@yanlinglabs/winter-agent-runtime 0.0.41 → 0.0.43

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.
Files changed (57) hide show
  1. package/dist/commands/resolver.d.ts +8 -13
  2. package/dist/context/agent-listing.d.ts +7 -11
  3. package/dist/context/attachments.d.ts +14 -23
  4. package/dist/context/dynamic-sections.d.ts +5 -5
  5. package/dist/context/git-branch-fixture.d.ts +22 -0
  6. package/dist/context/git-status.d.ts +2 -2
  7. package/dist/context/memory.d.ts +1 -1
  8. package/dist/context/output-styles.d.ts +2 -2
  9. package/dist/context/request-layout.d.ts +16 -17
  10. package/dist/context/seam.d.ts +7 -6
  11. package/dist/embedded-worker.js +3 -3
  12. package/dist/embedded.js +3 -3
  13. package/dist/engine.d.ts +3 -3
  14. package/dist/{index-ey5c52j3.js → index-14xkt4jp.js} +2 -2
  15. package/dist/{index-hdvvezf8.js → index-bh1ve8ws.js} +238 -154
  16. package/dist/{index-z9yngxj4.js → index-kqc3tdph.js} +964 -826
  17. package/dist/index.js +1 -1
  18. package/dist/mcp/lifecycle.d.ts +2 -1
  19. package/dist/permissions/edit-recognition.d.ts +1 -1
  20. package/dist/permissions/evaluator.d.ts +19 -30
  21. package/dist/permissions/file-rules.d.ts +177 -277
  22. package/dist/permissions/grammar.d.ts +58 -0
  23. package/dist/permissions/policy-state.d.ts +1 -1
  24. package/dist/permissions/ruleset.d.ts +1 -1
  25. package/dist/permissions/shell-structure.d.ts +1 -1
  26. package/dist/plugins/bundle.d.ts +4 -6
  27. package/dist/plugins/loader.corpus-fixture.d.ts +26 -0
  28. package/dist/plugins/loader.d.ts +3 -4
  29. package/dist/plugins/manifest.d.ts +23 -46
  30. package/dist/production-wiring.d.ts +1 -1
  31. package/dist/provider/lean-prompt.d.ts +1 -6
  32. package/dist/sandbox/profile.d.ts +39 -79
  33. package/dist/sandbox/spawn.d.ts +5 -6
  34. package/dist/skills/listing.d.ts +8 -26
  35. package/dist/skills/store.d.ts +2 -3
  36. package/dist/store/dialect.d.ts +1 -1
  37. package/dist/subagents/availability.d.ts +10 -8
  38. package/dist/subagents/child-handle.d.ts +5 -5
  39. package/dist/subagents/definitions.d.ts +7 -6
  40. package/dist/subagents/fork.d.ts +4 -8
  41. package/dist/subagents/notification-queue.d.ts +30 -38
  42. package/dist/testing.js +2 -2
  43. package/dist/tools/descriptors/web-fetch.d.ts +1 -1
  44. package/dist/tools/descriptors/web-search.d.ts +1 -1
  45. package/dist/tools/impl/_search-budget.d.ts +1 -1
  46. package/dist/tools/impl/_web-fetch-net.d.ts +6 -6
  47. package/dist/tools/impl/_web-search-assembler.d.ts +7 -20
  48. package/dist/tools/impl/background-task-runtime.d.ts +13 -13
  49. package/dist/tools/impl/bash.d.ts +3 -3
  50. package/dist/tools/impl/monitor.d.ts +2 -2
  51. package/dist/toolsearch/exposure.d.ts +3 -3
  52. package/dist/version.d.ts +1 -1
  53. package/dist/version.js +1 -1
  54. package/dist/web/fetchable-url.d.ts +1 -1
  55. package/dist/web/preapproved-hosts.d.ts +9 -31
  56. package/dist/workflows/store.d.ts +23 -31
  57. package/package.json +4 -4
@@ -36,22 +36,17 @@ export interface FilesystemCommandResolverOptions {
36
36
  plugins?: readonly PluginCommandContribution[] | undefined;
37
37
  skillOverrides?: SkillOverrides | undefined;
38
38
  }
