executor 1.2.4-beta.1 → 1.2.4-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -349,6 +349,7 @@ If you are exploring the repo, these are the directories that matter most:
349
349
  - One-time npm setup: either configure npm trusted publishing for `RhysSullivan/executor` with the workflow file `.github/workflows/publish-executor-package.yml`, or add a GitHub Actions secret named `NPM_TOKEN` that can publish the `executor` package.
350
350
  - Stable releases use a normal semver like `1.2.3` and publish to npm under `latest`.
351
351
  - Beta releases use a prerelease semver like `1.3.0-beta.1` and publish to npm under `beta`.
352
+ - When a release should become an upgrade test fixture, capture a real workspace snapshot with `bun run fixture:release:capture -- ...` and commit it under [`packages/platform/control-plane/src/runtime/__fixtures__`](./packages/platform/control-plane/src/runtime/__fixtures__/README.md).
352
353
 
353
354
  ## Project status
354
355
 
package/bin/executor.mjs CHANGED
@@ -324424,7 +324424,23 @@ var LocalSourceArtifactSchema = Struct({
324424
324424
  revision: StoredSourceCatalogRevisionRecordSchema,
324425
324425
  snapshot: CatalogSnapshotV1Schema
324426
324426
  });
324427
- var decodeLocalSourceArtifact = decodeUnknownSync(Union2(LocalSourceArtifactSchema, LegacyLocalSourceArtifactSchema));
324427
+ var ReadableLegacyLocalSourceArtifactSchema = Struct({
324428
+ version: Literal2(LEGACY_LOCAL_SOURCE_ARTIFACT_VERSION),
324429
+ sourceId: SourceIdSchema,
324430
+ catalogId: SourceCatalogIdSchema,
324431
+ generatedAt: TimestampMsSchema,
324432
+ revision: StoredSourceCatalogRevisionRecordSchema,
324433
+ snapshot: Unknown
324434
+ });
324435
+ var ReadableLocalSourceArtifactSchema = Struct({
324436
+ version: Literal2(LOCAL_SOURCE_ARTIFACT_VERSION),
324437
+ sourceId: SourceIdSchema,
324438
+ catalogId: SourceCatalogIdSchema,
324439
+ generatedAt: TimestampMsSchema,
324440
+ revision: StoredSourceCatalogRevisionRecordSchema,
324441
+ snapshot: Unknown
324442
+ });
324443
+ var decodeReadableLocalSourceArtifactOption = decodeUnknownOption(parseJson(Union2(ReadableLocalSourceArtifactSchema, ReadableLegacyLocalSourceArtifactSchema)));
324428
324444
  var normalizeLocalSourceArtifact = (artifact) => artifact.version === LOCAL_SOURCE_ARTIFACT_VERSION ? artifact : {
324429
324445
  ...artifact,
324430
324446
  version: LOCAL_SOURCE_ARTIFACT_VERSION
@@ -324480,6 +324496,13 @@ var hydrateArtifactSourceDocuments = (input) => {
324480
324496
  };
324481
324497
  var snapshotHash = (snapshot2) => contentHash(JSON.stringify(snapshot2));
324482
324498
  var importMetadataHash = (snapshot2) => contentHash(JSON.stringify(snapshot2.import));
324499
+ var decodeCatalogSnapshotV1Option = (snapshot2) => {
324500
+ try {
324501
+ return decodeCatalogSnapshotV1(snapshot2);
324502
+ } catch {
324503
+ return null;
324504
+ }
324505
+ };
324483
324506
  var buildLocalSourceArtifact = (input) => {
324484
324507
  const catalogId = stableSourceCatalogId(input.source);
324485
324508
  const generatedAt = Date.now();
@@ -324512,16 +324535,21 @@ var readLocalSourceArtifact = (input) => gen2(function* () {
324512
324535
  }
324513
324536
  const readPath = path4;
324514
324537
  const content = yield* fs.readFileString(readPath, "utf8").pipe(mapError2(mapFileSystemError2(readPath, "read source artifact")));
324515
- const artifact = yield* try_3({
324516
- try: () => decodeLocalSourceArtifact(JSON.parse(content)),
324517
- catch: (cause2) => new LocalSourceArtifactDecodeError({
324518
- message: `Invalid local source artifact at ${readPath}: ${unknownLocalErrorDetails(cause2)}`,
324519
- path: readPath,
324520
- details: unknownLocalErrorDetails(cause2)
324521
- })
324522
- }).pipe(map16(normalizeLocalSourceArtifact));
324538
+ const decodedArtifact = decodeReadableLocalSourceArtifactOption(content);
324539
+ if (isNone2(decodedArtifact)) {
324540
+ return null;
324541
+ }
324542
+ const artifact = normalizeLocalSourceArtifact(decodedArtifact.value);
324543
+ const snapshot2 = decodeCatalogSnapshotV1Option(artifact.snapshot);
324544
+ if (snapshot2 === null) {
324545
+ return null;
324546
+ }
324547
+ const decodedSnapshotArtifact = {
324548
+ ...artifact,
324549
+ snapshot: snapshot2
324550
+ };
324523
324551
  const rawDocuments = {};
324524
- for (const documentId of Object.keys(artifact.snapshot.catalog.documents)) {
324552
+ for (const documentId of Object.keys(decodedSnapshotArtifact.snapshot.catalog.documents)) {
324525
324553
  const sourceDocumentPath = localSourceDocumentPath({
324526
324554
  context: input.context,
324527
324555
  sourceId: input.sourceId,
@@ -324533,26 +324561,19 @@ var readLocalSourceArtifact = (input) => gen2(function* () {
324533
324561
  }
324534
324562
  const sourceContent = yield* fs.readFileString(sourceDocumentPath, "utf8").pipe(mapError2(mapFileSystemError2(sourceDocumentPath, "read source document")));
324535
324563
  rawDocuments[documentId] = {
324536
- sourceKind: artifact.snapshot.import.sourceKind,
324564
+ sourceKind: decodedSnapshotArtifact.snapshot.import.sourceKind,
324537
324565
  kind: "source_document",
324538
324566
  value: sourceContent
324539
324567
  };
324540
324568
  }
324541
324569
  const hydratedArtifact = Object.keys(rawDocuments).length > 0 ? hydrateArtifactSourceDocuments({
324542
- artifact,
324570
+ artifact: decodedSnapshotArtifact,
324543
324571
  rawDocuments
324544
- }) : artifact;
324545
- return yield* try_3({
324546
- try: () => ({
324547
- ...hydratedArtifact,
324548
- snapshot: decodeCatalogSnapshotV1(hydratedArtifact.snapshot)
324549
- }),
324550
- catch: (cause2) => new LocalSourceArtifactDecodeError({
324551
- message: `Invalid IR snapshot in local source artifact at ${readPath}: ${unknownLocalErrorDetails(cause2)}`,
324552
- path: readPath,
324553
- details: unknownLocalErrorDetails(cause2)
324554
- })
324555
- });
324572
+ }) : decodedSnapshotArtifact;
324573
+ return {
324574
+ ...hydratedArtifact,
324575
+ snapshot: hydratedArtifact.snapshot
324576
+ };
324556
324577
  });
324557
324578
  var writeLocalSourceArtifact = (input) => gen2(function* () {
324558
324579
  const fs = yield* exports_FileSystem.FileSystem;
@@ -364561,6 +364582,38 @@ var createLocalControlPlanePersistence = (context7, fileSystem) => ({
364561
364582
  close: async () => {}
364562
364583
  });
364563
364584
 
364585
+ // packages/platform/control-plane/src/runtime/catalog/source/reconcile.ts
364586
+ var shouldReconcileSource = (source2) => source2.enabled && source2.status === "connected" && getSourceAdapterForSource(source2).catalogKind !== "internal";
364587
+ var reconcileMissingSourceCatalogArtifacts = (input) => gen2(function* () {
364588
+ const runtimeLocalWorkspace = yield* RuntimeLocalWorkspaceService;
364589
+ const sourceStore = yield* RuntimeSourceStoreService;
364590
+ const sourceArtifactStore = yield* SourceArtifactStore;
364591
+ const sourceCatalogSync = yield* RuntimeSourceCatalogSyncService;
364592
+ const sources = yield* sourceStore.loadSourcesInWorkspace(input.workspaceId, {
364593
+ actorAccountId: input.actorAccountId
364594
+ });
364595
+ for (const source2 of sources) {
364596
+ if (!shouldReconcileSource(source2)) {
364597
+ continue;
364598
+ }
364599
+ const artifact = yield* sourceArtifactStore.read({
364600
+ context: runtimeLocalWorkspace.context,
364601
+ sourceId: source2.id
364602
+ });
364603
+ if (artifact !== null) {
364604
+ continue;
364605
+ }
364606
+ yield* sourceCatalogSync.sync({
364607
+ source: source2,
364608
+ actorAccountId: input.actorAccountId
364609
+ }).pipe(catchAll2(() => _void));
364610
+ }
364611
+ }).pipe(withSpan2("source.catalog.reconcile_missing", {
364612
+ attributes: {
364613
+ "executor.workspace.id": input.workspaceId
364614
+ }
364615
+ }));
364616
+
364564
364617
  // packages/platform/control-plane/src/runtime/execution/state.ts
364565
364618
  class ResumeUnsupportedError extends TaggedError("ResumeUnsupportedError") {
364566
364619
  }
@@ -364631,6 +364684,10 @@ var createControlPlaneRuntime = (options9) => gen2(function* () {
364631
364684
  });
364632
364685
  const managedRuntime = make85(concreteRuntimeLayer);
364633
364686
  yield* managedRuntime.runtimeEffect;
364687
+ yield* reconcileMissingSourceCatalogArtifacts({
364688
+ workspaceId: localInstallation.workspaceId,
364689
+ actorAccountId: localInstallation.accountId
364690
+ }).pipe(provide2(managedRuntime), catchAll2(() => _void));
364634
364691
  return {
364635
364692
  persistence,
364636
364693
  localInstallation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "executor",
3
- "version": "1.2.4-beta.1",
3
+ "version": "1.2.4-beta.3",
4
4
  "description": "Local AI executor with a CLI, local API server, and web UI.",
5
5
  "keywords": [
6
6
  "executor",
@@ -1 +1 @@
1
- import{r,R as c,M as p,B as x}from"./mermaid-O7DHMXV3-DLDVSK79.js";import{j as d}from"./index-CRuElBS1.js";var R=({code:i,language:e,raw:t,className:g,startLine:u,...m})=>{let{shikiTheme:o}=r.useContext(c),a=p(),[n,s]=r.useState(t);return r.useEffect(()=>{if(!a){s(t);return}let l=a.highlight({code:i,language:e,themes:o},h=>{s(h)});l&&s(l)},[i,e,o,a,t]),d.jsx(x,{className:g,language:e,result:n,startLine:u,...m})};export{R as HighlightedCodeBlockBody};
1
+ import{r,R as c,M as p,B as x}from"./mermaid-O7DHMXV3-B7TAupVN.js";import{j as d}from"./index-CRuElBS1.js";var R=({code:i,language:e,raw:t,className:g,startLine:u,...m})=>{let{shikiTheme:o}=r.useContext(c),a=p(),[n,s]=r.useState(t);return r.useEffect(()=>{if(!a){s(t);return}let l=a.highlight({code:i,language:e,themes:o},h=>{s(h)});l&&s(l)},[i,e,o,a,t]),d.jsx(x,{className:g,language:e,result:n,startLine:u,...m})};export{R as HighlightedCodeBlockBody};