@tai42/api-client 25.0.1 → 26.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 +1 -0
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js.map +1 -1
- package/dist/client/auth-client.d.ts +1 -0
- package/dist/client/auth-client.d.ts.map +1 -1
- package/dist/client/backup-client.d.ts +1 -0
- package/dist/client/backup-client.d.ts.map +1 -1
- package/dist/client/capabilities-client.d.ts +1 -0
- package/dist/client/capabilities-client.d.ts.map +1 -1
- package/dist/client/channels-client.d.ts +4 -1
- package/dist/client/channels-client.d.ts.map +1 -1
- package/dist/client/config-client.d.ts +1 -0
- package/dist/client/config-client.d.ts.map +1 -1
- package/dist/client/connectors-client.d.ts +7 -0
- package/dist/client/connectors-client.d.ts.map +1 -1
- package/dist/client/conversations-client.d.ts +9 -9
- package/dist/client/hooks-client.d.ts +1 -1
- package/dist/client/index.d.ts +529 -198
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +9 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/interactions-client.d.ts +1 -1
- package/dist/client/manifest-client.d.ts +161 -30
- package/dist/client/manifest-client.d.ts.map +1 -1
- package/dist/client/manifest-client.js +16 -5
- package/dist/client/manifest-client.js.map +1 -1
- package/dist/client/marketplace-client.d.ts +132 -83
- package/dist/client/marketplace-client.d.ts.map +1 -1
- package/dist/client/observability-client.d.ts +2 -2
- package/dist/client/presets-client.d.ts +113 -11
- package/dist/client/presets-client.d.ts.map +1 -1
- package/dist/client/presets-client.js +4 -3
- package/dist/client/presets-client.js.map +1 -1
- package/dist/client/profiles-client.d.ts +1 -0
- package/dist/client/profiles-client.d.ts.map +1 -1
- package/dist/client/states-client.d.ts +30 -21
- package/dist/client/states-client.d.ts.map +1 -1
- package/dist/client/states-client.js +5 -0
- package/dist/client/states-client.js.map +1 -1
- package/dist/client/storage-client.d.ts +19 -0
- package/dist/client/storage-client.d.ts.map +1 -1
- package/dist/client/storage-client.js +14 -17
- package/dist/client/storage-client.js.map +1 -1
- package/dist/client/templates-client.d.ts +20 -2
- package/dist/client/templates-client.d.ts.map +1 -1
- package/dist/client/templates-client.js +1 -1
- package/dist/client/templates-client.js.map +1 -1
- package/dist/client/tool-extensions-client.d.ts +3 -0
- package/dist/client/tool-extensions-client.d.ts.map +1 -1
- package/dist/client/transport.d.ts +2 -1
- package/dist/client/transport.d.ts.map +1 -1
- package/dist/client/transport.js.map +1 -1
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +31 -0
- package/dist/errors.js.map +1 -1
- package/dist/fleet-report.d.ts +14 -2
- package/dist/fleet-report.d.ts.map +1 -1
- package/dist/fleet-report.js +41 -10
- package/dist/fleet-report.js.map +1 -1
- package/dist/generated/api-routes.d.ts +17 -1
- package/dist/generated/api-routes.d.ts.map +1 -1
- package/dist/generated/api-routes.js +7 -2
- package/dist/generated/api-routes.js.map +1 -1
- package/dist/generated/openapi-schemas.d.ts +737 -160
- package/dist/generated/openapi-schemas.d.ts.map +1 -1
- package/dist/generated/openapi-schemas.js +46 -27
- package/dist/generated/openapi-schemas.js.map +1 -1
- package/dist/generated/served-schemas.d.ts +80 -16
- package/dist/generated/served-schemas.d.ts.map +1 -1
- package/dist/generated/served-schemas.js +64 -4
- package/dist/generated/served-schemas.js.map +1 -1
- package/dist/http.d.ts +6 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +11 -0
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas/auth-routes.d.ts +34 -8
- package/dist/schemas/auth-routes.d.ts.map +1 -1
- package/dist/schemas/auth-routes.js +16 -8
- package/dist/schemas/auth-routes.js.map +1 -1
- package/dist/schemas/backup.d.ts +13 -0
- package/dist/schemas/backup.d.ts.map +1 -1
- package/dist/schemas/backup.js +5 -0
- package/dist/schemas/backup.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +11 -6
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +10 -6
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/channels.d.ts +7 -1
- package/dist/schemas/channels.d.ts.map +1 -1
- package/dist/schemas/connectors.d.ts +6 -0
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/conversations.d.ts +11 -11
- package/dist/schemas/extensions.d.ts +8 -4
- package/dist/schemas/extensions.d.ts.map +1 -1
- package/dist/schemas/extensions.js +5 -4
- package/dist/schemas/extensions.js.map +1 -1
- package/dist/schemas/hooks.d.ts +1 -1
- package/dist/schemas/interactions.d.ts +3 -3
- package/dist/schemas/manifest-mcp.d.ts +79 -0
- package/dist/schemas/manifest-mcp.d.ts.map +1 -1
- package/dist/schemas/manifest-mcp.js +19 -0
- package/dist/schemas/manifest-mcp.js.map +1 -1
- package/dist/schemas/marketplace.d.ts +155 -84
- package/dist/schemas/marketplace.d.ts.map +1 -1
- package/dist/schemas/marketplace.js +7 -2
- package/dist/schemas/marketplace.js.map +1 -1
- package/dist/schemas/observability.d.ts +3 -3
- package/dist/schemas/presets.d.ts +107 -14
- package/dist/schemas/presets.d.ts.map +1 -1
- package/dist/schemas/presets.js +7 -5
- package/dist/schemas/presets.js.map +1 -1
- package/dist/schemas/profiles.d.ts +1 -0
- package/dist/schemas/profiles.d.ts.map +1 -1
- package/dist/schemas/served.d.ts +67 -13
- package/dist/schemas/served.d.ts.map +1 -1
- package/dist/schemas/states.d.ts +22 -22
- package/dist/schemas/storage.d.ts +30 -1
- package/dist/schemas/storage.d.ts.map +1 -1
- package/dist/schemas/storage.js +8 -1
- package/dist/schemas/storage.js.map +1 -1
- package/dist/schemas/system-kinds.d.ts +1 -0
- package/dist/schemas/system-kinds.d.ts.map +1 -1
- package/dist/schemas/templates.d.ts +110 -83
- package/dist/schemas/templates.d.ts.map +1 -1
- package/dist/schemas/templates.js +14 -2
- package/dist/schemas/templates.js.map +1 -1
- package/dist/schemas/tools.d.ts +1 -1
- package/package.json +1 -1
- package/src/agents.ts +1 -0
- package/src/client/index.ts +9 -2
- package/src/client/manifest-client.ts +39 -12
- package/src/client/presets-client.ts +20 -6
- package/src/client/states-client.ts +10 -0
- package/src/client/storage-client.ts +21 -17
- package/src/client/templates-client.ts +1 -1
- package/src/client/transport.ts +3 -1
- package/src/errors.ts +34 -0
- package/src/fleet-report.ts +46 -7
- package/src/generated/api-routes.ts +7 -2
- package/src/generated/openapi-schemas.ts +80 -31
- package/src/generated/served-schemas.ts +64 -4
- package/src/http.ts +12 -0
- package/src/index.ts +19 -2
- package/src/schemas/auth-routes.ts +18 -8
- package/src/schemas/backup.ts +7 -0
- package/src/schemas/capabilities.ts +10 -6
- package/src/schemas/channels.ts +2 -0
- package/src/schemas/extensions.ts +5 -4
- package/src/schemas/manifest-mcp.ts +25 -0
- package/src/schemas/marketplace.ts +7 -2
- package/src/schemas/presets.ts +13 -6
- package/src/schemas/storage.ts +10 -1
- package/src/schemas/templates.ts +17 -1
|
@@ -16,10 +16,11 @@ export const removeScopeResult = openapi.scopeDeleteResult;
|
|
|
16
16
|
* scope id, the public marker, or `null` when the path is unmapped (the mapper's
|
|
17
17
|
* "unassigned" bucket source). `methods` is the route's method set with `HEAD`
|
|
18
18
|
* removed. `tags` are the route's feature-group labels, `summary` its one-line
|
|
19
|
-
* description,
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* carries `tags: []`, `summary: ''`, `action: null
|
|
19
|
+
* description, `action` its authorization class, and `role_reach` the server's
|
|
20
|
+
* decision of what opens it for a non-admin role — the Roles grant editor groups
|
|
21
|
+
* routes by `tags` and offers a level only on a group with a `level` route. An
|
|
22
|
+
* unregistered path carries `tags: []`, `summary: ''`, `action: null`,
|
|
23
|
+
* `role_reach: null`. `declared_public` is `true` for
|
|
23
24
|
* a route its registration declares public: it is served without authentication
|
|
24
25
|
* and no scope mapping or public pin changes that, so the mapper never offers it
|
|
25
26
|
* for a scope.
|
|
@@ -30,14 +31,23 @@ export const authRoutes = openapi.routeMappingList;
|
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* A route's authorization ACTION class, joined onto the catalog from the route
|
|
33
|
-
* registry
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* for (an unregistered/ungated path — no feature tags, no action).
|
|
34
|
+
* registry: `read`/`write` by the route's method, `fenced`/`secret` reserved for
|
|
35
|
+
* admins. `null` on a row marks a path the registry carries no metadata for (an
|
|
36
|
+
* unregistered/ungated path — no feature tags, no action).
|
|
37
37
|
*/
|
|
38
38
|
export const routeAction = openapi.routeMappingRow.shape.action.unwrap();
|
|
39
39
|
export type RouteAction = z.infer<typeof routeAction>;
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* A route's role reach, the server's decision of what opens it for a non-admin role:
|
|
43
|
+
* `level` — a role's per-tag level opens it; `self_service` — every role keeps it, no
|
|
44
|
+
* level; `admin_only` — a fenced/secret class or a control-plane route the base tier
|
|
45
|
+
* reserves; `public` — the route is not authenticated and answers everyone without a
|
|
46
|
+
* login. `null` on a row marks a path with no registry metadata.
|
|
47
|
+
*/
|
|
48
|
+
export const routeRoleReach = openapi.routeMappingRow.shape.role_reach.unwrap();
|
|
49
|
+
export type RouteRoleReach = z.infer<typeof routeRoleReach>;
|
|
50
|
+
|
|
41
51
|
/** `GET /api/auth/public-routes` — the sorted urls pinned to the public marker. */
|
|
42
52
|
export const publicRoutes = openapi.stringList;
|
|
43
53
|
|
package/src/schemas/backup.ts
CHANGED
|
@@ -6,6 +6,13 @@ import { fleetReportFanout } from './fleet';
|
|
|
6
6
|
|
|
7
7
|
export const backupSections = openapi.backupSectionListing;
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* The export door's downloaded document: the exported `sections` and the `errors` map
|
|
11
|
+
* naming each section whose exporter failed (that section is absent from `sections`).
|
|
12
|
+
*/
|
|
13
|
+
export const backupExportDocument = openapi.backupExportDocument;
|
|
14
|
+
export type BackupExportDocument = z.infer<typeof backupExportDocument>;
|
|
15
|
+
|
|
9
16
|
/**
|
|
10
17
|
* A backup document as the import door accepts it — validated when the UI reads a picked
|
|
11
18
|
* file. Hand-written over the export's document: the import door takes `version` 1 and a
|
|
@@ -3,7 +3,11 @@ import type { z } from 'zod';
|
|
|
3
3
|
|
|
4
4
|
import * as openapi from '../generated/openapi-schemas';
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* A route the caller can reach — a concrete path, or a route template such as
|
|
8
|
+
* `/api/presets/{name}` — with the methods its grant admits (on a representative
|
|
9
|
+
* instance, for a template).
|
|
10
|
+
*/
|
|
7
11
|
export const routeEntry = openapi.routeEntry;
|
|
8
12
|
export type RouteEntry = z.infer<typeof routeEntry>;
|
|
9
13
|
|
|
@@ -25,17 +29,17 @@ export const subMcpEntry = openapi.subMcpEntry;
|
|
|
25
29
|
export type SubMcpEntry = z.infer<typeof subMcpEntry>;
|
|
26
30
|
|
|
27
31
|
/**
|
|
28
|
-
* `GET /api/auth/me` — the caller's derived capability projection: the
|
|
29
|
-
* (
|
|
32
|
+
* `GET /api/auth/me` — the caller's derived capability projection: the (path, method)
|
|
33
|
+
* surface (concrete paths and route templates), dynamic patterns, sub-MCP mounts, tools, and agents it
|
|
30
34
|
* can reach RIGHT NOW (derived server-side, never stored). `admin` is the
|
|
31
35
|
* condition-free `"*"` discriminator (a TOTAL projection); a scoped
|
|
32
|
-
* session carries `admin: false` and
|
|
36
|
+
* session carries `admin: false` and its projected `routes` list. `owner_user_id` is
|
|
33
37
|
* the key's owner claim, `null` for a key with no owner claim. `principal` is the
|
|
34
38
|
* caller's principal (kind + display name), `null` when no principal row backs the
|
|
35
39
|
* credential. `public_resource_id` is the deployment's reserved public marker (the
|
|
36
40
|
* route-table id a public route maps to — never a scope). The invariant is projection ⊆ gate: every projected surface is one
|
|
37
|
-
* the server would admit
|
|
38
|
-
*
|
|
41
|
+
* the server would admit for a role-holder; a credential fenced per instance is
|
|
42
|
+
* decided at the server, which answers 403 where its fence denies the instance.
|
|
39
43
|
*/
|
|
40
44
|
export const meProjection = openapi.projectionResult;
|
|
41
45
|
export type MeProjection = z.infer<typeof meProjection>;
|
package/src/schemas/channels.ts
CHANGED
|
@@ -9,3 +9,5 @@ import * as openapi from '../generated/openapi-schemas';
|
|
|
9
9
|
|
|
10
10
|
export const channels = openapi.channelListing;
|
|
11
11
|
export type Channels = z.infer<typeof channels>;
|
|
12
|
+
/** One installed channel plugin: its name and its declared identity hint, if any. */
|
|
13
|
+
export type ChannelEntry = z.infer<typeof openapi.channelEntry>;
|
|
@@ -11,8 +11,8 @@ export type Extension = z.infer<typeof extension>;
|
|
|
11
11
|
// reads its `{ name, config }` form.
|
|
12
12
|
/**
|
|
13
13
|
* One element of an extension combo: a bare extension NAME, or a
|
|
14
|
-
* `{ name, config }` mapping binding
|
|
15
|
-
*
|
|
14
|
+
* `{ name, config }` mapping binding the extension's settings, which the server
|
|
15
|
+
* checks against the extension's declared `config_schema`. Both wire forms are admitted so a
|
|
16
16
|
* config-bearing combo parses without dropping server data. A drift throws
|
|
17
17
|
* `ApiSchemaError`.
|
|
18
18
|
*/
|
|
@@ -25,8 +25,9 @@ export type PresetExtensionElement = z.infer<typeof presetExtensionElement>;
|
|
|
25
25
|
/**
|
|
26
26
|
* `GET /api/tools/{name}/extensions` — a tool's FULL lossless list-of-combos plus
|
|
27
27
|
* the extension catalog. `combos` is a list of combos, each an ordered list of
|
|
28
|
-
* extension ELEMENTS (a bare name or a
|
|
29
|
-
*
|
|
28
|
+
* extension ELEMENTS (a bare name, or a `{ name, config }` mapping binding the
|
|
29
|
+
* extension's settings, which the server checks against the extension's declared
|
|
30
|
+
* `config_schema`); `[]` when the tool has no map entry.
|
|
30
31
|
* It carries EVERY combo mapped to the base tool (the union across every `tools`/`mcp`
|
|
31
32
|
* config), never a single flattened one. `available` is the same flat catalog
|
|
32
33
|
* `GET /api/extensions` returns. A drift throws `ApiSchemaError`.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
import * as openapi from '../generated/openapi-schemas';
|
|
5
|
+
import { presetExtensionElement } from './extensions';
|
|
5
6
|
import { fleetReportFanout } from './fleet';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -33,8 +34,23 @@ export const manifestMcpEntry = z
|
|
|
33
34
|
.loose();
|
|
34
35
|
export type ManifestMcpEntry = z.infer<typeof manifestMcpEntry>;
|
|
35
36
|
|
|
37
|
+
const extensionMap = z.record(z.string(), z.array(z.array(presetExtensionElement)));
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The preserved manifest's extension settings: the extension modules, the backend
|
|
41
|
+
* module, and the `extensions` maps of the `tools`, `mcp` and `api_tools` sections,
|
|
42
|
+
* each combo element refined to the client's extension-element schema.
|
|
43
|
+
*/
|
|
44
|
+
export const manifestExtensionSettings = openapi.manifestExtensionSettings.extend({
|
|
45
|
+
tools: z.array(openapi.manifestExtensionMap.extend({ extensions: extensionMap })),
|
|
46
|
+
mcp: z.array(openapi.manifestExtensionMap.extend({ extensions: extensionMap })),
|
|
47
|
+
api_tools: extensionMap,
|
|
48
|
+
});
|
|
49
|
+
export type ManifestExtensionSettings = z.infer<typeof manifestExtensionSettings>;
|
|
50
|
+
|
|
36
51
|
export const manifestView = openapi.preservedManifestView.extend({
|
|
37
52
|
mcp: z.array(manifestMcpEntry),
|
|
53
|
+
extension_settings: manifestExtensionSettings,
|
|
38
54
|
});
|
|
39
55
|
|
|
40
56
|
/**
|
|
@@ -62,3 +78,12 @@ export type McpEnvRefs = z.infer<typeof mcpEnvRefs>;
|
|
|
62
78
|
*/
|
|
63
79
|
export const reloadConfigResult = openapi.applyResponse.extend({ fanout: fleetReportFanout });
|
|
64
80
|
export type ReloadConfigResult = z.infer<typeof reloadConfigResult>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* `POST /api/mcp-status/{title}/advertised-tools` — every tool the server advertises
|
|
84
|
+
* (before the entry's include/exclude filter), each with whether it is selected and
|
|
85
|
+
* bound, and why not (`unbound_reason`, or `null` when bound or unselected).
|
|
86
|
+
*/
|
|
87
|
+
export const mcpAdvertisedTools = openapi.mcpAdvertisedTools;
|
|
88
|
+
export type McpAdvertisedTools = z.infer<typeof mcpAdvertisedTools>;
|
|
89
|
+
export type McpAdvertisedTool = z.infer<typeof openapi.mcpAdvertisedTool>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
import * as openapi from '../generated/openapi-schemas';
|
|
5
|
+
import { reloadConfigResult } from './manifest-mcp';
|
|
5
6
|
|
|
6
7
|
// The registry's listing, search, version, detail and advisory shapes are hand-written: the
|
|
7
8
|
// skeleton passes the upstream registry's bodies through as opaque values. The installed,
|
|
@@ -299,10 +300,12 @@ export type MarketplaceMountedRoute = z.infer<typeof marketplaceMountedRoute>;
|
|
|
299
300
|
* non-critical `advisories` ride BOTH the install and update receipts.
|
|
300
301
|
* `routes` is the mounted-route list — empty for a plugin that registers none.
|
|
301
302
|
* `package`, `reload` and `pip_output` carry the installed package, the config reload
|
|
302
|
-
* and the raw install log
|
|
303
|
+
* and the raw install log; the reload's fan-out parses into its three modes so a
|
|
304
|
+
* failed propagation reaches the fleet report.
|
|
303
305
|
*/
|
|
304
306
|
export const marketplaceInstallResult = openapi.installResult.extend({
|
|
305
307
|
advisories: z.array(marketplaceAdvisory),
|
|
308
|
+
reload: reloadConfigResult,
|
|
306
309
|
});
|
|
307
310
|
export type MarketplaceInstallResult = z.infer<typeof marketplaceInstallResult>;
|
|
308
311
|
|
|
@@ -348,5 +351,7 @@ export type MarketplaceInstallPreview = z.infer<typeof marketplaceInstallPreview
|
|
|
348
351
|
* provider still selected by its env var); render them like the install
|
|
349
352
|
* receipt's notes. `reload` is `null` when the plugin wrote no manifest entry to remove.
|
|
350
353
|
*/
|
|
351
|
-
export const marketplaceUninstallResult = openapi.uninstallResult
|
|
354
|
+
export const marketplaceUninstallResult = openapi.uninstallResult.extend({
|
|
355
|
+
reload: reloadConfigResult.nullable(),
|
|
356
|
+
});
|
|
352
357
|
export type MarketplaceUninstallResult = z.infer<typeof marketplaceUninstallResult>;
|
package/src/schemas/presets.ts
CHANGED
|
@@ -52,13 +52,20 @@ export const presetRenamed = openapi.presetRenameResult;
|
|
|
52
52
|
export type PresetRenamed = z.infer<typeof presetRenamed>;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* `GET /api/presets/{name}/referees
|
|
56
|
-
*
|
|
57
|
-
* empty list is the clean case; a non-empty list
|
|
58
|
-
*
|
|
55
|
+
* `GET /api/presets/{name}/referees?action=` and
|
|
56
|
+
* `GET /api/states/{name}/attachments/{template}/referees` — every holder that would
|
|
57
|
+
* refuse the action. An empty list is the clean case; a non-empty list is what the
|
|
58
|
+
* server's 409 would name. A drift throws `ApiSchemaError`.
|
|
59
59
|
*/
|
|
60
|
-
export const
|
|
61
|
-
export type
|
|
60
|
+
export const holdersPreview = openapi.holdersPreview;
|
|
61
|
+
export type HoldersPreview = z.infer<typeof holdersPreview>;
|
|
62
|
+
|
|
63
|
+
/** One holder of a reference: its kind, its name, a one-line summary and its locator. */
|
|
64
|
+
export const referenceHolder = openapi.referenceHolder;
|
|
65
|
+
export type ReferenceHolder = z.infer<typeof referenceHolder>;
|
|
66
|
+
|
|
67
|
+
/** The preset action a holder preview answers for. */
|
|
68
|
+
export type PresetHolderAction = 'rename' | 'delete';
|
|
62
69
|
|
|
63
70
|
/**
|
|
64
71
|
* `POST /api/presets/validate` — the dry-run verdict for a preset draft. `valid`
|
package/src/schemas/storage.ts
CHANGED
|
@@ -4,10 +4,19 @@ import type { z } from 'zod';
|
|
|
4
4
|
import * as openapi from '../generated/openapi-schemas';
|
|
5
5
|
|
|
6
6
|
/** `GET /api/storage` — the storage-provider identity, or the absent sentinel
|
|
7
|
-
* (`present: false`, a 200) when no storage-provider plugin is installed
|
|
7
|
+
* (`present: false`, a 200) when no storage-provider plugin is installed; `surfaces`
|
|
8
|
+
* names the mounted doors (`storage`, `templates`) the caller's grants reach. */
|
|
8
9
|
export const storageInfo = openapi.storageInfo;
|
|
9
10
|
export type StorageInfo = z.infer<typeof storageInfo>;
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* `GET /api/storage/entries/{id}` — one stored object as the server classifies it: a
|
|
14
|
+
* `text` or `document` entry carries its (extracted) content, a `binary` entry only its
|
|
15
|
+
* type and size. An unknown `kind` throws `ApiSchemaError`.
|
|
16
|
+
*/
|
|
17
|
+
export const storedEntry = openapi.storedEntry;
|
|
18
|
+
export type StoredEntry = z.infer<typeof storedEntry>;
|
|
19
|
+
|
|
11
20
|
/** `GET /api/storage/resources` — the full sorted resource-id list. */
|
|
12
21
|
export const storageResourceList = openapi.resourceList;
|
|
13
22
|
|
package/src/schemas/templates.ts
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
/** Prompt-template listing, render and mutation ack schemas. */
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
|
|
2
4
|
import * as openapi from '../generated/openapi-schemas';
|
|
3
5
|
|
|
4
6
|
export const templateNames = openapi.stringListResponse;
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* `POST /api/template` — one stored template entry. A `text` entry carries its content
|
|
9
|
+
* and either its declared `schema` or the `schema_error` that kept it from compiling;
|
|
10
|
+
* `document` and `binary` entries carry no schema. A text entry with both or neither of
|
|
11
|
+
* `schema` and `schema_error` is refused.
|
|
12
|
+
*/
|
|
13
|
+
export const templateEntry = openapi.templateEntry.superRefine((entry, ctx) => {
|
|
14
|
+
if (entry.kind === 'text' && (entry.schema === null) === (entry.schema_error === null)) {
|
|
15
|
+
ctx.addIssue({
|
|
16
|
+
code: 'custom',
|
|
17
|
+
message: "a text template entry carries exactly one of 'schema' and 'schema_error'",
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export type TemplateEntry = z.infer<typeof templateEntry>;
|
|
6
22
|
export const templateUploaded = openapi.templateUploadResult;
|
|
7
23
|
export const templateDeleted = openapi.templateDeleteResult;
|
|
8
24
|
export const templateDirDeleted = openapi.templateDeleteResult;
|