@ziggs-ai/agent-sdk 0.42.2 → 0.43.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 +38 -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
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { agreementIdFromLane } from '@ziggs-ai/api-client';
|
|
2
|
-
import { isListing } from './agreementContext.js';
|
|
3
1
|
const record = (value) => value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
4
2
|
const id = (value) => typeof value === 'string' && value.trim() ? value : undefined;
|
|
5
3
|
/** Never combine a task from one event with an agreement from another. */
|
|
@@ -26,9 +24,7 @@ export function workScopeFromWake(event, sessionId) {
|
|
|
26
24
|
// A listing is never work, so it is never what a wake's sends and
|
|
27
25
|
// tools are filed under.
|
|
28
26
|
const listing = record(rec.agreementContext).listing === true;
|
|
29
|
-
const agreementId = listing ? undefined : id(rec.agreementId) ?? id(resource.agreementId) ?? id(task.agreementId)
|
|
30
|
-
?? agreementIdFromLane(rec.chatId) ?? agreementIdFromLane(resource.chatId)
|
|
31
|
-
?? agreementIdFromLane(sessionId) ?? undefined;
|
|
27
|
+
const agreementId = listing ? undefined : id(rec.agreementId) ?? id(resource.agreementId) ?? id(task.agreementId);
|
|
32
28
|
const taskId = id(rec.taskId) ?? id(resource.taskId) ?? id(task.taskId) ?? (resource.kind === 'task' ? id(resource.resourceId) : undefined);
|
|
33
29
|
return { ...(agreementId ? { agreementId } : {}), ...(taskId ? { taskId } : {}) };
|
|
34
30
|
}
|
|
@@ -49,19 +45,15 @@ const TASK_WRITES = new Set(['task_create', 'task_set_result', 'task_update_plan
|
|
|
49
45
|
/** Per-wake observation, including effects nested inside tools and cross-room sends. */
|
|
50
46
|
export class WakeEffects {
|
|
51
47
|
initialScope;
|
|
52
|
-
sessionId;
|
|
53
48
|
inferScope;
|
|
54
49
|
sentMessage = false;
|
|
55
50
|
taskWrite = false;
|
|
56
51
|
planVersions = new Set();
|
|
57
52
|
sentMessageKeys = new Set();
|
|
58
|
-
/** Agreements the wake's OWN room reported, from its fenced snapshot. */
|
|
59
|
-
roomAgreementIds = [];
|
|
60
53
|
/** Confirmed task writes: work this wake actually performed. */
|
|
61
54
|
taskWrites = [];
|
|
62
|
-
constructor(initialScope,
|
|
55
|
+
constructor(initialScope, inferScope = true) {
|
|
63
56
|
this.initialScope = initialScope;
|
|
64
|
-
this.sessionId = sessionId;
|
|
65
57
|
this.inferScope = inferScope;
|
|
66
58
|
}
|
|
67
59
|
static forWake(event, sessionId) {
|
|
@@ -70,47 +62,23 @@ export class WakeEffects {
|
|
|
70
62
|
const conflictingBatch = frame.type === 'batch' && Array.isArray(frame.events)
|
|
71
63
|
&& !initialScope.agreementId && !initialScope.taskId
|
|
72
64
|
&& frame.events.some(item => Object.keys(workScopeFromWake(item, sessionId)).length > 0);
|
|
73
|
-
return new WakeEffects(initialScope,
|
|
65
|
+
return new WakeEffects(initialScope, !conflictingBatch);
|
|
74
66
|
}
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
* scope — spend follows who the agent acts for, and in a room that is the
|
|
78
|
-
* room's agreement — and a confirmed task write names its task only when
|
|
79
|
-
* the server tied the write to that same agreement. A plan written for
|
|
80
|
-
* customer A from customer B's room stays billed to B and names no task; a
|
|
81
|
-
* write whose agreement the server did not report adds nothing but the room.
|
|
82
|
-
*/
|
|
67
|
+
/** Structured work wins. A confirmed task write may identify work performed;
|
|
68
|
+
* reading a context snapshot never selects billing or execution authority. */
|
|
83
69
|
get scope() {
|
|
84
70
|
if (this.initialScope.agreementId || this.initialScope.taskId)
|
|
85
71
|
return this.initialScope;
|
|
86
|
-
|
|
87
|
-
return {};
|
|
88
|
-
const room = new Set(this.roomAgreementIds);
|
|
89
|
-
if (room.size > 1)
|
|
90
|
-
return {};
|
|
91
|
-
const agreementId = [...room][0];
|
|
92
|
-
if (!agreementId)
|
|
93
|
-
return uniqueWorkScope(this.taskWrites);
|
|
94
|
-
const tasks = new Set(this.taskWrites.filter(w => w.agreementId === agreementId).map(w => w.taskId));
|
|
95
|
-
return { agreementId, ...(tasks.size === 1 ? { taskId: [...tasks][0] } : {}) };
|
|
72
|
+
return this.inferScope ? uniqueWorkScope(this.taskWrites) : {};
|
|
96
73
|
}
|
|
97
74
|
observe(effect, response) {
|
|
98
75
|
const outer = record(response);
|
|
99
|
-
if (effect.kind === 'send-message' && outer.ok === true
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
&& outer.chatMissing !== true && Array.isArray(outer.agreements)) {
|
|
106
|
-
for (const row of outer.agreements) {
|
|
107
|
-
// A stranger's room is linked to the agent's listing; the listing is
|
|
108
|
-
// every stranger's and never the room's work.
|
|
109
|
-
if (isListing(row))
|
|
110
|
-
continue;
|
|
111
|
-
const agreementId = id(record(row).agreementId);
|
|
112
|
-
if (agreementId)
|
|
113
|
-
this.roomAgreementIds.push(agreementId);
|
|
76
|
+
if (effect.kind === 'send-message' && outer.ok === true
|
|
77
|
+
&& (outer.outcome === 'created' || outer.outcome === 'existing')) {
|
|
78
|
+
const messageId = id(record(outer.message).messageId);
|
|
79
|
+
if (messageId) {
|
|
80
|
+
this.sentMessage = true;
|
|
81
|
+
this.sentMessageKeys.add(messageId);
|
|
114
82
|
}
|
|
115
83
|
}
|
|
116
84
|
if (effect.kind !== 'tool-call' || outer.ok !== true)
|
|
@@ -119,10 +87,11 @@ export class WakeEffects {
|
|
|
119
87
|
if (result.ok === false || result.success === false || result.error)
|
|
120
88
|
return;
|
|
121
89
|
const name = effect.name.replace(/^(functions|tools|function|tool)\./, '');
|
|
122
|
-
if (name === '
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
this.
|
|
90
|
+
if (name === 'message_send') {
|
|
91
|
+
const messageId = id(record(result.message).messageId);
|
|
92
|
+
if ((result.outcome === 'created' || result.outcome === 'existing') && messageId) {
|
|
93
|
+
this.sentMessage = true;
|
|
94
|
+
this.sentMessageKeys.add(messageId);
|
|
126
95
|
}
|
|
127
96
|
}
|
|
128
97
|
if (TASK_WRITES.has(name))
|
|
@@ -71,7 +71,7 @@ export function classifyWakeOutcome(input) {
|
|
|
71
71
|
export function buildWakeOutcomePayload(input) {
|
|
72
72
|
return {
|
|
73
73
|
source: 'agent',
|
|
74
|
-
|
|
74
|
+
addressId: input.sessionId,
|
|
75
75
|
sessionId: input.sessionId,
|
|
76
76
|
execution: {
|
|
77
77
|
llmCallsTotal: input.llmCalls ?? 0,
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { createAgent } from '../Agent.js';
|
|
2
2
|
import { ARTIFACT_TOOLS } from '../platform/tools/tier2/artifactTools.js';
|
|
3
|
+
import { accessRequestTool } from '../platform/tools/tier2/contextTools.js';
|
|
3
4
|
import { toolName } from '../tools/defineTool.js';
|
|
4
5
|
import { parseSkill, skillRolePrompt } from './parseSkill.js';
|
|
5
6
|
/** The artifact tools that finish inside one call, so instructions can keep
|
|
6
7
|
* their work as artifacts. The rest hand back a storage URL to upload to or
|
|
7
8
|
* fetch from, and this agent has no web tool to do that with.
|
|
9
|
+
*
|
|
10
|
+
* The contribution pair is here because delegating needs it: task_delegate
|
|
11
|
+
* takes an instruction artifact, the destination may read it only once a
|
|
12
|
+
* person approves that exact input, and that approval is asked for with
|
|
13
|
+
* artifact_contribution_review from inside this agent's execution. Without
|
|
14
|
+
* it a hired helper could never be given work. The review only reports
|
|
15
|
+
* what is missing; access_request (with its release source) files the card
|
|
16
|
+
* the person approves, so both are offered.
|
|
8
17
|
*/
|
|
9
18
|
const SKILL_ARTIFACT_TOOL_NAMES = new Set([
|
|
10
19
|
'artifact_record',
|
|
@@ -12,6 +21,8 @@ const SKILL_ARTIFACT_TOOL_NAMES = new Set([
|
|
|
12
21
|
'artifact_find',
|
|
13
22
|
'artifact_share',
|
|
14
23
|
'artifact_attach',
|
|
24
|
+
'artifact_contribution_review',
|
|
25
|
+
'artifact_contribute',
|
|
15
26
|
]);
|
|
16
27
|
const SKILL_ARTIFACT_TOOLS = ARTIFACT_TOOLS.filter((tool) => SKILL_ARTIFACT_TOOL_NAMES.has(toolName(tool) ?? ''));
|
|
17
28
|
/** The same instructions run on a host or on a person's machine. The trusted
|
|
@@ -30,7 +41,7 @@ export function createSkillAgent(options) {
|
|
|
30
41
|
const skill = parseSkill([{ path: 'SKILL.md', bytes: Buffer.from(text, 'utf8') }]);
|
|
31
42
|
return skillRolePrompt(skill);
|
|
32
43
|
},
|
|
33
|
-
tools: [...SKILL_ARTIFACT_TOOLS],
|
|
44
|
+
tools: [...SKILL_ARTIFACT_TOOLS, accessRequestTool],
|
|
34
45
|
taskTools: 'all',
|
|
35
46
|
actsOnHireActivation: true,
|
|
36
47
|
respondsToProposals: true,
|
|
@@ -13,7 +13,7 @@ export function toolFromCapability(cap) {
|
|
|
13
13
|
const operatorKey = ctx?.['operatorKey'];
|
|
14
14
|
const agentId = ctx?.['agentId'];
|
|
15
15
|
// The lane the wake is running in was already threaded to this exact
|
|
16
|
-
// point by the shared executor (`
|
|
16
|
+
// point by the shared executor (`sessionId: effect.sessionId` in
|
|
17
17
|
// executeToolWithSideEffects). `laneFromToolContext` is the one reader
|
|
18
18
|
// for it, which makes the fence brain-agnostic by construction — the
|
|
19
19
|
// Claude brain, the FSM brain and hand-written tools all claim the same
|
|
@@ -18,7 +18,7 @@ export interface RecordReportInput {
|
|
|
18
18
|
* readable by the task's parties; a chat or agreement only widens where it also
|
|
19
19
|
* shows up. Pass at most one; when both arrive, agreementId wins.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
addressId?: string;
|
|
22
22
|
agreementId?: string;
|
|
23
23
|
/**
|
|
24
24
|
* Heavy deliverable text (document, diff, data).
|
|
@@ -14,7 +14,7 @@ import { ArtifactsClient, updateTaskState, } from '@ziggs-ai/api-client';
|
|
|
14
14
|
* Implements the B1 convention (Agents/REPORTING.md).
|
|
15
15
|
*/
|
|
16
16
|
export async function recordReport(input) {
|
|
17
|
-
const { creds, taskId, report,
|
|
17
|
+
const { creds, taskId, report, addressId, agreementId, deliverable } = input;
|
|
18
18
|
// no container needed. The deliverable is bound to its task, which
|
|
19
19
|
// is what makes it retrievable as `via=task:<taskId>` and readable by the
|
|
20
20
|
// task's parties — a chat or agreement was never what made that work.
|
|
@@ -25,7 +25,7 @@ export async function recordReport(input) {
|
|
|
25
25
|
// (the task's agreement and the chat it is running in), so there is no
|
|
26
26
|
// mistake to surface and nobody to retry: refusing would fail a finished
|
|
27
27
|
// task's delivery over a pair of ids it did not choose.
|
|
28
|
-
const scope = agreementId ? { agreementId } :
|
|
28
|
+
const scope = agreementId ? { agreementId } : addressId ? { addressId } : {};
|
|
29
29
|
// Deliverable FIRST, then close the task.
|
|
30
30
|
//
|
|
31
31
|
// The old order completed the task and then wrote the artifact with the
|
|
@@ -42,7 +42,7 @@ export async function recordReport(input) {
|
|
|
42
42
|
contentType: 'result',
|
|
43
43
|
taskId,
|
|
44
44
|
...scope,
|
|
45
|
-
visibility: '
|
|
45
|
+
visibility: 'address',
|
|
46
46
|
// Deterministic, not random: one deliverable per task, so a replay of this
|
|
47
47
|
// whole function reproduces the key and dedups server-side.
|
|
48
48
|
idempotencyKey: `task-result:${taskId}`,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* A custom tool builds `{ operatorKey, agentId }` by hand and stops there, so
|
|
5
5
|
* every call it makes runs on the narrowest reach fence there is: the agent's
|
|
6
6
|
* own org. `Agent` already threads the wake's lane into the tool context
|
|
7
|
-
* (as `
|
|
7
|
+
* (as `addressId` / `sessionId`, which is what the capability adapter reads), and
|
|
8
8
|
* the backend's fence is "own org ∪ the orgs of the parties to this lane" — so
|
|
9
9
|
* a tool that does not pass it loses reach it is entitled to, and loses it
|
|
10
10
|
* SILENTLY: enumerations come back short rather than refused.
|
package/dist/tools/toolCreds.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* A custom tool builds `{ operatorKey, agentId }` by hand and stops there, so
|
|
5
5
|
* every call it makes runs on the narrowest reach fence there is: the agent's
|
|
6
6
|
* own org. `Agent` already threads the wake's lane into the tool context
|
|
7
|
-
* (as `
|
|
7
|
+
* (as `addressId` / `sessionId`, which is what the capability adapter reads), and
|
|
8
8
|
* the backend's fence is "own org ∪ the orgs of the parties to this lane" — so
|
|
9
9
|
* a tool that does not pass it loses reach it is entitled to, and loses it
|
|
10
10
|
* SILENTLY: enumerations come back short rather than refused.
|
|
@@ -35,7 +35,9 @@ const str = (ctx, key) => {
|
|
|
35
35
|
* that agreement rather than inferring it from the room's mail.
|
|
36
36
|
*/
|
|
37
37
|
export function laneFromToolContext(ctx) {
|
|
38
|
-
|
|
38
|
+
// The executor names the lane `sessionId`; `addressId` is only the wake's
|
|
39
|
+
// explicit conversation, so it is the lane only where nothing else is.
|
|
40
|
+
const lane = str(ctx, 'sessionId') ?? str(ctx, 'addressId');
|
|
39
41
|
return lane ? laneUnderAgreement(lane, str(ctx, 'wakeAgreementId')) : undefined;
|
|
40
42
|
}
|
|
41
43
|
/**
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MessageCommand, MessageCommandResult } from '@ziggs-ai/contracts';
|
|
2
2
|
/**
|
|
3
3
|
* Foundation types for the agent SDK workflow runtime.
|
|
4
4
|
*
|
|
@@ -19,7 +19,14 @@ export interface AgreementRef {
|
|
|
19
19
|
paymentStatus?: string;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
+
/** Exact facts that prompted this attempt. References convey no read authority. */
|
|
23
|
+
export interface TaskInputRef {
|
|
24
|
+
kind: import('@ziggs-ai/contracts').ResourceKind;
|
|
25
|
+
id: string;
|
|
26
|
+
eventId: string;
|
|
27
|
+
}
|
|
22
28
|
export interface TaskRef {
|
|
29
|
+
inputs?: TaskInputRef[];
|
|
23
30
|
taskId: string;
|
|
24
31
|
agreementId?: string;
|
|
25
32
|
agreement?: AgreementRef;
|
|
@@ -130,7 +137,7 @@ export type Outcome = {
|
|
|
130
137
|
* `{ sessionId, ctx, queue, parked }`. `Identity` is the Agent's view of
|
|
131
138
|
* which session this tick belongs to. `sessionId` is opaque to the Agent —
|
|
132
139
|
* it's a string the Server uses to route inbound events and outbound
|
|
133
|
-
* effects. (Today, the Ziggs transport derives sessionId from `
|
|
140
|
+
* effects. (Today, the Ziggs transport derives sessionId from `addressId` at
|
|
134
141
|
* the wire boundary; non-chat surfaces will produce sessionIds of other
|
|
135
142
|
* shapes.)
|
|
136
143
|
*/
|
|
@@ -360,19 +367,15 @@ export interface ContextSnapshot {
|
|
|
360
367
|
timelineSummary?: string | null;
|
|
361
368
|
latestSequence?: string | null;
|
|
362
369
|
unavailable?: boolean;
|
|
363
|
-
/**
|
|
364
|
-
* The session's chat no longer resolves on the backend (messages read
|
|
365
|
-
* 404'd) — deleted or never visible to this agent. Message-triggered wakes
|
|
366
|
-
* check this and skip the LLM instead of reasoning over a fabricated empty
|
|
367
|
-
* history. Only gates message wakes. A bare agreementId as sessionId also
|
|
368
|
-
* trips it — that is a mis-keyed lane, not a legitimate task lane;
|
|
369
|
-
* task wakes should key on the agreement's origin/notification chat.
|
|
370
|
-
*/
|
|
371
|
-
chatMissing?: boolean;
|
|
372
370
|
/** Index signature so PromptBuilder's `ServerContext` can accept it directly. */
|
|
373
371
|
[key: string]: unknown;
|
|
374
372
|
}
|
|
375
373
|
export interface ReadContextOpts {
|
|
374
|
+
/** Optional message history. Task/work initialization does not require it.
|
|
375
|
+
* An exact triggering message is always read when the wake names one. */
|
|
376
|
+
includeHistory?: boolean;
|
|
377
|
+
/** Explicit read entry point; distinct from the processing session. */
|
|
378
|
+
via?: string;
|
|
376
379
|
workScopes?: Array<{
|
|
377
380
|
agreementId?: string;
|
|
378
381
|
taskId?: string;
|
|
@@ -434,7 +437,7 @@ export interface DeliveryWriteKeys {
|
|
|
434
437
|
taskStateKey(taskId: string, state: string): string | undefined;
|
|
435
438
|
/**
|
|
436
439
|
* Default messageId for a chat-message send of this wake — the backend dedups
|
|
437
|
-
* on (
|
|
440
|
+
* on (addressId, messageId). Derived from the emission's content (text + chat +
|
|
438
441
|
* receiver), not a per-wake ordinal: a wake that says two things
|
|
439
442
|
* gets two keys, and a redelivered wake that re-says the same text reuses the
|
|
440
443
|
* same key, while a re-think with different text does not collide and drop.
|
|
@@ -523,13 +526,7 @@ export type Effect = {
|
|
|
523
526
|
| {
|
|
524
527
|
kind: 'send-message';
|
|
525
528
|
sessionId: string;
|
|
526
|
-
|
|
527
|
-
text: string;
|
|
528
|
-
messageId?: string;
|
|
529
|
-
conversationAgreementId?: string;
|
|
530
|
-
underAgreementId?: string;
|
|
531
|
-
taskId?: string;
|
|
532
|
-
sources?: WriteSource[];
|
|
529
|
+
command: MessageCommand;
|
|
533
530
|
} | {
|
|
534
531
|
kind: 'record-event';
|
|
535
532
|
sessionId: string;
|
|
@@ -556,15 +553,8 @@ export interface EffectResultMap {
|
|
|
556
553
|
* widened to the room's humans. The send's own report rides along when the
|
|
557
554
|
* backend makes one: where it went. Routing is separate from acceptance.
|
|
558
555
|
*/
|
|
559
|
-
'send-message': {
|
|
556
|
+
'send-message': MessageCommandResult & {
|
|
560
557
|
ok: true;
|
|
561
|
-
chatId?: string;
|
|
562
|
-
messageId?: string;
|
|
563
|
-
delivered?: string;
|
|
564
|
-
to?: {
|
|
565
|
-
id: string;
|
|
566
|
-
type: string;
|
|
567
|
-
};
|
|
568
558
|
};
|
|
569
559
|
'record-event': {
|
|
570
560
|
ok: true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziggs-ai/agent-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "Agent framework SDK for building autonomous agents on the Ziggs platform",
|
|
5
5
|
"homepage": "https://ziggsai.com/docs",
|
|
6
6
|
"bugs": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@anthropic-ai/claude-agent-sdk": "^0.3.284",
|
|
31
31
|
"@anthropic-ai/sdk": "^0.110.0",
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
33
|
-
"@ziggs-ai/api-client": "0.
|
|
34
|
-
"@ziggs-ai/contracts": "
|
|
33
|
+
"@ziggs-ai/api-client": "0.39.0",
|
|
34
|
+
"@ziggs-ai/contracts": "0.37.0",
|
|
35
35
|
"ajv": "^8.17.1",
|
|
36
36
|
"dotenv": "^17.2.3",
|
|
37
37
|
"openai": "^4.0.0",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CHAT_CAPABILITIES, openConversationCapability } from '@ziggs-ai/api-client';
|
|
2
|
-
import { toolFromCapability, toolsFromCapabilities } from '../../../tools/capabilityAdapter.js';
|
|
3
|
-
// chat_open only (chat listing stays a
|
|
4
|
-
// context-rail read, rule); defined once in api-client's shared
|
|
5
|
-
// capability layer.
|
|
6
|
-
export const openConversationTool = toolFromCapability(openConversationCapability);
|
|
7
|
-
export const CHAT_TOOLS = toolsFromCapabilities(CHAT_CAPABILITIES);
|
package/dist/probeChat.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One classifier for store-publish probe rooms.
|
|
3
|
-
*
|
|
4
|
-
* The runner mints `probe_<agentId>_<ts>`. That prefix skips the wake gate
|
|
5
|
-
* and the wake-rate breaker, so a store publish still hears a model reply.
|
|
6
|
-
* It does not write a canned answer, and it is not capability evidence.
|
|
7
|
-
* Capability versus liveness is decided by the store sync.
|
|
8
|
-
*/
|
|
9
|
-
export declare const PROBE_CHAT_ID_PREFIX = "probe_";
|
|
10
|
-
export declare function isPublishProbeChat(chatId: string | undefined | null): boolean;
|
package/dist/probeChat.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One classifier for store-publish probe rooms.
|
|
3
|
-
*
|
|
4
|
-
* The runner mints `probe_<agentId>_<ts>`. That prefix skips the wake gate
|
|
5
|
-
* and the wake-rate breaker, so a store publish still hears a model reply.
|
|
6
|
-
* It does not write a canned answer, and it is not capability evidence.
|
|
7
|
-
* Capability versus liveness is decided by the store sync.
|
|
8
|
-
*/
|
|
9
|
-
export const PROBE_CHAT_ID_PREFIX = 'probe_';
|
|
10
|
-
export function isPublishProbeChat(chatId) {
|
|
11
|
-
return typeof chatId === 'string' && chatId.startsWith(PROBE_CHAT_ID_PREFIX);
|
|
12
|
-
}
|