@silverprotocol/core 0.2.0-beta.0 → 0.2.1
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 +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,12 +78,16 @@ framework-neutral, ready to send over the wire, persist, or feed straight to the
|
|
|
78
78
|
`Reducer` above:
|
|
79
79
|
|
|
80
80
|
```ts
|
|
81
|
+
// `query` is the Claude Agent SDK's own streaming call — you keep using
|
|
82
|
+
// your framework as-is; the normalizer just translates what it emits.
|
|
83
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
81
84
|
import { createClaudeNormalizer } from "@silverprotocol/claude-agent-sdk";
|
|
82
85
|
|
|
83
86
|
const n = createClaudeNormalizer();
|
|
84
87
|
const agEvents = [];
|
|
85
|
-
for await (const native of
|
|
86
|
-
agEvents.push(...n.
|
|
88
|
+
for await (const native of query({ prompt: "call the echo tool" }))
|
|
89
|
+
agEvents.push(...n.push(native)); // one native event → 0+ AgEvents
|
|
90
|
+
agEvents.push(...n.flush()); // seal anything still open
|
|
87
91
|
```
|
|
88
92
|
|
|
89
93
|
## Learn more
|
package/package.json
CHANGED