@b3os/sdk 0.2.2 → 0.2.3
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 +1 -1
- package/dist/cjs/core/util.d.ts +1 -1
- package/dist/cjs/core/util.js +1 -1
- package/dist/cjs/generated/client.d.ts +5 -0
- package/dist/cjs/generated/client.js +9 -0
- package/dist/cjs/generated/client.js.map +1 -1
- package/dist/cjs/generated/errors.d.ts +1 -1
- package/dist/cjs/generated/errors.js +45 -0
- package/dist/cjs/generated/errors.js.map +1 -1
- package/dist/cjs/generated/ids.d.ts +28 -0
- package/dist/cjs/generated/ids.js +7 -0
- package/dist/cjs/generated/ids.js.map +1 -1
- package/dist/cjs/generated/ns/agents.d.ts +438 -11
- package/dist/cjs/generated/ns/agents.js +598 -11
- package/dist/cjs/generated/ns/agents.js.map +1 -1
- package/dist/cjs/generated/ns/images.d.ts +84 -3
- package/dist/cjs/generated/ns/images.js +126 -2
- package/dist/cjs/generated/ns/images.js.map +1 -1
- package/dist/cjs/generated/ns/listeners.d.ts +6 -2
- package/dist/cjs/generated/ns/listeners.js +6 -2
- package/dist/cjs/generated/ns/listeners.js.map +1 -1
- package/dist/cjs/generated/ns/routines.d.ts +11 -0
- package/dist/cjs/generated/ns/routines.js +11 -0
- package/dist/cjs/generated/ns/routines.js.map +1 -1
- package/dist/cjs/generated/ns/sandboxes.d.ts +140 -1
- package/dist/cjs/generated/ns/sandboxes.js +190 -1
- package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
- package/dist/cjs/generated/ns/vision.d.ts +55 -1
- package/dist/cjs/generated/ns/vision.js +94 -1
- package/dist/cjs/generated/ns/vision.js.map +1 -1
- package/dist/cjs/generated/ns/workspaces.d.ts +225 -0
- package/dist/cjs/generated/ns/workspaces.js +410 -0
- package/dist/cjs/generated/ns/workspaces.js.map +1 -0
- package/dist/cjs/generated/types.d.ts +2230 -72
- package/dist/esm/core/util.d.ts +1 -1
- package/dist/esm/core/util.js +1 -1
- package/dist/esm/generated/client.d.ts +5 -0
- package/dist/esm/generated/client.js +9 -0
- package/dist/esm/generated/client.js.map +1 -1
- package/dist/esm/generated/errors.d.ts +1 -1
- package/dist/esm/generated/errors.js +45 -0
- package/dist/esm/generated/errors.js.map +1 -1
- package/dist/esm/generated/ids.d.ts +28 -0
- package/dist/esm/generated/ids.js +7 -0
- package/dist/esm/generated/ids.js.map +1 -1
- package/dist/esm/generated/ns/agents.d.ts +438 -11
- package/dist/esm/generated/ns/agents.js +598 -11
- package/dist/esm/generated/ns/agents.js.map +1 -1
- package/dist/esm/generated/ns/images.d.ts +84 -3
- package/dist/esm/generated/ns/images.js +126 -2
- package/dist/esm/generated/ns/images.js.map +1 -1
- package/dist/esm/generated/ns/listeners.d.ts +6 -2
- package/dist/esm/generated/ns/listeners.js +6 -2
- package/dist/esm/generated/ns/listeners.js.map +1 -1
- package/dist/esm/generated/ns/routines.d.ts +11 -0
- package/dist/esm/generated/ns/routines.js +11 -0
- package/dist/esm/generated/ns/routines.js.map +1 -1
- package/dist/esm/generated/ns/sandboxes.d.ts +140 -1
- package/dist/esm/generated/ns/sandboxes.js +190 -1
- package/dist/esm/generated/ns/sandboxes.js.map +1 -1
- package/dist/esm/generated/ns/vision.d.ts +55 -1
- package/dist/esm/generated/ns/vision.js +94 -1
- package/dist/esm/generated/ns/vision.js.map +1 -1
- package/dist/esm/generated/ns/workspaces.d.ts +225 -0
- package/dist/esm/generated/ns/workspaces.js +406 -0
- package/dist/esm/generated/ns/workspaces.js.map +1 -0
- package/dist/esm/generated/types.d.ts +2230 -72
- package/package.json +1 -1
- package/src/core/util.ts +1 -1
- package/src/generated/client.ts +10 -0
- package/src/generated/errors.ts +90 -0
- package/src/generated/ids.ts +7 -0
- package/src/generated/ns/agents.ts +652 -11
- package/src/generated/ns/images.ts +131 -3
- package/src/generated/ns/listeners.ts +6 -2
- package/src/generated/ns/routines.ts +11 -0
- package/src/generated/ns/sandboxes.ts +203 -1
- package/src/generated/ns/vision.ts +101 -1
- package/src/generated/ns/workspaces.ts +448 -0
- package/src/generated/types.ts +2416 -48
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b3os/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "TypeScript SDK for B3OS beta: vision (web pages and browsers), render, infer, sandboxes, routines, actions and vault, on the machine that runs the model.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
package/src/core/util.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Small runtime helpers shared by the core. Nothing here imports a Node module statically, so the package loads
|
|
2
2
|
// unchanged on Node, Bun, Deno, Cloudflare Workers and browsers.
|
|
3
3
|
|
|
4
|
-
export const SDK_VERSION = "0.2.
|
|
4
|
+
export const SDK_VERSION = "0.2.3";
|
|
5
5
|
|
|
6
6
|
interface ProcessLike {
|
|
7
7
|
env?: Record<string, string | undefined>;
|
package/src/generated/client.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { UsageAPI } from "./ns/usage.ts";
|
|
|
20
20
|
import { VaultAPI } from "./ns/vault.ts";
|
|
21
21
|
import { VisionAPI } from "./ns/vision.ts";
|
|
22
22
|
import { WebhooksAPI } from "./ns/webhooks.ts";
|
|
23
|
+
import { WorkspacesAPI } from "./ns/workspaces.ts";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* The B3OS client: one key, every product. Configuration comes from options or the environment
|
|
@@ -39,6 +40,7 @@ export class B3OS extends B3OSCore {
|
|
|
39
40
|
#agents: AgentsAPI | undefined;
|
|
40
41
|
#routines: RoutinesAPI | undefined;
|
|
41
42
|
#listeners: ListenersAPI | undefined;
|
|
43
|
+
#workspaces: WorkspacesAPI | undefined;
|
|
42
44
|
#actions: ActionsAPI | undefined;
|
|
43
45
|
#vault: VaultAPI | undefined;
|
|
44
46
|
#infer: InferAPI | undefined;
|
|
@@ -103,6 +105,14 @@ export class B3OS extends B3OSCore {
|
|
|
103
105
|
return this.#listeners;
|
|
104
106
|
}
|
|
105
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Workspaces: file trees with git-compatible history, a branch per agent, commits checked against per-path rules, and merges that report every conflict (`/v1/workspaces`).
|
|
110
|
+
*/
|
|
111
|
+
get workspaces(): WorkspacesAPI {
|
|
112
|
+
this.#workspaces ??= new WorkspacesAPI(this);
|
|
113
|
+
return this.#workspaces;
|
|
114
|
+
}
|
|
115
|
+
|
|
106
116
|
/** Marketplace actions and triggers: search, describe, call, packs and the registry (`/v1/actions`). */
|
|
107
117
|
get actions(): ActionsAPI {
|
|
108
118
|
this.#actions ??= new ActionsAPI(this);
|
package/src/generated/errors.ts
CHANGED
|
@@ -127,6 +127,7 @@ export const ERROR_CATALOG: Readonly<Record<string, readonly [status: number, re
|
|
|
127
127
|
app_blocked: [410, 0, "Address unavailable"],
|
|
128
128
|
app_unavailable: [503, 1, "App unavailable"],
|
|
129
129
|
app_request_refused: [403, 0, "Request not served"],
|
|
130
|
+
trace_export_unset: [409, 0, "No trace export"],
|
|
130
131
|
authorization_pending: [400, 1, "Authorization pending"],
|
|
131
132
|
slow_down: [400, 1, "Slow down"],
|
|
132
133
|
access_denied: [400, 0, "Access denied"],
|
|
@@ -137,6 +138,9 @@ export const ERROR_CATALOG: Readonly<Record<string, readonly [status: number, re
|
|
|
137
138
|
session_not_found: [404, 0, "Browser session not found"],
|
|
138
139
|
session_closed: [409, 0, "Browser session closed"],
|
|
139
140
|
profile_not_found: [404, 0, "Browser profile not found"],
|
|
141
|
+
identity_not_found: [404, 0, "Stealth identity not found"],
|
|
142
|
+
identity_retired: [409, 0, "Stealth identity retired"],
|
|
143
|
+
stealth_exit_probe_failed: [502, 1, "Stealth exit probe failed"],
|
|
140
144
|
profile_domain_mismatch: [422, 0, "Profile domain mismatch"],
|
|
141
145
|
profile_conflict: [409, 0, "Profile changed since it was loaded"],
|
|
142
146
|
profile_name_taken: [409, 0, "Profile name taken"],
|
|
@@ -183,8 +187,10 @@ export const ERROR_CATALOG: Readonly<Record<string, readonly [status: number, re
|
|
|
183
187
|
goal_unplanned: [422, 0, "Goal could not be planned"],
|
|
184
188
|
sandbox_not_found: [404, 0, "Sandbox not found"],
|
|
185
189
|
sandbox_not_running: [409, 0, "Sandbox not running"],
|
|
190
|
+
sandbox_restoring: [503, 1, "Sandbox restoring"],
|
|
186
191
|
lease_holder_changed: [409, 0, "Lease holder changed"],
|
|
187
192
|
template_not_found: [404, 0, "Template not found"],
|
|
193
|
+
template_step_unsupported: [422, 0, "Template step not supported"],
|
|
188
194
|
memory_too_small: [422, 0, "Memory too small for this template"],
|
|
189
195
|
template_warmup_failed: [503, 1, "Template could not be prepared at this size"],
|
|
190
196
|
volume_not_found: [404, 0, "Volume not found"],
|
|
@@ -213,11 +219,17 @@ export const ERROR_CATALOG: Readonly<Record<string, readonly [status: number, re
|
|
|
213
219
|
snapshot_failed: [500, 1, "Snapshot failed"],
|
|
214
220
|
fork_unavailable: [409, 0, "Fork not available"],
|
|
215
221
|
swarm_not_found: [404, 0, "Swarm not found"],
|
|
222
|
+
computer_unavailable: [409, 0, "Computer use unavailable"],
|
|
223
|
+
desktop_unavailable: [503, 1, "Desktop unavailable"],
|
|
216
224
|
envd_token_invalid: [401, 0, "envd access token invalid"],
|
|
217
225
|
image_not_found: [404, 0, "Image not found"],
|
|
218
226
|
image_not_ready: [409, 1, "Image not ready"],
|
|
219
227
|
image_in_use: [409, 0, "Image in use"],
|
|
228
|
+
image_context_not_found: [404, 0, "Build context not found"],
|
|
229
|
+
image_name_taken: [409, 0, "Image name taken"],
|
|
230
|
+
image_name_reserved: [422, 0, "Image name reserved"],
|
|
220
231
|
image_refused: [422, 0, "Image refused"],
|
|
232
|
+
image_auth_invalid: [422, 0, "Registry connection not usable"],
|
|
221
233
|
import_failed: [502, 1, "Import failed"],
|
|
222
234
|
agent_not_found: [404, 0, "Agent not found"],
|
|
223
235
|
agent_exists: [409, 0, "Agent exists"],
|
|
@@ -232,6 +244,25 @@ export const ERROR_CATALOG: Readonly<Record<string, readonly [status: number, re
|
|
|
232
244
|
agent_session_not_found: [404, 0, "Agent session not found"],
|
|
233
245
|
instance_self_message: [409, 0, "Instance messaged itself"],
|
|
234
246
|
credential_revoked: [403, 0, "Credential revoked"],
|
|
247
|
+
harness_required: [409, 0, "Harness required"],
|
|
248
|
+
harness_version_unavailable: [422, 0, "Harness version unavailable"],
|
|
249
|
+
harness_claude_plan_signin_disabled: [403, 0, "Claude plan sign-in not enabled"],
|
|
250
|
+
harness_signin_unsupported: [422, 0, "Sign-in not supported for this harness"],
|
|
251
|
+
harness_signin_not_personal: [409, 0, "Sign-in needs a personal agent"],
|
|
252
|
+
harness_personal_agent: [403, 0, "Personal agent"],
|
|
253
|
+
harness_plan_credential: [400, 0, "Plan credential refused"],
|
|
254
|
+
harness_profile_unknown: [400, 0, "Profile unknown"],
|
|
255
|
+
harness_profile_unavailable: [409, 0, "Profile unavailable"],
|
|
256
|
+
harness_capability_unsupported: [422, 0, "Not supported by this harness"],
|
|
257
|
+
harness_setup_needs_prepare: [422, 0, "Prepared snapshots not served yet"],
|
|
258
|
+
harness_setup_unpinned: [422, 0, "Source not pinned"],
|
|
259
|
+
harness_prepare_failed: [502, 0, "Harness prepare failed"],
|
|
260
|
+
no_turn_running: [409, 0, "No turn running"],
|
|
261
|
+
decision_not_found: [404, 0, "Decision not found"],
|
|
262
|
+
controller_active: [409, 1, "Terminal controlled elsewhere"],
|
|
263
|
+
grant_not_found: [404, 0, "Grant not found"],
|
|
264
|
+
grant_invalid: [401, 0, "Grant invalid"],
|
|
265
|
+
recording_not_found: [404, 0, "Recording not found"],
|
|
235
266
|
routine_not_found: [404, 0, "Routine not found"],
|
|
236
267
|
routine_version_not_found: [404, 0, "Routine version not found"],
|
|
237
268
|
run_not_found: [404, 0, "Run not found"],
|
|
@@ -260,8 +291,22 @@ export const ERROR_CATALOG: Readonly<Record<string, readonly [status: number, re
|
|
|
260
291
|
listener_event_not_found: [404, 0, "Listener event not found"],
|
|
261
292
|
listener_invalid: [422, 0, "Listener invalid"],
|
|
262
293
|
listener_not_active: [409, 0, "Listener not active"],
|
|
294
|
+
listener_managed: [409, 0, "Listener belongs to a routine"],
|
|
295
|
+
listener_bound: [409, 0, "Listener sink held by a routine"],
|
|
263
296
|
listener_wrong_source: [409, 0, "Wrong source type"],
|
|
264
297
|
listener_backlog_full: [429, 1, "Listener backlog full"],
|
|
298
|
+
workspace_not_found: [404, 0, "Workspace not found"],
|
|
299
|
+
branch_not_found: [404, 0, "Branch not found"],
|
|
300
|
+
commit_not_found: [404, 0, "Commit not found"],
|
|
301
|
+
workspace_path_not_found: [404, 0, "Workspace path not found"],
|
|
302
|
+
workspace_invalid: [422, 0, "Workspace request invalid"],
|
|
303
|
+
branch_held: [409, 1, "Branch held"],
|
|
304
|
+
path_not_writable: [403, 0, "Path not writable"],
|
|
305
|
+
head_moved: [409, 0, "Head moved"],
|
|
306
|
+
merge_conflict: [409, 0, "Merge conflict"],
|
|
307
|
+
append_only_violation: [422, 0, "Append-only file changed"],
|
|
308
|
+
secret_in_commit: [422, 0, "Secret in commit"],
|
|
309
|
+
workspace_view_exceeds_initiator: [403, 0, "View exceeds initiator"],
|
|
265
310
|
pack_not_found: [404, 0, "Pack not found"],
|
|
266
311
|
pack_version_not_found: [404, 0, "Pack version not found"],
|
|
267
312
|
action_not_found: [404, 0, "Action not found"],
|
|
@@ -419,6 +464,7 @@ export type B3OSServerErrorCode =
|
|
|
419
464
|
| "app_blocked"
|
|
420
465
|
| "app_unavailable"
|
|
421
466
|
| "app_request_refused"
|
|
467
|
+
| "trace_export_unset"
|
|
422
468
|
| "authorization_pending"
|
|
423
469
|
| "slow_down"
|
|
424
470
|
| "access_denied"
|
|
@@ -429,6 +475,9 @@ export type B3OSServerErrorCode =
|
|
|
429
475
|
| "session_not_found"
|
|
430
476
|
| "session_closed"
|
|
431
477
|
| "profile_not_found"
|
|
478
|
+
| "identity_not_found"
|
|
479
|
+
| "identity_retired"
|
|
480
|
+
| "stealth_exit_probe_failed"
|
|
432
481
|
| "profile_domain_mismatch"
|
|
433
482
|
| "profile_conflict"
|
|
434
483
|
| "profile_name_taken"
|
|
@@ -475,8 +524,10 @@ export type B3OSServerErrorCode =
|
|
|
475
524
|
| "goal_unplanned"
|
|
476
525
|
| "sandbox_not_found"
|
|
477
526
|
| "sandbox_not_running"
|
|
527
|
+
| "sandbox_restoring"
|
|
478
528
|
| "lease_holder_changed"
|
|
479
529
|
| "template_not_found"
|
|
530
|
+
| "template_step_unsupported"
|
|
480
531
|
| "memory_too_small"
|
|
481
532
|
| "template_warmup_failed"
|
|
482
533
|
| "volume_not_found"
|
|
@@ -505,11 +556,17 @@ export type B3OSServerErrorCode =
|
|
|
505
556
|
| "snapshot_failed"
|
|
506
557
|
| "fork_unavailable"
|
|
507
558
|
| "swarm_not_found"
|
|
559
|
+
| "computer_unavailable"
|
|
560
|
+
| "desktop_unavailable"
|
|
508
561
|
| "envd_token_invalid"
|
|
509
562
|
| "image_not_found"
|
|
510
563
|
| "image_not_ready"
|
|
511
564
|
| "image_in_use"
|
|
565
|
+
| "image_context_not_found"
|
|
566
|
+
| "image_name_taken"
|
|
567
|
+
| "image_name_reserved"
|
|
512
568
|
| "image_refused"
|
|
569
|
+
| "image_auth_invalid"
|
|
513
570
|
| "import_failed"
|
|
514
571
|
| "agent_not_found"
|
|
515
572
|
| "agent_exists"
|
|
@@ -524,6 +581,25 @@ export type B3OSServerErrorCode =
|
|
|
524
581
|
| "agent_session_not_found"
|
|
525
582
|
| "instance_self_message"
|
|
526
583
|
| "credential_revoked"
|
|
584
|
+
| "harness_required"
|
|
585
|
+
| "harness_version_unavailable"
|
|
586
|
+
| "harness_claude_plan_signin_disabled"
|
|
587
|
+
| "harness_signin_unsupported"
|
|
588
|
+
| "harness_signin_not_personal"
|
|
589
|
+
| "harness_personal_agent"
|
|
590
|
+
| "harness_plan_credential"
|
|
591
|
+
| "harness_profile_unknown"
|
|
592
|
+
| "harness_profile_unavailable"
|
|
593
|
+
| "harness_capability_unsupported"
|
|
594
|
+
| "harness_setup_needs_prepare"
|
|
595
|
+
| "harness_setup_unpinned"
|
|
596
|
+
| "harness_prepare_failed"
|
|
597
|
+
| "no_turn_running"
|
|
598
|
+
| "decision_not_found"
|
|
599
|
+
| "controller_active"
|
|
600
|
+
| "grant_not_found"
|
|
601
|
+
| "grant_invalid"
|
|
602
|
+
| "recording_not_found"
|
|
527
603
|
| "routine_not_found"
|
|
528
604
|
| "routine_version_not_found"
|
|
529
605
|
| "run_not_found"
|
|
@@ -552,8 +628,22 @@ export type B3OSServerErrorCode =
|
|
|
552
628
|
| "listener_event_not_found"
|
|
553
629
|
| "listener_invalid"
|
|
554
630
|
| "listener_not_active"
|
|
631
|
+
| "listener_managed"
|
|
632
|
+
| "listener_bound"
|
|
555
633
|
| "listener_wrong_source"
|
|
556
634
|
| "listener_backlog_full"
|
|
635
|
+
| "workspace_not_found"
|
|
636
|
+
| "branch_not_found"
|
|
637
|
+
| "commit_not_found"
|
|
638
|
+
| "workspace_path_not_found"
|
|
639
|
+
| "workspace_invalid"
|
|
640
|
+
| "branch_held"
|
|
641
|
+
| "path_not_writable"
|
|
642
|
+
| "head_moved"
|
|
643
|
+
| "merge_conflict"
|
|
644
|
+
| "append_only_violation"
|
|
645
|
+
| "secret_in_commit"
|
|
646
|
+
| "workspace_view_exceeds_initiator"
|
|
557
647
|
| "pack_not_found"
|
|
558
648
|
| "pack_version_not_found"
|
|
559
649
|
| "action_not_found"
|
package/src/generated/ids.ts
CHANGED
|
@@ -21,9 +21,13 @@ export const ID_PREFIXES = {
|
|
|
21
21
|
vol: { object: "volume", product: "sandboxes" },
|
|
22
22
|
swm: { object: "swarm", product: "sandboxes" },
|
|
23
23
|
img: { object: "image", product: "images" },
|
|
24
|
+
bld: { object: "template_build", product: "sandboxes" },
|
|
24
25
|
agt: { object: "agent", product: "agents" },
|
|
25
26
|
inst: { object: "agent_instance", product: "agents" },
|
|
26
27
|
ses: { object: "agent_session", product: "agents" },
|
|
28
|
+
grt: { object: "agent_grant", product: "agents" },
|
|
29
|
+
rec: { object: "terminal_recording", product: "agents" },
|
|
30
|
+
dec: { object: "harness_decision_request", product: "agents" },
|
|
27
31
|
rtn: { object: "routine", product: "routines" },
|
|
28
32
|
ver: { object: "routine_version", product: "routines" },
|
|
29
33
|
run: { object: "routine_run", product: "routines" },
|
|
@@ -31,6 +35,9 @@ export const ID_PREFIXES = {
|
|
|
31
35
|
conn: { object: "connection", product: "vault" },
|
|
32
36
|
tsub: { object: "trigger_subscription", product: "actions" },
|
|
33
37
|
lsn: { object: "listener", product: "listeners" },
|
|
38
|
+
ws: { object: "workspace", product: "workspaces" },
|
|
39
|
+
br: { object: "branch", product: "workspaces" },
|
|
40
|
+
cmt: { object: "commit", product: "workspaces" },
|
|
34
41
|
tfile: { object: "tool_file", product: "actions" },
|
|
35
42
|
tblk: { object: "tool_block", product: "actions" },
|
|
36
43
|
clink: { object: "connect_link", product: "vault" },
|