@yanlinglabs/winter-agent-runtime 0.0.32 → 0.0.34
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/dist/embedded-worker.js +6 -6
- package/dist/embedded.js +6 -6
- package/dist/hooks/runner.d.ts +12 -1
- package/dist/{index-y8vfq85w.js → index-1bcfabm4.js} +2 -2
- package/dist/{index-9s68t0pd.js → index-1hef2gff.js} +43 -8
- package/dist/{index-bgeqc7ax.js → index-2wgfv0pa.js} +1 -1
- package/dist/{index-yg5ve6sg.js → index-dske1c00.js} +2 -2
- package/dist/{index-z6s3r4xm.js → index-mwew595z.js} +32 -1
- package/dist/{index-qdang0ag.js → index-rprst8z5.js} +14712 -14596
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -4
- package/dist/mcp/client.d.ts +5 -0
- package/dist/mcp/elicitation.d.ts +11 -2
- package/dist/mcp-auth.js +2 -2
- package/dist/mcp-client.js +2 -2
- package/dist/permissions/evaluator.d.ts +7 -1
- package/dist/provider/keychain-store.d.ts +2 -2
- package/dist/store/dialect.d.ts +1 -1
- package/dist/testing.js +5 -5
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workflows/runtime.d.ts +21 -0
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export { recordedProviderSystems, resetRecordedProviderSystems } from "./provide
|
|
|
6
6
|
export { SCENARIO_FINAL_TEXT, SCENARIO_FIRST_TEXT, SCENARIO_CHILD_AGENT, SCENARIO_CHILD_MODEL, SCENARIO_CHILD_WIRE_ID, SCENARIO_DELEGATE_MARKER, SCENARIO_MODELS, SCENARIO_TOOL_CALLING_NONE, SCENARIO_TOOL_INPUT, SCENARIO_TOOL_NAME, startScenarioFake, } from "./provider/scenario-fake.js";
|
|
7
7
|
export type { ScenarioFake, ScenarioFakeOptions, ScenarioRequest } from "./provider/scenario-fake.js";
|
|
8
8
|
export { onCompaction } from "./tools/registry.js";
|
|
9
|
+
export { buildWorkflowWorkerSeatbeltProfile } from "./sandbox/profile.js";
|
|
10
|
+
export type { SandboxBrand } from "./sandbox/profile.js";
|
|
11
|
+
export { WORKFLOW_SANDBOX_REFUSED_EXIT_CODE } from "./workflows/runtime.js";
|
|
9
12
|
export { createInMemoryChannel } from "./protocol/channel.js";
|
|
10
13
|
export type { Duplex, FrameSource, FrameSink } from "./protocol/channel.js";
|
|
11
14
|
export { createRpcBridge } from "./rpc/bridge.js";
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
sessionTempDir2,
|
|
7
7
|
ensureTasksDir2,
|
|
8
8
|
resolveProjectDirName2,
|
|
9
|
+
buildWorkflowWorkerSeatbeltProfile2,
|
|
10
|
+
WORKFLOW_SANDBOX_REFUSED_EXIT_CODE2,
|
|
9
11
|
DEFAULT_CONTEXT_WINDOW_TOKENS2,
|
|
10
12
|
createContextAccountant2,
|
|
11
13
|
runEngine2,
|
|
@@ -53,10 +55,10 @@ import {
|
|
|
53
55
|
DEFAULT_CLASSIFIER_TIMEOUT_MS2,
|
|
54
56
|
createModelClassifier2,
|
|
55
57
|
selectClassifierRoute2
|
|
56
|
-
} from "./index-
|
|
57
|
-
import"./index-
|
|
58
|
-
import"./index-
|
|
59
|
-
import"./index-
|
|
58
|
+
} from "./index-rprst8z5.js";
|
|
59
|
+
import"./index-1hef2gff.js";
|
|
60
|
+
import"./index-mwew595z.js";
|
|
61
|
+
import"./index-2wgfv0pa.js";
|
|
60
62
|
import"./index-bef62z3r.js";
|
|
61
63
|
import {
|
|
62
64
|
createInMemoryChannel2
|
|
@@ -306,11 +308,13 @@ export {
|
|
|
306
308
|
SUBAGENT_CHILD_PROBE_TEXT2 as SUBAGENT_CHILD_PROBE_TEXT,
|
|
307
309
|
TranscriptWriter2 as TranscriptWriter,
|
|
308
310
|
TranscriptWriterError2 as TranscriptWriterError,
|
|
311
|
+
WORKFLOW_SANDBOX_REFUSED_EXIT_CODE2 as WORKFLOW_SANDBOX_REFUSED_EXIT_CODE,
|
|
309
312
|
WinterCompatibilitySessionStore,
|
|
310
313
|
WinterPathsError2 as WinterPathsError,
|
|
311
314
|
WinterStoreError,
|
|
312
315
|
WinterStoreLeaseError,
|
|
313
316
|
assistantEntry2 as assistantEntry,
|
|
317
|
+
buildWorkflowWorkerSeatbeltProfile2 as buildWorkflowWorkerSeatbeltProfile,
|
|
314
318
|
claudeCompactBoundaryEntry2 as claudeCompactBoundaryEntry,
|
|
315
319
|
claudeCompactSummaryEntry2 as claudeCompactSummaryEntry,
|
|
316
320
|
compatibilityKeys,
|
package/dist/mcp/client.d.ts
CHANGED
|
@@ -80,8 +80,13 @@ export interface ConnectedMcpClient {
|
|
|
80
80
|
readResource(uri: string, opts?: {
|
|
81
81
|
timeoutMs?: number;
|
|
82
82
|
}): Promise<McpResourceContent[]>;
|
|
83
|
+
/**
|
|
84
|
+
* WS-27: `opts.signal` is the calling tool execution's abort (a turn interrupt). It cancels the MCP
|
|
85
|
+
* request (`notifications/cancelled`) and any elicitation the call raised (see `callScope` below).
|
|
86
|
+
*/
|
|
83
87
|
callTool(toolName: string, args: Record<string, unknown>, opts?: {
|
|
84
88
|
timeoutMs?: number;
|
|
89
|
+
signal?: AbortSignal;
|
|
85
90
|
}): Promise<McpToolCallResult>;
|
|
86
91
|
close(): Promise<void>;
|
|
87
92
|
}
|
|
@@ -19,9 +19,18 @@ export declare const MCP_ELICITATION_SUBTYPE = "mcp_elicitation";
|
|
|
19
19
|
export interface ElicitationSender {
|
|
20
20
|
request<T = unknown>(subtype: string, payload: unknown, opts?: {
|
|
21
21
|
timeoutMs?: number;
|
|
22
|
+
signal?: AbortSignal;
|
|
22
23
|
}): Promise<T>;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* WS-27: `opts.signal` aborts when the elicitation stops mattering -- the MCP server cancelled its request,
|
|
27
|
+
* or the tool call that raised it ended. The asker then stops waiting at once: the bridge sends the host a
|
|
28
|
+
* `control_cancel_request` (which aborts `Options.onElicitation`'s own `options.signal`), a host answer that
|
|
29
|
+
* arrives afterwards is dropped as an unknown request id, and the server is answered `cancel`.
|
|
30
|
+
*/
|
|
31
|
+
export type ElicitationAsker = (payload: ElicitationRequestPayload, opts?: {
|
|
32
|
+
signal?: AbortSignal;
|
|
33
|
+
}) => Promise<ElicitationResultPayload>;
|
|
25
34
|
export declare function createElicitationAsker(sender: ElicitationSender | undefined): ElicitationAsker;
|
|
26
35
|
interface RawElicitParams {
|
|
27
36
|
message: string;
|
|
@@ -31,5 +40,5 @@ interface RawElicitParams {
|
|
|
31
40
|
requestedSchema?: Record<string, unknown> | undefined;
|
|
32
41
|
}
|
|
33
42
|
export declare function buildElicitationPayload(serverName: string, params: RawElicitParams): ElicitationRequestPayload;
|
|
34
|
-
export declare function installElicitationHandler(client: Client, serverName: string, ask: ElicitationAsker): void;
|
|
43
|
+
export declare function installElicitationHandler(client: Client, serverName: string, ask: ElicitationAsker, callScope?: () => AbortSignal | undefined): void;
|
|
35
44
|
export {};
|
package/dist/mcp-auth.js
CHANGED
|
@@ -38,10 +38,10 @@ import {
|
|
|
38
38
|
MCP_OAUTH_HOST_HELD_REFRESH_TOKEN2,
|
|
39
39
|
toSessionMcpTokenRecord2,
|
|
40
40
|
refreshMcpOAuthToken2
|
|
41
|
-
} from "./index-
|
|
41
|
+
} from "./index-mwew595z.js";
|
|
42
42
|
import {
|
|
43
43
|
validateMcpOAuthConfig2
|
|
44
|
-
} from "./index-
|
|
44
|
+
} from "./index-2wgfv0pa.js";
|
|
45
45
|
// src/mcp-auth/login.ts
|
|
46
46
|
import { auth, computeScopeUnion, exchangeAuthorization, OAuthError, OAuthErrorCode } from "@modelcontextprotocol/client";
|
|
47
47
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
package/dist/mcp-client.js
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
McpConnectError2,
|
|
6
6
|
resolveVersionNegotiation2,
|
|
7
7
|
connectMcpServer2
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
} from "./index-1hef2gff.js";
|
|
9
|
+
import"./index-mwew595z.js";
|
|
10
10
|
|
|
11
11
|
// src/mcp-client.ts
|
|
12
12
|
import { WINTER_BRAND } from "@yanlinglabs/winter-agent-sdk";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PermissionBehavior, PermissionUpdate, RuleSource, PermissionDecisionClassification } from "@yanlinglabs/winter-agent-sdk";
|
|
1
|
+
import type { McpServerIdentity, PermissionBehavior, PermissionUpdate, RuleSource, PermissionDecisionClassification } from "@yanlinglabs/winter-agent-sdk";
|
|
2
2
|
import type { SourcedRuleEntry, SourcedRuleSet } from "./ruleset.js";
|
|
3
3
|
import type { PolicyState, AutoModeConfig } from "./policy-state.js";
|
|
4
4
|
import { type ProtectedBrand } from "./protected.js";
|
|
@@ -9,6 +9,12 @@ export interface PermissionCall {
|
|
|
9
9
|
input: Record<string, unknown>;
|
|
10
10
|
toolUseId?: string;
|
|
11
11
|
agentId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* WS-27: the MCP server the CALLED tool belongs to (hooks/runner.ts's `mcpServerIdentity`, computed
|
|
14
|
+
* by the engine from the name the model called -- `toolName` may be a renamed server's declared
|
|
15
|
+
* spelling). Carried to the PreToolUse hook's `winter_mcp_server` and `canUseTool`'s `mcpServer`.
|
|
16
|
+
*/
|
|
17
|
+
mcpServer?: McpServerIdentity;
|
|
12
18
|
}
|
|
13
19
|
export declare const ASK_USER_QUESTION_TOOL_NAME = "AskUserQuestion";
|
|
14
20
|
export interface HookDecision {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CredentialMaterial, CredentialStore } from "@yanlinglabs/winter-provider-runtime";
|
|
2
|
-
import { DEFAULT_KEYCHAIN_SERVICE, type CredentialRef } from "@yanlinglabs/winter-agent-sdk";
|
|
3
|
-
export { DEFAULT_KEYCHAIN_SERVICE };
|
|
2
|
+
import { DEFAULT_KEYCHAIN_SERVICE, TEST_KEYCHAIN_ENV, TEST_KEYCHAIN_MEMORY, type CredentialRef } from "@yanlinglabs/winter-agent-sdk";
|
|
3
|
+
export { DEFAULT_KEYCHAIN_SERVICE, TEST_KEYCHAIN_ENV, TEST_KEYCHAIN_MEMORY };
|
|
4
4
|
/**
|
|
5
5
|
* The shape this store needs from a secrets backend.
|
|
6
6
|
*
|
package/dist/store/dialect.d.ts
CHANGED
|
@@ -478,7 +478,7 @@ export declare class TranscriptWriter implements SessionPersistence {
|
|
|
478
478
|
private dialectRecord;
|
|
479
479
|
static readBack(store: SessionStore, key: SessionKey): Promise<SessionStoreEntry[]>;
|
|
480
480
|
}
|
|
481
|
-
export declare const RUNTIME_ENGINE_VERSION = "0.0.
|
|
481
|
+
export declare const RUNTIME_ENGINE_VERSION = "0.0.34";
|
|
482
482
|
export interface ResolvedEngineSession {
|
|
483
483
|
config: RuntimeConfig;
|
|
484
484
|
store: SessionPersistence | undefined;
|
package/dist/testing.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
runEngine2,
|
|
4
4
|
echoProvider2,
|
|
5
5
|
resolveEngineSession2
|
|
6
|
-
} from "./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
6
|
+
} from "./index-rprst8z5.js";
|
|
7
|
+
import"./index-1hef2gff.js";
|
|
8
|
+
import"./index-mwew595z.js";
|
|
9
|
+
import"./index-2wgfv0pa.js";
|
|
10
10
|
import"./index-bef62z3r.js";
|
|
11
11
|
import {
|
|
12
12
|
registerDefaultChildEngineFactory,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
buildProductionWiring,
|
|
15
15
|
withAutoSkillPermissions,
|
|
16
16
|
restoreChildRoster
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-dske1c00.js";
|
|
18
18
|
import {
|
|
19
19
|
Queue
|
|
20
20
|
} from "./index-97t2rmtf.js";
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const RUNTIME_VERSION = "0.0.
|
|
1
|
+
export declare const RUNTIME_VERSION = "0.0.34";
|
package/dist/version.js
CHANGED
|
@@ -22,7 +22,28 @@ export interface WorkerProcess {
|
|
|
22
22
|
onExit(cb: (code: number | null) => void): void;
|
|
23
23
|
onError(cb: (err: Error) => void): void;
|
|
24
24
|
kill(): void;
|
|
25
|
+
/** WS-27: the worker's last non-empty stderr line so far, when the spawner captures stderr (the real one does). */
|
|
26
|
+
lastStderrLine?(): string | undefined;
|
|
25
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* WS-27: the exit code a workflow worker uses to REFUSE to run -- it found itself outside a sandbox that
|
|
30
|
+
* denies Keychain access (a host's workers check this at start). Reported as a sandbox failure, never as a
|
|
31
|
+
* crash, so the host can tell the user what is actually wrong.
|
|
32
|
+
*/
|
|
33
|
+
export declare const WORKFLOW_SANDBOX_REFUSED_EXIT_CODE = 77;
|
|
34
|
+
/** The failure text for a worker that exited without a terminal bridge message. */
|
|
35
|
+
export declare function workerExitMessage(code: number | null, lastStderrLine?: string): string;
|
|
36
|
+
/** At most this many characters of the reported line. */
|
|
37
|
+
export declare const STDERR_LINE_CAP = 500;
|
|
38
|
+
/** At most this many characters of an unterminated line are held while waiting for its newline. */
|
|
39
|
+
export declare const STDERR_CARRY_CAP = 4096;
|
|
40
|
+
/**
|
|
41
|
+
* Keeps the last non-empty line of a stream, bounded -- never the whole of a chatty worker's stderr.
|
|
42
|
+
* Decoded with a streaming `StringDecoder`, so a multi-byte character split across two chunks survives;
|
|
43
|
+
* the reported line is sanitized (`UNSAFE_LINE_CHARS`) and capped at `STDERR_LINE_CAP`, and an
|
|
44
|
+
* unterminated line keeps only its last `STDERR_CARRY_CAP` characters.
|
|
45
|
+
*/
|
|
46
|
+
export declare function stderrTail(stream: NodeJS.ReadableStream | null | undefined): () => string | undefined;
|
|
26
47
|
export type WorkerSpawner = (command: WorkerCommand, opts: {
|
|
27
48
|
home?: string;
|
|
28
49
|
winterHome?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yanlinglabs/winter-agent-runtime",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"@modelcontextprotocol/client": "^2.1.0",
|
|
74
74
|
"ajv": "^8.20.0",
|
|
75
75
|
"ignore": "7.0.5",
|
|
76
|
-
"@yanlinglabs/winter-agent-sdk": "0.0.
|
|
77
|
-
"@yanlinglabs/winter-provider-runtime": "0.0.
|
|
78
|
-
"@yanlinglabs/winter-provider-catalog": "0.0.
|
|
76
|
+
"@yanlinglabs/winter-agent-sdk": "0.0.34",
|
|
77
|
+
"@yanlinglabs/winter-provider-runtime": "0.0.34",
|
|
78
|
+
"@yanlinglabs/winter-provider-catalog": "0.0.34"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@modelcontextprotocol/server": "^2.1.0"
|