@yanlinglabs/winter-agent-sdk 0.0.14 → 0.0.16

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/README.md CHANGED
@@ -68,6 +68,57 @@ plus two canonical standing-server twins, and `@yanlinglabs/winter-runtime-sdk`
68
68
  definitions under Claude's built-in names. Handlers return `{ text, isError? }` for each host to
69
69
  wrap in its own result shape.
70
70
 
71
+ ## Environment variables and settings
72
+
73
+ The runtime child reads a handful of environment variables at spawn/per-turn, plus a few
74
+ `Options`/`RuntimeConfig` fields. Every variable name below is `WINTER_`-prefixed for Winter's own
75
+ build (`BrandProfile.envPrefix`); a rebranded host reads the identical suffix under its own prefix.
76
+
77
+ | Variable | Default | Effect |
78
+ | --- | --- | --- |
79
+ | `WINTER_DISABLE_BACKGROUND_TASKS` | off | A hard kill switch with two effects together: it drops `run_in_background` from the Agent tool's own advertised schema entirely, and it forces every subagent spawn to the foreground unconditionally (outranking a definition's own `background: true`, a fork, and an explicit `run_in_background: true` alike). |
80
+ | `WINTER_BACKGROUND_BY_DEFAULT` | on (background) | A softer opt-out than the kill switch above: a falsy value (`0`/`false`/`no`/`off`, case-insensitive) restores the pre-0.0.16 default (an unflagged spawn runs in the FOREGROUND) without removing `run_in_background` from the schema — the model can still ask for either explicitly either way. `Options.backgroundByDefault` (see below) wins over this variable in either direction when both are set. |
81
+ | `WINTER_PRINT_BG_WAIT_CEILING_MS` | `600000` (10 minutes) | How long a closed-input session holds its result for a still-running background agent/workflow before sweeping it as stopped. `0` waits indefinitely. |
82
+ | `WINTER_EMIT_SESSION_STATE_EVENTS` | off | Truthy (`1`/`true`) emits `system/session_state_changed` frames (`running`/`idle`) as a turn starts and ends. Absent, the frame stream is unchanged from before this existed. |
83
+ | `WINTER_DISABLE_GIT_INSTRUCTIONS` | off | Truthy disables the git status/instructions section of the system prompt outright, overriding `Settings.includeGitInstructions` in either direction. A falsy value (`0`/`false`/`no`/`off`) explicitly re-enables it even when the setting says otherwise. |
84
+ | `WINTER_DISABLE_EXPLORE_INHERIT_CAP` | off | Truthy opts a first-party Anthropic session out of the Explore built-in's own model cap (which otherwise caps a Fable-tier session's Explore spawn down to Opus). |
85
+ | `WINTER_FORK_SUBAGENT` | off | Truthy enables `subagent_type: "fork"` for the session (mirrors `CLAUDE_CODE_FORK_SUBAGENT`). `Options.forkSubagent` (below) wins over this variable in either direction. |
86
+ | `WINTER_WEB_FETCH_AGENT` | off | Truthy makes the `web-fetch` built-in agent type available (off by default, like claude's own). |
87
+ | `WINTER_AGENT_SDK_DISABLE_BUILTIN_AGENTS` | off | Truthy withholds every built-in `subagent_type` (gated or not) for the session. |
88
+ | `WINTER_DISABLE_EXPLORE_PLAN_AGENTS` | off | Truthy withholds the `Explore` and `Plan` built-ins together. |
89
+ | `WINTER_DISABLE_AGENT_VIEW` | off | Truthy withholds the `claude` catch-all built-in (mirrors `CLAUDE_CODE_DISABLE_AGENT_VIEW`). |
90
+ | `WINTER_MAX_SUBAGENT_SPAWN_DEPTH` | `3` | How many levels of subagent nesting are allowed beneath the top-level session before a spawn is refused. |
91
+ | `WINTER_MAX_CONCURRENT_SUBAGENTS` | `20` | How many subagents may run at once (across the whole nesting tree) before a spawn is refused. |
92
+
93
+ A handful of `Options`/settings fields carry the same weight as their env counterparts, and a
94
+ RuntimeConfig field always wins over its own env fallback in either direction when both are set:
95
+
96
+ - **`Settings.includeGitInstructions`** (default `true`) — the setting `WINTER_DISABLE_GIT_INSTRUCTIONS` overrides above.
97
+ - **`Options.forkSubagent`** (`boolean`, default unset → env fallback) — the RuntimeConfig field behind `WINTER_FORK_SUBAGENT`.
98
+ - **`Options.backgroundByDefault`** (`boolean`, default unset → env fallback) — the RuntimeConfig field behind `WINTER_BACKGROUND_BY_DEFAULT`, above.
99
+
100
+ `RuntimeConfig.allowedAgentTypes` (`string[]`) is a different shape of field, not a host-settable
101
+ one: there is no `Options.allowedAgentTypes` and no env fallback to win over. It exists only on the
102
+ wire `RuntimeConfig`, and the engine — never a host — populates it: when a running agent's own
103
+ definition restricts `tools` with an `Agent(a, b)` entry, `allowedAgentTypesFromTools` parses that
104
+ restriction and threads the resulting list onto the CHILD it spawns for that agent's own
105
+ `RuntimeConfig`, so the child's listing / `init.agents` / Agent-tool resolution sees only `[a, b]`,
106
+ never the full universe of types its parent session could otherwise reach. Absent (every top-level
107
+ session, and any child whose parent definition named no `Agent(...)` restriction) means
108
+ unrestricted, the behavior every session had before this field existed.
109
+
110
+ ### The 0.0.16 background-default change
111
+
112
+ Before 0.0.16, an Agent tool call with no `run_in_background` ran in the **foreground** (this call
113
+ does not return until the spawned agent finishes). From 0.0.16 on, matching claude, the same
114
+ unflagged call runs in the **background** by default: the call returns immediately with a task id,
115
+ and the model is told about the result later as a task notification (mid-turn, or as its own
116
+ unsolicited turn). `run_in_background: false` still asks for the old, synchronous behavior on any
117
+ one call. A host that wants the *default* itself to stay foreground — without losing the
118
+ `run_in_background` field or forcing every call to name it explicitly — sets
119
+ `Options.backgroundByDefault: false` (or `WINTER_BACKGROUND_BY_DEFAULT=false`); the kill switch,
120
+ `WINTER_DISABLE_BACKGROUND_TASKS`, is unrelated and unaffected by this knob in either direction.
121
+
71
122
  ## License
72
123
 
73
124
  MIT — see [`LICENSE`](./LICENSE), which ships in the published tarball.
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";
@@ -24,7 +24,7 @@ export { SDK_VERSION } from "./version.js";
24
24
  export { MESSAGING_CONTROL_SUBTYPES, MESSAGING_CONTROL_SUBTYPE_LIST, MESSAGING_HOST_REQUEST_SUBTYPES, MESSAGING_RUNTIME_REQUEST_SUBTYPES, resolveFacetTarget } from "./protocol/messaging.js";
25
25
  export { isRuntimeAddress, isGlobalAgentMessage, isDeliveryOutcome, isListedRuntimeObjectArray, isPermissionClassLabel, isMessagingDeliverRequest, isMessagingChildRequest, isMessagingSubscribeIdleRequest, isMessagingReadNotificationsRequest, isMessagingNotificationsPage, isMessagingIdleNoticePayload, isNotificationRecord, } from "./protocol/messaging.js";
26
26
  export type { MessagingControlSubtype, MessagingDeliverRequest, MessagingChildRequest, MessagingSubscribeIdleRequest, MessagingSenderClassResponse, MessagingReadNotificationsRequest, MessagingNotificationsPage, MessagingIdleNoticePayload, } from "./protocol/messaging.js";
27
- export type { ProtocolVersion, WinterFrame, SdkMessage as ProtocolSdkMessage, InitFrame, UserFrame, DataFrame, ControlRequestFrame, ControlResponseFrame, UnknownFrame, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKPermissionDeniedMessage, SDKPermissionDenial, SDKTaskStartedMessage, SDKTaskNotificationMessage, SDKTaskUpdatedMessage, SDKTaskProgressMessage, SDKBackgroundTasksChangedMessage, SDKLocalCommandOutputMessage, BackgroundTaskMessage, SDKCompactBoundaryMessage, WireContentBlock, WireStreamEvent, WireStreamEventDelta, SDKPartialAssistantMessage, SDKAssistantMessageError, SDKAPIRetryMessage, SDKRateLimitEvent, SDKRateLimitInfo, SDKAuthStatusMessage, SDKThinkingTokensMessage, SDKModelRefusalFallbackMessage, SDKModelRefusalNoFallbackMessage, SDKReasoningSummaryMessage, SDKModelSwitchMessage, SDKContinuityWarningMessage, } from "./protocol/frames.js";
27
+ export type { ProtocolVersion, WinterFrame, SdkMessage as ProtocolSdkMessage, InitFrame, UserFrame, DataFrame, ControlRequestFrame, ControlResponseFrame, UnknownFrame, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKPermissionDeniedMessage, SDKPermissionDenial, SDKTaskStartedMessage, SDKTaskNotificationMessage, SDKTaskUpdatedMessage, SDKTaskProgressMessage, SDKBackgroundTasksChangedMessage, SDKLocalCommandOutputMessage, BackgroundTaskMessage, SDKCompactBoundaryMessage, SDKSessionStateChangedMessage, WireContentBlock, WireStreamEvent, WireStreamEventDelta, SDKPartialAssistantMessage, SDKAssistantMessageError, SDKAPIRetryMessage, SDKRateLimitEvent, SDKRateLimitInfo, SDKAuthStatusMessage, SDKThinkingTokensMessage, SDKModelRefusalFallbackMessage, SDKModelRefusalNoFallbackMessage, SDKReasoningSummaryMessage, SDKModelSwitchMessage, SDKContinuityWarningMessage, } from "./protocol/frames.js";
28
28
  export { resolveWinterHome, resolveKeychainServiceForProfile, isUnset } from "./paths/home.js";
29
29
  export { transcriptProjectKey, TRANSCRIPT_PROJECT_KEY_MAX_LENGTH, isVendorCompliantProjectKey } from "./paths/project-key.js";
30
30
  export { compatibilityKeys } from "./paths/keys.js";
package/dist/index.js CHANGED
@@ -578,6 +578,8 @@ 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 } : {},
582
+ ...options.backgroundByDefault !== undefined ? { backgroundByDefault: options.backgroundByDefault } : {},
581
583
  ...options.systemPrompt !== undefined ? { systemPrompt: options.systemPrompt } : {},
