@yanlinglabs/winter-agent-runtime 0.0.41 → 0.0.44

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 (60) 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 +29 -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-host.js +1 -1
  12. package/dist/embedded-worker.js +4 -4
  13. package/dist/embedded.js +3 -3
  14. package/dist/engine.d.ts +3 -3
  15. package/dist/{index-97t2rmtf.js → index-dne3dw18.js} +11 -0
  16. package/dist/{index-z9yngxj4.js → index-hbkdq3xs.js} +1072 -827
  17. package/dist/{index-hdvvezf8.js → index-r1pter2v.js} +239 -155
  18. package/dist/{index-ey5c52j3.js → index-x7hdare6.js} +2 -2
  19. package/dist/index.js +2 -2
  20. package/dist/mcp/lifecycle.d.ts +2 -1
  21. package/dist/permissions/edit-recognition.d.ts +1 -1
  22. package/dist/permissions/evaluator.d.ts +19 -30
  23. package/dist/permissions/file-rules.d.ts +177 -277
  24. package/dist/permissions/grammar.d.ts +58 -0
  25. package/dist/permissions/policy-state.d.ts +1 -1
  26. package/dist/permissions/ruleset.d.ts +1 -1
  27. package/dist/permissions/shell-structure.d.ts +1 -1
  28. package/dist/plugins/bundle.d.ts +4 -6
  29. package/dist/plugins/loader.corpus-fixture.d.ts +26 -0
  30. package/dist/plugins/loader.d.ts +3 -4
  31. package/dist/plugins/manifest.d.ts +23 -46
  32. package/dist/production-wiring.d.ts +1 -1
  33. package/dist/protocol/channel.d.ts +6 -0
  34. package/dist/provider/lean-prompt.d.ts +1 -6
  35. package/dist/sandbox/profile.d.ts +39 -79
  36. package/dist/sandbox/spawn.d.ts +5 -6
  37. package/dist/skills/listing.d.ts +8 -26
  38. package/dist/skills/store.d.ts +2 -3
  39. package/dist/store/dialect.d.ts +1 -1
  40. package/dist/subagents/availability.d.ts +10 -8
  41. package/dist/subagents/child-handle.d.ts +5 -5
  42. package/dist/subagents/definitions.d.ts +7 -6
  43. package/dist/subagents/fork.d.ts +4 -8
  44. package/dist/subagents/notification-queue.d.ts +30 -38
  45. package/dist/testing.js +3 -3
  46. package/dist/tools/descriptors/web-fetch.d.ts +1 -1
  47. package/dist/tools/descriptors/web-search.d.ts +1 -1
  48. package/dist/tools/impl/_search-budget.d.ts +1 -1
  49. package/dist/tools/impl/_web-fetch-net.d.ts +6 -6
  50. package/dist/tools/impl/_web-search-assembler.d.ts +7 -20
  51. package/dist/tools/impl/background-task-runtime.d.ts +13 -13
  52. package/dist/tools/impl/bash.d.ts +3 -3
  53. package/dist/tools/impl/monitor.d.ts +2 -2
  54. package/dist/toolsearch/exposure.d.ts +3 -3
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.js +1 -1
  57. package/dist/web/fetchable-url.d.ts +1 -1
  58. package/dist/web/preapproved-hosts.d.ts +9 -31
  59. package/dist/workflows/store.d.ts +23 -31
  60. package/package.json +4 -4
@@ -1,15 +1,6 @@
1
- /**
2
- * The 92 literals exactly as they appear in `c7t`'s source order (duplicate `learn.microsoft.com`
3
- * included) -- kept verbatim so a future re-extraction diffs cleanly against this array.
4
- */
1
+ /** The 92 entries, duplicate `learn.microsoft.com` included. */
5
2
  export declare const PREAPPROVED_HOST_ENTRIES: readonly string[];