39
- /**
40
- * `zE`, ported. `namedArgs` is `o` (see this section's header -- always `[]` from every call site in
41
- * this codebase today; no Winter frontmatter parser declares one yet).
42
- */
39
+ /** Expand `$ARGUMENTS`, `$ARGUMENTS[n]`, `$n`, `$<namedArg>` and `\$` escapes in a `/name args` body (args are appended when nothing matched). `namedArgs` is not yet wired from frontmatter (WS-21 follow-up). */
43
40
  export declare function substituteArguments(body: string, args: string, namedArgs?: readonly string[]): string;
44
41
  /**
45
42
  * The workflow-invoke-line substitution ONLY (fix round 7). `workflows/store.ts`'s
46
- * `buildWorkflowSkillPrompt` writes a static body whose invoke line embeds the raw args value INSIDE
47
- * its own hand-written quotes (`args: $ARGUMENTS_JSON`), and that value needs `"`/`\` escaping the
48
- * way claude's own `S(e)` does it -- dump-confirmed at `createWorkflowCommand`'s `getPromptForCommand`,
49
- * `a=e?\`{ name: ${i}, args: ${S(e)} }\`:...\`, and controller-confirmed `S` is `JSON.stringify`
50
- * (chunk export at dump ~269598). This function is DELIBERATELY SEPARATE from `substituteArguments`
51
- * (never merged into it again): only a synthetic, workflow-backed skill body should ever have
52
- * `$ARGUMENTS_JSON` recognised as a token at all; every other command/skill body must see claude's
53
- * plain single-token behaviour, `$ARGUMENTS_JSON` included -- since claude itself would leave that
54
- * text's `_JSON` suffix untouched.
43
+ * `buildWorkflowSkillPrompt` writes a static body whose invoke line carries the args as
44
+ * `args: $ARGUMENTS_JSON`, and that value must arrive as a JSON string literal (quotes and
45
+ * backslashes escaped) -- the same quoting claude uses for a workflow command's `args`. This function
46
+ * is DELIBERATELY SEPARATE from `substituteArguments` (never merged into it again): only a synthetic,
47
+ * workflow-backed skill body should ever have `$ARGUMENTS_JSON` recognised as a token at all; every
48
+ * other command/skill body gets the ordinary substitution, where `$ARGUMENTS_JSON` is just
49
+ * `$ARGUMENTS` followed by the literal text `_JSON`.
55
50
  *
56
51
  * A single left-to-right scan, not two `.split().join()` passes: `JSON.stringify(args)` can itself
57
52
  * contain the literal substring `$ARGUMENTS` (e.g. `args = "please pass $ARGUMENTS through"` stringifies
@@ -17,23 +17,19 @@ export interface AgentListingEntry {
17
17
  tools?: readonly string[];
18
18
  disallowedTools?: readonly string[];
19
19
  }
20
- /**
21
- * claude's `SSn`, exactly: both lists present -> `tools` minus the disallowed ones (`None` when that
22
- * leaves nothing); only `tools` -> `tools` joined (so `["*"]` renders `*`); only `disallowedTools` ->
23
- * `All tools except …` in DECLARED order; neither -> `All tools`.
24
- */
20
+ /** The `(Tools: ...)` text for one agent type. */
25
21
  export declare function renderAgentToolSpec(entry: Pick<AgentListingEntry, "tools" | "disallowedTools">): string;
26
- /** claude's `hrt`: `- <type>: <whenToUse> (Tools: <spec>)`. */
22
+ /** One listing line: `- <type>: <whenToUse> (Tools: <spec>)`. */
27
23
  export declare function renderAgentListingLine(entry: AgentListingEntry, leanModel?: boolean): string;
28
24
  export interface AgentListingDeltaOptions {
29
- /** claude's `Iu(mz(model))` -- whether the session's model takes the lean `whenToUse`. Another lane decides; `false` until then. */
25
+ /** Whether the session's model takes the lean `whenToUse`. Another lane decides; `false` until then. */
30
26
  leanModel?: boolean;
31
- /** claude's `plan !== "pro" && mode === "default"`. Winter has neither a plan tier nor a UI mode, so `true`. */
27
+ /** Whether the initial listing carries the concurrency sentence. Winter has neither a plan tier nor a UI mode, so `true`. */
32
28
  showConcurrencyNote?: boolean;
33
29
  }
