History

move ir into kernel

Rhys Sullivan committed 7 months ago

Commit e2dcd001 parent b2b2e8023 files · +94 −32Browse files

Unified · Split

23 files
  1. bun.lock +17 −0
  2. packages/kernel/ir/README.md +3 −2
  3. packages/kernel/ir/package.json +27 −0
  4. packages/kernel/ir/src/catalog.test.ts +0 −0
  5. packages/kernel/ir/src/catalog.ts +0 −0
  6. packages/kernel/ir/src/ids.ts +0 −0
  7. packages/kernel/ir/src/index.ts +3 −0
  8. packages/kernel/ir/src/model.ts +0 −0
  9. packages/kernel/ir/tsconfig.json +15 −0
  10. packages/platform/control-plane/package.json +1 −0
  11. packages/platform/control-plane/src/index.ts +1 −1
  12. packages/platform/control-plane/src/ir/index.ts +1 −3
  13. packages/platform/control-plane/src/runtime/catalog/catalog-typescript.ts +3 −3
  14. packages/platform/control-plane/src/runtime/catalog/source-catalog-runtime.test.ts +3 −3
  15. packages/platform/control-plane/src/runtime/catalog/source-catalog-runtime.ts +2 −2
  16. packages/platform/control-plane/src/runtime/catalog/source-catalog-snapshot.ts +3 −3
  17. packages/platform/control-plane/src/runtime/catalog/source-catalog-support.ts +2 −2
  18. packages/platform/control-plane/src/runtime/catalog/source-type-declarations.test.ts +3 −3
  19. packages/platform/control-plane/src/runtime/catalog/source-type-declarations.ts +2 −2
  20. packages/platform/control-plane/src/runtime/execution/ir-execution.ts +2 −2
  21. packages/platform/control-plane/src/runtime/local/local-source-artifacts.ts +2 −2
  22. packages/platform/control-plane/src/runtime/sources/source-adapter-fixture-matrix.test.ts +2 −2
  23. packages/platform/control-plane/src/runtime/sources/source-adapters/mcp.test.ts +2 −2
