@skaile/workspaces 1.2.0 → 1.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 +128 -0
- package/README.md +1 -1
- package/dist/app-sdk/index.d.ts +2 -0
- package/dist/app-sdk/index.js +295 -0
- package/dist/app-sdk/index.js.map +1 -0
- package/dist/app-sdk/src/app.d.ts +101 -0
- package/dist/app-sdk/src/app.d.ts.map +1 -0
- package/dist/app-sdk/src/define-app-capability.d.ts +139 -0
- package/dist/app-sdk/src/define-app-capability.d.ts.map +1 -0
- package/dist/app-sdk/src/index.d.ts +16 -0
- package/dist/app-sdk/src/index.d.ts.map +1 -0
- package/dist/app-sdk/src/logger.d.ts +26 -0
- package/dist/app-sdk/src/logger.d.ts.map +1 -0
- package/dist/app-sdk/src/transport.d.ts +84 -0
- package/dist/app-sdk/src/transport.d.ts.map +1 -0
- package/dist/app-sdk/src/ws-transport.d.ts +63 -0
- package/dist/app-sdk/src/ws-transport.d.ts.map +1 -0
- package/dist/{asset-feeds-OBPWVUDL.js → asset-feeds-NG5TKB3V.js} +10 -10
- package/dist/{asset-feeds-OBPWVUDL.js.map → asset-feeds-NG5TKB3V.js.map} +1 -1
- package/dist/asset-manager/index.js +9 -9
- package/dist/asset-manager/installer.js +8 -8
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/asset-manager/src/index.d.ts +42 -6
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +41 -6
- 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 +4 -3
- 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-MG6UIS7G.js → chunk-26YCXWCU.js} +52 -3
- package/dist/chunk-26YCXWCU.js.map +1 -0
- package/dist/{chunk-SKADPHAM.js → chunk-4N5XR5DQ.js} +2 -2
- package/dist/chunk-4N5XR5DQ.js.map +1 -0
- package/dist/{chunk-CLUJLV7Z.js → chunk-77OXU44H.js} +6 -6
- package/dist/{chunk-CLUJLV7Z.js.map → chunk-77OXU44H.js.map} +1 -1
- package/dist/{chunk-TTTLCSEQ.js → chunk-AAGD2J4H.js} +121 -41
- package/dist/chunk-AAGD2J4H.js.map +1 -0
- package/dist/{chunk-KVZ6XKVN.js → chunk-B6SSXVF2.js} +4 -4
- package/dist/chunk-B6SSXVF2.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-YI5OZ7QO.js → chunk-BE5KTS2L.js} +3 -3
- package/dist/{chunk-YI5OZ7QO.js.map → chunk-BE5KTS2L.js.map} +1 -1
- package/dist/{chunk-ZUE2PIJ5.js → chunk-BJHZHNKR.js} +3 -3
- package/dist/{chunk-ZUE2PIJ5.js.map → chunk-BJHZHNKR.js.map} +1 -1
- package/dist/{chunk-MQEZE6TU.js → chunk-DNFIKRO6.js} +3 -3
- package/dist/{chunk-MQEZE6TU.js.map → chunk-DNFIKRO6.js.map} +1 -1
- package/dist/{chunk-VCBLXF7D.js → chunk-GWDZW44L.js} +5 -5
- package/dist/{chunk-VCBLXF7D.js.map → chunk-GWDZW44L.js.map} +1 -1
- package/dist/{chunk-UY5Q2NZH.js → chunk-HKX5VSWQ.js} +3 -3
- package/dist/{chunk-UY5Q2NZH.js.map → chunk-HKX5VSWQ.js.map} +1 -1
- package/dist/{chunk-NUS5L5ZJ.js → chunk-HWTQ6HPO.js} +5 -5
- package/dist/{chunk-NUS5L5ZJ.js.map → chunk-HWTQ6HPO.js.map} +1 -1
- package/dist/{chunk-WRBF34YE.js → chunk-IEX5YV4R.js} +3 -3
- package/dist/{chunk-WRBF34YE.js.map → chunk-IEX5YV4R.js.map} +1 -1
- package/dist/{chunk-CU5Z7GH3.js → chunk-IRORTHGA.js} +20 -6
- package/dist/chunk-IRORTHGA.js.map +1 -0
- package/dist/chunk-ISQWMBKD.js +74 -0
- package/dist/chunk-ISQWMBKD.js.map +1 -0
- package/dist/{chunk-W65IK4MH.js → chunk-JZPEEMIM.js} +6 -6
- package/dist/{chunk-W65IK4MH.js.map → chunk-JZPEEMIM.js.map} +1 -1
- package/dist/{chunk-35TLBMHX.js → chunk-LCTRCWBK.js} +6 -6
- package/dist/{chunk-35TLBMHX.js.map → chunk-LCTRCWBK.js.map} +1 -1
- package/dist/{chunk-U5J77IIZ.js → chunk-NKTFEV7Q.js} +4 -4
- package/dist/{chunk-U5J77IIZ.js.map → chunk-NKTFEV7Q.js.map} +1 -1
- package/dist/{chunk-EPLYVB3L.js → chunk-OSCJRUKM.js} +2 -2
- package/dist/{chunk-EPLYVB3L.js.map → chunk-OSCJRUKM.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-EVZKWY5J.js → chunk-PK7Q7MC7.js} +5 -4
- package/dist/chunk-PK7Q7MC7.js.map +1 -0
- package/dist/{chunk-XWLVIEWD.js → chunk-QM2TT2PJ.js} +20 -12
- package/dist/chunk-QM2TT2PJ.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-QVE3ILCY.js → chunk-TNSCHS4I.js} +2 -2
- package/dist/chunk-TNSCHS4I.js.map +1 -0
- package/dist/{chunk-Z5Z3MYDL.js → chunk-UPZGQZEJ.js} +3 -3
- package/dist/{chunk-Z5Z3MYDL.js.map → chunk-UPZGQZEJ.js.map} +1 -1
- package/dist/{chunk-52XHXSBN.js → chunk-UQ5FK2AB.js} +3 -3
- package/dist/{chunk-52XHXSBN.js.map → chunk-UQ5FK2AB.js.map} +1 -1
- package/dist/{chunk-KAWKKMU4.js → chunk-X57AMTAH.js} +74 -11
- package/dist/chunk-X57AMTAH.js.map +1 -0
- package/dist/{chunk-OIGYDVCM.js → chunk-XBG2YDQQ.js} +3 -3
- package/dist/{chunk-OIGYDVCM.js.map → chunk-XBG2YDQQ.js.map} +1 -1
- package/dist/cli/index.js +770 -188
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/preset-apply.d.ts +59 -0
- package/dist/cli/src/commands/preset-apply.d.ts.map +1 -0
- package/dist/cli/src/commands/preset-cmd.d.ts +2 -2
- package/dist/cli/src/commands/preset-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/preset-export.d.ts +93 -0
- package/dist/cli/src/commands/preset-export.d.ts.map +1 -0
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/why.d.ts +18 -0
- package/dist/cli/src/commands/why.d.ts.map +1 -1
- package/dist/connectors/config.js +5 -5
- package/dist/connectors/index.js +7 -7
- package/dist/core/index.js +4 -4
- 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/src/workspace-yaml-editor.d.ts +14 -1
- package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/deploy/index.js +4 -4
- package/dist/discovery/index.js +2 -2
- package/dist/{ensure-sources-BQI2TOZZ.js → ensure-sources-CHC7X7AJ.js} +12 -12
- package/dist/{ensure-sources-BQI2TOZZ.js.map → ensure-sources-CHC7X7AJ.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +7 -7
- package/dist/factory-assets/connectors/deploy.js +7 -7
- package/dist/factory-assets/connectors/devserver.js +7 -7
- package/dist/factory-assets/connectors/flow/adapter.js +7 -7
- package/dist/factory-assets/connectors/flow/engine/engine.d.ts +4 -1
- package/dist/factory-assets/connectors/flow/engine/engine.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/types.d.ts +41 -6
- package/dist/factory-assets/connectors/flow/engine/types.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine.js +5 -5
- package/dist/factory-assets/connectors/flow/run-flow.js +8 -8
- package/dist/factory-assets/connectors/flow.js +7 -7
- package/dist/factory-assets/connectors/git.js +7 -7
- package/dist/factory-assets/connectors/gmail.js +7 -7
- package/dist/factory-assets/connectors/googledrive.js +7 -7
- package/dist/factory-assets/connectors/local.js +7 -7
- package/dist/factory-assets/connectors/mattermost.js +7 -7
- package/dist/factory-assets/connectors/memory.js +7 -7
- package/dist/factory-assets/connectors/minio.js +7 -7
- package/dist/factory-assets/connectors/postgres.js +7 -7
- package/dist/factory-assets/connectors/s3.js +7 -7
- package/dist/factory-assets/connectors/sharepoint.js +7 -7
- package/dist/factory-assets/connectors/sqlite.js +7 -7
- package/dist/factory-assets/connectors/static-server.js +7 -7
- package/dist/factory-assets/connectors/tunnel.js +7 -7
- package/dist/factory-assets/connectors/webdav.js +7 -7
- package/dist/factory-assets/connectors/xstate-store.js +7 -7
- package/dist/factory-assets/connectors/xstate.js +7 -7
- package/dist/factory-assets/skills/skaile-author-asset/SKILL.md +1 -1
- package/dist/factory-assets/skills/skaile-manage-workspace/SKILL.md +1 -1
- package/dist/{flows-4Z74KY2H.js → flows-CGOCUNO6.js} +4 -4
- package/dist/{flows-4Z74KY2H.js.map → flows-CGOCUNO6.js.map} +1 -1
- package/dist/{helpers-SC4PWN2F.js → helpers-GWG4CYYC.js} +12 -12
- package/dist/{helpers-SC4PWN2F.js.map → helpers-GWG4CYYC.js.map} +1 -1
- package/dist/library/index.js +8 -8
- package/dist/library/install.js +4 -4
- package/dist/{open-library-ZNYIND7N.js → open-library-37PXN6MK.js} +17 -17
- package/dist/{open-library-ZNYIND7N.js.map → open-library-37PXN6MK.js.map} +1 -1
- package/dist/{paths-S7QNXYMB.js → paths-UVOHWUPY.js} +7 -7
- package/dist/{paths-S7QNXYMB.js.map → paths-UVOHWUPY.js.map} +1 -1
- package/dist/{plugin-store-3DAVGKHN.js → plugin-store-EIMVEH3O.js} +6 -6
- package/dist/{plugin-store-3DAVGKHN.js.map → plugin-store-EIMVEH3O.js.map} +1 -1
- package/dist/runner/index.js +14 -13
- package/dist/runner/src/capability-registry.d.ts +15 -4
- package/dist/runner/src/capability-registry.d.ts.map +1 -1
- 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 +9 -9
- package/dist/sdk/bridge.js +4 -3
- package/dist/sdk/core.js +4 -4
- package/dist/sdk/flow.js +5 -5
- package/dist/sdk/index.js +14 -13
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runner.js +14 -13
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/session/index.js +2 -2
- package/dist/{setup-WBGDT2WY.js → setup-DINVR6ZQ.js} +10 -9
- package/dist/setup-DINVR6ZQ.js.map +1 -0
- package/dist/{source-SBFVULTG.js → source-RXAHIGMD.js} +18 -18
- package/dist/{source-SBFVULTG.js.map → source-RXAHIGMD.js.map} +1 -1
- package/dist/{store-client-YGDN4L2G.js → store-client-T3F663YG.js} +7 -7
- package/dist/{store-client-YGDN4L2G.js.map → store-client-T3F663YG.js.map} +1 -1
- package/dist/tui/index.js +14 -13
- package/dist/tui/index.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/capabilities.d.ts +8 -2
- package/dist/types/src/capabilities.d.ts.map +1 -1
- package/dist/types/src/logging.d.ts +3 -2
- package/dist/types/src/logging.d.ts.map +1 -1
- package/dist/types/src/manifests/_shared.d.ts +4 -4
- 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 +3 -3
- package/dist/types/src/manifests/index.d.ts.map +1 -1
- package/dist/types/src/manifests/preset.d.ts +10 -0
- package/dist/types/src/manifests/preset.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 +2 -2
- package/dist/workspace-plugin/adapters/omp.js +3 -3
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +7 -1
- package/dist/chunk-5AGARSQT.js.map +0 -1
- package/dist/chunk-CU5Z7GH3.js.map +0 -1
- package/dist/chunk-EVZKWY5J.js.map +0 -1
- package/dist/chunk-KAWKKMU4.js.map +0 -1
- package/dist/chunk-KVZ6XKVN.js.map +0 -1
- package/dist/chunk-MG6UIS7G.js.map +0 -1
- package/dist/chunk-QVE3ILCY.js.map +0 -1
- package/dist/chunk-SKADPHAM.js.map +0 -1
- package/dist/chunk-TTTLCSEQ.js.map +0 -1
- package/dist/chunk-XWLVIEWD.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-OSCJRUKM.js';
|
|
2
2
|
import { WebSocketServerTransport } from './chunk-WQ7DE5UC.js';
|
|
3
3
|
import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { EventNormalizer } from './chunk-HKX5VSWQ.js';
|
|
5
|
+
import { SUPPORTED_CLOUDS, CLOUD_SECRET_ENV_KEYS } from './chunk-ISQWMBKD.js';
|
|
6
6
|
import { classifyClaudeSdkError } from './chunk-GAH4YRCI.js';
|
|
7
|
-
import { createDriver } from './chunk-
|
|
7
|
+
import { createDriver } from './chunk-TNSCHS4I.js';
|
|
8
8
|
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-
|
|
9
|
+
import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools } from './chunk-GWDZW44L.js';
|
|
10
|
+
import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, deriveSingleMaterializedConnectorDeclaration } from './chunk-BDUANIAR.js';
|
|
11
11
|
import { renderStimulusPrompt, buildOrchestratorPrompt } from './chunk-DEYYRFQU.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { PROTOCOL_VERSION } from './chunk-PK7Q7MC7.js';
|
|
13
|
+
import { resolveSettings, resolveApiKey, providerEnvKey } from './chunk-26YCXWCU.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));
|
|
@@ -2187,8 +2199,12 @@ var ORIGIN_PROMPT_ORDER = [
|
|
|
2187
2199
|
"skill",
|
|
2188
2200
|
"mcp",
|
|
2189
2201
|
"connector",
|
|
2190
|
-
"mount"
|
|
2202
|
+
"mount",
|
|
2203
|
+
"app"
|
|
2191
2204
|
];
|
|
2205
|
+
function describeSource(source) {
|
|
2206
|
+
return typeof source === "string" ? source : `app:${source.appId}`;
|
|
2207
|
+
}
|
|
2192
2208
|
var CapabilityRegistry = class {
|
|
2193
2209
|
byName = /* @__PURE__ */ new Map();
|
|
2194
2210
|
logger;
|
|
@@ -2238,6 +2254,8 @@ var CapabilityRegistry = class {
|
|
|
2238
2254
|
* Allowed combinations:
|
|
2239
2255
|
* - source `'agent'`: origins `framework | agent | flow | skill | mcp | connector | mount`
|
|
2240
2256
|
* - source `'client'`: origin `client` only
|
|
2257
|
+
* - source `{ kind: 'app', appId }`: origin `app` only, and the origin's
|
|
2258
|
+
* `appId` must match the source `appId`
|
|
2241
2259
|
*
|
|
2242
2260
|
* @param cap - capability to register (typically built via {@link defineCapability})
|
|
2243
2261
|
* @param source - which side is doing the registration
|
|
@@ -2246,7 +2264,7 @@ var CapabilityRegistry = class {
|
|
|
2246
2264
|
if (!this.isOriginAllowed(source, cap.origin)) {
|
|
2247
2265
|
this.logger.warn("capability registration rejected (origin mismatch)", {
|
|
2248
2266
|
name: cap.name,
|
|
2249
|
-
source,
|
|
2267
|
+
source: describeSource(source),
|
|
2250
2268
|
originKind: cap.origin.kind
|
|
2251
2269
|
});
|
|
2252
2270
|
return;
|
|
@@ -2397,7 +2415,10 @@ var CapabilityRegistry = class {
|
|
|
2397
2415
|
if (source === "client") {
|
|
2398
2416
|
return origin.kind === "client";
|
|
2399
2417
|
}
|
|
2400
|
-
|
|
2418
|
+
if (source === "agent") {
|
|
2419
|
+
return origin.kind !== "client" && origin.kind !== "app";
|
|
2420
|
+
}
|
|
2421
|
+
return origin.kind === "app" && origin.appId === source.appId;
|
|
2401
2422
|
}
|
|
2402
2423
|
/** Strip the runtime-only fields from a {@link DefinedCapability}. */
|
|
2403
2424
|
toWire(cap) {
|
|
@@ -2466,7 +2487,7 @@ function buildClientCapabilityHandler(args) {
|
|
|
2466
2487
|
});
|
|
2467
2488
|
return {};
|
|
2468
2489
|
}
|
|
2469
|
-
return new Promise((
|
|
2490
|
+
return new Promise((resolve4, reject) => {
|
|
2470
2491
|
const timer = setTimeout(() => {
|
|
2471
2492
|
args.pending.delete(callId);
|
|
2472
2493
|
reject(
|
|
@@ -2475,7 +2496,7 @@ function buildClientCapabilityHandler(args) {
|
|
|
2475
2496
|
)
|
|
2476
2497
|
);
|
|
2477
2498
|
}, timeoutMs);
|
|
2478
|
-
args.pending.set(callId, { resolve:
|
|
2499
|
+
args.pending.set(callId, { resolve: resolve4, reject, timer });
|
|
2479
2500
|
args.emit({
|
|
2480
2501
|
type: "capability_invoked",
|
|
2481
2502
|
callId,
|
|
@@ -2864,6 +2885,34 @@ function planRuntimeSessionEmit(input) {
|
|
|
2864
2885
|
}
|
|
2865
2886
|
return { type: "runtime_session", driverSessionId, model, capabilitySignature };
|
|
2866
2887
|
}
|
|
2888
|
+
var GCP_SA_JSON_KEY = "GOOGLE_APPLICATION_CREDENTIALS_JSON";
|
|
2889
|
+
var GCP_SA_RELATIVE_PATH = join(".skaile", "gcp-sa.json");
|
|
2890
|
+
function resolveCloudSecretBundle(args) {
|
|
2891
|
+
const { cloud, secrets, projectDir } = args;
|
|
2892
|
+
const cloudSecrets = {};
|
|
2893
|
+
const bundleKeys = CLOUD_SECRET_ENV_KEYS[cloud];
|
|
2894
|
+
if (!secrets || !bundleKeys) return { cloudSecrets };
|
|
2895
|
+
for (const key of bundleKeys) {
|
|
2896
|
+
if (key === GCP_SA_JSON_KEY) continue;
|
|
2897
|
+
const value = secrets[key];
|
|
2898
|
+
if (value) cloudSecrets[key] = value;
|
|
2899
|
+
}
|
|
2900
|
+
const saJson = secrets[GCP_SA_JSON_KEY];
|
|
2901
|
+
if (bundleKeys.includes(GCP_SA_JSON_KEY) && saJson) {
|
|
2902
|
+
const saPath = resolve(projectDir, GCP_SA_RELATIVE_PATH);
|
|
2903
|
+
mkdirSync(dirname(saPath), { recursive: true });
|
|
2904
|
+
rmSync(saPath, { force: true });
|
|
2905
|
+
writeFileSync(saPath, saJson, { mode: 384 });
|
|
2906
|
+
cloudSecrets.GOOGLE_APPLICATION_CREDENTIALS = saPath;
|
|
2907
|
+
}
|
|
2908
|
+
return { cloudSecrets };
|
|
2909
|
+
}
|
|
2910
|
+
function cleanupCloudCredentialFiles(projectDir) {
|
|
2911
|
+
try {
|
|
2912
|
+
rmSync(resolve(projectDir, GCP_SA_RELATIVE_PATH), { force: true });
|
|
2913
|
+
} catch {
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2867
2916
|
|
|
2868
2917
|
// runner/src/compaction/prompt.ts
|
|
2869
2918
|
var DEFAULT_COMPACTION_PROMPT = `You are being asked to compact this conversation into a structured summary.
|
|
@@ -3877,9 +3926,9 @@ function createSessionStimulusBus(opts) {
|
|
|
3877
3926
|
connectorId,
|
|
3878
3927
|
fragmentLength: sig.promptFragment.length
|
|
3879
3928
|
});
|
|
3880
|
-
return new Promise((
|
|
3929
|
+
return new Promise((resolve4, reject) => {
|
|
3881
3930
|
const q = getQueue(connectorId);
|
|
3882
|
-
q.pending.push({ signal: sig, resolve:
|
|
3931
|
+
q.pending.push({ signal: sig, resolve: resolve4, reject });
|
|
3883
3932
|
startTimerIfNeeded(connectorId, q, coalesceMs);
|
|
3884
3933
|
});
|
|
3885
3934
|
}
|
|
@@ -4129,7 +4178,7 @@ async function startAgentServer(opts) {
|
|
|
4129
4178
|
const pendingCapabilityCalls = /* @__PURE__ */ new Map();
|
|
4130
4179
|
const remoteCapabilityInvoker = (name, input, timeoutMs) => {
|
|
4131
4180
|
const callId = typeof crypto?.randomUUID === "function" ? crypto.randomUUID() : `rcap-${Date.now()}-${Math.floor(Math.random() * 1e9)}`;
|
|
4132
|
-
return new Promise((
|
|
4181
|
+
return new Promise((resolve4, reject) => {
|
|
4133
4182
|
if (!transport.connected) {
|
|
4134
4183
|
reject(new Error(`Transport disconnected; cannot invoke remote capability ${name}`));
|
|
4135
4184
|
return;
|
|
@@ -4138,7 +4187,7 @@ async function startAgentServer(opts) {
|
|
|
4138
4187
|
pendingCapabilityCalls.delete(callId);
|
|
4139
4188
|
reject(new Error(`Remote capability ${name} (callId=${callId}) timed out`));
|
|
4140
4189
|
}, timeoutMs ?? DEFAULT_CAPABILITY_CALL_TIMEOUT_MS);
|
|
4141
|
-
pendingCapabilityCalls.set(callId, { resolve:
|
|
4190
|
+
pendingCapabilityCalls.set(callId, { resolve: resolve4, reject, timer });
|
|
4142
4191
|
transport.send({
|
|
4143
4192
|
type: "capability_invoked",
|
|
4144
4193
|
callId,
|
|
@@ -4149,8 +4198,8 @@ async function startAgentServer(opts) {
|
|
|
4149
4198
|
});
|
|
4150
4199
|
};
|
|
4151
4200
|
let aiProviderConfigId;
|
|
4152
|
-
const sleep = (ms) => new Promise((
|
|
4153
|
-
const t = setTimeout(
|
|
4201
|
+
const sleep = (ms) => new Promise((resolve4) => {
|
|
4202
|
+
const t = setTimeout(resolve4, ms);
|
|
4154
4203
|
t.unref?.();
|
|
4155
4204
|
});
|
|
4156
4205
|
async function mintAndPersistAiCredential(args) {
|
|
@@ -4257,7 +4306,15 @@ async function startAgentServer(opts) {
|
|
|
4257
4306
|
}
|
|
4258
4307
|
const secretsMode = wsConfig.secrets?.provider ?? "env";
|
|
4259
4308
|
wsConfig.secrets?.timeoutMs ?? 3e4;
|
|
4260
|
-
|
|
4309
|
+
const rawCloud = profile?.cloud ?? "default";
|
|
4310
|
+
const effectiveCloud = SUPPORTED_CLOUDS.includes(rawCloud) ? rawCloud : "default";
|
|
4311
|
+
if (effectiveCloud !== rawCloud) {
|
|
4312
|
+
log(
|
|
4313
|
+
`[serve] WARNING: unknown cloud "${rawCloud}" in agent-config \u2014 falling back to the default transport`
|
|
4314
|
+
);
|
|
4315
|
+
}
|
|
4316
|
+
const effectiveCloudConfig = cloudConfigFromProfile(profile);
|
|
4317
|
+
function buildSessionConfig(secretProvider2, apiKey, cloudSecrets) {
|
|
4261
4318
|
return {
|
|
4262
4319
|
projectDir: opts.projectDir,
|
|
4263
4320
|
agentDir,
|
|
@@ -4273,6 +4330,13 @@ async function startAgentServer(opts) {
|
|
|
4273
4330
|
secretProvider: secretProvider2,
|
|
4274
4331
|
onAuthError,
|
|
4275
4332
|
...apiKey ? { apiKey } : {},
|
|
4333
|
+
// Non-default cloud transport from skaile.yaml agent-config.default,
|
|
4334
|
+
// plus the platform-resolved credential bundle (Vertex SA JSON already
|
|
4335
|
+
// materialized to a file path by resolveCloudSecretBundle). Omitted
|
|
4336
|
+
// entirely for `default` so the session config stays byte-identical.
|
|
4337
|
+
...effectiveCloud !== "default" ? { cloud: effectiveCloud } : {},
|
|
4338
|
+
...effectiveCloudConfig ? { cloudConfig: effectiveCloudConfig } : {},
|
|
4339
|
+
...cloudSecrets ? { cloudSecrets } : {},
|
|
4276
4340
|
// Protocol v2 `<CAPABILITIES>` block — joins each registered capability's
|
|
4277
4341
|
// `promptFragment` (framework first, then client, then agent-side
|
|
4278
4342
|
// surfaces). Built lazily inside `buildSessionConfig` so newly registered
|
|
@@ -4338,8 +4402,8 @@ async function startAgentServer(opts) {
|
|
|
4338
4402
|
}
|
|
4339
4403
|
let resolveSessionReady;
|
|
4340
4404
|
let rejectSessionReady;
|
|
4341
|
-
const sessionReady = new Promise((
|
|
4342
|
-
resolveSessionReady =
|
|
4405
|
+
const sessionReady = new Promise((resolve4, reject) => {
|
|
4406
|
+
resolveSessionReady = resolve4;
|
|
4343
4407
|
rejectSessionReady = reject;
|
|
4344
4408
|
});
|
|
4345
4409
|
let sessionConfig;
|
|
@@ -4506,7 +4570,9 @@ async function startAgentServer(opts) {
|
|
|
4506
4570
|
driver.removeAllListeners("error");
|
|
4507
4571
|
driver.kill();
|
|
4508
4572
|
} catch (err) {
|
|
4509
|
-
log(
|
|
4573
|
+
log(
|
|
4574
|
+
`[serve] failed to retire previous driver: ${err instanceof Error ? err.message : String(err)}`
|
|
4575
|
+
);
|
|
4510
4576
|
}
|
|
4511
4577
|
}
|
|
4512
4578
|
driver = incoming;
|
|
@@ -4604,7 +4670,7 @@ async function startAgentServer(opts) {
|
|
|
4604
4670
|
return stimulusBus;
|
|
4605
4671
|
}
|
|
4606
4672
|
function awaitFlowAgentEnd(prompt, timeoutMs) {
|
|
4607
|
-
return new Promise((
|
|
4673
|
+
return new Promise((resolve4, reject) => {
|
|
4608
4674
|
let settled = false;
|
|
4609
4675
|
const onEvent = (event) => {
|
|
4610
4676
|
if (event.type === "agent_end") done();
|
|
@@ -4622,7 +4688,7 @@ async function startAgentServer(opts) {
|
|
|
4622
4688
|
onEvent
|
|
4623
4689
|
) ?? driver.removeListener("agent-event", onEvent);
|
|
4624
4690
|
if (err) reject(err);
|
|
4625
|
-
else
|
|
4691
|
+
else resolve4();
|
|
4626
4692
|
};
|
|
4627
4693
|
const timer = setTimeout(
|
|
4628
4694
|
() => done(new Error(`Flow turn timed out after ${timeoutMs / 1e3}s`)),
|
|
@@ -4751,8 +4817,8 @@ async function startAgentServer(opts) {
|
|
|
4751
4817
|
try {
|
|
4752
4818
|
await Promise.race([
|
|
4753
4819
|
sessionReady,
|
|
4754
|
-
new Promise((
|
|
4755
|
-
const t = setTimeout(
|
|
4820
|
+
new Promise((resolve4) => {
|
|
4821
|
+
const t = setTimeout(resolve4, 2e3);
|
|
4756
4822
|
t.unref?.();
|
|
4757
4823
|
})
|
|
4758
4824
|
]);
|
|
@@ -4784,6 +4850,10 @@ async function startAgentServer(opts) {
|
|
|
4784
4850
|
} catch {
|
|
4785
4851
|
}
|
|
4786
4852
|
}
|
|
4853
|
+
try {
|
|
4854
|
+
cleanupCloudCredentialFiles(opts.projectDir);
|
|
4855
|
+
} catch {
|
|
4856
|
+
}
|
|
4787
4857
|
}
|
|
4788
4858
|
async function awaitSessionReadyOrFail() {
|
|
4789
4859
|
try {
|
|
@@ -4842,10 +4912,20 @@ async function startAgentServer(opts) {
|
|
|
4842
4912
|
return initialAiCredentialExpiresAt;
|
|
4843
4913
|
}
|
|
4844
4914
|
async function buildSessionFromInit(secrets) {
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4915
|
+
let apiKeyFromSecrets;
|
|
4916
|
+
let cloudSecrets;
|
|
4917
|
+
if (effectiveCloud === "default") {
|
|
4918
|
+
const effectiveProvider = opts.provider ?? "anthropic";
|
|
4919
|
+
const envKey = providerEnvKey(effectiveProvider);
|
|
4920
|
+
apiKeyFromSecrets = secrets?.[envKey];
|
|
4921
|
+
} else {
|
|
4922
|
+
({ cloudSecrets } = resolveCloudSecretBundle({
|
|
4923
|
+
cloud: effectiveCloud,
|
|
4924
|
+
secrets,
|
|
4925
|
+
projectDir: opts.projectDir
|
|
4926
|
+
}));
|
|
4927
|
+
}
|
|
4928
|
+
sessionConfig = buildSessionConfig(secretProvider, apiKeyFromSecrets, cloudSecrets);
|
|
4849
4929
|
if (!agentSession) {
|
|
4850
4930
|
agentSession = await createAgentSession(sessionConfig);
|
|
4851
4931
|
emitSystemPromptComposed(agentSession, sendEvent);
|
|
@@ -5827,5 +5907,5 @@ function touchSession(state) {
|
|
|
5827
5907
|
}
|
|
5828
5908
|
|
|
5829
5909
|
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-
|
|
5910
|
+
//# sourceMappingURL=chunk-AAGD2J4H.js.map
|
|
5911
|
+
//# sourceMappingURL=chunk-AAGD2J4H.js.map
|