@skaile/workspaces 4.2.0 → 4.4.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.
- package/CHANGELOG.md +16 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-GTE7AT4E.js → asset-feeds-OBOI2POB.js} +5 -5
- package/dist/{asset-feeds-GTE7AT4E.js.map → asset-feeds-OBOI2POB.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +1 -1
- package/dist/asset-manager/index.js +4 -4
- package/dist/asset-manager/installer.js +2 -2
- package/dist/bridge/codex-app-server.js +2 -2
- package/dist/bridge/drivers/claude-sdk.js +42 -9
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +4 -4
- package/dist/bridge/drivers/continue.js +3 -3
- package/dist/bridge/drivers/echo.js +3 -3
- package/dist/bridge/drivers/gemini.js +4 -4
- package/dist/bridge/drivers/goose.js +3 -3
- package/dist/bridge/drivers/omp.js +1 -1
- package/dist/bridge/drivers/opencode.js +3 -3
- package/dist/bridge/drivers/qwen.js +4 -4
- package/dist/bridge/index.js +6 -6
- package/dist/bridge/src/drivers/claude-sdk.d.ts +14 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/provider-catalog.d.ts +2 -2
- package/dist/bridge/src/provider-materialize/credential-env.d.ts +1 -2
- package/dist/bridge/src/provider-materialize/credential-env.d.ts.map +1 -1
- package/dist/bridge/src/provider-registry-derive.d.ts +6 -35
- package/dist/bridge/src/provider-registry-derive.d.ts.map +1 -1
- package/dist/{chunk-6DI4NTZN.js → chunk-23BTREZQ.js} +3 -3
- package/dist/{chunk-6DI4NTZN.js.map → chunk-23BTREZQ.js.map} +1 -1
- package/dist/{chunk-MLDJHV2U.js → chunk-35XUCUKZ.js} +3 -3
- package/dist/{chunk-MLDJHV2U.js.map → chunk-35XUCUKZ.js.map} +1 -1
- package/dist/{chunk-6G3VM5Y7.js → chunk-3IU5B3YX.js} +3 -3
- package/dist/{chunk-6G3VM5Y7.js.map → chunk-3IU5B3YX.js.map} +1 -1
- package/dist/{chunk-GMKNGIIB.js → chunk-3UAE2BVU.js} +39 -5
- package/dist/chunk-3UAE2BVU.js.map +1 -0
- package/dist/{chunk-NL3XHIVF.js → chunk-52FI7RXZ.js} +5 -5
- package/dist/{chunk-NL3XHIVF.js.map → chunk-52FI7RXZ.js.map} +1 -1
- package/dist/{chunk-27SLKGQW.js → chunk-53MOGLIA.js} +5 -5
- package/dist/{chunk-27SLKGQW.js.map → chunk-53MOGLIA.js.map} +1 -1
- package/dist/{chunk-Q3MY2UOM.js → chunk-62ETRVY3.js} +2 -2
- package/dist/{chunk-Q3MY2UOM.js.map → chunk-62ETRVY3.js.map} +1 -1
- package/dist/{chunk-WO3YLR22.js → chunk-A4UG5BWS.js} +8 -8
- package/dist/{chunk-WO3YLR22.js.map → chunk-A4UG5BWS.js.map} +1 -1
- package/dist/{chunk-SCDXNF3U.js → chunk-BC7BBIDJ.js} +3 -3
- package/dist/{chunk-SCDXNF3U.js.map → chunk-BC7BBIDJ.js.map} +1 -1
- package/dist/{chunk-2RO6N7DN.js → chunk-COK4WPU4.js} +3 -3
- package/dist/{chunk-2RO6N7DN.js.map → chunk-COK4WPU4.js.map} +1 -1
- package/dist/{chunk-KKFXS6WG.js → chunk-D7PYQMNK.js} +5 -5
- package/dist/{chunk-KKFXS6WG.js.map → chunk-D7PYQMNK.js.map} +1 -1
- package/dist/{chunk-KO6EBWBA.js → chunk-EPQHIC6E.js} +4 -4
- package/dist/{chunk-KO6EBWBA.js.map → chunk-EPQHIC6E.js.map} +1 -1
- package/dist/{chunk-KVIMWXO6.js → chunk-FPV4E5DK.js} +4 -4
- package/dist/{chunk-KVIMWXO6.js.map → chunk-FPV4E5DK.js.map} +1 -1
- package/dist/{chunk-FPUEDTXA.js → chunk-FWDTBQCO.js} +5 -5
- package/dist/{chunk-FPUEDTXA.js.map → chunk-FWDTBQCO.js.map} +1 -1
- package/dist/{chunk-TR4FOIL3.js → chunk-HFS22LN2.js} +3 -3
- package/dist/{chunk-TR4FOIL3.js.map → chunk-HFS22LN2.js.map} +1 -1
- package/dist/{chunk-M3A3K4RL.js → chunk-IFXO3KZT.js} +183 -52
- package/dist/chunk-IFXO3KZT.js.map +1 -0
- package/dist/{chunk-O552FCP7.js → chunk-JHBLSPAI.js} +3 -3
- package/dist/{chunk-O552FCP7.js.map → chunk-JHBLSPAI.js.map} +1 -1
- package/dist/{chunk-6HFEEKCT.js → chunk-JUAC5QL4.js} +3 -51
- package/dist/chunk-JUAC5QL4.js.map +1 -0
- package/dist/{chunk-5HT5M5HX.js → chunk-NWZQMJTI.js} +3 -3
- package/dist/{chunk-5HT5M5HX.js.map → chunk-NWZQMJTI.js.map} +1 -1
- package/dist/{chunk-5VZXQVAR.js → chunk-NXH7TTWK.js} +7 -7
- package/dist/{chunk-5VZXQVAR.js.map → chunk-NXH7TTWK.js.map} +1 -1
- package/dist/{chunk-NS7CRWO6.js → chunk-O3XVKALH.js} +8 -8
- package/dist/{chunk-NS7CRWO6.js.map → chunk-O3XVKALH.js.map} +1 -1
- package/dist/{chunk-7YNBVDGL.js → chunk-TAZQ232B.js} +3 -3
- package/dist/{chunk-7YNBVDGL.js.map → chunk-TAZQ232B.js.map} +1 -1
- package/dist/{chunk-3VSRJE3M.js → chunk-UJPVUN6H.js} +24 -40
- package/dist/chunk-UJPVUN6H.js.map +1 -0
- package/dist/{chunk-DY3R7FYY.js → chunk-V2P4ECNY.js} +4 -4
- package/dist/chunk-V2P4ECNY.js.map +1 -0
- package/dist/{chunk-2CJXSHO3.js → chunk-VC4TWNOT.js} +5 -5
- package/dist/{chunk-2CJXSHO3.js.map → chunk-VC4TWNOT.js.map} +1 -1
- package/dist/{chunk-OXTPH6HT.js → chunk-W3YYB7K7.js} +3 -3
- package/dist/{chunk-OXTPH6HT.js.map → chunk-W3YYB7K7.js.map} +1 -1
- package/dist/{chunk-MVBK4JUK.js → chunk-WVSF3IEQ.js} +2 -2
- package/dist/{chunk-MVBK4JUK.js.map → chunk-WVSF3IEQ.js.map} +1 -1
- package/dist/{chunk-SEXKMZHA.js → chunk-YDPT2X6G.js} +4 -4
- package/dist/{chunk-SEXKMZHA.js.map → chunk-YDPT2X6G.js.map} +1 -1
- package/dist/cli/index.js +49 -54
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/setup.d.ts.map +1 -1
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +8 -8
- package/dist/core/index.js +1 -1
- package/dist/core/src/settings.d.ts +8 -17
- package/dist/core/src/settings.d.ts.map +1 -1
- package/dist/deploy/index.js +1 -1
- package/dist/{ensure-sources-VWFKZPU6.js → ensure-sources-XQ4WQAIB.js} +7 -7
- package/dist/{ensure-sources-VWFKZPU6.js.map → ensure-sources-XQ4WQAIB.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +8 -8
- package/dist/factory-assets/connectors/deploy.js +8 -8
- package/dist/factory-assets/connectors/devserver.js +8 -8
- package/dist/factory-assets/connectors/flow/adapter.js +8 -8
- package/dist/factory-assets/connectors/flow/engine.js +2 -2
- package/dist/factory-assets/connectors/flow/run-flow.js +9 -9
- package/dist/factory-assets/connectors/flow.js +8 -8
- package/dist/factory-assets/connectors/git.js +8 -8
- package/dist/factory-assets/connectors/gmail.js +8 -8
- package/dist/factory-assets/connectors/googledrive.js +8 -8
- package/dist/factory-assets/connectors/local.js +8 -8
- package/dist/factory-assets/connectors/mattermost.js +8 -8
- package/dist/factory-assets/connectors/memory.js +8 -8
- package/dist/factory-assets/connectors/minio.js +8 -8
- package/dist/factory-assets/connectors/postgres.js +8 -8
- package/dist/factory-assets/connectors/s3.js +8 -8
- package/dist/factory-assets/connectors/sharepoint.js +8 -8
- package/dist/factory-assets/connectors/sqlite.js +8 -8
- package/dist/factory-assets/connectors/static-server.js +8 -8
- package/dist/factory-assets/connectors/tunnel.js +8 -8
- package/dist/factory-assets/connectors/webdav.js +8 -8
- package/dist/factory-assets/connectors/xstate-store.js +8 -8
- package/dist/factory-assets/connectors/xstate.js +8 -8
- package/dist/{flows-KIQH2VGA.js → flows-X4KJC4RH.js} +4 -4
- package/dist/{flows-KIQH2VGA.js.map → flows-X4KJC4RH.js.map} +1 -1
- package/dist/{helpers-6NM3QS5D.js → helpers-AFXYIAYJ.js} +7 -7
- package/dist/{helpers-6NM3QS5D.js.map → helpers-AFXYIAYJ.js.map} +1 -1
- package/dist/library/index.js +2 -2
- package/dist/library/install.js +1 -1
- package/dist/{library-publish-ESWK6ENF.js → library-publish-ZDLQ5PHJ.js} +11 -11
- package/dist/{library-publish-ESWK6ENF.js.map → library-publish-ZDLQ5PHJ.js.map} +1 -1
- package/dist/{open-library-LNJ7GYFG.js → open-library-Q44MES2N.js} +9 -9
- package/dist/{open-library-LNJ7GYFG.js.map → open-library-Q44MES2N.js.map} +1 -1
- package/dist/{paths-XLSP5K6C.js → paths-FRD62K2N.js} +3 -3
- package/dist/{paths-XLSP5K6C.js.map → paths-FRD62K2N.js.map} +1 -1
- package/dist/{plugin-store-V5BMOYGS.js → plugin-store-54SEASTK.js} +3 -3
- package/dist/{plugin-store-V5BMOYGS.js.map → plugin-store-54SEASTK.js.map} +1 -1
- package/dist/{project-E3G3FUBY.js → project-2UJVJYPS.js} +8 -8
- package/dist/{project-E3G3FUBY.js.map → project-2UJVJYPS.js.map} +1 -1
- package/dist/resolver/index.js +1 -1
- package/dist/runner/index.js +13 -13
- package/dist/runner/src/resource-handler.d.ts +40 -1
- package/dist/runner/src/resource-handler.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +4 -4
- package/dist/sdk/bridge.js +6 -6
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/flow.js +2 -2
- package/dist/sdk/index.js +13 -13
- package/dist/sdk/resolver.js +1 -1
- package/dist/sdk/runner.js +13 -13
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/store.js +1 -1
- package/dist/sdk/types.js +1 -1
- package/dist/session/index.js +2 -2
- package/dist/{setup-VSWAFEZ2.js → setup-LPTQRR6B.js} +13 -14
- package/dist/setup-LPTQRR6B.js.map +1 -0
- package/dist/{skills-KHBYF6AU.js → skills-C6NOMIBV.js} +3 -3
- package/dist/{skills-KHBYF6AU.js.map → skills-C6NOMIBV.js.map} +1 -1
- package/dist/{source-ZQEVI3HJ.js → source-KSNC6ZYY.js} +10 -10
- package/dist/{source-ZQEVI3HJ.js.map → source-KSNC6ZYY.js.map} +1 -1
- package/dist/{source-manifest-publish-RHPXNAS6.js → source-manifest-publish-QQYA6ZGP.js} +12 -12
- package/dist/{source-manifest-publish-RHPXNAS6.js.map → source-manifest-publish-QQYA6ZGP.js.map} +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/src/index.d.ts +1 -1
- package/dist/store/src/index.d.ts.map +1 -1
- package/dist/store/src/resource-client.d.ts +32 -2
- package/dist/store/src/resource-client.d.ts.map +1 -1
- package/dist/tui/index.js +13 -13
- package/dist/types/index.js +1 -1
- package/dist/types/src/events.d.ts +100 -4
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/protocol.d.ts +3 -3
- package/dist/types/src/protocol.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +11 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +4 -4
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3VSRJE3M.js.map +0 -1
- package/dist/chunk-6HFEEKCT.js.map +0 -1
- package/dist/chunk-DY3R7FYY.js.map +0 -1
- package/dist/chunk-GMKNGIIB.js.map +0 -1
- package/dist/chunk-M3A3K4RL.js.map +0 -1
- package/dist/setup-VSWAFEZ2.js.map +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { WorkspacePlugin } from './chunk-
|
|
2
|
-
import { buildWorkspaceToolDefs } from './chunk-
|
|
1
|
+
import { WorkspacePlugin } from './chunk-62ETRVY3.js';
|
|
2
|
+
import { buildWorkspaceToolDefs } from './chunk-EPQHIC6E.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
6
|
import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-45LLHKQ2.js';
|
|
7
|
-
import { resolveFlowPath } from './chunk-
|
|
7
|
+
import { resolveFlowPath } from './chunk-FWDTBQCO.js';
|
|
8
8
|
import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-7BUZQVRR.js';
|
|
9
|
-
import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-
|
|
9
|
+
import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-O3XVKALH.js';
|
|
10
10
|
import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, isKnownSecretRef, deriveSingleMaterializedConnectorDeclaration } from './chunk-KW7YIRYL.js';
|
|
11
|
-
import { EventNormalizer } from './chunk-
|
|
11
|
+
import { EventNormalizer } from './chunk-YDPT2X6G.js';
|
|
12
12
|
import { probeResumeTranscript } from './chunk-WLFRA5RM.js';
|
|
13
13
|
import { CodexNativeStateUnavailable } from './chunk-LOO5CB5M.js';
|
|
14
|
-
import { dispatchCapability } from './chunk-
|
|
14
|
+
import { dispatchCapability } from './chunk-TAZQ232B.js';
|
|
15
15
|
import { classifyClaudeSdkError } from './chunk-GAH4YRCI.js';
|
|
16
|
-
import {
|
|
17
|
-
import { loadFlow } from './chunk-
|
|
16
|
+
import { createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv } from './chunk-JUAC5QL4.js';
|
|
17
|
+
import { loadFlow } from './chunk-NWZQMJTI.js';
|
|
18
18
|
import { parseFlowDefinition } from './chunk-53ORCYPJ.js';
|
|
19
19
|
import { renderStimulusPrompt } from './chunk-2D5BYAL6.js';
|
|
20
|
-
import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-
|
|
21
|
-
import { resolveSettings, loadProviderRegistry } from './chunk-
|
|
20
|
+
import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-V2P4ECNY.js';
|
|
21
|
+
import { resolveSettings, loadProviderRegistry } from './chunk-UJPVUN6H.js';
|
|
22
22
|
import { resolveRuntimeAssets } from './chunk-REILIKVM.js';
|
|
23
23
|
import { resolveDriverPaths } from './chunk-K5GBV4SA.js';
|
|
24
24
|
import { resolveSkWorkspaceConfig, resolveAgentDir, stageMaterializedSkills, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration } from './chunk-K27T47OO.js';
|
|
25
|
-
import { withFsDeadline,
|
|
25
|
+
import { withFsDeadline, FsDeadlineError, fsDeadlineMs, tryWithFsDeadline } from './chunk-MKZOK4JU.js';
|
|
26
26
|
import { parseAssetRef } from './chunk-GEEW6SY2.js';
|
|
27
27
|
import { resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink } from './chunk-FTG7CRFD.js';
|
|
28
28
|
import { registryEntries, resolveEntryBaseUrl } from './chunk-ILG4BXYE.js';
|
|
@@ -31,9 +31,9 @@ import { __require } from './chunk-NSBPE2FW.js';
|
|
|
31
31
|
import pc from 'picocolors';
|
|
32
32
|
import { Marked } from 'marked';
|
|
33
33
|
import { markedTerminal } from 'marked-terminal';
|
|
34
|
-
import fs4, { readFile, stat, rm, unlink, mkdir, writeFile,
|
|
34
|
+
import fs4, { readFile, readdir, lstat, stat, rm, unlink, mkdir, writeFile, realpath, rename, readlink, mkdtemp } from 'fs/promises';
|
|
35
35
|
import { createHash, randomBytes, timingSafeEqual, randomUUID } from 'crypto';
|
|
36
|
-
import path4, { join, resolve, relative, sep, isAbsolute,
|
|
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';
|
|
@@ -2254,16 +2254,9 @@ async function createAgentSession(config) {
|
|
|
2254
2254
|
});
|
|
2255
2255
|
const driverType = managed ? "codex" : settings.driver ?? "omp";
|
|
2256
2256
|
const model = managed ? config.model : settings.model;
|
|
2257
|
-
const
|
|
2258
|
-
if (legacyKeys?.deprecation) sessionLog.debug(legacyKeys.deprecation);
|
|
2259
|
-
const registry = loadSessionRegistry(
|
|
2260
|
-
projectDir,
|
|
2261
|
-
config.registry,
|
|
2262
|
-
legacyKeys?.providers,
|
|
2263
|
-
sessionLog
|
|
2264
|
-
);
|
|
2257
|
+
const registry = loadSessionRegistry(projectDir, config.registry, sessionLog);
|
|
2265
2258
|
const modelRef = config.modelRef?.trim() || model?.trim() || void 0;
|
|
2266
|
-
const credentialEnv = { ...
|
|
2259
|
+
const credentialEnv = { ...config.credentialEnv };
|
|
2267
2260
|
const manifest = agentDir ? await loadAgentManifest(agentDir) : void 0;
|
|
2268
2261
|
const {
|
|
2269
2262
|
resourceManager,
|
|
@@ -2441,10 +2434,8 @@ function createManagedCodexSubpromptDriver(config, model, cwd, privateDirectory)
|
|
|
2441
2434
|
}
|
|
2442
2435
|
});
|
|
2443
2436
|
}
|
|
2444
|
-
function loadSessionRegistry(projectDir, sessionRegistry,
|
|
2437
|
+
function loadSessionRegistry(projectDir, sessionRegistry, log) {
|
|
2445
2438
|
const extraLayers = [];
|
|
2446
|
-
if (legacyApiKeyProviders && Object.keys(legacyApiKeyProviders).length > 0)
|
|
2447
|
-
extraLayers.push({ layer: "user", providers: legacyApiKeyProviders });
|
|
2448
2439
|
if (sessionRegistry && Object.keys(sessionRegistry).length > 0)
|
|
2449
2440
|
extraLayers.push({ layer: "session", providers: sessionRegistry });
|
|
2450
2441
|
const first = loadProviderRegistry({ projectDir, extraLayers });
|
|
@@ -3153,6 +3144,30 @@ function rejectCapabilityOnApprovalDeny(pending, callId, feedback) {
|
|
|
3153
3144
|
entry.reject(new Error(feedback ?? "declined by user"));
|
|
3154
3145
|
return true;
|
|
3155
3146
|
}
|
|
3147
|
+
var ResourceOperationError = class extends Error {
|
|
3148
|
+
constructor(message, code) {
|
|
3149
|
+
super(message);
|
|
3150
|
+
this.code = code;
|
|
3151
|
+
this.name = "ResourceOperationError";
|
|
3152
|
+
}
|
|
3153
|
+
code;
|
|
3154
|
+
};
|
|
3155
|
+
function unsupportedOperation(operation, target) {
|
|
3156
|
+
return new ResourceOperationError(
|
|
3157
|
+
`Unsupported operation for ${target}: ${operation}`,
|
|
3158
|
+
"unsupported_operation"
|
|
3159
|
+
);
|
|
3160
|
+
}
|
|
3161
|
+
function errorResponse(command, resourceId, err) {
|
|
3162
|
+
return {
|
|
3163
|
+
type: "resource_response",
|
|
3164
|
+
requestId: command.requestId,
|
|
3165
|
+
resourceId,
|
|
3166
|
+
operation: command.operation,
|
|
3167
|
+
error: err instanceof Error ? err.message : String(err),
|
|
3168
|
+
...err instanceof ResourceOperationError ? { code: err.code } : {}
|
|
3169
|
+
};
|
|
3170
|
+
}
|
|
3156
3171
|
async function handleResourceRequest(command, manager, emit) {
|
|
3157
3172
|
const { requestId, connectorId, operation, path: path5, options, content } = command;
|
|
3158
3173
|
try {
|
|
@@ -3182,22 +3197,96 @@ async function handleResourceRequest(command, manager, emit) {
|
|
|
3182
3197
|
options
|
|
3183
3198
|
);
|
|
3184
3199
|
break;
|
|
3200
|
+
default:
|
|
3201
|
+
throw unsupportedOperation(operation, "connector");
|
|
3185
3202
|
}
|
|
3186
3203
|
emit({ type: "resource_response", requestId, resourceId: connectorId, operation, data });
|
|
3187
3204
|
} catch (err) {
|
|
3188
|
-
emit(
|
|
3189
|
-
type: "resource_response",
|
|
3190
|
-
requestId,
|
|
3191
|
-
resourceId: connectorId,
|
|
3192
|
-
operation,
|
|
3193
|
-
error: err instanceof Error ? err.message : String(err)
|
|
3194
|
-
});
|
|
3205
|
+
emit(errorResponse(command, connectorId, err));
|
|
3195
3206
|
}
|
|
3196
3207
|
}
|
|
3197
3208
|
var MOUNT_LIST_MAX_DEPTH = 32;
|
|
3198
3209
|
var MOUNT_LIST_MAX_ENTRIES = 1e4;
|
|
3199
3210
|
var MOUNT_TREE_OP_DEADLINE_FACTOR = 4;
|
|
3200
3211
|
var MOUNT_READ_DEADLINE_FACTOR = 4;
|
|
3212
|
+
var MOUNT_STAT_MAX_ENTRIES = 5e4;
|
|
3213
|
+
var MOUNT_STAT_BUDGET_MS = 1e4;
|
|
3214
|
+
var MOUNT_STAT_CONCURRENCY = 16;
|
|
3215
|
+
function lowerCap(requested, cap) {
|
|
3216
|
+
return typeof requested === "number" && Number.isFinite(requested) && requested > 0 ? Math.min(Math.floor(requested), cap) : cap;
|
|
3217
|
+
}
|
|
3218
|
+
function isoTime(time) {
|
|
3219
|
+
const ms = time.getTime();
|
|
3220
|
+
return Number.isFinite(ms) && ms > 0 ? time.toISOString() : void 0;
|
|
3221
|
+
}
|
|
3222
|
+
async function computeDirectoryTotals(root, opts, clock = Date.now) {
|
|
3223
|
+
const deadline = clock() + opts.budgetMs;
|
|
3224
|
+
const totals = { files: 0, directories: 0, bytes: 0, partial: false };
|
|
3225
|
+
const markPartial = (why) => {
|
|
3226
|
+
totals.partial = true;
|
|
3227
|
+
if (why && (!totals.stoppedBy || why !== "depth")) totals.stoppedBy = why;
|
|
3228
|
+
};
|
|
3229
|
+
let stopped = false;
|
|
3230
|
+
let seen = 0;
|
|
3231
|
+
const pending = [{ abs: root, depth: 0 }];
|
|
3232
|
+
while (pending.length > 0 && !stopped) {
|
|
3233
|
+
if (clock() >= deadline) {
|
|
3234
|
+
markPartial("time");
|
|
3235
|
+
break;
|
|
3236
|
+
}
|
|
3237
|
+
const { abs, depth } = pending.pop();
|
|
3238
|
+
let dirents;
|
|
3239
|
+
try {
|
|
3240
|
+
dirents = await withFsDeadline(`readdir ${abs}`, () => readdir(abs, { withFileTypes: true }));
|
|
3241
|
+
} catch (err) {
|
|
3242
|
+
if (err instanceof FsDeadlineError || abs === root) throw err;
|
|
3243
|
+
if (err.code === "ENOENT") {
|
|
3244
|
+
totals.directories--;
|
|
3245
|
+
continue;
|
|
3246
|
+
}
|
|
3247
|
+
totals.unreadable = (totals.unreadable ?? 0) + 1;
|
|
3248
|
+
markPartial();
|
|
3249
|
+
continue;
|
|
3250
|
+
}
|
|
3251
|
+
const files = [];
|
|
3252
|
+
for (const e of dirents) {
|
|
3253
|
+
if (!opts.includeHidden && e.name.startsWith(".")) continue;
|
|
3254
|
+
if (seen >= opts.maxEntries) {
|
|
3255
|
+
markPartial("entries");
|
|
3256
|
+
stopped = true;
|
|
3257
|
+
break;
|
|
3258
|
+
}
|
|
3259
|
+
seen++;
|
|
3260
|
+
if (e.isDirectory()) {
|
|
3261
|
+
totals.directories++;
|
|
3262
|
+
if (depth + 1 > opts.maxDepth) markPartial("depth");
|
|
3263
|
+
else pending.push({ abs: join(abs, e.name), depth: depth + 1 });
|
|
3264
|
+
} else {
|
|
3265
|
+
totals.files++;
|
|
3266
|
+
files.push(join(abs, e.name));
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
for (let i = 0; i < files.length; i += MOUNT_STAT_CONCURRENCY) {
|
|
3270
|
+
if (clock() >= deadline) {
|
|
3271
|
+
markPartial("time");
|
|
3272
|
+
stopped = true;
|
|
3273
|
+
break;
|
|
3274
|
+
}
|
|
3275
|
+
const sizes = await Promise.all(
|
|
3276
|
+
files.slice(i, i + MOUNT_STAT_CONCURRENCY).map(async (file) => {
|
|
3277
|
+
try {
|
|
3278
|
+
return (await withFsDeadline(`lstat ${file}`, () => lstat(file))).size;
|
|
3279
|
+
} catch (err) {
|
|
3280
|
+
if (err instanceof FsDeadlineError) throw err;
|
|
3281
|
+
return 0;
|
|
3282
|
+
}
|
|
3283
|
+
})
|
|
3284
|
+
);
|
|
3285
|
+
for (const size of sizes) totals.bytes += size;
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
return totals;
|
|
3289
|
+
}
|
|
3201
3290
|
function getMimeType(filename) {
|
|
3202
3291
|
return mime.getType(filename) ?? "application/octet-stream";
|
|
3203
3292
|
}
|
|
@@ -3223,7 +3312,10 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
3223
3312
|
const entry = manager.get(mountId);
|
|
3224
3313
|
const mountPath = entry.handle.mountPath;
|
|
3225
3314
|
if (!mountPath) {
|
|
3226
|
-
throw new
|
|
3315
|
+
throw new ResourceOperationError(
|
|
3316
|
+
`Connector "${mountId}" has no projected mount directory`,
|
|
3317
|
+
"unsupported_operation"
|
|
3318
|
+
);
|
|
3227
3319
|
}
|
|
3228
3320
|
const targetPath = reqPath ? resolve(mountPath, reqPath) : mountPath;
|
|
3229
3321
|
const rel = relative(mountPath, targetPath);
|
|
@@ -3324,6 +3416,49 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
3324
3416
|
data = true;
|
|
3325
3417
|
break;
|
|
3326
3418
|
}
|
|
3419
|
+
case "mkdir": {
|
|
3420
|
+
if (rel === "") throw new Error("A folder path is required");
|
|
3421
|
+
const parentDir = dirname(targetPath);
|
|
3422
|
+
await withFsDeadline(`mkdir ${parentDir}`, () => mkdir(parentDir, { recursive: true }));
|
|
3423
|
+
try {
|
|
3424
|
+
await withFsDeadline(`mkdir ${targetPath}`, () => mkdir(targetPath));
|
|
3425
|
+
} catch (mkdirErr) {
|
|
3426
|
+
if (mkdirErr.code === "EEXIST") {
|
|
3427
|
+
throw new ResourceOperationError(
|
|
3428
|
+
`"${rel.split(sep).join("/")}" already exists`,
|
|
3429
|
+
"already_exists"
|
|
3430
|
+
);
|
|
3431
|
+
}
|
|
3432
|
+
throw mkdirErr;
|
|
3433
|
+
}
|
|
3434
|
+
data = true;
|
|
3435
|
+
break;
|
|
3436
|
+
}
|
|
3437
|
+
case "stat": {
|
|
3438
|
+
const statOptions = options;
|
|
3439
|
+
const st = await withFsDeadline(`stat ${targetPath}`, () => stat(targetPath));
|
|
3440
|
+
const isDir = st.isDirectory();
|
|
3441
|
+
const result = {
|
|
3442
|
+
name: rel === "" ? "" : basename(targetPath),
|
|
3443
|
+
path: rel.split(sep).join("/"),
|
|
3444
|
+
type: isDir ? "directory" : "file"
|
|
3445
|
+
};
|
|
3446
|
+
if (!isDir) result.size = st.size;
|
|
3447
|
+
const modifiedAt = isoTime(st.mtime);
|
|
3448
|
+
if (modifiedAt) result.modifiedAt = modifiedAt;
|
|
3449
|
+
const createdAt = isoTime(st.birthtime);
|
|
3450
|
+
if (createdAt) result.createdAt = createdAt;
|
|
3451
|
+
if (isDir && statOptions?.recursive) {
|
|
3452
|
+
result.totals = await computeDirectoryTotals(targetPath, {
|
|
3453
|
+
includeHidden: Boolean(statOptions.includeHidden),
|
|
3454
|
+
maxEntries: lowerCap(statOptions.maxEntries, MOUNT_STAT_MAX_ENTRIES),
|
|
3455
|
+
budgetMs: lowerCap(statOptions.timeoutMs, MOUNT_STAT_BUDGET_MS),
|
|
3456
|
+
maxDepth: MOUNT_LIST_MAX_DEPTH
|
|
3457
|
+
});
|
|
3458
|
+
}
|
|
3459
|
+
data = result;
|
|
3460
|
+
break;
|
|
3461
|
+
}
|
|
3327
3462
|
case "delete": {
|
|
3328
3463
|
const st = await withFsDeadline(`stat ${targetPath}`, () => stat(targetPath));
|
|
3329
3464
|
if (st.isDirectory()) {
|
|
@@ -3339,17 +3474,11 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
3339
3474
|
break;
|
|
3340
3475
|
}
|
|
3341
3476
|
default:
|
|
3342
|
-
throw
|
|
3477
|
+
throw unsupportedOperation(operation, "mount");
|
|
3343
3478
|
}
|
|
3344
3479
|
emit({ type: "resource_response", requestId, resourceId: mountId, operation, data });
|
|
3345
3480
|
} catch (err) {
|
|
3346
|
-
emit(
|
|
3347
|
-
type: "resource_response",
|
|
3348
|
-
requestId,
|
|
3349
|
-
resourceId: mountId,
|
|
3350
|
-
operation,
|
|
3351
|
-
error: err instanceof Error ? err.message : String(err)
|
|
3352
|
-
});
|
|
3481
|
+
emit(errorResponse(command, mountId, err));
|
|
3353
3482
|
}
|
|
3354
3483
|
}
|
|
3355
3484
|
var SESSION_ROOT_WRITABLE_FILES = ["skaile.yaml"];
|
|
@@ -3410,7 +3539,7 @@ async function handleSessionRootResourceRequest(command, rootDir, emit) {
|
|
|
3410
3539
|
const { requestId, connectorId, operation, path: reqPath, content } = command;
|
|
3411
3540
|
try {
|
|
3412
3541
|
if (operation !== "write" && operation !== "delete") {
|
|
3413
|
-
throw
|
|
3542
|
+
throw unsupportedOperation(operation, "the session root");
|
|
3414
3543
|
}
|
|
3415
3544
|
if (!reqPath) throw new Error("A path is required for the session root");
|
|
3416
3545
|
if (isAbsolute(reqPath)) throw new Error("Absolute paths are not allowed for the session root");
|
|
@@ -3459,13 +3588,7 @@ async function handleSessionRootResourceRequest(command, rootDir, emit) {
|
|
|
3459
3588
|
}
|
|
3460
3589
|
emit({ type: "resource_response", requestId, resourceId: connectorId, operation, data });
|
|
3461
3590
|
} catch (err) {
|
|
3462
|
-
emit(
|
|
3463
|
-
type: "resource_response",
|
|
3464
|
-
requestId,
|
|
3465
|
-
resourceId: connectorId,
|
|
3466
|
-
operation,
|
|
3467
|
-
error: err instanceof Error ? err.message : String(err)
|
|
3468
|
-
});
|
|
3591
|
+
emit(errorResponse(command, connectorId, err));
|
|
3469
3592
|
}
|
|
3470
3593
|
}
|
|
3471
3594
|
async function dispatchResourceRequest(command, deps) {
|
|
@@ -7934,6 +8057,7 @@ async function startAgentServer(opts) {
|
|
|
7934
8057
|
let pendingResumeSessionId;
|
|
7935
8058
|
const cfgResumeSessionId = cfg.resumeSessionId;
|
|
7936
8059
|
const cfgExpectedSig = cfg.expectedCapabilitySignature;
|
|
8060
|
+
const resumeTargetDriver = managedCodex ? "codex" : opts.driver ?? wireAgentConfig?.driver ?? agentSession?.driverType;
|
|
7937
8061
|
if (cfgResumeSessionId) {
|
|
7938
8062
|
const currentSig = computeCapabilitySignature(capabilityRegistry.list());
|
|
7939
8063
|
if (cfgExpectedSig && cfgExpectedSig !== currentSig) {
|
|
@@ -7945,6 +8069,13 @@ async function startAgentServer(opts) {
|
|
|
7945
8069
|
resumeSessionId: cfgResumeSessionId,
|
|
7946
8070
|
reason: "signature_mismatch"
|
|
7947
8071
|
});
|
|
8072
|
+
} else if (resumeProbe === "jsonl_lost" && resumeTargetDriver === "claude-sdk") {
|
|
8073
|
+
log(`[serve] tier-1 resume skipped: no transcript for ${cfgResumeSessionId}`);
|
|
8074
|
+
sendEvent({
|
|
8075
|
+
type: "resume_failed",
|
|
8076
|
+
resumeSessionId: cfgResumeSessionId,
|
|
8077
|
+
reason: "jsonl_lost"
|
|
8078
|
+
});
|
|
7948
8079
|
} else {
|
|
7949
8080
|
log(`[serve] tier-1 resume attempted: resumeSessionId=${cfgResumeSessionId}`);
|
|
7950
8081
|
sendEvent({
|
|
@@ -8669,6 +8800,6 @@ function touchSession(state) {
|
|
|
8669
8800
|
return { ...state, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
8670
8801
|
}
|
|
8671
8802
|
|
|
8672
|
-
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, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildStoreSnapshotReplay, builtinCapabilities, capabilityLogInstance, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, 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 };
|
|
8673
|
-
//# sourceMappingURL=chunk-
|
|
8674
|
-
//# sourceMappingURL=chunk-
|
|
8803
|
+
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 };
|
|
8804
|
+
//# sourceMappingURL=chunk-IFXO3KZT.js.map
|
|
8805
|
+
//# sourceMappingURL=chunk-IFXO3KZT.js.map
|