34
30
  /**
35
- * claude's `s1t`: the `agent_listing_delta` attachment this history needs now, or `undefined` when
36
- * the available set equals what `history` already announced. `history` is the engine's own message
37
- * list, which after a compaction is already claude's post-boundary slice.
31
+ * The `agent_listing_delta` attachment this history needs now, or `undefined` when the available set
32
+ * equals what `history` already announced. `history` is the engine's own message list, which after a
33
+ * compaction is already the post-boundary slice.
38
34
  */
39
35
  export declare function computeAgentListingDelta(available: readonly AgentListingEntry[], history: readonly ProviderMessage[], opts?: AgentListingDeltaOptions): AgentListingDeltaAttachment | undefined;
@@ -8,7 +8,7 @@ export interface AttachmentPayload {
8
8
  type: string;
9
9
  [key: string]: unknown;
10
10
  }
11
- /** claude's `agent_listing_delta` (`s1t`): what the Agent tool can spawn, as a delta over what the history already announced. */
11
+ /** claude's `agent_listing_delta`: what the Agent tool can spawn, as a delta over what the history already announced. */
12
12
  export interface AgentListingDeltaAttachment extends AttachmentPayload {
13
13
  type: "agent_listing_delta";
14
14
  addedTypes: string[];
@@ -17,7 +17,7 @@ export interface AgentListingDeltaAttachment extends AttachmentPayload {
17
17
  isInitial: boolean;
18
18
  showConcurrencyNote: boolean;
19
19
  }
20
- /** claude's `skill_listing` (`Urn`): the skills not yet sent this session. `names` seeds the sent set on resume. */
20
+ /** claude's `skill_listing`: the skills not yet sent this session. `names` seeds the sent set on resume. */
21
21
  export interface SkillListingAttachment extends AttachmentPayload {
22
22
  type: "skill_listing";
23
23
  content: string;
@@ -25,7 +25,7 @@ export interface SkillListingAttachment extends AttachmentPayload {
25
25
  isInitial: boolean;
26
26
  names: string[];
27
27
  }
28
- /** claude's `date_change` (`alr`): the local date moved past the one the session's context was built with. */
28
+ /** claude's `date_change`: the local date moved past the one the session's context was built with. */
29
29
  export interface DateChangeAttachment extends AttachmentPayload {
30
30
  type: "date_change";
31
31
  newDate: string;
@@ -68,13 +68,13 @@ export interface DeferredToolsDeltaAttachment extends AttachmentPayload {
68
68
  addedLines: string[];
69
69
  removedNames: string[];
70
70
  }
71
- /** claude's own two headers for `deferred_tools_delta` (`utils/messages.ts`), verbatim. */
71
+ /** The two `deferred_tools_delta` headers (claude's interface text, unchanged). */
72
72
  export declare const DEFERRED_TOOLS_ADDED_HEADER = "The following deferred tools are now available via ToolSearch:";
73
73
  export declare const DEFERRED_TOOLS_REMOVED_HEADER = "The following deferred tools are no longer available (their MCP server disconnected). Do not search for them \u2014 ToolSearch will return no match:";
74
74
  export declare const AGENT_LISTING_INITIAL_HEADER = "Available agent types for the Agent tool:";
75
75
  export declare const AGENT_LISTING_ADDED_HEADER = "New agent types are now available for the Agent tool:";
76
76
  export declare const AGENT_LISTING_REMOVED_HEADER = "The following agent types are no longer available:";
77
- /** claude's `s$`: appended after a "no longer available" section. */
77
+ /** Appended after a "no longer available" section. */
78
78
  export declare const AMBIENT_CONTEXT_SENTENCE = "This is ambient context \u2014 do not narrate it to the user unless they ask or it is directly relevant to their request.";
79
79
  /** Appended to the INITIAL listing only, when `showConcurrencyNote` is set. */
80
80
  export declare const AGENT_CONCURRENCY_SENTENCE = "When you launch multiple agents for independent work, send them in a single message with multiple tool uses so they run concurrently.";
@@ -87,7 +87,7 @@ export declare function dateChangeText(newDate: string): string;
87
87
  * UI action (`set_permission_mode`) with no tool call at all -- without repeating that sentence.
88
88
  */
89
89
  export declare const PLAN_MODE_EXITED_TEXT = "Plan mode has ended. The write restriction is lifted.";
90
- /** claude's attachment wrapper (`Qa`). Nothing is added around it and nothing after it. */
90
+ /** The attachment wrapper. Nothing is added around it and nothing after it. */
91
91
  export declare function wrapSystemReminder(body: string): string;
92
92
  /** A renderer returns the UNWRAPPED body, or `undefined` when the attachment has nothing to say. */
93
93
  export type AttachmentRenderer = (attachment: AttachmentPayload) => string | undefined;
@@ -95,10 +95,8 @@ export type AttachmentRenderer = (attachment: AttachmentPayload) => string | und
95
95
  * SDK 0.0.16 Lane N: `wrap: false` for the ONE attachment family claude does not wrap. Its
96
96
  * `queued_command` attachments (a task notification delivered mid-turn) are rendered as a BARE user
97
97
  * text block carrying their own `[SYSTEM NOTIFICATION - NOT USER INPUT]` preamble instead of the
98
- * `<system-reminder>` envelope every other attachment type gets (traced in the pinned binary: the
99
- * queued-command branch of its request builder calls its origin-aware renderer directly, never the
100
- * reminder wrapper). Defaults to `true`, so every type registered before this option existed is
101
- * unchanged.
98
+ * `<system-reminder>` envelope every other attachment type gets (as claude's requests show them).
99
+ * Defaults to `true`, so every type registered before this option existed is unchanged.
102
100
  */
103
101
  export interface AttachmentRendererOptions {
104
102
  wrap?: boolean;
@@ -122,7 +120,7 @@ export declare function registerAttachmentRenderer(type: string, renderer: Attac
122
120
  /** WS-23: whether this attachment's renderer opted into the mid-conversation `system` role. */
123
121
  export declare function isSystemRoleAttachment(attachment: AttachmentPayload): boolean;
124
122
  /**
125
- * claude's fold for `deferred_tools_delta`: the deferred tool names the history has announced and not
123
+ * The fold for `deferred_tools_delta`: the deferred tool names the history has announced and not
126
124
  * since withdrawn. A delta's `addedNames` count only when it carries `addedLines` (as the agent fold).
127
125
  */
128
126
  export declare function announcedDeferredTools(messages: readonly ProviderMessage[]): Set<string>;
@@ -144,14 +142,11 @@ export declare function isAttachmentMessage(message: ProviderMessage): message i
144
142
  attachment: AttachmentPayload;
145
143
  };
146
144
  };
147
- /** Every attachment payload in `messages`, in order. The engine's history IS claude's post-compaction slice (`Ml`). */
145
+ /** Every attachment payload in `messages`, in order. The engine's history is already the post-compaction slice. */
148
146
  export declare function attachmentsIn(messages: readonly ProviderMessage[]): AttachmentPayload[];
149
- /**
150
- * claude's `s1t` fold: the agent types the history has already announced. A delta's `addedTypes`
151
- * count only when it carries an `addedLines` array (claude's own guard); `removedTypes` always remove.
152
- */
147
+ /** The agent types the history has already announced (and not since withdrawn). */
153
148
  export declare function announcedAgentTypes(messages: readonly ProviderMessage[]): Set<string>;
154
- /** claude's `alr` fold: whether a `date_change` for `date` is already in the history. */
149
+ /** Whether a `date_change` for `date` is already in the history. */
155
150
  export declare function dateChangeAnnounced(messages: readonly ProviderMessage[], date: string): boolean;
156
151
  /**
157
152
  * WS-24 (I-1): the last `plan_mode` attachment's state, or `"exited"` when none exists yet -- a
@@ -160,14 +155,10 @@ export declare function dateChangeAnnounced(messages: readonly ProviderMessage[]
160
155
  * since the history's own last word on it -- emitting only on a genuine difference, never every turn.
161
156
  */
162
157
  export declare function lastPlanModeState(messages: readonly ProviderMessage[]): "entered" | "exited";
163
- /**
164
- * claude's `vlr` resume seed for the skill listing: the names every persisted `skill_listing` sent,
165
- * and whether a legacy entry without `names` asks the next listing to be suppressed (claude's
166
- * `suppressNext`).
167
- */
158
+ /** The skill-listing resume seed: the names persisted listings already sent, and whether to suppress the next listing. */
168
159
  export declare function skillListingResumeSeed(messages: readonly ProviderMessage[]): {
169
160
  names: string[];
170
161
  suppressNext: boolean;
171
162
  };
172
- /** claude's `tcn`: the LOCAL calendar date, `YYYY-MM-DD`. */
163
+ /** The LOCAL calendar date, `YYYY-MM-DD`. */
173
164
  export declare function localDateString(now?: Date): string;
@@ -6,7 +6,7 @@ export interface EnvironmentInput {
6
6
  cwd: string;
7
7
  isGitRepo: boolean;
8
8
  platform: string;
9
- /** The raw `$SHELL` value; reduced to `zsh` / `bash` the way claude reduces it. */
9
+ /** The raw `$SHELL` value; reduced to `zsh` / `bash` (see `shellName`). */
10
10
  shell: string;
11
11
  /** `<os type> <os release>`, e.g. `Darwin 25.6.0`. */
12
12
  osVersion: string;
@@ -18,14 +18,14 @@ export interface EnvironmentInput {
18
18
  /** The model's knowledge cutoff, when known. Winter's catalog carries none today, so the line is normally absent. */
19
19
  knowledgeCutoff?: string;
20
20
  }
21
- /** claude's `GEe`: the shell as `zsh`, `bash`, the raw value, or `unknown`. */
21
+ /** The shell name shown on the ` - Shell:` line. */
22
22
  export declare function shellName(raw: string): string;
23
- /** The whole section for the system prompt's dynamic half (claude's `mHn`). */
23
+ /** The whole section for the system prompt's dynamic half. */
24
24
  export declare function renderEnvironmentSection(input: EnvironmentInput): string;
25
- /** `excludeDynamicSections`, static half (claude's `fHn`): the model and product lines only. */
25
+ /** `excludeDynamicSections`, static half: the model and product lines only. */
26
26
  export declare function renderStaticEnvironmentSection(input: Pick<EnvironmentInput, "model" | "modelDisplayName" | "knowledgeCutoff">): string;
27
27
  /**
28
- * `excludeDynamicSections`, userContext half (claude's `gHn` through `jEe`): the machine facts under
28
+ * `excludeDynamicSections`, userContext half: the machine facts under
29
29
  * the lead-in, WITHOUT the heading -- the heading's text becomes the userContext key `Environment`.
30
30
  */
31
31
  export declare function renderEnvironmentContextValue(input: EnvironmentInput): string;
@@ -0,0 +1,22 @@
1
+ export interface BranchShape {
2
+ /** `{ branch: name }` checks that (born) branch out; `"detached"` detaches HEAD at the commit; `"unborn"` leaves `trunk` with no commit. */
3
+ checkout: {
4
+ branch: string;
5
+ } | "detached" | "unborn";
6
+ /** Branch names that exist under `refs/remotes/origin/`. */
7
+ originBranches: string[];
8
+ /** Where `refs/remotes/origin/HEAD` points: absent = not set; otherwise the FULL ref it targets (it need not exist). */
9
+ originHead?: string;
10
+ }
11
+ export interface BranchRepo {
12
+ dir: string;
13
+ /** The environment to run `computeGitStatus` with (machine config neutralised). */
14
+ env: Record<string, string | undefined>;
15
+ }
16
+ /** Creates a repository in the given shape under `parent` (a fresh mkdtemp root when omitted). */
17
+ export declare function makeBranchRepo(shape: BranchShape, parent?: string): BranchRepo;
18
+ /** The two branch lines of a gitStatus value (`Current branch: ...`, `Main branch ...: ...`). */
19
+ export declare function branchLines(status: string | undefined): {
20
+ current: string | null;
21
+ main: string | null;
22
+ };
@@ -1,6 +1,6 @@
1
1
  /** Winter's snapshot caveat (claude's sentence says the same thing in its own words). */
2
2
  export declare const GIT_STATUS_CAVEAT = "This git status was captured when the session began; it is a snapshot and does not change as the conversation goes on.";
3
- /** claude's `hde`. */
3
+ /** Where the short status is cut. */
4
4
  export declare const GIT_STATUS_MAX_CHARS = 2000;
5
5
  /**
6
6
  * The `gitStatus` value for `cwd`, or `undefined` when there is none. Never throws. `env` is for
@@ -11,6 +11,6 @@ export declare function computeGitStatus(cwd: string, env?: Record<string, strin
11
11
  /**
12
12
  * The kill switch (claude's `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS`, Winter's `<PREFIX>DISABLE_GIT_INSTRUCTIONS`)
13
13
  * over the `includeGitInstructions` setting (default true). An explicit env value wins either way,
14
- * as claude's `VU` does: a truthy value disables, a falsy one ("0"/"false"/"no"/"off") enables.
14
+ * as claude's does: a truthy value disables, a falsy one ("0"/"false"/"no"/"off") enables.
15
15
  */
16
16
  export declare function gitInstructionsEnabled(envValue: string | undefined, includeGitInstructions: unknown): boolean;
@@ -24,5 +24,5 @@ export declare const AUTO_MEMORY_HEADING = "# auto memory";
24
24
  * nothing to recall but every reason to know it CAN save something.
25
25
  */
26
26
  export declare function renderAutoMemorySection(memoryDir: string, instructionsFile?: string): string;
27
- /** `excludeDynamicSections`: the same guidance as the userContext value under the key `auto memory` (claude's `jEe` strips the heading). */
27
+ /** `excludeDynamicSections`: the same guidance as the userContext value under the key `auto memory`, without its heading. */
28
28
  export declare function renderAutoMemoryContextValue(memoryDir: string, instructionsFile?: string): string;
@@ -32,8 +32,8 @@ export interface PluginOutputStyleSource {
32
32
  * Fix round 5: a manifest `outputStyles` override -- see `PluginBundle.outputStylesPaths`'s own
33
33
  * comment for why a real bundle never sets both this and `outputStylesPath` together (the override
34
34
  * SHADOWS the default directory at load time). Each entry may be a directory (scanned the same way
35
- * `outputStylesPath` is) or a single style file, matching claude's own `Tb`
36
- * (`requireDirectory:false` for `output-styles`, dump-confirmed).
35
+ * `outputStylesPath` is) or a single style file, as claude accepts either for a plugin's output
36
+ * styles.
37
37
  */
38
38
  outputStylesPaths?: readonly string[];
39
39
  }
@@ -3,18 +3,18 @@ import type { SystemPromptBlock } from "@yanlinglabs/winter-provider-runtime";
3
3
  /** One userContext / systemContext entry, in the order it is rendered. */
4
4
  export type ContextEntry = readonly [key: string, value: string];
5
5
  /**
6
- * claude's `mbt` text for a userContext map, or `undefined` when the map is empty (claude then
7
- * prepends nothing). Exactly one trailing newline; the second one the wire shows comes from the
8
- * merge with the prompt (`Noe`).
6
+ * The index-0 context text for a userContext map, or `undefined` when the map is empty (nothing is
7
+ * then prepended). Exactly one trailing newline; the second one the wire shows comes from the merge
8
+ * with the prompt.
9
9
  */
10
10
  export declare function renderUserContext(entries: readonly ContextEntry[]): string | undefined;
11
- /** claude's `pbt` systemContext part: `key: value` lines. `undefined` when there are none. */
11
+ /** The systemContext part: `key: value` lines. `undefined` when there are none. */
12
12
  export declare function renderSystemContext(entries: readonly ContextEntry[]): string | undefined;
13
13
  /**
14
- * claude's `VEe` for Winter's two halves. With a dynamic boundary (Winter's authored prompt, the
14
+ * The cache-block split for Winter's two halves. With a dynamic boundary (Winter's authored prompt, the
15
15
  * preset, or a caller array that names one) the static half is one `global` block and the dynamic
16
16
  * half -- systemContext appended last -- one `org` block. Without a boundary (a caller string, or a
17
- * caller array with none) everything is one `org` block. Empty parts are dropped (`filter(Boolean)`).
17
+ * caller array with none) everything is one `org` block. Empty parts are dropped.
18
18
  */
19
19
  export declare function buildSystemBlocks(input: {
20
20
  staticParts: readonly string[];
@@ -25,15 +25,14 @@ export declare function buildSystemBlocks(input: {
25
25
  /** The `system` string equivalent of a block list (what a block-unaware provider receives). */
26
26
  export declare function joinSystemBlocks(blocks: readonly SystemPromptBlock[]): string;
27
27
  /**
28
- * claude's `SJn` (reorderAttachmentsForAPI). WS-23: `stays` names attachments that keep their HISTORY
29
- * position instead of bubbling up -- a system-role reminder must follow the user turn that triggered
30
- * it, which is exactly where the engine appended it.
28
+ * Moves attachment messages up the history (see the module header). WS-23: `stays` names attachments
29
+ * that keep their HISTORY position instead of moving -- a system-role reminder must follow the user
30
+ * turn that triggered it, which is exactly where the engine appended it.
31
31
  */
32
32
  export declare function reorderAttachments(messages: readonly ProviderMessage[], stays?: (message: ProviderMessage) => boolean): ProviderMessage[];
33
33
  /**
34
- * claude's `NMe`: a reminder that must never be folded into a tool result (its poll-event
35
- * deliveries). Ported literally; Winter produces neither prefix today, so this only keeps a
36
- * claude-written transcript's shape intact on resume.
34
+ * A reminder that must never be folded into a tool result (event deliveries). Winter produces
35
+ * neither prefix today; this only keeps a claude-written transcript's shape intact on resume.
37
36
  */
38
37
  export declare function isSmooshExempt(text: string): boolean;
39
38
  type ToolResultBlock = Extract<ContentBlock, {
@@ -43,13 +42,13 @@ type TextBlock = Extract<ContentBlock, {
43
42
  type: "text";
44
43
  }>;
45
44
  /**
46
- * claude's `IMe`: fold trailing text blocks INTO a tool result. `null` when the result carries a
47
- * `tool_reference` (claude refuses to fold into those).
45
+ * Folds trailing text blocks INTO a tool result. `null` when the result cannot take them (it carries
46
+ * a `tool_reference`, or -- WS-23 -- it loaded tools).
48
47
  */
49
48
  export declare function foldTextIntoToolResult(result: ToolResultBlock, texts: TextBlock[]): ToolResultBlock | null;
50
49
  /**
51
50
  * The live request's message list: `history` with the index-0 context prepended, attachments
52
- * reordered and consecutive user-role messages merged, exactly as the pinned binary builds it.
51
+ * reordered and consecutive user-role messages merged, in the layout claude's requests have.
53
52
  * Never mutates `history`. Assistant messages pass through untouched (their own merge is the
54
53
  * adapters' business, as before).
55
54
  */
@@ -131,8 +130,8 @@ export declare function registerSessionContextReload(sessionId: string, agentId:
131
130
  export declare function unregisterSessionContextReload(sessionId: string, agentId?: string): void;
132
131
  /**
133
132
  * EXPLICIT RELOAD: drop a live session's memoized userContext/systemContext so its next request
134
- * re-reads the instructions files, the memory index and the git snapshot (claude does the same on a
135
- * `reload_claude_md`-style request). `false` when no such session is running.
133
+ * re-reads the instructions files, the memory index and the git snapshot (claude re-reads them on an
134
+ * explicit reload too). `false` when no such session is running.
136
135
  */
137
136
  export declare function reloadSessionContext(sessionId: string, agentId?: string): boolean;
138
137
  export {};
@@ -64,12 +64,13 @@ export interface SystemPromptInput {
64
64
  */
65
65
  agentPrompt?: string;
66
66
  /**
67
- * Spawn-surface parity (research §A1's `Explore`/`Plan` field table: "`omitClaudeMd: true`;
68
- * context also drops gitStatus", mirrored on `RuntimeAgentDefinition.omitProjectContext`). When
69
- * true, the index-0 userContext carries NO `claudeMd` entry at all (claude's `omitClaudeMd` drops the
70
- * whole value -- the auto-memory index is one of its entries, so it goes too) and the systemContext
71
- * `gitStatus` is not produced (`systemContextPlacement: "none"`). Everything else -- the date, the
72
- * environment and auto-memory sections, the listings -- is unaffected.
67
+ * Spawn-surface parity (research §A1's `Explore`/`Plan` field table: neither agent gets the
68
+ * instructions files, and their context also drops gitStatus; mirrored on
69
+ * `RuntimeAgentDefinition.omitProjectContext`). When true, the index-0 userContext carries NO
70
+ * `claudeMd` entry at all (the whole value goes -- the auto-memory index is one of its entries, so
71
+ * it goes too) and the systemContext `gitStatus` is not produced (`systemContextPlacement:
72
+ * "none"`). Everything else -- the date, the environment and auto-memory sections, the listings --
73
+ * is unaffected.
73
74
  */
74
75
  omitProjectContext?: boolean;
75
76
  }
@@ -1,4 +1,4 @@
1
- import"./index-z9yngxj4.js";
1
+ import"./index-kqc3tdph.js";
2
2
  import {
3
3
  liveProcessGroups,
4
4
  onProcessGroupChange
@@ -6,10 +6,10 @@ import {
6
6
  import"./index-mwew595z.js";
7
7
  import"./index-2wgfv0pa.js";
8
8
  import"./index-bef62z3r.js";
9
- import"./index-hdvvezf8.js";
9
+ import"./index-bh1ve8ws.js";
10
10
  import {
11
11
  runEmbeddedSession2
12
- } from "./index-ey5c52j3.js";
12
+ } from "./index-14xkt4jp.js";
13
13
  import {
14
14
  Queue
15
15
  } from "./index-97t2rmtf.js";
package/dist/embedded.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  runEmbeddedSession2
3
- } from "./index-ey5c52j3.js";
4
- import"./index-hdvvezf8.js";
5
- import"./index-z9yngxj4.js";
3
+ } from "./index-14xkt4jp.js";
4
+ import"./index-bh1ve8ws.js";
5
+ import"./index-kqc3tdph.js";
6
6
  import"./index-2wgfv0pa.js";
7
7
  import"./index-bef62z3r.js";
8
8
  import"./index-1hef2gff.js";
package/dist/engine.d.ts CHANGED
@@ -143,7 +143,7 @@ export interface ProviderMessage {
143
143
  attachment: AttachmentPayload;
144
144
  };
145
145
  /**
146
- * 0.0.16 request layout: the per-request userContext message (claude's `mbt`) at INDEX 0 of the
146
+ * 0.0.16 request layout: the per-request userContext message (as claude sends it) at INDEX 0 of the
147
147
  * live request. Never in the engine's history and never persisted; it only appears on an outbound
148
148
  * request whose first history message it could not be merged into (context/request-layout.ts).
149
149
  */
@@ -1110,8 +1110,8 @@ export interface EngineOptions {
1110
1110
  * resolution path that could disagree with the session's own.
1111
1111
  *
1112
1112
  * `supportedModels` answers the pinned payload-free `list_models` control request
1113
- * (`sdk.d.ts:3855`), whose own JSDoc frames it as "ask the worker" — a table inside the binary, per
1114
- * capture (J), never a `/v1/models` fetch. Absent -> the handler answers an empty array, which is
1113
+ * (`sdk.d.ts:3855`), whose own JSDoc frames it as "ask the worker" — answered locally, with no
1114
+ * `/v1/models` request on the wire (capture (J)). Absent -> the handler answers an empty array, which is
1115
1115
  * the honest answer for a session running a scripted double.
1116
1116
  */
1117
1117
  supportedModels?: () => unknown[];
@@ -9,14 +9,14 @@ import {
9
9
  resolveEngineSession2,
10
10
  resolveProductionWinterHome2,
11
11
  resolveProductionStoreHome
12
- } from "./index-z9yngxj4.js";
12
+ } from "./index-kqc3tdph.js";
13
13
  import {
14
14
  registerDefaultChildEngineFactory,
15
15
  loadResumedChain,
16
16
  buildProductionWiring,
17
17
  withAutoSkillPermissions,
18
18
  restoreChildRoster
19
- } from "./index-hdvvezf8.js";
19
+ } from "./index-bh1ve8ws.js";
20
20
 
21
21
  // src/embedded.ts
22
22
  import { splitFrames, encodeFrame } from "@yanlinglabs/winter-agent-sdk";