@skaile/workspaces 4.9.2 → 4.9.4

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 (140) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{asset-feeds-ZKMRNVV2.js → asset-feeds-WHWQJOAQ.js} +5 -5
  3. package/dist/{asset-feeds-ZKMRNVV2.js.map → asset-feeds-WHWQJOAQ.js.map} +1 -1
  4. package/dist/asset-manager/catalog-deployer.js +1 -1
  5. package/dist/asset-manager/index.js +2 -2
  6. package/dist/asset-manager/installer.js +1 -1
  7. package/dist/bridge/drivers/claude-sdk.js +3 -3
  8. package/dist/bridge/drivers/codex.js +4 -4
  9. package/dist/bridge/drivers/continue.js +3 -3
  10. package/dist/bridge/drivers/echo.js +2 -2
  11. package/dist/bridge/drivers/gemini.js +5 -5
  12. package/dist/bridge/drivers/goose.js +3 -3
  13. package/dist/bridge/drivers/omp.js +2 -2
  14. package/dist/bridge/drivers/opencode.js +3 -3
  15. package/dist/bridge/drivers/qwen.js +5 -5
  16. package/dist/bridge/index.js +4 -4
  17. package/dist/{chunk-45LLHKQ2.js → chunk-2HUQUTJ3.js} +3 -3
  18. package/dist/{chunk-45LLHKQ2.js.map → chunk-2HUQUTJ3.js.map} +1 -1
  19. package/dist/{chunk-OZAF24OQ.js → chunk-3BDWW7OE.js} +6 -6
  20. package/dist/{chunk-OZAF24OQ.js.map → chunk-3BDWW7OE.js.map} +1 -1
  21. package/dist/{chunk-FTG7CRFD.js → chunk-3HKYCT2M.js} +69 -6
  22. package/dist/chunk-3HKYCT2M.js.map +1 -0
  23. package/dist/{chunk-6YIFJW2I.js → chunk-5HZWDH3L.js} +88 -67
  24. package/dist/chunk-5HZWDH3L.js.map +1 -0
  25. package/dist/{chunk-7ZYKHL6Y.js → chunk-7F4FGEMI.js} +3 -3
  26. package/dist/{chunk-7ZYKHL6Y.js.map → chunk-7F4FGEMI.js.map} +1 -1
  27. package/dist/{chunk-5VKBD3QV.js → chunk-FTSXFA7P.js} +5 -5
  28. package/dist/{chunk-5VKBD3QV.js.map → chunk-FTSXFA7P.js.map} +1 -1
  29. package/dist/{chunk-5YB4GYMB.js → chunk-HRVXHRL4.js} +225 -39
  30. package/dist/chunk-HRVXHRL4.js.map +1 -0
  31. package/dist/{chunk-NHZR3NVY.js → chunk-KQTMJP3X.js} +3 -3
  32. package/dist/{chunk-NHZR3NVY.js.map → chunk-KQTMJP3X.js.map} +1 -1
  33. package/dist/{chunk-QBH7PC4D.js → chunk-LDQB5VEC.js} +2 -2
  34. package/dist/{chunk-QBH7PC4D.js.map → chunk-LDQB5VEC.js.map} +1 -1
  35. package/dist/{chunk-TLMDSUEL.js → chunk-OIXSGSKM.js} +3 -3
  36. package/dist/{chunk-TLMDSUEL.js.map → chunk-OIXSGSKM.js.map} +1 -1
  37. package/dist/{chunk-BZBRCPEB.js → chunk-PROIKXJR.js} +3 -3
  38. package/dist/{chunk-BZBRCPEB.js.map → chunk-PROIKXJR.js.map} +1 -1
  39. package/dist/{chunk-6QMWCPME.js → chunk-R5NALZHK.js} +6 -6
  40. package/dist/{chunk-6QMWCPME.js.map → chunk-R5NALZHK.js.map} +1 -1
  41. package/dist/{chunk-XJLB4OH2.js → chunk-SPAG2BWG.js} +2 -2
  42. package/dist/{chunk-XJLB4OH2.js.map → chunk-SPAG2BWG.js.map} +1 -1
  43. package/dist/{chunk-5OZVZI2E.js → chunk-TXXPJ5CQ.js} +2 -2
  44. package/dist/{chunk-5OZVZI2E.js.map → chunk-TXXPJ5CQ.js.map} +1 -1
  45. package/dist/{chunk-TAHJRTAD.js → chunk-US3NCUQF.js} +4 -4
  46. package/dist/{chunk-TAHJRTAD.js.map → chunk-US3NCUQF.js.map} +1 -1
  47. package/dist/{chunk-DB6H7M5O.js → chunk-WPW5XS6I.js} +2 -2
  48. package/dist/{chunk-DB6H7M5O.js.map → chunk-WPW5XS6I.js.map} +1 -1
  49. package/dist/{chunk-CJCZIWW6.js → chunk-XEWX4V7T.js} +3 -3
  50. package/dist/{chunk-CJCZIWW6.js.map → chunk-XEWX4V7T.js.map} +1 -1
  51. package/dist/{chunk-7LBL25WI.js → chunk-YCIW4YOT.js} +3 -3
  52. package/dist/{chunk-7LBL25WI.js.map → chunk-YCIW4YOT.js.map} +1 -1
  53. package/dist/{chunk-X5VZOIAP.js → chunk-YMHRKIMQ.js} +3 -3
  54. package/dist/{chunk-X5VZOIAP.js.map → chunk-YMHRKIMQ.js.map} +1 -1
  55. package/dist/{chunk-6DN6U2CK.js → chunk-ZVYWMD6Q.js} +3 -3
  56. package/dist/{chunk-6DN6U2CK.js.map → chunk-ZVYWMD6Q.js.map} +1 -1
  57. package/dist/cli/index.js +42 -42
  58. package/dist/connectors/config.js +1 -1
  59. package/dist/connectors/index.js +5 -5
  60. package/dist/core/index.js +1 -1
  61. package/dist/core/logging.js +1 -1
  62. package/dist/core/src/logging/index.d.ts +3 -1
  63. package/dist/core/src/logging/index.d.ts.map +1 -1
  64. package/dist/core/src/logging/retention.d.ts +29 -0
  65. package/dist/core/src/logging/retention.d.ts.map +1 -0
  66. package/dist/core/src/logging/sinks/sqlite-runtime.d.ts +6 -1
  67. package/dist/core/src/logging/sinks/sqlite-runtime.d.ts.map +1 -1
  68. package/dist/deploy/index.js +1 -1
  69. package/dist/{ensure-sources-FRG6HKPM.js → ensure-sources-QOQSDYIW.js} +5 -5
  70. package/dist/{ensure-sources-FRG6HKPM.js.map → ensure-sources-QOQSDYIW.js.map} +1 -1
  71. package/dist/factory-assets/connectors/box.js +5 -5
  72. package/dist/factory-assets/connectors/deploy.js +5 -5
  73. package/dist/factory-assets/connectors/devserver.js +5 -5
  74. package/dist/factory-assets/connectors/flow/adapter.js +5 -5
  75. package/dist/factory-assets/connectors/flow/engine.js +1 -1
  76. package/dist/factory-assets/connectors/flow/run-flow.js +6 -6
  77. package/dist/factory-assets/connectors/flow.js +5 -5
  78. package/dist/factory-assets/connectors/git/CONNECTOR.md +7 -1
  79. package/dist/factory-assets/connectors/git/driver.d.ts +60 -10
  80. package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
  81. package/dist/factory-assets/connectors/git.js +5 -5
  82. package/dist/factory-assets/connectors/gmail.js +5 -5
  83. package/dist/factory-assets/connectors/googledrive.js +5 -5
  84. package/dist/factory-assets/connectors/local.js +5 -5
  85. package/dist/factory-assets/connectors/mattermost.js +5 -5
  86. package/dist/factory-assets/connectors/memory.js +5 -5
  87. package/dist/factory-assets/connectors/minio.js +5 -5
  88. package/dist/factory-assets/connectors/postgres.js +5 -5
  89. package/dist/factory-assets/connectors/s3.js +5 -5
  90. package/dist/factory-assets/connectors/sharepoint.js +5 -5
  91. package/dist/factory-assets/connectors/sqlite.js +5 -5
  92. package/dist/factory-assets/connectors/static-server.js +5 -5
  93. package/dist/factory-assets/connectors/tunnel.js +5 -5
  94. package/dist/factory-assets/connectors/webdav.js +5 -5
  95. package/dist/factory-assets/connectors/xstate-store.js +5 -5
  96. package/dist/factory-assets/connectors/xstate.js +5 -5
  97. package/dist/{flows-377JICTL.js → flows-SYYQDDCT.js} +4 -4
  98. package/dist/{flows-377JICTL.js.map → flows-SYYQDDCT.js.map} +1 -1
  99. package/dist/{helpers-JHGUA7T7.js → helpers-HGDWKXLE.js} +5 -5
  100. package/dist/{helpers-JHGUA7T7.js.map → helpers-HGDWKXLE.js.map} +1 -1
  101. package/dist/library/index.js +1 -1
  102. package/dist/library/install.js +1 -1
  103. package/dist/{library-publish-CUFLZUEV.js → library-publish-6QYWX635.js} +7 -7
  104. package/dist/{library-publish-CUFLZUEV.js.map → library-publish-6QYWX635.js.map} +1 -1
  105. package/dist/{open-library-ZI6TWEM6.js → open-library-R74XCRPC.js} +6 -6
  106. package/dist/{open-library-ZI6TWEM6.js.map → open-library-R74XCRPC.js.map} +1 -1
  107. package/dist/{paths-WJUPZXFS.js → paths-NHONUGUU.js} +3 -3
  108. package/dist/{paths-WJUPZXFS.js.map → paths-NHONUGUU.js.map} +1 -1
  109. package/dist/{plugin-store-ZW4GDES3.js → plugin-store-4RALGK5S.js} +3 -3
  110. package/dist/{plugin-store-ZW4GDES3.js.map → plugin-store-4RALGK5S.js.map} +1 -1
  111. package/dist/{project-TVZ6Y6AR.js → project-OFUZ5D3S.js} +6 -6
  112. package/dist/{project-TVZ6Y6AR.js.map → project-OFUZ5D3S.js.map} +1 -1
  113. package/dist/resolver/index.js +1 -1
  114. package/dist/runner/index.js +11 -11
  115. package/dist/runner/src/logging-bootstrap.d.ts +11 -0
  116. package/dist/runner/src/logging-bootstrap.d.ts.map +1 -1
  117. package/dist/runner/src/serve.d.ts.map +1 -1
  118. package/dist/sdk/asset-manager.js +2 -2
  119. package/dist/sdk/bridge.js +4 -4
  120. package/dist/sdk/core.js +1 -1
  121. package/dist/sdk/flow.js +1 -1
  122. package/dist/sdk/index.js +11 -11
  123. package/dist/sdk/resolver.js +1 -1
  124. package/dist/sdk/runner.js +11 -11
  125. package/dist/{setup-54FNPLTS.js → setup-OYXGVHBF.js} +9 -9
  126. package/dist/{setup-54FNPLTS.js.map → setup-OYXGVHBF.js.map} +1 -1
  127. package/dist/{skills-J6KZ2WUT.js → skills-VUPPILR5.js} +3 -3
  128. package/dist/{skills-J6KZ2WUT.js.map → skills-VUPPILR5.js.map} +1 -1
  129. package/dist/{source-SPMRD7S2.js → source-MEQTWW3S.js} +7 -7
  130. package/dist/{source-SPMRD7S2.js.map → source-MEQTWW3S.js.map} +1 -1
  131. package/dist/{source-manifest-publish-3LSSDCSI.js → source-manifest-publish-EPPOGSLD.js} +8 -8
  132. package/dist/{source-manifest-publish-3LSSDCSI.js.map → source-manifest-publish-EPPOGSLD.js.map} +1 -1
  133. package/dist/tui/index.js +11 -11
  134. package/dist/workspace-plugin/adapters/mcp.js +3 -3
  135. package/dist/workspace-plugin/adapters/omp.js +7 -7
  136. package/dist/workspace-plugin/index.js +2 -2
  137. package/package.json +1 -1
  138. package/dist/chunk-5YB4GYMB.js.map +0 -1
  139. package/dist/chunk-6YIFJW2I.js.map +0 -1
  140. package/dist/chunk-FTG7CRFD.js.map +0 -1