6
- /**
7
- * `wX(hostname, pathname)`, verbatim: an EXACT hostname match (no subdomains) against the
8
- * hostname-only half, OR a hostname with a registered path prefix whose pathname is that prefix or a
9
- * `/`-bounded child of it -- rejected outright when the raw pathname contains an encoded slash,
10
- * backslash or dot (`%2f`, `%5c`, `%2e`, doubly-encoded or not), which is exactly the traversal class
11
- * that would otherwise let `/docs%2f..%2fadmin` read as a legitimate child of `/docs`.
12
- */
3
+ /** Whether `hostname` + `pathname` (raw strings) fall under a preapproved entry. */
13
4
  export declare function isPreapprovedHost(hostname: string, pathname: string): boolean;
14
5
  /** `isPreapprovedHost`, taking the URL directly. A URL that fails to parse is never preapproved. */
15
6
  export declare function isPreapprovedUrl(url: URL): boolean;
@@ -24,29 +15,16 @@ export interface PreapprovedMatch {
24
15
  pathPrefix?: string;
25
16
  }
26
17
  /**
27
- * Security review round 2, minor: this was EXACT-hostname-only, while `staysWithinScope` (below)
28
- * already applied the three-way `[host, stripped, "www."+stripped]` match -- half of one fix. The
29
- * gap is not cosmetic: a redirect chain `claude.com/docs/a` -> `www.claude.com/docs/a` (eligible,
30
- * `staysWithinScope` says so) -> `www.claude.com/other` recomputes THIS function fresh at the top of
31
- * the SECOND hop, on hostname `www.claude.com` -- which `PATH_PREFIXES` only ever keys by
32
- * `claude.com`, so the old exact match returned `undefined` for it. An `undefined` scope makes
33
- * `isEligibleAutoFollow`'s own `scope !== undefined && ...` check SHORT-CIRCUIT to "no restriction
34
- * at all," so the THIRD hop (genuinely outside `/docs`) was auto-followed, not refused -- and because
35
- * `claude.com/docs/a` (the ORIGINAL input URL) is still preapproved, that off-scope content got
36
- * permissive guidelines and was eligible for the verbatim markdown passthrough. Matching hosts the
37
- * same three-way way `staysWithinScope` does closes it: hop 2 now still resolves a scope (matched via
38
- * the `claude.com` entry), and `staysWithinScope` correctly refuses hop 3's `/other` path.
18
+ * The preapproved scope `url` falls under, matching its host, that host without a leading `www.`,
19
+ * and that stripped form with `www.` re-added (security review round 2: an exact-host-only match let
20
+ * a redirect chain `claude.com/docs/a` -> `www.claude.com/docs/a` -> `www.claude.com/other` lose its
21
+ * scope at the second hop, so the third, off-scope hop was auto-followed).
39
22
  */
40
23
  export declare function preapprovedScopeOf(url: URL): PreapprovedMatch | undefined;
41
24
  /**
42
25
  * Whether `url` still falls under the SAME preapproved scope `from` matched -- used by the redirect
43
- * walk's "not leaving a preapproved path scope" gate.
44
- *
45
- * HOST comparison is the same three-way test claude's own code runs (security review corrections
46
- * §4.8, measured): `[host, stripped, "www."+stripped]`, i.e. the scope's own host, that host with a
47
- * leading `www.` stripped, and that stripped form with `www.` re-added -- so a scope matched on
48
- * `claude.com/docs` still covers a redirect to `www.claude.com/docs/x`, and one matched on
49
- * `www.example.com/docs` still covers a redirect to `example.com/docs/x`. An EXACT match only (this
50
- * lane's earlier version) refused a same-site www-variant redirect claude itself follows.
26
+ * walk's "not leaving a preapproved path scope" gate. The host may be the scope's own host, that host
27
+ * without a leading `www.`, or that with `www.` re-added (claude follows a same-site www-variant
28
+ * redirect -- security review corrections §4.8).
51
29
  */
52
30
  export declare function staysWithinScope(from: PreapprovedMatch, url: URL): boolean;
