borgmcp 0.2.0-beta.9 → 0.4.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/README.md +2 -2
- package/dist/auth.js +5 -5
- package/dist/auth.js.map +1 -1
- package/dist/claude.d.ts +9 -4
- package/dist/claude.d.ts.map +1 -1
- package/dist/claude.js +62 -26
- package/dist/claude.js.map +1 -1
- package/dist/config-utils.d.ts +32 -0
- package/dist/config-utils.d.ts.map +1 -1
- package/dist/config-utils.js +159 -0
- package/dist/config-utils.js.map +1 -1
- package/dist/cubes.d.ts +51 -0
- package/dist/cubes.d.ts.map +1 -0
- package/dist/cubes.js +161 -0
- package/dist/cubes.js.map +1 -0
- package/dist/inbox.d.ts +33 -0
- package/dist/inbox.d.ts.map +1 -0
- package/dist/inbox.js +125 -0
- package/dist/inbox.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +701 -25
- package/dist/index.js.map +1 -1
- package/dist/log-audit.d.ts +27 -0
- package/dist/log-audit.d.ts.map +1 -0
- package/dist/log-audit.js +161 -0
- package/dist/log-audit.js.map +1 -0
- package/dist/postinstall.d.ts +1 -1
- package/dist/postinstall.d.ts.map +1 -1
- package/dist/postinstall.js +4 -4
- package/dist/postinstall.js.map +1 -1
- package/dist/regen-format.d.ts +59 -0
- package/dist/regen-format.d.ts.map +1 -0
- package/dist/regen-format.js +172 -0
- package/dist/regen-format.js.map +1 -0
- package/dist/regen.d.ts +19 -0
- package/dist/regen.d.ts.map +1 -0
- package/dist/regen.js +36 -0
- package/dist/regen.js.map +1 -0
- package/dist/remote-client.d.ts +186 -2
- package/dist/remote-client.d.ts.map +1 -1
- package/dist/remote-client.js +232 -11
- package/dist/remote-client.js.map +1 -1
- package/dist/setup.js +40 -33
- package/dist/setup.js.map +1 -1
- package/dist/sync.js +1 -1
- package/dist/sync.js.map +1 -1
- package/dist/templates.d.ts +33 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +96 -0
- package/dist/templates.js.map +1 -0
- package/package.json +11 -10
package/dist/remote-client.d.ts
CHANGED
|
@@ -8,14 +8,198 @@
|
|
|
8
8
|
* - Offline queue for pending operations
|
|
9
9
|
*/
|
|
10
10
|
import type { RemoteResponse } from './types.js';
|
|
11
|
+
export declare const API_URL: string;
|
|
11
12
|
/**
|
|
12
13
|
* Call remote MCP tool with retry logic
|
|
13
14
|
*/
|
|
14
15
|
export declare function callRemoteTool(toolName: string, args: Record<string, any>): Promise<RemoteResponse>;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* Connect this client as a Drone to a Cube.
|
|
18
|
+
*
|
|
19
|
+
* Returns the cube definition, the drone's assigned role (with full
|
|
20
|
+
* detailed_description), the drone record, and an opaque session token
|
|
21
|
+
* the caller is expected to persist via cubes.ts.
|
|
22
|
+
*/
|
|
23
|
+
export declare function assimilate(cubeName: string, apiUrl?: string): Promise<{
|
|
24
|
+
cube: {
|
|
25
|
+
id: string;
|
|
26
|
+
owner_id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
ground_rules: string;
|
|
29
|
+
coordinator_drone_id: string | null;
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
};
|
|
33
|
+
role: {
|
|
34
|
+
id: string;
|
|
35
|
+
cube_id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
short_description: string;
|
|
38
|
+
detailed_description: string;
|
|
39
|
+
is_default: boolean;
|
|
40
|
+
is_coordinator: boolean;
|
|
41
|
+
created_at: string;
|
|
42
|
+
};
|
|
43
|
+
drone: {
|
|
44
|
+
id: string;
|
|
45
|
+
cube_id: string;
|
|
46
|
+
role_id: string;
|
|
47
|
+
label: string;
|
|
48
|
+
last_seen: string;
|
|
49
|
+
created_at: string;
|
|
50
|
+
};
|
|
51
|
+
sessionToken: string;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Get the active cube's ground rules + role registry.
|
|
55
|
+
*/
|
|
56
|
+
export declare function getCubeInfo(sessionToken: string, apiUrl: string): Promise<{
|
|
57
|
+
cube: any;
|
|
58
|
+
roles: any[];
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Get this drone's assigned role (with detailed_description).
|
|
62
|
+
*/
|
|
63
|
+
export declare function getRoleInfo(sessionToken: string, apiUrl: string): Promise<{
|
|
64
|
+
role: any;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* List all currently-connected drones in this cube.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getRoster(sessionToken: string, apiUrl: string): Promise<{
|
|
70
|
+
drones: any[];
|
|
71
|
+
roles: any[];
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Read recent log entries for the cube.
|
|
75
|
+
*/
|
|
76
|
+
export declare function readLog(sessionToken: string, apiUrl: string, opts?: {
|
|
77
|
+
since?: string;
|
|
78
|
+
limit?: number;
|
|
79
|
+
}): Promise<{
|
|
80
|
+
entries: any[];
|
|
81
|
+
drones: any[];
|
|
82
|
+
roles: any[];
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Regen: one-shot composite of everything a drone needs to be oriented.
|
|
86
|
+
*
|
|
87
|
+
* Returns the active cube's ground rules, the drone's own role with full
|
|
88
|
+
* detailed_description, the public role registry (no detailed_description
|
|
89
|
+
* leakage for OTHER roles), the drone roster, and recent log entries.
|
|
90
|
+
* Use on session start and before each new task to stay in sync.
|
|
91
|
+
*/
|
|
92
|
+
export declare function regen(sessionToken: string, apiUrl: string): Promise<{
|
|
93
|
+
cube: any;
|
|
94
|
+
role: any;
|
|
95
|
+
drone: any;
|
|
96
|
+
roles: any[];
|
|
97
|
+
drones: any[];
|
|
98
|
+
recentLog: any[];
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Long-poll for new activity in the active cube.
|
|
102
|
+
*
|
|
103
|
+
* The worker holds the request open for up to ~25s while polling the DB
|
|
104
|
+
* for new entries strictly after `since`. Returns immediately as soon as
|
|
105
|
+
* any new entry exists; otherwise returns an empty result on timeout so
|
|
106
|
+
* the caller can re-poll. Used by the client-side inbox poller to wake
|
|
107
|
+
* drones the moment another drone posts to the cube.
|
|
108
|
+
*/
|
|
109
|
+
export declare function waitForActivity(sessionToken: string, apiUrl: string, since?: string): Promise<{
|
|
110
|
+
entries: any[];
|
|
111
|
+
drones: any[];
|
|
112
|
+
roles: any[];
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* Append a message to the cube's shared activity log.
|
|
116
|
+
*/
|
|
117
|
+
export declare function appendLog(sessionToken: string, apiUrl: string, message: string): Promise<{
|
|
118
|
+
entry: {
|
|
119
|
+
id: string;
|
|
120
|
+
cube_id: string;
|
|
121
|
+
drone_id: string;
|
|
122
|
+
message: string;
|
|
123
|
+
created_at: string;
|
|
124
|
+
};
|
|
125
|
+
}>;
|
|
126
|
+
/**
|
|
127
|
+
* List all cubes owned by the authenticated user. Owner-scoped via the
|
|
128
|
+
* Bearer token alone; no drone session needed.
|
|
129
|
+
*/
|
|
130
|
+
export declare function listCubes(): Promise<{
|
|
131
|
+
cubes: any[];
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* Create a new cube. Server-side seeds a default "Drone" role atomically
|
|
135
|
+
* so the cube is assimilatable immediately.
|
|
136
|
+
*/
|
|
137
|
+
export declare function createCube(name: string, groundRules: string): Promise<{
|
|
138
|
+
cube: any;
|
|
139
|
+
}>;
|
|
140
|
+
/**
|
|
141
|
+
* Update a cube's name and/or ground_rules. Both fields are optional;
|
|
142
|
+
* pass only what changes.
|
|
143
|
+
*/
|
|
144
|
+
export declare function updateCube(cubeId: string, updates: {
|
|
145
|
+
name?: string;
|
|
146
|
+
ground_rules?: string;
|
|
147
|
+
}): Promise<{
|
|
148
|
+
cube: any;
|
|
149
|
+
}>;
|
|
150
|
+
/**
|
|
151
|
+
* Delete a cube. Cascade-deletes all roles, drones, and log entries.
|
|
152
|
+
* Owner-scoped via the Bearer token; the worker enforces ownership.
|
|
153
|
+
*/
|
|
154
|
+
export declare function deleteCube(cubeId: string): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Create a role inside a cube. is_default=true demotes the previous
|
|
157
|
+
* default role; the cube always has exactly one default.
|
|
158
|
+
*/
|
|
159
|
+
export declare function createRole(cubeId: string, data: {
|
|
160
|
+
name: string;
|
|
161
|
+
short_description: string;
|
|
162
|
+
detailed_description: string;
|
|
163
|
+
is_default?: boolean;
|
|
164
|
+
is_coordinator?: boolean;
|
|
165
|
+
}): Promise<{
|
|
166
|
+
role: any;
|
|
167
|
+
}>;
|
|
168
|
+
/**
|
|
169
|
+
* Update a role. All fields optional; pass only what changes.
|
|
170
|
+
*/
|
|
171
|
+
export declare function updateRole(roleId: string, updates: {
|
|
172
|
+
name?: string;
|
|
173
|
+
short_description?: string;
|
|
174
|
+
detailed_description?: string;
|
|
175
|
+
is_default?: boolean;
|
|
176
|
+
is_coordinator?: boolean;
|
|
177
|
+
}): Promise<{
|
|
178
|
+
role: any;
|
|
179
|
+
}>;
|
|
180
|
+
/**
|
|
181
|
+
* Delete a role. Worker refuses if any drone is still assigned to it
|
|
182
|
+
* (reassign or evict those drones first).
|
|
183
|
+
*/
|
|
184
|
+
export declare function deleteRole(roleId: string): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Reassign a drone to a different role within the same cube.
|
|
187
|
+
* Coordinator seat is enforced server-side — attempting to assign to a
|
|
188
|
+
* Coordinator role when another drone holds the seat returns an error.
|
|
189
|
+
*/
|
|
190
|
+
export declare function reassignDrone(droneId: string, roleId: string): Promise<{
|
|
191
|
+
drone: any;
|
|
192
|
+
}>;
|
|
193
|
+
/**
|
|
194
|
+
* Fetch a cube's full detail: ground rules, roles (with detailed
|
|
195
|
+
* descriptions, owner-only), and drones. Owner-scoped via the Bearer
|
|
196
|
+
* token; no drone session needed.
|
|
17
197
|
*/
|
|
18
|
-
export declare function
|
|
198
|
+
export declare function getCube(cubeId: string): Promise<{
|
|
199
|
+
cube: any;
|
|
200
|
+
roles: any[];
|
|
201
|
+
drones: any[];
|
|
202
|
+
}>;
|
|
19
203
|
/**
|
|
20
204
|
* Check subscription status
|
|
21
205
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-client.d.ts","sourceRoot":"","sources":["../src/remote-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"remote-client.d.ts","sourceRoot":"","sources":["../src/remote-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,YAAY,CAAC;AAEhE,eAAO,MAAM,OAAO,QAAuD,CAAC;AAqD5E;;GAEG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,cAAc,CAAC,CAoEzB;AA4CD;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3E,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;QACpC,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,iBAAiB,EAAE,MAAM,CAAC;QAC1B,oBAAoB,EAAE,MAAM,CAAC;QAC7B,UAAU,EAAE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CAAA;CAAE,CAAC,CAGjG;AAED;;GAEG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,GAAG,CAAC,CAa5D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,CAsB1D"}
|
package/dist/remote-client.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { getIdToken, getRefreshToken, clearTokens } from './config.js';
|
|
11
11
|
import { refreshIdToken } from './auth.js';
|
|
12
|
-
const API_URL = process.env.BORG_API_URL || 'https://api.borgmcp.ai';
|
|
12
|
+
export const API_URL = process.env.BORG_API_URL || 'https://api.borgmcp.ai';
|
|
13
13
|
const MAX_RETRIES = 3;
|
|
14
14
|
const INITIAL_BACKOFF_MS = 1000; // 1 second
|
|
15
15
|
const MAX_BACKOFF_MS = 30000; // 30 seconds
|
|
@@ -114,23 +114,244 @@ export async function callRemoteTool(toolName, args) {
|
|
|
114
114
|
throw new Error(`Failed after ${MAX_RETRIES} retries: ${lastError?.message}`);
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
117
|
+
* Authenticated fetch helper.
|
|
118
|
+
*
|
|
119
|
+
* Adds the Bearer token + optional drone-session header, parses errors
|
|
120
|
+
* consistently, and surfaces a helpful "run: borg setup" message on 401.
|
|
121
|
+
*
|
|
122
|
+
* Accepts an optional `apiUrl` override so already-assimilated callers can
|
|
123
|
+
* route to the worker that issued their drone session token, regardless of
|
|
124
|
+
* what BORG_API_URL was set to when this process started.
|
|
118
125
|
*/
|
|
119
|
-
|
|
126
|
+
async function authedFetch(path, init = {}) {
|
|
120
127
|
const token = await getValidToken();
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
128
|
+
const { droneSession, apiUrl, headers, ...rest } = init;
|
|
129
|
+
const baseUrl = apiUrl ?? API_URL;
|
|
130
|
+
const finalHeaders = {
|
|
131
|
+
'Authorization': `Bearer ${token}`,
|
|
132
|
+
...headers,
|
|
133
|
+
};
|
|
134
|
+
if (droneSession) {
|
|
135
|
+
finalHeaders['X-Drone-Session'] = droneSession;
|
|
124
136
|
}
|
|
125
|
-
const response = await fetch(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
},
|
|
137
|
+
const response = await fetch(`${baseUrl}${path}`, {
|
|
138
|
+
...rest,
|
|
139
|
+
headers: finalHeaders,
|
|
129
140
|
});
|
|
141
|
+
if (response.status === 401) {
|
|
142
|
+
throw new Error('Authentication expired. Run: borg setup');
|
|
143
|
+
}
|
|
130
144
|
if (!response.ok) {
|
|
131
145
|
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
|
|
132
146
|
}
|
|
133
|
-
return
|
|
147
|
+
return response;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Connect this client as a Drone to a Cube.
|
|
151
|
+
*
|
|
152
|
+
* Returns the cube definition, the drone's assigned role (with full
|
|
153
|
+
* detailed_description), the drone record, and an opaque session token
|
|
154
|
+
* the caller is expected to persist via cubes.ts.
|
|
155
|
+
*/
|
|
156
|
+
export async function assimilate(cubeName, apiUrl) {
|
|
157
|
+
const response = await authedFetch('/api/assimilate', {
|
|
158
|
+
method: 'POST',
|
|
159
|
+
headers: { 'Content-Type': 'application/json' },
|
|
160
|
+
body: JSON.stringify({ cube_name: cubeName }),
|
|
161
|
+
apiUrl,
|
|
162
|
+
});
|
|
163
|
+
return await response.json();
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Get the active cube's ground rules + role registry.
|
|
167
|
+
*/
|
|
168
|
+
export async function getCubeInfo(sessionToken, apiUrl) {
|
|
169
|
+
const response = await authedFetch('/api/drone/cube', {
|
|
170
|
+
method: 'GET',
|
|
171
|
+
droneSession: sessionToken,
|
|
172
|
+
apiUrl,
|
|
173
|
+
});
|
|
174
|
+
return await response.json();
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Get this drone's assigned role (with detailed_description).
|
|
178
|
+
*/
|
|
179
|
+
export async function getRoleInfo(sessionToken, apiUrl) {
|
|
180
|
+
const response = await authedFetch('/api/drone/role', {
|
|
181
|
+
method: 'GET',
|
|
182
|
+
droneSession: sessionToken,
|
|
183
|
+
apiUrl,
|
|
184
|
+
});
|
|
185
|
+
return await response.json();
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* List all currently-connected drones in this cube.
|
|
189
|
+
*/
|
|
190
|
+
export async function getRoster(sessionToken, apiUrl) {
|
|
191
|
+
const response = await authedFetch('/api/drone/roster', {
|
|
192
|
+
method: 'GET',
|
|
193
|
+
droneSession: sessionToken,
|
|
194
|
+
apiUrl,
|
|
195
|
+
});
|
|
196
|
+
return await response.json();
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Read recent log entries for the cube.
|
|
200
|
+
*/
|
|
201
|
+
export async function readLog(sessionToken, apiUrl, opts = {}) {
|
|
202
|
+
const params = new URLSearchParams();
|
|
203
|
+
if (opts.since)
|
|
204
|
+
params.set('since', opts.since);
|
|
205
|
+
if (opts.limit !== undefined)
|
|
206
|
+
params.set('limit', String(opts.limit));
|
|
207
|
+
const qs = params.toString();
|
|
208
|
+
const response = await authedFetch(`/api/drone/log${qs ? `?${qs}` : ''}`, {
|
|
209
|
+
method: 'GET',
|
|
210
|
+
droneSession: sessionToken,
|
|
211
|
+
apiUrl,
|
|
212
|
+
});
|
|
213
|
+
return await response.json();
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Regen: one-shot composite of everything a drone needs to be oriented.
|
|
217
|
+
*
|
|
218
|
+
* Returns the active cube's ground rules, the drone's own role with full
|
|
219
|
+
* detailed_description, the public role registry (no detailed_description
|
|
220
|
+
* leakage for OTHER roles), the drone roster, and recent log entries.
|
|
221
|
+
* Use on session start and before each new task to stay in sync.
|
|
222
|
+
*/
|
|
223
|
+
export async function regen(sessionToken, apiUrl) {
|
|
224
|
+
const response = await authedFetch('/api/drone/regen', {
|
|
225
|
+
method: 'GET',
|
|
226
|
+
droneSession: sessionToken,
|
|
227
|
+
apiUrl,
|
|
228
|
+
});
|
|
229
|
+
return await response.json();
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Long-poll for new activity in the active cube.
|
|
233
|
+
*
|
|
234
|
+
* The worker holds the request open for up to ~25s while polling the DB
|
|
235
|
+
* for new entries strictly after `since`. Returns immediately as soon as
|
|
236
|
+
* any new entry exists; otherwise returns an empty result on timeout so
|
|
237
|
+
* the caller can re-poll. Used by the client-side inbox poller to wake
|
|
238
|
+
* drones the moment another drone posts to the cube.
|
|
239
|
+
*/
|
|
240
|
+
export async function waitForActivity(sessionToken, apiUrl, since) {
|
|
241
|
+
const params = new URLSearchParams();
|
|
242
|
+
if (since)
|
|
243
|
+
params.set('since', since);
|
|
244
|
+
const qs = params.toString();
|
|
245
|
+
const response = await authedFetch(`/api/drone/wait${qs ? `?${qs}` : ''}`, {
|
|
246
|
+
method: 'GET',
|
|
247
|
+
droneSession: sessionToken,
|
|
248
|
+
apiUrl,
|
|
249
|
+
});
|
|
250
|
+
return await response.json();
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Append a message to the cube's shared activity log.
|
|
254
|
+
*/
|
|
255
|
+
export async function appendLog(sessionToken, apiUrl, message) {
|
|
256
|
+
const response = await authedFetch('/api/drone/log', {
|
|
257
|
+
method: 'POST',
|
|
258
|
+
headers: { 'Content-Type': 'application/json' },
|
|
259
|
+
droneSession: sessionToken,
|
|
260
|
+
apiUrl,
|
|
261
|
+
body: JSON.stringify({ message }),
|
|
262
|
+
});
|
|
263
|
+
return await response.json();
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* List all cubes owned by the authenticated user. Owner-scoped via the
|
|
267
|
+
* Bearer token alone; no drone session needed.
|
|
268
|
+
*/
|
|
269
|
+
export async function listCubes() {
|
|
270
|
+
const response = await authedFetch('/api/cubes', { method: 'GET' });
|
|
271
|
+
return await response.json();
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Create a new cube. Server-side seeds a default "Drone" role atomically
|
|
275
|
+
* so the cube is assimilatable immediately.
|
|
276
|
+
*/
|
|
277
|
+
export async function createCube(name, groundRules) {
|
|
278
|
+
const response = await authedFetch('/api/cubes', {
|
|
279
|
+
method: 'POST',
|
|
280
|
+
headers: { 'Content-Type': 'application/json' },
|
|
281
|
+
body: JSON.stringify({ name, ground_rules: groundRules }),
|
|
282
|
+
});
|
|
283
|
+
return await response.json();
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Update a cube's name and/or ground_rules. Both fields are optional;
|
|
287
|
+
* pass only what changes.
|
|
288
|
+
*/
|
|
289
|
+
export async function updateCube(cubeId, updates) {
|
|
290
|
+
const response = await authedFetch(`/api/cubes/${cubeId}`, {
|
|
291
|
+
method: 'PATCH',
|
|
292
|
+
headers: { 'Content-Type': 'application/json' },
|
|
293
|
+
body: JSON.stringify(updates),
|
|
294
|
+
});
|
|
295
|
+
return await response.json();
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Delete a cube. Cascade-deletes all roles, drones, and log entries.
|
|
299
|
+
* Owner-scoped via the Bearer token; the worker enforces ownership.
|
|
300
|
+
*/
|
|
301
|
+
export async function deleteCube(cubeId) {
|
|
302
|
+
await authedFetch(`/api/cubes/${cubeId}`, { method: 'DELETE' });
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Create a role inside a cube. is_default=true demotes the previous
|
|
306
|
+
* default role; the cube always has exactly one default.
|
|
307
|
+
*/
|
|
308
|
+
export async function createRole(cubeId, data) {
|
|
309
|
+
const response = await authedFetch(`/api/cubes/${cubeId}/roles`, {
|
|
310
|
+
method: 'POST',
|
|
311
|
+
headers: { 'Content-Type': 'application/json' },
|
|
312
|
+
body: JSON.stringify(data),
|
|
313
|
+
});
|
|
314
|
+
return await response.json();
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Update a role. All fields optional; pass only what changes.
|
|
318
|
+
*/
|
|
319
|
+
export async function updateRole(roleId, updates) {
|
|
320
|
+
const response = await authedFetch(`/api/roles/${roleId}`, {
|
|
321
|
+
method: 'PATCH',
|
|
322
|
+
headers: { 'Content-Type': 'application/json' },
|
|
323
|
+
body: JSON.stringify(updates),
|
|
324
|
+
});
|
|
325
|
+
return await response.json();
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Delete a role. Worker refuses if any drone is still assigned to it
|
|
329
|
+
* (reassign or evict those drones first).
|
|
330
|
+
*/
|
|
331
|
+
export async function deleteRole(roleId) {
|
|
332
|
+
await authedFetch(`/api/roles/${roleId}`, { method: 'DELETE' });
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Reassign a drone to a different role within the same cube.
|
|
336
|
+
* Coordinator seat is enforced server-side — attempting to assign to a
|
|
337
|
+
* Coordinator role when another drone holds the seat returns an error.
|
|
338
|
+
*/
|
|
339
|
+
export async function reassignDrone(droneId, roleId) {
|
|
340
|
+
const response = await authedFetch(`/api/drones/${droneId}`, {
|
|
341
|
+
method: 'PATCH',
|
|
342
|
+
headers: { 'Content-Type': 'application/json' },
|
|
343
|
+
body: JSON.stringify({ role_id: roleId }),
|
|
344
|
+
});
|
|
345
|
+
return await response.json();
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Fetch a cube's full detail: ground rules, roles (with detailed
|
|
349
|
+
* descriptions, owner-only), and drones. Owner-scoped via the Bearer
|
|
350
|
+
* token; no drone session needed.
|
|
351
|
+
*/
|
|
352
|
+
export async function getCube(cubeId) {
|
|
353
|
+
const response = await authedFetch(`/api/cubes/${cubeId}`, { method: 'GET' });
|
|
354
|
+
return await response.json();
|
|
134
355
|
}
|
|
135
356
|
/**
|
|
136
357
|
* Check subscription status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-client.js","sourceRoot":"","sources":["../src/remote-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe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