buckyos 0.7.193 → 0.7.197
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/cli/README.md +20 -0
- package/cli/core/app.ts +1 -0
- package/cli/core/argv.ts +4 -0
- package/cli/dist/cli.mjs +218 -392
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/modules/aiws.ts +11 -3
- package/cli/modules/obj.ts +70 -3
- package/cli/runtime/host.ts +2 -0
- package/cli/version.ts +1 -1
- package/dist/{aiws_bind-ec6fe2d5.mjs → aiws_bind-a96cb506.mjs} +135 -31
- package/dist/aiws_bind-a96cb506.mjs.map +1 -0
- package/dist/aiws_bind-fb4caf43.js +2 -0
- package/dist/aiws_bind-fb4caf43.js.map +1 -0
- package/dist/aiws_ext.cjs +1 -1
- package/dist/aiws_ext.mjs +1 -1
- package/dist/aiws_rrule.d.ts +3 -2
- package/dist/aiws_rrule.d.ts.map +1 -1
- package/dist/aiws_schedule.d.ts +14 -2
- package/dist/aiws_schedule.d.ts.map +1 -1
- package/dist/{aiws_write-1f179e1c.js → aiws_write-189e4c0e.js} +2 -2
- package/dist/aiws_write-189e4c0e.js.map +1 -0
- package/dist/{aiws_write-07562abc.mjs → aiws_write-7078045b.mjs} +2 -2
- package/dist/aiws_write-7078045b.mjs.map +1 -0
- package/dist/browser.cjs +1 -1
- package/dist/browser.mjs +4 -4
- package/dist/{content_objid-7605d166.mjs → content_objid-20b82f52.mjs} +2 -2
- package/dist/{content_objid-7605d166.mjs.map → content_objid-20b82f52.mjs.map} +1 -1
- package/dist/{content_objid-17daaa69.js → content_objid-d1d089a6.js} +2 -2
- package/dist/{content_objid-17daaa69.js.map → content_objid-d1d089a6.js.map} +1 -1
- package/dist/hybrid_sso.d.ts +37 -2
- package/dist/hybrid_sso.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/node.cjs +1 -1
- package/dist/node.mjs +3 -3
- package/dist/owner-extensions/object_extensions.toml +160 -0
- package/dist/owner-extensions/profiles/bindings.json +165 -0
- package/dist/owner-extensions/profiles/calendar.json +489 -0
- package/dist/owner-extensions/profiles/contacts.json +89 -0
- package/dist/owner-extensions/profiles/person.json +193 -0
- package/dist/owner-extensions/profiles/sharing.json +65 -0
- package/dist/owner-extensions/profiles/todo.json +493 -0
- package/dist/owner-extensions/scripts/bindings.mjs +9 -0
- package/dist/owner-extensions/scripts/calendar.mjs +3 -0
- package/dist/owner-extensions/scripts/contacts.mjs +9 -0
- package/dist/owner-extensions/scripts/free_busy.mjs +666 -0
- package/dist/owner-extensions/scripts/person.mjs +11 -0
- package/dist/owner-extensions/scripts/schedule.mjs +2618 -0
- package/dist/owner-extensions/scripts/sharing.mjs +8 -0
- package/dist/owner-extensions/scripts/todo.mjs +3 -0
- package/dist/owner_availability.d.ts +15 -0
- package/dist/owner_availability.d.ts.map +1 -0
- package/dist/owner_schedule.d.ts +30 -0
- package/dist/owner_schedule.d.ts.map +1 -0
- package/dist/site_manager-716a2cf5.js +2 -0
- package/dist/site_manager-716a2cf5.js.map +1 -0
- package/dist/{site_manager-8adb478e.mjs → site_manager-91b4d899.mjs} +29 -14
- package/dist/site_manager-91b4d899.mjs.map +1 -0
- package/dist/xllm/core/action_parser.d.ts.map +1 -1
- package/dist/xllm/core/behavior_result.d.ts.map +1 -1
- package/dist/xllm/core/loop.d.ts.map +1 -1
- package/dist/xllm/core/protocol.d.ts.map +1 -1
- package/dist/xllm/core/types.d.ts +2 -0
- package/dist/xllm/core/types.d.ts.map +1 -1
- package/dist/xllm.cjs +1 -1
- package/dist/xllm.mjs +2 -2
- package/dist/xllm_deno.cjs +1 -1
- package/dist/xllm_deno.mjs +1 -1
- package/package.json +2 -2
- package/cli/modules/aiws_schedule.ts +0 -256
- package/dist/aiws_bind-1a26e3e6.js +0 -2
- package/dist/aiws_bind-1a26e3e6.js.map +0 -1
- package/dist/aiws_bind-ec6fe2d5.mjs.map +0 -1
- package/dist/aiws_write-07562abc.mjs.map +0 -1
- package/dist/aiws_write-1f179e1c.js.map +0 -1
- package/dist/site_manager-8adb478e.mjs.map +0 -1
- package/dist/site_manager-c832463b.js +0 -2
- package/dist/site_manager-c832463b.js.map +0 -1
package/cli/dist/cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import process from "node:process";
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import * as nodePath from "node:path";
|
|
4
4
|
import { resolve as resolve$5, dirname as dirname$3 } from "node:path";
|
|
5
|
-
import { BuckyOSSDK, RuntimeType, buckyos, namelib, VerifyHubClient, createAppInstanceId, parseSessionTokenClaims, ndn, verifyBundle, controlSkeleton, aiwsContentDigest, AIWS_MANIFEST_VERSION, AIWS_MANIFEST_FILE, taskMgrTaskEventPath, ndm_proxy, objectUrl as objectUrl$1, ExecutorCommandStream,
|
|
5
|
+
import { BuckyOSSDK, RuntimeType, buckyos, namelib, VerifyHubClient, createAppInstanceId, parseSessionTokenClaims, ndn, verifyBundle, controlSkeleton, aiwsContentDigest, AIWS_MANIFEST_VERSION, AIWS_MANIFEST_FILE, taskMgrTaskEventPath, ndm_proxy, objectUrl as objectUrl$1, ExecutorCommandStream, resolveBindings, noUiDialogs, createOps, orderKeyBetween, bindingsPayload, AIWS_PROTOCOL_VERSION, BindFailure, aiwsTarget, watchControl, buildControl, pullControl, exportBundle, AiwsFailure, tableDelete, optionAdd, fieldAdd, tableSet, tableInsert, textAppend, textDeleteBlocks, textReplaceBlock, move, rename, setProps, NfspClient, AiwsSourceError, packBuildFiles, commitOps, templateDir, isSourcePath } from "buckyos/node";
|
|
6
6
|
import * as provisionSdk from "buckyos/provision";
|
|
7
7
|
import { providerErrorFromRpc, AiccLlmClient, LLMComputeException } from "buckyos/xllm";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
@@ -393,6 +393,11 @@ function parseInvocation(argv) {
|
|
|
393
393
|
}
|
|
394
394
|
function parseCommandArgs(command2, argv, inputObject, allowReplScopedGlobals = false, deferValidation = false) {
|
|
395
395
|
const scoped = {};
|
|
396
|
+
if (command2.module === "obj" && command2.verb === "call") {
|
|
397
|
+
if (inputObject)
|
|
398
|
+
throw new UsageError("INVALID_ARGUMENT", "pass xcall arguments directly");
|
|
399
|
+
return { input: { argv }, scoped, help: false };
|
|
400
|
+
}
|
|
396
401
|
const replScoped = (parsed, args, index) => {
|
|
397
402
|
if (!allowReplScopedGlobals)
|
|
398
403
|
return void 0;
|
|
@@ -542,7 +547,7 @@ function buildDistributionPolicy(options) {
|
|
|
542
547
|
for (const candidate of parsed.writeParents) {
|
|
543
548
|
writePaths.add(path.dirname(resolveInputPath(candidate, cwd, path)));
|
|
544
549
|
}
|
|
545
|
-
const subprocesses = parsed.module === "pikg" && ["init", "build"].includes(parsed.verb ?? "") ? ["docker"] : parsed.module === "aiws" && ["run-exec", "run-program"].includes(parsed.verb ?? "") && options.runtimeExecutable ? [options.runtimeExecutable] : [];
|
|
550
|
+
const subprocesses = parsed.module === "pikg" && ["init", "build"].includes(parsed.verb ?? "") ? ["docker"] : parsed.module === "aiws" && ["run-exec", "run-program"].includes(parsed.verb ?? "") && options.runtimeExecutable ? [options.runtimeExecutable] : options.distribution === "system" && parsed.module === "obj" && parsed.verb === "call" ? [path.join(buckyosRoot, "bin", "opendan", path.sep === "\\" ? "agent_tool.exe" : "agent_tool")] : [];
|
|
546
551
|
const network = parsed.module !== void 0 && !["pikg", "command", "completion", "config", "provision"].includes(parsed.module);
|
|
547
552
|
const allowedEnvironment = options.distribution === "developer" ? TOOL_ENVIRONMENT_NAMES.filter((name) => name !== "BUCKYOS_ROOT") : TOOL_ENVIRONMENT_NAMES;
|
|
548
553
|
return Object.freeze({
|
|
@@ -2521,7 +2526,7 @@ function replPrompt(config) {
|
|
|
2521
2526
|
return `buckyos[${profile}|${zone}|${identity}]> `;
|
|
2522
2527
|
}
|
|
2523
2528
|
const EMPTY_INPUT$3 = { type: "object", properties: {}, additionalProperties: false };
|
|
2524
|
-
const OBJECT_OUTPUT$
|
|
2529
|
+
const OBJECT_OUTPUT$i = { type: "object", additionalProperties: true };
|
|
2525
2530
|
function createAuthModule() {
|
|
2526
2531
|
return {
|
|
2527
2532
|
name: "auth",
|
|
@@ -2531,7 +2536,7 @@ function createAuthModule() {
|
|
|
2531
2536
|
verb: "whoami",
|
|
2532
2537
|
summary: "Show the effective principal and application identity",
|
|
2533
2538
|
inputSchema: EMPTY_INPUT$3,
|
|
2534
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2539
|
+
outputSchema: OBJECT_OUTPUT$i,
|
|
2535
2540
|
resultSchemaVersion: 1,
|
|
2536
2541
|
access: { mode: "fixed", level: "read" },
|
|
2537
2542
|
asyncMode: "sync",
|
|
@@ -2549,7 +2554,7 @@ function createAuthModule() {
|
|
|
2549
2554
|
verb: "session-status",
|
|
2550
2555
|
summary: "Show the in-memory session state without exposing credentials",
|
|
2551
2556
|
inputSchema: EMPTY_INPUT$3,
|
|
2552
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2557
|
+
outputSchema: OBJECT_OUTPUT$i,
|
|
2553
2558
|
resultSchemaVersion: 1,
|
|
2554
2559
|
access: { mode: "fixed", level: "read" },
|
|
2555
2560
|
asyncMode: "sync",
|
|
@@ -2570,7 +2575,7 @@ const EMPTY_INPUT$2 = {
|
|
|
2570
2575
|
properties: {},
|
|
2571
2576
|
additionalProperties: false
|
|
2572
2577
|
};
|
|
2573
|
-
const OBJECT_OUTPUT$
|
|
2578
|
+
const OBJECT_OUTPUT$h = { type: "object", additionalProperties: true };
|
|
2574
2579
|
function createCoreModules(registry) {
|
|
2575
2580
|
return [createCommandModule(registry), createConfigModule(), createCompletionModule(registry)];
|
|
2576
2581
|
}
|
|
@@ -2583,7 +2588,7 @@ function createCommandModule(registry) {
|
|
|
2583
2588
|
verb: "list",
|
|
2584
2589
|
summary: "List registered modules and commands",
|
|
2585
2590
|
inputSchema: EMPTY_INPUT$2,
|
|
2586
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2591
|
+
outputSchema: OBJECT_OUTPUT$h,
|
|
2587
2592
|
resultSchemaVersion: 1,
|
|
2588
2593
|
access: { mode: "fixed", level: "read" },
|
|
2589
2594
|
asyncMode: "sync",
|
|
@@ -2616,7 +2621,7 @@ function createCommandModule(registry) {
|
|
|
2616
2621
|
required: ["target_module", "target_verb"],
|
|
2617
2622
|
additionalProperties: false
|
|
2618
2623
|
},
|
|
2619
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2624
|
+
outputSchema: OBJECT_OUTPUT$h,
|
|
2620
2625
|
resultSchemaVersion: 1,
|
|
2621
2626
|
access: { mode: "fixed", level: "read" },
|
|
2622
2627
|
asyncMode: "sync",
|
|
@@ -2638,7 +2643,7 @@ function createConfigModule() {
|
|
|
2638
2643
|
verb: "list",
|
|
2639
2644
|
summary: "List the global configuration and available profiles",
|
|
2640
2645
|
inputSchema: EMPTY_INPUT$2,
|
|
2641
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2646
|
+
outputSchema: OBJECT_OUTPUT$h,
|
|
2642
2647
|
resultSchemaVersion: 1,
|
|
2643
2648
|
access: { mode: "fixed", level: "read" },
|
|
2644
2649
|
asyncMode: "sync",
|
|
@@ -2669,7 +2674,7 @@ function createConfigModule() {
|
|
|
2669
2674
|
},
|
|
2670
2675
|
additionalProperties: false
|
|
2671
2676
|
},
|
|
2672
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2677
|
+
outputSchema: OBJECT_OUTPUT$h,
|
|
2673
2678
|
resultSchemaVersion: 1,
|
|
2674
2679
|
access: { mode: "fixed", level: "read" },
|
|
2675
2680
|
asyncMode: "sync",
|
|
@@ -2715,7 +2720,7 @@ function createConfigModule() {
|
|
|
2715
2720
|
required: ["key", "value"],
|
|
2716
2721
|
additionalProperties: false
|
|
2717
2722
|
},
|
|
2718
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2723
|
+
outputSchema: OBJECT_OUTPUT$h,
|
|
2719
2724
|
resultSchemaVersion: 1,
|
|
2720
2725
|
access: { mode: "fixed", level: "write" },
|
|
2721
2726
|
asyncMode: "sync",
|
|
@@ -2755,7 +2760,7 @@ function createConfigModule() {
|
|
|
2755
2760
|
required: ["profile_name"],
|
|
2756
2761
|
additionalProperties: false
|
|
2757
2762
|
},
|
|
2758
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2763
|
+
outputSchema: OBJECT_OUTPUT$h,
|
|
2759
2764
|
resultSchemaVersion: 1,
|
|
2760
2765
|
access: { mode: "fixed", level: "write" },
|
|
2761
2766
|
asyncMode: "sync",
|
|
@@ -2787,7 +2792,7 @@ function createConfigModule() {
|
|
|
2787
2792
|
properties: { effective: { type: "boolean" } },
|
|
2788
2793
|
additionalProperties: false
|
|
2789
2794
|
},
|
|
2790
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2795
|
+
outputSchema: OBJECT_OUTPUT$h,
|
|
2791
2796
|
resultSchemaVersion: 1,
|
|
2792
2797
|
access: { mode: "fixed", level: "read" },
|
|
2793
2798
|
asyncMode: "sync",
|
|
@@ -3029,7 +3034,7 @@ async function buckyosInfo(ctx) {
|
|
|
3029
3034
|
);
|
|
3030
3035
|
}
|
|
3031
3036
|
const SERVICE_NAME = "system_config";
|
|
3032
|
-
const OBJECT_OUTPUT$
|
|
3037
|
+
const OBJECT_OUTPUT$g = { type: "object", additionalProperties: false };
|
|
3033
3038
|
const KEY_INPUT = {
|
|
3034
3039
|
type: "object",
|
|
3035
3040
|
properties: { key: { type: "string", minLength: 1 } },
|
|
@@ -3047,7 +3052,7 @@ function createSystemConfigModule() {
|
|
|
3047
3052
|
positionals: [{ name: "key", description: "System-config key" }],
|
|
3048
3053
|
inputSchema: KEY_INPUT,
|
|
3049
3054
|
outputSchema: {
|
|
3050
|
-
...OBJECT_OUTPUT$
|
|
3055
|
+
...OBJECT_OUTPUT$g,
|
|
3051
3056
|
properties: {
|
|
3052
3057
|
key: { type: "string" },
|
|
3053
3058
|
value: { type: "string" },
|
|
@@ -3090,7 +3095,7 @@ function createSystemConfigModule() {
|
|
|
3090
3095
|
additionalProperties: false
|
|
3091
3096
|
},
|
|
3092
3097
|
outputSchema: {
|
|
3093
|
-
...OBJECT_OUTPUT$
|
|
3098
|
+
...OBJECT_OUTPUT$g,
|
|
3094
3099
|
properties: {
|
|
3095
3100
|
key: { type: "string" },
|
|
3096
3101
|
items: { type: "array", items: { type: "string" } }
|
|
@@ -3144,7 +3149,7 @@ function setCommand() {
|
|
|
3144
3149
|
additionalProperties: false
|
|
3145
3150
|
},
|
|
3146
3151
|
outputSchema: {
|
|
3147
|
-
...OBJECT_OUTPUT$
|
|
3152
|
+
...OBJECT_OUTPUT$g,
|
|
3148
3153
|
properties: { key: { type: "string" }, updated: { type: "boolean" } },
|
|
3149
3154
|
required: ["key", "updated"]
|
|
3150
3155
|
},
|
|
@@ -3183,7 +3188,7 @@ function setFileCommand() {
|
|
|
3183
3188
|
additionalProperties: false
|
|
3184
3189
|
},
|
|
3185
3190
|
outputSchema: {
|
|
3186
|
-
...OBJECT_OUTPUT$
|
|
3191
|
+
...OBJECT_OUTPUT$g,
|
|
3187
3192
|
properties: { key: { type: "string" }, updated: { type: "boolean" } },
|
|
3188
3193
|
required: ["key", "updated"]
|
|
3189
3194
|
},
|
|
@@ -3220,7 +3225,7 @@ function mutationCommand(options) {
|
|
|
3220
3225
|
additionalProperties: false
|
|
3221
3226
|
},
|
|
3222
3227
|
outputSchema: {
|
|
3223
|
-
...OBJECT_OUTPUT$
|
|
3228
|
+
...OBJECT_OUTPUT$g,
|
|
3224
3229
|
properties: {
|
|
3225
3230
|
key: { type: "string" },
|
|
3226
3231
|
[options.resultProperty]: { type: "boolean" }
|
|
@@ -6226,7 +6231,7 @@ async function readSkillDirectory(root, limit) {
|
|
|
6226
6231
|
await walk(realRoot, "");
|
|
6227
6232
|
return { files, ignored };
|
|
6228
6233
|
}
|
|
6229
|
-
const PACKAGE_VERSION = "0.7.
|
|
6234
|
+
const PACKAGE_VERSION = "0.7.197";
|
|
6230
6235
|
const TOOL_VERSION = PACKAGE_VERSION;
|
|
6231
6236
|
const SDK_VERSION = PACKAGE_VERSION;
|
|
6232
6237
|
const PROTOCOL_VERSION = "1";
|
|
@@ -6243,7 +6248,7 @@ const VERSION$1 = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
|
6243
6248
|
const SHA256_ID = /^sha256:[0-9a-f]{64}$/;
|
|
6244
6249
|
const OBJECT_ID = /^(?:appdoc|pkg):[0-9a-f]{64}$/;
|
|
6245
6250
|
const SAFE_GENERATED_FILE = /^[A-Za-z0-9._-]+$/;
|
|
6246
|
-
const OBJECT_OUTPUT$
|
|
6251
|
+
const OBJECT_OUTPUT$f = { type: "object", additionalProperties: true };
|
|
6247
6252
|
const APP_KINDS = ["static-web", "script", "docker", "agent-skills", "aiws-controls", "ext-tools"];
|
|
6248
6253
|
const PATH_KINDS = {
|
|
6249
6254
|
"static-web": { key: "web", category: "web", selectorType: "static" },
|
|
@@ -6301,7 +6306,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
6301
6306
|
},
|
|
6302
6307
|
additionalProperties: false
|
|
6303
6308
|
},
|
|
6304
|
-
outputSchema: OBJECT_OUTPUT$
|
|
6309
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
6305
6310
|
resultSchemaVersion: 1,
|
|
6306
6311
|
access: { mode: "fixed", level: "read" },
|
|
6307
6312
|
asyncMode: "sync",
|
|
@@ -6358,7 +6363,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
6358
6363
|
},
|
|
6359
6364
|
additionalProperties: false
|
|
6360
6365
|
},
|
|
6361
|
-
outputSchema: OBJECT_OUTPUT$
|
|
6366
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
6362
6367
|
resultSchemaVersion: 1,
|
|
6363
6368
|
access: { mode: "fixed", level: "write" },
|
|
6364
6369
|
asyncMode: "sync",
|
|
@@ -6386,7 +6391,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
6386
6391
|
properties: { meta_dir: { type: "string", minLength: 1 } },
|
|
6387
6392
|
additionalProperties: false
|
|
6388
6393
|
},
|
|
6389
|
-
outputSchema: OBJECT_OUTPUT$
|
|
6394
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
6390
6395
|
resultSchemaVersion: 1,
|
|
6391
6396
|
access: { mode: "fixed", level: "write" },
|
|
6392
6397
|
asyncMode: "sync",
|
|
@@ -6407,7 +6412,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
6407
6412
|
properties: { dist_dir: { type: "string", minLength: 1 } },
|
|
6408
6413
|
additionalProperties: false
|
|
6409
6414
|
},
|
|
6410
|
-
outputSchema: OBJECT_OUTPUT$
|
|
6415
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
6411
6416
|
resultSchemaVersion: 1,
|
|
6412
6417
|
access: { mode: "fixed", level: "write" },
|
|
6413
6418
|
asyncMode: "sync",
|
|
@@ -6427,7 +6432,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
6427
6432
|
required: ["pikg_path"],
|
|
6428
6433
|
additionalProperties: false
|
|
6429
6434
|
},
|
|
6430
|
-
outputSchema: OBJECT_OUTPUT$
|
|
6435
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
6431
6436
|
resultSchemaVersion: 1,
|
|
6432
6437
|
access: { mode: "fixed", level: "read" },
|
|
6433
6438
|
asyncMode: "sync",
|
|
@@ -6448,7 +6453,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
6448
6453
|
properties: { meta_dir: { type: "string", minLength: 1 } },
|
|
6449
6454
|
additionalProperties: false
|
|
6450
6455
|
},
|
|
6451
|
-
outputSchema: OBJECT_OUTPUT$
|
|
6456
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
6452
6457
|
resultSchemaVersion: 1,
|
|
6453
6458
|
access: { mode: "fixed", level: "destructive" },
|
|
6454
6459
|
asyncMode: "sync",
|
|
@@ -8126,7 +8131,7 @@ const CONTROL_PANEL_SERVICE = "control-panel";
|
|
|
8126
8131
|
const PLAN_SCHEMA_VERSION = 4;
|
|
8127
8132
|
const STAGING_RELEASE_TIMEOUT_MS = 5e3;
|
|
8128
8133
|
const ZIP_LOCAL_MAGIC = [80, 75, 3, 4];
|
|
8129
|
-
const OBJECT_OUTPUT$
|
|
8134
|
+
const OBJECT_OUTPUT$e = { type: "object", additionalProperties: true };
|
|
8130
8135
|
const INSTALL_POLICIES = [
|
|
8131
8136
|
"strict-public",
|
|
8132
8137
|
"normal",
|
|
@@ -8177,7 +8182,7 @@ function cancelCommand$1() {
|
|
|
8177
8182
|
required: ["task_id"],
|
|
8178
8183
|
additionalProperties: false
|
|
8179
8184
|
},
|
|
8180
|
-
outputSchema: OBJECT_OUTPUT$
|
|
8185
|
+
outputSchema: OBJECT_OUTPUT$e,
|
|
8181
8186
|
resultSchemaVersion: 1,
|
|
8182
8187
|
access: { mode: "fixed", level: "write" },
|
|
8183
8188
|
asyncMode: "sync",
|
|
@@ -8212,7 +8217,7 @@ function fetchCommand(dependencies) {
|
|
|
8212
8217
|
target: { type: "object", additionalProperties: true },
|
|
8213
8218
|
install_params: { type: "object", additionalProperties: true }
|
|
8214
8219
|
}),
|
|
8215
|
-
outputSchema: OBJECT_OUTPUT$
|
|
8220
|
+
outputSchema: OBJECT_OUTPUT$e,
|
|
8216
8221
|
resultSchemaVersion: 1,
|
|
8217
8222
|
access: { mode: "fixed", level: "read" },
|
|
8218
8223
|
asyncMode: "sync",
|
|
@@ -8229,7 +8234,7 @@ function listCommand$3() {
|
|
|
8229
8234
|
verb: "list",
|
|
8230
8235
|
summary: "List visible installed Apps",
|
|
8231
8236
|
inputSchema: emptyInputSchema(),
|
|
8232
|
-
outputSchema: OBJECT_OUTPUT$
|
|
8237
|
+
outputSchema: OBJECT_OUTPUT$e,
|
|
8233
8238
|
resultSchemaVersion: 1,
|
|
8234
8239
|
access: { mode: "fixed", level: "read" },
|
|
8235
8240
|
asyncMode: "sync",
|
|
@@ -8287,7 +8292,7 @@ function installCommand$1(dependencies) {
|
|
|
8287
8292
|
no_wait: { type: "boolean" },
|
|
8288
8293
|
policy: { type: "string", enum: [...INSTALL_POLICIES] }
|
|
8289
8294
|
}),
|
|
8290
|
-
outputSchema: OBJECT_OUTPUT$
|
|
8295
|
+
outputSchema: OBJECT_OUTPUT$e,
|
|
8291
8296
|
resultSchemaVersion: 1,
|
|
8292
8297
|
access: { mode: "fixed", level: "write" },
|
|
8293
8298
|
asyncMode: "either",
|
|
@@ -8331,7 +8336,7 @@ function upgradeCommand(dependencies) {
|
|
|
8331
8336
|
},
|
|
8332
8337
|
additionalProperties: false
|
|
8333
8338
|
},
|
|
8334
|
-
outputSchema: OBJECT_OUTPUT$
|
|
8339
|
+
outputSchema: OBJECT_OUTPUT$e,
|
|
8335
8340
|
resultSchemaVersion: 1,
|
|
8336
8341
|
access: { mode: "fixed", level: "write" },
|
|
8337
8342
|
asyncMode: "either",
|
|
@@ -8460,7 +8465,7 @@ function statusCommand$1() {
|
|
|
8460
8465
|
properties: { app_name: { type: "string", minLength: 1 } },
|
|
8461
8466
|
additionalProperties: false
|
|
8462
8467
|
},
|
|
8463
|
-
outputSchema: OBJECT_OUTPUT$
|
|
8468
|
+
outputSchema: OBJECT_OUTPUT$e,
|
|
8464
8469
|
resultSchemaVersion: 1,
|
|
8465
8470
|
access: { mode: "fixed", level: "read" },
|
|
8466
8471
|
asyncMode: "sync",
|
|
@@ -8531,7 +8536,7 @@ function publishCommand() {
|
|
|
8531
8536
|
required: ["local_dir", "app_doc"],
|
|
8532
8537
|
additionalProperties: false
|
|
8533
8538
|
},
|
|
8534
|
-
outputSchema: OBJECT_OUTPUT$
|
|
8539
|
+
outputSchema: OBJECT_OUTPUT$e,
|
|
8535
8540
|
resultSchemaVersion: 1,
|
|
8536
8541
|
access: { mode: "fixed", level: "write" },
|
|
8537
8542
|
asyncMode: "sync",
|
|
@@ -9677,7 +9682,7 @@ function selectorCommand(options) {
|
|
|
9677
9682
|
required: ["app_name"],
|
|
9678
9683
|
additionalProperties: false
|
|
9679
9684
|
},
|
|
9680
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9685
|
+
outputSchema: OBJECT_OUTPUT$e,
|
|
9681
9686
|
resultSchemaVersion: 1,
|
|
9682
9687
|
access: { mode: "fixed", level: options.access },
|
|
9683
9688
|
asyncMode: options.asyncMode,
|
|
@@ -9841,7 +9846,7 @@ function toHex(bytes) {
|
|
|
9841
9846
|
return [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
9842
9847
|
}
|
|
9843
9848
|
const CONTROL_PANEL$4 = "control-panel";
|
|
9844
|
-
const OBJECT_OUTPUT$
|
|
9849
|
+
const OBJECT_OUTPUT$d = { type: "object", additionalProperties: true };
|
|
9845
9850
|
function createDiagnosticModule(dependencies = {}) {
|
|
9846
9851
|
return {
|
|
9847
9852
|
name: "diagnostic",
|
|
@@ -9880,7 +9885,7 @@ function collectCommand() {
|
|
|
9880
9885
|
required: ["services"],
|
|
9881
9886
|
additionalProperties: false
|
|
9882
9887
|
},
|
|
9883
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9888
|
+
outputSchema: OBJECT_OUTPUT$d,
|
|
9884
9889
|
resultSchemaVersion: 1,
|
|
9885
9890
|
access: { mode: "fixed", level: "privileged" },
|
|
9886
9891
|
asyncMode: "task",
|
|
@@ -9934,7 +9939,7 @@ function exportCommand$2(dependencies) {
|
|
|
9934
9939
|
required: ["bundle_id", "path"],
|
|
9935
9940
|
additionalProperties: false
|
|
9936
9941
|
},
|
|
9937
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9942
|
+
outputSchema: OBJECT_OUTPUT$d,
|
|
9938
9943
|
resultSchemaVersion: 1,
|
|
9939
9944
|
access: { mode: "fixed", level: "privileged" },
|
|
9940
9945
|
asyncMode: "sync",
|
|
@@ -9976,7 +9981,7 @@ function compact$2(value) {
|
|
|
9976
9981
|
return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== void 0));
|
|
9977
9982
|
}
|
|
9978
9983
|
const CONTROL_PANEL$3 = "control-panel";
|
|
9979
|
-
const OBJECT_OUTPUT$
|
|
9984
|
+
const OBJECT_OUTPUT$c = { type: "object", additionalProperties: true };
|
|
9980
9985
|
const LOG_LEVELS = ["error", "warning", "info", "debug", "trace"];
|
|
9981
9986
|
function createLogModule(dependencies = {}) {
|
|
9982
9987
|
return {
|
|
@@ -9997,7 +10002,7 @@ function servicesCommand() {
|
|
|
9997
10002
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
9998
10003
|
outputSchema: {
|
|
9999
10004
|
type: "object",
|
|
10000
|
-
properties: { services: { type: "array", items: OBJECT_OUTPUT$
|
|
10005
|
+
properties: { services: { type: "array", items: OBJECT_OUTPUT$c } },
|
|
10001
10006
|
required: ["services"],
|
|
10002
10007
|
additionalProperties: false
|
|
10003
10008
|
},
|
|
@@ -10070,7 +10075,7 @@ function tailCommand(dependencies) {
|
|
|
10070
10075
|
}
|
|
10071
10076
|
],
|
|
10072
10077
|
inputSchema: filterSchema({ from: { type: "string", enum: ["start", "end"] } }),
|
|
10073
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10078
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
10074
10079
|
resultSchemaVersion: 1,
|
|
10075
10080
|
access: { mode: "fixed", level: "read" },
|
|
10076
10081
|
asyncMode: "stream",
|
|
@@ -10126,7 +10131,7 @@ function exportCommand$1(dependencies) {
|
|
|
10126
10131
|
...filterSchema({ path: { type: "string", minLength: 1 } }),
|
|
10127
10132
|
required: ["path"]
|
|
10128
10133
|
},
|
|
10129
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10134
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
10130
10135
|
resultSchemaVersion: 1,
|
|
10131
10136
|
access: { mode: "fixed", level: "read" },
|
|
10132
10137
|
asyncMode: "sync",
|
|
@@ -10278,7 +10283,7 @@ function abortableSleep(milliseconds, signal) {
|
|
|
10278
10283
|
}
|
|
10279
10284
|
const TASK_MANAGER = "task-manager";
|
|
10280
10285
|
const CONTROL_PANEL$2 = "control-panel";
|
|
10281
|
-
const OBJECT_OUTPUT$
|
|
10286
|
+
const OBJECT_OUTPUT$b = { type: "object", additionalProperties: true };
|
|
10282
10287
|
function createTaskModule() {
|
|
10283
10288
|
return {
|
|
10284
10289
|
name: "task",
|
|
@@ -10381,7 +10386,7 @@ function getCommand$2() {
|
|
|
10381
10386
|
required: ["task_id"],
|
|
10382
10387
|
additionalProperties: false
|
|
10383
10388
|
},
|
|
10384
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10389
|
+
outputSchema: OBJECT_OUTPUT$b,
|
|
10385
10390
|
resultSchemaVersion: 1,
|
|
10386
10391
|
access: { mode: "fixed", level: "read" },
|
|
10387
10392
|
asyncMode: "sync",
|
|
@@ -10422,7 +10427,7 @@ function waitCommand() {
|
|
|
10422
10427
|
summary: "Stream changes until a Task becomes terminal",
|
|
10423
10428
|
positionals: [{ name: "task_id", description: "Opaque Task ID", required: true }],
|
|
10424
10429
|
inputSchema: taskIdSchema(),
|
|
10425
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10430
|
+
outputSchema: OBJECT_OUTPUT$b,
|
|
10426
10431
|
resultSchemaVersion: 1,
|
|
10427
10432
|
access: { mode: "fixed", level: "read" },
|
|
10428
10433
|
asyncMode: "stream",
|
|
@@ -10473,7 +10478,7 @@ function cancelCommand() {
|
|
|
10473
10478
|
required: ["task_id"],
|
|
10474
10479
|
additionalProperties: false
|
|
10475
10480
|
},
|
|
10476
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10481
|
+
outputSchema: OBJECT_OUTPUT$b,
|
|
10477
10482
|
resultSchemaVersion: 1,
|
|
10478
10483
|
access: { mode: "fixed", level: "write" },
|
|
10479
10484
|
asyncMode: "sync",
|
|
@@ -10516,7 +10521,7 @@ function retryCommand() {
|
|
|
10516
10521
|
required: ["task_id"],
|
|
10517
10522
|
additionalProperties: false
|
|
10518
10523
|
},
|
|
10519
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10524
|
+
outputSchema: OBJECT_OUTPUT$b,
|
|
10520
10525
|
resultSchemaVersion: 1,
|
|
10521
10526
|
access: { mode: "fixed", level: "write" },
|
|
10522
10527
|
asyncMode: "either",
|
|
@@ -10590,7 +10595,7 @@ function invalidResponse$1(label) {
|
|
|
10590
10595
|
throw new ToolError("INVALID_SERVICE_RESPONSE", `${label} is invalid`, EXIT_INTERNAL);
|
|
10591
10596
|
}
|
|
10592
10597
|
const sdk = provisionSdk;
|
|
10593
|
-
const OBJECT_OUTPUT$
|
|
10598
|
+
const OBJECT_OUTPUT$a = { type: "object", additionalProperties: true };
|
|
10594
10599
|
const ROOT_OPTION = {
|
|
10595
10600
|
name: "root",
|
|
10596
10601
|
description: "Installed BuckyOS root on this machine (BUCKYOS_ROOT); read by status/check, written by activate",
|
|
@@ -10674,7 +10679,7 @@ function statusCommand(deps) {
|
|
|
10674
10679
|
additionalProperties: false
|
|
10675
10680
|
},
|
|
10676
10681
|
outputSchema: {
|
|
10677
|
-
...OBJECT_OUTPUT$
|
|
10682
|
+
...OBJECT_OUTPUT$a,
|
|
10678
10683
|
properties: {
|
|
10679
10684
|
root: { type: "string" },
|
|
10680
10685
|
state: {
|
|
@@ -10712,7 +10717,7 @@ function checkCommand(deps) {
|
|
|
10712
10717
|
additionalProperties: false
|
|
10713
10718
|
},
|
|
10714
10719
|
outputSchema: {
|
|
10715
|
-
...OBJECT_OUTPUT$
|
|
10720
|
+
...OBJECT_OUTPUT$a,
|
|
10716
10721
|
properties: {
|
|
10717
10722
|
ready: { type: "boolean" },
|
|
10718
10723
|
root: { type: "string" },
|
|
@@ -10760,7 +10765,7 @@ function activateCommand(deps) {
|
|
|
10760
10765
|
additionalProperties: false
|
|
10761
10766
|
},
|
|
10762
10767
|
outputSchema: {
|
|
10763
|
-
...OBJECT_OUTPUT$
|
|
10768
|
+
...OBJECT_OUTPUT$a,
|
|
10764
10769
|
properties: {
|
|
10765
10770
|
root: { type: "string" },
|
|
10766
10771
|
state: { type: "string", enum: ["configured"] },
|
|
@@ -10909,9 +10914,9 @@ async function confirmActivation(ctx, precheck) {
|
|
|
10909
10914
|
function isSdkError(error) {
|
|
10910
10915
|
return error instanceof Error && error.name === "ActivationError" && typeof error.code === "string";
|
|
10911
10916
|
}
|
|
10912
|
-
async function runSdk(
|
|
10917
|
+
async function runSdk(run) {
|
|
10913
10918
|
try {
|
|
10914
|
-
return await
|
|
10919
|
+
return await run();
|
|
10915
10920
|
} catch (error) {
|
|
10916
10921
|
if (isSdkError(error)) {
|
|
10917
10922
|
const exitCode = error.code === "INVALID_ARGUMENT" ? EXIT_USAGE : error.code === "ACTIVATION_COMMIT_FAILED" ? EXIT_PARTIAL : EXIT_OPERATION;
|
|
@@ -11042,7 +11047,7 @@ function inputFingerprint(input) {
|
|
|
11042
11047
|
hash.update(new TextEncoder().encode(JSON.stringify(material)));
|
|
11043
11048
|
return hash.digestHex();
|
|
11044
11049
|
}
|
|
11045
|
-
const OBJECT_OUTPUT$
|
|
11050
|
+
const OBJECT_OUTPUT$9 = { type: "object", additionalProperties: true };
|
|
11046
11051
|
const SKILLS_SUB_PKG = "agent_skills";
|
|
11047
11052
|
const SKILL_SCOPES = ["ui", "work"];
|
|
11048
11053
|
const IMPORT_SCOPES = ["work", "ui", "plan"];
|
|
@@ -11082,7 +11087,7 @@ function command$1(definition) {
|
|
|
11082
11087
|
required: ["agent_id", ...required ?? []],
|
|
11083
11088
|
additionalProperties: false
|
|
11084
11089
|
},
|
|
11085
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11090
|
+
outputSchema: OBJECT_OUTPUT$9,
|
|
11086
11091
|
resultSchemaVersion: 1,
|
|
11087
11092
|
access: { mode: "fixed", level },
|
|
11088
11093
|
asyncMode: "sync",
|
|
@@ -11695,8 +11700,8 @@ function base64(bytes) {
|
|
|
11695
11700
|
return btoa(binary);
|
|
11696
11701
|
}
|
|
11697
11702
|
const CONTROL_PANEL$1 = "control-panel";
|
|
11698
|
-
const OBJECT_OUTPUT$
|
|
11699
|
-
const ID$
|
|
11703
|
+
const OBJECT_OUTPUT$8 = { type: "object", additionalProperties: true };
|
|
11704
|
+
const ID$1 = { type: "string", minLength: 1 };
|
|
11700
11705
|
const DEVICE_PREFIX = "exec-";
|
|
11701
11706
|
const AGENT_RUNTIME_ACTIONS = ["list", "enable", "disable", "default"];
|
|
11702
11707
|
const AGENT_OPTION = {
|
|
@@ -11870,7 +11875,7 @@ function command(definition) {
|
|
|
11870
11875
|
const { level, properties, required, ...rest } = definition;
|
|
11871
11876
|
return {
|
|
11872
11877
|
inputSchema: { type: "object", properties, required: required ?? [], additionalProperties: false },
|
|
11873
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11878
|
+
outputSchema: OBJECT_OUTPUT$8,
|
|
11874
11879
|
resultSchemaVersion: 1,
|
|
11875
11880
|
access: { mode: "fixed", level },
|
|
11876
11881
|
asyncMode: "sync",
|
|
@@ -11902,7 +11907,7 @@ function createRuntimeModule() {
|
|
|
11902
11907
|
positionals: [{ name: "runtime_id", description: "Runtime id as `runtime list` prints it" }],
|
|
11903
11908
|
options: [AGENT_OPTION, { name: "disabled", description: "Assign it switched off", type: "boolean" }],
|
|
11904
11909
|
level: "write",
|
|
11905
|
-
properties: { runtime_id: ID$
|
|
11910
|
+
properties: { runtime_id: ID$1, agent_id: ID$1, disabled: { type: "boolean" } },
|
|
11906
11911
|
required: ["runtime_id", "agent_id"],
|
|
11907
11912
|
examples: [
|
|
11908
11913
|
"buckyos runtime assign host --agent jarvis.example.zone",
|
|
@@ -11917,7 +11922,7 @@ function createRuntimeModule() {
|
|
|
11917
11922
|
positionals: [{ name: "runtime_id", description: "Runtime id" }],
|
|
11918
11923
|
options: [AGENT_OPTION],
|
|
11919
11924
|
level: "destructive",
|
|
11920
|
-
properties: { runtime_id: ID$
|
|
11925
|
+
properties: { runtime_id: ID$1, agent_id: ID$1 },
|
|
11921
11926
|
required: ["runtime_id", "agent_id"],
|
|
11922
11927
|
examples: ["buckyos runtime unassign host --agent jarvis.example.zone"],
|
|
11923
11928
|
handler: async (ctx, input) => await unassign(ctx, input)
|
|
@@ -11928,7 +11933,7 @@ function createRuntimeModule() {
|
|
|
11928
11933
|
description: "Devices only (exec-<executor_id>, or the executor id). Refused while sessions of the Agent using it run there (SESSIONS_IN_PROGRESS); otherwise shows the Agents the device is assigned to and asks; --yes skips the question.",
|
|
11929
11934
|
positionals: [{ name: "runtime_id", description: "Device runtime id (exec-<executor_id>) or executor id" }],
|
|
11930
11935
|
level: "destructive",
|
|
11931
|
-
properties: { runtime_id: ID$
|
|
11936
|
+
properties: { runtime_id: ID$1 },
|
|
11932
11937
|
required: ["runtime_id"],
|
|
11933
11938
|
examples: ["buckyos runtime revoke exec-laptop", "buckyos --yes runtime revoke laptop"],
|
|
11934
11939
|
handler: async (ctx, input) => await revoke(ctx, input)
|
|
@@ -11948,11 +11953,11 @@ function agentRuntimeCommand() {
|
|
|
11948
11953
|
options: [AGENT_OPTION],
|
|
11949
11954
|
inputSchema: {
|
|
11950
11955
|
type: "object",
|
|
11951
|
-
properties: { action: { type: "string", enum: AGENT_RUNTIME_ACTIONS }, runtime_id: ID$
|
|
11956
|
+
properties: { action: { type: "string", enum: AGENT_RUNTIME_ACTIONS }, runtime_id: ID$1, agent_id: ID$1 },
|
|
11952
11957
|
required: ["action", "agent_id"],
|
|
11953
11958
|
additionalProperties: false
|
|
11954
11959
|
},
|
|
11955
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11960
|
+
outputSchema: OBJECT_OUTPUT$8,
|
|
11956
11961
|
resultSchemaVersion: 1,
|
|
11957
11962
|
access: { mode: "operation", operationIdField: "action", possibleLevels: ["read", "write"] },
|
|
11958
11963
|
asyncMode: "sync",
|
|
@@ -12141,7 +12146,7 @@ async function revoke(ctx, input) {
|
|
|
12141
12146
|
return { runtime_id: device.runtime_id, executor_id: device.executor_id, revoked: true, assigned_to: assigned, impacts, ...revoked };
|
|
12142
12147
|
}
|
|
12143
12148
|
const CONTROL_PANEL = "control-panel";
|
|
12144
|
-
const OBJECT_OUTPUT$
|
|
12149
|
+
const OBJECT_OUTPUT$7 = { type: "object", additionalProperties: true };
|
|
12145
12150
|
const AGENT_POSITIONAL = {
|
|
12146
12151
|
name: "agent_id",
|
|
12147
12152
|
description: "Agent ID as `agent list` prints it (raw host name, e.g. jarvis.example.zone)"
|
|
@@ -12165,7 +12170,7 @@ function createAgentModule() {
|
|
|
12165
12170
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
12166
12171
|
outputSchema: {
|
|
12167
12172
|
type: "object",
|
|
12168
|
-
properties: { agents: { type: "array", items: OBJECT_OUTPUT$
|
|
12173
|
+
properties: { agents: { type: "array", items: OBJECT_OUTPUT$7 } },
|
|
12169
12174
|
required: ["agents"],
|
|
12170
12175
|
additionalProperties: false
|
|
12171
12176
|
},
|
|
@@ -12191,7 +12196,7 @@ function createAgentModule() {
|
|
|
12191
12196
|
summary: "Get one Agent: profile, settings, install state, template, and runtime",
|
|
12192
12197
|
positionals: [AGENT_POSITIONAL],
|
|
12193
12198
|
inputSchema: AGENT_INPUT,
|
|
12194
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12199
|
+
outputSchema: OBJECT_OUTPUT$7,
|
|
12195
12200
|
resultSchemaVersion: 1,
|
|
12196
12201
|
access: { mode: "fixed", level: "read" },
|
|
12197
12202
|
asyncMode: "sync",
|
|
@@ -12204,7 +12209,7 @@ function createAgentModule() {
|
|
|
12204
12209
|
summary: "Get the public profile (display name, bio, avatar) of an Agent",
|
|
12205
12210
|
positionals: [AGENT_POSITIONAL],
|
|
12206
12211
|
inputSchema: AGENT_INPUT,
|
|
12207
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12212
|
+
outputSchema: OBJECT_OUTPUT$7,
|
|
12208
12213
|
resultSchemaVersion: 1,
|
|
12209
12214
|
access: { mode: "fixed", level: "read" },
|
|
12210
12215
|
asyncMode: "sync",
|
|
@@ -12245,8 +12250,8 @@ function createAgentModule() {
|
|
|
12245
12250
|
type: "object",
|
|
12246
12251
|
properties: {
|
|
12247
12252
|
agent_id: { type: "string" },
|
|
12248
|
-
before: OBJECT_OUTPUT$
|
|
12249
|
-
profile: OBJECT_OUTPUT$
|
|
12253
|
+
before: OBJECT_OUTPUT$7,
|
|
12254
|
+
profile: OBJECT_OUTPUT$7
|
|
12250
12255
|
},
|
|
12251
12256
|
required: ["agent_id", "before", "profile"],
|
|
12252
12257
|
additionalProperties: false
|
|
@@ -12292,7 +12297,7 @@ async function callAgent(ctx, method, params) {
|
|
|
12292
12297
|
}
|
|
12293
12298
|
}
|
|
12294
12299
|
const AICC = "aicc";
|
|
12295
|
-
const OBJECT_OUTPUT$
|
|
12300
|
+
const OBJECT_OUTPUT$6 = { type: "object", additionalProperties: true };
|
|
12296
12301
|
const EMPTY_INPUT = { type: "object", properties: {}, additionalProperties: false };
|
|
12297
12302
|
const RANGES = ["last1d", "last7d", "last30d"];
|
|
12298
12303
|
const GROUPS = [
|
|
@@ -12340,7 +12345,7 @@ function quotaCommand() {
|
|
|
12340
12345
|
properties: { app: { type: "string", minLength: 1 } },
|
|
12341
12346
|
additionalProperties: false
|
|
12342
12347
|
},
|
|
12343
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12348
|
+
outputSchema: OBJECT_OUTPUT$6,
|
|
12344
12349
|
resultSchemaVersion: 1,
|
|
12345
12350
|
access: { mode: "fixed", level: "read" },
|
|
12346
12351
|
asyncMode: "sync",
|
|
@@ -12358,7 +12363,7 @@ function readCommand$2(options) {
|
|
|
12358
12363
|
summary: options.summary,
|
|
12359
12364
|
description: options.description,
|
|
12360
12365
|
inputSchema: EMPTY_INPUT,
|
|
12361
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12366
|
+
outputSchema: OBJECT_OUTPUT$6,
|
|
12362
12367
|
resultSchemaVersion: 1,
|
|
12363
12368
|
access: { mode: "fixed", level: "read" },
|
|
12364
12369
|
asyncMode: "sync",
|
|
@@ -12410,7 +12415,7 @@ function usageCommand() {
|
|
|
12410
12415
|
},
|
|
12411
12416
|
additionalProperties: false
|
|
12412
12417
|
},
|
|
12413
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12418
|
+
outputSchema: OBJECT_OUTPUT$6,
|
|
12414
12419
|
resultSchemaVersion: 1,
|
|
12415
12420
|
access: { mode: "fixed", level: "read" },
|
|
12416
12421
|
asyncMode: "sync",
|
|
@@ -12455,7 +12460,7 @@ function timeRange(input) {
|
|
|
12455
12460
|
}
|
|
12456
12461
|
return { kind: "explicit", start_time_ms: since, end_time_ms: until ?? Date.now() };
|
|
12457
12462
|
}
|
|
12458
|
-
const OBJECT_OUTPUT$
|
|
12463
|
+
const OBJECT_OUTPUT$5 = { type: "object", additionalProperties: true };
|
|
12459
12464
|
const DAY_MS$1 = 864e5;
|
|
12460
12465
|
const EXPIRES_HELP = "1d, 7d (default), 30d, none, or an RFC 3339 time";
|
|
12461
12466
|
function createShareModule() {
|
|
@@ -12566,7 +12571,7 @@ function createCommand() {
|
|
|
12566
12571
|
required: ["path"],
|
|
12567
12572
|
additionalProperties: false
|
|
12568
12573
|
},
|
|
12569
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12574
|
+
outputSchema: OBJECT_OUTPUT$5,
|
|
12570
12575
|
resultSchemaVersion: 1,
|
|
12571
12576
|
access: { mode: "fixed", level: "write" },
|
|
12572
12577
|
asyncMode: "either",
|
|
@@ -12635,7 +12640,7 @@ function listCommand() {
|
|
|
12635
12640
|
},
|
|
12636
12641
|
additionalProperties: false
|
|
12637
12642
|
},
|
|
12638
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12643
|
+
outputSchema: OBJECT_OUTPUT$5,
|
|
12639
12644
|
resultSchemaVersion: 1,
|
|
12640
12645
|
access: { mode: "fixed", level: "read" },
|
|
12641
12646
|
asyncMode: "sync",
|
|
@@ -12667,7 +12672,7 @@ function getCommand$1() {
|
|
|
12667
12672
|
required: ["share_id"],
|
|
12668
12673
|
additionalProperties: false
|
|
12669
12674
|
},
|
|
12670
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12675
|
+
outputSchema: OBJECT_OUTPUT$5,
|
|
12671
12676
|
resultSchemaVersion: 1,
|
|
12672
12677
|
access: { mode: "fixed", level: "read" },
|
|
12673
12678
|
asyncMode: "sync",
|
|
@@ -12704,7 +12709,7 @@ function updateCommand() {
|
|
|
12704
12709
|
required: ["share_id"],
|
|
12705
12710
|
additionalProperties: false
|
|
12706
12711
|
},
|
|
12707
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12712
|
+
outputSchema: OBJECT_OUTPUT$5,
|
|
12708
12713
|
resultSchemaVersion: 1,
|
|
12709
12714
|
access: { mode: "fixed", level: "write" },
|
|
12710
12715
|
asyncMode: "sync",
|
|
@@ -12748,7 +12753,7 @@ function stopCommand() {
|
|
|
12748
12753
|
required: ["share_id"],
|
|
12749
12754
|
additionalProperties: false
|
|
12750
12755
|
},
|
|
12751
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12756
|
+
outputSchema: OBJECT_OUTPUT$5,
|
|
12752
12757
|
resultSchemaVersion: 1,
|
|
12753
12758
|
access: { mode: "fixed", level: "destructive" },
|
|
12754
12759
|
asyncMode: "sync",
|
|
@@ -12780,7 +12785,7 @@ function statsCommand() {
|
|
|
12780
12785
|
},
|
|
12781
12786
|
additionalProperties: false
|
|
12782
12787
|
},
|
|
12783
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12788
|
+
outputSchema: OBJECT_OUTPUT$5,
|
|
12784
12789
|
resultSchemaVersion: 1,
|
|
12785
12790
|
access: { mode: "fixed", level: "read" },
|
|
12786
12791
|
asyncMode: "sync",
|
|
@@ -12799,7 +12804,7 @@ function statsCommand() {
|
|
|
12799
12804
|
}
|
|
12800
12805
|
};
|
|
12801
12806
|
}
|
|
12802
|
-
const OBJECT_OUTPUT$
|
|
12807
|
+
const OBJECT_OUTPUT$4 = { type: "object", additionalProperties: true };
|
|
12803
12808
|
const SERVICE$2 = "nfs-server";
|
|
12804
12809
|
const MAX_PUT_BYTES = 32 * 1024 * 1024;
|
|
12805
12810
|
const DAY_MS = 864e5;
|
|
@@ -12904,7 +12909,7 @@ function lsCommand$1() {
|
|
|
12904
12909
|
},
|
|
12905
12910
|
additionalProperties: false
|
|
12906
12911
|
},
|
|
12907
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12912
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
12908
12913
|
resultSchemaVersion: 1,
|
|
12909
12914
|
access: { mode: "fixed", level: "read" },
|
|
12910
12915
|
asyncMode: "sync",
|
|
@@ -12937,7 +12942,7 @@ function statCommand$1() {
|
|
|
12937
12942
|
required: ["target"],
|
|
12938
12943
|
additionalProperties: false
|
|
12939
12944
|
},
|
|
12940
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12945
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
12941
12946
|
resultSchemaVersion: 1,
|
|
12942
12947
|
access: { mode: "fixed", level: "read" },
|
|
12943
12948
|
asyncMode: "sync",
|
|
@@ -12978,7 +12983,7 @@ function putCommand() {
|
|
|
12978
12983
|
required: ["target", "file"],
|
|
12979
12984
|
additionalProperties: false
|
|
12980
12985
|
},
|
|
12981
|
-
outputSchema: OBJECT_OUTPUT$
|
|
12986
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
12982
12987
|
resultSchemaVersion: 1,
|
|
12983
12988
|
access: { mode: "fixed", level: "write" },
|
|
12984
12989
|
asyncMode: "sync",
|
|
@@ -13027,7 +13032,7 @@ function getCommand() {
|
|
|
13027
13032
|
required: ["target", "output"],
|
|
13028
13033
|
additionalProperties: false
|
|
13029
13034
|
},
|
|
13030
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13035
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
13031
13036
|
resultSchemaVersion: 1,
|
|
13032
13037
|
access: { mode: "fixed", level: "read" },
|
|
13033
13038
|
asyncMode: "sync",
|
|
@@ -13065,7 +13070,7 @@ function rmCommand() {
|
|
|
13065
13070
|
required: ["target"],
|
|
13066
13071
|
additionalProperties: false
|
|
13067
13072
|
},
|
|
13068
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13073
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
13069
13074
|
resultSchemaVersion: 1,
|
|
13070
13075
|
access: { mode: "fixed", level: "write" },
|
|
13071
13076
|
asyncMode: "sync",
|
|
@@ -13096,7 +13101,7 @@ function linkCommand() {
|
|
|
13096
13101
|
required: ["target"],
|
|
13097
13102
|
additionalProperties: false
|
|
13098
13103
|
},
|
|
13099
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13104
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
13100
13105
|
resultSchemaVersion: 1,
|
|
13101
13106
|
access: { mode: "fixed", level: "write" },
|
|
13102
13107
|
asyncMode: "sync",
|
|
@@ -13125,7 +13130,7 @@ function s3KeysCommand() {
|
|
|
13125
13130
|
verb: "s3-keys",
|
|
13126
13131
|
summary: "List your S3 access keys (secrets are shown only when created)",
|
|
13127
13132
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
13128
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13133
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
13129
13134
|
resultSchemaVersion: 1,
|
|
13130
13135
|
access: { mode: "fixed", level: "read" },
|
|
13131
13136
|
asyncMode: "sync",
|
|
@@ -13149,7 +13154,7 @@ function s3KeyCreateCommand() {
|
|
|
13149
13154
|
required: ["app"],
|
|
13150
13155
|
additionalProperties: false
|
|
13151
13156
|
},
|
|
13152
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13157
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
13153
13158
|
resultSchemaVersion: 1,
|
|
13154
13159
|
access: { mode: "fixed", level: "write" },
|
|
13155
13160
|
asyncMode: "sync",
|
|
@@ -13180,7 +13185,7 @@ function s3KeyRevokeCommand() {
|
|
|
13180
13185
|
required: ["access_key_id"],
|
|
13181
13186
|
additionalProperties: false
|
|
13182
13187
|
},
|
|
13183
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13188
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
13184
13189
|
resultSchemaVersion: 1,
|
|
13185
13190
|
access: { mode: "fixed", level: "write" },
|
|
13186
13191
|
asyncMode: "sync",
|
|
@@ -13189,13 +13194,13 @@ function s3KeyRevokeCommand() {
|
|
|
13189
13194
|
handler: async (ctx, input) => await call$3(ctx, "bucket.revoke_s3_key", { access_key_id: requiredInputString(input, "access_key_id") })
|
|
13190
13195
|
};
|
|
13191
13196
|
}
|
|
13192
|
-
const OBJECT_OUTPUT$
|
|
13197
|
+
const OBJECT_OUTPUT$3 = { type: "object", additionalProperties: true };
|
|
13193
13198
|
const URL_ARG = { name: "url", description: "obj:// cyfs:// file:// https:// url, or //<service>/... /abs/path shorthand", required: true };
|
|
13194
13199
|
function createObjModule() {
|
|
13195
13200
|
return {
|
|
13196
13201
|
name: "obj",
|
|
13197
13202
|
summary: "Resolve system URLs and read DID Objects (obj://, cyfs://, file://, https://)",
|
|
13198
|
-
commands: [resolveCommand$1(), readCommand$1()]
|
|
13203
|
+
commands: [resolveCommand$1(), readCommand$1(), aliasCommand(), callCommand()]
|
|
13199
13204
|
};
|
|
13200
13205
|
}
|
|
13201
13206
|
function gatewayOrigin(endpoint) {
|
|
@@ -13240,7 +13245,7 @@ function resolveCommand$1() {
|
|
|
13240
13245
|
summary: "Normalize a URL and show its identity, RBAC key, events and endpoint (no access check)",
|
|
13241
13246
|
positionals: [URL_ARG],
|
|
13242
13247
|
inputSchema: { type: "object", properties: { url: { type: "string", minLength: 1 } }, required: ["url"], additionalProperties: false },
|
|
13243
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13248
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
13244
13249
|
resultSchemaVersion: 1,
|
|
13245
13250
|
access: { mode: "fixed", level: "read" },
|
|
13246
13251
|
asyncMode: "sync",
|
|
@@ -13251,7 +13256,7 @@ function resolveCommand$1() {
|
|
|
13251
13256
|
}
|
|
13252
13257
|
async function getJson(ctx, url) {
|
|
13253
13258
|
const headers = { accept: "application/json" };
|
|
13254
|
-
if (ctx.session)
|
|
13259
|
+
if (ctx.session && new URL(url).origin === new URL(ctx.connection.endpoint).origin)
|
|
13255
13260
|
headers.authorization = `Bearer ${(await ctx.session.ensureValid()).token}`;
|
|
13256
13261
|
const response = await fetch(url, { headers, signal: ctx.signal });
|
|
13257
13262
|
const text2 = await response.text();
|
|
@@ -13277,7 +13282,7 @@ function readCommand$1() {
|
|
|
13277
13282
|
required: ["url"],
|
|
13278
13283
|
additionalProperties: false
|
|
13279
13284
|
},
|
|
13280
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13285
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
13281
13286
|
resultSchemaVersion: 1,
|
|
13282
13287
|
access: { mode: "fixed", level: "read" },
|
|
13283
13288
|
asyncMode: "sync",
|
|
@@ -13320,6 +13325,90 @@ function readCommand$1() {
|
|
|
13320
13325
|
}
|
|
13321
13326
|
};
|
|
13322
13327
|
}
|
|
13328
|
+
function aliasCommand() {
|
|
13329
|
+
const names = ["list", "set", "rm"];
|
|
13330
|
+
return {
|
|
13331
|
+
verb: "alias",
|
|
13332
|
+
summary: "List, override or reset object aliases in your current Zone",
|
|
13333
|
+
positionals: [{ name: "action", description: "list | set | rm", required: true }, { name: "name", description: "Complete alias name (set, rm)", required: false }],
|
|
13334
|
+
options: [
|
|
13335
|
+
{ name: "kind", description: "local | link | disabled", type: "string", enum: ["local", "link", "disabled"] },
|
|
13336
|
+
{ name: "object", description: "Installed object ID for a local binding", type: "string" },
|
|
13337
|
+
{ name: "url", description: "Fixed Object URL for a link", type: "string" },
|
|
13338
|
+
{ name: "if-revision", property: "if_revision", description: "Expected override revision (0 if never configured)", type: "integer" }
|
|
13339
|
+
],
|
|
13340
|
+
inputSchema: { type: "object", properties: {
|
|
13341
|
+
action: { type: "string", enum: names },
|
|
13342
|
+
name: { type: "string" },
|
|
13343
|
+
kind: { type: "string" },
|
|
13344
|
+
object: { type: "string" },
|
|
13345
|
+
url: { type: "string" },
|
|
13346
|
+
if_revision: { type: "integer", minimum: 0 }
|
|
13347
|
+
}, required: ["action"], additionalProperties: false },
|
|
13348
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
13349
|
+
resultSchemaVersion: 1,
|
|
13350
|
+
access: { mode: "operation", operationIdField: "action", possibleLevels: ["read", "write"] },
|
|
13351
|
+
asyncMode: "sync",
|
|
13352
|
+
requiresSession: true,
|
|
13353
|
+
examples: ["buckyos obj alias list", "buckyos obj alias set owner.cal --kind link --url obj://cal/calendars/alice --if-revision 0", "buckyos obj alias rm owner.cal --if-revision 1"],
|
|
13354
|
+
handler: async (ctx, input) => {
|
|
13355
|
+
const { action, ...params } = input;
|
|
13356
|
+
if (!names.includes(String(action)))
|
|
13357
|
+
throw new UsageError("INVALID_ARGUMENT", "expected list, set or rm");
|
|
13358
|
+
if (action === "list" && Object.keys(params).length)
|
|
13359
|
+
throw new UsageError("INVALID_ARGUMENT", "list takes no arguments");
|
|
13360
|
+
if (action !== "list" && (!params.name || !Number.isSafeInteger(params.if_revision)))
|
|
13361
|
+
throw new UsageError("INVALID_ARGUMENT", "name and --if-revision are required");
|
|
13362
|
+
if (action === "set" && !params.kind)
|
|
13363
|
+
throw new UsageError("INVALID_ARGUMENT", "set requires --kind");
|
|
13364
|
+
const result = expectObject$4(await callService(ctx, "control-panel", "owner.alias." + action, params), "owner.alias." + action);
|
|
13365
|
+
if (result.ok === false) {
|
|
13366
|
+
const e = expectObject$4(result.error, "alias error");
|
|
13367
|
+
throw new ToolError(String(e.code), String(e.message), void 0, false, { detail: e.detail });
|
|
13368
|
+
}
|
|
13369
|
+
return result;
|
|
13370
|
+
}
|
|
13371
|
+
};
|
|
13372
|
+
}
|
|
13373
|
+
function callCommand() {
|
|
13374
|
+
return {
|
|
13375
|
+
verb: "call",
|
|
13376
|
+
summary: "Invoke xcall with your current Zone session",
|
|
13377
|
+
description: "Pass the object, action and xcall arguments verbatim. The installed agent_tool handles profiles, permissions, output and exit status.",
|
|
13378
|
+
examples: ["buckyos obj call owner who", "buckyos obj call owner.todo add title=Review"],
|
|
13379
|
+
inputSchema: { type: "object", properties: { argv: { type: "array", items: { type: "string" } } }, required: ["argv"] },
|
|
13380
|
+
outputSchema: { type: "object", properties: { exit_code: { type: "integer" } }, required: ["exit_code"] },
|
|
13381
|
+
resultSchemaVersion: 1,
|
|
13382
|
+
access: { mode: "fixed", level: "write" },
|
|
13383
|
+
asyncMode: "sync",
|
|
13384
|
+
requiresSession: true,
|
|
13385
|
+
handler: async (ctx, input) => {
|
|
13386
|
+
const host2 = getHost();
|
|
13387
|
+
const root = host2.policy.buckyosRoot;
|
|
13388
|
+
if (!root || host2.policy.distribution !== "system")
|
|
13389
|
+
throw new ToolError("EXTENSION_UNAVAILABLE", "xcall requires the BuckyOS system installation");
|
|
13390
|
+
if (!ctx.session)
|
|
13391
|
+
throw new ToolError("AUTH_REQUIRED", "xcall requires a signed-in Zone session");
|
|
13392
|
+
const { token } = await ctx.session.ensureValid();
|
|
13393
|
+
const exe = host2.path.join(root, "bin", "opendan", host2.platform === "win32" || host2.platform === "windows" ? "agent_tool.exe" : "agent_tool");
|
|
13394
|
+
const env = { BUCKYOS_ROOT: root, BUCKYOS_TOOL_ENDPOINT: ctx.connection.endpoint, BUCKYOS_APPCLIENT_SESSION_TOKEN: token };
|
|
13395
|
+
const child = host2.spawn(exe, ["xcall", ...input.argv], { cwd: ctx.cwd, env });
|
|
13396
|
+
const cancel = () => child.kill();
|
|
13397
|
+
ctx.signal.addEventListener("abort", cancel, { once: true });
|
|
13398
|
+
try {
|
|
13399
|
+
await child.closeInput();
|
|
13400
|
+
for await (const line of child.lines())
|
|
13401
|
+
await ctx.io.stdout(line + "\n");
|
|
13402
|
+
const stderr = await child.stderr;
|
|
13403
|
+
if (stderr)
|
|
13404
|
+
await ctx.io.stderr(stderr);
|
|
13405
|
+
return { exit_code: await child.status };
|
|
13406
|
+
} finally {
|
|
13407
|
+
ctx.signal.removeEventListener("abort", cancel);
|
|
13408
|
+
}
|
|
13409
|
+
}
|
|
13410
|
+
};
|
|
13411
|
+
}
|
|
13323
13412
|
const text = { type: "string", minLength: 1 };
|
|
13324
13413
|
const object = { type: "object", additionalProperties: true };
|
|
13325
13414
|
const targetProperties = {
|
|
@@ -13437,8 +13526,8 @@ function operation(verb, extra, required) {
|
|
|
13437
13526
|
}
|
|
13438
13527
|
};
|
|
13439
13528
|
}
|
|
13440
|
-
const OBJECT_OUTPUT$
|
|
13441
|
-
const ID
|
|
13529
|
+
const OBJECT_OUTPUT$2 = { type: "object", additionalProperties: true };
|
|
13530
|
+
const ID = { type: "string", minLength: 1 };
|
|
13442
13531
|
function call$1(ctx, method, params) {
|
|
13443
13532
|
return ctx.clients.call("control-panel", method, params, {
|
|
13444
13533
|
traceId: ctx.traceId,
|
|
@@ -13457,7 +13546,7 @@ function read(verb, summary2, method) {
|
|
|
13457
13546
|
verb,
|
|
13458
13547
|
summary: summary2,
|
|
13459
13548
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
13460
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13549
|
+
outputSchema: OBJECT_OUTPUT$2,
|
|
13461
13550
|
resultSchemaVersion: 1,
|
|
13462
13551
|
access: { mode: "fixed", level: "read" },
|
|
13463
13552
|
asyncMode: "sync",
|
|
@@ -13466,7 +13555,7 @@ function read(verb, summary2, method) {
|
|
|
13466
13555
|
};
|
|
13467
13556
|
}
|
|
13468
13557
|
function desired(verb, summary2, enabled) {
|
|
13469
|
-
const properties = { id: ID
|
|
13558
|
+
const properties = { id: ID, ...enabled ? { version: { type: "string", minLength: 1 } } : {}, dry_run: { type: "boolean" } };
|
|
13470
13559
|
return {
|
|
13471
13560
|
verb,
|
|
13472
13561
|
summary: summary2,
|
|
@@ -13476,7 +13565,7 @@ function desired(verb, summary2, enabled) {
|
|
|
13476
13565
|
{ name: "dry-run", property: "dry_run", description: "Only show what would change", type: "boolean" }
|
|
13477
13566
|
],
|
|
13478
13567
|
inputSchema: { type: "object", properties, required: ["id"], additionalProperties: false },
|
|
13479
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13568
|
+
outputSchema: OBJECT_OUTPUT$2,
|
|
13480
13569
|
resultSchemaVersion: 1,
|
|
13481
13570
|
access: { mode: "fixed", level: "write" },
|
|
13482
13571
|
asyncMode: "sync",
|
|
@@ -13495,11 +13584,11 @@ function download() {
|
|
|
13495
13584
|
options: [{ name: "node", description: "Only this node; without it every node that has the item", type: "string" }],
|
|
13496
13585
|
inputSchema: {
|
|
13497
13586
|
type: "object",
|
|
13498
|
-
properties: { id: ID
|
|
13587
|
+
properties: { id: ID, item: ID, node: { type: "string", minLength: 1 } },
|
|
13499
13588
|
required: ["id", "item"],
|
|
13500
13589
|
additionalProperties: false
|
|
13501
13590
|
},
|
|
13502
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13591
|
+
outputSchema: OBJECT_OUTPUT$2,
|
|
13503
13592
|
resultSchemaVersion: 1,
|
|
13504
13593
|
access: { mode: "fixed", level: "write" },
|
|
13505
13594
|
asyncMode: "sync",
|
|
@@ -13528,7 +13617,7 @@ function createExtToolsModule() {
|
|
|
13528
13617
|
summary: "Put an already built .pikg (an official release asset) into the Repo unchanged",
|
|
13529
13618
|
positionals: [{ name: "pikg", description: "Local .pikg file" }],
|
|
13530
13619
|
inputSchema: { type: "object", properties: { pikg: { type: "string", minLength: 1 } }, required: ["pikg"], additionalProperties: false },
|
|
13531
|
-
outputSchema: OBJECT_OUTPUT$
|
|
13620
|
+
outputSchema: OBJECT_OUTPUT$2,
|
|
13532
13621
|
resultSchemaVersion: 1,
|
|
13533
13622
|
access: { mode: "fixed", level: "write" },
|
|
13534
13623
|
asyncMode: "sync",
|
|
@@ -13541,285 +13630,6 @@ function createExtToolsModule() {
|
|
|
13541
13630
|
]
|
|
13542
13631
|
};
|
|
13543
13632
|
}
|
|
13544
|
-
const OBJECT_OUTPUT$2 = { type: "object", additionalProperties: true };
|
|
13545
|
-
function schedule(ctx) {
|
|
13546
|
-
return new ScheduleClient({
|
|
13547
|
-
call: async (method, params) => {
|
|
13548
|
-
const result = expectObject$4(await callService(ctx, "aiworkspace", method, params), method);
|
|
13549
|
-
if (result.ok === false) {
|
|
13550
|
-
const error = expectObject$4(result.error, `${method}.error`);
|
|
13551
|
-
throw new AiwsFailure({ code: String(error.code ?? "AIWS_ERROR"), retryable: Boolean(error.retryable), detail: String(error.detail ?? error.code ?? ""), sub_code: typeof error.sub_code === "string" ? error.sub_code : void 0, data: error.data });
|
|
13552
|
-
}
|
|
13553
|
-
return result;
|
|
13554
|
-
}
|
|
13555
|
-
}, { locale: /^zh/i.test(Intl.DateTimeFormat().resolvedOptions().locale) ? "zh" : "en" });
|
|
13556
|
-
}
|
|
13557
|
-
async function run(work) {
|
|
13558
|
-
try {
|
|
13559
|
-
return await work();
|
|
13560
|
-
} catch (error) {
|
|
13561
|
-
if (error instanceof AiwsFailure)
|
|
13562
|
-
throw new ToolError(error.code, error.message, void 0, false, { ...error.subCode ? { sub_code: error.subCode } : {}, ...error.data !== void 0 ? { data: error.data } : {} });
|
|
13563
|
-
throw error;
|
|
13564
|
-
}
|
|
13565
|
-
}
|
|
13566
|
-
const todoView = (i) => ({ id: i.record_id, title: i.title, status: i.status, done: i.done, due: i.due, order: i.order, ...i.done_at ? { done_at: i.done_at } : {}, ...Object.keys(i.ext).length ? { ext: i.ext } : {} });
|
|
13567
|
-
const eventView = (o) => ({
|
|
13568
|
-
id: o.id,
|
|
13569
|
-
record_id: o.row.record_id,
|
|
13570
|
-
title: o.title,
|
|
13571
|
-
all_day: o.allDay,
|
|
13572
|
-
...o.allDay ? { start_date: o.startDate, end_date: o.endDate } : { start: new Date(o.startMs).toISOString(), end: new Date(o.endMs).toISOString() },
|
|
13573
|
-
...o.recurring ? { recurring: true, original: o.original } : {},
|
|
13574
|
-
...o.override ? { changed_once: true } : {},
|
|
13575
|
-
...o.agentWritten ? { agent_written: true } : {},
|
|
13576
|
-
...o.status ? { status: o.status } : {},
|
|
13577
|
-
...Object.keys(o.ext).length ? { ext: o.ext } : {}
|
|
13578
|
-
});
|
|
13579
|
-
const DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
13580
|
-
function parseExt(input) {
|
|
13581
|
-
const text2 = inputString(input, "ext");
|
|
13582
|
-
if (!text2)
|
|
13583
|
-
return void 0;
|
|
13584
|
-
const ext = JSON.parse(text2);
|
|
13585
|
-
if (!ext || typeof ext !== "object" || Array.isArray(ext))
|
|
13586
|
-
throw new UsageError("AIWS_USAGE", "--ext must be a JSON object");
|
|
13587
|
-
return ext;
|
|
13588
|
-
}
|
|
13589
|
-
const ID = { name: "id", property: "id", description: "To-do record id (`todo list` shows them)", type: "string" };
|
|
13590
|
-
const todoCommand = {
|
|
13591
|
-
verb: "todo",
|
|
13592
|
-
summary: "Your to-do list (the private schedule Workspace): list | add | done | undone | update | move | rm",
|
|
13593
|
-
description: "The to-dos are records of the table `todo` in your Workspace named `schedule` (created on first use); the to-do control shows every change at once. Status is a board column (`todo`, `doing`, `done` unless columns were added); `done` completes.",
|
|
13594
|
-
positionals: [{ name: "action", description: "list | add | done | undone | update | move | rm", required: true }, { name: "title", description: "add: the title", required: false }],
|
|
13595
|
-
options: [
|
|
13596
|
-
ID,
|
|
13597
|
-
{ name: "all", property: "all", description: "list: completed ones too", type: "boolean" },
|
|
13598
|
-
{ name: "title", property: "new_title", description: "update: the new title", type: "string" },
|
|
13599
|
-
{ name: "status", property: "status", description: "add / update / move: the status (board column) option id", type: "string" },
|
|
13600
|
-
{ name: "due", property: "due", description: 'add / update: due date YYYY-MM-DD (update: "none" clears it)', type: "string" },
|
|
13601
|
-
{ name: "priority", property: "priority", description: "add / update: low | normal | high | urgent | none", type: "string", enum: ["low", "normal", "high", "urgent", "none"] },
|
|
13602
|
-
{ name: "before", property: "before", description: "add / move: place before this to-do id", type: "string" },
|
|
13603
|
-
{ name: "after", property: "after", description: "add / move: place after this to-do id", type: "string" },
|
|
13604
|
-
{ name: "ext", property: "ext", description: "add / update: extension fields JSON (merged on update; null removes a key)", type: "string" }
|
|
13605
|
-
],
|
|
13606
|
-
inputSchema: {
|
|
13607
|
-
type: "object",
|
|
13608
|
-
properties: { action: { type: "string", enum: ["list", "add", "done", "undone", "update", "move", "rm"] }, title: { type: "string" }, id: { type: "string" }, all: { type: "boolean" }, new_title: { type: "string" }, status: { type: "string" }, due: { type: "string" }, priority: { type: "string" }, before: { type: "string" }, after: { type: "string" }, ext: { type: "string" } },
|
|
13609
|
-
required: ["action"],
|
|
13610
|
-
additionalProperties: false
|
|
13611
|
-
},
|
|
13612
|
-
outputSchema: OBJECT_OUTPUT$2,
|
|
13613
|
-
resultSchemaVersion: 1,
|
|
13614
|
-
access: { mode: "fixed", level: "write" },
|
|
13615
|
-
asyncMode: "sync",
|
|
13616
|
-
requiresSession: true,
|
|
13617
|
-
examples: [
|
|
13618
|
-
"buckyos aiws todo list",
|
|
13619
|
-
'buckyos aiws todo add "Renew the passport" --due 2026-12-01 --priority high',
|
|
13620
|
-
"buckyos aiws todo done --id t…",
|
|
13621
|
-
"buckyos aiws todo move --id t… --status doing --before t…"
|
|
13622
|
-
],
|
|
13623
|
-
handler: (ctx, input) => run(async () => {
|
|
13624
|
-
const s = schedule(ctx);
|
|
13625
|
-
const action = requiredInputString(input, "action");
|
|
13626
|
-
const id = () => requiredInputString(input, "id");
|
|
13627
|
-
const due = inputString(input, "due");
|
|
13628
|
-
if (due && due !== "none" && !DATE.test(due))
|
|
13629
|
-
throw new UsageError("AIWS_USAGE", "--due must be YYYY-MM-DD");
|
|
13630
|
-
const priority = inputString(input, "priority");
|
|
13631
|
-
switch (action) {
|
|
13632
|
-
case "list": {
|
|
13633
|
-
const handle = await s.ensure();
|
|
13634
|
-
const items = await s.todos({ includeDone: input.all === true });
|
|
13635
|
-
return { workspace_id: handle.workspace_id, table: handle.todo, items: items.map(todoView) };
|
|
13636
|
-
}
|
|
13637
|
-
case "add": {
|
|
13638
|
-
const title = requiredInputString(input, "title");
|
|
13639
|
-
const ext = { ...parseExt(input) ?? {}, ...priority && priority !== "none" ? { priority } : {} };
|
|
13640
|
-
const item = await s.addTodo({ title, status: inputString(input, "status") ?? void 0, due: due && due !== "none" ? due : void 0, ext }, { before: inputString(input, "before") ?? void 0, after: inputString(input, "after") ?? void 0 });
|
|
13641
|
-
return { item: todoView(item) };
|
|
13642
|
-
}
|
|
13643
|
-
case "done":
|
|
13644
|
-
case "undone":
|
|
13645
|
-
await s.completeTodo(id(), action === "done");
|
|
13646
|
-
return { ok: true, id: id(), done: action === "done" };
|
|
13647
|
-
case "update": {
|
|
13648
|
-
const ext = parseExt(input);
|
|
13649
|
-
const merge = { ...ext ?? {} };
|
|
13650
|
-
if (priority)
|
|
13651
|
-
merge.priority = priority === "none" ? null : priority;
|
|
13652
|
-
await s.updateTodo(id(), { ...inputString(input, "new_title") ? { title: inputString(input, "new_title") } : {}, ...inputString(input, "status") ? { status: inputString(input, "status") } : {}, ...due ? { due: due === "none" ? null : due } : {}, ...Object.keys(merge).length ? { ext_merge: merge } : {} });
|
|
13653
|
-
return { ok: true, id: id() };
|
|
13654
|
-
}
|
|
13655
|
-
case "move":
|
|
13656
|
-
await s.moveTodo(id(), { status: inputString(input, "status") ?? void 0, before: inputString(input, "before") ?? void 0, after: inputString(input, "after") ?? void 0 });
|
|
13657
|
-
return { ok: true, id: id() };
|
|
13658
|
-
case "rm": {
|
|
13659
|
-
const ids2 = id().split(",").map((x) => x.trim()).filter(Boolean);
|
|
13660
|
-
await s.removeTodos(ids2);
|
|
13661
|
-
return { ok: true, removed: ids2 };
|
|
13662
|
-
}
|
|
13663
|
-
default:
|
|
13664
|
-
throw new UsageError("AIWS_USAGE", `todo: unknown action ${action}`);
|
|
13665
|
-
}
|
|
13666
|
-
})
|
|
13667
|
-
};
|
|
13668
|
-
const SCOPE = { name: "scope", property: "scope", description: "A repeating event: one (only this occurrence, default) | following (this and later) | all", type: "string", enum: ["one", "following", "all"] };
|
|
13669
|
-
const calCommand = {
|
|
13670
|
-
verb: "cal",
|
|
13671
|
-
summary: "Your calendar (the private schedule Workspace): list | add | update | rm | skip | postpone",
|
|
13672
|
-
description: "Events are records of the table `calendar` in your Workspace named `schedule`. A repeating event has `ext.rrule` (iCalendar RRULE subset: FREQ DAILY/WEEKLY/MONTHLY/YEARLY, INTERVAL, COUNT or UNTIL, BYDAY with -1FR style ordinals, BYMONTHDAY, BYMONTH, BYSETPOS); `list` expands it and names each occurrence `<record_id>@<original start>` — pass that id to change, skip or postpone one occurrence. Rules the subset cannot express go to ext.rule_text with ext.occurrences written by you.",
|
|
13673
|
-
positionals: [{ name: "action", description: "list | add | update | rm | skip | postpone", required: true }, { name: "title", description: "add: the title", required: false }],
|
|
13674
|
-
options: [
|
|
13675
|
-
{ name: "id", property: "id", description: "Event id or occurrence id (`cal list` shows them)", type: "string" },
|
|
13676
|
-
{ name: "from", property: "from", description: "list: first day YYYY-MM-DD (default today)", type: "string" },
|
|
13677
|
-
{ name: "days", property: "days", description: "list: how many days (default 7, ≤ 366)", type: "integer" },
|
|
13678
|
-
{ name: "start", property: "start", description: "add / update: start, RFC 3339 instant (timed) or YYYY-MM-DD (all-day)", type: "string" },
|
|
13679
|
-
{ name: "end", property: "end", description: "add / update: end, same form as --start (all-day: the last day, inclusive)", type: "string" },
|
|
13680
|
-
{ name: "title", property: "new_title", description: "update: the new title", type: "string" },
|
|
13681
|
-
{ name: "rrule", property: "rrule", description: 'add / update: repeat rule, e.g. FREQ=WEEKLY;BYDAY=MO,WE ("none" stops repeating)', type: "string" },
|
|
13682
|
-
{ name: "tz", property: "tz", description: "add: the IANA time zone a series repeats in (default this machine’s)", type: "string" },
|
|
13683
|
-
{ name: "location", property: "location", description: "add / update: where", type: "string" },
|
|
13684
|
-
{ name: "reminder", property: "reminder", description: "add: minutes before to remind, comma separated (e.g. 10,1440)", type: "string" },
|
|
13685
|
-
{ name: "minutes", property: "minutes", description: "postpone: by how many minutes", type: "integer" },
|
|
13686
|
-
{ name: "ext", property: "ext", description: "add / update: extension fields JSON (merged on update; null removes a key)", type: "string" },
|
|
13687
|
-
SCOPE
|
|
13688
|
-
],
|
|
13689
|
-
inputSchema: {
|
|
13690
|
-
type: "object",
|
|
13691
|
-
properties: {
|
|
13692
|
-
action: { type: "string", enum: ["list", "add", "update", "rm", "skip", "postpone"] },
|
|
13693
|
-
title: { type: "string" },
|
|
13694
|
-
id: { type: "string" },
|
|
13695
|
-
from: { type: "string" },
|
|
13696
|
-
days: { type: "integer" },
|
|
13697
|
-
start: { type: "string" },
|
|
13698
|
-
end: { type: "string" },
|
|
13699
|
-
new_title: { type: "string" },
|
|
13700
|
-
rrule: { type: "string" },
|
|
13701
|
-
tz: { type: "string" },
|
|
13702
|
-
location: { type: "string" },
|
|
13703
|
-
reminder: { type: "string" },
|
|
13704
|
-
minutes: { type: "integer" },
|
|
13705
|
-
ext: { type: "string" },
|
|
13706
|
-
scope: { type: "string", enum: ["one", "following", "all"] }
|
|
13707
|
-
},
|
|
13708
|
-
required: ["action"],
|
|
13709
|
-
additionalProperties: false
|
|
13710
|
-
},
|
|
13711
|
-
outputSchema: OBJECT_OUTPUT$2,
|
|
13712
|
-
resultSchemaVersion: 1,
|
|
13713
|
-
access: { mode: "fixed", level: "write" },
|
|
13714
|
-
asyncMode: "sync",
|
|
13715
|
-
requiresSession: true,
|
|
13716
|
-
examples: [
|
|
13717
|
-
"buckyos aiws cal list --days 14",
|
|
13718
|
-
'buckyos aiws cal add "Stand-up" --start 2026-11-16T09:00:00+08:00 --end 2026-11-16T09:15:00+08:00 --rrule "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR"',
|
|
13719
|
-
'buckyos aiws cal add "Trip" --start 2026-11-20 --end 2026-11-22',
|
|
13720
|
-
"buckyos aiws cal skip --id e…@2026-11-18T01:00:00.000Z",
|
|
13721
|
-
"buckyos aiws cal update --id e…@2026-11-18T01:00:00.000Z --start 2026-11-18T10:00:00+08:00 --end 2026-11-18T10:15:00+08:00 --scope following"
|
|
13722
|
-
],
|
|
13723
|
-
handler: (ctx, input) => run(async () => {
|
|
13724
|
-
const s = schedule(ctx);
|
|
13725
|
-
const action = requiredInputString(input, "action");
|
|
13726
|
-
const tz = viewerTimeZone();
|
|
13727
|
-
const scope = inputString(input, "scope") ?? "one";
|
|
13728
|
-
const times = () => {
|
|
13729
|
-
const start = inputString(input, "start"), end = inputString(input, "end");
|
|
13730
|
-
if (!start && !end)
|
|
13731
|
-
return void 0;
|
|
13732
|
-
if (!start)
|
|
13733
|
-
throw new UsageError("AIWS_USAGE", "--end needs --start");
|
|
13734
|
-
if (DATE.test(start)) {
|
|
13735
|
-
const last = end ?? start;
|
|
13736
|
-
if (!DATE.test(last))
|
|
13737
|
-
throw new UsageError("AIWS_USAGE", "an all-day event takes dates for --start and --end");
|
|
13738
|
-
return { allDay: true, startDate: start, endDate: last };
|
|
13739
|
-
}
|
|
13740
|
-
const s0 = Date.parse(start);
|
|
13741
|
-
const e0 = end ? Date.parse(end) : s0 + 36e5;
|
|
13742
|
-
if (!Number.isFinite(s0) || !Number.isFinite(e0))
|
|
13743
|
-
throw new UsageError("AIWS_USAGE", "--start / --end must be RFC 3339 instants with an offset (or dates for all-day)");
|
|
13744
|
-
return { allDay: false, start: new Date(s0).toISOString(), end: new Date(e0).toISOString() };
|
|
13745
|
-
};
|
|
13746
|
-
switch (action) {
|
|
13747
|
-
case "list": {
|
|
13748
|
-
const handle = await s.ensure();
|
|
13749
|
-
const from = inputString(input, "from") ?? localDate(Date.now(), tz);
|
|
13750
|
-
if (!DATE.test(from))
|
|
13751
|
-
throw new UsageError("AIWS_USAGE", "--from must be YYYY-MM-DD");
|
|
13752
|
-
const days = typeof input.days === "number" ? Math.max(1, Math.min(366, input.days)) : 7;
|
|
13753
|
-
const fromMs = Date.parse(`${from}T00:00:00Z`) - 14 * 36e5;
|
|
13754
|
-
const window = { fromMs, toMs: fromMs + days * 864e5 + 28 * 36e5 };
|
|
13755
|
-
const rows = await s.rows(handle.calendar);
|
|
13756
|
-
const last = localDate(Date.parse(`${from}T12:00:00Z`) + (days - 1) * 864e5, "UTC");
|
|
13757
|
-
const occ = calendarOccurrences(rows, window, { viewerTz: tz }).filter((o) => o.allDay ? o.endDate >= from && o.startDate <= last : localDate(o.endMs, tz) >= from && localDate(o.startMs, tz) <= last);
|
|
13758
|
-
return { workspace_id: handle.workspace_id, table: handle.calendar, from, days, time_zone: tz, events: occ.map(eventView) };
|
|
13759
|
-
}
|
|
13760
|
-
case "add": {
|
|
13761
|
-
const title = requiredInputString(input, "title");
|
|
13762
|
-
const t = times();
|
|
13763
|
-
if (!t)
|
|
13764
|
-
throw new UsageError("AIWS_USAGE", "add needs --start");
|
|
13765
|
-
const ext = { ...parseExt(input) ?? {} };
|
|
13766
|
-
const rrule = inputString(input, "rrule");
|
|
13767
|
-
if (rrule && rrule !== "none") {
|
|
13768
|
-
ext.rrule = rrule;
|
|
13769
|
-
ext.tz = inputString(input, "tz") ?? tz;
|
|
13770
|
-
}
|
|
13771
|
-
const location = inputString(input, "location");
|
|
13772
|
-
if (location)
|
|
13773
|
-
ext.location = location;
|
|
13774
|
-
const reminder = inputString(input, "reminder");
|
|
13775
|
-
if (reminder)
|
|
13776
|
-
ext.reminders = reminder.split(",").map((m) => ({ before_min: Number(m.trim()) })).filter((r) => Number.isFinite(r.before_min));
|
|
13777
|
-
const id = await s.addEvent(t.allDay ? { title, all_day: true, start_date: t.startDate, end_date: t.endDate, ext } : { title, start: t.start, end: t.end, ext });
|
|
13778
|
-
return { ok: true, id };
|
|
13779
|
-
}
|
|
13780
|
-
case "update": {
|
|
13781
|
-
const change = {};
|
|
13782
|
-
const t = times();
|
|
13783
|
-
if (t)
|
|
13784
|
-
change.times = t;
|
|
13785
|
-
const title = inputString(input, "new_title");
|
|
13786
|
-
if (title)
|
|
13787
|
-
change.values = { title };
|
|
13788
|
-
const merge = { ...parseExt(input) ?? {} };
|
|
13789
|
-
const location = inputString(input, "location");
|
|
13790
|
-
if (location !== void 0 && location !== null)
|
|
13791
|
-
merge.location = location || null;
|
|
13792
|
-
if (Object.keys(merge).length)
|
|
13793
|
-
change.ext_merge = merge;
|
|
13794
|
-
const rrule = inputString(input, "rrule");
|
|
13795
|
-
if (rrule)
|
|
13796
|
-
change.rrule = rrule === "none" ? null : rrule;
|
|
13797
|
-
const id = await s.editEvent(requiredInputString(input, "id"), change, scope);
|
|
13798
|
-
return { ok: true, id };
|
|
13799
|
-
}
|
|
13800
|
-
case "rm":
|
|
13801
|
-
await s.deleteEvent(requiredInputString(input, "id"), scope);
|
|
13802
|
-
return { ok: true };
|
|
13803
|
-
case "skip":
|
|
13804
|
-
await s.deleteEvent(requiredInputString(input, "id"), "one");
|
|
13805
|
-
return { ok: true };
|
|
13806
|
-
case "postpone": {
|
|
13807
|
-
const minutes = typeof input.minutes === "number" ? input.minutes : 0;
|
|
13808
|
-
if (minutes <= 0)
|
|
13809
|
-
throw new UsageError("AIWS_USAGE", "postpone needs --minutes");
|
|
13810
|
-
const { occ } = await s.occurrence(requiredInputString(input, "id"));
|
|
13811
|
-
const change = occ.allDay ? { times: { allDay: true, startDate: shiftDate(occ.startDate, Math.max(1, Math.round(minutes / 1440))), endDate: shiftDate(occ.endDate, Math.max(1, Math.round(minutes / 1440))) } } : { times: { allDay: false, start: new Date(occ.startMs + minutes * 6e4).toISOString(), end: new Date(occ.endMs + minutes * 6e4).toISOString() } };
|
|
13812
|
-
const id = await s.editEvent(requiredInputString(input, "id"), change, "one");
|
|
13813
|
-
return { ok: true, id };
|
|
13814
|
-
}
|
|
13815
|
-
default:
|
|
13816
|
-
throw new UsageError("AIWS_USAGE", `cal: unknown action ${action}`);
|
|
13817
|
-
}
|
|
13818
|
-
})
|
|
13819
|
-
};
|
|
13820
|
-
function shiftDate(date, days) {
|
|
13821
|
-
return new Date(Date.parse(`${date}T00:00:00Z`) + days * 864e5).toISOString().slice(0, 10);
|
|
13822
|
-
}
|
|
13823
13633
|
const OBJECT_OUTPUT$1 = { type: "object", additionalProperties: true };
|
|
13824
13634
|
const SERVICE$1 = "aiworkspace";
|
|
13825
13635
|
const NOT_DATA = /* @__PURE__ */ new Set([
|
|
@@ -15051,9 +14861,9 @@ const runExecCommand = {
|
|
|
15051
14861
|
requiresSession: true,
|
|
15052
14862
|
examples: ["buckyos aiws run-exec --workspace ws_abc --run run_xyz --attempt 1 --dir work"],
|
|
15053
14863
|
handler: async (ctx, input) => {
|
|
15054
|
-
const
|
|
15055
|
-
const r =
|
|
15056
|
-
return { exit_code:
|
|
14864
|
+
const run = await execMacro(ctx, input);
|
|
14865
|
+
const r = run.results ?? {};
|
|
14866
|
+
return { exit_code: run.code, error: r.error ?? null, error_code: r.error_code ?? null, ai: r.ai ?? null, declare: r.declare ?? null, log: run.log };
|
|
15057
14867
|
}
|
|
15058
14868
|
};
|
|
15059
14869
|
const runProgramCommand = {
|
|
@@ -15071,7 +14881,7 @@ const runProgramCommand = {
|
|
|
15071
14881
|
handler: async (ctx, input) => {
|
|
15072
14882
|
const host2 = getHost();
|
|
15073
14883
|
const dir = host2.path.resolve(ctx.cwd, requiredInputString(input, "dir"));
|
|
15074
|
-
const
|
|
14884
|
+
const run = await execMacro(ctx, input);
|
|
15075
14885
|
const files = {};
|
|
15076
14886
|
const walk = async (rel) => {
|
|
15077
14887
|
for (const entry of await host2.readDir(`${dir}/output${rel ? `/${rel}` : ""}`)) {
|
|
@@ -15093,7 +14903,7 @@ const runProgramCommand = {
|
|
|
15093
14903
|
}
|
|
15094
14904
|
};
|
|
15095
14905
|
await walk("");
|
|
15096
|
-
return aiws(ctx, "proc.program", { workspace_id: requiredInputString(input, "workspace_id"), run_id: requiredInputString(input, "run_id"), attempt: input.attempt, source:
|
|
14906
|
+
return aiws(ctx, "proc.program", { workspace_id: requiredInputString(input, "workspace_id"), run_id: requiredInputString(input, "run_id"), attempt: input.attempt, source: run.source, results: run.results, log: run.log, files });
|
|
15097
14907
|
}
|
|
15098
14908
|
};
|
|
15099
14909
|
const runStartCommand = {
|
|
@@ -15332,9 +15142,9 @@ function assetFetcher(ctx) {
|
|
|
15332
15142
|
return new Uint8Array(await response.arrayBuffer());
|
|
15333
15143
|
};
|
|
15334
15144
|
}
|
|
15335
|
-
async function sourceErrors(
|
|
15145
|
+
async function sourceErrors(run) {
|
|
15336
15146
|
try {
|
|
15337
|
-
return await
|
|
15147
|
+
return await run();
|
|
15338
15148
|
} catch (error) {
|
|
15339
15149
|
if (error instanceof AiwsSourceError)
|
|
15340
15150
|
throw new ToolError("BUILD_FAILED", `BUILD_FAILED: ${error.message}`, void 0, false, { data: { diagnostics: error.diagnostics } });
|
|
@@ -15920,11 +15730,25 @@ const templateCommand = {
|
|
|
15920
15730
|
return aiws(ctx, "ext.create_from_template", { pkg_id, template_id, ...title ? { title } : {}, ...params ? { params } : {} });
|
|
15921
15731
|
}
|
|
15922
15732
|
};
|
|
15733
|
+
const selectNameCommand = {
|
|
15734
|
+
verb: "select-name",
|
|
15735
|
+
summary: "Choose the workspace that keeps a conflicting personal name",
|
|
15736
|
+
positionals: [{ name: "name", description: "Conflicting workspace name", required: true }],
|
|
15737
|
+
options: [WORKSPACE_OPTION],
|
|
15738
|
+
inputSchema: workspaceInput({ name: { type: "string", minLength: 1 } }, ["name"]),
|
|
15739
|
+
outputSchema: OBJECT_OUTPUT,
|
|
15740
|
+
resultSchemaVersion: 1,
|
|
15741
|
+
access: WRITE_ACCESS,
|
|
15742
|
+
asyncMode: "sync",
|
|
15743
|
+
requiresSession: true,
|
|
15744
|
+
examples: ["buckyos aiws select-name schedule --workspace ws_2611a123"],
|
|
15745
|
+
handler: (ctx, input) => aiws(ctx, "ws.select_name", input)
|
|
15746
|
+
};
|
|
15923
15747
|
function createAiwsModule() {
|
|
15924
15748
|
return {
|
|
15925
15749
|
name: "aiws",
|
|
15926
|
-
summary: "AI Workspace: find and read a workspace by path (ls, find, grep, stat, cat, resolve, read), its permissions (acl, acl-edit), query its tables in SQL (sql), write tables, rich text and common properties (table, text, mv, rename, set-prop),
|
|
15927
|
-
commands: [infoCommand, lsCommand, findCommand, grepCommand, statCommand, aclCommand, aclEditCommand, catCommand, resolveCommand, readCommand, sqlCommand, tableCommand, textCommand, mvCommand, renameCommand, setPropCommand,
|
|
15750
|
+
summary: "AI Workspace: find and read a workspace by path (ls, find, grep, stat, cat, resolve, read), its permissions (acl, acl-edit), query its tables in SQL (sql), write tables, rich text and common properties (table, text, mv, rename, set-prop), resolve conflicting workspace names (select-name), Block-controls (catalogue, import, export), extension controls (build, pull, export, library, import, upgrade), Workspace templates (list, create, export), and execute wish runs as their executor (claim, heartbeat, report) or roll one back",
|
|
15751
|
+
commands: [infoCommand, selectNameCommand, lsCommand, findCommand, grepCommand, statCommand, aclCommand, aclEditCommand, catCommand, resolveCommand, readCommand, sqlCommand, tableCommand, textCommand, mvCommand, renameCommand, setPropCommand, placeCommand, controlsCommand, importCommand, exportCommand, buildCommand, pullCommand, extExportCommand, libraryCommand, extImportCommand, extUpgradeCommand, templateCommand, runGetCommand, runClaimCommand, runHeartbeatCommand, runFilesCommand, runToolCommand, runExecCommand, runProgramCommand, runReportCommand, runRollbackCommand, runStartCommand]
|
|
15928
15752
|
};
|
|
15929
15753
|
}
|
|
15930
15754
|
const VERSION = TOOL_VERSION;
|
|
@@ -16182,6 +16006,8 @@ class BuckyOSToolApplication {
|
|
|
16182
16006
|
9
|
|
16183
16007
|
);
|
|
16184
16008
|
}
|
|
16009
|
+
if (command2.module === "obj" && command2.verb === "call")
|
|
16010
|
+
return data.exit_code;
|
|
16185
16011
|
const envelope = successEnvelope(data, {
|
|
16186
16012
|
command: `${command2.module}.${command2.verb}`,
|
|
16187
16013
|
trace_id: traceId,
|