@skaile/workspaces 3.20.1 → 3.22.0

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{asset-feeds-V4DZPOVS.js → asset-feeds-6EETZDHH.js} +4 -4
  3. package/dist/{asset-feeds-V4DZPOVS.js.map → asset-feeds-6EETZDHH.js.map} +1 -1
  4. package/dist/asset-manager/index.js +3 -3
  5. package/dist/asset-manager/installer.js +2 -2
  6. package/dist/asset-manager/renderers.js +1 -1
  7. package/dist/asset-manager/src/renderers.d.ts.map +1 -1
  8. package/dist/{chunk-RQ6YLAXF.js → chunk-AA3ZFPWX.js} +2 -2
  9. package/dist/{chunk-RQ6YLAXF.js.map → chunk-AA3ZFPWX.js.map} +1 -1
  10. package/dist/{chunk-74KGZA7R.js → chunk-AYOYM3R3.js} +3 -3
  11. package/dist/{chunk-74KGZA7R.js.map → chunk-AYOYM3R3.js.map} +1 -1
  12. package/dist/{chunk-PVVPGD7P.js → chunk-DAWQ22RW.js} +3 -3
  13. package/dist/{chunk-PVVPGD7P.js.map → chunk-DAWQ22RW.js.map} +1 -1
  14. package/dist/{chunk-AQJ5ZYD6.js → chunk-FBIETQGY.js} +3 -3
  15. package/dist/{chunk-AQJ5ZYD6.js.map → chunk-FBIETQGY.js.map} +1 -1
  16. package/dist/{chunk-HKKTVD45.js → chunk-FXHBHT75.js} +64 -8
  17. package/dist/chunk-FXHBHT75.js.map +1 -0
  18. package/dist/{chunk-DVSASEGO.js → chunk-K6VZQNTR.js} +2 -2
  19. package/dist/{chunk-DVSASEGO.js.map → chunk-K6VZQNTR.js.map} +1 -1
  20. package/dist/{chunk-OHLYKLGJ.js → chunk-MX6TGDZ7.js} +3 -3
  21. package/dist/{chunk-OHLYKLGJ.js.map → chunk-MX6TGDZ7.js.map} +1 -1
  22. package/dist/{chunk-CGLJHFQI.js → chunk-ORC2K2I7.js} +6 -6
  23. package/dist/{chunk-CGLJHFQI.js.map → chunk-ORC2K2I7.js.map} +1 -1
  24. package/dist/{chunk-DFELEIPJ.js → chunk-TDHG7F77.js} +3 -3
  25. package/dist/{chunk-DFELEIPJ.js.map → chunk-TDHG7F77.js.map} +1 -1
  26. package/dist/{chunk-5JTA7HNJ.js → chunk-ZMV3VFDF.js} +6 -6
  27. package/dist/{chunk-5JTA7HNJ.js.map → chunk-ZMV3VFDF.js.map} +1 -1
  28. package/dist/cli/index.js +26 -26
  29. package/dist/{ensure-sources-HXAPBBA5.js → ensure-sources-LLUFYDS6.js} +6 -6
  30. package/dist/{ensure-sources-HXAPBBA5.js.map → ensure-sources-LLUFYDS6.js.map} +1 -1
  31. package/dist/factory-assets/connectors/flow/run-flow.js +1 -1
  32. package/dist/{helpers-3VAE3TYQ.js → helpers-QCDU5PSM.js} +6 -6
  33. package/dist/{helpers-3VAE3TYQ.js.map → helpers-QCDU5PSM.js.map} +1 -1
  34. package/dist/{library-publish-Z7QQDGOL.js → library-publish-ZKA7VRVX.js} +8 -8
  35. package/dist/{library-publish-Z7QQDGOL.js.map → library-publish-ZKA7VRVX.js.map} +1 -1
  36. package/dist/{open-library-424UBGA7.js → open-library-JSP4TJJH.js} +7 -7
  37. package/dist/{open-library-424UBGA7.js.map → open-library-JSP4TJJH.js.map} +1 -1
  38. package/dist/{project-HLSVZVAF.js → project-6WVN7M7B.js} +7 -7
  39. package/dist/{project-HLSVZVAF.js.map → project-6WVN7M7B.js.map} +1 -1
  40. package/dist/runner/index.js +2 -2
  41. package/dist/runner/src/serve.d.ts.map +1 -1
  42. package/dist/runner/src/turn-status-replay.d.ts +19 -0
  43. package/dist/runner/src/turn-status-replay.d.ts.map +1 -0
  44. package/dist/sdk/asset-manager.js +3 -3
  45. package/dist/sdk/index.js +2 -2
  46. package/dist/sdk/runner.js +2 -2
  47. package/dist/{source-SWZRKTKL.js → source-KC2IJYXJ.js} +8 -8
  48. package/dist/{source-SWZRKTKL.js.map → source-KC2IJYXJ.js.map} +1 -1
  49. package/dist/{source-manifest-publish-XBRXFOHO.js → source-manifest-publish-OLSWFW7L.js} +9 -9
  50. package/dist/{source-manifest-publish-XBRXFOHO.js.map → source-manifest-publish-OLSWFW7L.js.map} +1 -1
  51. package/dist/tui/index.js +2 -2
  52. package/dist/types/src/lifecycle.d.ts +12 -1
  53. package/dist/types/src/lifecycle.d.ts.map +1 -1
  54. package/package.json +1 -1
  55. package/dist/chunk-HKKTVD45.js.map +0 -1
