@ziggs-ai/api-client 0.19.0 → 0.21.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/dist/capabilities/agreementVerbs.d.ts +7 -0
- package/dist/capabilities/agreementVerbs.js +84 -1
- package/dist/capabilities/agreements.d.ts +3 -0
- package/dist/capabilities/agreements.js +9 -1
- package/dist/capabilities/artifacts.d.ts +38 -0
- package/dist/capabilities/artifacts.js +148 -7
- package/dist/capabilities/chat.d.ts +31 -1
- package/dist/capabilities/chat.js +39 -0
- package/dist/capabilities/context.d.ts +3 -0
- package/dist/capabilities/context.js +125 -1
- package/dist/capabilities/index.d.ts +6 -6
- package/dist/capabilities/index.js +6 -6
- package/dist/capabilities/introductions.js +5 -10
- package/dist/capabilities/links.js +1 -0
- package/dist/capabilities/marketplace.js +15 -6
- package/dist/capabilities/nextCall.d.ts +72 -14
- package/dist/capabilities/nextCall.js +279 -4
- package/dist/capabilities/tasks.d.ts +68 -1
- package/dist/capabilities/tasks.js +112 -3
- package/dist/engagementGuide.d.ts +148 -0
- package/dist/engagementGuide.js +349 -0
- package/dist/http/AgreementClient.d.ts +2 -1
- package/dist/http/AgreementClient.js +4 -0
- package/dist/http/ArtifactsClient.d.ts +47 -0
- package/dist/http/ArtifactsClient.js +33 -0
- package/dist/http/ChatClient.d.ts +28 -2
- package/dist/http/ChatClient.js +7 -0
- package/dist/http/ContextGrantsClient.d.ts +17 -1
- package/dist/http/ContextGrantsClient.js +26 -2
- package/dist/http/ContextOpenClient.d.ts +70 -0
- package/dist/http/ContextOpenClient.js +52 -0
- package/dist/http/InboxClient.d.ts +8 -0
- package/dist/http/InboxClient.js +18 -0
- package/dist/http/TaskClient.d.ts +2 -0
- package/dist/http/TaskClient.js +1 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/instanceIdentity.d.ts +1 -1
- package/dist/instanceIdentity.js +2 -2
- package/dist/sessionOrientation.d.ts +50 -0
- package/dist/sessionOrientation.js +43 -0
- package/dist/types.d.ts +11 -0
- package/package.json +2 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const CONTEXT_OPEN_KINDS: readonly ["artifact", "chat", "task", "agreement"];
|
|
2
|
+
export type ContextOpenKind = (typeof CONTEXT_OPEN_KINDS)[number];
|
|
3
|
+
export type ContextOpenOutcome = 'ok' | 'unreadable' | 'hidden';
|
|
4
|
+
export interface ContextOpenRef {
|
|
5
|
+
kind: ContextOpenKind;
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ContextOpenBody {
|
|
9
|
+
artifactId?: string;
|
|
10
|
+
chatId?: string;
|
|
11
|
+
taskId?: string;
|
|
12
|
+
agreementId?: string;
|
|
13
|
+
cursor?: string;
|
|
14
|
+
after?: string;
|
|
15
|
+
limit?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ContextOpenAbilities {
|
|
18
|
+
read: boolean;
|
|
19
|
+
reply: boolean;
|
|
20
|
+
share: boolean;
|
|
21
|
+
delegate: boolean;
|
|
22
|
+
approve: boolean;
|
|
23
|
+
download: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ContextOpenAccess {
|
|
26
|
+
abilities: ContextOpenAbilities;
|
|
27
|
+
summary: string;
|
|
28
|
+
document?: {
|
|
29
|
+
empty: boolean;
|
|
30
|
+
extractionStatus?: string | null;
|
|
31
|
+
};
|
|
32
|
+
continuation?: {
|
|
33
|
+
kind: 'owner_decision';
|
|
34
|
+
summary: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface ContextOpenResult {
|
|
38
|
+
outcome: ContextOpenOutcome;
|
|
39
|
+
ref: ContextOpenRef;
|
|
40
|
+
access: ContextOpenAccess;
|
|
41
|
+
workContext: {
|
|
42
|
+
laneId: string | null;
|
|
43
|
+
};
|
|
44
|
+
page?: {
|
|
45
|
+
type: string;
|
|
46
|
+
via: {
|
|
47
|
+
kind: string;
|
|
48
|
+
id: string;
|
|
49
|
+
};
|
|
50
|
+
items: unknown[];
|
|
51
|
+
hasMore: boolean;
|
|
52
|
+
nextCursor: string | null;
|
|
53
|
+
latestSequence?: string | null;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export type ContextExplainResult = Omit<ContextOpenResult, 'page'>;
|
|
57
|
+
/**
|
|
58
|
+
* Open or explain a returned reference. The server resolves the read path;
|
|
59
|
+
* the caller does not send type, via, or a grant id.
|
|
60
|
+
*/
|
|
61
|
+
export declare class ContextOpenClient {
|
|
62
|
+
private readonly operatorKey;
|
|
63
|
+
private readonly agentId?;
|
|
64
|
+
private readonly baseUrl?;
|
|
65
|
+
private readonly laneId?;
|
|
66
|
+
constructor(operatorKey: string, agentId?: string | undefined, baseUrl?: string | undefined, laneId?: string | undefined);
|
|
67
|
+
open(body: ContextOpenBody): Promise<ContextOpenResult>;
|
|
68
|
+
explain(body: ContextOpenBody): Promise<ContextExplainResult>;
|
|
69
|
+
private post;
|
|
70
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { getBackendUrl } from '../utils/urlUtils.js';
|
|
2
|
+
import { pollSurfaceError } from '../shared/rateLimit.js';
|
|
3
|
+
import { buildOperatorHeaders } from './operatorHeaders.js';
|
|
4
|
+
export const CONTEXT_OPEN_KINDS = [
|
|
5
|
+
'artifact',
|
|
6
|
+
'chat',
|
|
7
|
+
'task',
|
|
8
|
+
'agreement',
|
|
9
|
+
];
|
|
10
|
+
/**
|
|
11
|
+
* Open or explain a returned reference. The server resolves the read path;
|
|
12
|
+
* the caller does not send type, via, or a grant id.
|
|
13
|
+
*/
|
|
14
|
+
export class ContextOpenClient {
|
|
15
|
+
operatorKey;
|
|
16
|
+
agentId;
|
|
17
|
+
baseUrl;
|
|
18
|
+
laneId;
|
|
19
|
+
constructor(operatorKey, agentId, baseUrl, laneId) {
|
|
20
|
+
this.operatorKey = operatorKey;
|
|
21
|
+
this.agentId = agentId;
|
|
22
|
+
this.baseUrl = baseUrl;
|
|
23
|
+
this.laneId = laneId;
|
|
24
|
+
if (!operatorKey)
|
|
25
|
+
throw new Error('ContextOpenClient: operatorKey is required');
|
|
26
|
+
}
|
|
27
|
+
async open(body) {
|
|
28
|
+
return this.post('/context/open', body);
|
|
29
|
+
}
|
|
30
|
+
async explain(body) {
|
|
31
|
+
return this.post('/context/access/explain', body);
|
|
32
|
+
}
|
|
33
|
+
async post(path, body) {
|
|
34
|
+
const filled = ['artifactId', 'chatId', 'taskId', 'agreementId'].filter((key) => typeof body[key] === 'string' && body[key].trim());
|
|
35
|
+
if (filled.length !== 1) {
|
|
36
|
+
throw new Error('ContextOpenClient: pass exactly one of artifactId, chatId, taskId, agreementId');
|
|
37
|
+
}
|
|
38
|
+
const url = `${this.baseUrl || getBackendUrl()}${path}`;
|
|
39
|
+
const res = await fetch(url, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: {
|
|
42
|
+
...buildOperatorHeaders(this.operatorKey, this.agentId, { 'Content-Type': 'application/json' }, this.laneId),
|
|
43
|
+
},
|
|
44
|
+
body: JSON.stringify(body),
|
|
45
|
+
});
|
|
46
|
+
const text = await res.text().catch(() => '');
|
|
47
|
+
if (!res.ok) {
|
|
48
|
+
throw pollSurfaceError(`ContextOpenClient ${path}`, res, text);
|
|
49
|
+
}
|
|
50
|
+
return JSON.parse(text);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -36,6 +36,14 @@ export declare class InboxClient {
|
|
|
36
36
|
ack(upTo: string, opts?: {
|
|
37
37
|
handledResourceIds?: string[];
|
|
38
38
|
}): Promise<InboxAckResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Ack, and if the row still names a host that has already gone away,
|
|
41
|
+
* read once (that is what takes an expired inbox) and ack again.
|
|
42
|
+
* A second host-conflict is a live competitor and is rethrown unchanged.
|
|
43
|
+
*/
|
|
44
|
+
ackOrTakeHost(upTo: string, opts?: {
|
|
45
|
+
handledResourceIds?: string[];
|
|
46
|
+
}): Promise<InboxAckResult>;
|
|
39
47
|
/**
|
|
40
48
|
* Drop this process's inbox host lease so another client can take
|
|
41
49
|
* GET /inbox on its next read.
|
package/dist/http/InboxClient.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getBackendUrl } from '../utils/urlUtils.js';
|
|
2
2
|
import { pollSurfaceError } from '../shared/rateLimit.js';
|
|
3
|
+
import { ApiError } from '../types.js';
|
|
3
4
|
import { INBOX_HOST_CLAIMANT_HEADER, hostIdentity, } from '../instanceIdentity.js';
|
|
4
5
|
/**
|
|
5
6
|
* The doorbell, not the door: references addressed to this agent
|
|
@@ -96,6 +97,23 @@ export class InboxClient {
|
|
|
96
97
|
}
|
|
97
98
|
return JSON.parse(body);
|
|
98
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Ack, and if the row still names a host that has already gone away,
|
|
102
|
+
* read once (that is what takes an expired inbox) and ack again.
|
|
103
|
+
* A second host-conflict is a live competitor and is rethrown unchanged.
|
|
104
|
+
*/
|
|
105
|
+
async ackOrTakeHost(upTo, opts = {}) {
|
|
106
|
+
try {
|
|
107
|
+
return await this.ack(upTo, opts);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
if (!(err instanceof ApiError) || err.code !== 'INBOX_HOST_CONFLICT') {
|
|
111
|
+
throw err;
|
|
112
|
+
}
|
|
113
|
+
await this.getInbox();
|
|
114
|
+
return await this.ack(upTo, opts);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
99
117
|
/**
|
|
100
118
|
* Drop this process's inbox host lease so another client can take
|
|
101
119
|
* GET /inbox on its next read.
|
|
@@ -6,6 +6,8 @@ import { type Creds, type Task, type TaskState } from '../types.js';
|
|
|
6
6
|
export interface TaskWriteConfirm {
|
|
7
7
|
ok: true;
|
|
8
8
|
taskId: string;
|
|
9
|
+
/** The agreement the task hangs under, when the server reports it. */
|
|
10
|
+
agreementId?: string;
|
|
9
11
|
state: TaskState;
|
|
10
12
|
updatedAt?: string;
|
|
11
13
|
status?: string;
|
package/dist/http/TaskClient.js
CHANGED
|
@@ -37,6 +37,7 @@ function extractWriteConfirm(data) {
|
|
|
37
37
|
return {
|
|
38
38
|
ok: true,
|
|
39
39
|
taskId: d['taskId'],
|
|
40
|
+
...(typeof d['agreementId'] === 'string' ? { agreementId: d['agreementId'] } : {}),
|
|
40
41
|
state: d['state'],
|
|
41
42
|
...(typeof d['updatedAt'] === 'string' || d['updatedAt'] instanceof Date
|
|
42
43
|
? { updatedAt: String(d['updatedAt']) }
|
package/dist/http/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { ArtifactsClient, artifactScopeForSession, AGREEMENT_LANE_PREFIX, ARTIFA
|
|
|
9
9
|
export type { ArtifactVisibility, ListArtifactsOptions, ListArtifactsQuery, ListArtifactsResult, WriteArtifactInput, } from './ArtifactsClient.js';
|
|
10
10
|
export { ContextReadClient, CONTEXT_READ_TYPES, CONTEXT_READ_VIA, VIA_KINDS, parseVia, viaHint, } from './ContextReadClient.js';
|
|
11
11
|
export type { ContextReadType, ContextReadQuery, ContextReadEnvelope, ContextSnapshotResult, ContextSnapshotParticipant, ViaKind, } from './ContextReadClient.js';
|
|
12
|
+
export { ContextOpenClient, CONTEXT_OPEN_KINDS } from './ContextOpenClient.js';
|
|
13
|
+
export type { ContextOpenKind, ContextOpenOutcome, ContextOpenRef, ContextOpenBody, ContextOpenAbilities, ContextOpenAccess, ContextOpenResult, ContextExplainResult, } from './ContextOpenClient.js';
|
|
12
14
|
export { ContextDiscoveryClient } from './ContextDiscoveryClient.js';
|
|
13
15
|
export type { DiscoverableItem } from './ContextDiscoveryClient.js';
|
|
14
16
|
export { IntroductionsClient } from './IntroductionsClient.js';
|
package/dist/http/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { ArtifactsClient,
|
|
|
8
8
|
// agreement lanes are not chats — callers scope artifact writes with this.
|
|
9
9
|
artifactScopeForSession, AGREEMENT_LANE_PREFIX, ARTIFACT_INLINE_TEXT_MAX_CHARS, ARTIFACT_INLINE_TEXT_OVER_LIMIT_HINT, } from './ArtifactsClient.js';
|
|
10
10
|
export { ContextReadClient, CONTEXT_READ_TYPES, CONTEXT_READ_VIA, VIA_KINDS, parseVia, viaHint, } from './ContextReadClient.js';
|
|
11
|
+
export { ContextOpenClient, CONTEXT_OPEN_KINDS } from './ContextOpenClient.js';
|
|
11
12
|
export { ContextDiscoveryClient } from './ContextDiscoveryClient.js';
|
|
12
13
|
export { IntroductionsClient } from './IntroductionsClient.js';
|
|
13
14
|
export { GrantsClient } from './GrantsClient.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -18,3 +18,7 @@ export { agreementLaneId, agreementIdFromLane, isAgreementLaneId, isAgreementId
|
|
|
18
18
|
export * from './shared/operatorKey.js';
|
|
19
19
|
export { INBOX_HOST_CLAIMANT_HEADER, INSTANCE_IDENTITY_MAX_LENGTH, cliHostIdentity, hostIdentity, instanceIdentity, mcpConnectionIdentity, } from './instanceIdentity.js';
|
|
20
20
|
export * from './utils/appUrls.js';
|
|
21
|
+
export { sessionOrientation, } from './sessionOrientation.js';
|
|
22
|
+
export type { ContinuationKind, InboxAckDriver, InboxHandling, RepresentedPerson, SessionContinuation, SessionOrientation, SessionOrientationInput, } from './sessionOrientation.js';
|
|
23
|
+
export { inboxEngagement, isEchoOrDuplicate, isHireWorkOrder, contactPath, formationGuide, marketplaceFormation, liveHireChangedTerms, liveHireConflictFromStatus, withdrawHeldGraph, reminderHonesty, graphReleaseHonesty, hintsFromTasks, } from './engagementGuide.js';
|
|
24
|
+
export type { EngagementGuide, EngagementGuideKind, EngagementOutcome, EngagementTaskHint, ContactPathInput, FormationInput, GraphHonesty, HireTermsHonesty, WaitingOn, } from './engagementGuide.js';
|
package/dist/index.js
CHANGED
|
@@ -18,3 +18,5 @@ export { agreementLaneId, agreementIdFromLane, isAgreementLaneId, isAgreementId
|
|
|
18
18
|
export * from './shared/operatorKey.js';
|
|
19
19
|
export { INBOX_HOST_CLAIMANT_HEADER, INSTANCE_IDENTITY_MAX_LENGTH, cliHostIdentity, hostIdentity, instanceIdentity, mcpConnectionIdentity, } from './instanceIdentity.js';
|
|
20
20
|
export * from './utils/appUrls.js';
|
|
21
|
+
export { sessionOrientation, } from './sessionOrientation.js';
|
|
22
|
+
export { inboxEngagement, isEchoOrDuplicate, isHireWorkOrder, contactPath, formationGuide, marketplaceFormation, liveHireChangedTerms, liveHireConflictFromStatus, withdrawHeldGraph, reminderHonesty, graphReleaseHonesty, hintsFromTasks, } from './engagementGuide.js';
|
|
@@ -25,7 +25,7 @@ export declare function cliHostIdentity(): string;
|
|
|
25
25
|
*
|
|
26
26
|
* Not the backend task's identity. That process serves every connected
|
|
27
27
|
* assistant at once, so its own identity makes them one host and changes under
|
|
28
|
-
* all of them on every deploy — a hosted read answering 409 for up to
|
|
28
|
+
* all of them on every deploy — a hosted read answering 409 for up to 220
|
|
29
29
|
* seconds after each restart, and replicas refusing each other's agents.
|
|
30
30
|
*
|
|
31
31
|
* The key survives both. A token refresh re-signs the same `keyId`, so an
|
package/dist/instanceIdentity.js
CHANGED
|
@@ -4,7 +4,7 @@ import { decodeOperatorKeyClaims } from './shared/operatorKey.js';
|
|
|
4
4
|
*
|
|
5
5
|
* `X-Ziggs-Instance` decides inbox ownership: the first host to read acquires
|
|
6
6
|
* an agent's whole inbox, a second host is refused with
|
|
7
|
-
* `409 INBOX_HOST_CONFLICT` until the owner has stopped renewing for
|
|
7
|
+
* `409 INBOX_HOST_CONFLICT` until the owner has stopped renewing for 220
|
|
8
8
|
* seconds, and an ack renews an owner but never acquires. A missing or
|
|
9
9
|
* overlong value is `400 INBOX_HOST_REQUIRED`.
|
|
10
10
|
*
|
|
@@ -71,7 +71,7 @@ export function cliHostIdentity() {
|
|
|
71
71
|
*
|
|
72
72
|
* Not the backend task's identity. That process serves every connected
|
|
73
73
|
* assistant at once, so its own identity makes them one host and changes under
|
|
74
|
-
* all of them on every deploy — a hosted read answering 409 for up to
|
|
74
|
+
* all of them on every deploy — a hosted read answering 409 for up to 220
|
|
75
75
|
* seconds after each restart, and replicas refusing each other's agents.
|
|
76
76
|
*
|
|
77
77
|
* The key survives both. A token refresh re-signs the same `keyId`, so an
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who this session is, who it represents, and whether it can continue
|
|
3
|
+
* unattended. Built from the binding the caller already has. Does not
|
|
4
|
+
* read mail and does not take the inbox lease.
|
|
5
|
+
*/
|
|
6
|
+
export type InboxAckDriver = 'agent' | 'host';
|
|
7
|
+
export type ContinuationKind = 'manual' | 'scheduled';
|
|
8
|
+
export interface RepresentedPerson {
|
|
9
|
+
/** The human this agent acts for. Null when the key does not name one. */
|
|
10
|
+
id: string | null;
|
|
11
|
+
kind: 'user';
|
|
12
|
+
}
|
|
13
|
+
export interface SessionContinuation {
|
|
14
|
+
kind: ContinuationKind;
|
|
15
|
+
canScheduleWake: boolean;
|
|
16
|
+
summary: string;
|
|
17
|
+
}
|
|
18
|
+
export interface InboxHandling {
|
|
19
|
+
/** Who closes the inbox loop. Never both on the same identity. */
|
|
20
|
+
ackDriver: InboxAckDriver;
|
|
21
|
+
readAcquiresHost: true;
|
|
22
|
+
peekDoesNotAcquire: true;
|
|
23
|
+
peek: {
|
|
24
|
+
tool: string;
|
|
25
|
+
http: {
|
|
26
|
+
method: 'GET';
|
|
27
|
+
path: '/inbox/peek';
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface SessionOrientation {
|
|
32
|
+
representedPerson: RepresentedPerson;
|
|
33
|
+
continuation: SessionContinuation;
|
|
34
|
+
inboxHandling: InboxHandling;
|
|
35
|
+
identity: {
|
|
36
|
+
agentId: string;
|
|
37
|
+
distinctFromBackgroundWorker: true;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface SessionOrientationInput {
|
|
41
|
+
agentId: string;
|
|
42
|
+
ownerUserId: string | null;
|
|
43
|
+
/** MCP assistants ack themselves. The hosted SDK host acks; the brain does not. */
|
|
44
|
+
surface: 'mcp' | 'sdk';
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Facts a cold entry needs that `session.ownerId` never labelled: the
|
|
48
|
+
* represented person, whether this host can arm a wake, and who drives ack.
|
|
49
|
+
*/
|
|
50
|
+
export declare function sessionOrientation(input: SessionOrientationInput): SessionOrientation;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who this session is, who it represents, and whether it can continue
|
|
3
|
+
* unattended. Built from the binding the caller already has. Does not
|
|
4
|
+
* read mail and does not take the inbox lease.
|
|
5
|
+
*/
|
|
6
|
+
const PEEK = {
|
|
7
|
+
tool: 'ziggs_inbox_peek',
|
|
8
|
+
http: { method: 'GET', path: '/inbox/peek' },
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Facts a cold entry needs that `session.ownerId` never labelled: the
|
|
12
|
+
* represented person, whether this host can arm a wake, and who drives ack.
|
|
13
|
+
*/
|
|
14
|
+
export function sessionOrientation(input) {
|
|
15
|
+
const mcp = input.surface === 'mcp';
|
|
16
|
+
return {
|
|
17
|
+
representedPerson: {
|
|
18
|
+
id: input.ownerUserId,
|
|
19
|
+
kind: 'user',
|
|
20
|
+
},
|
|
21
|
+
continuation: mcp
|
|
22
|
+
? {
|
|
23
|
+
kind: 'manual',
|
|
24
|
+
canScheduleWake: false,
|
|
25
|
+
summary: 'This MCP session has no wake_at. Continue by calling ziggs_inbox again — a scheduler in the host is the only unattended path.',
|
|
26
|
+
}
|
|
27
|
+
: {
|
|
28
|
+
kind: 'scheduled',
|
|
29
|
+
canScheduleWake: true,
|
|
30
|
+
summary: 'The hosted runtime can arm wake_at. The brain does not ack; the host owns the inbox loop.',
|
|
31
|
+
},
|
|
32
|
+
inboxHandling: {
|
|
33
|
+
ackDriver: mcp ? 'agent' : 'host',
|
|
34
|
+
readAcquiresHost: true,
|
|
35
|
+
peekDoesNotAcquire: true,
|
|
36
|
+
peek: PEEK,
|
|
37
|
+
},
|
|
38
|
+
identity: {
|
|
39
|
+
agentId: input.agentId,
|
|
40
|
+
distinctFromBackgroundWorker: true,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -216,6 +216,17 @@ export interface Agreement {
|
|
|
216
216
|
lifecycle?: string;
|
|
217
217
|
expiresAt?: string;
|
|
218
218
|
maxExecutions?: number;
|
|
219
|
+
/**
|
|
220
|
+
* What `money.price` MEANS: `total` is the whole engagement, settled once;
|
|
221
|
+
* `per_task` is a rate charged as each task completes.
|
|
222
|
+
*
|
|
223
|
+
* The server has always stamped it (`terms.billing`, defaulting to
|
|
224
|
+
* `total`), and the marketplace row shows it, but the agreement an agent
|
|
225
|
+
* actually reads before working under it did not lift it. A rate then read as
|
|
226
|
+
* a total: one number, two meanings, and nothing on the row to tell them
|
|
227
|
+
* apart. Absent on rows written before the field existed, which read `total`.
|
|
228
|
+
*/
|
|
229
|
+
billing?: 'total' | 'per_task';
|
|
219
230
|
/**
|
|
220
231
|
* Seat bookkeeping when this agreement is an open link invite. Each claim
|
|
221
232
|
* takes a seat and mints its own child link, so one shared link produces N
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziggs-ai/api-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "HTTP and WebSocket client for the Ziggs backend API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"socket.io-client": "^4.7.0",
|
|
31
|
-
"@ziggs-ai/contracts": "^0.
|
|
31
|
+
"@ziggs-ai/contracts": "^0.9.0"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"ziggs",
|