@skaile/workspaces 1.2.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 +6 -0
- package/dist/{asset-feeds-OBPWVUDL.js → asset-feeds-NEZKG6YS.js} +9 -9
- package/dist/{asset-feeds-OBPWVUDL.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-MQEZE6TU.js → chunk-5XS3BFJS.js} +3 -3
- package/dist/{chunk-MQEZE6TU.js.map → chunk-5XS3BFJS.js.map} +1 -1
- package/dist/{chunk-TTTLCSEQ.js → chunk-7CNIRF42.js} +108 -37
- 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-EPLYVB3L.js → chunk-ETYDLXI5.js} +2 -2
- package/dist/{chunk-EPLYVB3L.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-KAWKKMU4.js → chunk-OBSSORCE.js} +6 -6
- package/dist/{chunk-KAWKKMU4.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-NUS5L5ZJ.js → chunk-P3MJYPZE.js} +5 -5
- package/dist/{chunk-NUS5L5ZJ.js.map → chunk-P3MJYPZE.js.map} +1 -1
- package/dist/{chunk-VCBLXF7D.js → chunk-PSMW5HLX.js} +4 -4
- package/dist/{chunk-VCBLXF7D.js.map → chunk-PSMW5HLX.js.map} +1 -1
- 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-CLUJLV7Z.js → chunk-RHMQPLIK.js} +5 -5
- package/dist/{chunk-CLUJLV7Z.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-XWLVIEWD.js → chunk-RYRJEVQ4.js} +7 -7
- package/dist/{chunk-XWLVIEWD.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-W65IK4MH.js → chunk-YXEPZ7LP.js} +5 -5
- package/dist/{chunk-W65IK4MH.js.map → chunk-YXEPZ7LP.js.map} +1 -1
- package/dist/cli/index.js +40 -39
- package/dist/cli/index.js.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-BQI2TOZZ.js → ensure-sources-4BAJGJRK.js} +10 -10
- package/dist/{ensure-sources-BQI2TOZZ.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.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-SC4PWN2F.js → helpers-2OL4FRFB.js} +10 -10
- package/dist/{helpers-SC4PWN2F.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-ZNYIND7N.js → open-library-RPV2LIKL.js} +13 -13
- package/dist/{open-library-ZNYIND7N.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/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/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/{setup-WBGDT2WY.js → setup-WS6PF6JQ.js} +8 -7
- package/dist/setup-WS6PF6JQ.js.map +1 -0
- package/dist/{source-SBFVULTG.js → source-22U5NOY4.js} +14 -14
- package/dist/{source-SBFVULTG.js.map → source-22U5NOY4.js.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-CU5Z7GH3.js.map +0 -1
- package/dist/chunk-MG6UIS7G.js.map +0 -1
- package/dist/chunk-QVE3ILCY.js.map +0 -1
- package/dist/chunk-TTTLCSEQ.js.map +0 -1
- 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),
|
|
@@ -1787,7 +1788,9 @@ async function createAgentSession(config) {
|
|
|
1787
1788
|
const driverType = settings.driver ?? "omp";
|
|
1788
1789
|
const provider = settings.provider;
|
|
1789
1790
|
const model = settings.model;
|
|
1790
|
-
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);
|
|
1791
1794
|
const manifest = agentDir ? await loadAgentManifest(agentDir) : void 0;
|
|
1792
1795
|
const {
|
|
1793
1796
|
resourceManager,
|
|
@@ -1862,6 +1865,8 @@ async function createAgentSession(config) {
|
|
|
1862
1865
|
agentCwd,
|
|
1863
1866
|
provider,
|
|
1864
1867
|
model,
|
|
1868
|
+
cloud,
|
|
1869
|
+
cloudConfig,
|
|
1865
1870
|
manifest,
|
|
1866
1871
|
maxTurns,
|
|
1867
1872
|
apiKey,
|
|
@@ -1984,6 +1989,8 @@ function createSessionDriver(args) {
|
|
|
1984
1989
|
agentCwd,
|
|
1985
1990
|
provider,
|
|
1986
1991
|
model,
|
|
1992
|
+
cloud,
|
|
1993
|
+
cloudConfig,
|
|
1987
1994
|
manifest,
|
|
1988
1995
|
maxTurns,
|
|
1989
1996
|
apiKey,
|
|
@@ -2003,6 +2010,11 @@ function createSessionDriver(args) {
|
|
|
2003
2010
|
apiKeys: apiKey ? { [provider ?? "anthropic"]: apiKey } : void 0,
|
|
2004
2011
|
systemPrompt,
|
|
2005
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 } : {},
|
|
2006
2018
|
...thinking ? { thinking } : {},
|
|
2007
2019
|
...effort ? { effort } : {},
|
|
2008
2020
|
...sessionId ? { sessionId } : {},
|
|
@@ -2059,14 +2071,14 @@ async function runAgentChat(opts) {
|
|
|
2059
2071
|
${message}`;
|
|
2060
2072
|
}
|
|
2061
2073
|
try {
|
|
2062
|
-
await new Promise((
|
|
2074
|
+
await new Promise((resolve4, reject) => {
|
|
2063
2075
|
const onEvent = (event) => {
|
|
2064
2076
|
if (event.type === "agent_end") {
|
|
2065
2077
|
driver.off("agent-event", onEvent);
|
|
2066
2078
|
mdStream.end();
|
|
2067
2079
|
process.stdout.write("\n");
|
|
2068
2080
|
driver.kill();
|
|
2069
|
-
|
|
2081
|
+
resolve4();
|
|
2070
2082
|
} else if (event.type === "error") {
|
|
2071
2083
|
driver.off("agent-event", onEvent);
|
|
2072
2084
|
const err = new Error(String(event.error));
|
|
@@ -2466,7 +2478,7 @@ function buildClientCapabilityHandler(args) {
|
|
|
2466
2478
|
});
|
|
2467
2479
|
return {};
|
|
2468
2480
|
}
|
|
2469
|
-
return new Promise((
|
|
2481
|
+
return new Promise((resolve4, reject) => {
|
|
2470
2482
|
const timer = setTimeout(() => {
|
|
2471
2483
|
args.pending.delete(callId);
|
|
2472
2484
|
reject(
|
|
@@ -2475,7 +2487,7 @@ function buildClientCapabilityHandler(args) {
|
|
|
2475
2487
|
)
|
|
2476
2488
|
);
|
|
2477
2489
|
}, timeoutMs);
|
|
2478
|
-
args.pending.set(callId, { resolve:
|
|
2490
|
+
args.pending.set(callId, { resolve: resolve4, reject, timer });
|
|
2479
2491
|
args.emit({
|
|
2480
2492
|
type: "capability_invoked",
|
|
2481
2493
|
callId,
|
|
@@ -2864,6 +2876,34 @@ function planRuntimeSessionEmit(input) {
|
|
|
2864
2876
|
}
|
|
2865
2877
|
return { type: "runtime_session", driverSessionId, model, capabilitySignature };
|
|
2866
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
|
+
}
|
|
2867
2907
|
|
|
2868
2908
|
// runner/src/compaction/prompt.ts
|
|
2869
2909
|
var DEFAULT_COMPACTION_PROMPT = `You are being asked to compact this conversation into a structured summary.
|
|
@@ -3877,9 +3917,9 @@ function createSessionStimulusBus(opts) {
|
|
|
3877
3917
|
connectorId,
|
|
3878
3918
|
fragmentLength: sig.promptFragment.length
|
|
3879
3919
|
});
|
|
3880
|
-
return new Promise((
|
|
3920
|
+
return new Promise((resolve4, reject) => {
|
|
3881
3921
|
const q = getQueue(connectorId);
|
|
3882
|
-
q.pending.push({ signal: sig, resolve:
|
|
3922
|
+
q.pending.push({ signal: sig, resolve: resolve4, reject });
|
|
3883
3923
|
startTimerIfNeeded(connectorId, q, coalesceMs);
|
|
3884
3924
|
});
|
|
3885
3925
|
}
|
|
@@ -4129,7 +4169,7 @@ async function startAgentServer(opts) {
|
|
|
4129
4169
|
const pendingCapabilityCalls = /* @__PURE__ */ new Map();
|
|
4130
4170
|
const remoteCapabilityInvoker = (name, input, timeoutMs) => {
|
|
4131
4171
|
const callId = typeof crypto?.randomUUID === "function" ? crypto.randomUUID() : `rcap-${Date.now()}-${Math.floor(Math.random() * 1e9)}`;
|
|
4132
|
-
return new Promise((
|
|
4172
|
+
return new Promise((resolve4, reject) => {
|
|
4133
4173
|
if (!transport.connected) {
|
|
4134
4174
|
reject(new Error(`Transport disconnected; cannot invoke remote capability ${name}`));
|
|
4135
4175
|
return;
|
|
@@ -4138,7 +4178,7 @@ async function startAgentServer(opts) {
|
|
|
4138
4178
|
pendingCapabilityCalls.delete(callId);
|
|
4139
4179
|
reject(new Error(`Remote capability ${name} (callId=${callId}) timed out`));
|
|
4140
4180
|
}, timeoutMs ?? DEFAULT_CAPABILITY_CALL_TIMEOUT_MS);
|
|
4141
|
-
pendingCapabilityCalls.set(callId, { resolve:
|
|
4181
|
+
pendingCapabilityCalls.set(callId, { resolve: resolve4, reject, timer });
|
|
4142
4182
|
transport.send({
|
|
4143
4183
|
type: "capability_invoked",
|
|
4144
4184
|
callId,
|
|
@@ -4149,8 +4189,8 @@ async function startAgentServer(opts) {
|
|
|
4149
4189
|
});
|
|
4150
4190
|
};
|
|
4151
4191
|
let aiProviderConfigId;
|
|
4152
|
-
const sleep = (ms) => new Promise((
|
|
4153
|
-
const t = setTimeout(
|
|
4192
|
+
const sleep = (ms) => new Promise((resolve4) => {
|
|
4193
|
+
const t = setTimeout(resolve4, ms);
|
|
4154
4194
|
t.unref?.();
|
|
4155
4195
|
});
|
|
4156
4196
|
async function mintAndPersistAiCredential(args) {
|
|
@@ -4257,7 +4297,15 @@ async function startAgentServer(opts) {
|
|
|
4257
4297
|
}
|
|
4258
4298
|
const secretsMode = wsConfig.secrets?.provider ?? "env";
|
|
4259
4299
|
wsConfig.secrets?.timeoutMs ?? 3e4;
|
|
4260
|
-
|
|
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) {
|
|
4261
4309
|
return {
|
|
4262
4310
|
projectDir: opts.projectDir,
|
|
4263
4311
|
agentDir,
|
|
@@ -4273,6 +4321,13 @@ async function startAgentServer(opts) {
|
|
|
4273
4321
|
secretProvider: secretProvider2,
|
|
4274
4322
|
onAuthError,
|
|
4275
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 } : {},
|
|
4276
4331
|
// Protocol v2 `<CAPABILITIES>` block — joins each registered capability's
|
|
4277
4332
|
// `promptFragment` (framework first, then client, then agent-side
|
|
4278
4333
|
// surfaces). Built lazily inside `buildSessionConfig` so newly registered
|
|
@@ -4338,8 +4393,8 @@ async function startAgentServer(opts) {
|
|
|
4338
4393
|
}
|
|
4339
4394
|
let resolveSessionReady;
|
|
4340
4395
|
let rejectSessionReady;
|
|
4341
|
-
const sessionReady = new Promise((
|
|
4342
|
-
resolveSessionReady =
|
|
4396
|
+
const sessionReady = new Promise((resolve4, reject) => {
|
|
4397
|
+
resolveSessionReady = resolve4;
|
|
4343
4398
|
rejectSessionReady = reject;
|
|
4344
4399
|
});
|
|
4345
4400
|
let sessionConfig;
|
|
@@ -4506,7 +4561,9 @@ async function startAgentServer(opts) {
|
|
|
4506
4561
|
driver.removeAllListeners("error");
|
|
4507
4562
|
driver.kill();
|
|
4508
4563
|
} catch (err) {
|
|
4509
|
-
log(
|
|
4564
|
+
log(
|
|
4565
|
+
`[serve] failed to retire previous driver: ${err instanceof Error ? err.message : String(err)}`
|
|
4566
|
+
);
|
|
4510
4567
|
}
|
|
4511
4568
|
}
|
|
4512
4569
|
driver = incoming;
|
|
@@ -4604,7 +4661,7 @@ async function startAgentServer(opts) {
|
|
|
4604
4661
|
return stimulusBus;
|
|
4605
4662
|
}
|
|
4606
4663
|
function awaitFlowAgentEnd(prompt, timeoutMs) {
|
|
4607
|
-
return new Promise((
|
|
4664
|
+
return new Promise((resolve4, reject) => {
|
|
4608
4665
|
let settled = false;
|
|
4609
4666
|
const onEvent = (event) => {
|
|
4610
4667
|
if (event.type === "agent_end") done();
|
|
@@ -4622,7 +4679,7 @@ async function startAgentServer(opts) {
|
|
|
4622
4679
|
onEvent
|
|
4623
4680
|
) ?? driver.removeListener("agent-event", onEvent);
|
|
4624
4681
|
if (err) reject(err);
|
|
4625
|
-
else
|
|
4682
|
+
else resolve4();
|
|
4626
4683
|
};
|
|
4627
4684
|
const timer = setTimeout(
|
|
4628
4685
|
() => done(new Error(`Flow turn timed out after ${timeoutMs / 1e3}s`)),
|
|
@@ -4751,8 +4808,8 @@ async function startAgentServer(opts) {
|
|
|
4751
4808
|
try {
|
|
4752
4809
|
await Promise.race([
|
|
4753
4810
|
sessionReady,
|
|
4754
|
-
new Promise((
|
|
4755
|
-
const t = setTimeout(
|
|
4811
|
+
new Promise((resolve4) => {
|
|
4812
|
+
const t = setTimeout(resolve4, 2e3);
|
|
4756
4813
|
t.unref?.();
|
|
4757
4814
|
})
|
|
4758
4815
|
]);
|
|
@@ -4784,6 +4841,10 @@ async function startAgentServer(opts) {
|
|
|
4784
4841
|
} catch {
|
|
4785
4842
|
}
|
|
4786
4843
|
}
|
|
4844
|
+
try {
|
|
4845
|
+
cleanupCloudCredentialFiles(opts.projectDir);
|
|
4846
|
+
} catch {
|
|
4847
|
+
}
|
|
4787
4848
|
}
|
|
4788
4849
|
async function awaitSessionReadyOrFail() {
|
|
4789
4850
|
try {
|
|
@@ -4842,10 +4903,20 @@ async function startAgentServer(opts) {
|
|
|
4842
4903
|
return initialAiCredentialExpiresAt;
|
|
4843
4904
|
}
|
|
4844
4905
|
async function buildSessionFromInit(secrets) {
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
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);
|
|
4849
4920
|
if (!agentSession) {
|
|
4850
4921
|
agentSession = await createAgentSession(sessionConfig);
|
|
4851
4922
|
emitSystemPromptComposed(agentSession, sendEvent);
|
|
@@ -5827,5 +5898,5 @@ function touchSession(state) {
|
|
|
5827
5898
|
}
|
|
5828
5899
|
|
|
5829
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 };
|
|
5830
|
-
//# sourceMappingURL=chunk-
|
|
5831
|
-
//# sourceMappingURL=chunk-
|
|
5901
|
+
//# sourceMappingURL=chunk-7CNIRF42.js.map
|
|
5902
|
+
//# sourceMappingURL=chunk-7CNIRF42.js.map
|