@skaile/workspaces 3.21.0 → 3.22.1

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 +28 -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-74KGZA7R.js → chunk-AYOYM3R3.js} +3 -3
  9. package/dist/{chunk-74KGZA7R.js.map → chunk-AYOYM3R3.js.map} +1 -1
  10. package/dist/{chunk-PVVPGD7P.js → chunk-DAWQ22RW.js} +3 -3
  11. package/dist/{chunk-PVVPGD7P.js.map → chunk-DAWQ22RW.js.map} +1 -1
  12. package/dist/{chunk-AQJ5ZYD6.js → chunk-FBIETQGY.js} +3 -3
  13. package/dist/{chunk-AQJ5ZYD6.js.map → chunk-FBIETQGY.js.map} +1 -1
  14. package/dist/{chunk-DVSASEGO.js → chunk-K6VZQNTR.js} +2 -2
  15. package/dist/{chunk-DVSASEGO.js.map → chunk-K6VZQNTR.js.map} +1 -1
  16. package/dist/{chunk-OHLYKLGJ.js → chunk-MX6TGDZ7.js} +3 -3
  17. package/dist/{chunk-OHLYKLGJ.js.map → chunk-MX6TGDZ7.js.map} +1 -1
  18. package/dist/{chunk-CGLJHFQI.js → chunk-ORC2K2I7.js} +6 -6
  19. package/dist/{chunk-CGLJHFQI.js.map → chunk-ORC2K2I7.js.map} +1 -1
  20. package/dist/{chunk-FWFHCERM.js → chunk-SYHMXGLF.js} +62 -12
  21. package/dist/chunk-SYHMXGLF.js.map +1 -0
  22. package/dist/{chunk-DFELEIPJ.js → chunk-TDHG7F77.js} +3 -3
  23. package/dist/{chunk-DFELEIPJ.js.map → chunk-TDHG7F77.js.map} +1 -1
  24. package/dist/{chunk-EJ76MKTF.js → chunk-V7QZ7QIE.js} +2 -2
  25. package/dist/{chunk-EJ76MKTF.js.map → chunk-V7QZ7QIE.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/reply-routing.d.ts +44 -0
  42. package/dist/runner/src/reply-routing.d.ts.map +1 -0
  43. package/dist/runner/src/serve.d.ts.map +1 -1
  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-FWFHCERM.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-EJ76MKTF.js';
7
+ import { resolveFlowPath } from './chunk-V7QZ7QIE.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';
@@ -3925,6 +3925,16 @@ var DriverSwapGate = class {
3925
3925
  }
3926
3926
  };
3927
3927
 
3928
+ // runner/src/reply-routing.ts
3929
+ async function routeReply(deps) {
3930
+ const current = deps.getDriver();
3931
+ if (current.hasPendingQuestion()) {
3932
+ return current.answerQuestion(deps.answer, deps.question, deps.requestId) ? "answered" : "fresh-turn";
3933
+ }
3934
+ await deps.awaitSwap();
3935
+ return "fresh-turn";
3936
+ }
3937
+
3928
3938
  // runner/src/compaction/prompt.ts
