@tai42/api-client 25.0.1 → 27.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.
Files changed (160) hide show
  1. package/dist/agents.d.ts +1 -0
  2. package/dist/agents.d.ts.map +1 -1
  3. package/dist/agents.js.map +1 -1
  4. package/dist/client/auth-client.d.ts +1 -0
  5. package/dist/client/auth-client.d.ts.map +1 -1
  6. package/dist/client/backup-client.d.ts +1 -0
  7. package/dist/client/backup-client.d.ts.map +1 -1
  8. package/dist/client/capabilities-client.d.ts +1 -0
  9. package/dist/client/capabilities-client.d.ts.map +1 -1
  10. package/dist/client/channels-client.d.ts +4 -1
  11. package/dist/client/channels-client.d.ts.map +1 -1
  12. package/dist/client/config-client.d.ts +1 -0
  13. package/dist/client/config-client.d.ts.map +1 -1
  14. package/dist/client/connectors-client.d.ts +7 -0
  15. package/dist/client/connectors-client.d.ts.map +1 -1
  16. package/dist/client/conversations-client.d.ts +9 -9
  17. package/dist/client/hooks-client.d.ts +1 -1
  18. package/dist/client/index.d.ts +528 -199
  19. package/dist/client/index.d.ts.map +1 -1
  20. package/dist/client/index.js +9 -1
  21. package/dist/client/index.js.map +1 -1
  22. package/dist/client/interactions-client.d.ts +1 -1
  23. package/dist/client/manifest-client.d.ts +161 -30
  24. package/dist/client/manifest-client.d.ts.map +1 -1
  25. package/dist/client/manifest-client.js +16 -5
  26. package/dist/client/manifest-client.js.map +1 -1
  27. package/dist/client/marketplace-client.d.ts +132 -83
  28. package/dist/client/marketplace-client.d.ts.map +1 -1
  29. package/dist/client/observability-client.d.ts +2 -2
  30. package/dist/client/presets-client.d.ts +113 -11
  31. package/dist/client/presets-client.d.ts.map +1 -1
  32. package/dist/client/presets-client.js +4 -3
  33. package/dist/client/presets-client.js.map +1 -1
  34. package/dist/client/profiles-client.d.ts +1 -0
  35. package/dist/client/profiles-client.d.ts.map +1 -1
  36. package/dist/client/states-client.d.ts +30 -21
  37. package/dist/client/states-client.d.ts.map +1 -1
  38. package/dist/client/states-client.js +5 -0
  39. package/dist/client/states-client.js.map +1 -1
  40. package/dist/client/storage-client.d.ts +19 -0
  41. package/dist/client/storage-client.d.ts.map +1 -1
  42. package/dist/client/storage-client.js +14 -17
  43. package/dist/client/storage-client.js.map +1 -1
  44. package/dist/client/templates-client.d.ts +20 -2
  45. package/dist/client/templates-client.d.ts.map +1 -1
  46. package/dist/client/templates-client.js +1 -1
  47. package/dist/client/templates-client.js.map +1 -1
  48. package/dist/client/tool-extensions-client.d.ts +3 -0
  49. package/dist/client/tool-extensions-client.d.ts.map +1 -1
  50. package/dist/client/transport.d.ts +2 -1
  51. package/dist/client/transport.d.ts.map +1 -1
  52. package/dist/client/transport.js.map +1 -1
  53. package/dist/errors.d.ts +13 -0
  54. package/dist/errors.d.ts.map +1 -1
  55. package/dist/errors.js +31 -0
  56. package/dist/errors.js.map +1 -1
  57. package/dist/fleet-report.d.ts +14 -2
  58. package/dist/fleet-report.d.ts.map +1 -1
  59. package/dist/fleet-report.js +41 -10
  60. package/dist/fleet-report.js.map +1 -1
  61. package/dist/generated/api-routes.d.ts +17 -1
  62. package/dist/generated/api-routes.d.ts.map +1 -1
  63. package/dist/generated/api-routes.js +7 -2
  64. package/dist/generated/api-routes.js.map +1 -1
  65. package/dist/generated/openapi-schemas.d.ts +737 -160
  66. package/dist/generated/openapi-schemas.d.ts.map +1 -1
  67. package/dist/generated/openapi-schemas.js +46 -27
  68. package/dist/generated/openapi-schemas.js.map +1 -1
  69. package/dist/generated/served-schemas.d.ts +80 -16
  70. package/dist/generated/served-schemas.d.ts.map +1 -1
  71. package/dist/generated/served-schemas.js +64 -4
  72. package/dist/generated/served-schemas.js.map +1 -1
  73. package/dist/http.d.ts +6 -0
  74. package/dist/http.d.ts.map +1 -1
  75. package/dist/http.js +11 -0
  76. package/dist/http.js.map +1 -1
  77. package/dist/index.d.ts +3 -3
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js.map +1 -1
  80. package/dist/schemas/auth-routes.d.ts +34 -8
  81. package/dist/schemas/auth-routes.d.ts.map +1 -1
  82. package/dist/schemas/auth-routes.js +16 -8
  83. package/dist/schemas/auth-routes.js.map +1 -1
  84. package/dist/schemas/backup.d.ts +13 -0
  85. package/dist/schemas/backup.d.ts.map +1 -1
  86. package/dist/schemas/backup.js +5 -0
  87. package/dist/schemas/backup.js.map +1 -1
  88. package/dist/schemas/capabilities.d.ts +11 -6
  89. package/dist/schemas/capabilities.d.ts.map +1 -1
  90. package/dist/schemas/capabilities.js +10 -6
  91. package/dist/schemas/capabilities.js.map +1 -1
  92. package/dist/schemas/channels.d.ts +6 -1
  93. package/dist/schemas/channels.d.ts.map +1 -1
  94. package/dist/schemas/connectors.d.ts +6 -0
  95. package/dist/schemas/connectors.d.ts.map +1 -1
  96. package/dist/schemas/conversations.d.ts +11 -11
  97. package/dist/schemas/extensions.d.ts +8 -4
  98. package/dist/schemas/extensions.d.ts.map +1 -1
  99. package/dist/schemas/extensions.js +5 -4
  100. package/dist/schemas/extensions.js.map +1 -1
  101. package/dist/schemas/hooks.d.ts +1 -1
  102. package/dist/schemas/interactions.d.ts +3 -3
  103. package/dist/schemas/manifest-mcp.d.ts +78 -0
  104. package/dist/schemas/manifest-mcp.d.ts.map +1 -1
  105. package/dist/schemas/manifest-mcp.js +19 -0
  106. package/dist/schemas/manifest-mcp.js.map +1 -1
  107. package/dist/schemas/marketplace.d.ts +155 -84
  108. package/dist/schemas/marketplace.d.ts.map +1 -1
  109. package/dist/schemas/marketplace.js +7 -2
  110. package/dist/schemas/marketplace.js.map +1 -1
  111. package/dist/schemas/observability.d.ts +3 -3
  112. package/dist/schemas/presets.d.ts +107 -14
  113. package/dist/schemas/presets.d.ts.map +1 -1
  114. package/dist/schemas/presets.js +7 -5
  115. package/dist/schemas/presets.js.map +1 -1
  116. package/dist/schemas/profiles.d.ts +1 -0
  117. package/dist/schemas/profiles.d.ts.map +1 -1
  118. package/dist/schemas/served.d.ts +67 -13
  119. package/dist/schemas/served.d.ts.map +1 -1
  120. package/dist/schemas/states.d.ts +22 -22
  121. package/dist/schemas/storage.d.ts +30 -1
  122. package/dist/schemas/storage.d.ts.map +1 -1
  123. package/dist/schemas/storage.js +8 -1
  124. package/dist/schemas/storage.js.map +1 -1
  125. package/dist/schemas/system-kinds.d.ts +1 -0
  126. package/dist/schemas/system-kinds.d.ts.map +1 -1
  127. package/dist/schemas/system-kinds.js +6 -5
  128. package/dist/schemas/system-kinds.js.map +1 -1
  129. package/dist/schemas/templates.d.ts +110 -83
  130. package/dist/schemas/templates.d.ts.map +1 -1
  131. package/dist/schemas/templates.js +14 -2
  132. package/dist/schemas/templates.js.map +1 -1
  133. package/dist/schemas/tools.d.ts +1 -1
  134. package/package.json +1 -1
  135. package/src/agents.ts +1 -0
  136. package/src/client/index.ts +9 -2
  137. package/src/client/manifest-client.ts +39 -12
  138. package/src/client/presets-client.ts +20 -6
  139. package/src/client/states-client.ts +10 -0
  140. package/src/client/storage-client.ts +21 -17
  141. package/src/client/templates-client.ts +1 -1
  142. package/src/client/transport.ts +3 -1
  143. package/src/errors.ts +34 -0
  144. package/src/fleet-report.ts +46 -7
  145. package/src/generated/api-routes.ts +7 -2
  146. package/src/generated/openapi-schemas.ts +80 -31
  147. package/src/generated/served-schemas.ts +64 -4
  148. package/src/http.ts +12 -0
  149. package/src/index.ts +19 -2
  150. package/src/schemas/auth-routes.ts +18 -8
  151. package/src/schemas/backup.ts +7 -0
  152. package/src/schemas/capabilities.ts +10 -6
  153. package/src/schemas/channels.ts +2 -0
  154. package/src/schemas/extensions.ts +5 -4
  155. package/src/schemas/manifest-mcp.ts +25 -0
  156. package/src/schemas/marketplace.ts +7 -2
  157. package/src/schemas/presets.ts +13 -6
  158. package/src/schemas/storage.ts +10 -1
  159. package/src/schemas/system-kinds.ts +6 -5
  160. 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, and `action` its authorization class — the join fields the Roles
