@ziggs-ai/agent-sdk 0.42.2 → 0.43.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/CHANGELOG.md +40 -0
- package/README.md +1 -1
- package/dist/Agent.d.ts +21 -8
- package/dist/Agent.js +173 -97
- package/dist/brain/ClaudeBrain.d.ts +0 -1
- package/dist/brain/ClaudeBrain.js +18 -42
- package/dist/brain/claudeCognition.js +5 -6
- package/dist/brain/claudeSdkProtocol.js +9 -9
- package/dist/brain/claudeSdkTools.d.ts +3 -3
- package/dist/brain/claudeSdkTools.js +37 -133
- package/dist/brain/hostedToolSurface.js +1 -1
- package/dist/brain/standingOfferNotice.d.ts +0 -2
- package/dist/brain/standingOfferNotice.js +1 -21
- package/dist/brain/toolManagerToSdkMcp.js +1 -1
- package/dist/brain/wakeGate.d.ts +3 -1
- package/dist/brain/wakeGate.js +6 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/ingress/normalizeIncoming.d.ts +5 -3
- package/dist/ingress/normalizeIncoming.js +9 -8
- package/dist/mcp/createMcpAgent.d.ts +15 -0
- package/dist/mcp/createMcpAgent.js +47 -11
- package/dist/memory/MemoryStore.d.ts +1 -1
- package/dist/memory/MemoryStore.js +1 -6
- package/dist/platform/ConnectionPool.js +1 -1
- package/dist/platform/OutboxBuffer.d.ts +2 -2
- package/dist/platform/OutboxBuffer.js +17 -17
- package/dist/platform/StateTimers.d.ts +3 -1
- package/dist/platform/StateTimers.js +4 -3
- package/dist/platform/WakeLedger.d.ts +10 -6
- package/dist/platform/WakeLedger.js +16 -9
- package/dist/platform/ZiggsEffectHandler.d.ts +18 -4
- package/dist/platform/ZiggsEffectHandler.js +86 -55
- package/dist/platform/agreements/AgreementService.d.ts +1 -3
- package/dist/platform/agreements/AgreementService.js +1 -7
- package/dist/platform/inboxLoop.d.ts +3 -9
- package/dist/platform/inboxLoop.js +151 -158
- package/dist/platform/polls/PollKind.d.ts +13 -16
- package/dist/platform/polls/PollKind.js +4 -4
- package/dist/platform/polls/PollRunner.d.ts +3 -20
- package/dist/platform/polls/PollRunner.js +13 -15
- package/dist/platform/polls/declaredPollRunner.d.ts +1 -1
- package/dist/platform/polls/declaredPollRunner.js +1 -1
- package/dist/platform/tasks/TaskService.d.ts +4 -3
- package/dist/platform/tasks/TaskService.js +1 -4
- package/dist/platform/telemetryIngest.js +4 -4
- package/dist/platform/tools/index.d.ts +0 -1
- package/dist/platform/tools/index.js +0 -3
- package/dist/platform/tools/tier1/protocolRunner.d.ts +1 -1
- package/dist/platform/tools/tier1/protocolRunner.js +24 -17
- package/dist/platform/tools/tier1/protocolTools.js +2 -2
- package/dist/platform/tools/tier1/wakeTools.d.ts +1 -1
- package/dist/platform/tools/tier1/wakeTools.js +2 -1
- package/dist/platform/tools/tier2/mcpConnectionTools.js +1 -1
- package/dist/runtime/AgentMachine.d.ts +2 -2
- package/dist/runtime/AgentMachine.js +4 -5
- package/dist/runtime/PromptBuilder.d.ts +1 -1
- package/dist/runtime/PromptBuilder.js +5 -4
- package/dist/runtime/buildOutcome.d.ts +1 -1
- package/dist/runtime/deliveryWriteKeys.d.ts +1 -1
- package/dist/runtime/deliveryWriteKeys.js +1 -1
- package/dist/runtime/kickoff.d.ts +14 -43
- package/dist/runtime/kickoff.js +22 -178
- package/dist/runtime/messageCommand.d.ts +9 -0
- package/dist/runtime/messageCommand.js +23 -0
- package/dist/runtime/requiredContext.d.ts +6 -0
- package/dist/runtime/requiredContext.js +23 -0
- package/dist/runtime/runTurn.js +31 -106
- package/dist/runtime/taskIntake.js +8 -22
- package/dist/runtime/wakeEffects.d.ts +3 -12
- package/dist/runtime/wakeEffects.js +17 -48
- package/dist/runtime/wakeOutcome.js +1 -1
- package/dist/skills/createSkillAgent.js +12 -1
- package/dist/tools/capabilityAdapter.js +1 -1
- package/dist/tools/recordReport.d.ts +1 -1
- package/dist/tools/recordReport.js +3 -3
- package/dist/tools/toolCreds.d.ts +1 -1
- package/dist/tools/toolCreds.js +4 -2
- package/dist/types.d.ts +17 -27
- package/package.json +3 -3
- package/dist/platform/tools/tier2/chatTools.d.ts +0 -3
- package/dist/platform/tools/tier2/chatTools.js +0 -7
- package/dist/probeChat.d.ts +0 -10
- package/dist/probeChat.js +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.43.1
|
|
6
|
+
|
|
7
|
+
- Task progress updates use the shared non-cancellation state type. Cancellation remains a separate command.
|
|
8
|
+
|
|
9
|
+
- Explicit message answer requests assigned to an agent bypass the context-only wake classifier. Short greetings and acknowledgments can no longer leave a requested answer pending because their wording looks like an FYI.
|
|
10
|
+
- An MCP agent can work an assigned task before closing it. The task intake now offers the MCP server's tools beside `task_set_result`; before, the only tool there was `task_set_result`, so the agent could close or fail the task but never search, fetch or call anything for it.
|
|
11
|
+
- An agent closing an assigned task through the injected intake now gets its `task_set_result` call carried out. The intake bound two actions (complete and fail) to that one tool, so a native tool call matched both and was dropped. It is one action now, and its format passes `result` as an object (`{ summary }`), as the tool requires.
|
|
12
|
+
- An agent made with `createSkillAgent` also has `access_request`, so it can file the release request (`releaseSource`) the person approves before an input can be delegated to a hired helper.
|
|
13
|
+
- An agent made with `createSkillAgent` can delegate to a helper it hired. It now has `artifact_contribution_review` and `artifact_contribute`, so it can ask for the person's approval of the instruction input that `task_delegate` takes, and then deliver it.
|
|
14
|
+
- A message that arrives inside a task or agreement no longer makes the wake read as unavailable. The context read selects the work, and the triggering message is read on its own; before, both went into one snapshot request, which refuses a message beside other resources.
|
|
15
|
+
- An MCP agent answers an assigned task with its result. `createMcpAgent` workflows now get the same assigned-task intake `defineAgent` gives every other agent, so a task wake goes to `task_set_result` instead of a reply that has no recipient and is refused.
|
|
16
|
+
- A lane name is never an address. Sends, context reads, breadcrumbs and tool contexts use the wake's explicit destination: the incoming message's address, or the room a lane's own messages came from (kept with saved check-backs). With none, a send fails asking to name the conversation, and a read says nothing is selected. Tool contexts carry the lane as `sessionId` and `addressId` only for an explicit destination; the FSM prompt shows the lane as `lane`.
|
|
17
|
+
- Later wakes of a direct request (check-backs, restored wakes, events on its execution) still answer it: they read it by its message and reply to its sender, in its room when it arrived in one.
|
|
18
|
+
- Coalesced messages from one shared room under agreement work are answered in that room. From several rooms, a send must name the conversation.
|
|
19
|
+
- A work-conversation reply names its recipient and selected work; a causal reply reference never changes either.
|
|
20
|
+
- A matching marketplace request wakes the agent with the request's agreement only, no made-up message or address. A request wake that fails is logged and no longer holds the rest of the inbox pass.
|
|
21
|
+
|
|
22
|
+
- Work execution remains stable across navigation changes and retains exact message sources in batches. Both cognition engines refuse missing required inputs without acknowledging the responsibility; optional history can fail independently.
|
|
23
|
+
|
|
24
|
+
- Work execution and inbox message reads use the shared messaging API. Task initialization no longer needs conversation history; `includeHistory` requests optional history while exact triggering messages and execution revocation remain enforced.
|
|
25
|
+
|
|
26
|
+
- Task recovery uses its agreement or restored execution; historical origin links never choose its delivery destination. Missing shared conversations cannot silently become agreement conversations. Structured work events and restored timer execution replace session-name parsing.
|
|
27
|
+
|
|
28
|
+
- Resolve agreement/shared-conversation destinations from selected executions, including task-first, scheduled and replayed work. Never select or create rooms from lane names. Explicit shared conversation addresses remain exact.
|
|
29
|
+
- Keep mixed work from borrowing a previous destination; stop deriving artifact and memory scopes from lane names. `context_snapshot` accepts explicit agreement/task scopes.
|
|
30
|
+
|
|
3
31
|
## 0.39.0
|
|
4
32
|
|
|
5
33
|
- A manifest may declare `needs: [{ checkout: 'git' }]`. The host provides a throwaway box per wake (`checkout` option, a `CheckoutProvider`); the task names the repository as owner/name and may name a base branch; the brain gets `checkout_read`, `checkout_write`, `checkout_run` and `checkout_push`; the change is pushed to `agent/<task id>` for a pull request. Without a GitHub connection grant on the hire the task is refused by name, like a connection need. The box holds no credential: its git traffic is relayed by the host through the backend git door under the hire's grant. The box server ships as `dist/checkout/box/server.js` (`checkoutBoxServerPath()`).
|
|
@@ -32,6 +60,18 @@
|
|
|
32
60
|
|
|
33
61
|
## Unreleased
|
|
34
62
|
|
|
63
|
+
- A store claim no longer makes the agent open a room and greet the buyer. `claimKickingOff`, `CLAIM_KICKOFF_STATE` and `buildClaimKickoffState` are removed; the buyer's first message or task wakes the provider, and the protocol says so. `handlesClaimWake` still routes a claim for an author who wants to act on it.
|
|
64
|
+
|
|
65
|
+
- Consume roomless message assignments under their execution contexts; keep retained lanes separate and route replies without creating chats.
|
|
66
|
+
|
|
67
|
+
- Only a lane that a message with no room reached sends to, and reads history from, that agreement's conversation. A task or claim wake on an `agrn-` lane, including any hire made with a room, sends into the lane as before, and the server routes it to the agreement's live room.
|
|
68
|
+
|
|
69
|
+
- On a roomless lane, a `human` recipient answers the message that woke the lane; with no such message the send is refused and points to `conversation_read` for recipients. A send that names a different agreement is refused, never dropped or moved.
|
|
70
|
+
|
|
71
|
+
- A message with no room that the host cannot route (a custom `sessionResolver` returned no lane, or the agent id is missing) now fails its handover and stays pending instead of being acknowledged.
|
|
72
|
+
|
|
73
|
+
- Roomless sends and history reads use the runner's backend URL. Proposals and subcontracts made from an agreement lane name no chat.
|
|
74
|
+
|
|
35
75
|
- Expose the shared `task_delegate` capability on the hosted agent surface for recursive task assignments and approved artifact returns.
|
|
36
76
|
|
|
37
77
|
## 0.41.2
|
package/README.md
CHANGED
|
@@ -150,7 +150,7 @@ who want them.
|
|
|
150
150
|
|
|
151
151
|
## External wake sources
|
|
152
152
|
|
|
153
|
-
Declare `polls: [{ kind,
|
|
153
|
+
Declare `polls: [{ kind, addressId, ...sourceOptions }]` and their implementations in
|
|
154
154
|
`pollKinds`. Each implementation supplies an `id`, optional `intervalMs` and
|
|
155
155
|
`poll(binding, { agentId, operatorKey })`, returning `{ actionable, hint? }`.
|
|
156
156
|
|
package/dist/Agent.d.ts
CHANGED
|
@@ -35,18 +35,17 @@ import type { CheckoutProvider } from './checkout/types.js';
|
|
|
35
35
|
/**
|
|
36
36
|
* Given a normalized event, return the sessionId for this agent. Return
|
|
37
37
|
* `null` to skip processing. Lets each Agent define what "session" means —
|
|
38
|
-
*
|
|
38
|
+
* the default groups by addressId or by agreement when there is no room, task-scoped agents
|
|
39
39
|
* could bucket by taskId, cron agents by schedule id, etc.
|
|
40
40
|
*/
|
|
41
41
|
export type SessionResolver = (normalized: NormalizedEvent, ownAgentId: string) => string | null;
|
|
42
42
|
/**
|
|
43
43
|
* one lane key per unit of work, derived the same way as inbox wakes.
|
|
44
44
|
*
|
|
45
|
-
* Inbox deliveries
|
|
45
|
+
* Inbox deliveries use their room when present. Bootstrap used to
|
|
46
46
|
* prefer bare `agreementId`, which opened a second lane for the same task and
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* notification chat (`agrn-<agreementId>`), which is always linked after.
|
|
47
|
+
* misdirected the snapshot read. Use the agreement's local processing key. An origin link is
|
|
48
|
+
* navigation, not a delivery destination. This key creates no chat or grant.
|
|
50
49
|
*/
|
|
51
50
|
export declare function laneSessionIdForTask(task: {
|
|
52
51
|
originChatId?: string | null;
|
|
@@ -140,7 +139,7 @@ export interface AgentOptions {
|
|
|
140
139
|
states?: Workflow['states'];
|
|
141
140
|
initial?: string;
|
|
142
141
|
tickTimeoutMs?: number;
|
|
143
|
-
/** Per-agent session keying. Defaults to `(n) => n.
|
|
142
|
+
/** Per-agent session keying. Defaults to `(n) => n.addressId`. */
|
|
144
143
|
sessionResolver?: SessionResolver;
|
|
145
144
|
/**
|
|
146
145
|
* Agent-private long-term memory. With an operator key and agent id, the
|
|
@@ -277,6 +276,11 @@ export declare class Agent {
|
|
|
277
276
|
/** Tasks left active by the asking turn, failed right after it (per lane). */
|
|
278
277
|
private unmetTasksPendingAsk;
|
|
279
278
|
private readonly wakeEffects;
|
|
279
|
+
/**
|
|
280
|
+
* The roomless lane a live wake runs on. A tool's send or read reaches the
|
|
281
|
+
* host without the wake's effect wrapper, so both look the lane up here.
|
|
282
|
+
*/
|
|
283
|
+
private readonly wakeDestination;
|
|
280
284
|
private readonly outboundMessages;
|
|
281
285
|
private readonly confirmedPlanVersions;
|
|
282
286
|
private grantProviderCache;
|
|
@@ -347,7 +351,7 @@ export declare class Agent {
|
|
|
347
351
|
* wake keys on the live room / hire.
|
|
348
352
|
*/
|
|
349
353
|
private dropStaleCancelledAgreementSession;
|
|
350
|
-
private
|
|
354
|
+
private agreementIsTerminal;
|
|
351
355
|
/**
|
|
352
356
|
* Whether the host answers this wake without spending a model turn.
|
|
353
357
|
*
|
|
@@ -372,7 +376,7 @@ export declare class Agent {
|
|
|
372
376
|
*
|
|
373
377
|
* A task frame that carries a terminal state AND a result is an echo of work
|
|
374
378
|
* this agent has already finished: there is no decision left in it. Dropping it
|
|
375
|
-
* is not the same suppression as {@link
|
|
379
|
+
* is not the same suppression as {@link agreementIsTerminal}, which waits
|
|
376
380
|
* for the agreement to end — this fires while the engagement is still live,
|
|
377
381
|
* which is where the cost actually was.
|
|
378
382
|
*
|
|
@@ -418,6 +422,14 @@ export declare class Agent {
|
|
|
418
422
|
* need". Without it the extra turn buys nothing, so it is not spent.
|
|
419
423
|
*/
|
|
420
424
|
private canAskForAccess;
|
|
425
|
+
/**
|
|
426
|
+
* The work destination comes from the selected execution first, then the
|
|
427
|
+
* structured wake. It does not depend on an earlier message being delivered
|
|
428
|
+
* to this host, so task-first and restarted/scheduled runs work identically.
|
|
429
|
+
* A reply defaults to the message that woke it, and to the wake's task.
|
|
430
|
+
* A lane name is never an address: a conversation comes from a message.
|
|
431
|
+
*/
|
|
432
|
+
private wakeDestinationFor;
|
|
421
433
|
private _processEvent;
|
|
422
434
|
private _processEventInContext;
|
|
423
435
|
/**
|
|
@@ -467,6 +479,7 @@ export declare class Agent {
|
|
|
467
479
|
/** replay task-assigned for an existing active task (demo recovery). */
|
|
468
480
|
wakeTaskAssignment(taskId: string, options?: {
|
|
469
481
|
fromInbox?: boolean;
|
|
482
|
+
inputs?: import('./types.js').TaskInputRef[];
|
|
470
483
|
}): Promise<void>;
|
|
471
484
|
/**
|
|
472
485
|
* Stop taking work. Timers and polls stop at once; the inbox loop cancels
|