@cadenya/cadenya 0.62.0 → 0.63.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/CHANGELOG.md +14 -0
- package/client.d.mts +13 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -0
- package/client.d.ts.map +1 -1
- package/client.js +13 -0
- package/client.js.map +1 -1
- package/client.mjs +13 -0
- package/client.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts +288 -0
- package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts.map +1 -0
- package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts +288 -0
- package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts.map +1 -0
- package/resources/bulk-workspace-resources/bulk-workspace-resources.js +51 -0
- package/resources/bulk-workspace-resources/bulk-workspace-resources.js.map +1 -0
- package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs +46 -0
- package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs.map +1 -0
- package/resources/bulk-workspace-resources/index.d.mts +3 -0
- package/resources/bulk-workspace-resources/index.d.mts.map +1 -0
- package/resources/bulk-workspace-resources/index.d.ts +3 -0
- package/resources/bulk-workspace-resources/index.d.ts.map +1 -0
- package/resources/bulk-workspace-resources/index.js +9 -0
- package/resources/bulk-workspace-resources/index.js.map +1 -0
- package/resources/bulk-workspace-resources/index.mjs +4 -0
- package/resources/bulk-workspace-resources/index.mjs.map +1 -0
- package/resources/bulk-workspace-resources/results.d.mts +638 -0
- package/resources/bulk-workspace-resources/results.d.mts.map +1 -0
- package/resources/bulk-workspace-resources/results.d.ts +638 -0
- package/resources/bulk-workspace-resources/results.d.ts.map +1 -0
- package/resources/bulk-workspace-resources/results.js +27 -0
- package/resources/bulk-workspace-resources/results.js.map +1 -0
- package/resources/bulk-workspace-resources/results.mjs +23 -0
- package/resources/bulk-workspace-resources/results.mjs.map +1 -0
- package/resources/bulk-workspace-resources.d.mts +2 -0
- package/resources/bulk-workspace-resources.d.mts.map +1 -0
- package/resources/bulk-workspace-resources.d.ts +2 -0
- package/resources/bulk-workspace-resources.d.ts.map +1 -0
- package/resources/bulk-workspace-resources.js +6 -0
- package/resources/bulk-workspace-resources.js.map +1 -0
- package/resources/bulk-workspace-resources.mjs +3 -0
- package/resources/bulk-workspace-resources.mjs.map +1 -0
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +51 -0
- package/src/internal/types.ts +6 -8
- package/src/resources/bulk-workspace-resources/bulk-workspace-resources.ts +409 -0
- package/src/resources/bulk-workspace-resources/index.ts +37 -0
- package/src/resources/bulk-workspace-resources/results.ts +821 -0
- package/src/resources/bulk-workspace-resources.ts +3 -0
- package/src/resources/index.ts +19 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as AccountAPI from "../account.mjs";
|
|
3
|
+
import * as Shared from "../shared.mjs";
|
|
4
|
+
import * as AgentsAPI from "../agents/agents.mjs";
|
|
5
|
+
import * as SchedulesAPI from "../agents/schedules.mjs";
|
|
6
|
+
import * as VariationsAPI from "../agents/variations.mjs";
|
|
7
|
+
import * as ResultsAPI from "./results.mjs";
|
|
8
|
+
import { BulkWorkspaceApplyResult, BulkWorkspaceApplyResultData, BulkWorkspaceApplyResultDataAgentOutcome, BulkWorkspaceApplyResultDataAgentScheduleOutcome, BulkWorkspaceApplyResultDataAgentVariationOutcome, BulkWorkspaceApplyResultDataMemoryEntryOutcome, BulkWorkspaceApplyResultDataMemoryLayerOutcome, BulkWorkspaceApplyResultDataToolOutcome, BulkWorkspaceApplyResultDataToolSetOutcome, BulkWorkspaceApplyResultDataVariationAssignmentOutcome, BulkWorkspaceApplyResultDataVariationMemoryLayerOutcome, BulkWorkspaceApplyResultsCursorPagination, ResultListParams, Results } from "./results.mjs";
|
|
9
|
+
import * as MemoryLayersAPI from "../memory-layers/memory-layers.mjs";
|
|
10
|
+
import * as ToolSetsAPI from "../tool-sets/tool-sets.mjs";
|
|
11
|
+
import * as ToolsAPI from "../tool-sets/tools.mjs";
|
|
12
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
13
|
+
import { CursorPagination, type CursorPaginationParams, PagePromise } from "../../core/pagination.mjs";
|
|
14
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
15
|
+
/**
|
|
16
|
+
* BulkWorkspaceResources is the workspace-scoped service that applies
|
|
17
|
+
* a declarative bundle of workspace resources (tool sets, memory
|
|
18
|
+
* layers, agents, variations, assignments, schedules) in one async
|
|
19
|
+
* operation. See docs/superpowers/specs/2026-05-02-bulk-workspace-resources-design.md
|
|
20
|
+
* for the full design.
|
|
21
|
+
*
|
|
22
|
+
* Authentication: Bearer token (JWT)
|
|
23
|
+
* Scope: Workspace-level operations
|
|
24
|
+
*/
|
|
25
|
+
export declare class BulkWorkspaceResources extends APIResource {
|
|
26
|
+
results: ResultsAPI.Results;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a bulk workspace apply operation by ID.
|
|
29
|
+
*/
|
|
30
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<BulkWorkspaceApply>;
|
|
31
|
+
/**
|
|
32
|
+
* Lists past and in-flight bulk workspace apply operations in the workspace.
|
|
33
|
+
*/
|
|
34
|
+
list(query?: BulkWorkspaceResourceListParams | null | undefined, options?: RequestOptions): PagePromise<BulkWorkspaceAppliesCursorPagination, BulkWorkspaceApply>;
|
|
35
|
+
/**
|
|
36
|
+
* Asynchronously applies a declarative bundle of workspace resources. Returns the
|
|
37
|
+
* operation immediately in PENDING; clients poll Get to track progress.
|
|
38
|
+
*/
|
|
39
|
+
apply(body: BulkWorkspaceResourceApplyParams, options?: RequestOptions): APIPromise<BulkWorkspaceApply>;
|
|
40
|
+
}
|
|
41
|
+
export type BulkWorkspaceAppliesCursorPagination = CursorPagination<BulkWorkspaceApply>;
|
|
42
|
+
export interface AgentEntry {
|
|
43
|
+
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* Agent specification (user-provided configuration)
|
|
46
|
+
*/
|
|
47
|
+
spec: AgentsAPI.AgentSpec;
|
|
48
|
+
labels?: {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Schedules under this agent, keyed by external_id.
|
|
53
|
+
*/
|
|
54
|
+
schedules?: {
|
|
55
|
+
[key: string]: AgentScheduleEntry;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Variations under this agent, keyed by external_id.
|
|
59
|
+
*/
|
|
60
|
+
variations?: {
|
|
61
|
+
[key: string]: AgentVariationEntry;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export interface AgentScheduleEntry {
|
|
65
|
+
name: string;
|
|
66
|
+
/**
|
|
67
|
+
* AgentScheduleSpec is the user-provided configuration for a schedule.
|
|
68
|
+
*/
|
|
69
|
+
spec: SchedulesAPI.AgentScheduleSpec;
|
|
70
|
+
labels?: {
|
|
71
|
+
[key: string]: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface AgentVariationEntry {
|
|
75
|
+
name: string;
|
|
76
|
+
/**
|
|
77
|
+
* AgentVariationSpec defines the operational configuration for a variation
|
|
78
|
+
*/
|
|
79
|
+
spec: VariationsAPI.AgentVariationSpec;
|
|
80
|
+
/**
|
|
81
|
+
* Reconciled list — server adjusts the variation's assignments to exactly this set
|
|
82
|
+
* when the variation is bundle-owned.
|
|
83
|
+
*/
|
|
84
|
+
assignments?: Array<VariationAssignmentEntry>;
|
|
85
|
+
labels?: {
|
|
86
|
+
[key: string]: string;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Reconciled list — capped at 10 to match the existing variation
|
|
90
|
+
* memory-layer-assignment cap.
|
|
91
|
+
*/
|
|
92
|
+
memoryLayers?: Array<VariationMemoryLayerEntry>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* BulkWorkspaceApply is the operation resource produced by a call to
|
|
96
|
+
* BulkWorkspaceResources.Apply. It is operation-typed (uses OperationMetadata,
|
|
97
|
+
* like Objective and ObjectiveEvent) and carries the input bundle in `data`, the
|
|
98
|
+
* lifecycle state in `status`, and aggregate counts in `info`.
|
|
99
|
+
*/
|
|
100
|
+
export interface BulkWorkspaceApply {
|
|
101
|
+
data: BulkWorkspaceApplyData;
|
|
102
|
+
/**
|
|
103
|
+
* Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
104
|
+
* runs)
|
|
105
|
+
*/
|
|
106
|
+
metadata: Shared.OperationMetadata;
|
|
107
|
+
status: BulkWorkspaceApplyStatus;
|
|
108
|
+
info?: BulkWorkspaceApplyInfo;
|
|
109
|
+
}
|
|
110
|
+
export interface BulkWorkspaceApplyData {
|
|
111
|
+
/**
|
|
112
|
+
* Required. Bundle ownership key. Resources created or updated by an Apply with
|
|
113
|
+
* this key are tagged with the reserved label
|
|
114
|
+
* `bulk.cadenya.com/managed-by=<managed_by_key>`; on subsequent applies with the
|
|
115
|
+
* same key, resources currently bearing the label but absent from the spec are
|
|
116
|
+
* soft-deleted.
|
|
117
|
+
*/
|
|
118
|
+
managedByKey: string;
|
|
119
|
+
/**
|
|
120
|
+
* Agents to upsert, keyed by external_id.
|
|
121
|
+
*/
|
|
122
|
+
agents?: {
|
|
123
|
+
[key: string]: AgentEntry;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Memory layers to upsert, keyed by external_id.
|
|
127
|
+
*/
|
|
128
|
+
memoryLayers?: {
|
|
129
|
+
[key: string]: MemoryLayerEntry;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Optional URL pointing to the source of this apply (GitHub PR, Jenkins build,
|
|
133
|
+
* GitLab pipeline, etc.). Surfaced in the dashboard so users can jump from an
|
|
134
|
+
* apply back to the change that produced it. Free-form HTTPS URI; not interpreted
|
|
135
|
+
* by the server.
|
|
136
|
+
*/
|
|
137
|
+
sourceUrl?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Tool sets to upsert, keyed by external_id.
|
|
140
|
+
*/
|
|
141
|
+
toolSets?: {
|
|
142
|
+
[key: string]: ToolSetEntry;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export interface BulkWorkspaceApplyInfo {
|
|
146
|
+
completedAt?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Profile represents a human user at the account level. Profiles are
|
|
149
|
+
* account-scoped resources that can be associated with multiple workspaces through
|
|
150
|
+
* the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
|
|
151
|
+
*/
|
|
152
|
+
createdBy?: AccountAPI.Profile;
|
|
153
|
+
createdCount?: number;
|
|
154
|
+
deletedCount?: number;
|
|
155
|
+
failedCount?: number;
|
|
156
|
+
startedAt?: string;
|
|
157
|
+
totalCount?: number;
|
|
158
|
+
unchangedCount?: number;
|
|
159
|
+
updatedCount?: number;
|
|
160
|
+
}
|
|
161
|
+
export interface BulkWorkspaceApplyStatus {
|
|
162
|
+
state: 'STATE_UNSPECIFIED' | 'STATE_PENDING' | 'STATE_VALIDATING' | 'STATE_RUNNING' | 'STATE_SUCCEEDED' | 'STATE_PARTIALLY_APPLIED' | 'STATE_FAILED';
|
|
163
|
+
message?: string;
|
|
164
|
+
/**
|
|
165
|
+
* The `Status` type defines a logical error model that is suitable for different
|
|
166
|
+
* programming environments, including REST APIs and RPC APIs. It is used by
|
|
167
|
+
* [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
|
|
168
|
+
* data: error code, error message, and error details. You can find out more about
|
|
169
|
+
* this error model and how to work with it in the
|
|
170
|
+
* [API Design Guide](https://cloud.google.com/apis/design/errors).
|
|
171
|
+
*/
|
|
172
|
+
preflightError?: BulkWorkspaceApplyStatus.PreflightError;
|
|
173
|
+
}
|
|
174
|
+
export declare namespace BulkWorkspaceApplyStatus {
|
|
175
|
+
/**
|
|
176
|
+
* The `Status` type defines a logical error model that is suitable for different
|
|
177
|
+
* programming environments, including REST APIs and RPC APIs. It is used by
|
|
178
|
+
* [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
|
|
179
|
+
* data: error code, error message, and error details. You can find out more about
|
|
180
|
+
* this error model and how to work with it in the
|
|
181
|
+
* [API Design Guide](https://cloud.google.com/apis/design/errors).
|
|
182
|
+
*/
|
|
183
|
+
interface PreflightError {
|
|
184
|
+
/**
|
|
185
|
+
* The status code, which should be an enum value of
|
|
186
|
+
* [google.rpc.Code][google.rpc.Code].
|
|
187
|
+
*/
|
|
188
|
+
code?: number;
|
|
189
|
+
/**
|
|
190
|
+
* A list of messages that carry the error details. There is a common set of
|
|
191
|
+
* message types for APIs to use.
|
|
192
|
+
*/
|
|
193
|
+
details?: Array<PreflightError.Detail>;
|
|
194
|
+
/**
|
|
195
|
+
* A developer-facing error message, which should be in English. Any user-facing
|
|
196
|
+
* error message should be localized and sent in the
|
|
197
|
+
* [google.rpc.Status.details][google.rpc.Status.details] field, or localized by
|
|
198
|
+
* the client.
|
|
199
|
+
*/
|
|
200
|
+
message?: string;
|
|
201
|
+
}
|
|
202
|
+
namespace PreflightError {
|
|
203
|
+
/**
|
|
204
|
+
* Contains an arbitrary serialized message along with a @type that describes the
|
|
205
|
+
* type of the serialized message.
|
|
206
|
+
*/
|
|
207
|
+
interface Detail {
|
|
208
|
+
/**
|
|
209
|
+
* The type of the serialized message.
|
|
210
|
+
*/
|
|
211
|
+
'@type'?: string;
|
|
212
|
+
[k: string]: unknown;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
export interface MemoryEntryItem {
|
|
217
|
+
key: string;
|
|
218
|
+
content?: string;
|
|
219
|
+
description?: string;
|
|
220
|
+
uploadId?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface MemoryLayerEntry {
|
|
223
|
+
name: string;
|
|
224
|
+
spec: MemoryLayersAPI.MemoryLayerSpec;
|
|
225
|
+
/**
|
|
226
|
+
* Memory entries in this layer, keyed by external_id.
|
|
227
|
+
*/
|
|
228
|
+
entries?: {
|
|
229
|
+
[key: string]: MemoryEntryItem;
|
|
230
|
+
};
|
|
231
|
+
labels?: {
|
|
232
|
+
[key: string]: string;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
export interface ToolEntry {
|
|
236
|
+
name: string;
|
|
237
|
+
spec: ToolsAPI.ToolSpec;
|
|
238
|
+
labels?: {
|
|
239
|
+
[key: string]: string;
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
export interface ToolSetEntry {
|
|
243
|
+
name: string;
|
|
244
|
+
spec: ToolSetsAPI.ToolSetSpec;
|
|
245
|
+
labels?: {
|
|
246
|
+
[key: string]: string;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Tools in this tool set, keyed by external_id.
|
|
250
|
+
*/
|
|
251
|
+
tools?: {
|
|
252
|
+
[key: string]: ToolEntry;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
export interface VariationAssignmentEntry {
|
|
256
|
+
subAgentId?: string;
|
|
257
|
+
toolId?: string;
|
|
258
|
+
toolSetId?: string;
|
|
259
|
+
}
|
|
260
|
+
export interface VariationMemoryLayerEntry {
|
|
261
|
+
/**
|
|
262
|
+
* external_id:<value> form. Canonical IDs are rejected.
|
|
263
|
+
*/
|
|
264
|
+
memoryLayerId?: string;
|
|
265
|
+
position?: number;
|
|
266
|
+
}
|
|
267
|
+
export interface BulkWorkspaceResourceListParams extends CursorPaginationParams {
|
|
268
|
+
/**
|
|
269
|
+
* Filter by managed_by_key — list every apply for a given bundle.
|
|
270
|
+
*/
|
|
271
|
+
managedByKey?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Sort order for results (asc or desc by creation time)
|
|
274
|
+
*/
|
|
275
|
+
sortOrder?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Filter by lifecycle state.
|
|
278
|
+
*/
|
|
279
|
+
state?: 'STATE_UNSPECIFIED' | 'STATE_PENDING' | 'STATE_VALIDATING' | 'STATE_RUNNING' | 'STATE_SUCCEEDED' | 'STATE_PARTIALLY_APPLIED' | 'STATE_FAILED';
|
|
280
|
+
}
|
|
281
|
+
export interface BulkWorkspaceResourceApplyParams {
|
|
282
|
+
data: BulkWorkspaceApplyData;
|
|
283
|
+
}
|
|
284
|
+
export declare namespace BulkWorkspaceResources {
|
|
285
|
+
export { type AgentEntry as AgentEntry, type AgentScheduleEntry as AgentScheduleEntry, type AgentVariationEntry as AgentVariationEntry, type BulkWorkspaceApply as BulkWorkspaceApply, type BulkWorkspaceApplyData as BulkWorkspaceApplyData, type BulkWorkspaceApplyInfo as BulkWorkspaceApplyInfo, type BulkWorkspaceApplyStatus as BulkWorkspaceApplyStatus, type MemoryEntryItem as MemoryEntryItem, type MemoryLayerEntry as MemoryLayerEntry, type ToolEntry as ToolEntry, type ToolSetEntry as ToolSetEntry, type VariationAssignmentEntry as VariationAssignmentEntry, type VariationMemoryLayerEntry as VariationMemoryLayerEntry, type BulkWorkspaceAppliesCursorPagination as BulkWorkspaceAppliesCursorPagination, type BulkWorkspaceResourceListParams as BulkWorkspaceResourceListParams, type BulkWorkspaceResourceApplyParams as BulkWorkspaceResourceApplyParams, };
|
|
286
|
+
export { Results as Results, type BulkWorkspaceApplyResult as BulkWorkspaceApplyResult, type BulkWorkspaceApplyResultData as BulkWorkspaceApplyResultData, type BulkWorkspaceApplyResultDataAgentOutcome as BulkWorkspaceApplyResultDataAgentOutcome, type BulkWorkspaceApplyResultDataAgentScheduleOutcome as BulkWorkspaceApplyResultDataAgentScheduleOutcome, type BulkWorkspaceApplyResultDataAgentVariationOutcome as BulkWorkspaceApplyResultDataAgentVariationOutcome, type BulkWorkspaceApplyResultDataMemoryEntryOutcome as BulkWorkspaceApplyResultDataMemoryEntryOutcome, type BulkWorkspaceApplyResultDataMemoryLayerOutcome as BulkWorkspaceApplyResultDataMemoryLayerOutcome, type BulkWorkspaceApplyResultDataToolOutcome as BulkWorkspaceApplyResultDataToolOutcome, type BulkWorkspaceApplyResultDataToolSetOutcome as BulkWorkspaceApplyResultDataToolSetOutcome, type BulkWorkspaceApplyResultDataVariationAssignmentOutcome as BulkWorkspaceApplyResultDataVariationAssignmentOutcome, type BulkWorkspaceApplyResultDataVariationMemoryLayerOutcome as BulkWorkspaceApplyResultDataVariationMemoryLayerOutcome, type BulkWorkspaceApplyResultsCursorPagination as BulkWorkspaceApplyResultsCursorPagination, type ResultListParams as ResultListParams, };
|
|
287
|
+
}
|
|
288
|
+
//# sourceMappingURL=bulk-workspace-resources.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-workspace-resources.d.mts","sourceRoot":"","sources":["../../src/resources/bulk-workspace-resources/bulk-workspace-resources.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,KAAK,SAAS;OACd,KAAK,YAAY;OACjB,KAAK,aAAa;OAClB,KAAK,UAAU;OACf,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,wCAAwC,EACxC,gDAAgD,EAChD,iDAAiD,EACjD,8CAA8C,EAC9C,8CAA8C,EAC9C,uCAAuC,EACvC,0CAA0C,EAC1C,sDAAsD,EACtD,uDAAuD,EACvD,yCAAyC,EACzC,gBAAgB,EAChB,OAAO,EACR;OACM,KAAK,eAAe;OACpB,KAAK,WAAW;OAChB,KAAK,QAAQ;OACb,EAAE,UAAU,EAAE;OACd,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE;OAC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AAkB,IAAI,kBAAkB,EAC7C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,gCAAgC,IAAI,gCAAgC,GAC1E,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wCAAwC,IAAI,wCAAwC,EACzF,KAAK,gDAAgD,IAAI,gDAAgD,EACzG,KAAK,iDAAiD,IAAI,iDAAiD,EAC3G,KAAK,8CAA8C,IAAI,8CAA8C,EACrG,KAAK,8CAA8C,IAAI,8CAA8C,EACrG,KAAK,uCAAuC,IAAI,uCAAuC,EACvF,KAAK,0CAA0C,IAAI,0CAA0C,EAC7F,KAAK,sDAAsD,IAAI,sDAAsD,EACrH,KAAK,uDAAuD,IAAI,uDAAuD,EACvH,KAAK,yCAAyC,IAAI,yCAAyC,EAC3F,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as AccountAPI from "../account.js";
|
|
3
|
+
import * as Shared from "../shared.js";
|
|
4
|
+
import * as AgentsAPI from "../agents/agents.js";
|
|
5
|
+
import * as SchedulesAPI from "../agents/schedules.js";
|
|
6
|
+
import * as VariationsAPI from "../agents/variations.js";
|
|
7
|
+
import * as ResultsAPI from "./results.js";
|
|
8
|
+
import { BulkWorkspaceApplyResult, BulkWorkspaceApplyResultData, BulkWorkspaceApplyResultDataAgentOutcome, BulkWorkspaceApplyResultDataAgentScheduleOutcome, BulkWorkspaceApplyResultDataAgentVariationOutcome, BulkWorkspaceApplyResultDataMemoryEntryOutcome, BulkWorkspaceApplyResultDataMemoryLayerOutcome, BulkWorkspaceApplyResultDataToolOutcome, BulkWorkspaceApplyResultDataToolSetOutcome, BulkWorkspaceApplyResultDataVariationAssignmentOutcome, BulkWorkspaceApplyResultDataVariationMemoryLayerOutcome, BulkWorkspaceApplyResultsCursorPagination, ResultListParams, Results } from "./results.js";
|
|
9
|
+
import * as MemoryLayersAPI from "../memory-layers/memory-layers.js";
|
|
10
|
+
import * as ToolSetsAPI from "../tool-sets/tool-sets.js";
|
|
11
|
+
import * as ToolsAPI from "../tool-sets/tools.js";
|
|
12
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
13
|
+
import { CursorPagination, type CursorPaginationParams, PagePromise } from "../../core/pagination.js";
|
|
14
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
15
|
+
/**
|
|
16
|
+
* BulkWorkspaceResources is the workspace-scoped service that applies
|
|
17
|
+
* a declarative bundle of workspace resources (tool sets, memory
|
|
18
|
+
* layers, agents, variations, assignments, schedules) in one async
|
|
19
|
+
* operation. See docs/superpowers/specs/2026-05-02-bulk-workspace-resources-design.md
|
|
20
|
+
* for the full design.
|
|
21
|
+
*
|
|
22
|
+
* Authentication: Bearer token (JWT)
|
|
23
|
+
* Scope: Workspace-level operations
|
|
24
|
+
*/
|
|
25
|
+
export declare class BulkWorkspaceResources extends APIResource {
|
|
26
|
+
results: ResultsAPI.Results;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a bulk workspace apply operation by ID.
|
|
29
|
+
*/
|
|
30
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<BulkWorkspaceApply>;
|
|
31
|
+
/**
|
|
32
|
+
* Lists past and in-flight bulk workspace apply operations in the workspace.
|
|
33
|
+
*/
|
|
34
|
+
list(query?: BulkWorkspaceResourceListParams | null | undefined, options?: RequestOptions): PagePromise<BulkWorkspaceAppliesCursorPagination, BulkWorkspaceApply>;
|
|
35
|
+
/**
|
|
36
|
+
* Asynchronously applies a declarative bundle of workspace resources. Returns the
|
|
37
|
+
* operation immediately in PENDING; clients poll Get to track progress.
|
|
38
|
+
*/
|
|
39
|
+
apply(body: BulkWorkspaceResourceApplyParams, options?: RequestOptions): APIPromise<BulkWorkspaceApply>;
|
|
40
|
+
}
|
|
41
|
+
export type BulkWorkspaceAppliesCursorPagination = CursorPagination<BulkWorkspaceApply>;
|
|
42
|
+
export interface AgentEntry {
|
|
43
|
+
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* Agent specification (user-provided configuration)
|
|
46
|
+
*/
|
|
47
|
+
spec: AgentsAPI.AgentSpec;
|
|
48
|
+
labels?: {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Schedules under this agent, keyed by external_id.
|
|
53
|
+
*/
|
|
54
|
+
schedules?: {
|
|
55
|
+
[key: string]: AgentScheduleEntry;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Variations under this agent, keyed by external_id.
|
|
59
|
+
*/
|
|
60
|
+
variations?: {
|
|
61
|
+
[key: string]: AgentVariationEntry;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export interface AgentScheduleEntry {
|
|
65
|
+
name: string;
|
|
66
|
+
/**
|
|
67
|
+
* AgentScheduleSpec is the user-provided configuration for a schedule.
|
|
68
|
+
*/
|
|
69
|
+
spec: SchedulesAPI.AgentScheduleSpec;
|
|
70
|
+
labels?: {
|
|
71
|
+
[key: string]: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface AgentVariationEntry {
|
|
75
|
+
name: string;
|
|
76
|
+
/**
|
|
77
|
+
* AgentVariationSpec defines the operational configuration for a variation
|
|
78
|
+
*/
|
|
79
|
+
spec: VariationsAPI.AgentVariationSpec;
|
|
80
|
+
/**
|
|
81
|
+
* Reconciled list — server adjusts the variation's assignments to exactly this set
|
|
82
|
+
* when the variation is bundle-owned.
|
|
83
|
+
*/
|
|
84
|
+
assignments?: Array<VariationAssignmentEntry>;
|
|
85
|
+
labels?: {
|
|
86
|
+
[key: string]: string;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Reconciled list — capped at 10 to match the existing variation
|
|
90
|
+
* memory-layer-assignment cap.
|
|
91
|
+
*/
|
|
92
|
+
memoryLayers?: Array<VariationMemoryLayerEntry>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* BulkWorkspaceApply is the operation resource produced by a call to
|
|
96
|
+
* BulkWorkspaceResources.Apply. It is operation-typed (uses OperationMetadata,
|
|
97
|
+
* like Objective and ObjectiveEvent) and carries the input bundle in `data`, the
|
|
98
|
+
* lifecycle state in `status`, and aggregate counts in `info`.
|
|
99
|
+
*/
|
|
100
|
+
export interface BulkWorkspaceApply {
|
|
101
|
+
data: BulkWorkspaceApplyData;
|
|
102
|
+
/**
|
|
103
|
+
* Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
104
|
+
* runs)
|
|
105
|
+
*/
|
|
106
|
+
metadata: Shared.OperationMetadata;
|
|
107
|
+
status: BulkWorkspaceApplyStatus;
|
|
108
|
+
info?: BulkWorkspaceApplyInfo;
|
|
109
|
+
}
|
|
110
|
+
export interface BulkWorkspaceApplyData {
|
|
111
|
+
/**
|
|
112
|
+
* Required. Bundle ownership key. Resources created or updated by an Apply with
|
|
113
|
+
* this key are tagged with the reserved label
|
|
114
|
+
* `bulk.cadenya.com/managed-by=<managed_by_key>`; on subsequent applies with the
|
|
115
|
+
* same key, resources currently bearing the label but absent from the spec are
|
|
116
|
+
* soft-deleted.
|
|
117
|
+
*/
|
|
118
|
+
managedByKey: string;
|
|
119
|
+
/**
|
|
120
|
+
* Agents to upsert, keyed by external_id.
|
|
121
|
+
*/
|
|
122
|
+
agents?: {
|
|
123
|
+
[key: string]: AgentEntry;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Memory layers to upsert, keyed by external_id.
|
|
127
|
+
*/
|
|
128
|
+
memoryLayers?: {
|
|
129
|
+
[key: string]: MemoryLayerEntry;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Optional URL pointing to the source of this apply (GitHub PR, Jenkins build,
|
|
133
|
+
* GitLab pipeline, etc.). Surfaced in the dashboard so users can jump from an
|
|
134
|
+
* apply back to the change that produced it. Free-form HTTPS URI; not interpreted
|
|
135
|
+
* by the server.
|
|
136
|
+
*/
|
|
137
|
+
sourceUrl?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Tool sets to upsert, keyed by external_id.
|
|
140
|
+
*/
|
|
141
|
+
toolSets?: {
|
|
142
|
+
[key: string]: ToolSetEntry;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export interface BulkWorkspaceApplyInfo {
|
|
146
|
+
completedAt?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Profile represents a human user at the account level. Profiles are
|
|
149
|
+
* account-scoped resources that can be associated with multiple workspaces through
|
|
150
|
+
* the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
|
|
151
|
+
*/
|
|
152
|
+
createdBy?: AccountAPI.Profile;
|
|
153
|
+
createdCount?: number;
|
|
154
|
+
deletedCount?: number;
|
|
155
|
+
failedCount?: number;
|
|
156
|
+
startedAt?: string;
|
|
157
|
+
totalCount?: number;
|
|
158
|
+
unchangedCount?: number;
|
|
159
|
+
updatedCount?: number;
|
|
160
|
+
}
|
|
161
|
+
export interface BulkWorkspaceApplyStatus {
|
|
162
|
+
state: 'STATE_UNSPECIFIED' | 'STATE_PENDING' | 'STATE_VALIDATING' | 'STATE_RUNNING' | 'STATE_SUCCEEDED' | 'STATE_PARTIALLY_APPLIED' | 'STATE_FAILED';
|
|
163
|
+
message?: string;
|
|
164
|
+
/**
|
|
165
|
+
* The `Status` type defines a logical error model that is suitable for different
|
|
166
|
+
* programming environments, including REST APIs and RPC APIs. It is used by
|
|
167
|
+
* [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
|
|
168
|
+
* data: error code, error message, and error details. You can find out more about
|
|
169
|
+
* this error model and how to work with it in the
|
|
170
|
+
* [API Design Guide](https://cloud.google.com/apis/design/errors).
|
|
171
|
+
*/
|
|
172
|
+
preflightError?: BulkWorkspaceApplyStatus.PreflightError;
|
|
173
|
+
}
|
|
174
|
+
export declare namespace BulkWorkspaceApplyStatus {
|
|
175
|
+
/**
|
|
176
|
+
* The `Status` type defines a logical error model that is suitable for different
|
|
177
|
+
* programming environments, including REST APIs and RPC APIs. It is used by
|
|
178
|
+
* [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
|
|
179
|
+
* data: error code, error message, and error details. You can find out more about
|
|
180
|
+
* this error model and how to work with it in the
|
|
181
|
+
* [API Design Guide](https://cloud.google.com/apis/design/errors).
|
|
182
|
+
*/
|
|
183
|
+
interface PreflightError {
|
|
184
|
+
/**
|
|
185
|
+
* The status code, which should be an enum value of
|
|
186
|
+
* [google.rpc.Code][google.rpc.Code].
|
|
187
|
+
*/
|
|
188
|
+
code?: number;
|
|
189
|
+
/**
|
|
190
|
+
* A list of messages that carry the error details. There is a common set of
|
|
191
|
+
* message types for APIs to use.
|
|
192
|
+
*/
|
|
193
|
+
details?: Array<PreflightError.Detail>;
|
|
194
|
+
/**
|
|
195
|
+
* A developer-facing error message, which should be in English. Any user-facing
|
|
196
|
+
* error message should be localized and sent in the
|
|
197
|
+
* [google.rpc.Status.details][google.rpc.Status.details] field, or localized by
|
|
198
|
+
* the client.
|
|
199
|
+
*/
|
|
200
|
+
message?: string;
|
|
201
|
+
}
|
|
202
|
+
namespace PreflightError {
|
|
203
|
+
/**
|
|
204
|
+
* Contains an arbitrary serialized message along with a @type that describes the
|
|
205
|
+
* type of the serialized message.
|
|
206
|
+
*/
|
|
207
|
+
interface Detail {
|
|
208
|
+
/**
|
|
209
|
+
* The type of the serialized message.
|
|
210
|
+
*/
|
|
211
|
+
'@type'?: string;
|
|
212
|
+
[k: string]: unknown;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
export interface MemoryEntryItem {
|
|
217
|
+
key: string;
|
|
218
|
+
content?: string;
|
|
219
|
+
description?: string;
|
|
220
|
+
uploadId?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface MemoryLayerEntry {
|
|
223
|
+
name: string;
|
|
224
|
+
spec: MemoryLayersAPI.MemoryLayerSpec;
|
|
225
|
+
/**
|
|
226
|
+
* Memory entries in this layer, keyed by external_id.
|
|
227
|
+
*/
|
|
228
|
+
entries?: {
|
|
229
|
+
[key: string]: MemoryEntryItem;
|
|
230
|
+
};
|
|
231
|
+
labels?: {
|
|
232
|
+
[key: string]: string;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
export interface ToolEntry {
|
|
236
|
+
name: string;
|
|
237
|
+
spec: ToolsAPI.ToolSpec;
|
|
238
|
+
labels?: {
|
|
239
|
+
[key: string]: string;
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
export interface ToolSetEntry {
|
|
243
|
+
name: string;
|
|
244
|
+
spec: ToolSetsAPI.ToolSetSpec;
|
|
245
|
+
labels?: {
|
|
246
|
+
[key: string]: string;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Tools in this tool set, keyed by external_id.
|
|
250
|
+
*/
|
|
251
|
+
tools?: {
|
|
252
|
+
[key: string]: ToolEntry;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
export interface VariationAssignmentEntry {
|
|
256
|
+
subAgentId?: string;
|
|
257
|
+
toolId?: string;
|
|
258
|
+
toolSetId?: string;
|
|
259
|
+
}
|
|
260
|
+
export interface VariationMemoryLayerEntry {
|
|
261
|
+
/**
|
|
262
|
+
* external_id:<value> form. Canonical IDs are rejected.
|
|
263
|
+
*/
|
|
264
|
+
memoryLayerId?: string;
|
|
265
|
+
position?: number;
|
|
266
|
+
}
|
|
267
|
+
export interface BulkWorkspaceResourceListParams extends CursorPaginationParams {
|
|
268
|
+
/**
|
|
269
|
+
* Filter by managed_by_key — list every apply for a given bundle.
|
|
270
|
+
*/
|
|
271
|
+
managedByKey?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Sort order for results (asc or desc by creation time)
|
|
274
|
+
*/
|
|
275
|
+
sortOrder?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Filter by lifecycle state.
|
|
278
|
+
*/
|
|
279
|
+
state?: 'STATE_UNSPECIFIED' | 'STATE_PENDING' | 'STATE_VALIDATING' | 'STATE_RUNNING' | 'STATE_SUCCEEDED' | 'STATE_PARTIALLY_APPLIED' | 'STATE_FAILED';
|
|
280
|
+
}
|
|
281
|
+
export interface BulkWorkspaceResourceApplyParams {
|
|
282
|
+
data: BulkWorkspaceApplyData;
|
|
283
|
+
}
|
|
284
|
+
export declare namespace BulkWorkspaceResources {
|
|
285
|
+
export { type AgentEntry as AgentEntry, type AgentScheduleEntry as AgentScheduleEntry, type AgentVariationEntry as AgentVariationEntry, type BulkWorkspaceApply as BulkWorkspaceApply, type BulkWorkspaceApplyData as BulkWorkspaceApplyData, type BulkWorkspaceApplyInfo as BulkWorkspaceApplyInfo, type BulkWorkspaceApplyStatus as BulkWorkspaceApplyStatus, type MemoryEntryItem as MemoryEntryItem, type MemoryLayerEntry as MemoryLayerEntry, type ToolEntry as ToolEntry, type ToolSetEntry as ToolSetEntry, type VariationAssignmentEntry as VariationAssignmentEntry, type VariationMemoryLayerEntry as VariationMemoryLayerEntry, type BulkWorkspaceAppliesCursorPagination as BulkWorkspaceAppliesCursorPagination, type BulkWorkspaceResourceListParams as BulkWorkspaceResourceListParams, type BulkWorkspaceResourceApplyParams as BulkWorkspaceResourceApplyParams, };
|
|
286
|
+
export { Results as Results, type BulkWorkspaceApplyResult as BulkWorkspaceApplyResult, type BulkWorkspaceApplyResultData as BulkWorkspaceApplyResultData, type BulkWorkspaceApplyResultDataAgentOutcome as BulkWorkspaceApplyResultDataAgentOutcome, type BulkWorkspaceApplyResultDataAgentScheduleOutcome as BulkWorkspaceApplyResultDataAgentScheduleOutcome, type BulkWorkspaceApplyResultDataAgentVariationOutcome as BulkWorkspaceApplyResultDataAgentVariationOutcome, type BulkWorkspaceApplyResultDataMemoryEntryOutcome as BulkWorkspaceApplyResultDataMemoryEntryOutcome, type BulkWorkspaceApplyResultDataMemoryLayerOutcome as BulkWorkspaceApplyResultDataMemoryLayerOutcome, type BulkWorkspaceApplyResultDataToolOutcome as BulkWorkspaceApplyResultDataToolOutcome, type BulkWorkspaceApplyResultDataToolSetOutcome as BulkWorkspaceApplyResultDataToolSetOutcome, type BulkWorkspaceApplyResultDataVariationAssignmentOutcome as BulkWorkspaceApplyResultDataVariationAssignmentOutcome, type BulkWorkspaceApplyResultDataVariationMemoryLayerOutcome as BulkWorkspaceApplyResultDataVariationMemoryLayerOutcome, type BulkWorkspaceApplyResultsCursorPagination as BulkWorkspaceApplyResultsCursorPagination, type ResultListParams as ResultListParams, };
|
|
287
|
+
}
|
|
288
|
+
//# sourceMappingURL=bulk-workspace-resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-workspace-resources.d.ts","sourceRoot":"","sources":["../../src/resources/bulk-workspace-resources/bulk-workspace-resources.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,KAAK,SAAS;OACd,KAAK,YAAY;OACjB,KAAK,aAAa;OAClB,KAAK,UAAU;OACf,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,wCAAwC,EACxC,gDAAgD,EAChD,iDAAiD,EACjD,8CAA8C,EAC9C,8CAA8C,EAC9C,uCAAuC,EACvC,0CAA0C,EAC1C,sDAAsD,EACtD,uDAAuD,EACvD,yCAAyC,EACzC,gBAAgB,EAChB,OAAO,EACR;OACM,KAAK,eAAe;OACp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,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,gCAAgC,IAAI,gCAAgC,GAC1E,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wCAAwC,IAAI,wCAAwC,EACzF,KAAK,gDAAgD,IAAI,gDAAgD,EACzG,KAAK,iDAAiD,IAAI,iDAAiD,EAC3G,KAAK,8CAA8C,IAAI,8CAA8C,EACrG,KAAK,8CAA8C,IAAI,8CAA8C,EACrG,KAAK,uCAAuC,IAAI,uCAAuC,EACvF,KAAK,0CAA0C,IAAI,0CAA0C,EAC7F,KAAK,sDAAsD,IAAI,sDAAsD,EACrH,KAAK,uDAAuD,IAAI,uDAAuD,EACvH,KAAK,yCAAyC,IAAI,yCAAyC,EAC3F,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BulkWorkspaceResources = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const ResultsAPI = tslib_1.__importStar(require("./results.js"));
|
|
8
|
+
const results_1 = require("./results.js");
|
|
9
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
10
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
11
|
+
/**
|
|
12
|
+
* BulkWorkspaceResources is the workspace-scoped service that applies
|
|
13
|
+
* a declarative bundle of workspace resources (tool sets, memory
|
|
14
|
+
* layers, agents, variations, assignments, schedules) in one async
|
|
15
|
+
* operation. See docs/superpowers/specs/2026-05-02-bulk-workspace-resources-design.md
|
|
16
|
+
* for the full design.
|
|
17
|
+
*
|
|
18
|
+
* Authentication: Bearer token (JWT)
|
|
19
|
+
* Scope: Workspace-level operations
|
|
20
|
+
*/
|
|
21
|
+
class BulkWorkspaceResources extends resource_1.APIResource {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.results = new ResultsAPI.Results(this._client);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves a bulk workspace apply operation by ID.
|
|
28
|
+
*/
|
|
29
|
+
retrieve(id, options) {
|
|
30
|
+
return this._client.get((0, path_1.path) `/v1/bulk_workspace_applies/${id}`, options);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Lists past and in-flight bulk workspace apply operations in the workspace.
|
|
34
|
+
*/
|
|
35
|
+
list(query = {}, options) {
|
|
36
|
+
return this._client.getAPIList('/v1/bulk_workspace_applies', (pagination_1.CursorPagination), {
|
|
37
|
+
query,
|
|
38
|
+
...options,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Asynchronously applies a declarative bundle of workspace resources. Returns the
|
|
43
|
+
* operation immediately in PENDING; clients poll Get to track progress.
|
|
44
|
+
*/
|
|
45
|
+
apply(body, options) {
|
|
46
|
+
return this._client.post('/v1/bulk_workspace_applies', { body, ...options });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.BulkWorkspaceResources = BulkWorkspaceResources;
|
|
50
|
+
BulkWorkspaceResources.Results = results_1.Results;
|
|
51
|
+
//# sourceMappingURL=bulk-workspace-resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-workspace-resources.js","sourceRoot":"","sources":["../../src/resources/bulk-workspace-resources/bulk-workspace-resources.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAMlD,iEAAwC;AACxC,0CAemB;AAKnB,yDAAmG;AAEnG,uDAAiD;AAEjD;;;;;;;;;GASG;AACH,MAAa,sBAAuB,SAAQ,sBAAW;IAAvD;;QACE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6BrE,CAAC;IA3BC;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,8BAA8B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA4D,EAAE,EAC9D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,4BAA4B,EAAE,CAAA,6BAAoC,CAAA,EAAE;YACjG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAsC,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AA9BD,wDA8BC;AAySD,sBAAsB,CAAC,OAAO,GAAG,iBAAO,CAAC"}
|