@amigo-ai/sdk 1.1.2 → 1.1.3

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/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="./assets/readme/amigo-banner.png" alt="Amigo banner" width="100%" />
3
+ </p>
4
+
1
5
  <h1 align="center">@amigo-ai/sdk</h1>
2
6
 
3
7
  <p align="center">Official TypeScript SDK for the Amigo classic and Platform APIs.</p>
@@ -5,7 +9,7 @@
5
9
  <p align="center">
6
10
  <a href="https://docs.amigo.ai">Product Docs</a>
7
11
  ·
8
- <a href="https://docs.amigo.ai/developer-guide">Developer Guide</a>
12
+ <a href="https://docs.amigo.ai/developer-guide/classic-api/sdks">Developer Guide</a>
9
13
  ·
10
14
  <a href="https://amigo-ai.github.io/amigo-typescript-sdk/">API Reference</a>
11
15
  ·
@@ -21,36 +25,40 @@
21
25
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License" /></a>
22
26
  </p>
23
27
 
24
- Typed from the Amigo OpenAPI schemas, shipped as ESM and CommonJS, and used by current org-scoped and workspace-scoped Amigo integrations.
28
+ Typed from the Amigo OpenAPI schemas, shipped as ESM and CommonJS, and used by existing org-scoped integrations on the original Amigo backend at `api.amigo.ai` plus new workspace-scoped integrations on `api.platform.amigo.ai`.
25
29
 
26
- ## Product Status
30
+ ## Backend Context
27
31
 
28
- `@amigo-ai/sdk` remains the supported TypeScript client for the classic Amigo API and now also ships the Platform API client from the `@amigo-ai/sdk/platform` subpath.
32
+ The root package export targets the original org-scoped Classic API. Existing deployments still use this surface for conversations, services, organizations, users, agents, context graphs, webhooks, and streaming events.
29
33
 
30
- The Platform API is the long-term home for new workspace-scoped capabilities. Classic customers are not being asked to make an abrupt rewrite: the root package export continues to target the current org-scoped API, while new platform integrations can use the platform subpath from the same package.
34
+ ![Classic text session flow](./assets/readme/classic-session-flow.svg)
31
35
 
32
- ## Choose The Right SDK
36
+ The `@amigo-ai/sdk/platform` subpath targets the Platform API. It includes a raw OpenAPI-typed fetch client, workspace-scoped resources, SSE helpers for streaming turns and workspace events, and WebSocket helpers for public text sessions.
33
37
 
34
- | If you need | Use |
35
- | --- | --- |
36
- | The current org-scoped Amigo API used by existing integrations | `@amigo-ai/sdk` |
37
- | New workspace-scoped Platform API integrations | `@amigo-ai/sdk/platform` |
38
+ ## Product Status
38
39
 
39
- ## API Context
40
+ `@amigo-ai/sdk` remains the supported TypeScript client for the Classic API and now also ships the Platform API client from the `@amigo-ai/sdk/platform` subpath.
40
41
 
41
- This SDK is the typed client boundary between your application and the classic Amigo API at `https://api.amigo.ai`. It covers the current org-scoped resources used by existing Amigo deployments: conversations, services, organizations, users, agents, context graphs, webhooks, and streaming events.
42
+ The Platform API is where new workspace-scoped capabilities land first, but the Classic API is not being switched off abruptly. The root export continues to target the current org-scoped API, while new Platform integrations can use the platform subpath from the same package.
42
43
 
43
- The platform subpath is the typed client boundary for the Platform API at `https://api.platform.amigo.ai`. It includes a raw OpenAPI-typed fetch client, workspace-scoped resources, SSE helpers for streaming turns and workspace events, and WebSocket helpers for public text sessions.
44
+ ## Choose The Right SDK
45
+
46
+ | If you need | Start here |
47
+ | ------------------------------------------------------------ | ------------------------- |
48
+ | Existing org-scoped integrations on `api.amigo.ai` | `@amigo-ai/sdk` |
49
+ | New workspace-scoped integrations on `api.platform.amigo.ai` | `@amigo-ai/sdk/platform` |
44
50
 
45
51
  ## Documentation
46
52
 
