@amigo-ai/sdk 1.0.0 → 1.1.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.
Files changed (32) hide show
  1. package/README.md +50 -37
  2. package/dist/index.cjs.map +2 -2
  3. package/dist/index.mjs.map +2 -2
  4. package/dist/platform.cjs +1754 -0
  5. package/dist/platform.cjs.map +7 -0
  6. package/dist/platform.mjs +1723 -0
  7. package/dist/platform.mjs.map +7 -0
  8. package/dist/types/core/utils.d.ts +11 -0
  9. package/dist/types/generated/api-types.d.ts +1 -1
  10. package/dist/types/generated/platform-api-types.d.ts +45240 -0
  11. package/dist/types/platform/core/auth.d.ts +6 -0
  12. package/dist/types/platform/core/branded-types.d.ts +59 -0
  13. package/dist/types/platform/core/openapi-client.d.ts +6 -0
  14. package/dist/types/platform/core/websocket.d.ts +8 -0
  15. package/dist/types/platform/index.d.ts +59 -0
  16. package/dist/types/platform/resources/agents.d.ts +107 -0
  17. package/dist/types/platform/resources/api-keys.d.ts +57 -0
  18. package/dist/types/platform/resources/context-graphs.d.ts +114 -0
  19. package/dist/types/platform/resources/conversations.d.ts +154 -0
  20. package/dist/types/platform/resources/data-sources.d.ts +143 -0
  21. package/dist/types/platform/resources/events.d.ts +253 -0
  22. package/dist/types/platform/resources/fhir.d.ts +186 -0
  23. package/dist/types/platform/resources/integrations.d.ts +114 -0
  24. package/dist/types/platform/resources/phone-numbers.d.ts +170 -0
  25. package/dist/types/platform/resources/services.d.ts +133 -0
  26. package/dist/types/platform/resources/sessions.d.ts +61 -0
  27. package/dist/types/platform/resources/skills.d.ts +169 -0
  28. package/dist/types/platform/resources/workspaces.d.ts +187 -0
  29. package/package.json +15 -11
  30. package/assets/readme/amigo-banner.png +0 -0
  31. package/assets/readme/classic-ts-architecture.png +0 -0
  32. package/assets/readme/classic-ts-architecture.svg +0 -102
