@silverprotocol/claude-agent-sdk 0.6.6 → 0.7.0
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 +1 -1
- package/dist/index.d.ts +36 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1023 -204
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +1129 -209
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -59,12 +59,44 @@ export interface ClaudeNormalizerOptions {
|
|
|
59
59
|
* construction.
|
|
60
60
|
*/
|
|
61
61
|
threadId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The stem of this invoke's POSITIONAL fallback turn ids,
|
|
64
|
+
* `turn_<invokeId>_frame_<n>`, minted only for a top-level or nested turn
|
|
65
|
+
* whose frame carries no usable message id or uuid (the normal path names a
|
|
66
|
+
* turn by its SDK message id or frame uuid, unique by construction). A host
|
|
67
|
+
* folds every invoke of a conversation into ONE Reducer, so a stem that
|
|
68
|
+
* restarted with each invoke repeated those ids across invokes (DC-10, from
|
|
69
|
+
* sp-protocol's D3 bar). Absent, each normalizer draws a random
|
|
70
|
+
* `claude_<16 hex>` stem at most once, lazily (only when a fallback id is
|
|
71
|
+
* first needed, so the common path draws no randomness), and holds it
|
|
72
|
+
* OUTSIDE the atomic-push rebuild, so a rebuild reproduces it. Pass a fixed
|
|
73
|
+
* value only where one invoke's output must be byte-reproducible (capture,
|
|
74
|
+
* replay, tests), as vercel-ai's `invokeId`.
|
|
75
|
+
*/
|
|
76
|
+
invokeId?: string;
|
|
62
77
|
}
|
|
63
78
|
/**
|
|
64
|
-
* Build
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
79
|
+
* Build the Claude-facet normalizer: the inner normalizer wrapped in core's
|
|
80
|
+
* withAtomicPush (the fleet guard ruling, 2026-09-24, binding). push() never
|
|
81
|
+
* throws (SPEC:933):
|
|
82
|
+
* - each native is first read as plain JSON (core toJsonValueSafe): a host
|
|
83
|
+
* may hand in the in-process object, whose members need not be JSON (an
|
|
84
|
+
* undefined member, a Date, NaN, a BigInt, a function, a cycle); a JSON
|
|
85
|
+
* frame passes by reference, anything else folds exactly as its JSON form,
|
|
86
|
+
* which is what every capture already is (the SDK itself parses the CLI's
|
|
87
|
+
* NDJSON, so no 0.3.280 SDK frame needs it);
|
|
88
|
+
* - an envelope-valid but malformed frame (a required field missing or
|
|
89
|
+
* mistyped below the isSDKMessage discriminants: 61 single-point fuzz
|
|
90
|
+
* mutants of the corpus's 25 frame shapes threw, from ~17 sites, most after
|
|
91
|
+
* the frame had emitted) no longer throws: its partial batch is discarded
|
|
92
|
+
* with its state (the inner is rebuilt and re-driven from the journal) and
|
|
93
|
+
* one core `error {message: "normalizer error", code: <constructor name>}`
|
|
94
|
+
* takes the next seq. Over every committed native it fires zero times
|
|
95
|
+
* (e2e agents/claude-agent-sdk/guard.corpus.test.ts).
|
|
96
|
+
* The fallback id stem is held HERE, outside the rebuild's factory: drawn at
|
|
97
|
+
* most once, and only when a fallback id is first needed, so the common path
|
|
98
|
+
* never touches randomness (core's atomic-guard differential runs with it
|
|
99
|
+
* poisoned) and a rebuild re-reads the same stem.
|
|
68
100
|
*/
|
|
69
101
|
export declare function createClaudeNormalizer(options?: ClaudeNormalizerOptions): Normalizer;
|
|
70
102
|
export default createClaudeNormalizer;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAGL,KAAK,cAAc,EAQnB,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAGL,KAAK,cAAc,EAQnB,KAAK,UAAU,EAIhB,MAAM,sBAAsB,CAAC;AAO9B,KAAK,YAAY,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC,CAAC;AAE/D,KAAK,YAAY,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;AAE5C,KAAK,cAAc,GAAG,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC;AAiC/D,iBAAS,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,cAAc,CAwB3E;AA0gCD,kDAAkD;AAClD,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAy9DD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,uBAA4B,GAAG,UAAU,CAIxF;AAED,eAAe,sBAAsB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,CAAC"}
|