47
- | Need | Best entry point |
48
- | --- | --- |
49
- | Product overview and deployment context | [docs.amigo.ai](https://docs.amigo.ai/) |
50
- | Integration guidance and developer docs | [Developer Guide](https://docs.amigo.ai/developer-guide) |
51
- | Generated API reference | [amigo-ai.github.io/amigo-typescript-sdk](https://amigo-ai.github.io/amigo-typescript-sdk/) |
52
- | Runnable examples | [examples/](https://github.com/amigo-ai/amigo-typescript-sdk/tree/main/examples) |
53
- | Release history | [CHANGELOG.md](https://github.com/amigo-ai/amigo-typescript-sdk/blob/main/CHANGELOG.md) |
53
+ | Need | Best entry point |
54
+ | --------------------------------------- | ------------------------------------------------------------------------------------------- |
55
+ | Product overview and deployment context | [docs.amigo.ai](https://docs.amigo.ai/) |
56
+ | Integration guidance and developer docs | [Developer Guide](https://docs.amigo.ai/developer-guide/classic-api/sdks) |
57
+ | Generated API reference | [amigo-ai.github.io/amigo-typescript-sdk](https://amigo-ai.github.io/amigo-typescript-sdk/) |
58
+ | Runnable examples | [examples/](https://github.com/amigo-ai/amigo-typescript-sdk/tree/main/examples) |
59
+ | Release history | [CHANGELOG.md](https://github.com/amigo-ai/amigo-typescript-sdk/blob/main/CHANGELOG.md) |
60
+
61
+ The docs site remains the primary reference. The repo-local examples stay close to the shipped package surface and are validated in CI.
54
62
 
55
63
  ## Installation
56
64
 
@@ -75,7 +83,7 @@ const conversations = await client.conversations.getConversations({
75
83
  sort_by: ['-created_at'],
76
84
  })
77
85
 
78
- console.log(conversations.conversations.map((conversation) => conversation.id))
86
+ console.log(conversations.conversations.map(conversation => conversation.id))
79
87
  ```
80
88
 
81
89
  ## Platform Quick Start
@@ -89,19 +97,19 @@ const platform = new PlatformClient({
89
97
  })
90
98
 
91
99
  const agents = await platform.agents.list({ query: { limit: 10 } })
92
- console.log(agents.items.map((agent) => agent.id))
100
+ console.log(agents.items.map(agent => agent.id))
93
101
  ```
94
102
 
95
103
  ## Configuration
96
104
 
97
- | Option | Type | Required | Description |
98
- | --- | --- | --- | --- |
99
- | `apiKey` | `string` | Yes | API key from the Amigo dashboard |
100
- | `apiKeyId` | `string` | Yes | API key ID paired with `apiKey` |
101
- | `userId` | `string` | Yes | User ID on whose behalf the request is made |
102
- | `orgId` | `string` | Yes | Organization ID for the classic API |
103
- | `baseUrl` | `string` | No | Override the API base URL. Defaults to `https://api.amigo.ai` |
104
- | `retry` | `RetryOptions` | No | Retry policy overrides for transient HTTP failures |
105
+ | Option | Type | Required | Description |
106
+ | ---------- | -------------- | -------- | ------------------------------------------------------------- |
107
+ | `apiKey` | `string` | Yes | API key from the Amigo dashboard |
108
+ | `apiKeyId` | `string` | Yes | API key ID paired with `apiKey` |
109
+ | `userId` | `string` | Yes | User ID on whose behalf the request is made |
110
+ | `orgId` | `string` | Yes | Organization ID for the Classic API |
111
+ | `baseUrl` | `string` | No | Override the API base URL. Defaults to `https://api.amigo.ai` |
112
+ | `retry` | `RetryOptions` | No | Retry policy overrides for transient HTTP failures |
105
113
 
106
114
  ### Runtime Requirements
107
115
 
@@ -118,6 +126,12 @@ type Conversation = components['schemas']['ConversationInstance']
118
126
  type GetConversationsQuery = operations['get-conversations']['parameters']['query']
119
127
  ```
120
128
 
129
+ Public Classic builds are generated from the committed [`specs/openapi-baseline.json`](./specs/openapi-baseline.json) snapshot in this repo so type output stays deterministic across machines and CI runs. When you need to refresh that snapshot, run:
130
+
131
+ ```bash
132
+ npm run openapi:sync
133
+ ```
134
+
121
135
  Platform OpenAPI types are exported from the platform subpath:
122
136
 
123
137
  ```typescript
Binary file
@@ -0,0 +1,72 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="428" viewBox="0 0 1200 428">
2
+
3
+ <defs>
4
+ <marker id="arrow" viewBox="0 0 10 7" refX="9" refY="3.5" markerWidth="8" markerHeight="6" orient="auto-start-reverse">
5
+ <path d="M 0 0.5 L 9 3.5 L 0 6.5" fill="none" stroke="#575452" stroke-width="1" opacity="0.4"/>
6
+ </marker>
7
+ <marker id="arrowRev" viewBox="0 0 10 7" refX="1" refY="3.5" markerWidth="8" markerHeight="6" orient="auto-start-reverse">
8
+ <path d="M 10 0.5 L 1 3.5 L 10 6.5" fill="none" stroke="#575452" stroke-width="1" opacity="0.4"/>
9
+ </marker>
10
+ <linearGradient id="bgGrad" x1="0" y1="0" x2="0.6" y2="1">
11
+ <stop offset="0%" stop-color="#FAF7F5"/>
12
+ <stop offset="100%" stop-color="#F1EAE7"/>
13
+ </linearGradient>
14
+ <linearGradient id="containerFill" x1="0" y1="0" x2="0.5" y2="1">
15
+ <stop offset="0%" stop-color="#F1EAE7" stop-opacity="0.06"/>
16
+ <stop offset="100%" stop-color="#B3AEAC" stop-opacity="0.04"/>
17
+ </linearGradient>
18
+ <linearGradient id="cardFill" x1="0" y1="0" x2="1" y2="1">
19
+ <stop offset="0%" stop-color="#F1EAE7" stop-opacity="0.12"/>
20
+ <stop offset="100%" stop-color="#B3AEAC" stop-opacity="0.08"/>
21
+ </linearGradient>
22
+ <linearGradient id="strokeGrad" x1="0" y1="0" x2="1" y2="1">
23
+ <stop offset="0%" stop-color="white" stop-opacity="0.1"/>
24
+ <stop offset="100%" stop-color="#999999" stop-opacity="0.04"/>
25
+ </linearGradient>
26
+ <linearGradient id="strokeGradSubtle" x1="0" y1="0" x2="1" y2="1">
27
+ <stop offset="0%" stop-color="white" stop-opacity="0.08"/>
28
+ <stop offset="100%" stop-color="#999999" stop-opacity="0.03"/>
29
+ </linearGradient>
30
+ </defs>
31
+
32
+ <rect width="1200" height="428" fill="url(#bgGrad)"/>
33
+
34
+ <rect x="32" y="32" width="355" height="356" rx="10" fill="url(#cardFill)" stroke="#D7D2D0" stroke-opacity="0.4" stroke-width="0.75"/>
35
+ <text x="209.5" y="60" text-anchor="middle" fill="#575452" font-family="'Diatype Mono', 'SF Mono', 'Fira Code', monospace" font-size="13" font-weight="500" letter-spacing="2">INPUT CHANNELS</text>
36
+ <rect x="99.5" y="76" width="220" height="60" rx="8" fill="white" fill-opacity="0.9" stroke="#D7D2D0" stroke-opacity="0.5" stroke-width="0.75"/>
37
+ <text x="209.5" y="100" text-anchor="middle" fill="#100F0F" font-family="'Flecha S', Georgia, serif" font-size="16" font-weight="400">Inbound SMS</text>
38
+ <text x="209.5" y="120" text-anchor="middle" fill="#575452" font-family="Inter, -apple-system, system-ui, sans-serif" font-size="12">Patient texts agent number</text>
39
+ <rect x="99.5" y="150" width="220" height="60" rx="8" fill="white" fill-opacity="0.8" stroke="#D7D2D0" stroke-opacity="0.5" stroke-width="0.75"/>
40
+ <text x="209.5" y="174" text-anchor="middle" fill="#100F0F" font-family="'Flecha S', Georgia, serif" font-size="16" font-weight="400">Gap Scanner</text>
41
+ <text x="209.5" y="194" text-anchor="middle" fill="#575452" font-family="Inter, -apple-system, system-ui, sans-serif" font-size="12">Auto-detects missing data</text>
42
+ <rect x="99.5" y="224" width="220" height="60" rx="8" fill="white" fill-opacity="0.8" stroke="#D7D2D0" stroke-opacity="0.5" stroke-width="0.75"/>
43
+ <text x="209.5" y="248" text-anchor="middle" fill="#100F0F" font-family="'Flecha S', Georgia, serif" font-size="16" font-weight="400">Outbound API</text>
44
+ <text x="209.5" y="268" text-anchor="middle" fill="#575452" font-family="Inter, -apple-system, system-ui, sans-serif" font-size="12">System-triggered sessions</text>
45
+ <rect x="99.5" y="298" width="220" height="60" rx="8" fill="white" fill-opacity="0.8" stroke="#D7D2D0" stroke-opacity="0.5" stroke-width="0.75"/>
46
+ <text x="209.5" y="322" text-anchor="middle" fill="#100F0F" font-family="'Flecha S', Georgia, serif" font-size="16" font-weight="400">Audio Input</text>
47
+ <text x="209.5" y="342" text-anchor="middle" fill="#575452" font-family="Inter, -apple-system, system-ui, sans-serif" font-size="12">Voice memos via web chat</text>
48
+
49
+ <rect x="422" y="32" width="355" height="356" rx="10" fill="url(#cardFill)" stroke="#D7D2D0" stroke-opacity="0.4" stroke-width="0.75"/>
50
+ <text x="599.5" y="60" text-anchor="middle" fill="#575452" font-family="'Diatype Mono', 'SF Mono', 'Fira Code', monospace" font-size="13" font-weight="500" letter-spacing="2">REASONING</text>
51
+ <rect x="489.5" y="76" width="220" height="60" rx="8" fill="white" fill-opacity="0.9" stroke="#D7D2D0" stroke-opacity="0.5" stroke-width="0.75"/>
52
+ <text x="599.5" y="100" text-anchor="middle" fill="#100F0F" font-family="'Flecha S', Georgia, serif" font-size="16" font-weight="400">Context Graph Engine</text>
53
+ <text x="599.5" y="120" text-anchor="middle" fill="#575452" font-family="Inter, -apple-system, system-ui, sans-serif" font-size="12">Same pipeline as voice</text>
54
+ <rect x="489.5" y="150" width="220" height="60" rx="8" fill="white" fill-opacity="0.8" stroke="#D7D2D0" stroke-opacity="0.5" stroke-width="0.75"/>
55
+ <text x="599.5" y="174" text-anchor="middle" fill="#100F0F" font-family="'Flecha S', Georgia, serif" font-size="16" font-weight="400">Tool Execution</text>
56
+ <text x="599.5" y="194" text-anchor="middle" fill="#575452" font-family="Inter, -apple-system, system-ui, sans-serif" font-size="12">Scheduling, EHR, surfaces</text>
57
+
58
+ <rect x="812" y="32" width="355" height="356" rx="10" fill="url(#cardFill)" stroke="#D7D2D0" stroke-opacity="0.4" stroke-width="0.75"/>
59
+ <text x="989.5" y="60" text-anchor="middle" fill="#575452" font-family="'Diatype Mono', 'SF Mono', 'Fira Code', monospace" font-size="13" font-weight="500" letter-spacing="2">DELIVERY</text>
60
+ <rect x="879.5" y="76" width="220" height="60" rx="8" fill="white" fill-opacity="0.9" stroke="#D7D2D0" stroke-opacity="0.5" stroke-width="0.75"/>
61
+ <text x="989.5" y="100" text-anchor="middle" fill="#100F0F" font-family="'Flecha S', Georgia, serif" font-size="16" font-weight="400">SMS Response</text>
62
+ <text x="989.5" y="120" text-anchor="middle" fill="#575452" font-family="Inter, -apple-system, system-ui, sans-serif" font-size="12">Multi-turn text messages</text>
63
+ <rect x="879.5" y="150" width="220" height="60" rx="8" fill="white" fill-opacity="0.8" stroke="#D7D2D0" stroke-opacity="0.5" stroke-width="0.75"/>
64
+ <text x="989.5" y="174" text-anchor="middle" fill="#100F0F" font-family="'Flecha S', Georgia, serif" font-size="16" font-weight="400">Surface Delivery</text>
65
+ <text x="989.5" y="194" text-anchor="middle" fill="#575452" font-family="Inter, -apple-system, system-ui, sans-serif" font-size="12">Inline form links</text>
66
+
67
+
68
+ <!-- Connections -->
69
+ <line x1="397" y1="210" x2="412" y2="210" stroke="#575452" stroke-width="1" stroke-opacity="0.4" marker-end="url(#arrow)"/>
70
+ <line x1="787" y1="210" x2="802" y2="210" stroke="#575452" stroke-width="1" stroke-opacity="0.4" marker-end="url(#arrow)"/>
71
+
72
+ </svg>
package/dist/platform.cjs CHANGED
@@ -51,6 +51,7 @@ __export(index_exports, {
51
51
  createPlatformFetch: () => createPlatformFetch,
52
52
  dataSourceId: () => dataSourceId,
53
53
  entityId: () => entityId,
54
+ hsmId: () => hsmId,
54
55
  integrationId: () => integrationId,
55
56
  isAmigoError: () => isAmigoError,
56
57
  monitorConceptId: () => monitorConceptId,
@@ -1687,6 +1688,9 @@ function skillId(id) {
1687
1688
  function integrationId(id) {
1688
1689
  return id;
1689
1690
  }
1691
+ function hsmId(id) {
1692
+ return id;
1693
+ }
1690
1694
  function contextGraphId(id) {
1691
1695
  return id;
1692
1696
  }