@@ -86,42 +86,37 @@ export interface WorkflowListingEntry {
86
86
  source: "project" | "user" | "plugin";
87
87
  /** The script's real filesystem path -- carried through so a caller building a `SkillMeta`-shaped synthetic entry (production-wiring.ts) never has to invent one. */
88
88
  path: string;
89
- /** Fix round 4 (I-E): carried through for a synthetic skill/command prompt's own structure -- claude's own `m()` includes both alongside name/description. */
89
+ /** Fix round 4 (I-E): carried through for a synthetic skill/command prompt's own structure -- claude's workflow command carries both alongside name/description. */
90
90
  whenToUse?: string;
91
91
  phases?: WorkflowMetaPhase[];
92
92
  }
93
93
  /**
94
- * SV-5 (batch-2, second round, extended in fix round 3) -- the router same-view test: the pinned
95
- * binary lists EVERY discovered workflow (user + project + plugin; built-in excluded, the pinned
96
- * binary's own `d()`/`Ru()` gate that separately and Winter ships none -- see `BUILTIN_WORKFLOWS`)
97
- * in the init `skills`/`slash_commands` fields and the model-facing Skill listing, named
98
- * `<plugin>:<meta.name>` for a plugin workflow or bare `<meta.name>` for a user/project one --
99
- * `getWorkflowCommands` in the pinned binary's own workflow-discovery module maps its FULL discovery
100
- * result through a `{type:"prompt", name: o.name, description: o.description, ...}` projection,
101
- * `o.name` already being the qualified/bare identity discovery assigned. `production-wiring.ts` is
102
- * the one caller, folding this into all three listing surfaces.
94
+ * SV-5 (batch-2, second round, extended in fix round 3) -- the router same-view test: claude lists
95
+ * EVERY discovered workflow (user + project + plugin; built-ins are handled separately, and Winter
96
+ * ships none -- see `BUILTIN_WORKFLOWS`) in the init `skills`/`slash_commands` fields and the
97
+ * model-facing Skill listing, as a prompt-type command named `<plugin>:<meta.name>` for a plugin
98
+ * workflow or bare `<meta.name>` for a user/project one, with the workflow's description.
99
+ * `production-wiring.ts` is the one caller, folding this into all three listing surfaces.
103
100
  *
104
- * ORDER matches claude's own final merge in `j()`/`QX()`: plugin entries first (builtins would lead,
105
- * but Winter has none to list), then user+project merged and name-sorted -- a project entry
106
- * overriding a user entry of the same name the same way resolution above does, so listing and
107
- * resolution can never disagree about which tier's copy is "the" workflow of that name.
101
+ * ORDER matches claude's listing: plugin entries first (builtins would lead, but Winter has none to
102
+ * list), then user+project merged and name-sorted -- a project entry overriding a user entry of the
103
+ * same name the same way resolution above does, so listing and resolution can never disagree about
104
+ * which tier's copy is "the" workflow of that name.
108
105
  */
109
106
  export declare function listWorkflowsForListing(opts: WorkflowDiscoveryOptions): WorkflowListingEntry[];