20
- * grant editor reads to derive grantable feature groups and mark the admin-only
21
- * (fenced/secret) routes it must never offer a grant for. An unregistered path
22
- * carries `tags: []`, `summary: ''`, `action: null`. `declared_public` is `true` for
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. `read`/`write` routes are GRANTABLE — a role's per-tag level opens
34
- * them; `fenced`/`secret` routes are ADMIN-ONLY and never grantable (no per-tag
35
- * level reaches them). `null` on a row marks a path the registry carries no metadata
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
 
@@ -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
- /** A concrete route the caller can reach, with the methods that pass its jq fence. */
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 concrete
29
- * (path, method) surface, dynamic patterns, sub-MCP mounts, tools, and agents it
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 a jq-exact `routes` list. `owner_user_id` is
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, so the UI can filter on it without ever advertising a
38
- * door the gate denies.
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>;
@@ -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 } from '../generated/openapi-schemas';
@@ -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 author config (e.g. an `output_schema` JSON
15
- * Schema, or an `ask_external` verifier). Both wire forms are admitted so a
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 config-bearing `{ name, config }` mapping —
29
- * `output_schema` carries its schema this way); `[]` when the tool has no map entry.
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 } from '../generated/openapi-schemas';
@@ -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>;
@@ -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` — every OTHER preset whose active authored
56
- * composition names this one as a tool (the referees a rename would strand). An
57
- * empty list is the clean case; a non-empty list means a rename is blocked until
58
- * those presets are updated. A drift throws `ApiSchemaError`.
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 presetReferees = openapi.presetRefereesResult;
61
- export type PresetReferees = z.infer<typeof presetReferees>;
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`
@@ -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
 