@@ -0,0 +1,187 @@
1
+ import type { PlatformFetch } from '../core/openapi-client';
2
+ import type { components, operations } from '../../generated/platform-api-types';
3
+ import type { WorkspaceId } from '../core/branded-types';
4
+ /** Resource for managing workspaces. */
5
+ export declare class WorkspaceResource {
6
+ private c;
7
+ private workspaceId?;
8
+ constructor(c: PlatformFetch, workspaceId?: WorkspaceId | undefined);
9
+ private requireWorkspaceId;
10
+ /** List workspaces accessible to this API key. */
11
+ list(options?: {
12
+ query?: operations['list-workspaces']['parameters']['query'];
13
+ }): Promise<{
14
+ continuation_token?: number | null;
15
+ has_more: boolean;
16
+ items: components["schemas"]["WorkspaceResponse"][];
17
+ total?: number | null;
18
+ }>;
19
+ /** Get a workspace by ID. */
20
+ get(options?: {
21
+ workspaceId?: WorkspaceId;
22
+ }): Promise<{
23
+ backend_org_id: string | null;
24
+ connector_type: string | null;
25
+ created_at: string;
26
+ environment: string;
27
+ id: string;
28
+ name: string;
29
+ provisioned_at: string | null;
30
+ region: string;
31
+ slug: string;
32
+ updated_at: string;
33
+ }>;
34
+ /** Create a new workspace. */
35
+ create(options: {
36
+ body: components['schemas']['CreateWorkspaceRequest'];
37
+ }): Promise<{
38
+ backend_org_id: string | null;
39
+ connector_type: string | null;
40
+ created_at: string;
41
+ environment: string;
42
+ id: string;
43
+ name: string;
44
+ provisioned_at: string | null;
45
+ region: string;
46
+ slug: string;
47
+ updated_at: string;
48
+ }>;
49
+ /** Create a self-service workspace. */
50
+ createSelfService(options: {
51
+ body: components['schemas']['CreateWorkspaceRequest'];
52
+ }): Promise<{
53
+ backend_org_id: string | null;
54
+ connector_type: string | null;
55
+ created_at: string;
56
+ environment: string;
57
+ id: string;
58
+ name: string;
59
+ provisioned_at: string | null;
60
+ region: string;
61
+ slug: string;
62
+ updated_at: string;
63
+ }>;
64
+ /** Update a workspace. */
65
+ update(options: {
66
+ workspaceId?: WorkspaceId;
67
+ body: components['schemas']['UpdateWorkspaceRequest'];
68
+ }): Promise<{
69
+ backend_org_id: string | null;
70
+ connector_type: string | null;
71
+ created_at: string;
72
+ environment: string;
73
+ id: string;
74
+ name: string;
75
+ provisioned_at: string | null;
76
+ region: string;
77
+ slug: string;
78
+ updated_at: string;
79
+ }>;
80
+ /** Provision workspace resources (idempotent). */
81
+ provision(options?: {
82
+ workspaceId?: WorkspaceId;
83
+ }): Promise<{
84
+ workspace: components["schemas"]["WorkspaceResponse"];
85
+ }>;
86
+ /** Archive a workspace. */
87
+ archive(options: {
88
+ workspaceId?: WorkspaceId;
89
+ body: components['schemas']['ArchiveWorkspaceRequest'];
90
+ }): Promise<{
91
+ backend_org_id: string | null;
92
+ connector_type: string | null;
93
+ created_at: string;
94
+ environment: string;
95
+ id: string;
96
+ name: string;
97
+ provisioned_at: string | null;
98
+ region: string;
99
+ slug: string;
100
+ updated_at: string;
101
+ }>;
102
+ /** Check whether a workspace can be converted between environments. */
103
+ checkEnvironmentConversion(options?: {
104
+ workspaceId?: WorkspaceId;
105
+ query?: operations['check-environment-conversion']['parameters']['query'];
106
+ }): Promise<{
107
+ current: string;
108
+ target: string;
109
+ warnings: string[];
110
+ }>;
111
+ /** Convert a workspace environment. */
112
+ convertEnvironment(options: {
113
+ workspaceId?: WorkspaceId;
114
+ body: components['schemas']['ConvertEnvironmentRequest'];
115
+ }): Promise<{
116
+ backend_org_id: string | null;
117
+ connector_type: string | null;
118
+ created_at: string;
119
+ environment: string;
120
+ id: string;
121
+ name: string;
122
+ provisioned_at: string | null;
123
+ region: string;
124
+ slug: string;
125
+ updated_at: string;
126
+ }>;
127
+ /** Get voice settings for a workspace. */
128
+ getVoiceSettings(options?: {
129
+ workspaceId?: WorkspaceId;
130
+ }): Promise<{
131
+ correction_categories: string[];
132
+ keyterms: string[];
133
+ language: string;
134
+ language_providers?: {
135
+ [key: string]: components["schemas"]["LanguageProviderEntry"];
136
+ } | null;
137
+ post_call_analysis_enabled: boolean;
138
+ pronunciation_dict_id: string | null;
139
+ sensitive_topics: string[];
140
+ speed: number | null;
141
+ tone: string | null;
142
+ transcript_correction_enabled: boolean;
143
+ tts_config: {
144
+ [key: string]: unknown;
145
+ } | null;
146
+ tts_provider: ("cartesia" | "elevenlabs" | "groq") | null;
147
+ voice_id: string | null;
148
+ volume: number | null;
149
+ }>;
150
+ /** Update voice settings for a workspace. */
151
+ updateVoiceSettings(options: {
152
+ workspaceId?: WorkspaceId;
153
+ body: components['schemas']['VoiceSettingsRequest'];
154
+ }): Promise<{
155
+ correction_categories: string[];
156
+ keyterms: string[];
157
+ language: string;
158
+ language_providers?: {
159
+ [key: string]: components["schemas"]["LanguageProviderEntry"];
160
+ } | null;
161
+ post_call_analysis_enabled: boolean;
162
+ pronunciation_dict_id: string | null;
163
+ sensitive_topics: string[];
164
+ speed: number | null;
165
+ tone: string | null;
166
+ transcript_correction_enabled: boolean;
167
+ tts_config: {
168
+ [key: string]: unknown;
169
+ } | null;
170
+ tts_provider: ("cartesia" | "elevenlabs" | "groq") | null;
171
+ voice_id: string | null;
172
+ volume: number | null;
173
+ }>;
174
+ /** Get test caller numbers for a workspace. */
175
+ getTestCallerNumbers(options?: {
176
+ workspaceId?: WorkspaceId;
177
+ }): Promise<{
178
+ numbers: string[];
179
+ }>;
180
+ /** Update test caller numbers for a workspace. */
181
+ updateTestCallerNumbers(options: {
182
+ workspaceId?: WorkspaceId;
183
+ body: components['schemas']['TestCallerNumbersRequest'];
184
+ }): Promise<{
185
+ numbers: string[];
186
+ }>;
187
+ }
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@amigo-ai/sdk",
3
- "version": "1.0.0",
4
- "description": "Official TypeScript SDK for the classic Amigo API",
3
+ "version": "1.1.0",
4
+ "description": "Official TypeScript SDK for the Amigo classic and Platform APIs",
5
5
  "keywords": [
6
6
  "amigo",
7
7
  "sdk",
8
8
  "typescript",
9
9
  "api",
10
- "conversation"
10
+ "conversation",
11
+ "platform",
12
+ "openapi"
11
13
  ],
