@w6w/sdk 0.9.15 → 0.9.23

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 (91) hide show
  1. package/README.md +21 -16
  2. package/dist/mod.d.ts +12 -1
  3. package/dist/mod.d.ts.map +1 -1
  4. package/dist/mod.js +7 -1
  5. package/dist/mod.js.map +1 -1
  6. package/dist/src/agents.d.ts +33 -0
  7. package/dist/src/agents.d.ts.map +1 -0
  8. package/dist/src/agents.js +73 -0
  9. package/dist/src/agents.js.map +1 -0
  10. package/dist/src/assets.d.ts +56 -0
  11. package/dist/src/assets.d.ts.map +1 -0
  12. package/dist/src/assets.js +143 -0
  13. package/dist/src/assets.js.map +1 -0
  14. package/dist/src/client.d.ts +24 -3
  15. package/dist/src/client.d.ts.map +1 -1
  16. package/dist/src/client.js +32 -3
  17. package/dist/src/client.js.map +1 -1
  18. package/dist/src/config.d.ts +14 -8
  19. package/dist/src/config.d.ts.map +1 -1
  20. package/dist/src/config.js +15 -9
  21. package/dist/src/config.js.map +1 -1
  22. package/dist/src/connections.d.ts +8 -3
  23. package/dist/src/connections.d.ts.map +1 -1
  24. package/dist/src/connections.js +6 -2
  25. package/dist/src/connections.js.map +1 -1
  26. package/dist/src/console/apps.d.ts +13 -0
  27. package/dist/src/console/apps.d.ts.map +1 -1
  28. package/dist/src/console/apps.js +3 -0
  29. package/dist/src/console/apps.js.map +1 -1
  30. package/dist/src/console/connections.d.ts +71 -11
  31. package/dist/src/console/connections.d.ts.map +1 -1
  32. package/dist/src/console/connections.js +27 -6
  33. package/dist/src/console/connections.js.map +1 -1
  34. package/dist/src/console/credentials.d.ts +183 -0
  35. package/dist/src/console/credentials.d.ts.map +1 -0
  36. package/dist/src/console/credentials.js +186 -0
  37. package/dist/src/console/credentials.js.map +1 -0
  38. package/dist/src/console/mod.d.ts +17 -2
  39. package/dist/src/console/mod.d.ts.map +1 -1
  40. package/dist/src/console/mod.js +15 -0
  41. package/dist/src/console/mod.js.map +1 -1
  42. package/dist/src/console/models.d.ts +208 -0
  43. package/dist/src/console/models.d.ts.map +1 -0
  44. package/dist/src/console/models.js +186 -0
  45. package/dist/src/console/models.js.map +1 -0
  46. package/dist/src/console/storage.d.ts +221 -0
  47. package/dist/src/console/storage.d.ts.map +1 -0
  48. package/dist/src/console/storage.js +198 -0
  49. package/dist/src/console/storage.js.map +1 -0
  50. package/dist/src/console/tokens.d.ts +53 -3
  51. package/dist/src/console/tokens.d.ts.map +1 -1
  52. package/dist/src/console/tokens.js +35 -4
  53. package/dist/src/console/tokens.js.map +1 -1
  54. package/dist/src/console/vault.d.ts +2 -2
  55. package/dist/src/console/vault.d.ts.map +1 -1
  56. package/dist/src/console/vault.js +1 -1
  57. package/dist/src/context.d.ts +68 -0
  58. package/dist/src/context.d.ts.map +1 -0
  59. package/dist/src/context.js +195 -0
  60. package/dist/src/context.js.map +1 -0
  61. package/dist/src/errors.d.ts +2 -2
  62. package/dist/src/errors.js +2 -2
  63. package/dist/src/http.d.ts +19 -1
  64. package/dist/src/http.d.ts.map +1 -1
  65. package/dist/src/http.js +21 -3
  66. package/dist/src/http.js.map +1 -1
  67. package/dist/src/models.d.ts +141 -0
  68. package/dist/src/models.d.ts.map +1 -0
  69. package/dist/src/models.js +128 -0
  70. package/dist/src/models.js.map +1 -0
  71. package/dist/src/server/mod.d.ts +11 -10
  72. package/dist/src/server/mod.d.ts.map +1 -1
  73. package/dist/src/server/mod.js +11 -9
  74. package/dist/src/server/mod.js.map +1 -1
  75. package/dist/src/skills.d.ts +29 -0
  76. package/dist/src/skills.d.ts.map +1 -0
  77. package/dist/src/skills.js +55 -0
  78. package/dist/src/skills.js.map +1 -0
  79. package/dist/src/types.d.ts +415 -8
  80. package/dist/src/types.d.ts.map +1 -1
  81. package/dist/src/types.js +1 -1
  82. package/dist/src/types.js.map +1 -1
  83. package/dist/src/vars.d.ts +2 -2
  84. package/dist/src/vars.d.ts.map +1 -1
  85. package/dist/src/vars.js +1 -1
  86. package/dist/src/version.js +1 -1
  87. package/dist/src/workflows.d.ts +6 -6
  88. package/dist/src/workflows.d.ts.map +1 -1
  89. package/dist/src/workflows.js +7 -5
  90. package/dist/src/workflows.js.map +1 -1
  91. package/package.json +1 -1
