@skaile/workspaces 4.9.0 → 4.9.2
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/{asset-feeds-UHUJ7ALH.js → asset-feeds-ZKMRNVV2.js} +6 -5
- package/dist/asset-feeds-ZKMRNVV2.js.map +1 -0
- package/dist/asset-manager/catalog-deployer.js +2 -1
- package/dist/asset-manager/index.js +5 -4
- package/dist/asset-manager/installer.js +3 -2
- package/dist/bridge/codex-app-server.js +2 -15
- package/dist/bridge/drivers/claude-sdk.js +4 -3
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +5 -4
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +4 -3
- package/dist/bridge/drivers/continue.js.map +1 -1
- package/dist/bridge/drivers/echo.js +1 -1
- package/dist/bridge/drivers/gemini.js +4 -4
- package/dist/bridge/drivers/goose.js +4 -3
- package/dist/bridge/drivers/goose.js.map +1 -1
- package/dist/bridge/drivers/omp.js +1 -1
- package/dist/bridge/drivers/opencode.js +4 -3
- package/dist/bridge/drivers/opencode.js.map +1 -1
- package/dist/bridge/drivers/qwen.js +4 -4
- package/dist/bridge/index.js +5 -4
- package/dist/bridge/src/codex-app-server.d.ts.map +1 -1
- package/dist/{chunk-2PGVW3FL.js → chunk-4F2L7WPU.js} +3 -3
- package/dist/chunk-4F2L7WPU.js.map +1 -0
- package/dist/chunk-4GY63JU6.js +63 -0
- package/dist/chunk-4GY63JU6.js.map +1 -0
- package/dist/{chunk-D6FPKO62.js → chunk-5OZVZI2E.js} +2 -2
- package/dist/{chunk-D6FPKO62.js.map → chunk-5OZVZI2E.js.map} +1 -1
- package/dist/{chunk-ERYOLF7V.js → chunk-5VKBD3QV.js} +5 -5
- package/dist/{chunk-ERYOLF7V.js.map → chunk-5VKBD3QV.js.map} +1 -1
- package/dist/{chunk-2FDOV5JG.js → chunk-5YB4GYMB.js} +118 -13
- package/dist/chunk-5YB4GYMB.js.map +1 -0
- package/dist/{chunk-HA3XJN65.js → chunk-6DN6U2CK.js} +3 -3
- package/dist/{chunk-HA3XJN65.js.map → chunk-6DN6U2CK.js.map} +1 -1
- package/dist/{chunk-7644QU3C.js → chunk-6QMWCPME.js} +7 -7
- package/dist/{chunk-7644QU3C.js.map → chunk-6QMWCPME.js.map} +1 -1
- package/dist/{chunk-LOCIJAS3.js → chunk-6YIFJW2I.js} +141 -29
- package/dist/chunk-6YIFJW2I.js.map +1 -0
- package/dist/{chunk-FSRWPLIQ.js → chunk-7LBL25WI.js} +3 -3
- package/dist/{chunk-FSRWPLIQ.js.map → chunk-7LBL25WI.js.map} +1 -1
- package/dist/{chunk-HUF4ON2C.js → chunk-7LHSC2DS.js} +3 -3
- package/dist/{chunk-HUF4ON2C.js.map → chunk-7LHSC2DS.js.map} +1 -1
- package/dist/{chunk-ZH3YEVKN.js → chunk-7ZYKHL6Y.js} +5 -5
- package/dist/{chunk-ZH3YEVKN.js.map → chunk-7ZYKHL6Y.js.map} +1 -1
- package/dist/{chunk-6J3L2CZ7.js → chunk-AF3ETSXF.js} +3 -3
- package/dist/{chunk-6J3L2CZ7.js.map → chunk-AF3ETSXF.js.map} +1 -1
- package/dist/{chunk-SJYOKKYO.js → chunk-AOE4KOMJ.js} +3 -3
- package/dist/{chunk-SJYOKKYO.js.map → chunk-AOE4KOMJ.js.map} +1 -1
- package/dist/{chunk-V62CAMBD.js → chunk-BZBRCPEB.js} +5 -5
- package/dist/{chunk-V62CAMBD.js.map → chunk-BZBRCPEB.js.map} +1 -1
- package/dist/{chunk-I7SQIWYX.js → chunk-CJCZIWW6.js} +3 -3
- package/dist/{chunk-I7SQIWYX.js.map → chunk-CJCZIWW6.js.map} +1 -1
- package/dist/{chunk-WLPL7CRM.js → chunk-DB6H7M5O.js} +2 -2
- package/dist/{chunk-WLPL7CRM.js.map → chunk-DB6H7M5O.js.map} +1 -1
- package/dist/{chunk-5WNQPXEG.js → chunk-GFU367UH.js} +3 -59
- package/dist/chunk-GFU367UH.js.map +1 -0
- package/dist/{chunk-5PF5OIQK.js → chunk-NHZR3NVY.js} +3 -3
- package/dist/{chunk-5PF5OIQK.js.map → chunk-NHZR3NVY.js.map} +1 -1
- package/dist/{chunk-KYE66EEM.js → chunk-OZAF24OQ.js} +8 -8
- package/dist/{chunk-KYE66EEM.js.map → chunk-OZAF24OQ.js.map} +1 -1
- package/dist/{chunk-WQ5BCHQS.js → chunk-QBH7PC4D.js} +2 -2
- package/dist/{chunk-WQ5BCHQS.js.map → chunk-QBH7PC4D.js.map} +1 -1
- package/dist/{chunk-I7IWIVXY.js → chunk-S4RYZDBB.js} +3 -3
- package/dist/{chunk-I7IWIVXY.js.map → chunk-S4RYZDBB.js.map} +1 -1
- package/dist/{chunk-BHBXWDQU.js → chunk-TAHJRTAD.js} +5 -5
- package/dist/{chunk-BHBXWDQU.js.map → chunk-TAHJRTAD.js.map} +1 -1
- package/dist/{chunk-6LEVXQAS.js → chunk-TLMDSUEL.js} +3 -3
- package/dist/{chunk-6LEVXQAS.js.map → chunk-TLMDSUEL.js.map} +1 -1
- package/dist/{chunk-PZ6AUBGY.js → chunk-X5VZOIAP.js} +4 -4
- package/dist/{chunk-PZ6AUBGY.js.map → chunk-X5VZOIAP.js.map} +1 -1
- package/dist/{chunk-TVXLXNQE.js → chunk-XJLB4OH2.js} +5 -5
- package/dist/{chunk-TVXLXNQE.js.map → chunk-XJLB4OH2.js.map} +1 -1
- package/dist/cli/index.js +46 -45
- package/dist/cli/index.js.map +1 -1
- package/dist/connectors/config.js +2 -1
- package/dist/connectors/index.js +7 -6
- package/dist/core/index.js +2 -1
- package/dist/deploy/index.js +2 -1
- package/dist/deploy/index.js.map +1 -1
- package/dist/deploy/src/targets/process-handle.d.ts.map +1 -1
- package/dist/{ensure-sources-2LFWDM3X.js → ensure-sources-FRG6HKPM.js} +8 -7
- package/dist/ensure-sources-FRG6HKPM.js.map +1 -0
- package/dist/factory-assets/connectors/box.js +7 -6
- package/dist/factory-assets/connectors/deploy.js +7 -6
- package/dist/factory-assets/connectors/devserver/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/devserver.js +7 -6
- package/dist/factory-assets/connectors/flow/adapter.js +7 -6
- package/dist/factory-assets/connectors/flow/engine.js +3 -2
- package/dist/factory-assets/connectors/flow/run-flow.js +8 -7
- package/dist/factory-assets/connectors/flow.js +7 -6
- package/dist/factory-assets/connectors/git/CONNECTOR.md +2 -1
- package/dist/factory-assets/connectors/git/driver.d.ts +25 -0
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +7 -6
- package/dist/factory-assets/connectors/gmail.js +7 -6
- package/dist/factory-assets/connectors/googledrive.js +7 -6
- package/dist/factory-assets/connectors/local.js +7 -6
- package/dist/factory-assets/connectors/mattermost.js +7 -6
- package/dist/factory-assets/connectors/memory.js +7 -6
- package/dist/factory-assets/connectors/minio.js +7 -6
- package/dist/factory-assets/connectors/postgres.js +7 -6
- package/dist/factory-assets/connectors/s3.js +7 -6
- package/dist/factory-assets/connectors/sharepoint.js +7 -6
- package/dist/factory-assets/connectors/sqlite.js +7 -6
- package/dist/factory-assets/connectors/static-server.js +7 -6
- package/dist/factory-assets/connectors/tunnel.js +7 -6
- package/dist/factory-assets/connectors/webdav.js +7 -6
- package/dist/factory-assets/connectors/xstate-store.js +7 -6
- package/dist/factory-assets/connectors/xstate.js +7 -6
- package/dist/{flows-EO5CO3A3.js → flows-377JICTL.js} +5 -4
- package/dist/{flows-EO5CO3A3.js.map → flows-377JICTL.js.map} +1 -1
- package/dist/{helpers-NR3YI5RG.js → helpers-JHGUA7T7.js} +8 -7
- package/dist/{helpers-NR3YI5RG.js.map → helpers-JHGUA7T7.js.map} +1 -1
- package/dist/library/index.js +3 -2
- package/dist/library/install.js +2 -1
- package/dist/{library-publish-ZHO7XA5C.js → library-publish-CUFLZUEV.js} +12 -11
- package/dist/library-publish-CUFLZUEV.js.map +1 -0
- package/dist/{open-library-F7JM7RDR.js → open-library-ZI6TWEM6.js} +10 -9
- package/dist/{open-library-F7JM7RDR.js.map → open-library-ZI6TWEM6.js.map} +1 -1
- package/dist/{paths-HWWTOYUY.js → paths-WJUPZXFS.js} +4 -3
- package/dist/{paths-HWWTOYUY.js.map → paths-WJUPZXFS.js.map} +1 -1
- package/dist/{plugin-store-VJYXFXP5.js → plugin-store-ZW4GDES3.js} +4 -3
- package/dist/plugin-store-ZW4GDES3.js.map +1 -0
- package/dist/{project-HIOOMV4D.js → project-TVZ6Y6AR.js} +9 -8
- package/dist/{project-HIOOMV4D.js.map → project-TVZ6Y6AR.js.map} +1 -1
- package/dist/resolver/index.js +2 -1
- package/dist/runner/index.js +12 -11
- package/dist/runner/src/lifecycle-handler.d.ts +2 -0
- package/dist/runner/src/lifecycle-handler.d.ts.map +1 -1
- package/dist/runner/src/runner-capabilities.d.ts +7 -2
- package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
- package/dist/runner/src/serve-credentials.d.ts +66 -0
- package/dist/runner/src/serve-credentials.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +5 -4
- package/dist/sdk/bridge.js +5 -4
- package/dist/sdk/core.js +2 -1
- package/dist/sdk/flow.js +3 -2
- package/dist/sdk/index.js +12 -11
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +2 -1
- package/dist/sdk/runner.js +12 -11
- package/dist/{setup-P4J7EN6S.js → setup-54FNPLTS.js} +12 -11
- package/dist/setup-54FNPLTS.js.map +1 -0
- package/dist/{skills-DNCI6ITW.js → skills-J6KZ2WUT.js} +4 -3
- package/dist/{skills-DNCI6ITW.js.map → skills-J6KZ2WUT.js.map} +1 -1
- package/dist/{source-S4DM4ZFQ.js → source-SPMRD7S2.js} +11 -10
- package/dist/{source-S4DM4ZFQ.js.map → source-SPMRD7S2.js.map} +1 -1
- package/dist/{source-manifest-publish-ABXDZTVG.js → source-manifest-publish-3LSSDCSI.js} +13 -12
- package/dist/source-manifest-publish-3LSSDCSI.js.map +1 -0
- package/dist/tui/index.js +12 -11
- package/dist/tui/index.js.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +4 -3
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +2 -1
- package/dist/asset-feeds-UHUJ7ALH.js.map +0 -1
- package/dist/chunk-2FDOV5JG.js.map +0 -1
- package/dist/chunk-2PGVW3FL.js.map +0 -1
- package/dist/chunk-5WNQPXEG.js.map +0 -1
- package/dist/chunk-LOCIJAS3.js.map +0 -1
- package/dist/ensure-sources-2LFWDM3X.js.map +0 -1
- package/dist/library-publish-ZHO7XA5C.js.map +0 -1
- package/dist/plugin-store-VJYXFXP5.js.map +0 -1
- package/dist/setup-P4J7EN6S.js.map +0 -1
- package/dist/source-manifest-publish-ABXDZTVG.js.map +0 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { WorkspacePlugin } from './chunk-
|
|
2
|
-
import { buildWorkspaceToolDefs } from './chunk-
|
|
1
|
+
import { WorkspacePlugin } from './chunk-5OZVZI2E.js';
|
|
2
|
+
import { buildWorkspaceToolDefs } from './chunk-CJCZIWW6.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-BZBRCPEB.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-5YB4GYMB.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-6DN6U2CK.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 } from './chunk-
|
|
17
|
-
import { loadFlow } from './chunk-
|
|
16
|
+
import { createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv, AI_PROVIDER_PRESETS } from './chunk-QBH7PC4D.js';
|
|
17
|
+
import { loadFlow } from './chunk-AOE4KOMJ.js';
|
|
18
18
|
import { parseFlowDefinition } from './chunk-REYJKU7T.js';
|
|
19
19
|
import { renderStimulusPrompt } from './chunk-2D5BYAL6.js';
|
|
20
20
|
import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-QAH24E5U.js';
|
|
21
|
-
import { resolveSettings, loadProviderRegistry } from './chunk-
|
|
21
|
+
import { resolveSettings, loadProviderRegistry } from './chunk-GFU367UH.js';
|
|
22
22
|
import { resolveRuntimeAssets } from './chunk-UM4LDXV5.js';
|
|
23
23
|
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
27
|
import { resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink } from './chunk-FTG7CRFD.js';
|
|
28
|
-
import { registryEntries, resolveEntryBaseUrl } from './chunk-ILG4BXYE.js';
|
|
28
|
+
import { registryEntries, resolveEntryBaseUrl, parseModelRef, isEntryEnabled, parseCredentialRef } from './chunk-ILG4BXYE.js';
|
|
29
29
|
import { getLogStore, registerLogStore, resetLogStore, createLogger, isUnwritableStreamError, markStreamBroken, isBrokenPipeError } from './chunk-W4IPN3DD.js';
|
|
30
30
|
import { __require } from './chunk-NSBPE2FW.js';
|
|
31
31
|
import pc from 'picocolors';
|
|
@@ -5203,6 +5203,67 @@ async function dispatchRefreshToExposedGitMounts(manager, log) {
|
|
|
5203
5203
|
);
|
|
5204
5204
|
}
|
|
5205
5205
|
var CLAUDE_CODE_CREDENTIALS_KEY = "CLAUDE_CODE_CREDENTIALS_JSON";
|
|
5206
|
+
var DEFAULT_CLAUDE_AI_OAUTH_SCOPES = ["user:inference", "user:profile"];
|
|
5207
|
+
function selectClaudeCodeCredentialsSecret(secrets, selection) {
|
|
5208
|
+
const legacy = secrets[CLAUDE_CODE_CREDENTIALS_KEY];
|
|
5209
|
+
if (legacy) return { key: CLAUDE_CODE_CREDENTIALS_KEY, value: legacy };
|
|
5210
|
+
if (!selection?.registry) return void 0;
|
|
5211
|
+
if (selection.driver && selection.driver !== "claude-sdk") return void 0;
|
|
5212
|
+
const entries = registryEntries(selection.registry).map(
|
|
5213
|
+
([id, entry2]) => [id, { ...entry2, kind: entryKind(entry2) }]
|
|
5214
|
+
);
|
|
5215
|
+
const registry = Object.fromEntries(entries);
|
|
5216
|
+
const named = selection.modelRef?.trim();
|
|
5217
|
+
const selected = named ? parseModelRef(named, registry) : void 0;
|
|
5218
|
+
const providerId = named && entries.some(([id]) => id === named) ? named : selected?.providerId ?? entries.find(
|
|
5219
|
+
([, entry2]) => (entry2.kind === "llm" || entry2.kind === "embed") && isEntryEnabled(entry2)
|
|
5220
|
+
)?.[0];
|
|
5221
|
+
const entry = entries.find(([id]) => id === providerId)?.[1];
|
|
5222
|
+
if (!entry || !isClaudeSubscriptionEndpoint(entry)) return void 0;
|
|
5223
|
+
if (entry.credential?.kind !== "oauth" || !entry.credential.ref) return void 0;
|
|
5224
|
+
const ref = parseCredentialRef(entry.credential.ref);
|
|
5225
|
+
if (ref?.form !== "platform") return void 0;
|
|
5226
|
+
const value = secrets[ref.configId];
|
|
5227
|
+
return value ? { key: ref.configId, value } : void 0;
|
|
5228
|
+
}
|
|
5229
|
+
function entryKind(entry) {
|
|
5230
|
+
return entry.kind ?? (entry.preset ? AI_PROVIDER_PRESETS[entry.preset]?.kind : void 0);
|
|
5231
|
+
}
|
|
5232
|
+
function isClaudeSubscriptionEndpoint(entry) {
|
|
5233
|
+
if (entryKind(entry) !== "llm") return false;
|
|
5234
|
+
const preset = entry.preset ? AI_PROVIDER_PRESETS[entry.preset] : void 0;
|
|
5235
|
+
const surface = entry.surface ?? preset?.surface;
|
|
5236
|
+
const transport = entry.transport ?? preset?.transport ?? "direct";
|
|
5237
|
+
return surface === "anthropic-messages" && transport === "direct";
|
|
5238
|
+
}
|
|
5239
|
+
function claudeAiOauthScopesState(json) {
|
|
5240
|
+
let parsed;
|
|
5241
|
+
try {
|
|
5242
|
+
parsed = JSON.parse(json);
|
|
5243
|
+
} catch {
|
|
5244
|
+
return "unparseable";
|
|
5245
|
+
}
|
|
5246
|
+
if (!parsed || typeof parsed !== "object") return "unparseable";
|
|
5247
|
+
const scopes = parsed.claudeAiOauth?.scopes;
|
|
5248
|
+
return Array.isArray(scopes) && scopes.length > 0 ? "ok" : "missing";
|
|
5249
|
+
}
|
|
5250
|
+
async function writeProvisionedClaudeCodeCredentials(home, source, warn) {
|
|
5251
|
+
const state = claudeAiOauthScopesState(source.value);
|
|
5252
|
+
if (state === "missing") {
|
|
5253
|
+
warn(
|
|
5254
|
+
"Claude Code credentials blob has no claudeAiOauth.scopes \u2014 Claude Code will report 'Not logged in'; re-capture or rotate the seat",
|
|
5255
|
+
{ key: source.key }
|
|
5256
|
+
);
|
|
5257
|
+
} else if (state === "unparseable") {
|
|
5258
|
+
warn(
|
|
5259
|
+
"Claude Code credentials blob is not a JSON object \u2014 Claude Code cannot read it; the platform sent malformed material for this secret",
|
|
5260
|
+
{ key: source.key }
|
|
5261
|
+
);
|
|
5262
|
+
}
|
|
5263
|
+
return writeClaudeCodeCredentialsFile(home, source.value);
|
|
5264
|
+
}
|
|
5265
|
+
var credentialsLog;
|
|
5266
|
+
var scopesRepairLogged = /* @__PURE__ */ new Set();
|
|
5206
5267
|
async function writeClaudeCodeCredentialsFile(home, json) {
|
|
5207
5268
|
const claudeDir = join(home, ".claude");
|
|
5208
5269
|
await mkdir(claudeDir, { recursive: true, mode: 448 });
|
|
@@ -5247,6 +5308,17 @@ async function mergeAndRewriteCredentialsFile(home, accessToken, expiresAt) {
|
|
|
5247
5308
|
const oauthBlock = merged.claudeAiOauth ?? {};
|
|
5248
5309
|
oauthBlock.accessToken = accessToken;
|
|
5249
5310
|
if (expiresAt) oauthBlock.expiresAt = expiresAt;
|
|
5311
|
+
if (!Array.isArray(oauthBlock.scopes) || oauthBlock.scopes.length === 0) {
|
|
5312
|
+
oauthBlock.scopes = [...DEFAULT_CLAUDE_AI_OAUTH_SCOPES];
|
|
5313
|
+
if (!scopesRepairLogged.has(credPath)) {
|
|
5314
|
+
scopesRepairLogged.add(credPath);
|
|
5315
|
+
credentialsLog ??= createLogger({ kind: "runner", subkind: "credentials" });
|
|
5316
|
+
credentialsLog.info("added default scopes to a claudeAiOauth block that had none", {
|
|
5317
|
+
path: credPath,
|
|
5318
|
+
scopes: DEFAULT_CLAUDE_AI_OAUTH_SCOPES
|
|
5319
|
+
});
|
|
5320
|
+
}
|
|
5321
|
+
}
|
|
5250
5322
|
merged.claudeAiOauth = oauthBlock;
|
|
5251
5323
|
merged.accessToken = accessToken;
|
|
5252
5324
|
return writeClaudeCodeCredentialsFile(home, JSON.stringify(merged));
|
|
@@ -5291,13 +5363,20 @@ function readCurrentClaudeAccessToken(home) {
|
|
|
5291
5363
|
function raiseHookFailures(phase, results, log) {
|
|
5292
5364
|
const failed = results.filter((r) => !r.ok);
|
|
5293
5365
|
if (failed.length === 0) return;
|
|
5366
|
+
const cause = (f) => redactUrlAuth(f.error ?? "unknown error");
|
|
5294
5367
|
for (const f of failed) {
|
|
5295
|
-
log(`[lifecycle] ${phase}: connector "${f.id}" failed \u2014 ${f
|
|
5368
|
+
log(`[lifecycle] ${phase}: connector "${f.id}" failed \u2014 ${cause(f)}`);
|
|
5296
5369
|
}
|
|
5297
5370
|
throw new Error(
|
|
5298
|
-
`${failed.length} connector(s) failed to ${phase}: ${failed.map((f) => `${f.id}: ${f
|
|
5371
|
+
`${failed.length} connector(s) failed to ${phase}: ${failed.map((f) => `${f.id}: ${cause(f)}`).join("; ")}`
|
|
5299
5372
|
);
|
|
5300
5373
|
}
|
|
5374
|
+
function redactUrlAuth(text2) {
|
|
5375
|
+
return text2.replace(/\/\/[^/\s]*@/g, "//***@");
|
|
5376
|
+
}
|
|
5377
|
+
function replyResults(results) {
|
|
5378
|
+
return results.map((r) => r.detail ? { ...r, detail: redactUrlAuth(r.detail) } : r);
|
|
5379
|
+
}
|
|
5301
5380
|
function buildLifecycleHandler(deps) {
|
|
5302
5381
|
const { getCompactionOrchestrator, getResourceManager, log } = deps;
|
|
5303
5382
|
return async ({ phase }) => {
|
|
@@ -5306,22 +5385,29 @@ function buildLifecycleHandler(deps) {
|
|
|
5306
5385
|
const orchestrator = getCompactionOrchestrator();
|
|
5307
5386
|
if (orchestrator) await orchestrator.compact("manual");
|
|
5308
5387
|
else log("[lifecycle] compact: no compaction orchestrator \u2014 skipped");
|
|
5309
|
-
|
|
5388
|
+
return { ok: true };
|
|
5310
5389
|
}
|
|
5311
5390
|
case "hibernate": {
|
|
5312
5391
|
const manager = getResourceManager();
|
|
5313
|
-
if (manager)
|
|
5314
|
-
|
|
5315
|
-
|
|
5392
|
+
if (!manager) {
|
|
5393
|
+
log("[lifecycle] hibernate: no resource manager \u2014 skipped");
|
|
5394
|
+
return { ok: true };
|
|
5395
|
+
}
|
|
5396
|
+
const results = await manager.hibernateAll();
|
|
5397
|
+
raiseHookFailures("hibernate", results, log);
|
|
5398
|
+
return { ok: true, results: replyResults(results) };
|
|
5316
5399
|
}
|
|
5317
5400
|
case "close": {
|
|
5318
5401
|
const manager = getResourceManager();
|
|
5319
|
-
if (manager)
|
|
5320
|
-
|
|
5321
|
-
|
|
5402
|
+
if (!manager) {
|
|
5403
|
+
log("[lifecycle] close: no resource manager \u2014 skipped");
|
|
5404
|
+
return { ok: true };
|
|
5405
|
+
}
|
|
5406
|
+
const results = await manager.closeAll();
|
|
5407
|
+
raiseHookFailures("close", results, log);
|
|
5408
|
+
return { ok: true, results: replyResults(results) };
|
|
5322
5409
|
}
|
|
5323
5410
|
}
|
|
5324
|
-
return { ok: true };
|
|
5325
5411
|
};
|
|
5326
5412
|
}
|
|
5327
5413
|
function asDeclaration(declaration) {
|
|
@@ -7765,17 +7851,21 @@ async function startAgentServer(opts) {
|
|
|
7765
7851
|
capabilityRegistry.register(stub, "client");
|
|
7766
7852
|
}
|
|
7767
7853
|
}
|
|
7768
|
-
async function provisionInitSecrets(secrets) {
|
|
7854
|
+
async function provisionInitSecrets(secrets, selection) {
|
|
7769
7855
|
let initialAiCredentialExpiresAt = null;
|
|
7770
7856
|
if (secrets) {
|
|
7771
|
-
const
|
|
7772
|
-
if (
|
|
7857
|
+
const source = selectClaudeCodeCredentialsSecret(secrets, selection);
|
|
7858
|
+
if (source) {
|
|
7773
7859
|
const home = process.env.HOME ?? homedir();
|
|
7774
7860
|
if (home) {
|
|
7775
7861
|
try {
|
|
7776
|
-
await
|
|
7862
|
+
await writeProvisionedClaudeCodeCredentials(
|
|
7863
|
+
home,
|
|
7864
|
+
source,
|
|
7865
|
+
(message, meta) => serverLog.warn(message, meta)
|
|
7866
|
+
);
|
|
7777
7867
|
log(
|
|
7778
|
-
`[serve] wrote Claude Code credentials file to ${home}/.claude/.credentials.json (mode 0600)`
|
|
7868
|
+
`[serve] wrote Claude Code credentials file to ${home}/.claude/.credentials.json (mode 0600) from ${source.key === CLAUDE_CODE_CREDENTIALS_KEY ? source.key : `registry credential platform:${source.key}`}`
|
|
7779
7869
|
);
|
|
7780
7870
|
await guardClaudeAiConnectors(home, serverLog);
|
|
7781
7871
|
} catch (err) {
|
|
@@ -7783,7 +7873,7 @@ async function startAgentServer(opts) {
|
|
|
7783
7873
|
log(`[serve] failed to write Claude Code credentials file: ${errMsg}`);
|
|
7784
7874
|
}
|
|
7785
7875
|
}
|
|
7786
|
-
initialAiCredentialExpiresAt = extractClaudeAiOauthExpiresAt(
|
|
7876
|
+
initialAiCredentialExpiresAt = extractClaudeAiOauthExpiresAt(source.value);
|
|
7787
7877
|
}
|
|
7788
7878
|
const otherSecrets = Object.fromEntries(
|
|
7789
7879
|
Object.entries(secrets).filter(([k]) => k !== CLAUDE_CODE_CREDENTIALS_KEY)
|
|
@@ -8234,8 +8324,6 @@ async function startAgentServer(opts) {
|
|
|
8234
8324
|
...managedHost ? { runtimeFeatures: supportedRuntimeFeatures } : {}
|
|
8235
8325
|
});
|
|
8236
8326
|
preMintedSecrets = new PreMintedSecretProvider(cmd.credentials);
|
|
8237
|
-
const initialAiCredentialExpiresAt = await provisionInitSecrets(cmd.secrets);
|
|
8238
|
-
if (managedCodex) secretsProvisioned = true;
|
|
8239
8327
|
if (cmd.resolvedConfig.aiProviderConfigId) {
|
|
8240
8328
|
aiProviderConfigId = cmd.resolvedConfig.aiProviderConfigId;
|
|
8241
8329
|
log(`[serve] stashed aiProviderConfigId=${aiProviderConfigId}`);
|
|
@@ -8243,6 +8331,30 @@ async function startAgentServer(opts) {
|
|
|
8243
8331
|
}
|
|
8244
8332
|
const wireCandidate = cmd.resolvedConfig.agentConfig ?? wireAgentConfig;
|
|
8245
8333
|
wireAgentConfig = managedCodex ? cmd.resolvedConfig.agentConfig : diskProfileHasAgentSettings(profile) ? wireCandidate?.registry ? { registry: wireCandidate.registry } : void 0 : wireCandidate;
|
|
8334
|
+
let credentialsSelection;
|
|
8335
|
+
if (!managedCodex && wireAgentConfig?.registry && cmd.secrets && !cmd.secrets[CLAUDE_CODE_CREDENTIALS_KEY]) {
|
|
8336
|
+
const driver2 = opts.driver ?? wireAgentConfig?.driver;
|
|
8337
|
+
const model = opts.model ?? wireAgentConfig?.model;
|
|
8338
|
+
let settings;
|
|
8339
|
+
try {
|
|
8340
|
+
settings = await resolveSettings(opts.projectDir, { driver: driver2, model });
|
|
8341
|
+
} catch (err) {
|
|
8342
|
+
serverLog.warn(
|
|
8343
|
+
`[serve] credentials selection: settings unreadable: ${err instanceof Error ? err.message : String(err)}`
|
|
8344
|
+
);
|
|
8345
|
+
settings = { driver: driver2 ?? profile?.driver, model: model ?? profile?.model };
|
|
8346
|
+
}
|
|
8347
|
+
credentialsSelection = {
|
|
8348
|
+
driver: settings.driver ?? "omp",
|
|
8349
|
+
registry: wireAgentConfig?.registry,
|
|
8350
|
+
modelRef: wireAgentConfig?.modelRef?.trim() || settings.model?.trim() || void 0
|
|
8351
|
+
};
|
|
8352
|
+
}
|
|
8353
|
+
const initialAiCredentialExpiresAt = await provisionInitSecrets(
|
|
8354
|
+
cmd.secrets,
|
|
8355
|
+
credentialsSelection
|
|
8356
|
+
);
|
|
8357
|
+
if (managedCodex) secretsProvisioned = true;
|
|
8246
8358
|
if (!managedCodex && aiProviderConfigId && initialAiCredentialExpiresAt) {
|
|
8247
8359
|
aiCredentialRefreshScheduler.schedule(initialAiCredentialExpiresAt);
|
|
8248
8360
|
}
|
|
@@ -9020,5 +9132,5 @@ function touchSession(state) {
|
|
|
9020
9132
|
}
|
|
9021
9133
|
|
|
9022
9134
|
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 };
|
|
9023
|
-
//# sourceMappingURL=chunk-
|
|
9024
|
-
//# sourceMappingURL=chunk-
|
|
9135
|
+
//# sourceMappingURL=chunk-6YIFJW2I.js.map
|
|
9136
|
+
//# sourceMappingURL=chunk-6YIFJW2I.js.map
|