12
14
  "publishConfig": {
13
15
  "access": "public"
@@ -16,21 +18,21 @@
16
18
  "module": "./dist/index.mjs",
17
19
  "types": "./dist/types/index.d.ts",
18
20
  "files": [
19
- "assets",
20
21
  "dist",
21
22
  "README.md",
22
23
  "LICENSE"
23
24
  ],
24
25
  "scripts": {
25
- "gen-types": "node scripts/gen.mjs",
26
- "openapi:sync": "node scripts/sync-openapi.mjs",
26
+ "gen-types": "node scripts/gen-all.mjs",
27
+ "gen-types:classic": "node scripts/gen-classic.mjs",
28
+ "gen-types:platform": "node scripts/gen-platform.mjs",
27
29
  "test": "vitest run --project unit",
28
30
  "test:dist": "vitest run --project dist",
29
31
  "test:integration": "vitest run --project integration",
30
32
  "test:watch": "vitest",
31
33
  "test:coverage": "vitest run --coverage --project unit",
32
- "build": "node scripts/gen.mjs && node scripts/build.mjs && tsc --project tsconfig.build.json",
33
- "dev": "node scripts/gen.mjs && node scripts/build.mjs --watch",
34
+ "build": "node scripts/gen-all.mjs && node scripts/build.mjs && tsc --project tsconfig.build.json",
35
+ "dev": "node scripts/gen-all.mjs && node scripts/build.mjs --watch",
34
36
  "format": "prettier --check .",
35
37
  "format:write": "prettier --write .",
36
38
  "lint": "eslint 'src/**/*.{ts,tsx}' --max-warnings 0",
@@ -59,6 +61,11 @@
59
61
  "import": "./dist/index.mjs",
60
62
  "require": "./dist/index.cjs"
61
63
  },
64
+ "./platform": {
65
+ "types": "./dist/types/platform/index.d.ts",
66
+ "import": "./dist/platform.mjs",
67
+ "require": "./dist/platform.cjs"
68
+ },
62
69
  "./package.json": "./package.json"
63
70
  },
64
71
  "type": "module",
@@ -97,8 +104,5 @@
97
104
  },
98
105
  "dependencies": {
99
106
  "openapi-fetch": "^0.14.0"
100
- },
101
- "optionalDependencies": {
102
- "@rollup/rollup-darwin-arm64": "^4.59.0"
103
107
  }
104
108
  }