@@ -4,7 +4,7 @@ import { WorkspacePlugin } from './chunk-IUOXPQA3.js';
4
4
  import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
5
5
  import { WebSocketServerTransport } from './chunk-WQ7DE5UC.js';
6
6
  import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-T3YLZQS4.js';
7
- import { resolveFlowPath } from './chunk-RQ6YLAXF.js';
7
+ import { resolveFlowPath } from './chunk-AA3ZFPWX.js';
8
8
  import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-7BUZQVRR.js';
9
9
  import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-PLLVREB2.js';
10
10
  import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, isKnownSecretRef, deriveSingleMaterializedConnectorDeclaration } from './chunk-SIREWRZE.js';
@@ -5366,6 +5366,29 @@ function createSessionStimulusBus(opts) {
5366
5366
  };
5367
5367
  }
5368
5368
 
5369
+ // runner/src/turn-status-replay.ts
5370
+ var TurnStatusTracker = class {
5371
+ phase = null;
5372
+ /** Feed every outbound event — connected or not — before it is sent. */
5373
+ observe(event) {
5374
+ switch (event.type) {
5375
+ case "status":
5376
+ this.phase = event.phase === "idle" ? null : event.phase;
5377
+ return;
5378
+ case "finished":
5379
+ case "error":
5380
+ this.phase = null;
5381
+ return;
5382
+ default:
5383
+ return;
5384
+ }
5385
+ }
5386
+ /** The `status` event that reproduces the current turn state on a fresh connect. */
5387
+ snapshot() {
5388
+ return { type: "status", phase: this.phase ?? "idle" };
5389
+ }
5390
+ };
5391
+
5369
5392
  // runner/src/serve.ts
5370
5393
  function getSessionCatalogEntries(session) {
5371
5394
  return session?.runtimeAssets?.catalogEntries ?? [];
@@ -6102,11 +6125,19 @@ async function startAgentServer(opts) {
6102
6125
  }
6103
6126
  })
6104
6127
  );
6128
+ const turnStatus = new TurnStatusTracker();
6105
6129
  function sendEvent(event) {
6130
+ turnStatus.observe(event);
6106
6131
  if (transport.connected) {
6107
6132
  transport.send(event);
6108
6133
  }
6109
6134
  }