@@ -1,19 +1,19 @@
1
- import { WorkspacePlugin } from './chunk-5OZVZI2E.js';
2
- import { buildWorkspaceToolDefs } from './chunk-CJCZIWW6.js';
1
+ import { WorkspacePlugin } from './chunk-TXXPJ5CQ.js';
2
+ import { buildWorkspaceToolDefs } from './chunk-XEWX4V7T.js';
3
3
  import { findAiAssetsRoot } from './chunk-7IRJ4K4F.js';
4
4
  import { WebSocketServerTransport } from './chunk-73ZXUUL6.js';
5
5
  import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
6
- import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-45LLHKQ2.js';
7
- import { resolveFlowPath } from './chunk-BZBRCPEB.js';
6
+ import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-2HUQUTJ3.js';
7
+ import { resolveFlowPath } from './chunk-PROIKXJR.js';
8
8
  import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-7BUZQVRR.js';
9
- import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-5YB4GYMB.js';
9
+ import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-HRVXHRL4.js';
10
10
  import { loadConnectorDeclarations, SecretProviderChain, ConnectorStartupError, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, isKnownSecretRef, deriveSingleMaterializedConnectorDeclaration } from './chunk-JUZJUKWM.js';
11
- import { EventNormalizer } from './chunk-6DN6U2CK.js';
11
+ import { EventNormalizer } from './chunk-ZVYWMD6Q.js';
12
12
  import { probeResumeTranscript } from './chunk-OUJVFZWJ.js';
