@skaile/workspaces 0.27.0 → 0.29.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 +44 -0
- package/dist/{asset-feeds-DGZO27M7.js → asset-feeds-2V7LZIG7.js} +4 -4
- package/dist/{asset-feeds-DGZO27M7.js.map → asset-feeds-2V7LZIG7.js.map} +1 -1
- package/dist/asset-manager/index.js +1 -1
- package/dist/{chunk-BUL5H6J7.js → chunk-3OKP6F2J.js} +3 -3
- package/dist/{chunk-BUL5H6J7.js.map → chunk-3OKP6F2J.js.map} +1 -1
- package/dist/{chunk-3ZER5DST.js → chunk-BZ2JU7IP.js} +3 -3
- package/dist/{chunk-3ZER5DST.js.map → chunk-BZ2JU7IP.js.map} +1 -1
- package/dist/{chunk-A4ASAIKK.js → chunk-CBNMIKUO.js} +2 -2
- package/dist/{chunk-A4ASAIKK.js.map → chunk-CBNMIKUO.js.map} +1 -1
- package/dist/{chunk-DGM74UP4.js → chunk-CMG3GJ6B.js} +35 -3
- package/dist/chunk-CMG3GJ6B.js.map +1 -0
- package/dist/{chunk-XHBPQ7QP.js → chunk-FENG6OO6.js} +46 -20
- package/dist/chunk-FENG6OO6.js.map +1 -0
- package/dist/{chunk-WRRYESHC.js → chunk-MIH45XPY.js} +99 -65
- package/dist/chunk-MIH45XPY.js.map +1 -0
- package/dist/{chunk-MZDXEFXF.js → chunk-TDZGENVP.js} +130 -17
- package/dist/chunk-TDZGENVP.js.map +1 -0
- package/dist/{chunk-UAW7VRAL.js → chunk-XFQ2OXYR.js} +2 -2
- package/dist/{chunk-UAW7VRAL.js.map → chunk-XFQ2OXYR.js.map} +1 -1
- package/dist/cli/index.js +21 -27
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +2 -2
- package/dist/connectors/src/config.d.ts +46 -1
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +1 -1
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/{ensure-sources-KQQEUDKM.js → ensure-sources-BNSRO5G7.js} +3 -3
- package/dist/{ensure-sources-KQQEUDKM.js.map → ensure-sources-BNSRO5G7.js.map} +1 -1
- package/dist/factory-assets/connectors/deploy.js +2 -2
- package/dist/factory-assets/connectors/devserver.js +2 -2
- package/dist/factory-assets/connectors/flow/adapter.js +2 -2
- package/dist/factory-assets/connectors/flow/run-flow.js +3 -3
- package/dist/factory-assets/connectors/flow.js +2 -2
- package/dist/factory-assets/connectors/git.js +2 -2
- package/dist/factory-assets/connectors/gmail.js +2 -2
- package/dist/factory-assets/connectors/googledrive/driver.d.ts +0 -12
- package/dist/factory-assets/connectors/googledrive/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/googledrive.js +2 -2
- package/dist/factory-assets/connectors/local.js +2 -2
- package/dist/factory-assets/connectors/mattermost.js +2 -2
- package/dist/factory-assets/connectors/memory.js +2 -2
- package/dist/factory-assets/connectors/minio.js +2 -2
- package/dist/factory-assets/connectors/postgres.js +2 -2
- package/dist/factory-assets/connectors/s3.js +2 -2
- package/dist/factory-assets/connectors/sharepoint/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/sharepoint.js +2 -2
- package/dist/factory-assets/connectors/sqlite.js +2 -2
- package/dist/factory-assets/connectors/static-server.js +2 -2
- package/dist/factory-assets/connectors/tunnel.js +2 -2
- package/dist/factory-assets/connectors/webdav/driver.d.ts +2 -0
- package/dist/factory-assets/connectors/webdav/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/webdav.js +2 -2
- package/dist/factory-assets/connectors/xstate-store.js +2 -2
- package/dist/factory-assets/connectors/xstate.js +2 -2
- package/dist/library/index.js +1 -1
- package/dist/library/src/index.d.ts +2 -2
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/library.d.ts +20 -20
- package/dist/library/src/library.d.ts.map +1 -1
- package/dist/library/src/local/db.d.ts.map +1 -1
- package/dist/library/src/local/library.d.ts +6 -6
- package/dist/library/src/local/library.d.ts.map +1 -1
- package/dist/library/src/local/local-catalog-source.d.ts +1 -1
- package/dist/library/src/local/schema.d.ts +9 -9
- package/dist/library/src/local/schema.d.ts.map +1 -1
- package/dist/library/src/preset/apply.d.ts +9 -9
- package/dist/library/src/preset/apply.d.ts.map +1 -1
- package/dist/library/src/preset/resolve-item.d.ts +1 -1
- package/dist/library/src/workspace-config.d.ts +11 -8
- package/dist/library/src/workspace-config.d.ts.map +1 -1
- package/dist/{open-library-I7YTADMD.js → open-library-3VJY74LQ.js} +4 -4
- package/dist/{open-library-I7YTADMD.js.map → open-library-3VJY74LQ.js.map} +1 -1
- package/dist/runner/index.js +4 -4
- package/dist/runner/src/capability-roundtrip.d.ts +23 -0
- package/dist/runner/src/capability-roundtrip.d.ts.map +1 -1
- package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-resource-handlers.d.ts +23 -0
- package/dist/runner/src/session-resource-handlers.d.ts.map +1 -0
- package/dist/sdk/asset-manager.js +1 -1
- package/dist/sdk/index.js +4 -4
- package/dist/sdk/runner.js +4 -4
- package/dist/tui/index.js +4 -4
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DGM74UP4.js.map +0 -1
- package/dist/chunk-MZDXEFXF.js.map +0 -1
- package/dist/chunk-WRRYESHC.js.map +0 -1
- package/dist/chunk-XHBPQ7QP.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WorkspacePlugin } from './chunk-
|
|
1
|
+
import { WorkspacePlugin } from './chunk-XFQ2OXYR.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-TDSRLMDB.js';
|
|
@@ -6,8 +6,8 @@ import { EventNormalizer } from './chunk-AKSR434V.js';
|
|
|
6
6
|
import { classifyClaudeSdkError } from './chunk-PAYAFNXG.js';
|
|
7
7
|
import { createDriver } from './chunk-ZEKWHJBB.js';
|
|
8
8
|
import { deployCatalogEntry, undeployCatalogEntry } from './chunk-LV2HPH3C.js';
|
|
9
|
-
import { registerBuiltinConnectors, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildConnectorPromptSection, buildSdkConnectorTools } from './chunk-
|
|
10
|
-
import { loadConnectorDeclarations, PreMintedSecretProvider, InMemorySecretProvider } from './chunk-
|
|
9
|
+
import { registerBuiltinConnectors, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildConnectorPromptSection, buildSdkConnectorTools } from './chunk-FENG6OO6.js';
|
|
10
|
+
import { loadConnectorDeclarations, PreMintedSecretProvider, InMemorySecretProvider } from './chunk-CMG3GJ6B.js';
|
|
11
11
|
import { renderStimulusPrompt, buildOrchestratorPrompt } from './chunk-DEYYRFQU.js';
|
|
12
12
|
import { resolveSettings, resolveApiKey, providerEnvKey } from './chunk-M4KLIEIJ.js';
|
|
13
13
|
import { resolveRuntimeAssets } from './chunk-FWHOU3CX.js';
|
|
@@ -503,7 +503,15 @@ async function resolveInlineLive(item, binding, loadContent, result) {
|
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
async function resolveDiscoverable(item, library, loadContent, result) {
|
|
506
|
-
|
|
506
|
+
let assetDef = null;
|
|
507
|
+
try {
|
|
508
|
+
assetDef = await library.getAssetDef(item.ref);
|
|
509
|
+
} catch (err) {
|
|
510
|
+
assetDef = null;
|
|
511
|
+
result.warnings.push(
|
|
512
|
+
`"${item.ref}" (${item.kind}): library lookup failed (${err instanceof Error ? err.message : String(err)}) \u2014 using fallback description`
|
|
513
|
+
);
|
|
514
|
+
}
|
|
507
515
|
const name = buildToolName(item);
|
|
508
516
|
const description = assetDef?.description ?? `${item.kind}: ${item.ref}`;
|
|
509
517
|
const content = await loadContent(item.ref, item.kind);
|
|
@@ -594,10 +602,10 @@ var STUB_LIBRARY = {
|
|
|
594
602
|
updateInstance: async () => ({}),
|
|
595
603
|
deleteInstance: async () => {
|
|
596
604
|
},
|
|
597
|
-
|
|
598
|
-
|
|
605
|
+
assign: async () => ({}),
|
|
606
|
+
unassign: async () => {
|
|
599
607
|
},
|
|
600
|
-
|
|
608
|
+
listAssignments: async () => [],
|
|
601
609
|
getConsumptionGraph: async () => []
|
|
602
610
|
};
|
|
603
611
|
async function openLocalIndexIfAvailable(log) {
|
|
@@ -2190,6 +2198,15 @@ function buildClientCapabilityHandler(args) {
|
|
|
2190
2198
|
});
|
|
2191
2199
|
};
|
|
2192
2200
|
}
|
|
2201
|
+
async function dispatchRunnerCapabilityInvocation(cmd, deps) {
|
|
2202
|
+
try {
|
|
2203
|
+
const result = await deps.invoke(cmd.name, cmd.input);
|
|
2204
|
+
deps.emit({ type: "capability_result", callId: cmd.callId, result });
|
|
2205
|
+
} catch (err) {
|
|
2206
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2207
|
+
deps.emit({ type: "capability_result", callId: cmd.callId, result: { error: message } });
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2193
2210
|
function resolveCapabilityResult(pending, cmd) {
|
|
2194
2211
|
const entry = pending.get(cmd.callId);
|
|
2195
2212
|
if (!entry) return false;
|
|
@@ -2605,7 +2622,11 @@ var preMintedTokenSchema = z5.object({
|
|
|
2605
2622
|
}).optional();
|
|
2606
2623
|
var mountDeclarationInput = z5.strictObject({
|
|
2607
2624
|
declaration: requiredUnknown,
|
|
2608
|
-
preMintedToken: preMintedTokenSchema
|
|
2625
|
+
preMintedToken: preMintedTokenSchema,
|
|
2626
|
+
// The platform attaches a workspace-migration directive on add_mount; the
|
|
2627
|
+
// handler ignores it for now (replace-workspace hot-migration is a follow-up).
|
|
2628
|
+
// Accepted here so a real platform add_mount payload validates.
|
|
2629
|
+
migration: z5.unknown().optional()
|
|
2609
2630
|
});
|
|
2610
2631
|
var connectorDeclarationInput = z5.strictObject({
|
|
2611
2632
|
declaration: requiredUnknown,
|
|
@@ -2761,6 +2782,76 @@ function buildRunnerCapabilities(handlers) {
|
|
|
2761
2782
|
})
|
|
2762
2783
|
];
|
|
2763
2784
|
}
|
|
2785
|
+
|
|
2786
|
+
// runner/src/session-resource-handlers.ts
|
|
2787
|
+
function asDeclaration(declaration) {
|
|
2788
|
+
if (declaration !== null && typeof declaration === "object" && typeof declaration.id === "string" && typeof declaration.driver === "string") {
|
|
2789
|
+
return declaration;
|
|
2790
|
+
}
|
|
2791
|
+
return null;
|
|
2792
|
+
}
|
|
2793
|
+
function toPreMinted(token) {
|
|
2794
|
+
return { ok: true, token: token.token, expiresAt: token.expiresAt ?? null };
|
|
2795
|
+
}
|
|
2796
|
+
function buildSessionResourceHandlers(deps) {
|
|
2797
|
+
const { getResourceManager, getPreMintedSecrets, emitResourcesAvailable, log } = deps;
|
|
2798
|
+
async function add(kind, input) {
|
|
2799
|
+
const rm = getResourceManager();
|
|
2800
|
+
if (!rm) return { ok: false, code: "no_session", message: "session resources not ready" };
|
|
2801
|
+
const decl = asDeclaration(input.declaration);
|
|
2802
|
+
if (!decl) {
|
|
2803
|
+
return { ok: false, code: "invalid_declaration", message: "declaration missing id/driver" };
|
|
2804
|
+
}
|
|
2805
|
+
if (input.preMintedToken) {
|
|
2806
|
+
getPreMintedSecrets()?.set(kind, decl.id, toPreMinted(input.preMintedToken));
|
|
2807
|
+
}
|
|
2808
|
+
try {
|
|
2809
|
+
await rm.connect(decl);
|
|
2810
|
+
} catch (err) {
|
|
2811
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2812
|
+
log(`[session-resource] runner.add_${kind} failed for ${decl.id}: ${message}`);
|
|
2813
|
+
return { ok: false, code: "connect_failed", message };
|
|
2814
|
+
}
|
|
2815
|
+
emitResourcesAvailable();
|
|
2816
|
+
log(`[session-resource] runner.add_${kind} connected ${decl.id}`);
|
|
2817
|
+
return { ok: true, id: decl.id };
|
|
2818
|
+
}
|
|
2819
|
+
return {
|
|
2820
|
+
addConnector: (input) => add("connector", input),
|
|
2821
|
+
addMount: (input) => add("mount", input),
|
|
2822
|
+
removeResource: async (input) => {
|
|
2823
|
+
const rm = getResourceManager();
|
|
2824
|
+
if (!rm) return { ok: false, code: "no_session", message: "session resources not ready" };
|
|
2825
|
+
if (!rm.has(input.id)) {
|
|
2826
|
+
return { ok: false, code: "not_found", message: `no resource with id ${input.id}` };
|
|
2827
|
+
}
|
|
2828
|
+
try {
|
|
2829
|
+
await rm.disconnect(input.id);
|
|
2830
|
+
} catch (err) {
|
|
2831
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2832
|
+
log(`[session-resource] runner.remove_resource failed for ${input.id}: ${message}`);
|
|
2833
|
+
return { ok: false, code: "disconnect_failed", message };
|
|
2834
|
+
}
|
|
2835
|
+
const ps = getPreMintedSecrets();
|
|
2836
|
+
ps?.unset("connector", input.id);
|
|
2837
|
+
ps?.unset("mount", input.id);
|
|
2838
|
+
emitResourcesAvailable();
|
|
2839
|
+
log(`[session-resource] runner.remove_resource removed ${input.id}`);
|
|
2840
|
+
return { ok: true };
|
|
2841
|
+
},
|
|
2842
|
+
updateCredential: async (input) => {
|
|
2843
|
+
const ps = getPreMintedSecrets();
|
|
2844
|
+
if (!ps) return { ok: false, code: "no_session", message: "session resources not ready" };
|
|
2845
|
+
const rm = getResourceManager();
|
|
2846
|
+
if (rm && !rm.has(input.id)) {
|
|
2847
|
+
return { ok: false, code: "not_found", message: `no resource with id ${input.id}` };
|
|
2848
|
+
}
|
|
2849
|
+
ps.set(input.kind, input.id, input.mint);
|
|
2850
|
+
log(`[session-resource] runner.update_credential staged ${input.kind}:${input.id}`);
|
|
2851
|
+
return { ok: true };
|
|
2852
|
+
}
|
|
2853
|
+
};
|
|
2854
|
+
}
|
|
2764
2855
|
var CLAUDE_CODE_CREDENTIALS_KEY = "CLAUDE_CODE_CREDENTIALS_JSON";
|
|
2765
2856
|
async function writeClaudeCodeCredentialsFile(home, json) {
|
|
2766
2857
|
const claudeDir = join(home, ".claude");
|
|
@@ -3616,6 +3707,17 @@ async function startAgentServer(opts) {
|
|
|
3616
3707
|
}
|
|
3617
3708
|
}
|
|
3618
3709
|
async function handleCommand(cmd) {
|
|
3710
|
+
const inbound = cmd;
|
|
3711
|
+
if (inbound.type === "capability_invoked") {
|
|
3712
|
+
await dispatchRunnerCapabilityInvocation(
|
|
3713
|
+
{ callId: inbound.callId ?? "", name: inbound.name ?? "", input: inbound.input },
|
|
3714
|
+
{
|
|
3715
|
+
invoke: (name, input) => capabilityRegistry.invoke(name, input, { sessionId }),
|
|
3716
|
+
emit: (event) => sendEvent(event)
|
|
3717
|
+
}
|
|
3718
|
+
);
|
|
3719
|
+
return;
|
|
3720
|
+
}
|
|
3619
3721
|
switch (cmd.type) {
|
|
3620
3722
|
case "session_init": {
|
|
3621
3723
|
if (cmd.protocolVersion.major !== PROTOCOL_VERSION.major) {
|
|
@@ -3705,12 +3807,23 @@ async function startAgentServer(opts) {
|
|
|
3705
3807
|
agentSession.startWatching();
|
|
3706
3808
|
capabilityRegistry.setRemoteInvoker(remoteCapabilityInvoker);
|
|
3707
3809
|
const runnerCaps = buildRunnerCapabilities({
|
|
3708
|
-
//
|
|
3709
|
-
//
|
|
3710
|
-
//
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3810
|
+
// Resource hot-plug handlers, wired to the live session's
|
|
3811
|
+
// ConnectorManager + PreMintedSecretProvider via getters because
|
|
3812
|
+
// both are lazily (re)assigned in this scope.
|
|
3813
|
+
...buildSessionResourceHandlers({
|
|
3814
|
+
getResourceManager: () => resourceManager,
|
|
3815
|
+
getPreMintedSecrets: () => preMintedSecrets,
|
|
3816
|
+
emitResourcesAvailable: () => {
|
|
3817
|
+
sendEvent({
|
|
3818
|
+
type: "resources_available",
|
|
3819
|
+
...splitConnectorsForWire(resourceManager)
|
|
3820
|
+
});
|
|
3821
|
+
},
|
|
3822
|
+
log
|
|
3823
|
+
})
|
|
3824
|
+
// setLogLevel left undefined — the cap's built-in fallback calls
|
|
3825
|
+
// getLogStore()?.setLevel(...) directly. setState / lifecycle
|
|
3826
|
+
// remain stubs (not resource hot-plug; out of Sprint 2 scope).
|
|
3714
3827
|
});
|
|
3715
3828
|
for (const cap of runnerCaps) {
|
|
3716
3829
|
capabilityRegistry.register(cap, "agent");
|
|
@@ -4519,6 +4632,6 @@ function touchSession(state) {
|
|
|
4519
4632
|
return { ...state, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
4520
4633
|
}
|
|
4521
4634
|
|
|
4522
|
-
export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile };
|
|
4523
|
-
//# sourceMappingURL=chunk-
|
|
4524
|
-
//# sourceMappingURL=chunk-
|
|
4635
|
+
export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile };
|
|
4636
|
+
//# sourceMappingURL=chunk-TDZGENVP.js.map
|
|
4637
|
+
//# sourceMappingURL=chunk-TDZGENVP.js.map
|