@@ -6,11 +6,12 @@ import { fleetResult } from './fleet';
6
6
  import { reloadConfigResult } from './manifest-mcp';
7
7
 
8
8
  // `GET /api/system/kinds` — one row per pluggable kind (identity, accounts,
9
- // monitoring, storage, backend, channels, webhook_verifiers, config,
10
- // studio_plugins). `state` is the kind's active/default/off status: `active` = a
11
- // real plugin serves it, `default` = a built-in fallback serves it, `off` =
12
- // nothing is registered (a legal state, reported not "fixed"). `plugin` is the
13
- // provider/module name when known, else null.
9
+ // monitoring, storage, files, backend, sandbox, channels, webhook_verifiers,
10
+ // config, studio_plugins). `state` is the kind's active/default/off status:
11
+ // `active` = a real plugin serves it, `default` = a built-in fallback serves it,
12
+ // `off` = nothing is registered (a legal state, reported not "fixed"). `plugin` is
13
+ // the provider/module name when known, else null. The `files` row reports whether
14
+ // the server's optional file-loading dependencies are installed.
14
15
 
15
16
  export const kindStatus = openapi.kindStatus;
16
17
  export const kindStatusList = openapi.systemKindsListing;
@@ -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
- export const templateDetail = openapi.templateFetchView;
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;