@@ -0,0 +1,208 @@
1
+ /**
2
+ * `client.console.models.*` — the model registry's console-only routes: catalog
3
+ * edits, rates, discovery, providers, budgets (CRUD + usage) and route writes.
4
+ *
5
+ * **Studio-internal, not the published partner contract.** The six stable
6
+ * operations (`models.list|get`, `modelRoutes.list|get|complete`,
7
+ * `modelUsage.query`) live on the root client (`../models.ts`,
8
+ * `endpoints.json`). This namespace lives under the `console` subpath export
9
+ * and is excluded from `endpoints.json` and the root barrel.
10
+ *
11
+ * **`complete` is deliberately NOT modeled here.** `client.modelRoutes.complete`
12
+ * already reaches it and returns the flat envelope as-is; a second method would
13
+ * give a caller two ways to the same route (the precedent of
14
+ * `console/aliases.ts`). Catalog writes and budget writes need a tenant admin.
15
+ *
16
+ * @module
17
+ */
18
+ import { type HttpResponse, type RequestOptions } from "../http.ts";
19
+ import type { Model, ModelRoute } from "../models.ts";
20
+ /** The slice of `W6WClient` this namespace needs: the transport. */
21
+ export interface ModelsConsoleHost {
22
+ /** Perform one request. */
23
+ request<T>(options: RequestOptions): Promise<HttpResponse<T>>;
24
+ }
25
+ /** Per-call options for the project-scoped methods. */
26
+ export interface ModelsConsoleOptions {
27
+ /** Project slug; overrides the client default. */
28
+ project?: string;
29
+ /** Abort signal. */
30
+ signal?: AbortSignal;
31
+ }
32
+ /** Fields `updateModel` may change. */
33
+ export interface ModelPatch {
34
+ status?: "active" | "deprecated" | "blocked";
35
+ displayName?: string;
36
+ limits?: {
37
+ maxInputTokens?: number;
38
+ maxOutputTokens?: number;
39
+ };
40
+ }
41
+ /** A rate card stored against a model. */
42
+ export interface ModelRate {
43
+ id: string;
44
+ modelId: string;
45
+ effectiveFrom: string;
46
+ rates: Record<string, unknown>;
47
+ source: "seed" | "tenant";
48
+ }
49
+ /** The result of `discover`. */
50
+ export interface ModelDiscoveryResult {
51
+ added: string[];
52
+ updated: string[];
53
+ deprecated: string[];
54
+ }
55
+ /** One provider the host can speak to. */
56
+ export interface ModelProvider {
57
+ appId: string;
58
+ /** Adapter key; `null` for a designated provider with no adapter. */
59
+ provider: string | null;
60
+ installed: boolean;
61
+ /** The app's model-provider designation (absent on an older host). */
62
+ designation?: ModelProviderDesignation | null;
63
+ designationSource?: "manifest" | "compat";
64
+ /** Per-operation support; an unsupported row carries a `reason`. */
65
+ operations?: {
66
+ discover: ModelOperationSupport;
67
+ complete: ModelOperationSupport;
68
+ };
69
+ }
70
+ /** Declared model types and (optionally) families of a provider. */
71
+ export interface ModelProviderDesignation {
72
+ modelTypes: string[];
73
+ modelFamilies?: string[];
74
+ }
75
+ /** Whether the host can perform one operation for a provider, and why not. */
76
+ export interface ModelOperationSupport {
77
+ supported: boolean;
78
+ reason?: string;
79
+ }
80
+ /** Spend/usage caps of a budget. */
81
+ export interface ModelBudgetLimits {
82
+ requests?: number;
83
+ tokens?: number;
84
+ costMinor?: number;
85
+ currency?: string;
86
+ }
87
+ /**
88
+ * A stored budget, as the server sends it (flat, never under a `budget` key).
89
+ * The owning project is not on the wire: it is whatever `?project=` resolved to.
90
+ */
91
+ export interface ModelBudget {
92
+ id: string;
93
+ scopeKind: string;
94
+ scopeId: string | null;
95
+ window: string;
96
+ limits: ModelBudgetLimits;
97
+ onBreach: string;
98
+ createdAt: string;
99
+ updatedAt: string;
100
+ [field: string]: unknown;
101
+ }
102
+ /** Body of `createBudget`. */
103
+ export interface ModelBudgetInput {
104
+ scopeKind: string;
105
+ scopeId?: string;
106
+ window: string;
107
+ limits: ModelBudgetLimits;
108
+ onBreach: string;
109
+ }
110
+ /** Body of `updateBudget`: the server only lets `window`, `limits` and `onBreach` change. */
111
+ export type ModelBudgetPatch = Partial<Pick<ModelBudgetInput, "window" | "limits" | "onBreach">>;
112
+ /** A budget's live consumption. */
113
+ export interface ModelBudgetUsage {
114
+ budgetId: string;
115
+ window: string;
116
+ windowStart: string;
117
+ limits: ModelBudgetLimits;
118
+ used: {
119
+ requests: number;
120
+ tokens: number;
121
+ costMinor: number;
122
+ };
123
+ reserved: {
124
+ requests: number;
125
+ tokens: number;
126
+ costMinor: number;
127
+ };
128
+ }
129
+ /** A `{model, connection}` fallback hop. */
130
+ export interface ModelFallback {
131
+ model: string;
132
+ connection: string;
133
+ }
134
+ /** Body of `createRoute`. */
135
+ export interface ModelRouteInput {
136
+ name: string;
137
+ model: string;
138
+ connection: string;
139
+ fallbacks?: ModelFallback[];
140
+ defaults?: Record<string, unknown>;
141
+ }
142
+ /** Body of `updateRoute`. */
143
+ export type ModelRoutePatch = Partial<Omit<ModelRouteInput, "name">>;
144
+ /**
145
+ * The `console.models` namespace on a `W6WClient`.
146
+ *
147
+ * @example
148
+ * ```ts
149
+ * await client.console.models.discover("conn_1");
150
+ * await client.console.models.createRoute({ name: "chat", model: "mdl_1", connection: "conn_1" });
151
+ * ```
152
+ */
153
+ export declare class ModelsConsoleApi {
154
+ #private;
155
+ /** @param host - The client this namespace issues requests through. */
156
+ constructor(host: ModelsConsoleHost);
157
+ /** `PATCH /models/:id` — edit a catalog entry (tenant admin). */
158
+ updateModel(id: string, patch: ModelPatch): Promise<Model>;
159
+ /** `PUT /models/:id/rates` — store a rate card (tenant admin, `201`). */
160
+ putRates(id: string, input: {
161
+ effectiveFrom: string;
162
+ rates: Record<string, unknown>;
163
+ }): Promise<ModelRate>;
164
+ /** `POST /models/discover` — sync a connection's models into the catalog (tenant admin). */
165
+ discover(connection: string): Promise<ModelDiscoveryResult>;
166
+ /** `GET /models/providers` — the providers the host maps. */
167
+ providers(): Promise<ModelProvider[]>;
168
+ /** `GET /model-budgets` — the project's budgets. */
169
+ listBudgets(options?: ModelsConsoleOptions): Promise<ModelBudget[]>;
170
+ /** `POST /model-budgets` — create a budget (tenant admin, `201`). */
171
+ createBudget(input: ModelBudgetInput, options?: ModelsConsoleOptions): Promise<ModelBudget>;
172
+ /**
173
+ * `PATCH /model-budgets/:id` — edit a budget (tenant admin).
174
+ *
175
+ * The id resolves inside `?project=` (the default project when omitted), so a
176
+ * budget in another project needs `project` here, or the server answers 404.
177
+ *
178
+ * @throws {ApiError} `404 model_budget_not_found`.
179
+ */
180
+ updateBudget(id: string, patch: ModelBudgetPatch, options?: ModelsConsoleOptions): Promise<ModelBudget>;
181
+ /**
182
+ * `DELETE /model-budgets/:id` — delete a budget (tenant admin). Resolves to nothing.
183
+ *
184
+ * @throws {ApiError} `404 model_budget_not_found` (pass `project` for a non-default project).
185
+ */
186
+ deleteBudget(id: string, options?: ModelsConsoleOptions): Promise<void>;
187
+ /**
188
+ * `GET /model-budgets/:id/usage` — a budget's used/reserved counters.
189
+ *
190
+ * @throws {ApiError} `404 model_budget_not_found` (pass `project` for a non-default project).
191
+ */
192
+ budgetUsage(id: string, options?: ModelsConsoleOptions): Promise<ModelBudgetUsage>;
193
+ /**
194
+ * `POST /model-routes` — create a route (`201`).
195
+ *
196
+ * @throws {ApiError} `409 model_route_exists`, `400 invalid_route_name`.
197
+ */
198
+ createRoute(input: ModelRouteInput, options?: ModelsConsoleOptions): Promise<ModelRoute>;
199
+ /** `PATCH /model-routes/:name` — edit a route. */
200
+ updateRoute(name: string, patch: ModelRoutePatch, options?: ModelsConsoleOptions): Promise<ModelRoute>;
201
+ /**
202
+ * `DELETE /model-routes/:name` — delete a route. Resolves to nothing.
203
+ *
204
+ * @throws {ApiError} `404 model_route_not_found`.
205
+ */
206
+ deleteRoute(name: string, options?: ModelsConsoleOptions): Promise<void>;
207
+ }
208
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/console/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,KAAK,YAAY,EAAQ,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EA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+ /**
2
+ * `client.console.models.*` — the model registry's console-only routes: catalog
3
+ * edits, rates, discovery, providers, budgets (CRUD + usage) and route writes.
4
+ *
5
+ * **Studio-internal, not the published partner contract.** The six stable
6
+ * operations (`models.list|get`, `modelRoutes.list|get|complete`,
7
+ * `modelUsage.query`) live on the root client (`../models.ts`,
8
+ * `endpoints.json`). This namespace lives under the `console` subpath export
9
+ * and is excluded from `endpoints.json` and the root barrel.
10
+ *
11
+ * **`complete` is deliberately NOT modeled here.** `client.modelRoutes.complete`
12
+ * already reaches it and returns the flat envelope as-is; a second method would
13
+ * give a caller two ways to the same route (the precedent of
14
+ * `console/aliases.ts`). Catalog writes and budget writes need a tenant admin.
15
+ *
16
+ * @module
17
+ */
18
+ import { ApiError } from "../errors.js";
19
+ import { path } from "../http.js";
20
+ import { unwrap } from "../types.js";
21
+ /**
22
+ * The budget write routes answer the budget object FLAT (`c.json(created, 201)`),
23
+ * not under a `budget` key. Accept that, and refuse a body that is not one.
24
+ */
25
+ function budgetBody(res) {
26
+ const body = res.body;
27
+ if (typeof body === "object" && body !== null && !Array.isArray(body) &&
28
+ typeof body.id === "string") {
29
+ return body;
30
+ }
31
+ throw new ApiError(res.status, "bad_response", `Server returned a ${res.status} without a budget object in the response body.`, body);
32
+ }
33
+ /**
34
+ * The `console.models` namespace on a `W6WClient`.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * await client.console.models.discover("conn_1");
39
+ * await client.console.models.createRoute({ name: "chat", model: "mdl_1", connection: "conn_1" });
40
+ * ```
41
+ */
42
+ export class ModelsConsoleApi {
43
+ #host;
44
+ /** @param host - The client this namespace issues requests through. */
45
+ constructor(host) {
46
+ this.#host = host;
47
+ }
48
+ /** `PATCH /models/:id` — edit a catalog entry (tenant admin). */
49
+ async updateModel(id, patch) {
50
+ const res = await this.#host.request({
51
+ method: "PATCH",
52
+ path: path `/models/${id}`,
53
+ body: patch,
54
+ });
55
+ return unwrap(res, "model");
56
+ }
57
+ /** `PUT /models/:id/rates` — store a rate card (tenant admin, `201`). */
58
+ async putRates(id, input) {
59
+ const res = await this.#host.request({
60
+ method: "PUT",
61
+ path: path `/models/${id}/rates`,
62
+ body: input,
63
+ });
64
+ return unwrap(res, "rate");
65
+ }
66
+ /** `POST /models/discover` — sync a connection's models into the catalog (tenant admin). */
67
+ async discover(connection) {
68
+ const res = await this.#host.request({
69
+ method: "POST",
70
+ path: "/models/discover",
71
+ body: { connection },
72
+ });
73
+ return res.body;
74
+ }
75
+ /** `GET /models/providers` — the providers the host maps. */
76
+ async providers() {
77
+ const res = await this.#host.request({ method: "GET", path: "/models/providers" });
78
+ return unwrap(res, "providers");
79
+ }
80
+ /** `GET /model-budgets` — the project's budgets. */
81
+ async listBudgets(options) {
82
+ const res = await this.#host.request({
83
+ method: "GET",
84
+ path: "/model-budgets",
85
+ query: { project: options?.project },
86
+ signal: options?.signal,
87
+ });
88
+ return unwrap(res, "budgets");
89
+ }
90
+ /** `POST /model-budgets` — create a budget (tenant admin, `201`). */
91
+ async createBudget(input, options) {
92
+ const res = await this.#host.request({
93
+ method: "POST",
94
+ path: "/model-budgets",
95
+ query: { project: options?.project },
96
+ body: input,
97
+ signal: options?.signal,
98
+ });
99
+ return budgetBody(res);
100
+ }
101
+ /**
102
+ * `PATCH /model-budgets/:id` — edit a budget (tenant admin).
103
+ *
104
+ * The id resolves inside `?project=` (the default project when omitted), so a
105
+ * budget in another project needs `project` here, or the server answers 404.
106
+ *
107
+ * @throws {ApiError} `404 model_budget_not_found`.
108
+ */
109
+ async updateBudget(id, patch, options) {
110
+ const res = await this.#host.request({
111
+ method: "PATCH",
112
+ path: path `/model-budgets/${id}`,
113
+ query: { project: options?.project },
114
+ body: patch,
115
+ signal: options?.signal,
116
+ });
117
+ return budgetBody(res);
118
+ }
119
+ /**
120
+ * `DELETE /model-budgets/:id` — delete a budget (tenant admin). Resolves to nothing.
121
+ *
122
+ * @throws {ApiError} `404 model_budget_not_found` (pass `project` for a non-default project).
123
+ */
124
+ async deleteBudget(id, options) {
125
+ await this.#host.request({
126
+ method: "DELETE",
127
+ path: path `/model-budgets/${id}`,
128
+ query: { project: options?.project },
129
+ signal: options?.signal,
130
+ });
131
+ }
132
+ /**
133
+ * `GET /model-budgets/:id/usage` — a budget's used/reserved counters.
134
+ *
135
+ * @throws {ApiError} `404 model_budget_not_found` (pass `project` for a non-default project).
136
+ */
137
+ async budgetUsage(id, options) {
138
+ const res = await this.#host.request({
139
+ method: "GET",
140
+ path: path `/model-budgets/${id}/usage`,
141
+ query: { project: options?.project },
142
+ signal: options?.signal,
143
+ });
144
+ return res.body;
145
+ }
146
+ /**
147
+ * `POST /model-routes` — create a route (`201`).
148
+ *
149
+ * @throws {ApiError} `409 model_route_exists`, `400 invalid_route_name`.
150
+ */
151
+ async createRoute(input, options) {
152
+ const res = await this.#host.request({
153
+ method: "POST",
154
+ path: "/model-routes",
155
+ query: { project: options?.project },
156
+ body: input,
157
+ signal: options?.signal,
158
+ });
159
+ return unwrap(res, "route");
160
+ }
161
+ /** `PATCH /model-routes/:name` — edit a route. */
162
+ async updateRoute(name, patch, options) {
163
+ const res = await this.#host.request({
164
+ method: "PATCH",
165
+ path: path `/model-routes/${name}`,
166
+ query: { project: options?.project },
167
+ body: patch,
168
+ signal: options?.signal,
169
+ });
170
+ return unwrap(res, "route");
171
+ }
172
+ /**
173
+ * `DELETE /model-routes/:name` — delete a route. Resolves to nothing.
174
+ *
175
+ * @throws {ApiError} `404 model_route_not_found`.
176
+ */
177
+ async deleteRoute(name, options) {
178
+ await this.#host.request({
179
+ method: "DELETE",
180
+ path: path `/model-routes/${name}`,
181
+ query: { project: options?.project },
182
+ signal: options?.signal,
183
+ });
184
+ }
185
+ }
186
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/console/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAA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B;QACtE,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU;YAC5C,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;YACpC,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB,CAAC,CAAC;QACH,OAAO,MAAM,CAAa,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,kDAAkD;IAClD,KAAK,CAAC,WAAW,CACf,IAAY,EACZ,KAAsB,EACtB,OAA8B;QAE9B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU;YAC5C,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,IAAI,CAAA,iBAAiB,IAAI,EAAE;YACjC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;YACpC,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB,CAAC,CAAC;QACH,OAAO,MAAM,CAAa,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAAC,IAAY,EAAE,OAA8B;QAC5D,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU;YAChC,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,IAAI,CAAA,iBAAiB,IAAI,EAAE;YACjC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;YACpC,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,221 @@
1
+ /**
2
+ * `client.console.storage.*` — the account's storage bindings and agent-limit
3
+ * settings: the managed-store destination an account uploads to, and the caps
4
+ * (§P4: `max_file_bytes`, `max_package_bytes`, `max_files`, `retentionDays`)
5
+ * that apply to those uploads.
6
+ *
7
+ * **Studio-internal, not the published partner contract.** Both routes are
8
+ * account-admin surfaces (a member's write answers `403 forbidden`; another
9
+ * account's id is the uniform `404`) and live under the `console` subpath
10
+ * export only — deliberately absent from `endpoints.json` and from the root
11
+ * barrel, exactly like `console.models`' catalog edits (P-D5's console-only
12
+ * rule).
13
+ *
14
+ * **Nothing here carries a destination or a credential.** T4.1.1's wire shape
15
+ * is an allowlist: a binding never returns its bucket, region, endpoint, root
16
+ * prefix, credential or a revision's `config`, and settings never return a
17
+ * storage path — only the numeric limits and a binding *id*. The types below
18
+ * model that allowlist, not the row, so there is no field for a caller to be
19
+ * tempted by.
20
+ *
21
+ * **The account is never a parameter.** Both services resolve the account from
22
+ * the caller's own credential (the account scope on the bearer) plus a
23
+ * server-side admin check, never from an id this client sends — the same rule
24
+ * `console.tenantLoginFlags` and `console.tenantOAuthApps` follow.
25
+ *
26
+ * @module
27
+ */
28
+ import { type HttpResponse, type RequestOptions } from "../http.ts";
29
+ /** The slice of `W6WClient` this namespace needs: the transport. */
30
+ export interface StorageConsoleHost {
31
+ /** Perform one request. */
32
+ request<T>(options: RequestOptions): Promise<HttpResponse<T>>;
33
+ }
34
+ /** Per-call options for the reads. */
35
+ export interface StorageConsoleOptions {
36
+ /** Abort signal. */
37
+ signal?: AbortSignal;
38
+ }
39
+ /** Options for `bindings.list`. */
40
+ export interface ListStorageBindingsOptions extends StorageConsoleOptions {
41
+ /** Include retired bindings (the server elides them by default). */
42
+ includeRetired?: boolean;
43
+ }
44
+ /** One binding's newest revision, as the wire exposes it: identity only, no destination. */
45
+ export interface StorageBindingRevisionRef {
46
+ id: string;
47
+ revision: number;
48
+ createdAt: string;
49
+ }
50
+ /** The stored outcome of the last reachability probe: a code and a timestamp, never a free-form blob. */
51
+ export interface StorageBindingHealth {
52
+ ok?: boolean;
53
+ code?: string;
54
+ checkedAt?: string;
55
+ }
56
+ /**
57
+ * A storage binding, as the server sends it.
58
+ *
59
+ * `serverDefault` marks the account using the server's own store; `status` is
60
+ * `active` until the binding is retired (`retiredAt` then carries the moment).
61
+ */
62
+ export interface StorageBinding {
63
+ id: string;
64
+ name: string;
65
+ /** Store kind — `s3` today. */
66
+ provider: string;
67
+ connectionId: string | null;
68
+ serverDefault: boolean;
69
+ status: string;
70
+ health: StorageBindingHealth;
71
+ activeRevisionId: string | null;
72
+ revision: StorageBindingRevisionRef | null;
73
+ createdAt: string;
74
+ updatedAt: string;
75
+ retiredAt: string | null;
76
+ }
77
+ /**
78
+ * Body of `bindings.create`.
79
+ *
80
+ * The destination fields go **up** only: the caller supplies them once (they
81
+ * reach the service through the account's connection), and no read returns
82
+ * them. `rootPrefix` is refused when it is non-empty; the store's prefix is
83
+ * the server's to choose.
84
+ */
85
+ export interface CreateStorageBindingInput {
86
+ name?: string;
87
+ connectionId: string;
88
+ bucket: string;
89
+ region: string;
90
+ endpoint?: string;
91
+ forcePathStyle?: boolean;
92
+ rootPrefix?: string;
93
+ }
94
+ /** What `bindings.migrate` accepted: the jobs it enqueued, not the jobs themselves. */
95
+ export interface StorageMigration {
96
+ bindingId: string;
97
+ toRevisionId: string;
98
+ /** How many copies the runner queued (`202 Accepted`). */
99
+ enqueued: number;
100
+ }
101
+ /** The effective caps: `account setting ⊓ server ceiling`, per field. */
102
+ export interface AgentLimits {
103
+ maxFileBytes: number;
104
+ maxPackageBytes: number;
105
+ maxFiles: number;
106
+ }
107
+ /** The account's own stored values; `null` means "not set — use the default". */
108
+ export interface AgentSettingsValues {
109
+ maxFileBytes: number | null;
110
+ maxPackageBytes: number | null;
111
+ maxFiles: number | null;
112
+ retentionDays: number | null;
113
+ storageBindingId: string | null;
114
+ }
115
+ /**
116
+ * `GET`/`PATCH /agent-settings` — the effective limits, the stored values
117
+ * behind them, and when the row last changed (`null` until the first patch).
118
+ */
119
+ export interface AgentSettings {
120
+ limits: AgentLimits;
121
+ settings: AgentSettingsValues;
122
+ updatedAt: string | null;
123
+ }
124
+ /**
125
+ * Body of `settings.patch` — an allowlist of the five settable fields, key by
126
+ * key. An omitted field is left alone; `null` clears it back to the default.
127
+ *
128
+ * The server validates it (unknown field, a non-positive or non-integer value,
129
+ * a value above the operator's ceiling ⇒ `422`; an unknown binding id ⇒ the
130
+ * uniform `404`), so nothing is pre-validated here.
131
+ */
132
+ export type AgentSettingsPatch = Partial<AgentSettingsValues>;
133
+ /**
134
+ * `client.console.storage.bindings.*` — `GET|POST /storage-bindings`,
135
+ * `GET|DELETE /storage-bindings/:id`, `POST /storage-bindings/:id/migrate`.
136
+ *
137
+ * Reads are open to account members; `create`, `delete` and `migrate` need an
138
+ * account admin (`403 forbidden` otherwise).
139
+ */
140
+ export declare class StorageBindingsApi {
141
+ #private;
142
+ /** @param host - The client this namespace issues requests through. */
143
+ constructor(host: StorageConsoleHost);
144
+ /** `GET /storage-bindings` — the account's bindings, retired ones elided unless asked for. */
145
+ list(options?: ListStorageBindingsOptions): Promise<StorageBinding[]>;
146
+ /**
147
+ * `POST /storage-bindings` — store a destination (`201`, the binding answered flat).
148
+ *
149
+ * @throws {ApiError} `403 forbidden` (not an account admin), `422` for a refused
150
+ * destination (a non-empty `rootPrefix`, an unreachable endpoint).
151
+ */
152
+ create(input: CreateStorageBindingInput, options?: StorageConsoleOptions): Promise<StorageBinding>;
153
+ /**
154
+ * `GET /storage-bindings/:id` — one binding.
155
+ *
156
+ * @throws {ApiError} `404 not_found` — uniform, so another account's id is
157
+ * indistinguishable from a nonexistent one.
158
+ */
159
+ get(id: string, options?: StorageConsoleOptions): Promise<StorageBinding>;
160
+ /**
161
+ * `DELETE /storage-bindings/:id` — retire a binding. Resolves to nothing.
162
+ *
163
+ * Retire, not erase: the row stays readable (with `includeRetired`) so
164
+ * versions that live on it keep their provenance.
165
+ *
166
+ * @throws {ApiError} `409` while asset versions still sit under the binding
167
+ * (`connection_in_use`-shaped refusal), `403 forbidden`, `404 not_found`.
168
+ */
169
+ delete(id: string, options?: StorageConsoleOptions): Promise<void>;
170
+ /**
171
+ * `POST /storage-bindings/:id/migrate` — enqueue copy → verify → swap onto a
172
+ * new revision (`202`).
173
+ *
174
+ * The migration is asynchronous: the answer counts the jobs, and the caller
175
+ * polls the binding (`get`) or the version it moves.
176
+ *
177
+ * @throws {ApiError} `403 forbidden`, `404 not_found`, `409` when a migration
178
+ * is already running.
179
+ */
180
+ migrate(id: string, options?: StorageConsoleOptions): Promise<StorageMigration>;
181
+ }
182
+ /**
183
+ * `client.console.storage.settings.*` — `GET|PATCH /agent-settings`.
184
+ *
185
+ * Account-scoped (§P4/A-D4): members may read, only an account admin may patch.
186
+ */
187
+ export declare class AgentSettingsApi {
188
+ #private;
189
+ /** @param host - The client this namespace issues requests through. */
190
+ constructor(host: StorageConsoleHost);
191
+ /** `GET /agent-settings` — the effective limits and the stored values behind them. */
192
+ get(options?: StorageConsoleOptions): Promise<AgentSettings>;
193
+ /**
194
+ * `PATCH /agent-settings` — change the stored values. Fields are sent by
195
+ * omission; `null` clears one back to the default.
196
+ *
197
+ * @throws {ApiError} `403 forbidden` (not an account admin), `422` for an
198
+ * unknown field, a non-positive value or one above the server ceiling, and
199
+ * the uniform `404` for an unknown `storageBindingId`.
200
+ */
201
+ patch(input: AgentSettingsPatch, options?: StorageConsoleOptions): Promise<AgentSettings>;
202
+ }
203
+ /**
204
+ * The `console.storage` namespace on a `W6WClient` — bindings and the agent
205
+ * limits they bound.
206
+ *
207
+ * @example
208
+ * ```ts
209
+ * const [binding] = await client.console.storage.bindings.list();
210
+ * await client.console.storage.settings.patch({ maxFileBytes: 10 * 1024 * 1024 });
211
+ * ```
212
+ */
213
+ export declare class StorageConsoleApi {
214
+ /** `console.storage.bindings.*`. */
215
+ readonly bindings: StorageBindingsApi;
216
+ /** `console.storage.settings.*`. */
217
+ readonly settings: AgentSettingsApi;
218
+ /** @param host - The client this namespace group issues requests through. */
219
+ constructor(host: StorageConsoleHost);
220
+ }
221
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","s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