13
13
  import { CodexNativeStateUnavailable } from './chunk-LOO5CB5M.js';
14
14
  import { dispatchCapability } from './chunk-3GKBSHUG.js';
15
15
  import { classifyClaudeSdkError } from './chunk-GAH4YRCI.js';
16
- import { createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv, AI_PROVIDER_PRESETS } from './chunk-QBH7PC4D.js';
16
+ import { createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv, AI_PROVIDER_PRESETS } from './chunk-LDQB5VEC.js';
17
17
  import { loadFlow } from './chunk-AOE4KOMJ.js';
18
18
  import { parseFlowDefinition } from './chunk-REYJKU7T.js';
19
19
  import { renderStimulusPrompt } from './chunk-2D5BYAL6.js';
@@ -24,16 +24,16 @@ import { resolveDriverPaths } from './chunk-K5GBV4SA.js';
24
24
  import { resolveSkWorkspaceConfig, resolveAgentDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill } from './chunk-P2G6XSJ3.js';
25
25
  import { withFsDeadline, FsDeadlineError, fsDeadlineMs, tryWithFsDeadline } from './chunk-MKZOK4JU.js';
26
26
  import { parseAssetRef } from './chunk-GEEW6SY2.js';
27
- import { resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink } from './chunk-FTG7CRFD.js';
27
+ import { resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink, resolveLogsRetention, enforceLogsRetention } from './chunk-3HKYCT2M.js';
28
28
  import { registryEntries, resolveEntryBaseUrl, parseModelRef, isEntryEnabled, parseCredentialRef } from './chunk-ILG4BXYE.js';