bun.lock+17−0
@@ -228,6 +228,20 @@ · 227 unmodified lines
228 "vitest": "catalog:",228 "vitest": "catalog:",
229 },229 },
230 },230 },
231 "packages/kernel/ir": {
232 "name": "@executor/ir",
233 "version": "0.0.0",
234 "dependencies": {
235 "@executor/codemode-core": "workspace:*",
236 "effect": "catalog:",
237 },
238 "devDependencies": {
239 "@effect/vitest": "catalog:",
240 "@types/node": "catalog:",
241 "bun-types": "catalog:",
242 "vitest": "catalog:",
243 },
244 },
231 "packages/kernel/runtime-deno-subprocess": {245 "packages/kernel/runtime-deno-subprocess": {
232 "name": "@executor/runtime-deno-subprocess",246 "name": "@executor/runtime-deno-subprocess",
233 "version": "0.0.0",247 "version": "0.0.0",
@@ -279,6 +293,7 @@ · 45 unmodified lines
279 "@executor/codemode-google-discovery": "workspace:*",293 "@executor/codemode-google-discovery": "workspace:*",
280 "@executor/codemode-mcp": "workspace:*",294 "@executor/codemode-mcp": "workspace:*",
281 "@executor/codemode-openapi": "workspace:*",295 "@executor/codemode-openapi": "workspace:*",
296 "@executor/ir": "workspace:*",
282 "@executor/runtime-deno-subprocess": "workspace:*",297 "@executor/runtime-deno-subprocess": "workspace:*",
283 "@executor/runtime-quickjs": "workspace:*",298 "@executor/runtime-quickjs": "workspace:*",
284 "@executor/runtime-ses": "workspace:*",299 "@executor/runtime-ses": "workspace:*",
@@ -540,6 +555,8 @@ · 255 unmodified lines
540 555
541 "@executor/executor-mcp": ["@executor/executor-mcp@workspace:packages/hosts/mcp"],556 "@executor/executor-mcp": ["@executor/executor-mcp@workspace:packages/hosts/mcp"],
542 557
558 "@executor/ir": ["@executor/ir@workspace:packages/kernel/ir"],
559
543 "@executor/kitchen-sink": ["@executor/kitchen-sink@workspace:packages/dev/kitchen-sink"],560 "@executor/kitchen-sink": ["@executor/kitchen-sink@workspace:packages/dev/kitchen-sink"],
544 561
545 "@executor/mcp-elicitation-demo": ["@executor/mcp-elicitation-demo@workspace:apps/mcp-elicitation-demo"],562 "@executor/mcp-elicitation-demo": ["@executor/mcp-elicitation-demo@workspace:apps/mcp-elicitation-demo"],
packages/kernel/ir/README.mdrenamed from packages/platform/control-plane/src/ir/README.md+3−2
@@ -1,6 +1,6 @@
1# IR v11# IR v1
2 2
3`@executor/control-plane/ir` is the greenfield semantic center for imported sources.3`@executor/ir` is the greenfield semantic center for imported sources.
4 4
5## Boundary5## Boundary
6 6
@@ -21,7 +21,8 @@ The existing runtime-specific compiled payload blobs are no longer the target se · 14 unmodified lines
21 21
22Use either:22Use either:
23 23
24- `@executor/control-plane/ir`24- `@executor/ir`
25- `@executor/control-plane/ir` as a compatibility shim
25- `import { ir } from "@executor/control-plane"`26- `import { ir } from "@executor/control-plane"`
26 27
27## Guarantees28## Guarantees
packages/kernel/ir/package.json+27−0
@@ -0,0 +1,27 @@
1{
2 "name": "@executor/ir",
3 "private": true,
4 "type": "module",
5 "exports": {
6 ".": "./src/index.ts",
7 "./catalog": "./src/catalog.ts",
8 "./ids": "./src/ids.ts",
9 "./model": "./src/model.ts"
10 },
11 "scripts": {
12 "typecheck": "bunx tsc --noEmit -p tsconfig.json",
13 "test": "vitest run",
14 "test:watch": "vitest"
15 },
16 "dependencies": {
17 "@executor/codemode-core": "workspace:*",
18 "effect": "catalog:"
19 },
20 "devDependencies": {
21 "@effect/vitest": "catalog:",
22 "@types/node": "catalog:",
23 "bun-types": "catalog:",
24 "vitest": "catalog:"
25 },
26 "version": "0.0.0"
27}
packages/kernel/ir/src/catalog.test.tsrenamed from packages/platform/control-plane/src/ir/catalog.test.ts+0−0

File renamed without changes.

packages/kernel/ir/src/catalog.tsrenamed from packages/platform/control-plane/src/ir/catalog.ts+0−0

File renamed without changes.

packages/kernel/ir/src/ids.tsrenamed from packages/platform/control-plane/src/ir/ids.ts+0−0

File renamed without changes.

packages/kernel/ir/src/index.ts+3−0
@@ -0,0 +1,3 @@
1export * from "./ids";
2export * from "./model";
3export * from "./catalog";
packages/kernel/ir/src/model.tsrenamed from packages/platform/control-plane/src/ir/model.ts+0−0

File renamed without changes.

packages/kernel/ir/tsconfig.json+15−0
@@ -0,0 +1,15 @@
1{
2 "compilerOptions": {
3 "target": "ES2022",
4 "module": "ESNext",
5 "moduleResolution": "Bundler",
6 "strict": true,
7 "skipLibCheck": true,
8 "noEmit": true,
9 "lib": ["ES2022"],
10 "types": ["bun-types", "node"]
11 },
12 "include": [
13 "src/**/*.ts"
14 ]
15}
packages/platform/control-plane/package.json+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
24 24
25 "@executor/codemode-core": "workspace:*",25 "@executor/codemode-core": "workspace:*",
26 "@executor/codemode-google-discovery": "workspace:*",26 "@executor/codemode-google-discovery": "workspace:*",
27 "@executor/ir": "workspace:*",
27 "@executor/codemode-mcp": "workspace:*",28 "@executor/codemode-mcp": "workspace:*",
28 "@executor/codemode-openapi": "workspace:*",29 "@executor/codemode-openapi": "workspace:*",
29 "@executor/runtime-deno-subprocess": "workspace:*",30 "@executor/runtime-deno-subprocess": "workspace:*",
packages/platform/control-plane/src/index.ts+1−1
@@ -2,4 +2,4 @@ export * from "./schema/index"; · 1 unmodified line
2export * from "./api/index";2export * from "./api/index";
3export * from "./runtime/index";3export * from "./runtime/index";
4export * from "./client";4export * from "./client";
5export * as ir from "./ir/index";5export * as ir from "@executor/ir";
packages/platform/control-plane/src/ir/index.ts+1−3
@@ -1,3 +1 @@
1export * from "./ids";1export * from "@executor/ir";
2export * from "./model";
3export * from "./catalog";
packages/platform/control-plane/src/runtime/catalog/catalog-typescript.ts+3−3
@@ -1,8 +1,8 @@
1import { createHash } from "node:crypto";1import { createHash } from "node:crypto";
2 2
3import type { ProjectedCatalog } from "../../ir/catalog";3import type { ProjectedCatalog } from "@executor/ir/catalog";
4import type { ShapeSymbolId } from "../../ir/ids";4import type { ShapeSymbolId } from "@executor/ir/ids";
5import type { CatalogV1, ShapeNode, ShapeSymbol } from "../../ir/model";5import type { CatalogV1, ShapeNode, ShapeSymbol } from "@executor/ir/model";
6 6
7export type CatalogTypeRoot = {7export type CatalogTypeRoot = {
8 readonly shapeId: ShapeSymbolId;8 readonly shapeId: ShapeSymbolId;
packages/platform/control-plane/src/runtime/catalog/source-catalog-runtime.test.ts+3−3
@@ -17,7 +17,7 @@ import { · 16 unmodified lines
17 createCatalogSnapshotV1,17 createCatalogSnapshotV1,
18 createEmptyCatalogV1,18 createEmptyCatalogV1,
19 projectCatalogForAgentSdk,19 projectCatalogForAgentSdk,
20} from "../../ir/catalog";20} from "@executor/ir/catalog";
21import {21import {
22 CapabilityIdSchema,22 CapabilityIdSchema,
23 DocumentIdSchema,23 DocumentIdSchema,
@@ -26,8 +26,8 @@ import { · 2 unmodified lines
26 ResponseSetIdSchema,26 ResponseSetIdSchema,
27 ScopeIdSchema,27 ScopeIdSchema,
28 ShapeSymbolIdSchema,28 ShapeSymbolIdSchema,
29} from "../../ir/ids";29} from "@executor/ir/ids";
30import type { CatalogV1, ProvenanceRef } from "../../ir/model";30import type { CatalogV1, ProvenanceRef } from "@executor/ir/model";
31import {31import {
32 createCatalogTypeProjector,32 createCatalogTypeProjector,
33 formatTypeNameSegment,33 formatTypeNameSegment,
packages/platform/control-plane/src/runtime/catalog/source-catalog-runtime.ts+2−2
@@ -18,7 +18,7 @@ import { · 17 unmodified lines
18 decodeCatalogSnapshotV1,18 decodeCatalogSnapshotV1,
19 projectCatalogForAgentSdk,19 projectCatalogForAgentSdk,
20 type ProjectedCatalog,20 type ProjectedCatalog,
21} from "../../ir/catalog";21} from "@executor/ir/catalog";
22import type {22import type {
23 Capability,23 Capability,
24 CatalogSnapshotV1,24 CatalogSnapshotV1,
@@ -29,7 +29,7 @@ import type { · 4 unmodified lines
29 McpExecutable,29 McpExecutable,
30 ShapeSymbol,30 ShapeSymbol,
31 Symbol as IrSymbol,31 Symbol as IrSymbol,
32} from "../../ir/model";32} from "@executor/ir/model";
33import { LocalSourceArtifactMissingError } from "../local/local-errors";33import { LocalSourceArtifactMissingError } from "../local/local-errors";
34import {34import {
35 createCatalogTypeProjector,35 createCatalogTypeProjector,
packages/platform/control-plane/src/runtime/catalog/source-catalog-snapshot.ts+3−3
@@ -15,7 +15,7 @@ import type { Source } from "#schema"; · 14 unmodified lines
15 15
16import {16import {
17 createCatalogSnapshotV1FromFragments,17 createCatalogSnapshotV1FromFragments,
18} from "../../ir/catalog";18} from "@executor/ir/catalog";
19import {19import {
20 CapabilityIdSchema,20 CapabilityIdSchema,
21 DiagnosticIdSchema,21 DiagnosticIdSchema,
@@ -31,7 +31,7 @@ import { · 9 unmodified lines
31 ScopeIdSchema,31 ScopeIdSchema,
32 SecuritySchemeSymbolIdSchema,32 SecuritySchemeSymbolIdSchema,
33 ShapeSymbolIdSchema,33 ShapeSymbolIdSchema,
34} from "../../ir/ids";34} from "@executor/ir/ids";
35import type {35import type {
36 AuthRequirement,36 AuthRequirement,
37 Capability,37 Capability,
@@ -56,7 +56,7 @@ import type { · 18 unmodified lines
56 ShapeSymbol,56 ShapeSymbol,
57 SourceKind,57 SourceKind,
58 SourceDocument,58 SourceDocument,
59} from "../../ir/model";59} from "@executor/ir/model";
60import type { GraphqlToolProviderData } from "../sources/graphql-tools";60import type { GraphqlToolProviderData } from "../sources/graphql-tools";
61import { namespaceFromSourceName } from "../sources/source-names";61import { namespaceFromSourceName } from "../sources/source-names";
62 62
packages/platform/control-plane/src/runtime/catalog/source-catalog-support.ts+2−2
@@ -1,10 +1,10 @@
1import { sha256Hex } from "@executor/codemode-core";1import { sha256Hex } from "@executor/codemode-core";
2import { createCatalogSnapshotV1FromFragments } from "../../ir/catalog";2import { createCatalogSnapshotV1FromFragments } from "@executor/ir/catalog";
3import type {3import type {
4 CatalogFragmentV1,4 CatalogFragmentV1,
5 CatalogSnapshotV1,5 CatalogSnapshotV1,
6 ImportMetadata,6 ImportMetadata,
7} from "../../ir/model";7} from "@executor/ir/model";
8 8
9export const normalizeSearchText = (9export const normalizeSearchText = (
10 ...parts: ReadonlyArray<string | null | undefined>10 ...parts: ReadonlyArray<string | null | undefined>
packages/platform/control-plane/src/runtime/catalog/source-type-declarations.test.ts+3−3
@@ -13,7 +13,7 @@ import { · 12 unmodified lines
13import {13import {
14 createCatalogSnapshotV1,14 createCatalogSnapshotV1,
15 createEmptyCatalogV1,15 createEmptyCatalogV1,
16} from "../../ir/catalog";16} from "@executor/ir/catalog";
17import {17import {
18 CapabilityIdSchema,18 CapabilityIdSchema,
19 DocumentIdSchema,19 DocumentIdSchema,
@@ -22,8 +22,8 @@ import { · 2 unmodified lines
22 ResponseSetIdSchema,22 ResponseSetIdSchema,
23 ScopeIdSchema,23 ScopeIdSchema,
24 ShapeSymbolIdSchema,24 ShapeSymbolIdSchema,
25} from "../../ir/ids";25} from "@executor/ir/ids";
26import type { CatalogV1, GraphQLExecutable, ProvenanceRef } from "../../ir/model";26import type { CatalogV1, GraphQLExecutable, ProvenanceRef } from "@executor/ir/model";
27import { syncWorkspaceSourceTypeDeclarationsNode } from "./source-type-declarations";27import { syncWorkspaceSourceTypeDeclarationsNode } from "./source-type-declarations";
28 28
29const put = <K extends string, V>(record: Record<K, V>, key: K, value: V) => {29const put = <K extends string, V>(record: Record<K, V>, key: K, value: V) => {
packages/platform/control-plane/src/runtime/catalog/source-type-declarations.ts+2−2
@@ -6,8 +6,8 @@ import * as Cause from "effect/Cause"; · 5 unmodified lines
6import * as Effect from "effect/Effect";6import * as Effect from "effect/Effect";
7import * as Fiber from "effect/Fiber";7import * as Fiber from "effect/Fiber";
8 8
9import { projectCatalogForAgentSdk } from "../../ir/catalog";9import { projectCatalogForAgentSdk } from "@executor/ir/catalog";
10import type { CatalogSnapshotV1 } from "../../ir/model";10import type { CatalogSnapshotV1 } from "@executor/ir/model";
11import {11import {
12 createCatalogTypeProjector,12 createCatalogTypeProjector,
13 formatPropertyKey,13 formatPropertyKey,
packages/platform/control-plane/src/runtime/execution/ir-execution.ts+2−2
@@ -22,7 +22,7 @@ import type { · 21 unmodified lines
22 ToolInput,22 ToolInput,
23 ToolPath,23 ToolPath,
24} from "@executor/codemode-core";24} from "@executor/codemode-core";
25import { buildInvocationPlan, type InvocationPlan } from "../../ir/catalog";25import { buildInvocationPlan, type InvocationPlan } from "@executor/ir/catalog";
26import type {26import type {
27 CatalogV1,27 CatalogV1,
28 Capability,28 Capability,
@@ -32,7 +32,7 @@ import type { · 3 unmodified lines
32 McpExecutable,32 McpExecutable,
33 ParameterSymbol,33 ParameterSymbol,
34 Scope,34 Scope,
35} from "../../ir/model";35} from "@executor/ir/model";
36import type { LoadedSourceCatalogToolIndexEntry } from "../catalog/source-catalog-runtime";36import type { LoadedSourceCatalogToolIndexEntry } from "../catalog/source-catalog-runtime";
37import type { ResolvedSourceAuthMaterial } from "../auth/source-auth-material";37import type { ResolvedSourceAuthMaterial } from "../auth/source-auth-material";
38 38
packages/platform/control-plane/src/runtime/local/local-source-artifacts.ts+2−2
@@ -13,13 +13,13 @@ import { · 12 unmodified lines
13import * as Effect from "effect/Effect";13import * as Effect from "effect/Effect";
14import * as Schema from "effect/Schema";14import * as Schema from "effect/Schema";
15 15
16import { decodeCatalogSnapshotV1 } from "../../ir/catalog";16import { decodeCatalogSnapshotV1 } from "@executor/ir/catalog";
17import {17import {
18 CatalogSnapshotV1Schema,18 CatalogSnapshotV1Schema,
19 type CatalogSnapshotV1,19 type CatalogSnapshotV1,
20 type NativeBlob,20 type NativeBlob,
21 type SourceDocument,21 type SourceDocument,
22} from "../../ir/model";22} from "@executor/ir/model";
23import {23import {
24 contentHash,24 contentHash,
25 snapshotFromSourceCatalogSyncResult,25 snapshotFromSourceCatalogSyncResult,
packages/platform/control-plane/src/runtime/sources/source-adapter-fixture-matrix.test.ts+2−2
@@ -35,8 +35,8 @@ import { · 34 unmodified lines
35import * as Effect from "effect/Effect";35import * as Effect from "effect/Effect";
36import { Schema } from "effect";36import { Schema } from "effect";
37 37
38import { projectCatalogForAgentSdk } from "../../ir/catalog";38import { projectCatalogForAgentSdk } from "@executor/ir/catalog";
39import type { CatalogSnapshotV1 } from "../../ir/model";39import type { CatalogSnapshotV1 } from "@executor/ir/model";
40import { createCatalogTypeProjector, projectedCatalogTypeRoots } from "../catalog/catalog-typescript";40import { createCatalogTypeProjector, projectedCatalogTypeRoots } from "../catalog/catalog-typescript";
41import {41import {
42 buildGraphqlToolPresentation,42 buildGraphqlToolPresentation,
packages/platform/control-plane/src/runtime/sources/source-adapters/mcp.test.ts+2−2
@@ -19,8 +19,8 @@ import type { · 18 unmodified lines
19import * as Effect from "effect/Effect";19import * as Effect from "effect/Effect";
20import { z } from "zod/v4";20import { z } from "zod/v4";
21 21
22import { projectCatalogForAgentSdk } from "../../../ir/catalog";22import { projectCatalogForAgentSdk } from "@executor/ir/catalog";
23import type { CatalogSnapshotV1 } from "../../../ir/model";23import type { CatalogSnapshotV1 } from "@executor/ir/model";
24import { createCatalogTypeProjector, projectedCatalogTypeRoots } from "../../catalog/catalog-typescript";24import { createCatalogTypeProjector, projectedCatalogTypeRoots } from "../../catalog/catalog-typescript";
25import { invokeIrTool } from "../../execution/ir-execution";25import { invokeIrTool } from "../../execution/ir-execution";
26import {26import {