582
584
  ...options.plugins !== undefined ? { plugins: options.plugins } : {},
583
585
  ...options.skills !== undefined ? { skills: options.skills } : {},
@@ -850,6 +852,10 @@ function query(args) {
850
852
  const payload = await sendControlRequest("list_models", undefined);
851
853
  return Array.isArray(payload) ? payload : [];
852
854
  };
855
+ gen.supportedAgents = async () => {
856
+ const payload = await sendControlRequest("list_agents", undefined);
857
+ return Array.isArray(payload) ? payload : [];
858
+ };
853
859
  gen.listModelFamilies = async () => {
854
860
  const payload = await sendControlRequest("list_model_families", undefined);
855
861
  return isModelFamilyListing(payload) ? payload : { active: undefined, families: [] };
@@ -961,7 +967,7 @@ function query(args) {
961
967
  return gen;
962
968
  }
963
969
  // src/version.ts
964
- var SDK_VERSION = "0.0.14";
970
+ var SDK_VERSION = "0.0.16";
965
971
  // src/paths/project-key.ts
966
972
  var TRANSCRIPT_PROJECT_KEY_MAX_LENGTH = 64;
967
973
  var VENDOR_PROJECT_KEY_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
package/dist/options.d.ts CHANGED
@@ -97,6 +97,27 @@ 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;
106
+ /**
107
+ * I4 (fix wave): a programmatic opt-out for the Agent tool's own background default (SDK 0.0.16,
108
+ * `subagents/policy.ts`'s `resolveForegroundBackground` -- "background unless `run_in_background`
109
+ * is explicitly false"). `false` restores the 0.0.15 default (foreground) for every spawn this
110
+ * knob's stage of the chain decides; `true` is the 0.0.16 default, spelled out. Omitted = the
111
+ * runtime reads `WINTER_BACKGROUND_BY_DEFAULT` (falsy -- "0"/"false"/"no"/"off" -- restores
112
+ * foreground; anything else, including absent, keeps background), the SAME `forkSubagent`
113
+ * precedent: the field wins in either direction, the env is only the fallback.
114
+ *
115
+ * Distinct from `WINTER_DISABLE_BACKGROUND_TASKS` (which keeps its own, unrelated meaning -- a
116
+ * hard kill switch that ALSO removes `run_in_background` from the advertised schema entirely):
117
+ * this knob changes only which way an OMITTED `run_in_background` resolves, and the field stays
118
+ * on the schema either way.
119
+ */
120
+ backgroundByDefault?: boolean;
100
121
  onElicitation?: (request: {
101
122
  serverName: string;
102
123
  message: string;
@@ -164,6 +164,47 @@ 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;
200
+ /**
201
+ * SDK 0.0.16 Lane P (R3b §5): claude's `whenToUseLean` -- used in place of `description` in the
202
+ * Agent-tool listing when the session's own model takes the lean prompt (`leanModel`, computed
203
+ * by `context/agent-listing.ts`'s own caller). Set only on Winter's built-in Explore; every other
204
+ * definition (Winter's own, or a filesystem/programmatic one) has none, and the listing falls
205
+ * back to `description` exactly as it always has.
206
+ */
207
+ whenToUseLean?: string;
167
208
  }
168
209
  export interface RuntimeConfig {
169
210
  sessionId: string;
@@ -207,8 +248,37 @@ export interface RuntimeConfig {
207
248
  toolAliases?: Record<string, string>;
208
249
  agents?: Record<string, RuntimeAgentDefinition>;
209
250
  forwardSubagentText?: boolean;
251
+ /**
252
+ * SDK 0.0.16 Lane P (R3b §4): the RUNNING agent's own `Agent(a, b)` restriction, parsed from its
253
+ * `AgentDefinition.tools` entries by `subagents/definitions.ts`'s own `allowedAgentTypesFromTools`
254
+ * and threaded onto a CHILD's own RuntimeConfig at spawn (`child-engine.ts`) -- so a session
255
+ * spawned from a definition with `tools: ["*", "Agent(Explore, Plan)"]` sees only [Explore, Plan]
256
+ * in ITS OWN listing / `init.agents` / Agent-tool resolution, never the full universe of types
257
+ * this session could otherwise reach. Absent = unrestricted, the pre-existing behaviour every
258
+ * session before this field existed keeps. Pure passthrough; query.ts never interprets it.
259
+ */
260
+ allowedAgentTypes?: string[];
210
261
  agentId?: string;
211
262
  isolationPinnedCwd?: boolean;
263
+ /**
264
+ * Spawn-surface parity (R-S5): the fork gate -- `subagent_type: "fork"` is selectable (and the
265
+ * `fork` built-in is listed) only when this is `true`. `false` forces it off; ABSENT falls back to
266
+ * the `<PREFIX>FORK_SUBAGENT` env var (claude's own `CLAUDE_CODE_FORK_SUBAGENT` precedent), and
267
+ * absent-and-unset is OFF (a Winter session is non-interactive, like a headless SDK session).
268
+ */
269
+ forkSubagent?: boolean;
270
+ /**
271
+ * Spawn-surface parity (R-S5): set ONLY on the RuntimeConfig of a child that is itself a FORK --
272
+ * a forked worker may not fork again (claude's own refusal). Never set by `query()`.
273
+ */
274
+ insideFork?: boolean;
275
+ /**
276
+ * I4 (fix wave): mirrors `Options.backgroundByDefault` exactly -- see that field's own comment.
277
+ * `subagents/policy.ts`'s `resolveForegroundBackground` reads it at its own stage 5, AFTER the
278
+ * `WINTER_DISABLE_BACKGROUND_TASKS` kill switch (stage 2, unrelated and unaffected) and the
279
+ * invocation's own explicit `run_in_background` (stage 4, always wins when given).
280
+ */
281
+ backgroundByDefault?: boolean;
212
282
  systemPrompt?: SystemPromptOption;
213
283
  plugins?: SdkPluginConfig[];
214
284
  skills?: SkillsOption;
@@ -422,6 +492,21 @@ export interface ModelInfo {
422
492
  supportsFastMode?: boolean;
423
493
  supportsAutoMode?: boolean;
424
494
  }
495
+ /**
496
+ * The pinned `AgentInfo` (0.3.250 `sdk.d.ts`: "Information about an available subagent that can be
497
+ * invoked via the Task/Agent tool"). Three fields, one required trio short of `ModelInfo`'s own
498
+ * richness -- `name`/`description` required, `model` optional ("Model alias this agent uses. If
499
+ * omitted, inherits the parent's model").
500
+ *
501
+ * Declared here for the identical structural reason `ModelInfo`/`AccountInfo` are: `Query.
502
+ * supportedAgents()` is on the sdk's public surface, the sdk package is dependency-free and
503
+ * fence-resident, and `packages/runtime` (which BUILDS the listing this feeds) is Bun-only.
504
+ */
505
+ export interface AgentInfo {
506
+ name: string;
507
+ description: string;
508
+ model?: string;
509
+ }
425
510
  /**
426
511
  * The pinned `AccountInfo` (`sdk.d.ts:23-33`). EVERY field optional; an empty object is valid, and
427
512
  * 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";
@@ -543,6 +544,24 @@ export interface SDKContinuityWarningMessage {
543
544
  uuid: string;
544
545
  session_id: string;
545
546
  }
547
+ /**
548
+ * SDK 0.0.16 Lane N: `notifySessionStateChanged` (pinned `sdk.d.ts`: "Mirrors notifySessionStateChanged.
549
+ * 'idle' fires after heldBackResult flushes and the bg-agent do-while exits -- authoritative turn-over
550
+ * signal"). ENV-GATED on both runtimes: the pinned binary emits it only under
551
+ * `CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS`, Winter only under `WINTER_EMIT_SESSION_STATE_EVENTS`, so a
552
+ * default session's frame stream is byte-identical with or without this variant existing.
553
+ *
554
+ * `requires_action` is declared (it is in the pinned union) but has no Winter producer: Winter's
555
+ * approval prompts ride `control_request`, not a session-state transition.
556
+ */
557
+ export interface SDKSessionStateChangedMessage {
558
+ type: "system";
559
+ subtype: "session_state_changed";
560
+ state: "idle" | "running" | "requires_action";
561
+ uuid: string;
562
+ session_id: string;
563
+ [k: string]: unknown;
564
+ }
546
565
  export type SdkMessage = {
547
566
  type: "system";
548
567
  subtype: "init";
@@ -557,8 +576,17 @@ export type SdkMessage = {
557
576
  skills: string[];
558
577
  plugins: InitPluginInfo[];
559
578
  mcp_servers?: WireMcpServerStatus[];
579
+ /**
580
+ * Spawn-surface parity (research §A3): the per-session `subagent_type` names -- the SAME set
581
+ * `Query.supportedAgents()` reports (research: "Same list feeds `system/init.agents?:
582
+ * string[]` and `Query.supportedAgents(): AgentInfo[]`"). Present only when the `Agent` tool
583
+ * is itself advertised (absent otherwise, matching `mcp_servers`' own conditional-presence
584
+ * convention on this same frame) -- the engine-side producer is `engine.ts`'s own
585
+ * `system/init` block.
586
+ */
587
+ agents?: string[];
560
588
  [k: string]: unknown;
561
- } | SDKHookStartedMessage | SDKHookProgressMessage | SDKHookResponseMessage | SDKPermissionDeniedMessage | SDKStatusMessage | SDKCompactBoundaryMessage | BackgroundTaskMessage | SDKPartialAssistantMessage | SDKAPIRetryMessage | SDKRateLimitEvent | SDKAuthStatusMessage | SDKThinkingTokensMessage | SDKModelRefusalFallbackMessage | SDKModelRefusalNoFallbackMessage | SDKReasoningSummaryMessage | SDKModelSwitchMessage | SDKContinuityWarningMessage | {
589
+ } | SDKHookStartedMessage | SDKHookProgressMessage | SDKHookResponseMessage | SDKPermissionDeniedMessage | SDKStatusMessage | SDKCompactBoundaryMessage | SDKSessionStateChangedMessage | BackgroundTaskMessage | SDKPartialAssistantMessage | SDKAPIRetryMessage | SDKRateLimitEvent | SDKAuthStatusMessage | SDKThinkingTokensMessage | SDKModelRefusalFallbackMessage | SDKModelRefusalNoFallbackMessage | SDKReasoningSummaryMessage | SDKModelSwitchMessage | SDKContinuityWarningMessage | {
562
590
  type: "assistant";
563
591
  message: {
564
592
  content: Array<{
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
@@ -76,6 +76,11 @@ export interface Settings {
76
76
  skillListingMaxDescChars?: number;
77
77
  /** `sdk.d.ts:5503`. The listing's share of the context window (default 0.01). */
78
78
  skillListingBudgetFraction?: number;
79
+ /**
80
+ * `sdk.d.ts:5539`. SDK 0.0.16: whether the systemContext `gitStatus` snapshot is sent (default
81
+ * true). `<PREFIX>DISABLE_GIT_INSTRUCTIONS` overrides it either way.
82
+ */
83
+ includeGitInstructions?: boolean;
79
84
  /**
80
85
  * A settings-tier MCP server block. Deliberately `Record<string, unknown>` rather than a typed
81
86
  * server union: `settings/loaders/mcp-config.ts` validates each entry and `resolveMcpServerSources`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yanlinglabs/winter-agent-sdk",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
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.14"
48
+ "@yanlinglabs/winter-provider-catalog": "0.0.16"
49
49
  },
50
50
  "optionalDependencies": {
51
- "@yanlinglabs/winter-agent-sdk-darwin-arm64": "0.0.14"
51
+ "@yanlinglabs/winter-agent-sdk-darwin-arm64": "0.0.16"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "^26.4.0",
55
- "@yanlinglabs/winter-conformance": "0.0.14",
56
- "winter-agent-runtime": "0.0.14"
55
+ "winter-agent-runtime": "0.0.16",
56
+ "@yanlinglabs/winter-conformance": "0.0.16"
57
57
  },
58
58
  "scripts": {}
59
59
  }