@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.
- package/CHANGELOG.md +18 -0
- package/dist/{asset-feeds-ZKMRNVV2.js → asset-feeds-WHWQJOAQ.js} +5 -5
- package/dist/{asset-feeds-ZKMRNVV2.js.map → asset-feeds-WHWQJOAQ.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +1 -1
- package/dist/asset-manager/index.js +2 -2
- package/dist/asset-manager/installer.js +1 -1
- package/dist/bridge/drivers/claude-sdk.js +3 -3
- package/dist/bridge/drivers/codex.js +4 -4
- package/dist/bridge/drivers/continue.js +3 -3
- package/dist/bridge/drivers/echo.js +2 -2
- package/dist/bridge/drivers/gemini.js +5 -5
- package/dist/bridge/drivers/goose.js +3 -3
- package/dist/bridge/drivers/omp.js +2 -2
- package/dist/bridge/drivers/opencode.js +3 -3
- package/dist/bridge/drivers/qwen.js +5 -5
- package/dist/bridge/index.js +4 -4
- package/dist/{chunk-45LLHKQ2.js → chunk-2HUQUTJ3.js} +3 -3
- package/dist/{chunk-45LLHKQ2.js.map → chunk-2HUQUTJ3.js.map} +1 -1
- package/dist/{chunk-OZAF24OQ.js → chunk-3BDWW7OE.js} +6 -6
- package/dist/{chunk-OZAF24OQ.js.map → chunk-3BDWW7OE.js.map} +1 -1
- package/dist/{chunk-FTG7CRFD.js → chunk-3HKYCT2M.js} +69 -6
- package/dist/chunk-3HKYCT2M.js.map +1 -0
- package/dist/{chunk-6YIFJW2I.js → chunk-5HZWDH3L.js} +88 -67
- package/dist/chunk-5HZWDH3L.js.map +1 -0
- package/dist/{chunk-7ZYKHL6Y.js → chunk-7F4FGEMI.js} +3 -3
- package/dist/{chunk-7ZYKHL6Y.js.map → chunk-7F4FGEMI.js.map} +1 -1
- package/dist/{chunk-5VKBD3QV.js → chunk-FTSXFA7P.js} +5 -5
- package/dist/{chunk-5VKBD3QV.js.map → chunk-FTSXFA7P.js.map} +1 -1
- package/dist/{chunk-5YB4GYMB.js → chunk-HRVXHRL4.js} +225 -39
- package/dist/chunk-HRVXHRL4.js.map +1 -0
- package/dist/{chunk-NHZR3NVY.js → chunk-KQTMJP3X.js} +3 -3
- package/dist/{chunk-NHZR3NVY.js.map → chunk-KQTMJP3X.js.map} +1 -1
- package/dist/{chunk-QBH7PC4D.js → chunk-LDQB5VEC.js} +2 -2
- package/dist/{chunk-QBH7PC4D.js.map → chunk-LDQB5VEC.js.map} +1 -1
- package/dist/{chunk-TLMDSUEL.js → chunk-OIXSGSKM.js} +3 -3
- package/dist/{chunk-TLMDSUEL.js.map → chunk-OIXSGSKM.js.map} +1 -1
- package/dist/{chunk-BZBRCPEB.js → chunk-PROIKXJR.js} +3 -3
- package/dist/{chunk-BZBRCPEB.js.map → chunk-PROIKXJR.js.map} +1 -1
- package/dist/{chunk-6QMWCPME.js → chunk-R5NALZHK.js} +6 -6
- package/dist/{chunk-6QMWCPME.js.map → chunk-R5NALZHK.js.map} +1 -1
- package/dist/{chunk-XJLB4OH2.js → chunk-SPAG2BWG.js} +2 -2
- package/dist/{chunk-XJLB4OH2.js.map → chunk-SPAG2BWG.js.map} +1 -1
- package/dist/{chunk-5OZVZI2E.js → chunk-TXXPJ5CQ.js} +2 -2
- package/dist/{chunk-5OZVZI2E.js.map → chunk-TXXPJ5CQ.js.map} +1 -1
- package/dist/{chunk-TAHJRTAD.js → chunk-US3NCUQF.js} +4 -4
- package/dist/{chunk-TAHJRTAD.js.map → chunk-US3NCUQF.js.map} +1 -1
- package/dist/{chunk-DB6H7M5O.js → chunk-WPW5XS6I.js} +2 -2
- package/dist/{chunk-DB6H7M5O.js.map → chunk-WPW5XS6I.js.map} +1 -1
- package/dist/{chunk-CJCZIWW6.js → chunk-XEWX4V7T.js} +3 -3
- package/dist/{chunk-CJCZIWW6.js.map → chunk-XEWX4V7T.js.map} +1 -1
- package/dist/{chunk-7LBL25WI.js → chunk-YCIW4YOT.js} +3 -3
- package/dist/{chunk-7LBL25WI.js.map → chunk-YCIW4YOT.js.map} +1 -1
- package/dist/{chunk-X5VZOIAP.js → chunk-YMHRKIMQ.js} +3 -3
- package/dist/{chunk-X5VZOIAP.js.map → chunk-YMHRKIMQ.js.map} +1 -1
- package/dist/{chunk-6DN6U2CK.js → chunk-ZVYWMD6Q.js} +3 -3
- package/dist/{chunk-6DN6U2CK.js.map → chunk-ZVYWMD6Q.js.map} +1 -1
- package/dist/cli/index.js +42 -42
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +5 -5
- package/dist/core/index.js +1 -1
- package/dist/core/logging.js +1 -1
- package/dist/core/src/logging/index.d.ts +3 -1
- package/dist/core/src/logging/index.d.ts.map +1 -1
- package/dist/core/src/logging/retention.d.ts +29 -0
- package/dist/core/src/logging/retention.d.ts.map +1 -0
- package/dist/core/src/logging/sinks/sqlite-runtime.d.ts +6 -1
- package/dist/core/src/logging/sinks/sqlite-runtime.d.ts.map +1 -1
- package/dist/deploy/index.js +1 -1
- package/dist/{ensure-sources-FRG6HKPM.js → ensure-sources-QOQSDYIW.js} +5 -5
- package/dist/{ensure-sources-FRG6HKPM.js.map → ensure-sources-QOQSDYIW.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +5 -5
- package/dist/factory-assets/connectors/deploy.js +5 -5
- package/dist/factory-assets/connectors/devserver.js +5 -5
- package/dist/factory-assets/connectors/flow/adapter.js +5 -5
- package/dist/factory-assets/connectors/flow/engine.js +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +6 -6
- package/dist/factory-assets/connectors/flow.js +5 -5
- package/dist/factory-assets/connectors/git/CONNECTOR.md +7 -1
- package/dist/factory-assets/connectors/git/driver.d.ts +60 -10
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +5 -5
- package/dist/factory-assets/connectors/gmail.js +5 -5
- package/dist/factory-assets/connectors/googledrive.js +5 -5
- package/dist/factory-assets/connectors/local.js +5 -5
- package/dist/factory-assets/connectors/mattermost.js +5 -5
- package/dist/factory-assets/connectors/memory.js +5 -5
- package/dist/factory-assets/connectors/minio.js +5 -5
- package/dist/factory-assets/connectors/postgres.js +5 -5
- package/dist/factory-assets/connectors/s3.js +5 -5
- package/dist/factory-assets/connectors/sharepoint.js +5 -5
- package/dist/factory-assets/connectors/sqlite.js +5 -5
- package/dist/factory-assets/connectors/static-server.js +5 -5
- package/dist/factory-assets/connectors/tunnel.js +5 -5
- package/dist/factory-assets/connectors/webdav.js +5 -5
- package/dist/factory-assets/connectors/xstate-store.js +5 -5
- package/dist/factory-assets/connectors/xstate.js +5 -5
- package/dist/{flows-377JICTL.js → flows-SYYQDDCT.js} +4 -4
- package/dist/{flows-377JICTL.js.map → flows-SYYQDDCT.js.map} +1 -1
- package/dist/{helpers-JHGUA7T7.js → helpers-HGDWKXLE.js} +5 -5
- package/dist/{helpers-JHGUA7T7.js.map → helpers-HGDWKXLE.js.map} +1 -1
- package/dist/library/index.js +1 -1
- package/dist/library/install.js +1 -1
- package/dist/{library-publish-CUFLZUEV.js → library-publish-6QYWX635.js} +7 -7
- package/dist/{library-publish-CUFLZUEV.js.map → library-publish-6QYWX635.js.map} +1 -1
- package/dist/{open-library-ZI6TWEM6.js → open-library-R74XCRPC.js} +6 -6
- package/dist/{open-library-ZI6TWEM6.js.map → open-library-R74XCRPC.js.map} +1 -1
- package/dist/{paths-WJUPZXFS.js → paths-NHONUGUU.js} +3 -3
- package/dist/{paths-WJUPZXFS.js.map → paths-NHONUGUU.js.map} +1 -1
- package/dist/{plugin-store-ZW4GDES3.js → plugin-store-4RALGK5S.js} +3 -3
- package/dist/{plugin-store-ZW4GDES3.js.map → plugin-store-4RALGK5S.js.map} +1 -1
- package/dist/{project-TVZ6Y6AR.js → project-OFUZ5D3S.js} +6 -6
- package/dist/{project-TVZ6Y6AR.js.map → project-OFUZ5D3S.js.map} +1 -1
- package/dist/resolver/index.js +1 -1
- package/dist/runner/index.js +11 -11
- package/dist/runner/src/logging-bootstrap.d.ts +11 -0
- package/dist/runner/src/logging-bootstrap.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +2 -2
- package/dist/sdk/bridge.js +4 -4
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/flow.js +1 -1
- package/dist/sdk/index.js +11 -11
- package/dist/sdk/resolver.js +1 -1
- package/dist/sdk/runner.js +11 -11
- package/dist/{setup-54FNPLTS.js → setup-OYXGVHBF.js} +9 -9
- package/dist/{setup-54FNPLTS.js.map → setup-OYXGVHBF.js.map} +1 -1
- package/dist/{skills-J6KZ2WUT.js → skills-VUPPILR5.js} +3 -3
- package/dist/{skills-J6KZ2WUT.js.map → skills-VUPPILR5.js.map} +1 -1
- package/dist/{source-SPMRD7S2.js → source-MEQTWW3S.js} +7 -7
- package/dist/{source-SPMRD7S2.js.map → source-MEQTWW3S.js.map} +1 -1
- package/dist/{source-manifest-publish-3LSSDCSI.js → source-manifest-publish-EPPOGSLD.js} +8 -8
- package/dist/{source-manifest-publish-3LSSDCSI.js.map → source-manifest-publish-EPPOGSLD.js.map} +1 -1
- package/dist/tui/index.js +11 -11
- package/dist/workspace-plugin/adapters/mcp.js +3 -3
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-5YB4GYMB.js.map +0 -1
- package/dist/chunk-6YIFJW2I.js.map +0 -1
- package/dist/chunk-FTG7CRFD.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { WorkspacePlugin } from './chunk-
|
|
2
|
-
import { buildWorkspaceToolDefs } from './chunk-
|
|
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-
|
|
7
|
-
import { resolveFlowPath } from './chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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,
|
|
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 :
|
|
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(
|
|
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(
|
|
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(
|
|
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 =
|
|
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(
|
|
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
|
|
985
|
-
return
|
|
1003
|
+
const path6 = relative(root, target);
|
|
1004
|
+
return path6 === "" || !path6.startsWith("..") && !isAbsolute(path6);
|
|
986
1005
|
}
|
|
987
|
-
async function canonical(
|
|
1006
|
+
async function canonical(path6) {
|
|
988
1007
|
try {
|
|
989
|
-
return await realpath(
|
|
1008
|
+
return await realpath(path6);
|
|
990
1009
|
} catch (error) {
|
|
991
1010
|
if (error.code !== "ENOENT") throw error;
|
|
992
|
-
const parent = dirname(
|
|
993
|
-
if (parent ===
|
|
994
|
-
return resolve(await canonical(parent), relative(parent,
|
|
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(
|
|
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(
|
|
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(
|
|
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 =
|
|
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(
|
|
1131
|
-
return
|
|
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
|
|
1281
|
+
const path6 = recipeMapPath();
|
|
1263
1282
|
const mtimeMs = await tryWithFsDeadline(
|
|
1264
|
-
`stat ${
|
|
1265
|
-
async () => (await stat(
|
|
1283
|
+
`stat ${path6}`,
|
|
1284
|
+
async () => (await stat(path6)).mtimeMs,
|
|
1266
1285
|
null
|
|
1267
1286
|
);
|
|
1268
1287
|
if (mtimeMs === null) {
|
|
1269
|
-
recipeMapMemo = { path:
|
|
1288
|
+
recipeMapMemo = { path: path6, mtimeMs: -1, map: null };
|
|
1270
1289
|
return null;
|
|
1271
1290
|
}
|
|
1272
|
-
if (recipeMapMemo && recipeMapMemo.path ===
|
|
1291
|
+
if (recipeMapMemo && recipeMapMemo.path === path6 && recipeMapMemo.mtimeMs === mtimeMs) {
|
|
1273
1292
|
return recipeMapMemo.map;
|
|
1274
1293
|
}
|
|
1275
|
-
const key = `${
|
|
1294
|
+
const key = `${path6}:${mtimeMs}`;
|
|
1276
1295
|
if (recipeMapInFlight?.key === key) return recipeMapInFlight.promise;
|
|
1277
|
-
const promise = readRecipeMap(
|
|
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(
|
|
1304
|
+
async function readRecipeMap(path6, mtimeMs) {
|
|
1286
1305
|
let map = null;
|
|
1287
1306
|
try {
|
|
1288
1307
|
const parsed = JSON.parse(
|
|
1289
|
-
await withFsDeadline(`readFile ${
|
|
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:
|
|
1314
|
+
{ path: path6, error: err instanceof Error ? err.message : String(err) }
|
|
1296
1315
|
);
|
|
1297
1316
|
map = null;
|
|
1298
1317
|
}
|
|
1299
|
-
recipeMapMemo = { path:
|
|
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:
|
|
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
|
-
|
|
3214
|
+
path6,
|
|
3196
3215
|
options
|
|
3197
3216
|
);
|
|
3198
3217
|
break;
|
|
3199
3218
|
case "read":
|
|
3200
|
-
data = await manager.read(connectorId,
|
|
3219
|
+
data = await manager.read(connectorId, path6);
|
|
3201
3220
|
break;
|
|
3202
3221
|
case "write":
|
|
3203
|
-
await manager.write(connectorId,
|
|
3222
|
+
await manager.write(connectorId, path6, content);
|
|
3204
3223
|
data = true;
|
|
3205
3224
|
break;
|
|
3206
3225
|
case "delete":
|
|
3207
|
-
data = await manager.delete(connectorId,
|
|
3226
|
+
data = await manager.delete(connectorId, path6);
|
|
3208
3227
|
break;
|
|
3209
3228
|
case "search":
|
|
3210
3229
|
data = await manager.search(
|
|
3211
3230
|
connectorId,
|
|
3212
|
-
|
|
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
|
|
4285
|
-
const st = await tryWithFsDeadline(`lstat ${
|
|
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:
|
|
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,
|
|
4293
|
-
if (!record2 || record2.path !==
|
|
4294
|
-
const st = await tryWithFsDeadline(`lstat ${
|
|
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(
|
|
4377
|
+
async function pathState(path6) {
|
|
4359
4378
|
try {
|
|
4360
|
-
await withFsDeadline(`lstat ${
|
|
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
|
|
6228
|
-
serverLog.info("claude.ai connectors disabled in user settings", { path:
|
|
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
|
|
9047
|
+
return path5.join(projectDir, SESSION_DIR, SESSIONS_SUBDIR);
|
|
9027
9048
|
}
|
|
9028
9049
|
function sessionFilePath(projectDir, runId) {
|
|
9029
|
-
return
|
|
9050
|
+
return path5.join(sessionsDir(projectDir), `${runId}.json`);
|
|
9030
9051
|
}
|
|
9031
9052
|
function currentPointerPath(projectDir) {
|
|
9032
|
-
return
|
|
9053
|
+
return path5.join(projectDir, SESSION_DIR, CURRENT_FILE);
|
|
9033
9054
|
}
|
|
9034
9055
|
function legacySessionPath(projectDir) {
|
|
9035
|
-
return
|
|
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(
|
|
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(
|
|
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-
|
|
9136
|
-
//# sourceMappingURL=chunk-
|
|
9156
|
+
//# sourceMappingURL=chunk-5HZWDH3L.js.map
|
|
9157
|
+
//# sourceMappingURL=chunk-5HZWDH3L.js.map
|