@ziggs-ai/api-client 0.37.12 → 0.37.14

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.
@@ -4,6 +4,7 @@ export { type McpBrief, type McpDoor, hasMcpBrief, mcpBriefNames, mcpDescription
4
4
  export { nextCall, nextCallsFromUntrustedContent, isStaleAdvertisedAction, peerPrincipalId, isPersonaFace, workContextFromEnv, type NextCall, type NextCallOutcome, type NextCallEffects, type NextCallHold, type NextCallOptions, type WorkContext, } from './nextCall.js';
5
5
  export { AGREEMENT_VERB_CAPABILITIES, LISTING_DOOR_CAPABILITIES, agreementBuyCapability, agreementBidCapability, agreementBrokerCapability, agreementRequestCapability, agreementHandoffCapability, agreementSubcontractCapability, } from './agreementVerbs.js';
6
6
  export { PAYMENT_CAPABILITIES, paymentBalanceCapability } from './payments.js';
7
+ export { PARTY_CAPABILITIES, partyNoteCapability } from './parties.js';
7
8
  export { LINK_CAPABILITIES, listLinksCapability, proposeLinkCapability, linkIsReachOnly, } from './links.js';
8
9
  export { INTRODUCTION_CAPABILITIES, mintIntroductionCapability, redeemIntroductionCapability, listIntroductionsCapability, revokeIntroductionCapability, } from './introductions.js';
9
10
  export { AGREEMENT_CAPABILITIES, agreementClaimCapability, presentClaimResult, } from './agreements.js';
@@ -4,6 +4,7 @@ export { hasMcpBrief, mcpBriefNames, mcpDescription, } from './mcpBriefs.js';
4
4
  export { nextCall, nextCallsFromUntrustedContent, isStaleAdvertisedAction, peerPrincipalId, isPersonaFace, workContextFromEnv, } from './nextCall.js';
5
5
  export { AGREEMENT_VERB_CAPABILITIES, LISTING_DOOR_CAPABILITIES, agreementBuyCapability, agreementBidCapability, agreementBrokerCapability, agreementRequestCapability, agreementHandoffCapability, agreementSubcontractCapability, } from './agreementVerbs.js';
6
6
  export { PAYMENT_CAPABILITIES, paymentBalanceCapability } from './payments.js';
7
+ export { PARTY_CAPABILITIES, partyNoteCapability } from './parties.js';
7
8
  export { LINK_CAPABILITIES, listLinksCapability, proposeLinkCapability, linkIsReachOnly, } from './links.js';
8
9
  export { INTRODUCTION_CAPABILITIES, mintIntroductionCapability, redeemIntroductionCapability, listIntroductionsCapability, revokeIntroductionCapability, } from './introductions.js';
9
10
  export { AGREEMENT_CAPABILITIES, agreementClaimCapability, presentClaimResult, } from './agreements.js';
@@ -237,6 +237,10 @@ const BRIEFS = {
237
237
  does: 'Takes back an introduction you minted that nobody has redeemed.',
238
238
  changes: 'the token stops working',
239
239
  },
240
+ ziggs_party_note: {
241
+ does: 'Writes what your workspace knows about a person not on Ziggs yet (claimed: false in the snapshot). Shown to your workspace in every room they are in.',
242
+ changes: 'replaces the notes; empty clears them',
243
+ },
240
244
  // Connections and points
241
245
  ziggs_connection_list: {
242
246
  does: 'Lists third-party connections (GitHub, Jira, MCP servers) you hold grants on, with grant health; never credentials. They are listed, not callable over this connection.',
@@ -0,0 +1,10 @@
1
+ import { type CapabilityDefinition } from './types.js';
2
+ /**
3
+ * What your workspace knows about a person who is not on Ziggs yet.
4
+ *
5
+ * The room snapshot names them in `users` with `claimed: false`, and carries
6
+ * these notes for your workspace's readers, so the next session that wakes
7
+ * knows who they are without asking again.
8
+ */
9
+ export declare const partyNoteCapability: CapabilityDefinition;
10
+ export declare const PARTY_CAPABILITIES: CapabilityDefinition[];
@@ -0,0 +1,43 @@
1
+ import { PartiesClient } from '../http/PartiesClient.js';
2
+ import { fullCreds } from './types.js';
3
+ /**
4
+ * What your workspace knows about a person who is not on Ziggs yet.
5
+ *
6
+ * The room snapshot names them in `users` with `claimed: false`, and carries
7
+ * these notes for your workspace's readers, so the next session that wakes
8
+ * knows who they are without asking again.
9
+ */
10
+ export const partyNoteCapability = {
11
+ key: 'party_note',
12
+ names: { sdk: 'party_note', mcp: 'ziggs_party_note' },
13
+ title: 'Note who a person not on Ziggs yet is',
14
+ descriptions: {
15
+ sdk: 'Replace what your workspace knows about a person who is not on Ziggs yet: who they are, how you met, what they asked for (PUT /parties/{partyId}/notes). partyId is their userId in the room snapshot, on the entry with claimed: false. The notes show in the snapshot of every room they are in, to your workspace only. An empty string clears them; at most 2000 characters. Write what you learned, not what they said verbatim.',
16
+ },
17
+ annotation: 'write',
18
+ params: {
19
+ partyId: {
20
+ type: 'string',
21
+ required: true,
22
+ description: 'The person: their userId in the room snapshot, where claimed is false.',
23
+ },
24
+ notes: {
25
+ type: 'string',
26
+ required: true,
27
+ description: 'The whole note, replacing the previous one. Empty clears it. At most 2000 characters.',
28
+ },
29
+ },
30
+ needsAgentId: true,
31
+ handler: async (args, env) => {
32
+ const creds = fullCreds(env);
33
+ const client = new PartiesClient(creds.operatorKey, creds.agentId);
34
+ const saved = await client.setNotes(args['partyId'], args['notes']);
35
+ return {
36
+ party: saved,
37
+ message: saved.notes
38
+ ? 'Saved. It shows in the snapshot of every room they are in, to your workspace only.'
39
+ : 'Cleared.',
40
+ };
41
+ },
42
+ };
43
+ export const PARTY_CAPABILITIES = [partyNoteCapability];
@@ -9,6 +9,7 @@ import { GRANTS_CAPABILITIES } from './grants.js';
9
9
  import { INTRODUCTION_CAPABILITIES } from './introductions.js';
10
10
  import { LINK_CAPABILITIES } from './links.js';
11
11
  import { MARKETPLACE_CAPABILITIES } from './marketplace.js';
12
+ import { PARTY_CAPABILITIES } from './parties.js';
12
13
  import { PAYMENT_CAPABILITIES } from './payments.js';
13
14
  import { TASK_CAPABILITIES } from './tasks.js';
14
15
  const CAPABILITIES = [
@@ -25,6 +26,7 @@ const CAPABILITIES = [
25
26
  ...INTRODUCTION_CAPABILITIES,
26
27
  ...LINK_CAPABILITIES,
27
28
  ...MARKETPLACE_CAPABILITIES,
29
+ ...PARTY_CAPABILITIES,
28
30
  ...PAYMENT_CAPABILITIES,
29
31
  ...TASK_CAPABILITIES,
30
32
  ];
@@ -0,0 +1,18 @@
1
+ /** What a workspace keeps about a person who is not on Ziggs yet. */
2
+ export interface PartyNotesView {
3
+ partyId: string;
4
+ notes: string | null;
5
+ }
6
+ /**
7
+ * A person who is not on Ziggs yet, as your workspace keeps them: someone it
8
+ * reaches by email or Slack. Only the workspace that vouches for them writes
9
+ * or reads what it knows about them.
10
+ */
11
+ export declare class PartiesClient {
12
+ private readonly operatorKey;
13
+ private readonly agentId?;
14
+ private readonly baseUrl;
15
+ constructor(operatorKey: string, agentId?: string, baseUrl?: string);
16
+ /** Replace the notes; an empty string clears them. */
17
+ setNotes(partyId: string, notes: string): Promise<PartyNotesView>;
18
+ }
@@ -0,0 +1,37 @@
1
+ import { getBackendUrl } from '../utils/urlUtils.js';
2
+ import { throwApiError } from '../shared/apiError.js';
3
+ import { buildOperatorHeaders } from './operatorHeaders.js';
4
+ /**
5
+ * A person who is not on Ziggs yet, as your workspace keeps them: someone it
6
+ * reaches by email or Slack. Only the workspace that vouches for them writes
7
+ * or reads what it knows about them.
8
+ */
9
+ export class PartiesClient {
10
+ operatorKey;
11
+ agentId;
12
+ baseUrl;
13
+ constructor(operatorKey, agentId, baseUrl) {
14
+ if (!operatorKey) {
15
+ throw new Error('PartiesClient: operatorKey is required');
16
+ }
17
+ this.operatorKey = operatorKey;
18
+ this.agentId = agentId;
19
+ this.baseUrl = baseUrl || getBackendUrl();
20
+ }
21
+ /** Replace the notes; an empty string clears them. */
22
+ async setNotes(partyId, notes) {
23
+ const res = await fetch(`${this.baseUrl}/parties/${encodeURIComponent(partyId)}/notes`, {
24
+ method: 'PUT',
25
+ headers: {
26
+ ...buildOperatorHeaders(this.operatorKey, this.agentId),
27
+ 'Content-Type': 'application/json',
28
+ },
29
+ body: JSON.stringify({ notes }),
30
+ });
31
+ const text = await res.text().catch(() => '');
32
+ if (!res.ok) {
33
+ throwApiError(res, text, `PartiesClient.setNotes failed: ${res.status}`);
34
+ }
35
+ return JSON.parse(text);
36
+ }
37
+ }
@@ -14,6 +14,7 @@ export type { ContextOpenKind, ContextOpenOutcome, ContextOpenRef, ContextOpenBo
14
14
  export { ContextDiscoveryClient } from './ContextDiscoveryClient.js';
15
15
  export type { DiscoverableItem } from './ContextDiscoveryClient.js';
16
16
  export { IntroductionsClient } from './IntroductionsClient.js';
17
+ export { PartiesClient, type PartyNotesView } from './PartiesClient.js';
17
18
  export type { IntroductionView, IntroductionFrom, IntroductionStatus, IntroductionOutcome, MintIntroductionInput, } from './IntroductionsClient.js';
18
19
  export { GrantsClient } from './GrantsClient.js';
19
20
  export type { ListGrantsQuery, ListGrantsResult, UnreadableRail } from './GrantsClient.js';
@@ -11,6 +11,7 @@ export { ContextReadClient, CONTEXT_READ_TYPES, CONTEXT_READ_VIA, VIA_KINDS, par
11
11
  export { ContextOpenClient, CONTEXT_OPEN_KINDS } from './ContextOpenClient.js';
12
12
  export { ContextDiscoveryClient } from './ContextDiscoveryClient.js';
13
13
  export { IntroductionsClient } from './IntroductionsClient.js';
14
+ export { PartiesClient } from './PartiesClient.js';
14
15
  export { GrantsClient } from './GrantsClient.js';
15
16
  export { ContextGrantsClient } from './ContextGrantsClient.js';
16
17
  export { grantCaveat, CONTEXT_GRANT_SCOPE_KINDS, GRANT_SCOPE_KINDS, } from './grants.js';
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@ziggs-ai/api-client",
3
- "version": "0.37.12",
3
+ "version": "0.37.14",
4
4
  "description": "HTTP and WebSocket client for the Ziggs backend API",
5
+ "homepage": "https://ziggsai.com/docs",
6
+ "bugs": {
7
+ "url": "https://ziggsai.com/support"
8
+ },
5
9
  "type": "module",
6
10
  "main": "dist/index.js",
7
11
  "types": "dist/index.d.ts",
@@ -36,17 +40,18 @@
36
40
  "client",
37
41
  "websocket"
38
42
  ],
39
- "license": "MIT",
43
+ "license": "Apache-2.0",
40
44
  "files": [
41
45
  "dist",
42
46
  "README.md"
43
47
  ],
44
- "homepage": "https://ziggsai.com/docs",
45
- "bugs": {
46
- "url": "https://ziggsai.com/support"
47
- },
48
48
  "publishConfig": {
49
49
  "access": "public",
50
50
  "registry": "https://registry.npmjs.org/"
51
+ },
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://github.com/ZiggsAI/sdk.git",
55
+ "directory": "api-client"
51
56
  }
52
57
  }