@yanlinglabs/winter-agent-sdk 0.0.13 → 0.0.15
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/index.d.ts +1 -1
- package/dist/index.js +6 -1
- package/dist/options.d.ts +6 -0
- package/dist/protocol/config.d.ts +60 -0
- package/dist/protocol/frames.d.ts +10 -0
- package/dist/query.d.ts +15 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type { QueryInternal, ControlRequestHandler, ControlRequestHandlerResult
|
|
|
4
4
|
export type { Options } from "./options.js";
|
|
5
5
|
export { SYSTEM_PROMPT_DYNAMIC_BOUNDARY, DEFAULT_CONTEXT_WINDOW_TOKENS, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_PLANS_DIRECTORY, DEFAULT_OUTPUT_STYLE } from "./options.js";
|
|
6
6
|
export { DEFAULT_PROVIDER_STALL_TIMEOUT_MS, DEFAULT_KEYCHAIN_SERVICE } from "./options.js";
|
|
7
|
-
export type { ProviderSelection, ProviderConnectionConfig, CredentialRef, ThinkingConfig, EffortLevel, AutoClassifierConfig, AdvisorConfig, ModelInfo, AccountInfo } from "./protocol/config.js";
|
|
7
|
+
export type { ProviderSelection, ProviderConnectionConfig, CredentialRef, ThinkingConfig, EffortLevel, AutoClassifierConfig, AdvisorConfig, ModelInfo, AgentInfo, AccountInfo } from "./protocol/config.js";
|
|
8
8
|
export type { SlotView, ActiveSlotSet, ModelFamilyListing, ModelSlotSetting, ModelRowServable } from "./protocol/config.js";
|
|
9
9
|
export type { SdkPluginConfig, SystemPromptOption, SystemPromptPreset, OutputFormat, JsonSchemaOutputFormat, SkillsOption, RewindFilesResult, RewindFilesRequest, InitPluginInfo } from "./protocol/config.js";
|
|
10
10
|
export type { McpServerConfig, McpSdkServerConfigWithInstance, McpServerToolPolicy, McpStdioServerConfig, McpHttpServerConfig, McpSSEServerConfig, McpSdkServerConfig, AgentDefinition } from "./options.js";
|
package/dist/index.js
CHANGED
|
@@ -578,6 +578,7 @@ function query(args) {
|
|
|
578
578
|
...options.toolAliases !== undefined ? { toolAliases: options.toolAliases } : {},
|
|
579
579
|
...options.agents !== undefined ? { agents: options.agents } : {},
|
|
580
580
|
...options.forwardSubagentText !== undefined ? { forwardSubagentText: options.forwardSubagentText } : {},
|
|
581
|
+
...options.forkSubagent !== undefined ? { forkSubagent: options.forkSubagent } : {},
|
|
581
582
|
...options.systemPrompt !== undefined ? { systemPrompt: options.systemPrompt } : {},
|
|
582
583
|
...options.plugins !== undefined ? { plugins: options.plugins } : {},
|
|
583
584
|
...options.skills !== undefined ? { skills: options.skills } : {},
|
|
@@ -850,6 +851,10 @@ function query(args) {
|
|
|
850
851
|
const payload = await sendControlRequest("list_models", undefined);
|
|
851
852
|
return Array.isArray(payload) ? payload : [];
|
|
852
853
|
};
|
|
854
|
+
gen.supportedAgents = async () => {
|
|
855
|
+
const payload = await sendControlRequest("list_agents", undefined);
|
|
856
|
+
return Array.isArray(payload) ? payload : [];
|
|
857
|
+
};
|
|
853
858
|
gen.listModelFamilies = async () => {
|
|
854
859
|
const payload = await sendControlRequest("list_model_families", undefined);
|
|
855
860
|
return isModelFamilyListing(payload) ? payload : { active: undefined, families: [] };
|
|
@@ -961,7 +966,7 @@ function query(args) {
|
|
|
961
966
|
return gen;
|
|
962
967
|
}
|
|
963
968
|
// src/version.ts
|
|
964
|
-
var SDK_VERSION = "0.0.
|
|
969
|
+
var SDK_VERSION = "0.0.15";
|
|
965
970
|
// src/paths/project-key.ts
|
|
966
971
|
var TRANSCRIPT_PROJECT_KEY_MAX_LENGTH = 64;
|
|
967
972
|
var VENDOR_PROJECT_KEY_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
|
package/dist/options.d.ts
CHANGED
|
@@ -97,6 +97,12 @@ export interface Options {
|
|
|
97
97
|
toolAliases?: Record<string, string>;
|
|
98
98
|
agents?: Record<string, AgentDefinition>;
|
|
99
99
|
forwardSubagentText?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Winter extension (spawn-surface parity R-S5): enables `subagent_type: "fork"` for this session.
|
|
102
|
+
* `true` on, `false` off; omitted = the runtime reads `WINTER_FORK_SUBAGENT` (claude's own
|
|
103
|
+
* `CLAUDE_CODE_FORK_SUBAGENT`), and is off when that is unset.
|
|
104
|
+
*/
|
|
105
|
+
forkSubagent?: boolean;
|
|
100
106
|
onElicitation?: (request: {
|
|
101
107
|
serverName: string;
|
|
102
108
|
message: string;
|
|
@@ -164,6 +164,39 @@ export interface RuntimeAgentDefinition {
|
|
|
164
164
|
permissionMode?: string;
|
|
165
165
|
observer?: string;
|
|
166
166
|
observerMessage?: string;
|
|
167
|
+
/**
|
|
168
|
+
* A filesystem/frontmatter agent's own `isolation` (research §A1's own field table: "also color,
|
|
169
|
+
* isolation (worktree|remote), background, memory, effort, permissionMode"). Mirrors the model-
|
|
170
|
+
* facing `Agent` tool's own `isolation` enum exactly -- a DEFINITION may pin the isolation a caller
|
|
171
|
+
* would otherwise choose per-invocation. Absent = no isolation preference from the definition
|
|
172
|
+
* (today: the invocation's own `isolation` field, if any, still governs -- wiring a definition's
|
|
173
|
+
* own value through spawn resolution is a later lane's job; this field only carries it now).
|
|
174
|
+
*/
|
|
175
|
+
isolation?: "worktree" | "remote";
|
|
176
|
+
/**
|
|
177
|
+
* A filesystem/frontmatter agent's own display `color` (research §A1's field table, same entry as
|
|
178
|
+
* `isolation` above). Advisory/presentational only -- nothing in this package interprets it; a host
|
|
179
|
+
* UI (or a future Winter surface) may render an agent's rows in its own color.
|
|
180
|
+
*/
|
|
181
|
+
color?: string;
|
|
182
|
+
/**
|
|
183
|
+
* The `claude` built-in's own shape (research §A1: "`appendSystemPrompt: true` (appended to the
|
|
184
|
+
* default prompt)"): when true, `prompt` is APPENDED to the session's own composed system prompt
|
|
185
|
+
* rather than replacing it the way every other definition's `prompt` does (WS-10 §2's "system
|
|
186
|
+
* prompt of the child", layered onto the base). Absent/false = the established replace-and-layer
|
|
187
|
+
* behavior every pre-existing definition already has.
|
|
188
|
+
*/
|
|
189
|
+
appendSystemPrompt?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* The `Explore`/`Plan` built-ins' own shape (research §A1: "`omitClaudeMd: true`; context also
|
|
192
|
+
* drops gitStatus"). WINTER-NAMED rather than mirroring the pinned field's own product-specific
|
|
193
|
+
* spelling (WS-01 §5's own "rebrand, don't borrow the vendor's literal name" posture) -- but the
|
|
194
|
+
* BEHAVIOR is identical: when true, this agent's own context assembly omits the discovered
|
|
195
|
+
* project-instructions file (the brand's own instructions-file convention, `brand.instructionsFile`) and the git-status dynamic section
|
|
196
|
+
* from its system/user-context, the same two things claude's `omitClaudeMd` drops. Absent/false =
|
|
197
|
+
* every pre-existing definition's context, unchanged.
|
|
198
|
+
*/
|
|
199
|
+
omitProjectContext?: boolean;
|
|
167
200
|
}
|
|
168
201
|
export interface RuntimeConfig {
|
|
169
202
|
sessionId: string;
|
|
@@ -209,6 +242,18 @@ export interface RuntimeConfig {
|
|
|
209
242
|
forwardSubagentText?: boolean;
|
|
210
243
|
agentId?: string;
|
|
211
244
|
isolationPinnedCwd?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Spawn-surface parity (R-S5): the fork gate -- `subagent_type: "fork"` is selectable (and the
|
|
247
|
+
* `fork` built-in is listed) only when this is `true`. `false` forces it off; ABSENT falls back to
|
|
248
|
+
* the `<PREFIX>FORK_SUBAGENT` env var (claude's own `CLAUDE_CODE_FORK_SUBAGENT` precedent), and
|
|
249
|
+
* absent-and-unset is OFF (a Winter session is non-interactive, like a headless SDK session).
|
|
250
|
+
*/
|
|
251
|
+
forkSubagent?: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Spawn-surface parity (R-S5): set ONLY on the RuntimeConfig of a child that is itself a FORK --
|
|
254
|
+
* a forked worker may not fork again (claude's own refusal). Never set by `query()`.
|
|
255
|
+
*/
|
|
256
|
+
insideFork?: boolean;
|
|
212
257
|
systemPrompt?: SystemPromptOption;
|
|
213
258
|
plugins?: SdkPluginConfig[];
|
|
214
259
|
skills?: SkillsOption;
|
|
@@ -422,6 +467,21 @@ export interface ModelInfo {
|
|
|
422
467
|
supportsFastMode?: boolean;
|
|
423
468
|
supportsAutoMode?: boolean;
|
|
424
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* The pinned `AgentInfo` (0.3.250 `sdk.d.ts`: "Information about an available subagent that can be
|
|
472
|
+
* invoked via the Task/Agent tool"). Three fields, one required trio short of `ModelInfo`'s own
|
|
473
|
+
* richness -- `name`/`description` required, `model` optional ("Model alias this agent uses. If
|
|
474
|
+
* omitted, inherits the parent's model").
|
|
475
|
+
*
|
|
476
|
+
* Declared here for the identical structural reason `ModelInfo`/`AccountInfo` are: `Query.
|
|
477
|
+
* supportedAgents()` is on the sdk's public surface, the sdk package is dependency-free and
|
|
478
|
+
* fence-resident, and `packages/runtime` (which BUILDS the listing this feeds) is Bun-only.
|
|
479
|
+
*/
|
|
480
|
+
export interface AgentInfo {
|
|
481
|
+
name: string;
|
|
482
|
+
description: string;
|
|
483
|
+
model?: string;
|
|
484
|
+
}
|
|
425
485
|
/**
|
|
426
486
|
* The pinned `AccountInfo` (`sdk.d.ts:23-33`). EVERY field optional; an empty object is valid, and
|
|
427
487
|
* capture (J) observed exactly three keys present under API-key auth.
|
|
@@ -245,6 +245,7 @@ export type WireContentBlock = {
|
|
|
245
245
|
type: "tool_result";
|
|
246
246
|
tool_use_id: string;
|
|
247
247
|
content: string | WireContentBlock[];
|
|
248
|
+
is_error?: boolean;
|
|
248
249
|
[k: string]: unknown;
|
|
249
250
|
} | {
|
|
250
251
|
type: "image";
|
|
@@ -557,6 +558,15 @@ export type SdkMessage = {
|
|
|
557
558
|
skills: string[];
|
|
558
559
|
plugins: InitPluginInfo[];
|
|
559
560
|
mcp_servers?: WireMcpServerStatus[];
|
|
561
|
+
/**
|
|
562
|
+
* Spawn-surface parity (research §A3): the per-session `subagent_type` names -- the SAME set
|
|
563
|
+
* `Query.supportedAgents()` reports (research: "Same list feeds `system/init.agents?:
|
|
564
|
+
* string[]` and `Query.supportedAgents(): AgentInfo[]`"). Present only when the `Agent` tool
|
|
565
|
+
* is itself advertised (absent otherwise, matching `mcp_servers`' own conditional-presence
|
|
566
|
+
* convention on this same frame) -- the engine-side producer is `engine.ts`'s own
|
|
567
|
+
* `system/init` block.
|
|
568
|
+
*/
|
|
569
|
+
agents?: string[];
|
|
560
570
|
[k: string]: unknown;
|
|
561
571
|
} | SDKHookStartedMessage | SDKHookProgressMessage | SDKHookResponseMessage | SDKPermissionDeniedMessage | SDKStatusMessage | SDKCompactBoundaryMessage | BackgroundTaskMessage | SDKPartialAssistantMessage | SDKAPIRetryMessage | SDKRateLimitEvent | SDKAuthStatusMessage | SDKThinkingTokensMessage | SDKModelRefusalFallbackMessage | SDKModelRefusalNoFallbackMessage | SDKReasoningSummaryMessage | SDKModelSwitchMessage | SDKContinuityWarningMessage | {
|
|
562
572
|
type: "assistant";
|
package/dist/query.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SdkMessage as RuntimeSdkMessage } from "./protocol/frames.js";
|
|
2
|
-
import type { AccountInfo, ModelInfo, ModelFamilyListing, RewindFilesResult } from "./protocol/config.js";
|
|
2
|
+
import type { AccountInfo, AgentInfo, ModelInfo, ModelFamilyListing, RewindFilesResult } from "./protocol/config.js";
|
|
3
3
|
import { type Options } from "./options.js";
|
|
4
4
|
import type { PermissionMode, PermissionResult } from "./permissions/types.js";
|
|
5
5
|
import { type DeliveryOutcome, type GlobalAgentMessage, type ListedRuntimeObject, type PermissionClassLabel } from "./messaging/index.js";
|
|
@@ -120,6 +120,20 @@ export interface Query extends AsyncGenerator<SdkMessage> {
|
|
|
120
120
|
* so the answer is a table lookup rather than a network round trip.
|
|
121
121
|
*/
|
|
122
122
|
supportedModels(): Promise<ModelInfo[]>;
|
|
123
|
+
/**
|
|
124
|
+
* Spawn-surface parity (0.3.250 `sdk.d.ts:2572`, pinned): "Get the list of available subagents for
|
|
125
|
+
* the current session" — the SAME per-session agent-type list `system/init.agents` carries (research
|
|
126
|
+
* §A3: "Same list feeds `system/init.agents?: string[]` and `Query.supportedAgents(): AgentInfo[]`"),
|
|
127
|
+
* here as the richer `{name, description, model?}` triple rather than bare names. A BARE ARRAY, same
|
|
128
|
+
* shape as `supportedModels` above — served from the runtime's own resolved built-in/filesystem/
|
|
129
|
+
* programmatic agent set, a table lookup rather than a network round trip.
|
|
130
|
+
*
|
|
131
|
+
* The control-subtype producer (the runtime's `list_agents` handler) is a separate lane's wiring;
|
|
132
|
+
* this wrapper degrades a malformed/absent payload to `[]`, matching `supportedModels`'/
|
|
133
|
+
* `listModelFamilies`' own "answers with data, never leaves a rejection standing in for absence"
|
|
134
|
+
* posture.
|
|
135
|
+
*/
|
|
136
|
+
supportedAgents(): Promise<AgentInfo[]>;
|
|
123
137
|
/**
|
|
124
138
|
* WS-13c §7 (P6.6 Lane C) — WINTER-ONLY, no pinned counterpart: the active slot set this session is
|
|
125
139
|
* currently offering, plus every model family behind "more options". A model switcher shows
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yanlinglabs/winter-agent-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@yanlinglabs/winter-provider-catalog": "0.0.
|
|
48
|
+
"@yanlinglabs/winter-provider-catalog": "0.0.15"
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
|
-
"@yanlinglabs/winter-agent-sdk-darwin-arm64": "0.0.
|
|
51
|
+
"@yanlinglabs/winter-agent-sdk-darwin-arm64": "0.0.15"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^26.4.0",
|
|
55
|
-
"winter-
|
|
56
|
-
"
|
|
55
|
+
"@yanlinglabs/winter-conformance": "0.0.15",
|
|
56
|
+
"winter-agent-runtime": "0.0.15"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {}
|
|
59
59
|
}
|