@skaile/workspaces 1.1.0 → 1.3.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 +52 -0
- package/dist/{asset-feeds-NIAABO6U.js → asset-feeds-NEZKG6YS.js} +9 -9
- package/dist/{asset-feeds-NIAABO6U.js.map → asset-feeds-NEZKG6YS.js.map} +1 -1
- package/dist/asset-manager/index.js +7 -7
- package/dist/asset-manager/installer.js +6 -6
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/bridge/drivers/claude-sdk.js +40 -5
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +1 -1
- package/dist/bridge/drivers/continue.js +2 -2
- package/dist/bridge/drivers/echo.js +1 -1
- package/dist/bridge/drivers/gemini.js +3 -3
- package/dist/bridge/drivers/goose.js +2 -2
- package/dist/bridge/drivers/omp.js +1 -1
- package/dist/bridge/drivers/opencode.js +2 -2
- package/dist/bridge/drivers/qwen.js +3 -3
- package/dist/bridge/index.js +3 -2
- package/dist/bridge/src/cloud.d.ts +89 -0
- package/dist/bridge/src/cloud.d.ts.map +1 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts +12 -1
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +1 -0
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +31 -0
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-7X53KHQ4.js → chunk-4OVPB7SI.js} +4 -2
- package/dist/chunk-4OVPB7SI.js.map +1 -0
- package/dist/{chunk-SHOKXRL4.js → chunk-5XS3BFJS.js} +8 -4
- package/dist/chunk-5XS3BFJS.js.map +1 -0
- package/dist/{chunk-EE4NL25D.js → chunk-7CNIRF42.js} +111 -45
- package/dist/chunk-7CNIRF42.js.map +1 -0
- package/dist/{chunk-MG6UIS7G.js → chunk-AZAS3FKN.js} +6 -3
- package/dist/chunk-AZAS3FKN.js.map +1 -0
- package/dist/{chunk-BCJL2UNH.js → chunk-BDUANIAR.js} +3 -3
- package/dist/{chunk-BCJL2UNH.js.map → chunk-BDUANIAR.js.map} +1 -1
- package/dist/{chunk-KVZ6XKVN.js → chunk-BZMTR5WW.js} +3 -3
- package/dist/{chunk-KVZ6XKVN.js.map → chunk-BZMTR5WW.js.map} +1 -1
- package/dist/{chunk-INUQVXUE.js → chunk-ETYDLXI5.js} +2 -2
- package/dist/{chunk-INUQVXUE.js.map → chunk-ETYDLXI5.js.map} +1 -1
- package/dist/{chunk-CU5Z7GH3.js → chunk-GB4SEEK4.js} +13 -5
- package/dist/chunk-GB4SEEK4.js.map +1 -0
- package/dist/chunk-ISQWMBKD.js +74 -0
- package/dist/chunk-ISQWMBKD.js.map +1 -0
- package/dist/{chunk-ZUE2PIJ5.js → chunk-JQMIG7D3.js} +3 -3
- package/dist/{chunk-ZUE2PIJ5.js.map → chunk-JQMIG7D3.js.map} +1 -1
- package/dist/{chunk-UY5Q2NZH.js → chunk-K5SD7FSF.js} +3 -3
- package/dist/{chunk-UY5Q2NZH.js.map → chunk-K5SD7FSF.js.map} +1 -1
- package/dist/{chunk-L3SLC3S4.js → chunk-OBSSORCE.js} +6 -6
- package/dist/{chunk-L3SLC3S4.js.map → chunk-OBSSORCE.js.map} +1 -1
- package/dist/{chunk-5AGARSQT.js → chunk-OUWNTFDG.js} +31 -3
- package/dist/chunk-OUWNTFDG.js.map +1 -0
- package/dist/{chunk-VYIK5IE5.js → chunk-P3MJYPZE.js} +24 -5
- package/dist/chunk-P3MJYPZE.js.map +1 -0
- package/dist/{chunk-B4IOSXRZ.js → chunk-PSMW5HLX.js} +19 -8
- package/dist/chunk-PSMW5HLX.js.map +1 -0
- package/dist/{chunk-U5J77IIZ.js → chunk-QK5JDAFF.js} +4 -4
- package/dist/{chunk-U5J77IIZ.js.map → chunk-QK5JDAFF.js.map} +1 -1
- package/dist/{chunk-DMHVL5MC.js → chunk-RHMQPLIK.js} +5 -5
- package/dist/{chunk-DMHVL5MC.js.map → chunk-RHMQPLIK.js.map} +1 -1
- package/dist/{chunk-52XHXSBN.js → chunk-RJ3HUSBC.js} +3 -3
- package/dist/{chunk-52XHXSBN.js.map → chunk-RJ3HUSBC.js.map} +1 -1
- package/dist/{chunk-Z4EJOBEL.js → chunk-RYRJEVQ4.js} +7 -7
- package/dist/{chunk-Z4EJOBEL.js.map → chunk-RYRJEVQ4.js.map} +1 -1
- package/dist/{chunk-QVE3ILCY.js → chunk-SUOGVHGJ.js} +2 -2
- package/dist/chunk-SUOGVHGJ.js.map +1 -0
- package/dist/{chunk-BM37QD6U.js → chunk-TJRWGMD2.js} +3 -3
- package/dist/{chunk-BM37QD6U.js.map → chunk-TJRWGMD2.js.map} +1 -1
- package/dist/{chunk-35TLBMHX.js → chunk-WFEPI5LA.js} +5 -5
- package/dist/{chunk-35TLBMHX.js.map → chunk-WFEPI5LA.js.map} +1 -1
- package/dist/{chunk-OIGYDVCM.js → chunk-XBG2YDQQ.js} +3 -3
- package/dist/{chunk-OIGYDVCM.js.map → chunk-XBG2YDQQ.js.map} +1 -1
- package/dist/{chunk-WRBF34YE.js → chunk-XKARS6EE.js} +3 -3
- package/dist/{chunk-WRBF34YE.js.map → chunk-XKARS6EE.js.map} +1 -1
- package/dist/{chunk-YI5OZ7QO.js → chunk-YOPSHV7V.js} +2 -2
- package/dist/{chunk-YI5OZ7QO.js.map → chunk-YOPSHV7V.js.map} +1 -1
- package/dist/{chunk-G2X3THJV.js → chunk-YXEPZ7LP.js} +5 -5
- package/dist/{chunk-G2X3THJV.js.map → chunk-YXEPZ7LP.js.map} +1 -1
- package/dist/cli/index.js +104 -62
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +20 -0
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +9 -0
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/helpers.d.ts +10 -0
- package/dist/cli/src/helpers.d.ts.map +1 -1
- package/dist/connectors/config.js +4 -4
- package/dist/connectors/index.js +5 -5
- package/dist/core/index.js +3 -3
- package/dist/core/runtime-assets.js +2 -2
- package/dist/core/src/index.d.ts +2 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/settings.d.ts +18 -0
- package/dist/core/src/settings.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +45 -0
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/deploy/index.js +3 -3
- package/dist/discovery/index.js +2 -2
- package/dist/{ensure-sources-MJYHZ77Y.js → ensure-sources-4BAJGJRK.js} +10 -10
- package/dist/{ensure-sources-MJYHZ77Y.js.map → ensure-sources-4BAJGJRK.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 +3 -3
- 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/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-4Z74KY2H.js → flows-UFCOGAAM.js} +3 -3
- package/dist/{flows-4Z74KY2H.js.map → flows-UFCOGAAM.js.map} +1 -1
- package/dist/helpers-2OL4FRFB.js +22 -0
- package/dist/{helpers-7KOVCMHW.js.map → helpers-2OL4FRFB.js.map} +1 -1
- package/dist/library/index.js +6 -6
- package/dist/library/install.js +3 -3
- package/dist/{open-library-PGTL332T.js → open-library-RPV2LIKL.js} +13 -13
- package/dist/{open-library-PGTL332T.js.map → open-library-RPV2LIKL.js.map} +1 -1
- package/dist/{paths-S7QNXYMB.js → paths-ML33B5SB.js} +6 -6
- package/dist/{paths-S7QNXYMB.js.map → paths-ML33B5SB.js.map} +1 -1
- package/dist/{plugin-store-3DAVGKHN.js → plugin-store-G4HKWCTU.js} +5 -5
- package/dist/{plugin-store-3DAVGKHN.js.map → plugin-store-G4HKWCTU.js.map} +1 -1
- package/dist/plugins/src/catalog-source.d.ts +7 -0
- package/dist/plugins/src/catalog-source.d.ts.map +1 -1
- package/dist/runner/index.js +10 -9
- package/dist/runner/src/cloud-bundle.d.ts +36 -0
- package/dist/runner/src/cloud-bundle.d.ts.map +1 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +32 -0
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +7 -7
- package/dist/sdk/bridge.js +3 -2
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/flow.js +3 -3
- package/dist/sdk/index.js +10 -9
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runner.js +10 -9
- package/dist/sdk/store.js +1 -1
- package/dist/{setup-WBGDT2WY.js → setup-WS6PF6JQ.js} +8 -7
- package/dist/setup-WS6PF6JQ.js.map +1 -0
- package/dist/{source-FJXRQ2NU.js → source-22U5NOY4.js} +14 -14
- package/dist/{source-FJXRQ2NU.js.map → source-22U5NOY4.js.map} +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/{store-client-YGDN4L2G.js → store-client-YLMBH5MF.js} +6 -6
- package/dist/{store-client-YGDN4L2G.js.map → store-client-YLMBH5MF.js.map} +1 -1
- package/dist/tui/index.js +10 -9
- package/dist/tui/index.js.map +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/manifests/agent.d.ts +47 -8
- package/dist/types/src/manifests/agent.d.ts.map +1 -1
- package/dist/types/src/manifests/index.d.ts +1 -1
- package/dist/types/src/manifests/index.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +1 -1
- package/dist/workspace-plugin/adapters/omp.js +3 -3
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5AGARSQT.js.map +0 -1
- package/dist/chunk-7X53KHQ4.js.map +0 -1
- package/dist/chunk-B4IOSXRZ.js.map +0 -1
- package/dist/chunk-CU5Z7GH3.js.map +0 -1
- package/dist/chunk-EE4NL25D.js.map +0 -1
- package/dist/chunk-MG6UIS7G.js.map +0 -1
- package/dist/chunk-QVE3ILCY.js.map +0 -1
- package/dist/chunk-SHOKXRL4.js.map +0 -1
- package/dist/chunk-VYIK5IE5.js.map +0 -1
- package/dist/helpers-7KOVCMHW.js +0 -22
- package/dist/setup-WBGDT2WY.js.map +0 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { WorkspacePlugin } from './chunk-
|
|
1
|
+
import { WorkspacePlugin } from './chunk-ETYDLXI5.js';
|
|
2
2
|
import { WebSocketServerTransport } from './chunk-WQ7DE5UC.js';
|
|
3
3
|
import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
|
|
4
4
|
import { PROTOCOL_VERSION } from './chunk-EVZKWY5J.js';
|
|
5
|
-
import { EventNormalizer } from './chunk-
|
|
5
|
+
import { EventNormalizer } from './chunk-K5SD7FSF.js';
|
|
6
|
+
import { SUPPORTED_CLOUDS, CLOUD_SECRET_ENV_KEYS } from './chunk-ISQWMBKD.js';
|
|
6
7
|
import { classifyClaudeSdkError } from './chunk-GAH4YRCI.js';
|
|
7
|
-
import { createDriver } from './chunk-
|
|
8
|
+
import { createDriver } from './chunk-SUOGVHGJ.js';
|
|
8
9
|
import { deployCatalogEntry, undeployCatalogEntry } from './chunk-LV2HPH3C.js';
|
|
9
|
-
import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools } from './chunk-
|
|
10
|
-
import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, deriveSingleMaterializedConnectorDeclaration } from './chunk-
|
|
10
|
+
import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools } from './chunk-PSMW5HLX.js';
|
|
11
|
+
import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, deriveSingleMaterializedConnectorDeclaration } from './chunk-BDUANIAR.js';
|
|
11
12
|
import { renderStimulusPrompt, buildOrchestratorPrompt } from './chunk-DEYYRFQU.js';
|
|
12
|
-
import { resolveSettings, resolveApiKey, providerEnvKey } from './chunk-
|
|
13
|
-
import { resolveRuntimeAssets } from './chunk-
|
|
14
|
-
import { resolveSkWorkspaceConfig, resolveAgentDir, stageMaterializedSkills, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration } from './chunk-
|
|
13
|
+
import { resolveSettings, resolveApiKey, providerEnvKey } from './chunk-AZAS3FKN.js';
|
|
14
|
+
import { resolveRuntimeAssets } from './chunk-TJRWGMD2.js';
|
|
15
|
+
import { resolveSkWorkspaceConfig, resolveAgentDir, cloudConfigFromProfile, stageMaterializedSkills, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration } from './chunk-OUWNTFDG.js';
|
|
15
16
|
import { parseAssetRef } from './chunk-GEEW6SY2.js';
|
|
16
17
|
import { resolveDriverPaths } from './chunk-K5GBV4SA.js';
|
|
17
18
|
import { getLogStore, resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink, registerLogStore, resetLogStore, createLogger } from './chunk-JB35MVBN.js';
|
|
@@ -235,11 +236,11 @@ async function resolveMixin(ref, defaultKind, agentDir, repos) {
|
|
|
235
236
|
return { content: stripFrontmatter(raw).trim(), source: entry.source };
|
|
236
237
|
}
|
|
237
238
|
async function resolveAgentMixins(manifest, agentDir, repos) {
|
|
238
|
-
const
|
|
239
|
+
const resolve4 = (refs, kind) => Promise.all((refs ?? []).map((r) => resolveMixin(r, kind, agentDir, repos)));
|
|
239
240
|
const [personaResults, rulesResults, knowledgeResults] = await Promise.all([
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
resolve4(manifest.persona, "persona"),
|
|
242
|
+
resolve4(manifest.rules, "ruleset"),
|
|
243
|
+
resolve4(manifest.knowledge, "knowledge")
|
|
243
244
|
]);
|
|
244
245
|
return {
|
|
245
246
|
personas: personaResults.filter((r) => r !== null),
|
|
@@ -1507,10 +1508,7 @@ async function buildAgentResources(projectDir, driverType, _onLog, watch, secret
|
|
|
1507
1508
|
workspacePluginToShutdown = inProcess.workspacePluginToShutdown;
|
|
1508
1509
|
}
|
|
1509
1510
|
if (capabilityRegistry) {
|
|
1510
|
-
externalMcpDeclarations = resolveExternalMcpDeclarations(
|
|
1511
|
-
projectDir,
|
|
1512
|
-
sessionMeta?.sessionId
|
|
1513
|
-
);
|
|
1511
|
+
externalMcpDeclarations = resolveExternalMcpDeclarations(projectDir, sessionMeta?.sessionId);
|
|
1514
1512
|
externalMcpManager = await startExternalMcpServers(
|
|
1515
1513
|
capabilityRegistry,
|
|
1516
1514
|
externalMcpDeclarations,
|
|
@@ -1518,10 +1516,7 @@ async function buildAgentResources(projectDir, driverType, _onLog, watch, secret
|
|
|
1518
1516
|
sessionMeta
|
|
1519
1517
|
);
|
|
1520
1518
|
} else if (driverType === "claude-sdk") {
|
|
1521
|
-
externalMcpDeclarations = resolveExternalMcpDeclarations(
|
|
1522
|
-
projectDir,
|
|
1523
|
-
sessionMeta?.sessionId
|
|
1524
|
-
);
|
|
1519
|
+
externalMcpDeclarations = resolveExternalMcpDeclarations(projectDir, sessionMeta?.sessionId);
|
|
1525
1520
|
mcpServers = wireExternalMcpServersForSdk(
|
|
1526
1521
|
mcpServers,
|
|
1527
1522
|
externalMcpDeclarations,
|
|
@@ -1629,6 +1624,7 @@ async function connectAllConnectors(connectorDeclarations, projectDir, runtimeAs
|
|
|
1629
1624
|
} catch (err) {
|
|
1630
1625
|
if (err instanceof ConnectorStartupError) {
|
|
1631
1626
|
logConnectorReport(err.report.results, resLog);
|
|
1627
|
+
return resourceManager;
|
|
1632
1628
|
}
|
|
1633
1629
|
throw err;
|
|
1634
1630
|
}
|
|
@@ -1792,7 +1788,9 @@ async function createAgentSession(config) {
|
|
|
1792
1788
|
const driverType = settings.driver ?? "omp";
|
|
1793
1789
|
const provider = settings.provider;
|
|
1794
1790
|
const model = settings.model;
|
|
1795
|
-
const
|
|
1791
|
+
const cloud = config.cloud ?? settings.cloud ?? "default";
|
|
1792
|
+
const cloudConfig = config.cloudConfig ?? settings.cloudConfig;
|
|
1793
|
+
const apiKey = cloud === "bedrock" || cloud === "vertex" || cloud === "azure" ? config.apiKey : config.apiKey ?? resolveApiKey(provider ?? "anthropic", settings);
|
|
1796
1794
|
const manifest = agentDir ? await loadAgentManifest(agentDir) : void 0;
|
|
1797
1795
|
const {
|
|
1798
1796
|
resourceManager,
|
|
@@ -1867,6 +1865,8 @@ async function createAgentSession(config) {
|
|
|
1867
1865
|
agentCwd,
|
|
1868
1866
|
provider,
|
|
1869
1867
|
model,
|
|
1868
|
+
cloud,
|
|
1869
|
+
cloudConfig,
|
|
1870
1870
|
manifest,
|
|
1871
1871
|
maxTurns,
|
|
1872
1872
|
apiKey,
|
|
@@ -1989,6 +1989,8 @@ function createSessionDriver(args) {
|
|
|
1989
1989
|
agentCwd,
|
|
1990
1990
|
provider,
|
|
1991
1991
|
model,
|
|
1992
|
+
cloud,
|
|
1993
|
+
cloudConfig,
|
|
1992
1994
|
manifest,
|
|
1993
1995
|
maxTurns,
|
|
1994
1996
|
apiKey,
|
|
@@ -2008,6 +2010,11 @@ function createSessionDriver(args) {
|
|
|
2008
2010
|
apiKeys: apiKey ? { [provider ?? "anthropic"]: apiKey } : void 0,
|
|
2009
2011
|
systemPrompt,
|
|
2010
2012
|
tools: manifest?.tools,
|
|
2013
|
+
// Cloud transport dimension — omitted entirely for `default` so the
|
|
2014
|
+
// driver config stays byte-identical to pre-cloud behavior.
|
|
2015
|
+
...cloud !== "default" ? { cloud } : {},
|
|
2016
|
+
...cloudConfig ? { cloudConfig } : {},
|
|
2017
|
+
...config.cloudSecrets ? { cloudSecrets: config.cloudSecrets } : {},
|
|
2011
2018
|
...thinking ? { thinking } : {},
|
|
2012
2019
|
...effort ? { effort } : {},
|
|
2013
2020
|
...sessionId ? { sessionId } : {},
|
|
@@ -2064,14 +2071,14 @@ async function runAgentChat(opts) {
|
|
|
2064
2071
|
${message}`;
|
|
2065
2072
|
}
|
|
2066
2073
|
try {
|
|
2067
|
-
await new Promise((
|
|
2074
|
+
await new Promise((resolve4, reject) => {
|
|
2068
2075
|
const onEvent = (event) => {
|
|
2069
2076
|
if (event.type === "agent_end") {
|
|
2070
2077
|
driver.off("agent-event", onEvent);
|
|
2071
2078
|
mdStream.end();
|
|
2072
2079
|
process.stdout.write("\n");
|
|
2073
2080
|
driver.kill();
|
|
2074
|
-
|
|
2081
|
+
resolve4();
|
|
2075
2082
|
} else if (event.type === "error") {
|
|
2076
2083
|
driver.off("agent-event", onEvent);
|
|
2077
2084
|
const err = new Error(String(event.error));
|
|
@@ -2471,7 +2478,7 @@ function buildClientCapabilityHandler(args) {
|
|
|
2471
2478
|
});
|
|
2472
2479
|
return {};
|
|
2473
2480
|
}
|
|
2474
|
-
return new Promise((
|
|
2481
|
+
return new Promise((resolve4, reject) => {
|
|
2475
2482
|
const timer = setTimeout(() => {
|
|
2476
2483
|
args.pending.delete(callId);
|
|
2477
2484
|
reject(
|
|
@@ -2480,7 +2487,7 @@ function buildClientCapabilityHandler(args) {
|
|
|
2480
2487
|
)
|
|
2481
2488
|
);
|
|
2482
2489
|
}, timeoutMs);
|
|
2483
|
-
args.pending.set(callId, { resolve:
|
|
2490
|
+
args.pending.set(callId, { resolve: resolve4, reject, timer });
|
|
2484
2491
|
args.emit({
|
|
2485
2492
|
type: "capability_invoked",
|
|
2486
2493
|
callId,
|
|
@@ -2869,6 +2876,34 @@ function planRuntimeSessionEmit(input) {
|
|
|
2869
2876
|
}
|
|
2870
2877
|
return { type: "runtime_session", driverSessionId, model, capabilitySignature };
|
|
2871
2878
|
}
|
|
2879
|
+
var GCP_SA_JSON_KEY = "GOOGLE_APPLICATION_CREDENTIALS_JSON";
|
|
2880
|
+
var GCP_SA_RELATIVE_PATH = join(".skaile", "gcp-sa.json");
|
|
2881
|
+
function resolveCloudSecretBundle(args) {
|
|
2882
|
+
const { cloud, secrets, projectDir } = args;
|
|
2883
|
+
const cloudSecrets = {};
|
|
2884
|
+
const bundleKeys = CLOUD_SECRET_ENV_KEYS[cloud];
|
|
2885
|
+
if (!secrets || !bundleKeys) return { cloudSecrets };
|
|
2886
|
+
for (const key of bundleKeys) {
|
|
2887
|
+
if (key === GCP_SA_JSON_KEY) continue;
|
|
2888
|
+
const value = secrets[key];
|
|
2889
|
+
if (value) cloudSecrets[key] = value;
|
|
2890
|
+
}
|
|
2891
|
+
const saJson = secrets[GCP_SA_JSON_KEY];
|
|
2892
|
+
if (bundleKeys.includes(GCP_SA_JSON_KEY) && saJson) {
|
|
2893
|
+
const saPath = resolve(projectDir, GCP_SA_RELATIVE_PATH);
|
|
2894
|
+
mkdirSync(dirname(saPath), { recursive: true });
|
|
2895
|
+
rmSync(saPath, { force: true });
|
|
2896
|
+
writeFileSync(saPath, saJson, { mode: 384 });
|
|
2897
|
+
cloudSecrets.GOOGLE_APPLICATION_CREDENTIALS = saPath;
|
|
2898
|
+
}
|
|
2899
|
+
return { cloudSecrets };
|
|
2900
|
+
}
|
|
2901
|
+
function cleanupCloudCredentialFiles(projectDir) {
|
|
2902
|
+
try {
|
|
2903
|
+
rmSync(resolve(projectDir, GCP_SA_RELATIVE_PATH), { force: true });
|
|
2904
|
+
} catch {
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2872
2907
|
|
|
2873
2908
|
// runner/src/compaction/prompt.ts
|
|
2874
2909
|
var DEFAULT_COMPACTION_PROMPT = `You are being asked to compact this conversation into a structured summary.
|
|
@@ -3882,9 +3917,9 @@ function createSessionStimulusBus(opts) {
|
|
|
3882
3917
|
connectorId,
|
|
3883
3918
|
fragmentLength: sig.promptFragment.length
|
|
3884
3919
|
});
|
|
3885
|
-
return new Promise((
|
|
3920
|
+
return new Promise((resolve4, reject) => {
|
|
3886
3921
|
const q = getQueue(connectorId);
|
|
3887
|
-
q.pending.push({ signal: sig, resolve:
|
|
3922
|
+
q.pending.push({ signal: sig, resolve: resolve4, reject });
|
|
3888
3923
|
startTimerIfNeeded(connectorId, q, coalesceMs);
|
|
3889
3924
|
});
|
|
3890
3925
|
}
|
|
@@ -4134,7 +4169,7 @@ async function startAgentServer(opts) {
|
|
|
4134
4169
|
const pendingCapabilityCalls = /* @__PURE__ */ new Map();
|
|
4135
4170
|
const remoteCapabilityInvoker = (name, input, timeoutMs) => {
|
|
4136
4171
|
const callId = typeof crypto?.randomUUID === "function" ? crypto.randomUUID() : `rcap-${Date.now()}-${Math.floor(Math.random() * 1e9)}`;
|
|
4137
|
-
return new Promise((
|
|
4172
|
+
return new Promise((resolve4, reject) => {
|
|
4138
4173
|
if (!transport.connected) {
|
|
4139
4174
|
reject(new Error(`Transport disconnected; cannot invoke remote capability ${name}`));
|
|
4140
4175
|
return;
|
|
@@ -4143,7 +4178,7 @@ async function startAgentServer(opts) {
|
|
|
4143
4178
|
pendingCapabilityCalls.delete(callId);
|
|
4144
4179
|
reject(new Error(`Remote capability ${name} (callId=${callId}) timed out`));
|
|
4145
4180
|
}, timeoutMs ?? DEFAULT_CAPABILITY_CALL_TIMEOUT_MS);
|
|
4146
|
-
pendingCapabilityCalls.set(callId, { resolve:
|
|
4181
|
+
pendingCapabilityCalls.set(callId, { resolve: resolve4, reject, timer });
|
|
4147
4182
|
transport.send({
|
|
4148
4183
|
type: "capability_invoked",
|
|
4149
4184
|
callId,
|
|
@@ -4154,8 +4189,8 @@ async function startAgentServer(opts) {
|
|
|
4154
4189
|
});
|
|
4155
4190
|
};
|
|
4156
4191
|
let aiProviderConfigId;
|
|
4157
|
-
const sleep = (ms) => new Promise((
|
|
4158
|
-
const t = setTimeout(
|
|
4192
|
+
const sleep = (ms) => new Promise((resolve4) => {
|
|
4193
|
+
const t = setTimeout(resolve4, ms);
|
|
4159
4194
|
t.unref?.();
|
|
4160
4195
|
});
|
|
4161
4196
|
async function mintAndPersistAiCredential(args) {
|
|
@@ -4262,7 +4297,15 @@ async function startAgentServer(opts) {
|
|
|
4262
4297
|
}
|
|
4263
4298
|
const secretsMode = wsConfig.secrets?.provider ?? "env";
|
|
4264
4299
|
wsConfig.secrets?.timeoutMs ?? 3e4;
|
|
4265
|
-
|
|
4300
|
+
const rawCloud = profile?.cloud ?? "default";
|
|
4301
|
+
const effectiveCloud = SUPPORTED_CLOUDS.includes(rawCloud) ? rawCloud : "default";
|
|
4302
|
+
if (effectiveCloud !== rawCloud) {
|
|
4303
|
+
log(
|
|
4304
|
+
`[serve] WARNING: unknown cloud "${rawCloud}" in agent-config \u2014 falling back to the default transport`
|
|
4305
|
+
);
|
|
4306
|
+
}
|
|
4307
|
+
const effectiveCloudConfig = cloudConfigFromProfile(profile);
|
|
4308
|
+
function buildSessionConfig(secretProvider2, apiKey, cloudSecrets) {
|
|
4266
4309
|
return {
|
|
4267
4310
|
projectDir: opts.projectDir,
|
|
4268
4311
|
agentDir,
|
|
@@ -4278,6 +4321,13 @@ async function startAgentServer(opts) {
|
|
|
4278
4321
|
secretProvider: secretProvider2,
|
|
4279
4322
|
onAuthError,
|
|
4280
4323
|
...apiKey ? { apiKey } : {},
|
|
4324
|
+
// Non-default cloud transport from skaile.yaml agent-config.default,
|
|
4325
|
+
// plus the platform-resolved credential bundle (Vertex SA JSON already
|
|
4326
|
+
// materialized to a file path by resolveCloudSecretBundle). Omitted
|
|
4327
|
+
// entirely for `default` so the session config stays byte-identical.
|
|
4328
|
+
...effectiveCloud !== "default" ? { cloud: effectiveCloud } : {},
|
|
4329
|
+
...effectiveCloudConfig ? { cloudConfig: effectiveCloudConfig } : {},
|
|
4330
|
+
...cloudSecrets ? { cloudSecrets } : {},
|
|
4281
4331
|
// Protocol v2 `<CAPABILITIES>` block — joins each registered capability's
|
|
4282
4332
|
// `promptFragment` (framework first, then client, then agent-side
|
|
4283
4333
|
// surfaces). Built lazily inside `buildSessionConfig` so newly registered
|
|
@@ -4343,8 +4393,8 @@ async function startAgentServer(opts) {
|
|
|
4343
4393
|
}
|
|
4344
4394
|
let resolveSessionReady;
|
|
4345
4395
|
let rejectSessionReady;
|
|
4346
|
-
const sessionReady = new Promise((
|
|
4347
|
-
resolveSessionReady =
|
|
4396
|
+
const sessionReady = new Promise((resolve4, reject) => {
|
|
4397
|
+
resolveSessionReady = resolve4;
|
|
4348
4398
|
rejectSessionReady = reject;
|
|
4349
4399
|
});
|
|
4350
4400
|
let sessionConfig;
|
|
@@ -4511,7 +4561,9 @@ async function startAgentServer(opts) {
|
|
|
4511
4561
|
driver.removeAllListeners("error");
|
|
4512
4562
|
driver.kill();
|
|
4513
4563
|
} catch (err) {
|
|
4514
|
-
log(
|
|
4564
|
+
log(
|
|
4565
|
+
`[serve] failed to retire previous driver: ${err instanceof Error ? err.message : String(err)}`
|
|
4566
|
+
);
|
|
4515
4567
|
}
|
|
4516
4568
|
}
|
|
4517
4569
|
driver = incoming;
|
|
@@ -4609,7 +4661,7 @@ async function startAgentServer(opts) {
|
|
|
4609
4661
|
return stimulusBus;
|
|
4610
4662
|
}
|
|
4611
4663
|
function awaitFlowAgentEnd(prompt, timeoutMs) {
|
|
4612
|
-
return new Promise((
|
|
4664
|
+
return new Promise((resolve4, reject) => {
|
|
4613
4665
|
let settled = false;
|
|
4614
4666
|
const onEvent = (event) => {
|
|
4615
4667
|
if (event.type === "agent_end") done();
|
|
@@ -4627,7 +4679,7 @@ async function startAgentServer(opts) {
|
|
|
4627
4679
|
onEvent
|
|
4628
4680
|
) ?? driver.removeListener("agent-event", onEvent);
|
|
4629
4681
|
if (err) reject(err);
|
|
4630
|
-
else
|
|
4682
|
+
else resolve4();
|
|
4631
4683
|
};
|
|
4632
4684
|
const timer = setTimeout(
|
|
4633
4685
|
() => done(new Error(`Flow turn timed out after ${timeoutMs / 1e3}s`)),
|
|
@@ -4756,8 +4808,8 @@ async function startAgentServer(opts) {
|
|
|
4756
4808
|
try {
|
|
4757
4809
|
await Promise.race([
|
|
4758
4810
|
sessionReady,
|
|
4759
|
-
new Promise((
|
|
4760
|
-
const t = setTimeout(
|
|
4811
|
+
new Promise((resolve4) => {
|
|
4812
|
+
const t = setTimeout(resolve4, 2e3);
|
|
4761
4813
|
t.unref?.();
|
|
4762
4814
|
})
|
|
4763
4815
|
]);
|
|
@@ -4789,6 +4841,10 @@ async function startAgentServer(opts) {
|
|
|
4789
4841
|
} catch {
|
|
4790
4842
|
}
|
|
4791
4843
|
}
|
|
4844
|
+
try {
|
|
4845
|
+
cleanupCloudCredentialFiles(opts.projectDir);
|
|
4846
|
+
} catch {
|
|
4847
|
+
}
|
|
4792
4848
|
}
|
|
4793
4849
|
async function awaitSessionReadyOrFail() {
|
|
4794
4850
|
try {
|
|
@@ -4847,10 +4903,20 @@ async function startAgentServer(opts) {
|
|
|
4847
4903
|
return initialAiCredentialExpiresAt;
|
|
4848
4904
|
}
|
|
4849
4905
|
async function buildSessionFromInit(secrets) {
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4906
|
+
let apiKeyFromSecrets;
|
|
4907
|
+
let cloudSecrets;
|
|
4908
|
+
if (effectiveCloud === "default") {
|
|
4909
|
+
const effectiveProvider = opts.provider ?? "anthropic";
|
|
4910
|
+
const envKey = providerEnvKey(effectiveProvider);
|
|
4911
|
+
apiKeyFromSecrets = secrets?.[envKey];
|
|
4912
|
+
} else {
|
|
4913
|
+
({ cloudSecrets } = resolveCloudSecretBundle({
|
|
4914
|
+
cloud: effectiveCloud,
|
|
4915
|
+
secrets,
|
|
4916
|
+
projectDir: opts.projectDir
|
|
4917
|
+
}));
|
|
4918
|
+
}
|
|
4919
|
+
sessionConfig = buildSessionConfig(secretProvider, apiKeyFromSecrets, cloudSecrets);
|
|
4854
4920
|
if (!agentSession) {
|
|
4855
4921
|
agentSession = await createAgentSession(sessionConfig);
|
|
4856
4922
|
emitSystemPromptComposed(agentSession, sendEvent);
|
|
@@ -5832,5 +5898,5 @@ function touchSession(state) {
|
|
|
5832
5898
|
}
|
|
5833
5899
|
|
|
5834
5900
|
export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, connectorRefreshKind, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile };
|
|
5835
|
-
//# sourceMappingURL=chunk-
|
|
5836
|
-
//# sourceMappingURL=chunk-
|
|
5901
|
+
//# sourceMappingURL=chunk-7CNIRF42.js.map
|
|
5902
|
+
//# sourceMappingURL=chunk-7CNIRF42.js.map
|