Binary file
@@ -1,102 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="520" viewBox="0 0 1200 520">
2
- <defs>
3
- <linearGradient id="bg" x1="0" y1="0" x2="0.6" y2="1">
4
- <stop offset="0%" stop-color="#083241"/>
5
- <stop offset="100%" stop-color="#051A24"/>
6
- </linearGradient>
7
- <linearGradient id="strokeGrad" x1="0" y1="0" x2="1" y2="1">
8
- <stop offset="0%" stop-color="white" stop-opacity="0.1"/>
9
- <stop offset="100%" stop-color="#999" stop-opacity="0.04"/>
10
- </linearGradient>
11
- <linearGradient id="strokeGradSubtle" x1="0" y1="0" x2="1" y2="1">
12
- <stop offset="0%" stop-color="white" stop-opacity="0.08"/>
13
- <stop offset="100%" stop-color="#999" stop-opacity="0.03"/>
14
- </linearGradient>
15
- <marker id="arrow" viewBox="0 0 10 7" refX="9" refY="3.5" markerWidth="8" markerHeight="6" orient="auto-start-reverse">
16
- <path d="M 0 0.5 L 9 3.5 L 0 6.5" fill="none" stroke="white" stroke-width="1" opacity="0.2"/>
17
- </marker>
18
- </defs>
19
-
20
- <rect width="1200" height="520" fill="url(#bg)"/>
21
-
22
- <rect x="32" y="32" width="720" height="240" rx="10" fill="white" fill-opacity="0.03" stroke="url(#strokeGrad)" stroke-width="0.75"/>
23
- <text x="60" y="60" font-family="'Diatype Mono', 'SF Mono', monospace" font-size="13" font-weight="500" fill="white" fill-opacity="0.55" letter-spacing="2">CLASSIC API</text>
24
-
25
- <rect x="52" y="78" width="154" height="60" rx="8" fill="white" fill-opacity="0.1" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
26
- <text x="129" y="103" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Conversations</text>
27
- <text x="129" y="121" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">create + interact</text>
28
-
29
- <rect x="222" y="78" width="154" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
30
- <text x="299" y="103" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Services</text>
31
- <text x="299" y="121" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">release-routed entrypoints</text>
32
-
33
- <rect x="392" y="78" width="154" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
34
- <text x="469" y="103" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Organizations</text>
35
- <text x="469" y="121" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">org settings + branding</text>
36
-
37
- <rect x="562" y="78" width="170" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
38
- <text x="647" y="103" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Users</text>
39
- <text x="647" y="121" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">identity + preferences</text>
40
-
41
- <rect x="52" y="152" width="154" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
42
- <text x="129" y="177" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Agents</text>
43
- <text x="129" y="195" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">assistant behavior</text>
44
-
45
- <rect x="222" y="152" width="154" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
46
- <text x="299" y="177" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Context Graphs</text>
47
- <text x="299" y="195" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">memory + retrieval</text>
48
-
49
- <rect x="392" y="152" width="154" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
50
- <text x="469" y="177" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Webhooks</text>
51
- <text x="469" y="195" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">signed outbound delivery</text>
52
-
53
- <rect x="562" y="152" width="170" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
54
- <text x="647" y="177" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Streaming</text>
55
- <text x="647" y="195" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">NDJSON + WebSocket events</text>
56
-
57
- <text x="392" y="248" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" font-weight="500" fill="white" fill-opacity="0.5">requests + events</text>
58
- <line x1="392" y1="254" x2="392" y2="290" stroke="white" stroke-width="1" stroke-opacity="0.15" marker-end="url(#arrow)"/>
59
-
60
- <rect x="776" y="32" width="392" height="240" rx="10" fill="white" fill-opacity="0.03" stroke="url(#strokeGrad)" stroke-width="0.75"/>
61
- <text x="804" y="60" font-family="'Diatype Mono', 'SF Mono', monospace" font-size="13" font-weight="500" fill="white" fill-opacity="0.55" letter-spacing="2">PLATFORM SYSTEMS</text>
62
-
63
- <rect x="796" y="78" width="166" height="60" rx="8" fill="white" fill-opacity="0.1" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
64
- <text x="879" y="103" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Agent Engine</text>
65
- <text x="879" y="121" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">runtime orchestration</text>
66
-
67
- <rect x="982" y="78" width="166" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
68
- <text x="1065" y="103" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Connector Runner</text>
69
- <text x="1065" y="121" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">EHR, FHIR, CRM sync</text>
70
-
71
- <rect x="796" y="152" width="166" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
72
- <text x="879" y="177" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Metric Store</text>
73
- <text x="879" y="195" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">analytics + evaluation</text>
74
-
75
- <rect x="982" y="152" width="166" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
76
- <text x="1065" y="177" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Operators</text>
77
- <text x="1065" y="195" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">monitoring + escalation</text>
78
-
79
- <text x="972" y="248" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" font-weight="500" fill="white" fill-opacity="0.5">backing services</text>
80
- <line x1="972" y1="254" x2="972" y2="290" stroke="white" stroke-width="1" stroke-opacity="0.15" marker-end="url(#arrow)"/>
81
-
82
- <rect x="32" y="300" width="1136" height="170" rx="10" fill="white" fill-opacity="0.05" stroke="url(#strokeGrad)" stroke-width="0.75"/>
83
- <text x="60" y="328" font-family="'Diatype Mono', 'SF Mono', monospace" font-size="13" font-weight="500" fill="white" fill-opacity="0.55" letter-spacing="2">WORLD MODEL</text>
84
-
85
- <rect x="52" y="346" width="256" height="60" rx="8" fill="white" fill-opacity="0.1" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
86
- <text x="180" y="371" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Event Store</text>
87
- <text x="180" y="389" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">confidence-scored facts</text>
88
-
89
- <rect x="328" y="346" width="256" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
90
- <text x="456" y="371" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Entity Projections</text>
91
- <text x="456" y="389" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">current org + user state</text>
92
-
93
- <rect x="604" y="346" width="256" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
94
- <text x="732" y="371" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Intelligence Projections</text>
95
- <text x="732" y="389" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">memory, tasks, summaries</text>
96
-
97
- <rect x="880" y="346" width="268" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
98
- <text x="1014" y="371" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Vector Search</text>
99
- <text x="1014" y="389" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">semantic retrieval</text>
100
-
101
- <text x="600" y="492" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" font-weight="500" fill="white" fill-opacity="0.55">Classic SDK traffic lands on the same platform systems and world model foundation that future migration paths build on.</text>
102
- </svg>