@yanlinglabs/winter-runtime-sdk 0.0.2 → 0.0.4
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 +11 -2
- package/dist/door.d.ts +23 -6
- package/dist/index-294jzb3e.js +1434 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +62 -1328
- package/dist/official/auth.d.ts +11 -0
- package/dist/selection/runtime-selection.d.ts +12 -1
- package/dist/testing/capture-env.d.ts +41 -0
- package/dist/testing/hermetic.d.ts +33 -0
- package/dist/testing/host.d.ts +5 -0
- package/dist/testing/host.js +139 -0
- package/dist/testing/peers.d.ts +45 -0
- package/package.json +14 -2
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Decision record: WS-00 D19 (2026-09-05). Boundaries that do not move:
|
|
|
25
25
|
official runtime and no SDK is ever instantiated twice.
|
|
26
26
|
- A `brand` profile flows through unchanged (Winter defaults); Claude Code's own literals stay fixed.
|
|
27
27
|
|
|
28
|
-
Status: Phase 7b landed all four lanes and routed the door; `0.0.2`
|
|
28
|
+
Status: Phase 7b landed all four lanes and routed the door; `0.0.2` was the Phase-8b prerequisite
|
|
29
29
|
release. The spine (the package scaffold, the contract re-export, the `createRuntimeSdk` constructor
|
|
30
30
|
with its version matrix, the seams, the test harness and CI) and the four lanes behind those seams —
|
|
31
31
|
the official-SDK adapter, the runtime directory and messaging router, the store wiring and handoff
|
|
@@ -33,7 +33,16 @@ barrier, and runtime selection — are on `main`, with WS-17's eighteen router-o
|
|
|
33
33
|
cited in `docs/conformance-rows.md`. See `docs/architecture.md` for the ownership map, the pinned
|
|
34
34
|
interfaces and how this package consumes the Winter SDK.
|
|
35
35
|
|
|
36
|
-
**What `0.0.
|
|
36
|
+
**What `0.0.3` changes** (P8c-13 — the official-leg HOST SURFACE, so a host can bridge its own
|
|
37
|
+
approval broker and materialize MCP servers; no peer floor change):
|
|
38
|
+
|
|
39
|
+
| | |
|
|
40
|
+
|---|---|
|
|
41
|
+
| root exports | `createApprovalBridge`/`isOurApprovalBridge` (+ `ApprovalBroker`/`ApprovalRequest`/`ApprovalBridgeOptions`/`DecisionSource`/`OfficialPermissionMode`/`OfficialApprovalBridge`), `materializeOfficialMcpServer`/`officialMcpServers`/`winterMcpServerDescriptor`/`canonicalToolNames`/`OFFICIAL_MATERIALIZATION_DROPS` (+ their descriptor/schema types), `minimalOsEnvironmentFrom`/`buildOfficialChildEnv` (+ env-policy types), the containment/auth/options-template types, `containmentDispositions`/`officialDisallowedTools`, `officialBranchLabel`/`OFFICIAL_DISCLOSURES`, and `renderAttributedTurn` — all previously reachable only through `./official/index.ts`, a test-only import site. `buildOfficialOptions` uses `policy.canUseTool` verbatim and `assertOptionsInvariants` refuses anything not built by `createApprovalBridge`, so without this a host's every official-leg tool call was denied by the fail-closed default. The spawn-proxy/adapter internals (`createSupervisedSpawnProxy`, `createOfficialAdapter`, …) stay OUT — their declaration graph pulls Node-only types into a consumer that never asked for them; the door reaches the adapter through the seam, not through a root import. |
|
|
42
|
+
| `./testing` subpath | `createFakeKeychain`, `withHermeticHomes`, `withTempDir`, `createFakeClaudePeer`, `createFakeWinterPeer`, `HERMETIC_TRAFFIC_OPT_OUTS`, `officialCaptureEnv` — a NARROW barrel (`src/testing/host.ts`) that resolves neither `@yanlinglabs/winter-conformance` nor `@yanlinglabs/winter-provider-conformance`, so a host writing its own approval-bridge/MCP fixtures does not have to install either. The loopback fakes (`anthropicFake`, `openaiResponsesFake`, `requestsTo`, `withLoopbackFake`) and the golden-trace tooling stay on the internal, unpublished `./index.ts` barrel this repository's own tests use by relative path — a dynamic `import()` fixes their RUNTIME load without the peer, but not their TYPES, which still name it. |
|
|
43
|
+
| root exports (types only) | `HandoffParticipants`, `HandoffSourceOwner`, `HandoffDestinationRuntime`, `HandoffResumeTarget`, `HandoffStepReport`, `HandoffOwnerHealth`, `HandoffEligibilityLike`, `DetailedHandoffOutcome`, `HandoffBarrierDeps`, `HandoffSelection`, and `MaterializedResumeDecoratorHandle` (`HandoffBarrierDeps.decorator`'s type) — the data shapes a host actually renders a handoff plan/outcome from, not just `HandoffBarrier`/`HandoffOutcome`/`HandoffPlan` (already reachable via the seams). Pure interfaces: none pulls a `node:*` specifier into the declaration graph. |
|
|
44
|
+
|
|
45
|
+
**What `0.0.2` changed** (peer floor: `@yanlinglabs/winter-agent-sdk >=0.0.3 <0.1.0`):
|
|
37
46
|
|
|
38
47
|
| | |
|
|
39
48
|
|---|---|
|
package/dist/door.d.ts
CHANGED
|
@@ -68,11 +68,13 @@ export interface RouterOfficialInput {
|
|
|
68
68
|
*/
|
|
69
69
|
credentials?: readonly AuthCredentialPlan[];
|
|
70
70
|
/**
|
|
71
|
-
* NON-SECRET family variables: a gateway's `ANTHROPIC_BASE_URL`, a region, a project
|
|
71
|
+
* NON-SECRET family variables: a gateway's `ANTHROPIC_BASE_URL`, a region, a project, or (router
|
|
72
|
+
* 0.0.4, C1) a `console-profile` session's `ANTHROPIC_PROFILE` name and `ANTHROPIC_CONFIG_DIR` path.
|
|
72
73
|
*
|
|
73
74
|
* Separate from `credentials` because they are not secrets and must not travel through a keychain
|
|
74
75
|
* read — and because §12's gateway caveat ("set the full credential pair or neither") is checked
|
|
75
|
-
* across both halves by the auth validator, whichever side each variable came from.
|
|
76
|
+
* across both halves by the auth validator, whichever side each variable came from. The same shape
|
|
77
|
+
* applies to `console-profile`'s pairing rule: set both names here or neither.
|
|
76
78
|
*/
|
|
77
79
|
connectionEnv?: Readonly<Record<string, string>>;
|
|
78
80
|
/** §3's minimal OS set. Build it with `minimalOsEnvironmentFrom(process.env)` at the host's call site. */
|
|
@@ -273,16 +275,31 @@ export declare function officialUserTurn(text: string, sessionId: string): Offic
|
|
|
273
275
|
* DERIVED ONLY WHERE THE MAPPING IS UNAMBIGUOUS. `api-key` is one variable; `console-oauth` is a
|
|
274
276
|
* bearer token whose endpoint is non-secret and travels in `connectionEnv` (§12's "gateway configs
|
|
275
277
|
* MUST set the full credential pair" is then checked by the auth validator, across both halves). The
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
278
|
+
* three families that inject nothing (`claude-oauth`, `local-none`, and router 0.0.4's
|
|
279
|
+
* `console-profile` — its `ANTHROPIC_PROFILE`/`ANTHROPIC_CONFIG_DIR` pair are non-secret and travel in
|
|
280
|
+
* `connectionEnv` exactly like `console-oauth`'s base URL, never through a keychain-backed plan)
|
|
281
|
+
* inject nothing. A cloud credential chain and a `custom` family name their own variables, because
|
|
282
|
+
* their sets are the host's: a chain's variables depend on which of Bedrock's or Vertex's several auth
|
|
283
|
+
* modes the deployment uses, and `custom` is open by definition.
|
|
279
284
|
*/
|
|
280
285
|
export declare function officialCredentialPlan(args: {
|
|
281
286
|
selection: RuntimeSelection;
|
|
282
287
|
provider: ProviderSelection | undefined;
|
|
283
288
|
explicit: readonly AuthCredentialPlan[] | undefined;
|
|
284
289
|
}): readonly AuthCredentialPlan[];
|
|
285
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Non-secret connection variables a family sets, from the contract's own `ProviderConnectionConfig`
|
|
292
|
+
* plus whatever the host names in `RouterOfficialInput.connectionEnv`.
|
|
293
|
+
*
|
|
294
|
+
* ROUTER 0.0.4, C1: `console-profile`'s `ANTHROPIC_PROFILE` and `ANTHROPIC_CONFIG_DIR` have no
|
|
295
|
+
* counterpart on `ProviderConnectionConfig` (that shape carries only `baseUrl`, a pinned contract type
|
|
296
|
+
* this package does not extend) and are non-secret by the same reasoning `ANTHROPIC_BASE_URL` is, so a
|
|
297
|
+
* host sets them the identical way — `connectionEnv: { ANTHROPIC_PROFILE, ANTHROPIC_CONFIG_DIR }` —
|
|
298
|
+
* and they ride through `explicit` here unchanged, exactly like any other family's non-secret pair.
|
|
299
|
+
* No family-specific derivation is needed for them the way `console-oauth`'s base URL gets one below,
|
|
300
|
+
* because the host already has both values in hand (a profile name, a directory it manages) and there
|
|
301
|
+
* is no `ProviderSelection` field to read them from instead.
|
|
302
|
+
*/
|
|
286
303
|
export declare function officialConnectionEnv(args: {
|
|
287
304
|
selection: RuntimeSelection;
|
|
288
305
|
provider: ProviderSelection | undefined;
|