@tai42/api-client 16.0.1 → 17.0.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/agents.d.ts.map +1 -1
- package/dist/agents.js +1 -1
- package/dist/agents.js.map +1 -1
- package/dist/client/auth-client.d.ts +44 -2
- package/dist/client/auth-client.d.ts.map +1 -1
- package/dist/client/auth-client.js +15 -1
- package/dist/client/auth-client.js.map +1 -1
- package/dist/client/backup-client.js +1 -1
- package/dist/client/backup-client.js.map +1 -1
- package/dist/client/capabilities-client.d.ts +5 -0
- package/dist/client/capabilities-client.d.ts.map +1 -1
- package/dist/client/connectors-client.js +1 -1
- package/dist/client/connectors-client.js.map +1 -1
- package/dist/client/conversations-client.d.ts +0 -1
- package/dist/client/conversations-client.d.ts.map +1 -1
- package/dist/client/conversations-client.js +1 -1
- package/dist/client/conversations-client.js.map +1 -1
- package/dist/client/hooks-client.d.ts +1 -2
- package/dist/client/hooks-client.d.ts.map +1 -1
- package/dist/client/hooks-client.js +1 -1
- package/dist/client/hooks-client.js.map +1 -1
- package/dist/client/index.d.ts +71 -12
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/interactions-client.js +1 -1
- package/dist/client/interactions-client.js.map +1 -1
- package/dist/client/login-client.d.ts +15 -2
- package/dist/client/login-client.d.ts.map +1 -1
- package/dist/client/login-client.js +38 -4
- package/dist/client/login-client.js.map +1 -1
- package/dist/client/manifest-client.js +1 -1
- package/dist/client/manifest-client.js.map +1 -1
- package/dist/client/marketplace-client.js +1 -1
- package/dist/client/marketplace-client.js.map +1 -1
- package/dist/client/observability-client.js +1 -1
- package/dist/client/observability-client.js.map +1 -1
- package/dist/client/policy-client.js +1 -1
- package/dist/client/policy-client.js.map +1 -1
- package/dist/client/presets-client.d.ts +0 -1
- package/dist/client/presets-client.d.ts.map +1 -1
- package/dist/client/presets-client.js +1 -1
- package/dist/client/presets-client.js.map +1 -1
- package/dist/client/profiles-client.d.ts +0 -1
- package/dist/client/profiles-client.d.ts.map +1 -1
- package/dist/client/profiles-client.js +1 -1
- package/dist/client/profiles-client.js.map +1 -1
- package/dist/client/schedules-client.d.ts +0 -1
- package/dist/client/schedules-client.d.ts.map +1 -1
- package/dist/client/schedules-client.js +1 -1
- package/dist/client/schedules-client.js.map +1 -1
- package/dist/client/states-client.d.ts +0 -1
- package/dist/client/states-client.d.ts.map +1 -1
- package/dist/client/states-client.js +1 -1
- package/dist/client/states-client.js.map +1 -1
- package/dist/client/storage-client.js +1 -1
- package/dist/client/storage-client.js.map +1 -1
- package/dist/client/sub-mcp-client.js +1 -1
- package/dist/client/sub-mcp-client.js.map +1 -1
- package/dist/client/system-client.js +1 -1
- package/dist/client/system-client.js.map +1 -1
- package/dist/client/tool-extensions-client.d.ts +0 -1
- package/dist/client/tool-extensions-client.d.ts.map +1 -1
- package/dist/client/tool-extensions-client.js +1 -1
- package/dist/client/tool-extensions-client.js.map +1 -1
- package/dist/client/tool-meta-client.js +1 -1
- package/dist/client/tool-meta-client.js.map +1 -1
- package/dist/client/tools-client.d.ts +2 -2
- package/dist/client/tools-client.js +1 -1
- package/dist/client/tools-client.js.map +1 -1
- package/dist/client/trigger-links-client.d.ts +1 -1
- package/dist/client/trigger-links-client.js +1 -1
- package/dist/client/trigger-links-client.js.map +1 -1
- package/dist/client/web-entry-gate-client.js +1 -1
- package/dist/client/web-entry-gate-client.js.map +1 -1
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +15 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -13
- package/dist/index.js.map +1 -1
- package/dist/schemas/api-keys.d.ts +9 -0
- package/dist/schemas/api-keys.d.ts.map +1 -1
- package/dist/schemas/api-keys.js +7 -0
- package/dist/schemas/api-keys.js.map +1 -1
- package/dist/schemas/auth-routes.d.ts +3 -3
- package/dist/schemas/backup.d.ts.map +1 -1
- package/dist/schemas/backup.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +14 -4
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +8 -4
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/connectors.js.map +1 -1
- package/dist/schemas/conversations.d.ts.map +1 -1
- package/dist/schemas/conversations.js.map +1 -1
- package/dist/schemas/fleet.d.ts.map +1 -1
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/hooks.d.ts +2 -2
- package/dist/schemas/hooks.d.ts.map +1 -1
- package/dist/schemas/hooks.js.map +1 -1
- package/dist/schemas/index.d.ts +30 -28
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +30 -28
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/interactions.d.ts.map +1 -1
- package/dist/schemas/interactions.js.map +1 -1
- package/dist/schemas/login.d.ts +12 -5
- package/dist/schemas/login.d.ts.map +1 -1
- package/dist/schemas/login.js +11 -4
- package/dist/schemas/login.js.map +1 -1
- package/dist/schemas/manifest-mcp.d.ts.map +1 -1
- package/dist/schemas/manifest-mcp.js.map +1 -1
- package/dist/schemas/notifications.d.ts.map +1 -1
- package/dist/schemas/notifications.js.map +1 -1
- package/dist/schemas/observability.d.ts.map +1 -1
- package/dist/schemas/observability.js.map +1 -1
- package/dist/schemas/policy.d.ts.map +1 -1
- package/dist/schemas/policy.js.map +1 -1
- package/dist/schemas/presets.d.ts.map +1 -1
- package/dist/schemas/presets.js.map +1 -1
- package/dist/schemas/principals.d.ts +54 -0
- package/dist/schemas/principals.d.ts.map +1 -0
- package/dist/schemas/principals.js +34 -0
- package/dist/schemas/principals.js.map +1 -0
- package/dist/schemas/profiles.d.ts.map +1 -1
- package/dist/schemas/profiles.js.map +1 -1
- package/dist/schemas/roles.d.ts.map +1 -1
- package/dist/schemas/roles.js.map +1 -1
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/served.d.ts +1 -1
- package/dist/schemas/served.d.ts.map +1 -1
- package/dist/schemas/served.js +1 -1
- package/dist/schemas/served.js.map +1 -1
- package/dist/schemas/settings-schema.d.ts.map +1 -1
- package/dist/schemas/settings-schema.js.map +1 -1
- package/dist/schemas/setup.d.ts +43 -0
- package/dist/schemas/setup.d.ts.map +1 -0
- package/dist/schemas/setup.js +19 -0
- package/dist/schemas/setup.js.map +1 -0
- package/dist/schemas/states.d.ts.map +1 -1
- package/dist/schemas/states.js.map +1 -1
- package/dist/schemas/system-kinds.d.ts.map +1 -1
- package/dist/schemas/system-kinds.js.map +1 -1
- package/dist/schemas/templates.d.ts.map +1 -1
- package/dist/schemas/templates.js.map +1 -1
- package/dist/schemas/tools.d.ts.map +1 -1
- package/dist/schemas/tools.js.map +1 -1
- package/dist/schemas/trigger-links.d.ts +2 -2
- package/dist/schemas/trigger-links.d.ts.map +1 -1
- package/dist/schemas/trigger-links.js.map +1 -1
- package/dist/tool-runs.d.ts +4 -4
- package/dist/tool-runs.d.ts.map +1 -1
- package/dist/tool-runs.js.map +1 -1
- package/package.json +1 -1
- package/src/agents.ts +2 -2
- package/src/client/auth-client.ts +27 -1
- package/src/client/backup-client.ts +1 -1
- package/src/client/connectors-client.ts +1 -1
- package/src/client/conversations-client.ts +1 -1
- package/src/client/hooks-client.ts +1 -1
- package/src/client/index.ts +10 -10
- package/src/client/interactions-client.ts +1 -1
- package/src/client/login-client.ts +45 -4
- package/src/client/manifest-client.ts +1 -1
- package/src/client/marketplace-client.ts +1 -1
- package/src/client/observability-client.ts +1 -1
- package/src/client/policy-client.ts +1 -1
- package/src/client/presets-client.ts +1 -1
- package/src/client/profiles-client.ts +1 -1
- package/src/client/schedules-client.ts +1 -1
- package/src/client/states-client.ts +1 -1
- package/src/client/storage-client.ts +1 -1
- package/src/client/sub-mcp-client.ts +1 -1
- package/src/client/system-client.ts +1 -1
- package/src/client/tool-extensions-client.ts +1 -1
- package/src/client/tool-meta-client.ts +1 -1
- package/src/client/tools-client.ts +1 -1
- package/src/client/trigger-links-client.ts +1 -1
- package/src/client/web-entry-gate-client.ts +1 -1
- package/src/errors.ts +16 -0
- package/src/index.ts +231 -226
- package/src/schemas/api-keys.ts +8 -0
- package/src/schemas/backup.ts +1 -0
- package/src/schemas/capabilities.ts +9 -4
- package/src/schemas/connectors.ts +1 -0
- package/src/schemas/conversations.ts +1 -0
- package/src/schemas/fleet.ts +1 -0
- package/src/schemas/hooks.ts +1 -0
- package/src/schemas/index.ts +30 -28
- package/src/schemas/interactions.ts +1 -0
- package/src/schemas/login.ts +11 -4
- package/src/schemas/manifest-mcp.ts +1 -0
- package/src/schemas/notifications.ts +1 -0
- package/src/schemas/observability.ts +1 -0
- package/src/schemas/policy.ts +1 -0
- package/src/schemas/presets.ts +1 -0
- package/src/schemas/principals.ts +41 -0
- package/src/schemas/profiles.ts +1 -0
- package/src/schemas/roles.ts +1 -0
- package/src/schemas/schedules.ts +1 -0
- package/src/schemas/served.ts +2 -1
- package/src/schemas/settings-schema.ts +1 -0
- package/src/schemas/setup.ts +39 -0
- package/src/schemas/states.ts +1 -0
- package/src/schemas/system-kinds.ts +1 -0
- package/src/schemas/templates.ts +1 -0
- package/src/schemas/tools.ts +1 -0
- package/src/schemas/trigger-links.ts +1 -0
- package/src/tool-runs.ts +1 -1
package/src/schemas/index.ts
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
/** Public barrel for the api-client response/DTO schemas. */
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './templates';
|
|
9
|
-
export * from './storage';
|
|
10
|
-
export * from './fleet';
|
|
11
|
-
export * from './manifest-mcp';
|
|
12
|
-
export * from './system-kinds';
|
|
13
|
-
export * from './sub-mcp';
|
|
2
|
+
export { toolRunList, toolRunRecord, toolRunSubmitResult } from '../tool-runs';
|
|
3
|
+
export * from './api-keys';
|
|
4
|
+
export * from './auth-routes';
|
|
5
|
+
export * from './backup';
|
|
6
|
+
export * from './capabilities';
|
|
7
|
+
export * from './channels';
|
|
14
8
|
export * from './config';
|
|
15
|
-
export * from './profiles';
|
|
16
9
|
export * from './connectors';
|
|
17
|
-
export * from './studio-plugins';
|
|
18
|
-
export * from './interactions';
|
|
19
|
-
export * from './channels';
|
|
20
10
|
export * from './conversations';
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './
|
|
11
|
+
export * from './extensions';
|
|
12
|
+
export * from './fleet';
|
|
23
13
|
export * from './hooks';
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './settings-schema';
|
|
26
|
-
export * from './auth-routes';
|
|
27
|
-
export * from './roles';
|
|
28
|
-
export * from './api-keys';
|
|
14
|
+
export * from './interactions';
|
|
29
15
|
export * from './login';
|
|
30
|
-
export * from './
|
|
16
|
+
export * from './manifest-mcp';
|
|
17
|
+
export * from './marketplace';
|
|
18
|
+
export * from './notifications';
|
|
19
|
+
export * from './observability';
|
|
31
20
|
export * from './policy';
|
|
32
|
-
export * from './
|
|
21
|
+
export * from './presets';
|
|
22
|
+
export * from './principals';
|
|
23
|
+
export * from './profiles';
|
|
24
|
+
export * from './roles';
|
|
33
25
|
export * from './schedules';
|
|
34
|
-
export * from './
|
|
35
|
-
export * from './
|
|
26
|
+
export * from './served';
|
|
27
|
+
export * from './settings-schema';
|
|
28
|
+
export * from './setup';
|
|
29
|
+
export { jsonSchema, jsonValue } from './shared';
|
|
36
30
|
export * from './states';
|
|
37
|
-
export
|
|
31
|
+
export * from './storage';
|
|
32
|
+
export * from './studio-plugins';
|
|
33
|
+
export * from './sub-mcp';
|
|
34
|
+
export * from './system-kinds';
|
|
35
|
+
export * from './templates';
|
|
36
|
+
export * from './tool-meta';
|
|
37
|
+
export * from './tools';
|
|
38
|
+
export * from './trigger-links';
|
|
39
|
+
export * from './web-entry';
|
package/src/schemas/login.ts
CHANGED
|
@@ -24,7 +24,7 @@ export const loginMethod = z.discriminatedUnion('shape', [
|
|
|
24
24
|
shape: z.literal('form'),
|
|
25
25
|
id: z.string().min(1),
|
|
26
26
|
title: z.string().min(1),
|
|
27
|
-
purpose: z.enum(['login', '
|
|
27
|
+
purpose: z.enum(['login', 'invite']).default('login'),
|
|
28
28
|
fields: z.array(loginFormField).min(1),
|
|
29
29
|
submit_path: z.string().min(1),
|
|
30
30
|
}),
|
|
@@ -38,13 +38,20 @@ export const loginMethod = z.discriminatedUnion('shape', [
|
|
|
38
38
|
]);
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* `GET /api/login/methods` (PUBLIC). `
|
|
42
|
-
*
|
|
41
|
+
* `GET /api/login/methods` (PUBLIC). `needs_setup: true` ⇒ no principal exists
|
|
42
|
+
* yet, so the deployment must be initialized through the setup door before anyone
|
|
43
|
+
* can sign in. `setup_login` names the login-credential kinds the setup door can
|
|
44
|
+
* attach the owner's login with; it is `null`/absent when no login-attaching
|
|
45
|
+
* accounts provider is configured (a keys-only deployment). Non-strict — the
|
|
43
46
|
* skeleton may grow additive fields.
|
|
44
47
|
*/
|
|
45
48
|
export const loginMethods = z.object({
|
|
46
49
|
methods: z.array(loginMethod),
|
|
47
|
-
|
|
50
|
+
needs_setup: z.boolean(),
|
|
51
|
+
setup_login: z
|
|
52
|
+
.object({ kinds: z.array(z.enum(['password', 'invite'])) })
|
|
53
|
+
.nullable()
|
|
54
|
+
.optional(),
|
|
48
55
|
});
|
|
49
56
|
|
|
50
57
|
/**
|
package/src/schemas/policy.ts
CHANGED
package/src/schemas/presets.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Principal (identity) reference, row, listing and delete-result schemas. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A compact reference to a principal — the owner of a key, or the human behind a
|
|
6
|
+
* session — carried inline on payloads that name one.
|
|
7
|
+
*/
|
|
8
|
+
export const principalRef = z.object({
|
|
9
|
+
user_id: z.string(),
|
|
10
|
+
kind: z.enum(['human', 'service']),
|
|
11
|
+
display_name: z.string(),
|
|
12
|
+
});
|
|
13
|
+
export type PrincipalRef = z.infer<typeof principalRef>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A principal row (`/api/auth/principals`). `kind` is `human` (logs in
|
|
17
|
+
* interactively) or `service` (holds keys only, never logs in). `created_by` is
|
|
18
|
+
* the principal that created this one, or `null` for the owner the setup door
|
|
19
|
+
* mints. `disabled` turns off every credential the principal owns. `created_at`
|
|
20
|
+
* is an ISO-8601 instant.
|
|
21
|
+
*/
|
|
22
|
+
export const principal = z.object({
|
|
23
|
+
user_id: z.string(),
|
|
24
|
+
kind: z.enum(['human', 'service']),
|
|
25
|
+
display_name: z.string(),
|
|
26
|
+
created_by: z.string().nullable(),
|
|
27
|
+
disabled: z.boolean(),
|
|
28
|
+
created_at: z.string(),
|
|
29
|
+
});
|
|
30
|
+
export type Principal = z.infer<typeof principal>;
|
|
31
|
+
|
|
32
|
+
/** The principals listing (`GET /api/auth/principals`). */
|
|
33
|
+
export const principalList = z.array(principal);
|
|
34
|
+
export type PrincipalList = z.infer<typeof principalList>;
|
|
35
|
+
|
|
36
|
+
/** The delete result (`DELETE /api/auth/principals/{user_id}`). */
|
|
37
|
+
export const principalDeleted = z.object({
|
|
38
|
+
user_id: z.string(),
|
|
39
|
+
deleted: z.boolean(),
|
|
40
|
+
});
|
|
41
|
+
export type PrincipalDeleted = z.infer<typeof principalDeleted>;
|
package/src/schemas/profiles.ts
CHANGED
package/src/schemas/roles.ts
CHANGED
package/src/schemas/schedules.ts
CHANGED
package/src/schemas/served.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/** Generated served-document schema aliases and templated-text re-exports. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
|
|
3
4
|
import * as generated from '../generated/served-schemas';
|
|
4
5
|
|
|
5
|
-
export { templatedText, requiredTemplatedText } from '../templated-text';
|
|
6
6
|
export type { TemplatedText } from '../templated-text';
|
|
7
|
+
export { requiredTemplatedText, templatedText } from '../templated-text';
|
|
7
8
|
|
|
8
9
|
// Served-document schemas are GENERATED from the platform contract JSON-schema
|
|
9
10
|
// bundle (src/generated/served-schemas.ts) and re-exported here under the names the
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Setup-door (`POST /api/setup`) request-body and result schemas. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The result of a successful `POST /api/setup`, returned exactly ONCE. `api_key`
|
|
6
|
+
* is the owner key's plaintext (shown once, never retrievable again).
|
|
7
|
+
* `login_attached` is whether an interactive login was attached now;
|
|
8
|
+
* `invite_token` and `login_path` are set only when the attachment was an invite
|
|
9
|
+
* the operator completes later.
|
|
10
|
+
*/
|
|
11
|
+
export const setupResult = z.object({
|
|
12
|
+
owner_user_id: z.string(),
|
|
13
|
+
key_user_id: z.string(),
|
|
14
|
+
api_key: z.string().min(1),
|
|
15
|
+
key_fingerprint: z.string(),
|
|
16
|
+
login_attached: z.boolean(),
|
|
17
|
+
invite_token: z.string().nullable().optional(),
|
|
18
|
+
login_path: z.string().nullable().optional(),
|
|
19
|
+
});
|
|
20
|
+
export type SetupResult = z.infer<typeof setupResult>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The body of `POST /api/setup`. `setup_token` is checked against the
|
|
24
|
+
* deployment's setup token. `owner_user_id`/`key_user_id` are optional — the door
|
|
25
|
+
* mints ids when they are absent. `owner_display_name` is required. `login`
|
|
26
|
+
* attaches the owner's interactive login when a login-attaching accounts provider
|
|
27
|
+
* is configured (a password set now, or a one-time invite completed later); a
|
|
28
|
+
* keys-only setup omits it.
|
|
29
|
+
*/
|
|
30
|
+
export interface SetupBody {
|
|
31
|
+
readonly setup_token: string;
|
|
32
|
+
readonly owner_display_name: string;
|
|
33
|
+
readonly owner_user_id?: string;
|
|
34
|
+
readonly key_user_id?: string;
|
|
35
|
+
readonly key_description?: string;
|
|
36
|
+
readonly login?:
|
|
37
|
+
| { readonly kind: 'password'; readonly email: string; readonly password: string }
|
|
38
|
+
| { readonly kind: 'invite'; readonly email: string };
|
|
39
|
+
}
|
package/src/schemas/states.ts
CHANGED
package/src/schemas/templates.ts
CHANGED
package/src/schemas/tools.ts
CHANGED
package/src/tool-runs.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { z } from 'zod';
|
|
16
16
|
|
|
17
|
-
import { apiRequest, encodeSegment } from './http';
|
|
18
17
|
import type { ApiConfig } from './http';
|
|
18
|
+
import { apiRequest, encodeSegment } from './http';
|
|
19
19
|
|
|
20
20
|
/** A run's lifecycle state. `lost` = the server restarted mid-run; the result is
|
|
21
21
|
* unrecoverable. `running` is the only non-terminal state. */
|