@ziggs-ai/agent-sdk 0.10.7 → 0.11.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/CHANGELOG.md +11 -11
- package/dist/AgentHost.d.ts +15 -15
- package/dist/AgentHost.js +22 -22
- package/dist/adapters/AnthropicAdapter.js +1 -1
- package/dist/adapters/McpAdapter.d.ts +10 -10
- package/dist/adapters/McpAdapter.js +33 -21
- package/dist/adapters/OpenAIAdapter.js +1 -1
- package/dist/agent/Agent.d.ts +2 -2
- package/dist/agent/ClaudeSdkAgent.d.ts +6 -6
- package/dist/agent/ClaudeSdkAgent.js +25 -25
- package/dist/agent/claudeCognition.d.ts +3 -3
- package/dist/agent/claudeCognition.js +7 -7
- package/dist/agent/claudeSdkTools.d.ts +3 -3
- package/dist/agent/claudeSdkTools.js +9 -9
- package/dist/agent/hostedAgentConnection.d.ts +1 -1
- package/dist/agent/hostedAgentConnection.js +1 -1
- package/dist/agent/toolManagerToSdkMcp.d.ts +1 -1
- package/dist/agent/toolManagerToSdkMcp.js +2 -2
- package/dist/context/applyEffects.js +1 -1
- package/dist/defineAgent.js +2 -2
- package/dist/formatters/HistoryFormatter.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/ingress/normalizeIncoming.d.ts +1 -1
- package/dist/ingress/normalizeIncoming.js +7 -7
- package/dist/pricing/fleetDefaults.d.ts +3 -3
- package/dist/pricing/fleetDefaults.js +3 -3
- package/dist/pricing/fleetEvalFree.d.ts +1 -1
- package/dist/pricing/fleetEvalFree.js +1 -1
- package/dist/pricing/fleetFreeTierA.gen.d.ts +1 -1
- package/dist/pricing/fleetFreeTierA.gen.js +1 -1
- package/dist/pricing/fleetTierByAgentId.gen.d.ts +1 -1
- package/dist/runtime/AgentMachine.d.ts +1 -1
- package/dist/runtime/AgentMachine.js +8 -8
- package/dist/runtime/PromptBuilder.d.ts +2 -2
- package/dist/runtime/PromptBuilder.js +3 -3
- package/dist/runtime/bootstrapCtx.d.ts +1 -1
- package/dist/runtime/bootstrapCtx.js +2 -2
- package/dist/runtime/buildOutcome.d.ts +1 -1
- package/dist/runtime/buildOutcome.js +4 -4
- package/dist/runtime/defaults.d.ts +5 -5
- package/dist/runtime/defaults.js +4 -4
- package/dist/runtime/deliveryWriteKeys.d.ts +1 -1
- package/dist/runtime/deliveryWriteKeys.js +3 -3
- package/dist/runtime/kickoff.d.ts +3 -3
- package/dist/runtime/kickoff.js +3 -3
- package/dist/runtime/runMechanical.d.ts +1 -1
- package/dist/runtime/runMechanical.js +1 -1
- package/dist/runtime/runTurn.d.ts +1 -1
- package/dist/runtime/runTurn.js +10 -10
- package/dist/runtime/taskBookkeeping.d.ts +3 -3
- package/dist/runtime/taskBookkeeping.js +3 -3
- package/dist/runtime/taskIntake.js +2 -2
- package/dist/server/ConnectionPool.js +1 -1
- package/dist/server/EventQueue.d.ts +1 -1
- package/dist/server/EventQueue.js +1 -1
- package/dist/server/SeenMessages.d.ts +2 -2
- package/dist/server/SeenMessages.js +2 -2
- package/dist/server/ZiggsEffectHandler.d.ts +2 -2
- package/dist/server/ZiggsEffectHandler.js +8 -8
- package/dist/server/agreements/AgreementService.d.ts +3 -8
- package/dist/server/agreements/AgreementService.js +4 -7
- package/dist/server/inboxLoop.d.ts +5 -5
- package/dist/server/inboxLoop.js +21 -10
- package/dist/server/questMatch.d.ts +1 -1
- package/dist/server/questMatch.js +1 -1
- package/dist/server/runLauncher.js +3 -3
- package/dist/server/tools/index.d.ts +1 -0
- package/dist/server/tools/index.js +7 -6
- package/dist/server/tools/tier1/protocolRunner.d.ts +1 -1
- package/dist/server/tools/tier1/protocolRunner.js +19 -19
- package/dist/server/tools/tier1/protocolTools.js +5 -4
- package/dist/server/tools/tier2/artifactTools.js +2 -2
- package/dist/server/tools/tier2/chatTools.js +2 -2
- package/dist/server/tools/tier2/connectionTools.js +3 -3
- package/dist/server/tools/tier2/contextTools.js +1 -1
- package/dist/server/tools/tier2/discoveryTools.js +2 -2
- package/dist/server/tools/tier2/grantsTools.js +1 -1
- package/dist/server/tools/tier2/linkTools.js +3 -3
- package/dist/server/tools/tier2/marketplaceTools.js +1 -1
- package/dist/server/tools/tier2/mcpConnectionTools.d.ts +4 -0
- package/dist/server/tools/tier2/mcpConnectionTools.js +136 -0
- package/dist/server/tools/tier2/paymentTools.js +1 -1
- package/dist/shared/operatorKeyClaims.d.ts +2 -2
- package/dist/shared/operatorKeyClaims.js +1 -1
- package/dist/tasks/protocolRegistry.d.ts +1 -1
- package/dist/tasks/protocolRegistry.js +1 -1
- package/dist/tools/ToolManager.js +1 -1
- package/dist/tools/capabilityAdapter.d.ts +1 -1
- package/dist/tools/capabilityAdapter.js +3 -3
- package/dist/tools/defineTool.js +1 -1
- package/dist/tools/recordReport.d.ts +3 -3
- package/dist/tools/recordReport.js +3 -3
- package/dist/types.d.ts +17 -17
- package/package.json +3 -3
package/dist/types.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export type Outcome = {
|
|
|
70
70
|
} | {
|
|
71
71
|
kind: 'task-closed';
|
|
72
72
|
status: 'completed' | 'failed';
|
|
73
|
-
/** Task being closed — required to clear only that entry
|
|
73
|
+
/** Task being closed — required to clear only that entry. */
|
|
74
74
|
taskId?: string;
|
|
75
75
|
result?: unknown;
|
|
76
76
|
} | {
|
|
@@ -95,7 +95,7 @@ export type Outcome = {
|
|
|
95
95
|
*/
|
|
96
96
|
proposedByMe: boolean;
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* true when the wake was a chat-less store/listing claim
|
|
99
99
|
* (`resource_changed` + `reason === 'proposal_approved'`). Distinguishes
|
|
100
100
|
* the provider claim-kickoff (open chat + greet) from a direct-proposal
|
|
101
101
|
* counterparty approve, which must never auto-kickoff.
|
|
@@ -162,7 +162,7 @@ export interface CollectedSubtaskResult {
|
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Per-assigned-task (or coordinator-lane) bookkeeping under one chat lane.
|
|
165
|
-
* Keyed on Ctx.tasks by taskId
|
|
165
|
+
* Keyed on Ctx.tasks by taskId — task-closed clears only its entry.
|
|
166
166
|
*/
|
|
167
167
|
export interface TaskBookkeeping {
|
|
168
168
|
agreementId: string | null;
|
|
@@ -179,7 +179,7 @@ export interface TaskBookkeeping {
|
|
|
179
179
|
* Task bookkeeping lives in `tasks` (keyed by taskId). `activeTaskId` /
|
|
180
180
|
* `activeAgreementId` are the focus scalars for prompt + FSM convenience —
|
|
181
181
|
* assigning task B no longer destroys task A's pending/collected state, and
|
|
182
|
-
* closing A leaves B intact
|
|
182
|
+
* closing A leaves B intact.
|
|
183
183
|
*/
|
|
184
184
|
export interface Ctx {
|
|
185
185
|
identity: Identity;
|
|
@@ -276,7 +276,7 @@ export interface ThinkingState {
|
|
|
276
276
|
allowNoWait?: boolean;
|
|
277
277
|
}
|
|
278
278
|
/**
|
|
279
|
-
*
|
|
279
|
+
* fixed tool invoke with no LLM turn. Entered after transitions
|
|
280
280
|
* (e.g. task-assigned → executing); runs `tool` once and emits `produces`.
|
|
281
281
|
*/
|
|
282
282
|
export interface MechanicalState {
|
|
@@ -340,7 +340,7 @@ export interface ContextSnapshot {
|
|
|
340
340
|
* 404'd) — deleted or never visible to this agent. Message-triggered wakes
|
|
341
341
|
* check this and skip the LLM instead of reasoning over a fabricated empty
|
|
342
342
|
* history. Only gates message wakes. A bare agreementId as sessionId also
|
|
343
|
-
* trips it
|
|
343
|
+
* trips it — that is a mis-keyed lane, not a legitimate task lane;
|
|
344
344
|
* task wakes should key on the agreement's origin/notification chat.
|
|
345
345
|
*/
|
|
346
346
|
chatMissing?: boolean;
|
|
@@ -364,7 +364,7 @@ export interface ToolCallResult {
|
|
|
364
364
|
/**
|
|
365
365
|
* Summed token usage of any nested LLM call the tool made (e.g. llmTool).
|
|
366
366
|
* Threaded up so the turn's authoritative token count (machine.tokens ->
|
|
367
|
-
* result.metrics) includes tool-internal spend rather than leaking it
|
|
367
|
+
* result.metrics) includes tool-internal spend rather than leaking it.
|
|
368
368
|
*/
|
|
369
369
|
usage?: LlmResponse['usage'];
|
|
370
370
|
}
|
|
@@ -385,7 +385,7 @@ export interface DeliveryWriteKeys {
|
|
|
385
385
|
readonly wakeKey: string | null;
|
|
386
386
|
/**
|
|
387
387
|
* Key for an artifact write of this wake. Pass the artifact's content so the
|
|
388
|
-
* key is derived from it (
|
|
388
|
+
* key is derived from it (semantics): a wake writing several
|
|
389
389
|
* artifacts gets several keys, and a redelivered wake that re-writes the same
|
|
390
390
|
* content reuses its key instead of colliding on an ordinal slot and being
|
|
391
391
|
* discarded. Omitting content falls back to a per-wake ordinal — call exactly
|
|
@@ -397,7 +397,7 @@ export interface DeliveryWriteKeys {
|
|
|
397
397
|
/**
|
|
398
398
|
* Default messageId for a chat-message send of this wake — the backend dedups
|
|
399
399
|
* on (chatId, messageId). Derived from the emission's content (text + chat +
|
|
400
|
-
* receiver), not a per-wake ordinal
|
|
400
|
+
* receiver), not a per-wake ordinal: a wake that says two things
|
|
401
401
|
* gets two keys, and a redelivered wake that re-says the same text reuses the
|
|
402
402
|
* same key, while a re-think with different text does not collide and drop.
|
|
403
403
|
*/
|
|
@@ -437,11 +437,11 @@ export type Effect = {
|
|
|
437
437
|
kind: 'llm-call';
|
|
438
438
|
messages: LlmMessage[];
|
|
439
439
|
tools: LlmToolSchema[];
|
|
440
|
-
/** Chat/session id for monitoring ingest
|
|
440
|
+
/** Chat/session id for monitoring ingest. */
|
|
441
441
|
sessionId?: string;
|
|
442
|
-
/** Per-turn UUID grouping all LLM + tool calls in one turn
|
|
442
|
+
/** Per-turn UUID grouping all LLM + tool calls in one turn. */
|
|
443
443
|
runId?: string;
|
|
444
|
-
/** FSM state name at the time of this call
|
|
444
|
+
/** FSM state name at the time of this call. */
|
|
445
445
|
stateId?: string;
|
|
446
446
|
} | {
|
|
447
447
|
kind: 'stream-text';
|
|
@@ -459,15 +459,15 @@ export type Effect = {
|
|
|
459
459
|
senderId?: string;
|
|
460
460
|
senderType?: string;
|
|
461
461
|
/**
|
|
462
|
-
* Agreement this tool call is acting under
|
|
462
|
+
* Agreement this tool call is acting under. For a delegated
|
|
463
463
|
* per-user MCP call, `senderId` is the delegating agent, not the end-user
|
|
464
464
|
* who owns the connection; this lets the gateway resolve the delegation
|
|
465
465
|
* root's user. Sourced from the waking task event's `result.agreementId`.
|
|
466
466
|
*/
|
|
467
467
|
onBehalfOfAgreementId?: string;
|
|
468
|
-
/** Per-turn UUID
|
|
468
|
+
/** Per-turn UUID. */
|
|
469
469
|
runId?: string;
|
|
470
|
-
/** FSM state name
|
|
470
|
+
/** FSM state name. */
|
|
471
471
|
stateId?: string;
|
|
472
472
|
/** Replay-stable write keys for this wake — write-capable tools derive their idempotency key from here, never from the LLM. */
|
|
473
473
|
writeKeys?: DeliveryWriteKeys;
|
|
@@ -484,7 +484,7 @@ export type Effect = {
|
|
|
484
484
|
idempotencyKey?: string;
|
|
485
485
|
};
|
|
486
486
|
/**
|
|
487
|
-
* Typed result map. With this shape, `await eff({ kind: 'read-context',
|
|
487
|
+
* Typed result map. With this shape, `await eff({ kind: 'read-context', .. })`
|
|
488
488
|
* resolves to `ContextSnapshot`, not a union — the discriminant carries the
|
|
489
489
|
* result type. Tests and Server impls implement this map exhaustively.
|
|
490
490
|
*/
|
|
@@ -520,7 +520,7 @@ export interface DefineAgentInput {
|
|
|
520
520
|
/**
|
|
521
521
|
* Human-facing one-liner: what this agent does, for a buyer reading the store
|
|
522
522
|
* row. NOT the system prompt — a claude-sdk agent puts its prompt in
|
|
523
|
-
* `systemPrompt` (
|
|
523
|
+
* `systemPrompt` (every claude-sdk agent used to pass its prompt
|
|
524
524
|
* here, and `deriveAgentRecord` published it straight to the store).
|
|
525
525
|
*/
|
|
526
526
|
description: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziggs-ai/agent-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Agent framework SDK for building autonomous agents on the Ziggs platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsc -p tsconfig.json",
|
|
20
|
-
"prepack": "npm run build",
|
|
20
|
+
"prepack": "rm -rf dist && npm run build",
|
|
21
21
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
22
22
|
"test": "node --experimental-test-module-mocks --import tsx/esm --test --test-reporter=spec test/*.test.ts",
|
|
23
23
|
"test:watch": "node --experimental-test-module-mocks --import tsx/esm --test --watch test/*.test.ts"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@anthropic-ai/claude-agent-sdk": "^0.3.204",
|
|
27
27
|
"@anthropic-ai/sdk": "^0.110.0",
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
29
|
-
"@ziggs-ai/api-client": "0.
|
|
29
|
+
"@ziggs-ai/api-client": "0.10.0",
|
|
30
30
|
"ajv": "^8.17.1",
|
|
31
31
|
"dotenv": "^17.2.3",
|
|
32
32
|
"openai": "^4.0.0",
|