29
- import { getLogStore, registerLogStore, resetLogStore, createLogger, isUnwritableStreamError, markStreamBroken, isBrokenPipeError } from './chunk-W4IPN3DD.js';
29
+ import { getLogStore, registerLogStore, createLogger, resetLogStore, isUnwritableStreamError, markStreamBroken, isBrokenPipeError } from './chunk-W4IPN3DD.js';
30
30
  import { __require } from './chunk-NSBPE2FW.js';
31
31
  import pc from 'picocolors';
32
+ import path5, { join, resolve, relative, sep, isAbsolute, basename, dirname } from 'path';
32
33
  import { Marked } from 'marked';
33
34
  import { markedTerminal } from 'marked-terminal';
34
35
  import fs4, { readFile, readdir, lstat, stat, rm, unlink, mkdir, writeFile, realpath, rename, readlink, mkdtemp } from 'fs/promises';
35
36
  import { createHash, randomBytes, timingSafeEqual, randomUUID } from 'crypto';
36
- import path4, { join, resolve, relative, sep, isAbsolute, basename, dirname } from 'path';
37
37
  import { existsSync, lstatSync, realpathSync, readFileSync, mkdirSync, writeFileSync, watch, chmodSync, accessSync, constants } from 'fs';
38
38
  import { homedir } from 'os';
39
39
  import * as z7 from 'zod';
@@ -51,7 +51,6 @@ import { getDefaultEnvironment, StdioClientTransport } from '@modelcontextprotoc
51
51
  import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
52
52
  import mime from 'mime';
53
53
 
54
- // runner/src/logging-bootstrap.ts
55
54
  var PreInitRingSink = class {
56
55
  ring = [];
57
56
  cap;
@@ -131,14 +130,34 @@ function bootstrapRunnerLogStore(opts) {
131
130
  currentSessionId = opts.sessionId;
132
131
  const preInit = getPreInitRingSink();
133
132
  if (preInit) preInit.clear();
133
+ const retention = opts.enforceRetention && cfg.mode === "persistent" && cfg.workspacePath ? scheduleRetention(cfg) : void 0;
134
134
  return {
135
135
  store,
136
136
  dispose: () => {
137
137
  disposeStore(store);
138
138
  currentSessionId = null;
139
- }
139
+ },
140
+ ...retention ? { retention } : {}
140
141
  };
141
142
  }
