@ziggs-ai/agent-sdk 0.41.0 → 0.41.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 CHANGED
@@ -32,6 +32,10 @@
32
32
 
33
33
  ## Unreleased
34
34
 
35
+ ## 0.41.1
36
+
37
+ - Publishing names a third audience, `company`: every team in your active organization's company. A listing posted to it counts as a listing when the agent reads its wakes. Built on `@ziggs-ai/api-client` 0.37.26.
38
+
35
39
  ## 0.41.0
36
40
 
37
41
  - Claude-brain agents run work only under a task they hold. A custom tool, and the platform tools that write work onto a task, need a task assigned to the agent under an active work agreement, verified with the backend on every call; the task's agreement is the permission. The agent names the task in each wake: custom tools gain a `taskId` parameter the model fills and the handler never sees, later calls in the wake keep the task last named, and a task the agent opens for itself in that wake is the one it works under next. A task from an earlier wake is never a default. The host never opens a task and reads nothing off the waking message. Agreeing, managing, reading and talking stay open. Tool results carry the verified binding and operation records are scoped to it. `executionControl` lets other brains opt in or a host opt out; `execution: 'conversation'` keeps a custom tool open. Third-party API and MCP clients are unchanged.
@@ -6,7 +6,8 @@ export declare class AgreementService {
6
6
  proposeDirect(payload: ProposeDirectInput): Promise<Agreement>;
7
7
  /**
8
8
  * Open buyer-broadcast. `payload.audience` selects who may see/claim it:
9
- * 'everyone' (default, fully public) or 'org' (members of your active org).
9
+ * 'everyone' (default, fully public), 'org' (members of your active org) or
10
+ * 'company' (members of every team in your active org's company).
10
11
  * Server defaults engagementKind to `service`.
11
12
  */
12
13
  proposeBroadcast(payload: ProposeBroadcastInput): Promise<Agreement>;
@@ -23,7 +24,8 @@ export declare class AgreementService {
23
24
  }>;
24
25
  /**
25
26
  * Seller-broadcast marketplace offer. `payload.audience` sets the `payer`
26
- * sentinel: 'everyone' (default, public) or 'org' (your active org only).
27
+ * sentinel: 'everyone' (default, public), 'org' (your active org only) or
28
+ * 'company' (every team in your company).
27
29
  */
28
30
  publishOffer(payload: PublishOfferPayload): Promise<Agreement>;
29
31
  delegate(payload: DelegateAgreementData): Promise<Agreement>;
@@ -14,7 +14,8 @@ export class AgreementService {
14
14
  }
15
15
  /**
16
16
  * Open buyer-broadcast. `payload.audience` selects who may see/claim it:
17
- * 'everyone' (default, fully public) or 'org' (members of your active org).
17
+ * 'everyone' (default, fully public), 'org' (members of your active org) or
18
+ * 'company' (members of every team in your active org's company).
18
19
  * Server defaults engagementKind to `service`.
19
20
  */
20
21
  proposeBroadcast(payload) {
@@ -34,7 +35,8 @@ export class AgreementService {
34
35
  }
35
36
  /**
36
37
  * Seller-broadcast marketplace offer. `payload.audience` sets the `payer`
37
- * sentinel: 'everyone' (default, public) or 'org' (your active org only).
38
+ * sentinel: 'everyone' (default, public), 'org' (your active org only) or
39
+ * 'company' (every team in your company).
38
40
  */
39
41
  publishOffer(payload) {
40
42
  return publishOfferApi(payload, this.creds);
@@ -8,7 +8,8 @@
8
8
  * agreementService) injected into tool context — NOT passed in the user `tools:`
9
9
  * array. Publishing open work is part of this grammar:
10
10
  * agreement_propose({ proposedTo: "everyone" }) for a public broadcast, or
11
- * proposedTo: "org" to scope it to your org — there is no separate publish tool.
11
+ * proposedTo: "org" to scope it to your org, or "company" to every team in your
12
+ * company — there is no separate publish tool.
12
13
  *
13
14
  * Tier 2 — capability bundles (tier2/). Opt-in, HTTP-backed tool bundles an agent
14
15
  * chooses to have. Off by default; an agent gains a bundle by spreading it into
@@ -8,7 +8,8 @@
8
8
  * agreementService) injected into tool context — NOT passed in the user `tools:`
9
9
  * array. Publishing open work is part of this grammar:
10
10
  * agreement_propose({ proposedTo: "everyone" }) for a public broadcast, or
11
- * proposedTo: "org" to scope it to your org — there is no separate publish tool.
11
+ * proposedTo: "org" to scope it to your org, or "company" to every team in your
12
+ * company — there is no separate publish tool.
12
13
  *
13
14
  * Tier 2 — capability bundles (tier2/). Opt-in, HTTP-backed tool bundles an agent
14
15
  * chooses to have. Off by default; an agent gains a bundle by spreading it into
@@ -64,7 +64,7 @@ export const agreementProposeTool = defineTool('agreement_propose', {
64
64
  parentAgreementId: 'string',
65
65
  providerId: { type: 'string', description: AGREEMENT_PROPOSE_PROVIDER_ID_DESCRIPTION },
66
66
  agreementDescription: 'string',
67
- }, handlerFor('agreement_propose'), { description: 'Propose an agreement — direct, broadcast, or link; there are no separate publish tools. Engagement precedence (posted-first): 1) REUSE an active agreement on matching terms, 2) CLAIM the counterparty\'s listing (marketplace_view → agreement_claim; never counter a listing), 3) POST a request broadcast here when nothing listed fits, 4) direct-propose ONLY for bespoke terms, renegotiation, or commissioning a named counterparty with no listing — most published agents are claim-only and refuse direct proposals with a pointer at their listing. Direction is stated, never guessed: providerId = your own id ("I work, you pay") or providerId = proposedTo ("you work, I pay") on direct proposals. Broadcast with proposedTo="everyone" (fully public) or "org" (your org only) and no providerId posts a REQUEST any agent may claim. A person or the deploy publishes a standing listing; this agent does not. For a bilateral trust link, use link_propose: it takes an email or an agent id, or neither for a share link. engagementKind defaults to service. Agreements are STANDING by default (no expiry, unlimited tasks under one agreement); set expiresAt or maxExecutions only when the engagement should end on its own.', isAgreementCreation: true });
67
+ }, handlerFor('agreement_propose'), { description: 'Propose an agreement — direct, broadcast, or link; there are no separate publish tools. Engagement precedence (posted-first): 1) REUSE an active agreement on matching terms, 2) CLAIM the counterparty\'s listing (marketplace_view → agreement_claim; never counter a listing), 3) POST a request broadcast here when nothing listed fits, 4) direct-propose ONLY for bespoke terms, renegotiation, or commissioning a named counterparty with no listing — most published agents are claim-only and refuse direct proposals with a pointer at their listing. Direction is stated, never guessed: providerId = your own id ("I work, you pay") or providerId = proposedTo ("you work, I pay") on direct proposals. Broadcast with proposedTo="everyone" (fully public), "org" (your org only) or "company" (every team in your company) and no providerId posts a REQUEST any agent may claim. A person or the deploy publishes a standing listing; this agent does not. For a bilateral trust link, use link_propose: it takes an email or an agent id, or neither for a share link. engagementKind defaults to service. Agreements are STANDING by default (no expiry, unlimited tasks under one agreement); set expiresAt or maxExecutions only when the engagement should end on its own.', isAgreementCreation: true });
68
68
  export const agreementSubcontractTool = defineTool('agreement_subcontract', agreementSubcontractCapability.params, handlerFor('agreement_subcontract'), { description: agreementSubcontractCapability.descriptions.sdk, isAgreementCreation: true });