6135
+ let initAcknowledged = false;
6136
+ let initGeneration = 0;
6137
+ function emitInitAck(ack) {
6138
+ initAcknowledged = true;
6139
+ sendEvent(ack);
6140
+ }
6110
6141
  const capabilityRegistry = new CapabilityRegistry(
6111
6142
  createLogger({
6112
6143
  kind: "runner",
@@ -6443,9 +6474,16 @@ async function startAgentServer(opts) {
6443
6474
  }
6444
6475
  let resolveSessionReady;
6445
6476
  let rejectSessionReady;
6477
+ let sessionReadyOutcome = "pending";
6446
6478
  const sessionReady = new Promise((resolve5, reject) => {
6447
- resolveSessionReady = resolve5;
6448
- rejectSessionReady = reject;
6479
+ resolveSessionReady = () => {
6480
+ if (sessionReadyOutcome === "pending") sessionReadyOutcome = "resolved";
6481
+ resolve5();
6482
+ };
6483
+ rejectSessionReady = (err) => {
6484
+ if (sessionReadyOutcome === "pending") sessionReadyOutcome = "rejected";
6485
+ reject(err);
6486
+ };
6449
6487
  });
6450
6488
  let sessionConfig;
6451
6489
  let agentSession;
@@ -7003,6 +7041,7 @@ async function startAgentServer(opts) {
7003
7041
  }
7004
7042
  async function cleanup() {
7005
7043
  if (managedHost) managedBootstrapClosed = true;
7044
+ initAcknowledged = false;
7006
7045
  try {
7007
7046
  await Promise.race([
7008
7047
  sessionReady,
@@ -7438,6 +7477,8 @@ async function startAgentServer(opts) {
7438
7477
  let runtimeRejected = false;
7439
7478
  async function handleSessionInit(cmd) {
7440
7479
  const initReceivedAt = Date.now();
7480
+ const thisInit = ++initGeneration;
7481
+ initAcknowledged = false;
7441
7482
  if (cmd.protocolVersion.major !== PROTOCOL_VERSION.major) {
7442
7483
  log(
7443
7484
  `[serve] incompatible protocol: agent=${PROTOCOL_VERSION.major} platform=${cmd.protocolVersion.major}`
@@ -7491,7 +7532,7 @@ async function startAgentServer(opts) {
7491
7532
  if (managedInitFingerprint) {
7492
7533
  if (managedInitFingerprint !== fingerprint) throw new Error("AI_PROFILE_INVALID");
7493
7534
  if (managedInitComplete)
7494
- sendEvent({
7535
+ emitInitAck({
7495
7536
  type: "session_init_ack",
7496
7537
  capabilitySignature: computeCapabilitySignature(capabilityRegistry.list())
7497
7538
  });
@@ -7548,7 +7589,7 @@ async function startAgentServer(opts) {
7548
7589
  }
7549
7590
  const resumeProbe = !managedCodex && cmd.resume?.sessionId ? await probeResumeTranscript(cmd.resume.sessionId) : void 0;
7550
7591
  if (!managedCodex)
7551
- sendEvent({
7592
+ emitInitAck({
7552
7593
  type: "session_init_ack",
7553
7594
  capabilitySignature: computeCapabilitySignature(capabilityRegistry.list()),
7554
7595
  ...resumeProbe ? { resumeProbe } : {}
@@ -7638,7 +7679,7 @@ async function startAgentServer(opts) {
7638
7679
  }
7639
7680
  if (managedBootstrapClosed || !driverStarted) throw new Error("CODEX_RUNTIME_UNSUPPORTED");
7640
7681
  managedInitComplete = true;
7641
- sendEvent({
7682
+ emitInitAck({
7642
7683
  type: "session_init_ack",
7643
7684
  capabilitySignature: computeCapabilitySignature(capabilityRegistry.list())
7644
7685
  });
@@ -7647,6 +7688,7 @@ async function startAgentServer(opts) {
7647
7688
  };
7648
7689
  void buildSession().catch((err) => {
7649
7690
  const errMsg = err instanceof Error ? err.message : String(err);
7691
+ if (thisInit === initGeneration) initAcknowledged = false;
7650
7692
  logPhase("session_ready", initReceivedAt, { ready: false });
7651
7693
  log(`[serve] session_init failed to build session: ${errMsg}`);
7652
7694
  sendEvent({ type: "error", message: errMsg, fatal: true });
@@ -7704,6 +7746,8 @@ async function startAgentServer(opts) {
7704
7746
  const errMsg = err instanceof Error ? err.message : String(err);
7705
7747
  log(`[serve] flow user-message turn failed: ${errMsg}`);
7706
7748
  sendEvent({ type: "error", message: `Flow turn failed: ${errMsg}`, fatal: false });
7749
+ } finally {
7750
+ sendEvent({ type: "status", phase: "idle" });
7707
7751
  }
7708
7752
  return;
7709
7753
  }
@@ -8075,6 +8119,18 @@ async function startAgentServer(opts) {
8075
8119
  transport.onCommand((cmd) => {
8076
8120
  void handleCommand(cmd);
8077
8121
  });
8122
+ transport.onConnect(() => {
8123
+ if (!initAcknowledged || sessionReadyOutcome === "rejected") return;
8124
+ serverLog.debug("[serve] replaying session_init_ack on connect");
8125
+ sendEvent({
8126
+ type: "session_init_ack",
8127
+ capabilitySignature: computeCapabilitySignature(capabilityRegistry.list()),
8128
+ replayed: true
8129
+ });
8130
+ });
8131
+ transport.onConnect(() => {
8132
+ sendEvent(turnStatus.snapshot());
8133
+ });
8078
8134
  transport.onConnect(() => {
8079
8135
  if (managedHost && !managedBootstrapClosed)
8080
8136
  sendEvent({
@@ -8290,5 +8346,5 @@ function touchSession(state) {
8290
8346
  }
8291
8347
 
8292
8348
  export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, MOUNT_LIST_MAX_DEPTH, MOUNT_LIST_MAX_ENTRIES, MOUNT_READ_DEADLINE_FACTOR, MOUNT_TREE_OP_DEADLINE_FACTOR, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildStoreSnapshotReplay, builtinCapabilities, capabilityLogInstance, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, connectorRefreshKind, createAgentSession, createFlowConnectorReadiness, createManagedCodexSubpromptDriver, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, hasNonTerminalFlow, hostOpResumeStimulus, installPreInitRingSink, isTerminalFlowStatus, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadManagedCodexHostConfig, loadSession, loadSessionById, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveMixin, runAgentChat, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, supportsLiveToolUpdates, touchSession, validateInputResponse, writeClaudeCodeCredentialsFile };
8293
- //# sourceMappingURL=chunk-HKKTVD45.js.map
8294
- //# sourceMappingURL=chunk-HKKTVD45.js.map
8349
+ //# sourceMappingURL=chunk-FXHBHT75.js.map
8350
+ //# sourceMappingURL=chunk-FXHBHT75.js.map