3929
3939
  var DEFAULT_COMPACTION_PROMPT = `You are being asked to compact this conversation into a structured summary.
3930
3940
  This summary will replace the full conversation history when the session
@@ -6132,6 +6142,12 @@ async function startAgentServer(opts) {
6132
6142
  transport.send(event);
6133
6143
  }
6134
6144
  }
6145
+ let initAcknowledged = false;
6146
+ let initGeneration = 0;
6147
+ function emitInitAck(ack) {
6148
+ initAcknowledged = true;
6149
+ sendEvent(ack);
6150
+ }
6135
6151
  const capabilityRegistry = new CapabilityRegistry(
6136
6152
  createLogger({
6137
6153
  kind: "runner",
@@ -6468,9 +6484,16 @@ async function startAgentServer(opts) {
6468
6484
  }
6469
6485
  let resolveSessionReady;
6470
6486
  let rejectSessionReady;
6487
+ let sessionReadyOutcome = "pending";
6471
6488
  const sessionReady = new Promise((resolve5, reject) => {
6472
- resolveSessionReady = resolve5;
6473
- rejectSessionReady = reject;
6489
+ resolveSessionReady = () => {
6490
+ if (sessionReadyOutcome === "pending") sessionReadyOutcome = "resolved";
6491
+ resolve5();
6492
+ };
6493
+ rejectSessionReady = (err) => {
6494
+ if (sessionReadyOutcome === "pending") sessionReadyOutcome = "rejected";
6495
+ reject(err);
6496
+ };
6474
6497
  });
6475
6498
  let sessionConfig;
6476
6499
  let agentSession;
@@ -7028,6 +7051,7 @@ async function startAgentServer(opts) {
7028
7051
  }
7029
7052
  async function cleanup() {
7030
7053
  if (managedHost) managedBootstrapClosed = true;
7054
+ initAcknowledged = false;
7031
7055
  try {
7032
7056
  await Promise.race([
7033
7057
  sessionReady,
@@ -7416,7 +7440,9 @@ async function startAgentServer(opts) {
7416
7440
  }
7417
7441
  log(`[serve] runner.attach_instance staged skill(s): ${staged.join(", ")}`);
7418
7442
  const live = driverStarted;
7419
- await restartDriverForSkillChanges(staged.map((s) => ({ name: s, action: "add" })));
7443
+ scheduleDriverRestartForSkillChanges(
7444
+ staged.map((s) => ({ name: s, action: "add" }))
7445
+ );
7420
7446
  return { ok: true, id: name, live, toolCount: 0 };
7421
7447
  } catch (err) {
7422
7448
  return {
@@ -7460,9 +7486,18 @@ async function startAgentServer(opts) {
7460
7486
  }))
7461
7487
  });
7462
7488
  }
7489
+ function scheduleDriverRestartForSkillChanges(catalogActions) {
7490
+ void restartDriverForSkillChanges(catalogActions).catch((err) => {
7491
+ serverLog.warn(
7492
+ `[serve] background driver restart for skill changes failed: ${err instanceof Error ? err.message : String(err)}`
7493
+ );
7494
+ });
7495
+ }
7463
7496
  let runtimeRejected = false;
7464
7497
  async function handleSessionInit(cmd) {
7465
7498
  const initReceivedAt = Date.now();
7499
+ const thisInit = ++initGeneration;
7500
+ initAcknowledged = false;
7466
7501
  if (cmd.protocolVersion.major !== PROTOCOL_VERSION.major) {
7467
7502
  log(
7468
7503
  `[serve] incompatible protocol: agent=${PROTOCOL_VERSION.major} platform=${cmd.protocolVersion.major}`
@@ -7516,7 +7551,7 @@ async function startAgentServer(opts) {
7516
7551
  if (managedInitFingerprint) {
7517
7552
  if (managedInitFingerprint !== fingerprint) throw new Error("AI_PROFILE_INVALID");
7518
7553
  if (managedInitComplete)
7519
- sendEvent({
7554
+ emitInitAck({
7520
7555
  type: "session_init_ack",
7521
7556
  capabilitySignature: computeCapabilitySignature(capabilityRegistry.list())
7522
7557
  });
@@ -7573,7 +7608,7 @@ async function startAgentServer(opts) {
7573
7608
  }
7574
7609
  const resumeProbe = !managedCodex && cmd.resume?.sessionId ? await probeResumeTranscript(cmd.resume.sessionId) : void 0;
7575
7610
  if (!managedCodex)
7576
- sendEvent({
7611
+ emitInitAck({
7577
7612
  type: "session_init_ack",
7578
7613
  capabilitySignature: computeCapabilitySignature(capabilityRegistry.list()),
7579
7614
  ...resumeProbe ? { resumeProbe } : {}
@@ -7663,7 +7698,7 @@ async function startAgentServer(opts) {
7663
7698
  }
7664
7699
  if (managedBootstrapClosed || !driverStarted) throw new Error("CODEX_RUNTIME_UNSUPPORTED");
7665
7700
  managedInitComplete = true;
7666
- sendEvent({
7701
+ emitInitAck({
7667
7702
  type: "session_init_ack",
7668
7703
  capabilitySignature: computeCapabilitySignature(capabilityRegistry.list())
7669
7704
  });
@@ -7672,6 +7707,7 @@ async function startAgentServer(opts) {
7672
7707
  };
7673
7708
  void buildSession().catch((err) => {
7674
7709
  const errMsg = err instanceof Error ? err.message : String(err);
7710
+ if (thisInit === initGeneration) initAcknowledged = false;
7675
7711
  logPhase("session_ready", initReceivedAt, { ready: false });
7676
7712
  log(`[serve] session_init failed to build session: ${errMsg}`);
7677
7713
  sendEvent({ type: "error", message: errMsg, fatal: true });
@@ -7762,9 +7798,14 @@ async function startAgentServer(opts) {
7762
7798
  async function handleReply(cmd) {
7763
7799
  if (!await awaitSessionReadyOrFail()) return;
7764
7800
  log(`[serve] reply: ${cmd.answer.slice(0, 80)}...`);
7765
- await driverSwapGate.awaitSwap();
7766
- if (driver.hasPendingQuestion() && driver.answerQuestion(cmd.answer, cmd.question, cmd.requestId))
7767
- return;
7801
+ const routed = await routeReply({
7802
+ getDriver: () => driver,
7803
+ awaitSwap: () => driverSwapGate.awaitSwap(),
7804
+ answer: cmd.answer,
7805
+ question: cmd.question,
7806
+ requestId: cmd.requestId
7807
+ });
7808
+ if (routed === "answered") return;
7768
7809
  if (!driver.acceptsReplyAsPrompt) return;
7769
7810
  if (!await awaitCompactionIdle("reply")) return;
7770
7811
  const endTurn = driverSwapGate.beginTurn();
@@ -8102,6 +8143,15 @@ async function startAgentServer(opts) {
8102
8143
  transport.onCommand((cmd) => {
8103
8144
  void handleCommand(cmd);
8104
8145
  });
8146
+ transport.onConnect(() => {
8147
+ if (!initAcknowledged || sessionReadyOutcome === "rejected") return;
8148
+ serverLog.debug("[serve] replaying session_init_ack on connect");
8149
+ sendEvent({
8150
+ type: "session_init_ack",
8151
+ capabilitySignature: computeCapabilitySignature(capabilityRegistry.list()),
8152
+ replayed: true
8153
+ });
8154
+ });
8105
8155
  transport.onConnect(() => {
8106
8156
  sendEvent(turnStatus.snapshot());
8107
8157
  });
@@ -8320,5 +8370,5 @@ function touchSession(state) {
8320
8370
  }
8321
8371
 
8322
8372
  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 };
8323
- //# sourceMappingURL=chunk-FWFHCERM.js.map
8324
- //# sourceMappingURL=chunk-FWFHCERM.js.map
8373
+ //# sourceMappingURL=chunk-SYHMXGLF.js.map
8374
+ //# sourceMappingURL=chunk-SYHMXGLF.js.map