69
69
  export const agreementRespondTool = defineTool('agreement_respond', { agreementId: { type: 'string', required: true }, action: { type: 'string', required: true, enum: ['approve', 'reject'] } }, handlerFor('agreement_respond'), { description: 'Approve or reject a pending DIRECT agreement proposal addressed to you. Open broadcasts (requests, standing offers, link invites) have no personal approval slot — claim those with agreement_claim instead, or ignore them to pass. ONE exception: a hand-off that pins YOU as provider carries your pending approval even as an open broadcast — approving consents to serving whoever claims it (the row stays open for claims); rejecting cancels the hand-off. Ignoring it leaves the hand-off unclaimable, so always respond.' });
70
70
  export const agreementClaimTool = defineTool('agreement_claim', agreementClaimCapability.params, handlerFor('agreement_claim'), { description: agreementClaimCapability.descriptions.sdk });
@@ -3,7 +3,7 @@ import { toolFromCapability, toolsFromCapabilities } from '../../../tools/capabi
3
3
  // the marketplace read (requests AND standing offers),
4
4
  // defined once in api-client's shared capability layer. Publishing is NOT
5
5
  // here: it is the tier-1 verb agreement_propose with proposedTo
6
- // "everyone" | "org" (providerId = own id for an offer, omitted for a request);
6
+ // "everyone" | "org" | "company" (providerId = own id for an offer, omitted for a request);
7
7
  // claiming is agreement_claim.
8
8
  export const marketplaceViewTool = toolFromCapability(marketplaceViewCapability);
9
9
  export const MARKETPLACE_TOOLS = toolsFromCapabilities(MARKETPLACE_CAPABILITIES);
@@ -10,7 +10,8 @@ export function isListing(agreement) {
10
10
  const a = row(agreement);
11
11
  const payer = row(a.parties).payer;
12
12
  const principal = typeof payer === 'string' ? payer : row(payer).principal;
13
- return (principal === 'everyone' || principal === 'org') && a.engagementKind !== 'link';
13
+ return ((principal === 'everyone' || principal === 'org' || principal === 'company') &&
14
+ a.engagementKind !== 'link');
14
15
  }
15
16
  /** Enrich each wake from the agreement it actually names, never from the room's
16
17
  * latest deal. Reads use the agent's credentials; no grants are inferred here. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/agent-sdk",
3
- "version": "0.41.0",
3
+ "version": "0.41.1",
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.37.23",
34
- "@ziggs-ai/contracts": "^0.23.3",
33
+ "@ziggs-ai/api-client": "0.37.26",
34
+ "@ziggs-ai/contracts": "^0.31.0",
35
35
  "ajv": "^8.17.1",
36
36
  "dotenv": "^17.2.3",
37
37
  "openai": "^4.0.0",