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
228228 "vitest": "catalog:",
229229 },
230230 },
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+ },
231245 "packages/kernel/runtime-deno-subprocess": {
232246 "name": "@executor/runtime-deno-subprocess",
233247 "version": "0.0.0",
@@ -279,6 +293,7 @@ · 45 unmodified lines
279293 "@executor/codemode-google-discovery": "workspace:*",
280294 "@executor/codemode-mcp": "workspace:*",
281295 "@executor/codemode-openapi": "workspace:*",
296+ "@executor/ir": "workspace:*",
282297 "@executor/runtime-deno-subprocess": "workspace:*",
283298 "@executor/runtime-quickjs": "workspace:*",
284299 "@executor/runtime-ses": "workspace:*",
@@ -540,6 +555,8 @@ · 255 unmodified lines
540555
541556 "@executor/executor-mcp": ["@executor/executor-mcp@workspace:packages/hosts/mcp"],
542557
558+ "@executor/ir": ["@executor/ir@workspace:packages/kernel/ir"],
559+
543560 "@executor/kitchen-sink": ["@executor/kitchen-sink@workspace:packages/dev/kitchen-sink"],
544561
545562 "@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 @@
11 # IR v1
22
3−`@executor/control-plane/ir` is the greenfield semantic center for imported sources.
3+`@executor/ir` is the greenfield semantic center for imported sources.
44
55 ## Boundary
66
@@ -21,7 +21,8 @@ The existing runtime-specific compiled payload blobs are no longer the target se · 14 unmodified lines
2121
2222 Use either:
2323
24−- `@executor/control-plane/ir`
24+- `@executor/ir`
25+- `@executor/control-plane/ir` as a compatibility shim
2526 - `import { ir } from "@executor/control-plane"`
2627
2728 ## 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 @@
1+export * from "./ids";
2+export * from "./model";
3+export * 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
2424
2525 "@executor/codemode-core": "workspace:*",
2626 "@executor/codemode-google-discovery": "workspace:*",
27+ "@executor/ir": "workspace:*",
2728 "@executor/codemode-mcp": "workspace:*",
2829 "@executor/codemode-openapi": "workspace:*",
2930 "@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
22 export * from "./api/index";
33 export * from "./runtime/index";
44 export * from "./client";
5−export * as ir from "./ir/index";
5+export * as ir from "@executor/ir";
packages/platform/control-plane/src/ir/index.ts+1−3
@@ -1,3 +1 @@
1−export * from "./ids";
2−export * from "./model";
3−export * from "./catalog";
1+export * from "@executor/ir";
packages/platform/control-plane/src/runtime/catalog/catalog-typescript.ts+3−3
@@ -1,8 +1,8 @@
11 import { createHash } from "node:crypto";
22
3−import type { ProjectedCatalog } from "../../ir/catalog";
4−import type { ShapeSymbolId } from "../../ir/ids";
5−import type { CatalogV1, ShapeNode, ShapeSymbol } from "../../ir/model";
3+import type { ProjectedCatalog } from "@executor/ir/catalog";
4+import type { ShapeSymbolId } from "@executor/ir/ids";
5+import type { CatalogV1, ShapeNode, ShapeSymbol } from "@executor/ir/model";
66
77 export type CatalogTypeRoot = {
88 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
1717 createCatalogSnapshotV1,
1818 createEmptyCatalogV1,
1919 projectCatalogForAgentSdk,
20−} from "../../ir/catalog";
20+} from "@executor/ir/catalog";
2121 import {
2222 CapabilityIdSchema,
2323 DocumentIdSchema,
@@ -26,8 +26,8 @@ import { · 2 unmodified lines
2626 ResponseSetIdSchema,
2727 ScopeIdSchema,
2828 ShapeSymbolIdSchema,
29−} from "../../ir/ids";
30−import type { CatalogV1, ProvenanceRef } from "../../ir/model";
29+} from "@executor/ir/ids";
30+import type { CatalogV1, ProvenanceRef } from "@executor/ir/model";
3131 import {
3232 createCatalogTypeProjector,
3333 formatTypeNameSegment,
packages/platform/control-plane/src/runtime/catalog/source-catalog-runtime.ts+2−2
@@ -18,7 +18,7 @@ import { · 17 unmodified lines
1818 decodeCatalogSnapshotV1,
1919 projectCatalogForAgentSdk,
2020 type ProjectedCatalog,
21−} from "../../ir/catalog";
21+} from "@executor/ir/catalog";
2222 import type {
2323 Capability,
2424 CatalogSnapshotV1,
@@ -29,7 +29,7 @@ import type { · 4 unmodified lines
2929 McpExecutable,
3030 ShapeSymbol,
3131 Symbol as IrSymbol,
32−} from "../../ir/model";
32+} from "@executor/ir/model";
3333 import { LocalSourceArtifactMissingError } from "../local/local-errors";
3434 import {
3535 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
1515
1616 import {
1717 createCatalogSnapshotV1FromFragments,
18−} from "../../ir/catalog";
18+} from "@executor/ir/catalog";
1919 import {
2020 CapabilityIdSchema,
2121 DiagnosticIdSchema,
@@ -31,7 +31,7 @@ import { · 9 unmodified lines
3131 ScopeIdSchema,
3232 SecuritySchemeSymbolIdSchema,
3333 ShapeSymbolIdSchema,
34−} from "../../ir/ids";
34+} from "@executor/ir/ids";
3535 import type {
3636 AuthRequirement,
3737 Capability,
@@ -56,7 +56,7 @@ import type { · 18 unmodified lines
5656 ShapeSymbol,
5757 SourceKind,
5858 SourceDocument,
59−} from "../../ir/model";
59+} from "@executor/ir/model";
6060 import type { GraphqlToolProviderData } from "../sources/graphql-tools";
6161 import { namespaceFromSourceName } from "../sources/source-names";
6262
packages/platform/control-plane/src/runtime/catalog/source-catalog-support.ts+2−2
@@ -1,10 +1,10 @@
11 import { sha256Hex } from "@executor/codemode-core";
2−import { createCatalogSnapshotV1FromFragments } from "../../ir/catalog";
2+import { createCatalogSnapshotV1FromFragments } from "@executor/ir/catalog";
33 import type {
44 CatalogFragmentV1,
55 CatalogSnapshotV1,
66 ImportMetadata,
7−} from "../../ir/model";
7+} from "@executor/ir/model";
88
99 export const normalizeSearchText = (
1010 ...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
1313 import {
1414 createCatalogSnapshotV1,
1515 createEmptyCatalogV1,
16−} from "../../ir/catalog";
16+} from "@executor/ir/catalog";
1717 import {
1818 CapabilityIdSchema,
1919 DocumentIdSchema,
@@ -22,8 +22,8 @@ import { · 2 unmodified lines
2222 ResponseSetIdSchema,
2323 ScopeIdSchema,
2424 ShapeSymbolIdSchema,
25−} from "../../ir/ids";
26−import type { CatalogV1, GraphQLExecutable, ProvenanceRef } from "../../ir/model";
25+} from "@executor/ir/ids";
26+import type { CatalogV1, GraphQLExecutable, ProvenanceRef } from "@executor/ir/model";
2727 import { syncWorkspaceSourceTypeDeclarationsNode } from "./source-type-declarations";
2828
2929 const 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
66 import * as Effect from "effect/Effect";
77 import * as Fiber from "effect/Fiber";
88
9−import { projectCatalogForAgentSdk } from "../../ir/catalog";
10−import type { CatalogSnapshotV1 } from "../../ir/model";
9+import { projectCatalogForAgentSdk } from "@executor/ir/catalog";
10+import type { CatalogSnapshotV1 } from "@executor/ir/model";
1111 import {
1212 createCatalogTypeProjector,
1313 formatPropertyKey,
packages/platform/control-plane/src/runtime/execution/ir-execution.ts+2−2
@@ -22,7 +22,7 @@ import type { · 21 unmodified lines
2222 ToolInput,
2323 ToolPath,
2424 } from "@executor/codemode-core";
25−import { buildInvocationPlan, type InvocationPlan } from "../../ir/catalog";
25+import { buildInvocationPlan, type InvocationPlan } from "@executor/ir/catalog";
2626 import type {
2727 CatalogV1,
2828 Capability,
@@ -32,7 +32,7 @@ import type { · 3 unmodified lines
3232 McpExecutable,
3333 ParameterSymbol,
3434 Scope,
35−} from "../../ir/model";
35+} from "@executor/ir/model";
3636 import type { LoadedSourceCatalogToolIndexEntry } from "../catalog/source-catalog-runtime";
3737 import type { ResolvedSourceAuthMaterial } from "../auth/source-auth-material";
3838
packages/platform/control-plane/src/runtime/local/local-source-artifacts.ts+2−2
@@ -13,13 +13,13 @@ import { · 12 unmodified lines
1313 import * as Effect from "effect/Effect";
1414 import * as Schema from "effect/Schema";
1515
16−import { decodeCatalogSnapshotV1 } from "../../ir/catalog";
16+import { decodeCatalogSnapshotV1 } from "@executor/ir/catalog";
1717 import {
1818 CatalogSnapshotV1Schema,
1919 type CatalogSnapshotV1,
2020 type NativeBlob,
2121 type SourceDocument,
22−} from "../../ir/model";
22+} from "@executor/ir/model";
2323 import {
2424 contentHash,
2525 snapshotFromSourceCatalogSyncResult,
packages/platform/control-plane/src/runtime/sources/source-adapter-fixture-matrix.test.ts+2−2
@@ -35,8 +35,8 @@ import { · 34 unmodified lines
3535 import * as Effect from "effect/Effect";
3636 import { Schema } from "effect";
3737
38−import { projectCatalogForAgentSdk } from "../../ir/catalog";
39−import type { CatalogSnapshotV1 } from "../../ir/model";
38+import { projectCatalogForAgentSdk } from "@executor/ir/catalog";
39+import type { CatalogSnapshotV1 } from "@executor/ir/model";
4040 import { createCatalogTypeProjector, projectedCatalogTypeRoots } from "../catalog/catalog-typescript";
4141 import {
4242 buildGraphqlToolPresentation,
packages/platform/control-plane/src/runtime/sources/source-adapters/mcp.test.ts+2−2
@@ -19,8 +19,8 @@ import type { · 18 unmodified lines
1919 import * as Effect from "effect/Effect";
2020 import { z } from "zod/v4";
2121
22−import { projectCatalogForAgentSdk } from "../../../ir/catalog";
23−import type { CatalogSnapshotV1 } from "../../../ir/model";
22+import { projectCatalogForAgentSdk } from "@executor/ir/catalog";
23+import type { CatalogSnapshotV1 } from "@executor/ir/model";
2424 import { createCatalogTypeProjector, projectedCatalogTypeRoots } from "../../catalog/catalog-typescript";
2525 import { invokeIrTool } from "../../execution/ir-execution";
2626 import {