143
+ function scheduleRetention(cfg) {
144
+ const dbPath = path5.join(cfg.workspacePath, ".skaile", "logs.db");
145
+ const policy = resolveLogsRetention(cfg.retention);
146
+ const log = createLogger({ kind: "runner", subkind: "logging", instance: cfg.sessionId });
147
+ return new Promise((resolve4) => setImmediate(resolve4)).then(() => enforceLogsRetention(dbPath, policy)).then(
148
+ (result) => {
149
+ if (result.deletedByAge + result.deletedByCount > 0) {
150
+ log.info("logs.db retention trimmed rows", { ...result, ...policy });
151
+ }
152
+ },
153
+ (err) => {
154
+ log.warn("logs.db retention failed; continuing without trim", {
155
+ error: err instanceof Error ? err.message : String(err),
156
+ ...policy
157
+ });
158
+ }
159
+ );
160
+ }
142
161
  function resetRunnerLogStore() {
143
162
  const s = getLogStore();
144
163
  if (s) disposeStore(s);
@@ -246,7 +265,7 @@ function defineCapability(args) {
246
265
  }
247
266
  async function resolveMixin(ref, defaultKind, agentDir, repos) {
248
267
  if (ref.startsWith(".") || ref.startsWith("/")) {
249
- const absPath = ref.startsWith("/") ? ref : path4.join(agentDir, ref);
268
+ const absPath = ref.startsWith("/") ? ref : path5.join(agentDir, ref);
250
269
  if (defaultKind === "knowledge") {
251
270
  return loadKnowledgeDir(absPath);
252
271
  }
@@ -258,7 +277,7 @@ async function resolveMixin(ref, defaultKind, agentDir, repos) {
258
277
  const entry = findInRepos(repos, kind, name, repoQualifier);
259
278
  if (!entry) return null;
260
279
  if (entry.kind === "knowledge") {
261
- return loadKnowledgeDir(path4.dirname(entry.source));
280
+ return loadKnowledgeDir(path5.dirname(entry.source));
262
281
  }
263
282
  const raw = await readFileSafe(entry.source);
264
283
  if (!raw) return null;
@@ -321,7 +340,7 @@ async function loadKnowledgeDir(dir) {
321
340
  return null;
322
341
  }
323
342
  const priorityMap = {};
324
- const indexContent = await readFileSafe(path4.join(dir, "index.yaml"));
343
+ const indexContent = await readFileSafe(path5.join(dir, "index.yaml"));
325
344
  if (indexContent) {
326
345
  const pathMatches = [...indexContent.matchAll(/path:\s*(\S+)/g)];
327
346
  const priorityMatches = [...indexContent.matchAll(/priority:\s*(\d+)/g)];
@@ -336,7 +355,7 @@ async function loadKnowledgeDir(dir) {
336
355
  entries.map(async (filename) => ({
337
356
  filename,
338
357
  priority: priorityMap[filename] ?? 99,
339
- content: (await readFileSafe(path4.join(dir, filename))).trim()
358
+ content: (await readFileSafe(path5.join(dir, filename))).trim()
340
359
  }))
341
360
  );
342
361
  const sorted = docs.filter((d) => d.content).sort((a, b) => a.priority - b.priority || a.filename.localeCompare(b.filename));
@@ -370,7 +389,7 @@ function resolveBinding(item) {
370
389
  var COMPILE_MANIFEST_FILENAME = "compile_manifest.json";
371
390
  async function compileComposition(opts) {
372
391
  const { agentDir, items, loadContent, resolveVersion } = opts;
373
- const manifestPath = path4.join(agentDir, COMPILE_MANIFEST_FILENAME);
392
+ const manifestPath = path5.join(agentDir, COMPILE_MANIFEST_FILENAME);
374
393
  const warnings = [];
375
394
  const existing = await loadCompileManifest(manifestPath);
376
395
  const nextVersion = (existing?.prompt_version ?? 0) + 1;
@@ -422,7 +441,7 @@ async function loadCompileManifest(manifestPath) {
422
441
  }
423
442
  }
424
443
  async function loadCompileManifestFromDir(agentDir) {
425
- return loadCompileManifest(path4.join(agentDir, COMPILE_MANIFEST_FILENAME));
444
+ return loadCompileManifest(path5.join(agentDir, COMPILE_MANIFEST_FILENAME));
426
445
  }
427
446
  async function resolveComposition(opts) {
428
447
  const { items, library, compileManifest, loadContent } = opts;
@@ -981,20 +1000,20 @@ function registerCodexToolDefinitions(registry, namespace, tools) {
981
1000
  };
982
1001
  }
983
1002
  function contains(root, target) {
984
- const path5 = relative(root, target);
985
- return path5 === "" || !path5.startsWith("..") && !isAbsolute(path5);
1003
+ const path6 = relative(root, target);
1004
+ return path6 === "" || !path6.startsWith("..") && !isAbsolute(path6);
986
1005
  }
987
- async function canonical(path5) {
1006
+ async function canonical(path6) {
988
1007
  try {
989
- return await realpath(path5);
1008
+ return await realpath(path6);
990
1009
  } catch (error) {
991
1010
  if (error.code !== "ENOENT") throw error;
992
- const parent = dirname(path5);
993
- if (parent === path5) throw error;
994
- return resolve(await canonical(parent), relative(parent, path5));
1011
+ const parent = dirname(path6);
1012
+ if (parent === path6) throw error;
1013
+ return resolve(await canonical(parent), relative(parent, path6));
995
1014
  }
996
1015
  }
997
- async function assertScopedTree(path5, root) {
1016
+ async function assertScopedTree(path6, root) {
998
1017
  let remaining = 1e4;
999
1018
  async function visit(entry) {
1000
1019
  if (--remaining < 0) throw new Error("CODEX_RESOURCE_SCOPE_INVALID");
@@ -1010,7 +1029,7 @@ async function assertScopedTree(path5, root) {
1010
1029
  if (stat3.isDirectory())
1011
1030
  for (const child of await readdir(entry)) await visit(join(entry, child));
1012
1031
  }
1013
- await visit(path5);
1032
+ await visit(path6);
1014
1033
  }
1015
1034
  async function registerCodexResourceTools(options) {
1016
1035
  const project = await realpath(options.projectDir);
@@ -1098,14 +1117,14 @@ function registerCodexFlowTools(registry, manager, connectorId) {
1098
1117
  }
1099
1118
  async function agentDefinitionExists(agentDir) {
1100
1119
  try {
1101
- await fs4.access(path4.join(agentDir, "agent.yaml"));
1120
+ await fs4.access(path5.join(agentDir, "agent.yaml"));
1102
1121
  return true;
1103
1122
  } catch {
1104
1123
  return false;
1105
1124
  }
1106
1125
  }
1107
1126
  async function loadAgentManifest(agentDir) {
1108
- const agentYamlPath = path4.join(agentDir, "agent.yaml");
1127
+ const agentYamlPath = path5.join(agentDir, "agent.yaml");
1109
1128
  let content;
1110
1129
  try {
1111
1130
  content = await fs4.readFile(agentYamlPath, "utf-8");
@@ -1127,8 +1146,8 @@ var DEFAULT_MAX_DIRS = 256;
1127
1146
  function isStructuralAction(action) {
1128
1147
  return action === "create" || action === "delete";
1129
1148
  }
1130
- function parentDirOf(path5) {
1131
- return path5.includes("/") ? path5.slice(0, path5.lastIndexOf("/")) : "";
1149
+ function parentDirOf(path6) {
1150
+ return path6.includes("/") ? path6.slice(0, path6.lastIndexOf("/")) : "";
1132
1151
  }
1133
1152
  var FileChangedCoalescer = class {
1134
1153
  windowMs;
@@ -1259,22 +1278,22 @@ function recipeMapPath() {
1259
1278
  var recipeMapMemo = null;
1260
1279
  var recipeMapInFlight = null;
1261
1280
  async function loadRecipeMap() {
1262
- const path5 = recipeMapPath();
1281
+ const path6 = recipeMapPath();
1263
1282
  const mtimeMs = await tryWithFsDeadline(
1264
- `stat ${path5}`,
1265
- async () => (await stat(path5)).mtimeMs,
1283
+ `stat ${path6}`,
1284
+ async () => (await stat(path6)).mtimeMs,
1266
1285
  null
1267
1286
  );
1268
1287
  if (mtimeMs === null) {
1269
- recipeMapMemo = { path: path5, mtimeMs: -1, map: null };
1288
+ recipeMapMemo = { path: path6, mtimeMs: -1, map: null };
1270
1289
  return null;
1271
1290
  }
1272
- if (recipeMapMemo && recipeMapMemo.path === path5 && recipeMapMemo.mtimeMs === mtimeMs) {
1291
+ if (recipeMapMemo && recipeMapMemo.path === path6 && recipeMapMemo.mtimeMs === mtimeMs) {
1273
1292
  return recipeMapMemo.map;
1274
1293
  }
1275
- const key = `${path5}:${mtimeMs}`;
1294
+ const key = `${path6}:${mtimeMs}`;
1276
1295
  if (recipeMapInFlight?.key === key) return recipeMapInFlight.promise;
1277
- const promise = readRecipeMap(path5, mtimeMs);
1296
+ const promise = readRecipeMap(path6, mtimeMs);
1278
1297
  recipeMapInFlight = { key, promise };
1279
1298
  try {
1280
1299
  return await promise;
@@ -1282,21 +1301,21 @@ async function loadRecipeMap() {
1282
1301
  if (recipeMapInFlight?.key === key) recipeMapInFlight = null;
1283
1302
  }
1284
1303
  }
1285
- async function readRecipeMap(path5, mtimeMs) {
1304
+ async function readRecipeMap(path6, mtimeMs) {
1286
1305
  let map = null;
1287
1306
  try {
1288
1307
  const parsed = JSON.parse(
1289
- await withFsDeadline(`readFile ${path5}`, () => readFile(path5, "utf8"))
1308
+ await withFsDeadline(`readFile ${path6}`, () => readFile(path6, "utf8"))
1290
1309
  );
1291
1310
  map = parsed && typeof parsed === "object" ? parsed : null;
1292
1311
  } catch (err) {
1293
1312
  createLogger({ kind: "mcp", subkind: "recipe-resolve" }).warn(
1294
1313
  "recipe map malformed \u2014 falling back to nix path-info",
1295
- { path: path5, error: err instanceof Error ? err.message : String(err) }
1314
+ { path: path6, error: err instanceof Error ? err.message : String(err) }
1296
1315
  );
1297
1316
  map = null;
1298
1317
  }
1299
- recipeMapMemo = { path: path5, mtimeMs, map };
1318
+ recipeMapMemo = { path: path6, mtimeMs, map };
1300
1319
  return map;
1301
1320
  }
1302
1321
  var MapRecipeProducer = class {
@@ -3185,31 +3204,31 @@ function errorResponse(command, resourceId, err) {
3185
3204
  };
3186
3205
  }
3187
3206
  async function handleResourceRequest(command, manager, emit) {
3188
- const { requestId, connectorId, operation, path: path5, options, content } = command;
3207
+ const { requestId, connectorId, operation, path: path6, options, content } = command;
3189
3208
  try {
3190
3209
  let data;
3191
3210
  switch (operation) {
3192
3211
  case "list":
3193
3212
  data = await manager.list(
3194
3213
  connectorId,
3195
- path5,
3214
+ path6,
3196
3215
  options
3197
3216
  );
3198
3217
  break;
3199
3218
  case "read":
3200
- data = await manager.read(connectorId, path5);
3219
+ data = await manager.read(connectorId, path6);
3201
3220
  break;
3202
3221
  case "write":
3203
- await manager.write(connectorId, path5, content);
3222
+ await manager.write(connectorId, path6, content);
3204
3223
  data = true;
3205
3224
  break;
3206
3225
  case "delete":
3207
- data = await manager.delete(connectorId, path5);
3226
+ data = await manager.delete(connectorId, path6);
3208
3227
  break;
3209
3228
  case "search":
3210
3229
  data = await manager.search(
3211
3230
  connectorId,
3212
- path5,
3231
+ path6,
3213
3232
  options
3214
3233
  );
3215
3234
  break;
@@ -4281,17 +4300,17 @@ function createCoalescedTask(lock, fn) {
4281
4300
  }
4282
4301
  async function recordStagedSkills(staged, projectDir, skillsDir, names, timeoutMs) {
4283
4302
  for (const name of names) {
4284
- const path5 = join(projectDir, skillsDir, name);
4285
- const st = await tryWithFsDeadline(`lstat ${path5}`, () => lstat(path5), null, timeoutMs);
4303
+ const path6 = join(projectDir, skillsDir, name);
4304
+ const st = await tryWithFsDeadline(`lstat ${path6}`, () => lstat(path6), null, timeoutMs);
4286
4305
  staged.set(
4287
4306
  name,
4288
- st?.isDirectory() && st.birthtimeMs > 0 ? { path: path5, dev: st.dev, ino: st.ino, birthtimeMs: st.birthtimeMs } : null
4307
+ st?.isDirectory() && st.birthtimeMs > 0 ? { path: path6, dev: st.dev, ino: st.ino, birthtimeMs: st.birthtimeMs } : null
4289
4308
  );
4290
4309
  }
4291
4310
  }
4292
- async function isStillOurs(record2, path5, timeoutMs) {
4293
- if (!record2 || record2.path !== path5) return false;
4294
- const st = await tryWithFsDeadline(`lstat ${path5}`, () => lstat(path5), null, timeoutMs);
4311
+ async function isStillOurs(record2, path6, timeoutMs) {
4312
+ if (!record2 || record2.path !== path6) return false;
4313
+ const st = await tryWithFsDeadline(`lstat ${path6}`, () => lstat(path6), null, timeoutMs);
4295
4314
  return st?.isDirectory() === true && st.dev === record2.dev && st.ino === record2.ino && st.birthtimeMs === record2.birthtimeMs;
4296
4315
  }
4297
4316
  async function attachStagedSkill(deps, name) {
@@ -4355,9 +4374,9 @@ async function detachStagedSkill(deps, name) {
4355
4374
  };
4356
4375
  }
4357
4376
  }
4358
- async function pathState(path5) {
4377
+ async function pathState(path6) {
4359
4378
  try {
4360
- await withFsDeadline(`lstat ${path5}`, () => lstat(path5));
4379
+ await withFsDeadline(`lstat ${path6}`, () => lstat(path6));
4361
4380
  return "present";
4362
4381
  } catch (err) {
4363
4382
  return err?.code === "ENOENT" ? "absent" : "unknown";
@@ -6224,8 +6243,8 @@ async function buildStoreSnapshotReplay(manager, activeFlows) {
6224
6243
  }
6225
6244
  async function guardClaudeAiConnectors(home, serverLog) {
6226
6245
  try {
6227
- const path5 = await ensureClaudeSettingsDisablesConnectors(home);
6228
- serverLog.info("claude.ai connectors disabled in user settings", { path: path5 });
6246
+ const path6 = await ensureClaudeSettingsDisablesConnectors(home);
6247
+ serverLog.info("claude.ai connectors disabled in user settings", { path: path6 });
6229
6248
  } catch (err) {
6230
6249
  serverLog.warn(
6231
6250
  "failed to disable claude.ai connectors in user settings \u2014 relying on env only",
@@ -6789,7 +6808,9 @@ async function startAgentServer(opts) {
6789
6808
  sessionId,
6790
6809
  projectDir: opts.projectDir,
6791
6810
  yamlBlock: wsConfig.logging,
6792
- onLog: opts.onLog
6811
+ onLog: opts.onLog,
6812
+ // Broker mode has no host-side trim of this file; see logging-bootstrap.ts.
6813
+ enforceRetention: true
6793
6814
  });
6794
6815
  const serverLog = createLogger({
6795
6816
  kind: "runner",
@@ -9023,16 +9044,16 @@ var SESSIONS_SUBDIR = "sessions";
9023
9044
  var CURRENT_FILE = "current";
9024
9045
  var LEGACY_FILE = "session.json";
9025
9046
  function sessionsDir(projectDir) {
9026
- return path4.join(projectDir, SESSION_DIR, SESSIONS_SUBDIR);
9047
+ return path5.join(projectDir, SESSION_DIR, SESSIONS_SUBDIR);
9027
9048
  }
9028
9049
  function sessionFilePath(projectDir, runId) {
9029
- return path4.join(sessionsDir(projectDir), `${runId}.json`);
9050
+ return path5.join(sessionsDir(projectDir), `${runId}.json`);
9030
9051
  }
9031
9052
  function currentPointerPath(projectDir) {
9032
- return path4.join(projectDir, SESSION_DIR, CURRENT_FILE);
9053
+ return path5.join(projectDir, SESSION_DIR, CURRENT_FILE);
9033
9054
  }
9034
9055
  function legacySessionPath(projectDir) {
9035
- return path4.join(projectDir, SESSION_DIR, LEGACY_FILE);
9056
+ return path5.join(projectDir, SESSION_DIR, LEGACY_FILE);
9036
9057
  }
9037
9058
  async function migrateLegacySession(projectDir) {
9038
9059
  const legacyPath = legacySessionPath(projectDir);
@@ -9077,7 +9098,7 @@ async function listSessions(projectDir) {
9077
9098
  for (const file of files) {
9078
9099
  if (!file.endsWith(".json")) continue;
9079
9100
  try {
9080
- const raw = await fs4.readFile(path4.join(dir, file), "utf-8");
9101
+ const raw = await fs4.readFile(path5.join(dir, file), "utf-8");
9081
9102
  sessions.push(JSON.parse(raw));
9082
9103
  } catch {
9083
9104
  }
@@ -9101,7 +9122,7 @@ async function saveSession(projectDir, state, setCurrent = true) {
9101
9122
  async function setCurrentSession(projectDir, runId) {
9102
9123
  const exists = await loadSessionById(projectDir, runId);
9103
9124
  if (!exists) throw new Error(`Session not found: ${runId}`);
9104
- await fs4.mkdir(path4.join(projectDir, SESSION_DIR), { recursive: true });
9125
+ await fs4.mkdir(path5.join(projectDir, SESSION_DIR), { recursive: true });
9105
9126
  await fs4.writeFile(currentPointerPath(projectDir), runId, "utf-8");
9106
9127
  }
9107
9128
  async function deleteSession(projectDir, runId) {
@@ -9132,5 +9153,5 @@ function touchSession(state) {
9132
9153
  }
9133
9154
 
9134
9155
  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_STAT_BUDGET_MS, MOUNT_STAT_MAX_ENTRIES, MOUNT_TREE_OP_DEADLINE_FACTOR, MarkdownStreamer, PreInitRingSink, ResourceOperationError, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildStoreSnapshotReplay, builtinCapabilities, capabilityLogInstance, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, computeDirectoryTotals, connectorRefreshKind, createAgentSession, createFlowConnectorReadiness, createManagedCodexSubpromptDriver, createSessionStimulusBus, defineCapability, deleteSession, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowStartNeedsDriverRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, hasNonTerminalFlow, hostOpResumeStimulus, installPreInitRingSink, isSessionRootPathAllowed, isTerminalFlowStatus, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadManagedCodexHostConfig, loadSession, loadSessionById, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickFlowToolTarget, 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 };
9135
- //# sourceMappingURL=chunk-6YIFJW2I.js.map
9136
- //# sourceMappingURL=chunk-6YIFJW2I.js.map
9156
+ //# sourceMappingURL=chunk-5HZWDH3L.js.map
9157
+ //# sourceMappingURL=chunk-5HZWDH3L.js.map