110
107
  /**
111
- * Fix round 4 (I-E, the router same-view test): claude's own `m()` (dump-confirmed) turns every
112
- * discovered workflow into a `{type:"prompt", kind:"workflow", ...}` command whose PROMPT runs the
113
- * named workflow and carries the description, `whenToUse` and phases, ending with an instruction to
114
- * invoke the Workflow tool by name. `SkillMeta` has no dedicated "workflow" shape, so this builds the
108
+ * Fix round 4 (I-E, the router same-view test): claude offers every discovered workflow as a
109
+ * prompt-type command whose PROMPT runs the named workflow and carries the description, `whenToUse`
110
+ * and phases, ending with an instruction to invoke the Workflow tool by name. `SkillMeta` has no dedicated "workflow" shape, so this builds the
115
111
  * BODY TEXT `SkillIndex`'s own synthetic-entry seam (`SkillIndexOptions.syntheticSkills`) stores for
116
112
  * `Skill("<name>")` to return -- the WS-11 §2.3 contract ("invocation inserts the resolved skill
117
113
  * instructions into the main conversation") applied to a workflow instead of a SKILL.md body.
118
114
  *
119
115
  * THE PROMPT TEXT IS WINTER-AUTHORED, per the user's own ruling that prompts stay Winter's own
120
116
  * wording while INTERFACE strings (a field name, a listing label, an error message) may ship
121
- * verbatim from the pinned binary -- this is prompt content the model reads and acts on, not an
122
- * interface string, so it is worded fresh here rather than reproduced from the dump. The
123
- * STRUCTURE claude's own `m()` carries (name, description, `whenToUse`, phases, then the invoke
124
- * instruction) is preserved; the wording is not claude's.
117
+ * verbatim -- this is prompt content the model reads and acts on, not an interface string, so it is
118
+ * worded fresh here. The prompt carries name, description, `whenToUse`, phases, then the invoke
119
+ * instruction; the wording is Winter's own.
125
120
  *
126
121
  * Fix round 5 (promoted minor, the re-review of 57e7fef..20b623e): `/plugin:name some args` must
127
122
  * carry `some args` into the invoke line as `Workflow({ name, args })`, matching claude. This
@@ -136,15 +131,12 @@ export declare function listWorkflowsForListing(opts: WorkflowDiscoveryOptions):
136
131
  * a bare `/name` with nothing after it, where the tokens substitute to `""`/`'""'`) recognises it
137
132
  * does not apply and falls back to the first, unconditional line instead.
138
133
  *
139
- * Fix round 6 (a promoted minor, the re-review against the pinned 2.1.250 dump): the args value must
140
- * be ESCAPED the way claude's own `S(e)` does, matching `createWorkflowCommand`'s
141
- * `getPromptForCommand` (dump-confirmed: `a=e?\`{ name: ${i}, args: ${S(e)} }\`:...\`, i=S(o.name)`
142
- * -- inferred to be JSON-string-quoting from the call-site shape: applied to a plain, always-defined
143
- * string, used with no additional quotes around it). Using the RAW `$ARGUMENTS` token inside
144
- * hand-written quotes (round 5's own shape) would let a literal `"` or `\` in the typed args break
145
- * out of the quoted literal. `$ARGUMENTS_JSON` (`commands/resolver.ts`'s new second token) substitutes
146
- * with `JSON.stringify(args)` instead -- already quoted and escaped -- so this line writes NO quotes
147
- * of its own around it.
134
+ * Fix round 6 (a promoted minor): the args value must arrive as a JSON string literal (quoted,
135
+ * with `"` and `\` escaped), as claude passes a workflow command's args. Using the RAW `$ARGUMENTS`
136
+ * token inside hand-written quotes (round 5's own shape) would let a literal `"` or `\` in the typed
137
+ * args break out of the quoted literal. `$ARGUMENTS_JSON` (`commands/resolver.ts`'s new second
138
+ * token) substitutes with `JSON.stringify(args)` instead -- already quoted and escaped -- so this
139
+ * line writes NO quotes of its own around it.
148
140
  */
149
141
  export declare function buildWorkflowSkillPrompt(entry: WorkflowListingEntry): string;
150
142
  export interface SessionScriptLocation {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yanlinglabs/winter-agent-runtime",
3
- "version": "0.0.41",
3
+ "version": "0.0.44",
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.41",
77
- "@yanlinglabs/winter-provider-catalog": "0.0.41",
78
- "@yanlinglabs/winter-provider-runtime": "0.0.41"
76
+ "@yanlinglabs/winter-agent-sdk": "0.0.44",
77
+ "@yanlinglabs/winter-provider-catalog": "0.0.44",
78
+ "@yanlinglabs/winter-provider-runtime": "0.0.44"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@modelcontextprotocol/server": "^2.1.0"