buckyos 0.7.168 → 0.7.170
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/core/app.ts +2 -0
- package/cli/dist/cli.mjs +294 -146
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/modules/app.ts +7 -0
- package/cli/modules/ext_tools.ts +71 -0
- package/cli/modules/pikg.ts +7 -1
- package/cli/modules/pikg_protocol.ts +13 -2
- package/cli/modules/skill.ts +31 -6
- package/cli/version.ts +1 -1
- package/dist/app-frame.cjs +1 -1
- package/dist/app-frame.cjs.map +1 -1
- package/dist/app-frame.mjs +1 -0
- package/dist/app-frame.mjs.map +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.mjs +212 -211
- package/dist/browser.mjs.map +1 -1
- package/dist/content.cjs +1 -1
- package/dist/content.cjs.map +1 -1
- package/dist/content.d.ts +2 -1
- package/dist/content.d.ts.map +1 -1
- package/dist/content.mjs +32 -167
- package/dist/content.mjs.map +1 -1
- package/dist/content_mime-dc80d960.js +2 -0
- package/dist/content_mime-dc80d960.js.map +1 -0
- package/dist/content_mime-e42d5f8d.mjs +335 -0
- package/dist/content_mime-e42d5f8d.mjs.map +1 -0
- package/dist/content_mime.d.ts +18 -0
- package/dist/content_mime.d.ts.map +1 -1
- package/dist/executor_client-1ee523cf.js +13 -0
- package/dist/executor_client-1ee523cf.js.map +1 -0
- package/dist/{executor_client-a32bc377.mjs → executor_client-5f4d0468.mjs} +1751 -286
- package/dist/executor_client-5f4d0468.mjs.map +1 -0
- package/dist/file_meta.d.ts +26 -0
- package/dist/file_meta.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +217 -216
- package/dist/index.mjs.map +1 -1
- package/dist/msg_center_client.d.ts +2 -1
- package/dist/msg_center_client.d.ts.map +1 -1
- package/dist/namelib.d.ts.map +1 -1
- package/dist/ndm_client.d.ts +7 -0
- package/dist/ndm_client.d.ts.map +1 -1
- package/dist/ndn.d.ts +3 -0
- package/dist/ndn.d.ts.map +1 -0
- package/dist/ndn_types-8c2696d5.js +2 -0
- package/dist/ndn_types-8c2696d5.js.map +1 -0
- package/dist/{namelib-b41b10cc.mjs → ndn_types-ab30fac0.mjs} +3077 -2697
- package/dist/ndn_types-ab30fac0.mjs.map +1 -0
- package/dist/ndn_types.d.ts +268 -16
- package/dist/ndn_types.d.ts.map +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.mjs +212 -211
- package/dist/node.mjs.map +1 -1
- package/dist/provision.cjs +2 -2
- package/dist/provision.cjs.map +1 -1
- package/dist/provision.d.ts +1 -2
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.mjs +3 -31
- package/dist/provision.mjs.map +1 -1
- package/dist/repo_client.d.ts +2 -1
- package/dist/repo_client.d.ts.map +1 -1
- package/dist/{tus_client-4f7254e9.js → tus_client-b231b248.js} +2 -2
- package/dist/{tus_client-4f7254e9.js.map → tus_client-b231b248.js.map} +1 -1
- package/dist/{tus_client-04080b1e.mjs → tus_client-d1ffe2d6.mjs} +2 -2
- package/dist/{tus_client-04080b1e.mjs.map → tus_client-d1ffe2d6.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/executor_client-a32bc377.mjs.map +0 -1
- package/dist/executor_client-e026942b.js +0 -13
- package/dist/executor_client-e026942b.js.map +0 -1
- package/dist/namelib-b41b10cc.mjs.map +0 -1
- package/dist/namelib-f8ff0045.js +0 -2
- package/dist/namelib-f8ff0045.js.map +0 -1
package/cli/dist/cli.mjs
CHANGED
|
@@ -546,7 +546,7 @@ function resolveInputPath(value, cwd, path) {
|
|
|
546
546
|
return path.isAbsolute(value) ? path.resolve(value) : path.resolve(cwd, value);
|
|
547
547
|
}
|
|
548
548
|
function collectArgumentPaths(argv) {
|
|
549
|
-
const
|
|
549
|
+
const read2 = [];
|
|
550
550
|
const readParents = [];
|
|
551
551
|
const write = [];
|
|
552
552
|
const writeParents = [];
|
|
@@ -607,29 +607,29 @@ function collectArgumentPaths(argv) {
|
|
|
607
607
|
if (value === void 0)
|
|
608
608
|
continue;
|
|
609
609
|
if (name === "config-dir") {
|
|
610
|
-
|
|
610
|
+
read2.push(value);
|
|
611
611
|
write.push(value);
|
|
612
612
|
} else if (name === "allow-read") {
|
|
613
|
-
|
|
613
|
+
read2.push(value);
|
|
614
614
|
} else if (["input", "session-token-file", "pikg"].includes(name)) {
|
|
615
615
|
if (value !== "-")
|
|
616
|
-
|
|
616
|
+
read2.push(value);
|
|
617
617
|
} else if (name === "catalog" && module === "pikg") {
|
|
618
|
-
|
|
618
|
+
read2.push(value);
|
|
619
619
|
} else if (name === "source" && module === "pikg") {
|
|
620
|
-
|
|
620
|
+
read2.push(value);
|
|
621
621
|
} else if (name === "plan") {
|
|
622
|
-
|
|
622
|
+
read2.push(value);
|
|
623
623
|
if (module === "app" && verb === "fetch")
|
|
624
624
|
write.push(value);
|
|
625
625
|
} else if (name === "path")
|
|
626
626
|
write.push(value);
|
|
627
627
|
else if (name === "app-doc" && module === "app" && verb === "publish")
|
|
628
|
-
|
|
628
|
+
read2.push(value);
|
|
629
629
|
else if (name === "file" && module === "system-config" && verb === "set-file") {
|
|
630
|
-
|
|
630
|
+
read2.push(value);
|
|
631
631
|
} else if (name === "root" && module === "provision") {
|
|
632
|
-
|
|
632
|
+
read2.push(value);
|
|
633
633
|
if (verb === "activate")
|
|
634
634
|
write.push(value);
|
|
635
635
|
} else if (name === "owner-key-backup" && module === "provision") {
|
|
@@ -642,18 +642,18 @@ function collectArgumentPaths(argv) {
|
|
|
642
642
|
}
|
|
643
643
|
if (module === "app" && ["fetch", "install"].includes(verb ?? "") && positional++ === 0) {
|
|
644
644
|
if (!/^https?:\/\//i.test(token))
|
|
645
|
-
|
|
645
|
+
read2.push(token);
|
|
646
646
|
} else if (module === "skill" && verb === "install" && positional++ === 0) {
|
|
647
|
-
|
|
647
|
+
read2.push(token);
|
|
648
648
|
} else if (module === "pikg" && positional++ === 0) {
|
|
649
|
-
|
|
649
|
+
read2.push(token);
|
|
650
650
|
if (verb === "init" || verb === "pack")
|
|
651
651
|
write.push(token);
|
|
652
652
|
else if (verb === "build" || verb === "clean")
|
|
653
653
|
writeParents.push(token);
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
return { read, readParents, write, writeParents, module, verb };
|
|
656
|
+
return { read: read2, readParents, write, writeParents, module, verb };
|
|
657
657
|
}
|
|
658
658
|
function policyView(host2) {
|
|
659
659
|
return {
|
|
@@ -2500,7 +2500,7 @@ function replPrompt(config) {
|
|
|
2500
2500
|
return `buckyos[${profile}|${zone}|${identity}]> `;
|
|
2501
2501
|
}
|
|
2502
2502
|
const EMPTY_INPUT$3 = { type: "object", properties: {}, additionalProperties: false };
|
|
2503
|
-
const OBJECT_OUTPUT$
|
|
2503
|
+
const OBJECT_OUTPUT$g = { type: "object", additionalProperties: true };
|
|
2504
2504
|
function createAuthModule() {
|
|
2505
2505
|
return {
|
|
2506
2506
|
name: "auth",
|
|
@@ -2510,7 +2510,7 @@ function createAuthModule() {
|
|
|
2510
2510
|
verb: "whoami",
|
|
2511
2511
|
summary: "Show the effective principal and application identity",
|
|
2512
2512
|
inputSchema: EMPTY_INPUT$3,
|
|
2513
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2513
|
+
outputSchema: OBJECT_OUTPUT$g,
|
|
2514
2514
|
resultSchemaVersion: 1,
|
|
2515
2515
|
access: { mode: "fixed", level: "read" },
|
|
2516
2516
|
asyncMode: "sync",
|
|
@@ -2528,7 +2528,7 @@ function createAuthModule() {
|
|
|
2528
2528
|
verb: "session-status",
|
|
2529
2529
|
summary: "Show the in-memory session state without exposing credentials",
|
|
2530
2530
|
inputSchema: EMPTY_INPUT$3,
|
|
2531
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2531
|
+
outputSchema: OBJECT_OUTPUT$g,
|
|
2532
2532
|
resultSchemaVersion: 1,
|
|
2533
2533
|
access: { mode: "fixed", level: "read" },
|
|
2534
2534
|
asyncMode: "sync",
|
|
@@ -2549,7 +2549,7 @@ const EMPTY_INPUT$2 = {
|
|
|
2549
2549
|
properties: {},
|
|
2550
2550
|
additionalProperties: false
|
|
2551
2551
|
};
|
|
2552
|
-
const OBJECT_OUTPUT$
|
|
2552
|
+
const OBJECT_OUTPUT$f = { type: "object", additionalProperties: true };
|
|
2553
2553
|
function createCoreModules(registry) {
|
|
2554
2554
|
return [createCommandModule(registry), createConfigModule(), createCompletionModule(registry)];
|
|
2555
2555
|
}
|
|
@@ -2562,7 +2562,7 @@ function createCommandModule(registry) {
|
|
|
2562
2562
|
verb: "list",
|
|
2563
2563
|
summary: "List registered modules and commands",
|
|
2564
2564
|
inputSchema: EMPTY_INPUT$2,
|
|
2565
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2565
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
2566
2566
|
resultSchemaVersion: 1,
|
|
2567
2567
|
access: { mode: "fixed", level: "read" },
|
|
2568
2568
|
asyncMode: "sync",
|
|
@@ -2595,7 +2595,7 @@ function createCommandModule(registry) {
|
|
|
2595
2595
|
required: ["target_module", "target_verb"],
|
|
2596
2596
|
additionalProperties: false
|
|
2597
2597
|
},
|
|
2598
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2598
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
2599
2599
|
resultSchemaVersion: 1,
|
|
2600
2600
|
access: { mode: "fixed", level: "read" },
|
|
2601
2601
|
asyncMode: "sync",
|
|
@@ -2617,7 +2617,7 @@ function createConfigModule() {
|
|
|
2617
2617
|
verb: "list",
|
|
2618
2618
|
summary: "List the global configuration and available profiles",
|
|
2619
2619
|
inputSchema: EMPTY_INPUT$2,
|
|
2620
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2620
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
2621
2621
|
resultSchemaVersion: 1,
|
|
2622
2622
|
access: { mode: "fixed", level: "read" },
|
|
2623
2623
|
asyncMode: "sync",
|
|
@@ -2648,7 +2648,7 @@ function createConfigModule() {
|
|
|
2648
2648
|
},
|
|
2649
2649
|
additionalProperties: false
|
|
2650
2650
|
},
|
|
2651
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2651
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
2652
2652
|
resultSchemaVersion: 1,
|
|
2653
2653
|
access: { mode: "fixed", level: "read" },
|
|
2654
2654
|
asyncMode: "sync",
|
|
@@ -2694,7 +2694,7 @@ function createConfigModule() {
|
|
|
2694
2694
|
required: ["key", "value"],
|
|
2695
2695
|
additionalProperties: false
|
|
2696
2696
|
},
|
|
2697
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2697
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
2698
2698
|
resultSchemaVersion: 1,
|
|
2699
2699
|
access: { mode: "fixed", level: "write" },
|
|
2700
2700
|
asyncMode: "sync",
|
|
@@ -2734,7 +2734,7 @@ function createConfigModule() {
|
|
|
2734
2734
|
required: ["profile_name"],
|
|
2735
2735
|
additionalProperties: false
|
|
2736
2736
|
},
|
|
2737
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2737
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
2738
2738
|
resultSchemaVersion: 1,
|
|
2739
2739
|
access: { mode: "fixed", level: "write" },
|
|
2740
2740
|
asyncMode: "sync",
|
|
@@ -2766,7 +2766,7 @@ function createConfigModule() {
|
|
|
2766
2766
|
properties: { effective: { type: "boolean" } },
|
|
2767
2767
|
additionalProperties: false
|
|
2768
2768
|
},
|
|
2769
|
-
outputSchema: OBJECT_OUTPUT$
|
|
2769
|
+
outputSchema: OBJECT_OUTPUT$f,
|
|
2770
2770
|
resultSchemaVersion: 1,
|
|
2771
2771
|
access: { mode: "fixed", level: "read" },
|
|
2772
2772
|
asyncMode: "sync",
|
|
@@ -3008,7 +3008,7 @@ async function buckyosInfo(ctx) {
|
|
|
3008
3008
|
);
|
|
3009
3009
|
}
|
|
3010
3010
|
const SERVICE_NAME = "system_config";
|
|
3011
|
-
const OBJECT_OUTPUT$
|
|
3011
|
+
const OBJECT_OUTPUT$e = { type: "object", additionalProperties: false };
|
|
3012
3012
|
const KEY_INPUT = {
|
|
3013
3013
|
type: "object",
|
|
3014
3014
|
properties: { key: { type: "string", minLength: 1 } },
|
|
@@ -3026,7 +3026,7 @@ function createSystemConfigModule() {
|
|
|
3026
3026
|
positionals: [{ name: "key", description: "System-config key" }],
|
|
3027
3027
|
inputSchema: KEY_INPUT,
|
|
3028
3028
|
outputSchema: {
|
|
3029
|
-
...OBJECT_OUTPUT$
|
|
3029
|
+
...OBJECT_OUTPUT$e,
|
|
3030
3030
|
properties: {
|
|
3031
3031
|
key: { type: "string" },
|
|
3032
3032
|
value: { type: "string" },
|
|
@@ -3069,7 +3069,7 @@ function createSystemConfigModule() {
|
|
|
3069
3069
|
additionalProperties: false
|
|
3070
3070
|
},
|
|
3071
3071
|
outputSchema: {
|
|
3072
|
-
...OBJECT_OUTPUT$
|
|
3072
|
+
...OBJECT_OUTPUT$e,
|
|
3073
3073
|
properties: {
|
|
3074
3074
|
key: { type: "string" },
|
|
3075
3075
|
items: { type: "array", items: { type: "string" } }
|
|
@@ -3123,7 +3123,7 @@ function setCommand() {
|
|
|
3123
3123
|
additionalProperties: false
|
|
3124
3124
|
},
|
|
3125
3125
|
outputSchema: {
|
|
3126
|
-
...OBJECT_OUTPUT$
|
|
3126
|
+
...OBJECT_OUTPUT$e,
|
|
3127
3127
|
properties: { key: { type: "string" }, updated: { type: "boolean" } },
|
|
3128
3128
|
required: ["key", "updated"]
|
|
3129
3129
|
},
|
|
@@ -3162,7 +3162,7 @@ function setFileCommand() {
|
|
|
3162
3162
|
additionalProperties: false
|
|
3163
3163
|
},
|
|
3164
3164
|
outputSchema: {
|
|
3165
|
-
...OBJECT_OUTPUT$
|
|
3165
|
+
...OBJECT_OUTPUT$e,
|
|
3166
3166
|
properties: { key: { type: "string" }, updated: { type: "boolean" } },
|
|
3167
3167
|
required: ["key", "updated"]
|
|
3168
3168
|
},
|
|
@@ -3199,7 +3199,7 @@ function mutationCommand(options) {
|
|
|
3199
3199
|
additionalProperties: false
|
|
3200
3200
|
},
|
|
3201
3201
|
outputSchema: {
|
|
3202
|
-
...OBJECT_OUTPUT$
|
|
3202
|
+
...OBJECT_OUTPUT$e,
|
|
3203
3203
|
properties: {
|
|
3204
3204
|
key: { type: "string" },
|
|
3205
3205
|
[options.resultProperty]: { type: "boolean" }
|
|
@@ -3277,13 +3277,13 @@ async function digestFile(path) {
|
|
|
3277
3277
|
try {
|
|
3278
3278
|
const buffer = new Uint8Array(256 * 1024);
|
|
3279
3279
|
while (true) {
|
|
3280
|
-
const
|
|
3281
|
-
if (
|
|
3280
|
+
const read2 = await file.read(buffer);
|
|
3281
|
+
if (read2 === null)
|
|
3282
3282
|
break;
|
|
3283
|
-
const chunk = buffer.subarray(0,
|
|
3283
|
+
const chunk = buffer.subarray(0, read2);
|
|
3284
3284
|
sha.update(chunk);
|
|
3285
3285
|
crc = updateCrc32(crc, chunk);
|
|
3286
|
-
size +=
|
|
3286
|
+
size += read2;
|
|
3287
3287
|
if (!Number.isSafeInteger(size))
|
|
3288
3288
|
throw new UsageError("FILE_TOO_LARGE", "file is too large");
|
|
3289
3289
|
}
|
|
@@ -3459,13 +3459,13 @@ function fileReadableStream(path) {
|
|
|
3459
3459
|
async pull(controller) {
|
|
3460
3460
|
file ??= await getHost().open(path, { read: true });
|
|
3461
3461
|
const buffer = new Uint8Array(256 * 1024);
|
|
3462
|
-
const
|
|
3463
|
-
if (
|
|
3462
|
+
const read2 = await file.read(buffer);
|
|
3463
|
+
if (read2 === null) {
|
|
3464
3464
|
await file.close();
|
|
3465
3465
|
controller.close();
|
|
3466
3466
|
return;
|
|
3467
3467
|
}
|
|
3468
|
-
controller.enqueue(buffer.subarray(0,
|
|
3468
|
+
controller.enqueue(buffer.subarray(0, read2));
|
|
3469
3469
|
},
|
|
3470
3470
|
async cancel() {
|
|
3471
3471
|
await file?.close();
|
|
@@ -3910,14 +3910,14 @@ function zipEntryStream(path, entry) {
|
|
|
3910
3910
|
return;
|
|
3911
3911
|
}
|
|
3912
3912
|
const buffer = new Uint8Array(Math.min(256 * 1024, remaining));
|
|
3913
|
-
const
|
|
3914
|
-
if (
|
|
3913
|
+
const read2 = await file.read(buffer);
|
|
3914
|
+
if (read2 === null) {
|
|
3915
3915
|
void file.close();
|
|
3916
3916
|
controller.error(invalidZip("container", `truncated entry: ${entry.name}`));
|
|
3917
3917
|
return;
|
|
3918
3918
|
}
|
|
3919
|
-
remaining -=
|
|
3920
|
-
controller.enqueue(buffer.subarray(0,
|
|
3919
|
+
remaining -= read2;
|
|
3920
|
+
controller.enqueue(buffer.subarray(0, read2));
|
|
3921
3921
|
},
|
|
3922
3922
|
cancel() {
|
|
3923
3923
|
void file?.close();
|
|
@@ -4109,10 +4109,10 @@ async function copyFileToWriter(path, output) {
|
|
|
4109
4109
|
try {
|
|
4110
4110
|
const buffer = new Uint8Array(256 * 1024);
|
|
4111
4111
|
while (true) {
|
|
4112
|
-
const
|
|
4113
|
-
if (
|
|
4112
|
+
const read2 = await input.read(buffer);
|
|
4113
|
+
if (read2 === null)
|
|
4114
4114
|
break;
|
|
4115
|
-
await writeAll(output, buffer.subarray(0,
|
|
4115
|
+
await writeAll(output, buffer.subarray(0, read2));
|
|
4116
4116
|
}
|
|
4117
4117
|
} finally {
|
|
4118
4118
|
await input.close();
|
|
@@ -4126,10 +4126,10 @@ async function readAt(file, offset, length) {
|
|
|
4126
4126
|
const output = new Uint8Array(length);
|
|
4127
4127
|
let position = 0;
|
|
4128
4128
|
while (position < length) {
|
|
4129
|
-
const
|
|
4130
|
-
if (
|
|
4129
|
+
const read2 = await file.read(output.subarray(position));
|
|
4130
|
+
if (read2 === null)
|
|
4131
4131
|
throw invalidZip("container", "ZIP file is truncated");
|
|
4132
|
-
position +=
|
|
4132
|
+
position += read2;
|
|
4133
4133
|
}
|
|
4134
4134
|
return output;
|
|
4135
4135
|
}
|
|
@@ -4608,6 +4608,39 @@ const EXT_TOOLS_APP_TYPE = "ext_tools";
|
|
|
4608
4608
|
const EXT_TOOLS_MANIFEST_FILE = "ext-manifest.json";
|
|
4609
4609
|
const EXT_TOOLS_MANIFEST_SCHEMA = "buckyos.ext_tools/1";
|
|
4610
4610
|
const MAX_EXT_TOOLS_PAYLOAD_BYTES = 64 * 1024 * 1024 * 1024;
|
|
4611
|
+
const EXT_TOOLS_RESERVED_COMMANDS = [
|
|
4612
|
+
"agent-session",
|
|
4613
|
+
"agent_tool",
|
|
4614
|
+
"ai_provider",
|
|
4615
|
+
"ai_provider_test",
|
|
4616
|
+
"ai_quota",
|
|
4617
|
+
"aicc-tool",
|
|
4618
|
+
"ask_user",
|
|
4619
|
+
"buckyos",
|
|
4620
|
+
"caption_image",
|
|
4621
|
+
"detect_image",
|
|
4622
|
+
"edit_image",
|
|
4623
|
+
"edit_video",
|
|
4624
|
+
"enhance_audio",
|
|
4625
|
+
"extend_video",
|
|
4626
|
+
"gen_image",
|
|
4627
|
+
"gen_music",
|
|
4628
|
+
"gen_video",
|
|
4629
|
+
"import_office",
|
|
4630
|
+
"import_table",
|
|
4631
|
+
"inpaint_image",
|
|
4632
|
+
"llm_understand_media",
|
|
4633
|
+
"materialize_resource",
|
|
4634
|
+
"ocr_image",
|
|
4635
|
+
"remove_bg",
|
|
4636
|
+
"resume_aicc_task",
|
|
4637
|
+
"segment_image",
|
|
4638
|
+
"speech_to_text",
|
|
4639
|
+
"text_to_speech",
|
|
4640
|
+
"upscale_image",
|
|
4641
|
+
"upscale_video",
|
|
4642
|
+
"xagent"
|
|
4643
|
+
];
|
|
4611
4644
|
const MAX_EXT_TOOLS_LAUNCHER_BYTES = 1024 * 1024;
|
|
4612
4645
|
const EXT_TOOLS_ID = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
4613
4646
|
const EXT_TOOLS_COMMAND = /^[A-Za-z0-9_+-][A-Za-z0-9._+-]*$/;
|
|
@@ -4636,8 +4669,8 @@ function extToolsManifestErrors(value) {
|
|
|
4636
4669
|
errors.push(`schema must be ${EXT_TOOLS_MANIFEST_SCHEMA}`);
|
|
4637
4670
|
if (typeof manifest.id !== "string" || !EXT_TOOLS_ID.test(manifest.id))
|
|
4638
4671
|
errors.push("id must be lowercase letters, digits and -");
|
|
4639
|
-
if (typeof manifest.version !== "string" ||
|
|
4640
|
-
errors.push("version
|
|
4672
|
+
if (typeof manifest.version !== "string" || !/^[A-Za-z0-9._+-]+$/.test(manifest.version))
|
|
4673
|
+
errors.push("version must be letters, digits and ._+-");
|
|
4641
4674
|
if (!Array.isArray(manifest.provides) || manifest.provides.length === 0)
|
|
4642
4675
|
errors.push("provides must not be empty");
|
|
4643
4676
|
const commands = /* @__PURE__ */ new Set();
|
|
@@ -4650,6 +4683,8 @@ function extToolsManifestErrors(value) {
|
|
|
4650
4683
|
}
|
|
4651
4684
|
if (commands.has(command))
|
|
4652
4685
|
errors.push(`provides: command ${command} is listed twice`);
|
|
4686
|
+
if (EXT_TOOLS_RESERVED_COMMANDS.includes(command))
|
|
4687
|
+
errors.push(`provides: ${command} is a standard command and cannot be provided by a package`);
|
|
4653
4688
|
commands.add(command);
|
|
4654
4689
|
if (typeof entry.version_probe !== "string" || !entry.version_probe.trim())
|
|
4655
4690
|
errors.push(`provides: ${command} has no version_probe`);
|
|
@@ -4713,8 +4748,9 @@ function extToolsPayloadErrors(manifest, platform, tree, buildPaths = []) {
|
|
|
4713
4748
|
errors.push(`bin/${provided.command}: the launcher of a provided command is missing`);
|
|
4714
4749
|
else if (!windows && !launcher.executable)
|
|
4715
4750
|
errors.push(`bin/${provided.command}: the launcher is not executable`);
|
|
4716
|
-
|
|
4717
|
-
|
|
4751
|
+
const smoke = provided.smoke && windows ? provided.smoke.replace(/\.[^./]+$/, ".ps1") : provided.smoke;
|
|
4752
|
+
if (smoke && !tree.files.has(smoke))
|
|
4753
|
+
errors.push(`${smoke}: the smoke script of ${provided.command} is missing`);
|
|
4718
4754
|
}
|
|
4719
4755
|
for (const path of tree.files.keys()) {
|
|
4720
4756
|
if (!path.startsWith("bin/"))
|
|
@@ -5525,7 +5561,7 @@ function validateContentHandlers(value, permissions) {
|
|
|
5525
5561
|
}
|
|
5526
5562
|
return value;
|
|
5527
5563
|
}
|
|
5528
|
-
const PACKAGE_VERSION = "0.7.
|
|
5564
|
+
const PACKAGE_VERSION = "0.7.170";
|
|
5529
5565
|
const TOOL_VERSION = PACKAGE_VERSION;
|
|
5530
5566
|
const SDK_VERSION = PACKAGE_VERSION;
|
|
5531
5567
|
const PROTOCOL_VERSION = "1";
|
|
@@ -5542,7 +5578,7 @@ const VERSION$1 = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
|
5542
5578
|
const SHA256_ID = /^sha256:[0-9a-f]{64}$/;
|
|
5543
5579
|
const OBJECT_ID = /^(?:appdoc|pkg):[0-9a-f]{64}$/;
|
|
5544
5580
|
const SAFE_GENERATED_FILE = /^[A-Za-z0-9._-]+$/;
|
|
5545
|
-
const OBJECT_OUTPUT$
|
|
5581
|
+
const OBJECT_OUTPUT$d = { type: "object", additionalProperties: true };
|
|
5546
5582
|
const APP_KINDS = ["static-web", "script", "docker", "agent-skills", "aiws-controls", "ext-tools"];
|
|
5547
5583
|
const PATH_KINDS = {
|
|
5548
5584
|
"static-web": { key: "web", category: "web", selectorType: "static" },
|
|
@@ -5600,7 +5636,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
5600
5636
|
},
|
|
5601
5637
|
additionalProperties: false
|
|
5602
5638
|
},
|
|
5603
|
-
outputSchema: OBJECT_OUTPUT$
|
|
5639
|
+
outputSchema: OBJECT_OUTPUT$d,
|
|
5604
5640
|
resultSchemaVersion: 1,
|
|
5605
5641
|
access: { mode: "fixed", level: "read" },
|
|
5606
5642
|
asyncMode: "sync",
|
|
@@ -5657,7 +5693,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
5657
5693
|
},
|
|
5658
5694
|
additionalProperties: false
|
|
5659
5695
|
},
|
|
5660
|
-
outputSchema: OBJECT_OUTPUT$
|
|
5696
|
+
outputSchema: OBJECT_OUTPUT$d,
|
|
5661
5697
|
resultSchemaVersion: 1,
|
|
5662
5698
|
access: { mode: "fixed", level: "write" },
|
|
5663
5699
|
asyncMode: "sync",
|
|
@@ -5685,7 +5721,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
5685
5721
|
properties: { meta_dir: { type: "string", minLength: 1 } },
|
|
5686
5722
|
additionalProperties: false
|
|
5687
5723
|
},
|
|
5688
|
-
outputSchema: OBJECT_OUTPUT$
|
|
5724
|
+
outputSchema: OBJECT_OUTPUT$d,
|
|
5689
5725
|
resultSchemaVersion: 1,
|
|
5690
5726
|
access: { mode: "fixed", level: "write" },
|
|
5691
5727
|
asyncMode: "sync",
|
|
@@ -5706,7 +5742,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
5706
5742
|
properties: { dist_dir: { type: "string", minLength: 1 } },
|
|
5707
5743
|
additionalProperties: false
|
|
5708
5744
|
},
|
|
5709
|
-
outputSchema: OBJECT_OUTPUT$
|
|
5745
|
+
outputSchema: OBJECT_OUTPUT$d,
|
|
5710
5746
|
resultSchemaVersion: 1,
|
|
5711
5747
|
access: { mode: "fixed", level: "write" },
|
|
5712
5748
|
asyncMode: "sync",
|
|
@@ -5726,7 +5762,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
5726
5762
|
required: ["pikg_path"],
|
|
5727
5763
|
additionalProperties: false
|
|
5728
5764
|
},
|
|
5729
|
-
outputSchema: OBJECT_OUTPUT$
|
|
5765
|
+
outputSchema: OBJECT_OUTPUT$d,
|
|
5730
5766
|
resultSchemaVersion: 1,
|
|
5731
5767
|
access: { mode: "fixed", level: "read" },
|
|
5732
5768
|
asyncMode: "sync",
|
|
@@ -5747,7 +5783,7 @@ function createPikgModule(dependencies = {}) {
|
|
|
5747
5783
|
properties: { meta_dir: { type: "string", minLength: 1 } },
|
|
5748
5784
|
additionalProperties: false
|
|
5749
5785
|
},
|
|
5750
|
-
outputSchema: OBJECT_OUTPUT$
|
|
5786
|
+
outputSchema: OBJECT_OUTPUT$d,
|
|
5751
5787
|
resultSchemaVersion: 1,
|
|
5752
5788
|
access: { mode: "fixed", level: "destructive" },
|
|
5753
5789
|
asyncMode: "sync",
|
|
@@ -6059,10 +6095,17 @@ echo "${id} ${version}"
|
|
|
6059
6095
|
`,
|
|
6060
6096
|
{ mode: 493 }
|
|
6061
6097
|
);
|
|
6062
|
-
await host2.writeTextFile(
|
|
6098
|
+
await host2.writeTextFile(
|
|
6099
|
+
join(payload, "smoke", windows ? `${id}.ps1` : `${id}.sh`),
|
|
6100
|
+
windows ? `$ErrorActionPreference = 'Continue'
|
|
6101
|
+
& ${id} --version | Out-Null
|
|
6102
|
+
if ($LASTEXITCODE -ne 0) { exit 1 }
|
|
6103
|
+
` : `#!/bin/sh
|
|
6063
6104
|
set -eu
|
|
6064
6105
|
${id} --version >/dev/null
|
|
6065
|
-
`,
|
|
6106
|
+
`,
|
|
6107
|
+
{ mode: 493 }
|
|
6108
|
+
);
|
|
6066
6109
|
}
|
|
6067
6110
|
async function readExtToolsManifestFile(path) {
|
|
6068
6111
|
let text2;
|
|
@@ -7277,7 +7320,7 @@ const CONTROL_PANEL_SERVICE = "control-panel";
|
|
|
7277
7320
|
const PLAN_SCHEMA_VERSION = 4;
|
|
7278
7321
|
const STAGING_RELEASE_TIMEOUT_MS = 5e3;
|
|
7279
7322
|
const ZIP_LOCAL_MAGIC = [80, 75, 3, 4];
|
|
7280
|
-
const OBJECT_OUTPUT$
|
|
7323
|
+
const OBJECT_OUTPUT$c = { type: "object", additionalProperties: true };
|
|
7281
7324
|
const INSTALL_POLICIES = [
|
|
7282
7325
|
"strict-public",
|
|
7283
7326
|
"normal",
|
|
@@ -7328,7 +7371,7 @@ function cancelCommand$1() {
|
|
|
7328
7371
|
required: ["task_id"],
|
|
7329
7372
|
additionalProperties: false
|
|
7330
7373
|
},
|
|
7331
|
-
outputSchema: OBJECT_OUTPUT$
|
|
7374
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
7332
7375
|
resultSchemaVersion: 1,
|
|
7333
7376
|
access: { mode: "fixed", level: "write" },
|
|
7334
7377
|
asyncMode: "sync",
|
|
@@ -7363,7 +7406,7 @@ function fetchCommand(dependencies) {
|
|
|
7363
7406
|
target: { type: "object", additionalProperties: true },
|
|
7364
7407
|
install_params: { type: "object", additionalProperties: true }
|
|
7365
7408
|
}),
|
|
7366
|
-
outputSchema: OBJECT_OUTPUT$
|
|
7409
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
7367
7410
|
resultSchemaVersion: 1,
|
|
7368
7411
|
access: { mode: "fixed", level: "read" },
|
|
7369
7412
|
asyncMode: "sync",
|
|
@@ -7380,7 +7423,7 @@ function listCommand$2() {
|
|
|
7380
7423
|
verb: "list",
|
|
7381
7424
|
summary: "List visible installed Apps",
|
|
7382
7425
|
inputSchema: emptyInputSchema(),
|
|
7383
|
-
outputSchema: OBJECT_OUTPUT$
|
|
7426
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
7384
7427
|
resultSchemaVersion: 1,
|
|
7385
7428
|
access: { mode: "fixed", level: "read" },
|
|
7386
7429
|
asyncMode: "sync",
|
|
@@ -7438,7 +7481,7 @@ function installCommand(dependencies) {
|
|
|
7438
7481
|
no_wait: { type: "boolean" },
|
|
7439
7482
|
policy: { type: "string", enum: [...INSTALL_POLICIES] }
|
|
7440
7483
|
}),
|
|
7441
|
-
outputSchema: OBJECT_OUTPUT$
|
|
7484
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
7442
7485
|
resultSchemaVersion: 1,
|
|
7443
7486
|
access: { mode: "fixed", level: "write" },
|
|
7444
7487
|
asyncMode: "either",
|
|
@@ -7482,7 +7525,7 @@ function upgradeCommand(dependencies) {
|
|
|
7482
7525
|
},
|
|
7483
7526
|
additionalProperties: false
|
|
7484
7527
|
},
|
|
7485
|
-
outputSchema: OBJECT_OUTPUT$
|
|
7528
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
7486
7529
|
resultSchemaVersion: 1,
|
|
7487
7530
|
access: { mode: "fixed", level: "write" },
|
|
7488
7531
|
asyncMode: "either",
|
|
@@ -7611,7 +7654,7 @@ function statusCommand$1() {
|
|
|
7611
7654
|
properties: { app_name: { type: "string", minLength: 1 } },
|
|
7612
7655
|
additionalProperties: false
|
|
7613
7656
|
},
|
|
7614
|
-
outputSchema: OBJECT_OUTPUT$
|
|
7657
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
7615
7658
|
resultSchemaVersion: 1,
|
|
7616
7659
|
access: { mode: "fixed", level: "read" },
|
|
7617
7660
|
asyncMode: "sync",
|
|
@@ -7682,7 +7725,7 @@ function publishCommand() {
|
|
|
7682
7725
|
required: ["local_dir", "app_doc"],
|
|
7683
7726
|
additionalProperties: false
|
|
7684
7727
|
},
|
|
7685
|
-
outputSchema: OBJECT_OUTPUT$
|
|
7728
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
7686
7729
|
resultSchemaVersion: 1,
|
|
7687
7730
|
access: { mode: "fixed", level: "write" },
|
|
7688
7731
|
asyncMode: "sync",
|
|
@@ -7951,6 +7994,12 @@ async function mutateLifecycle(ctx, input, verb) {
|
|
|
7951
7994
|
const task = await waitForTask(ctx, taskId);
|
|
7952
7995
|
return { ...submitted, status: task };
|
|
7953
7996
|
}
|
|
7997
|
+
async function stageLocalPikg(ctx, path) {
|
|
7998
|
+
const prepared = await prepareSource(ctx, { pikg: path }, "inspect", {});
|
|
7999
|
+
if (prepared.kind === "catalog")
|
|
8000
|
+
throw new UsageError("INVALID_PIKG_SOURCE", "not a local PIKG");
|
|
8001
|
+
return prepared.staging;
|
|
8002
|
+
}
|
|
7954
8003
|
async function prepareSource(ctx, input, purpose, dependencies) {
|
|
7955
8004
|
const classified = await classifySource(ctx, input);
|
|
7956
8005
|
if (classified.kind === "catalog")
|
|
@@ -8087,12 +8136,12 @@ async function* fileChunks(file, size) {
|
|
|
8087
8136
|
while (true) {
|
|
8088
8137
|
let used = 0;
|
|
8089
8138
|
while (used < buffer.length) {
|
|
8090
|
-
const
|
|
8091
|
-
if (
|
|
8139
|
+
const read2 = await file.read(buffer.subarray(used));
|
|
8140
|
+
if (read2 === null)
|
|
8092
8141
|
break;
|
|
8093
|
-
if (
|
|
8142
|
+
if (read2 === 0)
|
|
8094
8143
|
throw new UsageError("PIKG_READ_FAILED", "PIKG read made no progress");
|
|
8095
|
-
used +=
|
|
8144
|
+
used += read2;
|
|
8096
8145
|
}
|
|
8097
8146
|
if (used === 0)
|
|
8098
8147
|
break;
|
|
@@ -8815,7 +8864,7 @@ function selectorCommand(options) {
|
|
|
8815
8864
|
required: ["app_name"],
|
|
8816
8865
|
additionalProperties: false
|
|
8817
8866
|
},
|
|
8818
|
-
outputSchema: OBJECT_OUTPUT$
|
|
8867
|
+
outputSchema: OBJECT_OUTPUT$c,
|
|
8819
8868
|
resultSchemaVersion: 1,
|
|
8820
8869
|
access: { mode: "fixed", level: options.access },
|
|
8821
8870
|
asyncMode: options.asyncMode,
|
|
@@ -8979,7 +9028,7 @@ function toHex(bytes) {
|
|
|
8979
9028
|
return [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
8980
9029
|
}
|
|
8981
9030
|
const CONTROL_PANEL$3 = "control-panel";
|
|
8982
|
-
const OBJECT_OUTPUT$
|
|
9031
|
+
const OBJECT_OUTPUT$b = { type: "object", additionalProperties: true };
|
|
8983
9032
|
function createDiagnosticModule(dependencies = {}) {
|
|
8984
9033
|
return {
|
|
8985
9034
|
name: "diagnostic",
|
|
@@ -9018,7 +9067,7 @@ function collectCommand() {
|
|
|
9018
9067
|
required: ["services"],
|
|
9019
9068
|
additionalProperties: false
|
|
9020
9069
|
},
|
|
9021
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9070
|
+
outputSchema: OBJECT_OUTPUT$b,
|
|
9022
9071
|
resultSchemaVersion: 1,
|
|
9023
9072
|
access: { mode: "fixed", level: "privileged" },
|
|
9024
9073
|
asyncMode: "task",
|
|
@@ -9072,7 +9121,7 @@ function exportCommand$2(dependencies) {
|
|
|
9072
9121
|
required: ["bundle_id", "path"],
|
|
9073
9122
|
additionalProperties: false
|
|
9074
9123
|
},
|
|
9075
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9124
|
+
outputSchema: OBJECT_OUTPUT$b,
|
|
9076
9125
|
resultSchemaVersion: 1,
|
|
9077
9126
|
access: { mode: "fixed", level: "privileged" },
|
|
9078
9127
|
asyncMode: "sync",
|
|
@@ -9114,7 +9163,7 @@ function compact$2(value) {
|
|
|
9114
9163
|
return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== void 0));
|
|
9115
9164
|
}
|
|
9116
9165
|
const CONTROL_PANEL$2 = "control-panel";
|
|
9117
|
-
const OBJECT_OUTPUT$
|
|
9166
|
+
const OBJECT_OUTPUT$a = { type: "object", additionalProperties: true };
|
|
9118
9167
|
const LOG_LEVELS = ["error", "warning", "info", "debug", "trace"];
|
|
9119
9168
|
function createLogModule(dependencies = {}) {
|
|
9120
9169
|
return {
|
|
@@ -9135,7 +9184,7 @@ function servicesCommand() {
|
|
|
9135
9184
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
9136
9185
|
outputSchema: {
|
|
9137
9186
|
type: "object",
|
|
9138
|
-
properties: { services: { type: "array", items: OBJECT_OUTPUT$
|
|
9187
|
+
properties: { services: { type: "array", items: OBJECT_OUTPUT$a } },
|
|
9139
9188
|
required: ["services"],
|
|
9140
9189
|
additionalProperties: false
|
|
9141
9190
|
},
|
|
@@ -9208,7 +9257,7 @@ function tailCommand(dependencies) {
|
|
|
9208
9257
|
}
|
|
9209
9258
|
],
|
|
9210
9259
|
inputSchema: filterSchema({ from: { type: "string", enum: ["start", "end"] } }),
|
|
9211
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9260
|
+
outputSchema: OBJECT_OUTPUT$a,
|
|
9212
9261
|
resultSchemaVersion: 1,
|
|
9213
9262
|
access: { mode: "fixed", level: "read" },
|
|
9214
9263
|
asyncMode: "stream",
|
|
@@ -9264,7 +9313,7 @@ function exportCommand$1(dependencies) {
|
|
|
9264
9313
|
...filterSchema({ path: { type: "string", minLength: 1 } }),
|
|
9265
9314
|
required: ["path"]
|
|
9266
9315
|
},
|
|
9267
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9316
|
+
outputSchema: OBJECT_OUTPUT$a,
|
|
9268
9317
|
resultSchemaVersion: 1,
|
|
9269
9318
|
access: { mode: "fixed", level: "read" },
|
|
9270
9319
|
asyncMode: "sync",
|
|
@@ -9416,7 +9465,7 @@ function abortableSleep(milliseconds, signal) {
|
|
|
9416
9465
|
}
|
|
9417
9466
|
const TASK_MANAGER = "task-manager";
|
|
9418
9467
|
const CONTROL_PANEL$1 = "control-panel";
|
|
9419
|
-
const OBJECT_OUTPUT$
|
|
9468
|
+
const OBJECT_OUTPUT$9 = { type: "object", additionalProperties: true };
|
|
9420
9469
|
function createTaskModule() {
|
|
9421
9470
|
return {
|
|
9422
9471
|
name: "task",
|
|
@@ -9519,7 +9568,7 @@ function getCommand$2() {
|
|
|
9519
9568
|
required: ["task_id"],
|
|
9520
9569
|
additionalProperties: false
|
|
9521
9570
|
},
|
|
9522
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9571
|
+
outputSchema: OBJECT_OUTPUT$9,
|
|
9523
9572
|
resultSchemaVersion: 1,
|
|
9524
9573
|
access: { mode: "fixed", level: "read" },
|
|
9525
9574
|
asyncMode: "sync",
|
|
@@ -9560,7 +9609,7 @@ function waitCommand() {
|
|
|
9560
9609
|
summary: "Stream changes until a Task becomes terminal",
|
|
9561
9610
|
positionals: [{ name: "task_id", description: "Opaque Task ID", required: true }],
|
|
9562
9611
|
inputSchema: taskIdSchema(),
|
|
9563
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9612
|
+
outputSchema: OBJECT_OUTPUT$9,
|
|
9564
9613
|
resultSchemaVersion: 1,
|
|
9565
9614
|
access: { mode: "fixed", level: "read" },
|
|
9566
9615
|
asyncMode: "stream",
|
|
@@ -9611,7 +9660,7 @@ function cancelCommand() {
|
|
|
9611
9660
|
required: ["task_id"],
|
|
9612
9661
|
additionalProperties: false
|
|
9613
9662
|
},
|
|
9614
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9663
|
+
outputSchema: OBJECT_OUTPUT$9,
|
|
9615
9664
|
resultSchemaVersion: 1,
|
|
9616
9665
|
access: { mode: "fixed", level: "write" },
|
|
9617
9666
|
asyncMode: "sync",
|
|
@@ -9654,7 +9703,7 @@ function retryCommand() {
|
|
|
9654
9703
|
required: ["task_id"],
|
|
9655
9704
|
additionalProperties: false
|
|
9656
9705
|
},
|
|
9657
|
-
outputSchema: OBJECT_OUTPUT$
|
|
9706
|
+
outputSchema: OBJECT_OUTPUT$9,
|
|
9658
9707
|
resultSchemaVersion: 1,
|
|
9659
9708
|
access: { mode: "fixed", level: "write" },
|
|
9660
9709
|
asyncMode: "either",
|
|
@@ -9728,7 +9777,7 @@ function invalidResponse$1(label) {
|
|
|
9728
9777
|
throw new ToolError("INVALID_SERVICE_RESPONSE", `${label} is invalid`, EXIT_INTERNAL);
|
|
9729
9778
|
}
|
|
9730
9779
|
const sdk = provisionSdk;
|
|
9731
|
-
const OBJECT_OUTPUT$
|
|
9780
|
+
const OBJECT_OUTPUT$8 = { type: "object", additionalProperties: true };
|
|
9732
9781
|
const ROOT_OPTION = {
|
|
9733
9782
|
name: "root",
|
|
9734
9783
|
description: "Installed BuckyOS root on this machine (BUCKYOS_ROOT); read by status/check, written by activate",
|
|
@@ -9812,7 +9861,7 @@ function statusCommand(deps) {
|
|
|
9812
9861
|
additionalProperties: false
|
|
9813
9862
|
},
|
|
9814
9863
|
outputSchema: {
|
|
9815
|
-
...OBJECT_OUTPUT$
|
|
9864
|
+
...OBJECT_OUTPUT$8,
|
|
9816
9865
|
properties: {
|
|
9817
9866
|
root: { type: "string" },
|
|
9818
9867
|
state: {
|
|
@@ -9850,7 +9899,7 @@ function checkCommand(deps) {
|
|
|
9850
9899
|
additionalProperties: false
|
|
9851
9900
|
},
|
|
9852
9901
|
outputSchema: {
|
|
9853
|
-
...OBJECT_OUTPUT$
|
|
9902
|
+
...OBJECT_OUTPUT$8,
|
|
9854
9903
|
properties: {
|
|
9855
9904
|
ready: { type: "boolean" },
|
|
9856
9905
|
root: { type: "string" },
|
|
@@ -9898,7 +9947,7 @@ function activateCommand(deps) {
|
|
|
9898
9947
|
additionalProperties: false
|
|
9899
9948
|
},
|
|
9900
9949
|
outputSchema: {
|
|
9901
|
-
...OBJECT_OUTPUT$
|
|
9950
|
+
...OBJECT_OUTPUT$8,
|
|
9902
9951
|
properties: {
|
|
9903
9952
|
root: { type: "string" },
|
|
9904
9953
|
state: { type: "string", enum: ["configured"] },
|
|
@@ -10180,7 +10229,7 @@ function inputFingerprint(input) {
|
|
|
10180
10229
|
hash.update(new TextEncoder().encode(JSON.stringify(material)));
|
|
10181
10230
|
return hash.digestHex();
|
|
10182
10231
|
}
|
|
10183
|
-
const OBJECT_OUTPUT$
|
|
10232
|
+
const OBJECT_OUTPUT$7 = { type: "object", additionalProperties: true };
|
|
10184
10233
|
const SKILL_KINDS = ["cmd", "goal"];
|
|
10185
10234
|
const SKILLS_SUB_PKG = "agent_skills";
|
|
10186
10235
|
const SKILL_DIRS = ["cmd_skills", "goal_skills", "tools"];
|
|
@@ -10217,7 +10266,7 @@ function createSkillModule() {
|
|
|
10217
10266
|
required: ["agent_id"],
|
|
10218
10267
|
additionalProperties: false
|
|
10219
10268
|
},
|
|
10220
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10269
|
+
outputSchema: OBJECT_OUTPUT$7,
|
|
10221
10270
|
resultSchemaVersion: 1,
|
|
10222
10271
|
access: { mode: "fixed", level: "read" },
|
|
10223
10272
|
asyncMode: "sync",
|
|
@@ -10233,6 +10282,27 @@ function createSkillModule() {
|
|
|
10233
10282
|
return { agent_id: agentId, ...kind ? { kind } : {}, total: skills.length, skills };
|
|
10234
10283
|
}
|
|
10235
10284
|
},
|
|
10285
|
+
{
|
|
10286
|
+
verb: "status",
|
|
10287
|
+
summary: "The commands each cmd skill relies on, on a runtime of the Agent, and the extension package that would bring what is missing",
|
|
10288
|
+
options: [
|
|
10289
|
+
AGENT_OPTION,
|
|
10290
|
+
{ name: "runtime", property: "runtime_id", description: "Runtime id (default: the private runtime)", type: "string" }
|
|
10291
|
+
],
|
|
10292
|
+
inputSchema: {
|
|
10293
|
+
type: "object",
|
|
10294
|
+
properties: { agent_id: { type: "string", minLength: 1 }, runtime_id: { type: "string", minLength: 1 } },
|
|
10295
|
+
required: ["agent_id"],
|
|
10296
|
+
additionalProperties: false
|
|
10297
|
+
},
|
|
10298
|
+
outputSchema: OBJECT_OUTPUT$7,
|
|
10299
|
+
resultSchemaVersion: 1,
|
|
10300
|
+
access: { mode: "fixed", level: "read" },
|
|
10301
|
+
asyncMode: "sync",
|
|
10302
|
+
requiresSession: true,
|
|
10303
|
+
examples: ["buckyos skill status --agent jarvis.example.zone --runtime host"],
|
|
10304
|
+
handler: async (ctx, input) => await callService(ctx, agentIdFrom(input), "skills.status", { runtime_id: input.runtime_id ?? null })
|
|
10305
|
+
},
|
|
10236
10306
|
{
|
|
10237
10307
|
verb: "install",
|
|
10238
10308
|
summary: "Install the skills of a skill PIKG into an Agent",
|
|
@@ -10256,7 +10326,7 @@ function createSkillModule() {
|
|
|
10256
10326
|
required: ["pikg_path", "agent_id"],
|
|
10257
10327
|
additionalProperties: false
|
|
10258
10328
|
},
|
|
10259
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10329
|
+
outputSchema: OBJECT_OUTPUT$7,
|
|
10260
10330
|
resultSchemaVersion: 1,
|
|
10261
10331
|
access: { mode: "fixed", level: "write" },
|
|
10262
10332
|
asyncMode: "sync",
|
|
@@ -10283,7 +10353,7 @@ function createSkillModule() {
|
|
|
10283
10353
|
required: ["name", "agent_id"],
|
|
10284
10354
|
additionalProperties: false
|
|
10285
10355
|
},
|
|
10286
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10356
|
+
outputSchema: OBJECT_OUTPUT$7,
|
|
10287
10357
|
resultSchemaVersion: 1,
|
|
10288
10358
|
access: { mode: "fixed", level: "destructive" },
|
|
10289
10359
|
asyncMode: "sync",
|
|
@@ -10324,21 +10394,24 @@ async function installSkills(ctx, input) {
|
|
|
10324
10394
|
}
|
|
10325
10395
|
files[entry.path] = { content: base64(entry.bytes), executable: entry.executable };
|
|
10326
10396
|
}
|
|
10397
|
+
const skillPackage = {
|
|
10398
|
+
package: inspection.app.name,
|
|
10399
|
+
version: inspection.app.version,
|
|
10400
|
+
pikg_digest: inspection.pikg_digest,
|
|
10401
|
+
files
|
|
10402
|
+
};
|
|
10327
10403
|
const result = await callService(ctx, agentId, "skills.install", {
|
|
10328
|
-
package:
|
|
10329
|
-
package: inspection.app.name,
|
|
10330
|
-
version: inspection.app.version,
|
|
10331
|
-
pikg_digest: inspection.pikg_digest,
|
|
10332
|
-
files
|
|
10333
|
-
},
|
|
10404
|
+
package: skillPackage,
|
|
10334
10405
|
replace: input.replace === true
|
|
10335
10406
|
});
|
|
10407
|
+
const commands = await callService(ctx, agentId, "skills.install_plan", { package: skillPackage }).catch(() => null);
|
|
10336
10408
|
return {
|
|
10337
10409
|
agent_id: agentId,
|
|
10338
10410
|
pikg_path: inspection.pikg_path,
|
|
10339
10411
|
pikg_digest: inspection.pikg_digest,
|
|
10340
10412
|
...expectObject(result, "skills.install"),
|
|
10341
|
-
...ignored.length ? { ignored_files: ignored } : {}
|
|
10413
|
+
...ignored.length ? { ignored_files: ignored } : {},
|
|
10414
|
+
...commands ? { commands } : {}
|
|
10342
10415
|
};
|
|
10343
10416
|
}
|
|
10344
10417
|
async function removeSkill(ctx, input) {
|
|
@@ -10404,7 +10477,7 @@ function base64(bytes) {
|
|
|
10404
10477
|
return btoa(binary);
|
|
10405
10478
|
}
|
|
10406
10479
|
const CONTROL_PANEL = "control-panel";
|
|
10407
|
-
const OBJECT_OUTPUT$
|
|
10480
|
+
const OBJECT_OUTPUT$6 = { type: "object", additionalProperties: true };
|
|
10408
10481
|
const AGENT_POSITIONAL = {
|
|
10409
10482
|
name: "agent_id",
|
|
10410
10483
|
description: "Agent ID as `agent list` prints it (raw host name, e.g. jarvis.example.zone)"
|
|
@@ -10428,7 +10501,7 @@ function createAgentModule() {
|
|
|
10428
10501
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
10429
10502
|
outputSchema: {
|
|
10430
10503
|
type: "object",
|
|
10431
|
-
properties: { agents: { type: "array", items: OBJECT_OUTPUT$
|
|
10504
|
+
properties: { agents: { type: "array", items: OBJECT_OUTPUT$6 } },
|
|
10432
10505
|
required: ["agents"],
|
|
10433
10506
|
additionalProperties: false
|
|
10434
10507
|
},
|
|
@@ -10454,7 +10527,7 @@ function createAgentModule() {
|
|
|
10454
10527
|
summary: "Get one Agent: profile, settings, install state, template, and runtime",
|
|
10455
10528
|
positionals: [AGENT_POSITIONAL],
|
|
10456
10529
|
inputSchema: AGENT_INPUT,
|
|
10457
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10530
|
+
outputSchema: OBJECT_OUTPUT$6,
|
|
10458
10531
|
resultSchemaVersion: 1,
|
|
10459
10532
|
access: { mode: "fixed", level: "read" },
|
|
10460
10533
|
asyncMode: "sync",
|
|
@@ -10467,7 +10540,7 @@ function createAgentModule() {
|
|
|
10467
10540
|
summary: "Get the public profile (display name, bio, avatar) of an Agent",
|
|
10468
10541
|
positionals: [AGENT_POSITIONAL],
|
|
10469
10542
|
inputSchema: AGENT_INPUT,
|
|
10470
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10543
|
+
outputSchema: OBJECT_OUTPUT$6,
|
|
10471
10544
|
resultSchemaVersion: 1,
|
|
10472
10545
|
access: { mode: "fixed", level: "read" },
|
|
10473
10546
|
asyncMode: "sync",
|
|
@@ -10508,8 +10581,8 @@ function createAgentModule() {
|
|
|
10508
10581
|
type: "object",
|
|
10509
10582
|
properties: {
|
|
10510
10583
|
agent_id: { type: "string" },
|
|
10511
|
-
before: OBJECT_OUTPUT$
|
|
10512
|
-
profile: OBJECT_OUTPUT$
|
|
10584
|
+
before: OBJECT_OUTPUT$6,
|
|
10585
|
+
profile: OBJECT_OUTPUT$6
|
|
10513
10586
|
},
|
|
10514
10587
|
required: ["agent_id", "before", "profile"],
|
|
10515
10588
|
additionalProperties: false
|
|
@@ -10554,7 +10627,7 @@ async function callAgent(ctx, method, params) {
|
|
|
10554
10627
|
}
|
|
10555
10628
|
}
|
|
10556
10629
|
const AICC = "aicc";
|
|
10557
|
-
const OBJECT_OUTPUT$
|
|
10630
|
+
const OBJECT_OUTPUT$5 = { type: "object", additionalProperties: true };
|
|
10558
10631
|
const EMPTY_INPUT = { type: "object", properties: {}, additionalProperties: false };
|
|
10559
10632
|
const RANGES = ["last1d", "last7d", "last30d"];
|
|
10560
10633
|
const GROUPS = [
|
|
@@ -10602,7 +10675,7 @@ function quotaCommand() {
|
|
|
10602
10675
|
properties: { app: { type: "string", minLength: 1 } },
|
|
10603
10676
|
additionalProperties: false
|
|
10604
10677
|
},
|
|
10605
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10678
|
+
outputSchema: OBJECT_OUTPUT$5,
|
|
10606
10679
|
resultSchemaVersion: 1,
|
|
10607
10680
|
access: { mode: "fixed", level: "read" },
|
|
10608
10681
|
asyncMode: "sync",
|
|
@@ -10620,7 +10693,7 @@ function readCommand$2(options) {
|
|
|
10620
10693
|
summary: options.summary,
|
|
10621
10694
|
description: options.description,
|
|
10622
10695
|
inputSchema: EMPTY_INPUT,
|
|
10623
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10696
|
+
outputSchema: OBJECT_OUTPUT$5,
|
|
10624
10697
|
resultSchemaVersion: 1,
|
|
10625
10698
|
access: { mode: "fixed", level: "read" },
|
|
10626
10699
|
asyncMode: "sync",
|
|
@@ -10672,7 +10745,7 @@ function usageCommand() {
|
|
|
10672
10745
|
},
|
|
10673
10746
|
additionalProperties: false
|
|
10674
10747
|
},
|
|
10675
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10748
|
+
outputSchema: OBJECT_OUTPUT$5,
|
|
10676
10749
|
resultSchemaVersion: 1,
|
|
10677
10750
|
access: { mode: "fixed", level: "read" },
|
|
10678
10751
|
asyncMode: "sync",
|
|
@@ -10717,7 +10790,7 @@ function timeRange(input) {
|
|
|
10717
10790
|
}
|
|
10718
10791
|
return { kind: "explicit", start_time_ms: since, end_time_ms: until ?? Date.now() };
|
|
10719
10792
|
}
|
|
10720
|
-
const OBJECT_OUTPUT$
|
|
10793
|
+
const OBJECT_OUTPUT$4 = { type: "object", additionalProperties: true };
|
|
10721
10794
|
const DAY_MS$1 = 864e5;
|
|
10722
10795
|
const EXPIRES_HELP = "1d, 7d (default), 30d, none, or an RFC 3339 time";
|
|
10723
10796
|
function createShareModule() {
|
|
@@ -10828,7 +10901,7 @@ function createCommand() {
|
|
|
10828
10901
|
required: ["path"],
|
|
10829
10902
|
additionalProperties: false
|
|
10830
10903
|
},
|
|
10831
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10904
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
10832
10905
|
resultSchemaVersion: 1,
|
|
10833
10906
|
access: { mode: "fixed", level: "write" },
|
|
10834
10907
|
asyncMode: "either",
|
|
@@ -10897,7 +10970,7 @@ function listCommand() {
|
|
|
10897
10970
|
},
|
|
10898
10971
|
additionalProperties: false
|
|
10899
10972
|
},
|
|
10900
|
-
outputSchema: OBJECT_OUTPUT$
|
|
10973
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
10901
10974
|
resultSchemaVersion: 1,
|
|
10902
10975
|
access: { mode: "fixed", level: "read" },
|
|
10903
10976
|
asyncMode: "sync",
|
|
@@ -10929,7 +11002,7 @@ function getCommand$1() {
|
|
|
10929
11002
|
required: ["share_id"],
|
|
10930
11003
|
additionalProperties: false
|
|
10931
11004
|
},
|
|
10932
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11005
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
10933
11006
|
resultSchemaVersion: 1,
|
|
10934
11007
|
access: { mode: "fixed", level: "read" },
|
|
10935
11008
|
asyncMode: "sync",
|
|
@@ -10966,7 +11039,7 @@ function updateCommand() {
|
|
|
10966
11039
|
required: ["share_id"],
|
|
10967
11040
|
additionalProperties: false
|
|
10968
11041
|
},
|
|
10969
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11042
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
10970
11043
|
resultSchemaVersion: 1,
|
|
10971
11044
|
access: { mode: "fixed", level: "write" },
|
|
10972
11045
|
asyncMode: "sync",
|
|
@@ -11010,7 +11083,7 @@ function stopCommand() {
|
|
|
11010
11083
|
required: ["share_id"],
|
|
11011
11084
|
additionalProperties: false
|
|
11012
11085
|
},
|
|
11013
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11086
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
11014
11087
|
resultSchemaVersion: 1,
|
|
11015
11088
|
access: { mode: "fixed", level: "destructive" },
|
|
11016
11089
|
asyncMode: "sync",
|
|
@@ -11042,7 +11115,7 @@ function statsCommand() {
|
|
|
11042
11115
|
},
|
|
11043
11116
|
additionalProperties: false
|
|
11044
11117
|
},
|
|
11045
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11118
|
+
outputSchema: OBJECT_OUTPUT$4,
|
|
11046
11119
|
resultSchemaVersion: 1,
|
|
11047
11120
|
access: { mode: "fixed", level: "read" },
|
|
11048
11121
|
asyncMode: "sync",
|
|
@@ -11061,7 +11134,7 @@ function statsCommand() {
|
|
|
11061
11134
|
}
|
|
11062
11135
|
};
|
|
11063
11136
|
}
|
|
11064
|
-
const OBJECT_OUTPUT$
|
|
11137
|
+
const OBJECT_OUTPUT$3 = { type: "object", additionalProperties: true };
|
|
11065
11138
|
const SERVICE$1 = "nfs-server";
|
|
11066
11139
|
const MAX_PUT_BYTES = 32 * 1024 * 1024;
|
|
11067
11140
|
const DAY_MS = 864e5;
|
|
@@ -11105,7 +11178,7 @@ function parseBucketTarget(value, keyRequired) {
|
|
|
11105
11178
|
throw new UsageError("INVALID_ARGUMENT", `'${value}' names no key`);
|
|
11106
11179
|
return { bucketId: parts.slice(0, 4).join("/"), key };
|
|
11107
11180
|
}
|
|
11108
|
-
async function call$
|
|
11181
|
+
async function call$2(ctx, method, params) {
|
|
11109
11182
|
try {
|
|
11110
11183
|
return await callService(ctx, SERVICE$1, method, params);
|
|
11111
11184
|
} catch (error) {
|
|
@@ -11166,7 +11239,7 @@ function lsCommand() {
|
|
|
11166
11239
|
},
|
|
11167
11240
|
additionalProperties: false
|
|
11168
11241
|
},
|
|
11169
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11242
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
11170
11243
|
resultSchemaVersion: 1,
|
|
11171
11244
|
access: { mode: "fixed", level: "read" },
|
|
11172
11245
|
asyncMode: "sync",
|
|
@@ -11175,9 +11248,9 @@ function lsCommand() {
|
|
|
11175
11248
|
handler: async (ctx, input) => {
|
|
11176
11249
|
const raw = inputString(input, "target");
|
|
11177
11250
|
if (!raw)
|
|
11178
|
-
return { buckets: await call$
|
|
11251
|
+
return { buckets: await call$2(ctx, "bucket.list", { appid: inputString(input, "appid") }) };
|
|
11179
11252
|
const target = parseBucketTarget(raw, false);
|
|
11180
|
-
return await call$
|
|
11253
|
+
return await call$2(ctx, "bucket.list_objects", {
|
|
11181
11254
|
bucket_id: target.bucketId,
|
|
11182
11255
|
prefix: target.key,
|
|
11183
11256
|
delimiter: inputString(input, "delimiter"),
|
|
@@ -11199,7 +11272,7 @@ function statCommand() {
|
|
|
11199
11272
|
required: ["target"],
|
|
11200
11273
|
additionalProperties: false
|
|
11201
11274
|
},
|
|
11202
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11275
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
11203
11276
|
resultSchemaVersion: 1,
|
|
11204
11277
|
access: { mode: "fixed", level: "read" },
|
|
11205
11278
|
asyncMode: "sync",
|
|
@@ -11209,12 +11282,12 @@ function statCommand() {
|
|
|
11209
11282
|
const target = parseBucketTarget(requiredInputString(input, "target"), false);
|
|
11210
11283
|
if (!target.key) {
|
|
11211
11284
|
const [bucket, quota] = await Promise.all([
|
|
11212
|
-
call$
|
|
11213
|
-
call$
|
|
11285
|
+
call$2(ctx, "bucket.stat", { bucket_id: target.bucketId }),
|
|
11286
|
+
call$2(ctx, "bucket.get_quota", { bucket_id: target.bucketId })
|
|
11214
11287
|
]);
|
|
11215
11288
|
return { bucket, quota };
|
|
11216
11289
|
}
|
|
11217
|
-
return await call$
|
|
11290
|
+
return await call$2(ctx, "bucket.head", { bucket_id: target.bucketId, key: target.key, version: input.version });
|
|
11218
11291
|
}
|
|
11219
11292
|
};
|
|
11220
11293
|
}
|
|
@@ -11240,7 +11313,7 @@ function putCommand() {
|
|
|
11240
11313
|
required: ["target", "file"],
|
|
11241
11314
|
additionalProperties: false
|
|
11242
11315
|
},
|
|
11243
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11316
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
11244
11317
|
resultSchemaVersion: 1,
|
|
11245
11318
|
access: { mode: "fixed", level: "write" },
|
|
11246
11319
|
asyncMode: "sync",
|
|
@@ -11289,7 +11362,7 @@ function getCommand() {
|
|
|
11289
11362
|
required: ["target", "output"],
|
|
11290
11363
|
additionalProperties: false
|
|
11291
11364
|
},
|
|
11292
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11365
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
11293
11366
|
resultSchemaVersion: 1,
|
|
11294
11367
|
access: { mode: "fixed", level: "read" },
|
|
11295
11368
|
asyncMode: "sync",
|
|
@@ -11327,7 +11400,7 @@ function rmCommand() {
|
|
|
11327
11400
|
required: ["target"],
|
|
11328
11401
|
additionalProperties: false
|
|
11329
11402
|
},
|
|
11330
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11403
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
11331
11404
|
resultSchemaVersion: 1,
|
|
11332
11405
|
access: { mode: "fixed", level: "write" },
|
|
11333
11406
|
asyncMode: "sync",
|
|
@@ -11335,7 +11408,7 @@ function rmCommand() {
|
|
|
11335
11408
|
examples: ["buckyos bucket rm obj://bucket/user/photos/alice/library/2026/a.jpg"],
|
|
11336
11409
|
handler: async (ctx, input) => {
|
|
11337
11410
|
const target = parseBucketTarget(requiredInputString(input, "target"), true);
|
|
11338
|
-
return await call$
|
|
11411
|
+
return await call$2(ctx, "bucket.delete", { bucket_id: target.bucketId, key: target.key, version: input.version });
|
|
11339
11412
|
}
|
|
11340
11413
|
};
|
|
11341
11414
|
}
|
|
@@ -11358,7 +11431,7 @@ function linkCommand() {
|
|
|
11358
11431
|
required: ["target"],
|
|
11359
11432
|
additionalProperties: false
|
|
11360
11433
|
},
|
|
11361
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11434
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
11362
11435
|
resultSchemaVersion: 1,
|
|
11363
11436
|
access: { mode: "fixed", level: "write" },
|
|
11364
11437
|
asyncMode: "sync",
|
|
@@ -11371,7 +11444,7 @@ function linkCommand() {
|
|
|
11371
11444
|
const expiresAt = days ? Date.now() + Number(days[1]) * DAY_MS : parseTimestamp(text2, "expires");
|
|
11372
11445
|
if (expiresAt === void 0)
|
|
11373
11446
|
throw new UsageError("INVALID_ARGUMENT", "expires is required");
|
|
11374
|
-
const issued = await call$
|
|
11447
|
+
const issued = await call$2(ctx, "bucket.create_access_token", {
|
|
11375
11448
|
bucket_id: target.bucketId,
|
|
11376
11449
|
key: target.key,
|
|
11377
11450
|
actions: ["read"],
|
|
@@ -11387,13 +11460,13 @@ function s3KeysCommand() {
|
|
|
11387
11460
|
verb: "s3-keys",
|
|
11388
11461
|
summary: "List your S3 access keys (secrets are shown only when created)",
|
|
11389
11462
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
11390
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11463
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
11391
11464
|
resultSchemaVersion: 1,
|
|
11392
11465
|
access: { mode: "fixed", level: "read" },
|
|
11393
11466
|
asyncMode: "sync",
|
|
11394
11467
|
requiresSession: true,
|
|
11395
11468
|
examples: ["buckyos bucket s3-keys"],
|
|
11396
|
-
handler: async (ctx) => ({ keys: await call$
|
|
11469
|
+
handler: async (ctx) => ({ keys: await call$2(ctx, "bucket.list_s3_keys", {}) })
|
|
11397
11470
|
};
|
|
11398
11471
|
}
|
|
11399
11472
|
function s3KeyCreateCommand() {
|
|
@@ -11411,7 +11484,7 @@ function s3KeyCreateCommand() {
|
|
|
11411
11484
|
required: ["app"],
|
|
11412
11485
|
additionalProperties: false
|
|
11413
11486
|
},
|
|
11414
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11487
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
11415
11488
|
resultSchemaVersion: 1,
|
|
11416
11489
|
access: { mode: "fixed", level: "write" },
|
|
11417
11490
|
asyncMode: "sync",
|
|
@@ -11422,7 +11495,7 @@ function s3KeyCreateCommand() {
|
|
|
11422
11495
|
const days = text2?.match(/^(\d+)d$/);
|
|
11423
11496
|
const expiresAt = !text2 ? void 0 : days ? Date.now() + Number(days[1]) * DAY_MS : parseTimestamp(text2, "expires");
|
|
11424
11497
|
const prefix = inputString(input, "prefix");
|
|
11425
|
-
const key = await call$
|
|
11498
|
+
const key = await call$2(ctx, "bucket.create_s3_key", {
|
|
11426
11499
|
appid: requiredInputString(input, "app"),
|
|
11427
11500
|
scope: prefix ? { prefix } : void 0,
|
|
11428
11501
|
expires_at: expiresAt
|
|
@@ -11442,16 +11515,16 @@ function s3KeyRevokeCommand() {
|
|
|
11442
11515
|
required: ["access_key_id"],
|
|
11443
11516
|
additionalProperties: false
|
|
11444
11517
|
},
|
|
11445
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11518
|
+
outputSchema: OBJECT_OUTPUT$3,
|
|
11446
11519
|
resultSchemaVersion: 1,
|
|
11447
11520
|
access: { mode: "fixed", level: "write" },
|
|
11448
11521
|
asyncMode: "sync",
|
|
11449
11522
|
requiresSession: true,
|
|
11450
11523
|
examples: ["buckyos bucket s3-key-revoke BKABCDEFGHIJKLMNOPQR"],
|
|
11451
|
-
handler: async (ctx, input) => await call$
|
|
11524
|
+
handler: async (ctx, input) => await call$2(ctx, "bucket.revoke_s3_key", { access_key_id: requiredInputString(input, "access_key_id") })
|
|
11452
11525
|
};
|
|
11453
11526
|
}
|
|
11454
|
-
const OBJECT_OUTPUT$
|
|
11527
|
+
const OBJECT_OUTPUT$2 = { type: "object", additionalProperties: true };
|
|
11455
11528
|
const URL_ARG = { name: "url", description: "obj:// cyfs:// file:// https:// url, or //<service>/... /abs/path shorthand", required: true };
|
|
11456
11529
|
function createObjModule() {
|
|
11457
11530
|
return {
|
|
@@ -11502,7 +11575,7 @@ function resolveCommand() {
|
|
|
11502
11575
|
summary: "Normalize a URL and show its identity, RBAC key, events and endpoint (no access check)",
|
|
11503
11576
|
positionals: [URL_ARG],
|
|
11504
11577
|
inputSchema: { type: "object", properties: { url: { type: "string", minLength: 1 } }, required: ["url"], additionalProperties: false },
|
|
11505
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11578
|
+
outputSchema: OBJECT_OUTPUT$2,
|
|
11506
11579
|
resultSchemaVersion: 1,
|
|
11507
11580
|
access: { mode: "fixed", level: "read" },
|
|
11508
11581
|
asyncMode: "sync",
|
|
@@ -11539,7 +11612,7 @@ function readCommand$1() {
|
|
|
11539
11612
|
required: ["url"],
|
|
11540
11613
|
additionalProperties: false
|
|
11541
11614
|
},
|
|
11542
|
-
outputSchema: OBJECT_OUTPUT$
|
|
11615
|
+
outputSchema: OBJECT_OUTPUT$2,
|
|
11543
11616
|
resultSchemaVersion: 1,
|
|
11544
11617
|
access: { mode: "fixed", level: "read" },
|
|
11545
11618
|
asyncMode: "sync",
|
|
@@ -11591,7 +11664,7 @@ const targetProperties = {
|
|
|
11591
11664
|
store_id: text,
|
|
11592
11665
|
locator: text
|
|
11593
11666
|
};
|
|
11594
|
-
function call(ctx, method, params) {
|
|
11667
|
+
function call$1(ctx, method, params) {
|
|
11595
11668
|
return ctx.clients.call("control-panel", method, params, {
|
|
11596
11669
|
traceId: ctx.traceId,
|
|
11597
11670
|
signal: ctx.signal,
|
|
@@ -11615,7 +11688,7 @@ function management(verb, method, properties, required, write = false) {
|
|
|
11615
11688
|
type: schema.type === "integer" ? "integer" : "string",
|
|
11616
11689
|
required: required.includes(name)
|
|
11617
11690
|
})),
|
|
11618
|
-
handler: (ctx, input) => call(ctx, method, input)
|
|
11691
|
+
handler: (ctx, input) => call$1(ctx, method, input)
|
|
11619
11692
|
};
|
|
11620
11693
|
}
|
|
11621
11694
|
function createExecutorModule() {
|
|
@@ -11671,7 +11744,7 @@ function operation(verb, extra, required) {
|
|
|
11671
11744
|
if (!ctx.session)
|
|
11672
11745
|
throw new ToolError("AUTH_REQUIRED", "An authenticated App session is required");
|
|
11673
11746
|
const { token } = await ctx.session.ensureValid();
|
|
11674
|
-
const route = await call(ctx, "executor.stream.open", { executor_id: target.executor_id, generation: target.generation, profile_id: target.profile_id });
|
|
11747
|
+
const route = await call$1(ctx, "executor.stream.open", { executor_id: target.executor_id, generation: target.generation, profile_id: target.profile_id });
|
|
11675
11748
|
const stream = await ExecutorCommandStream.connect(route, target, token, "buckyos-cli", locator.run_id);
|
|
11676
11749
|
if (!stream)
|
|
11677
11750
|
throw new ToolError("INVALID_SERVICE_RESPONSE", "Executor stream did not initialize");
|
|
@@ -11699,6 +11772,80 @@ function operation(verb, extra, required) {
|
|
|
11699
11772
|
}
|
|
11700
11773
|
};
|
|
11701
11774
|
}
|
|
11775
|
+
const OBJECT_OUTPUT$1 = { type: "object", additionalProperties: true };
|
|
11776
|
+
const ID = { type: "string", minLength: 1 };
|
|
11777
|
+
function call(ctx, method, params) {
|
|
11778
|
+
return ctx.clients.call("control-panel", method, params, {
|
|
11779
|
+
traceId: ctx.traceId,
|
|
11780
|
+
signal: ctx.signal,
|
|
11781
|
+
timeoutMs: Math.max(1, (ctx.deadline ?? Date.now() + 6e4) - Date.now())
|
|
11782
|
+
});
|
|
11783
|
+
}
|
|
11784
|
+
function requestOf(input, enabled) {
|
|
11785
|
+
const id = typeof input.id === "string" ? input.id : "";
|
|
11786
|
+
if (!id)
|
|
11787
|
+
throw new UsageError("MISSING_ARGUMENT", "a package id is required");
|
|
11788
|
+
return { id, enabled, ...typeof input.version === "string" ? { version: input.version } : {} };
|
|
11789
|
+
}
|
|
11790
|
+
function read(verb, summary2, method) {
|
|
11791
|
+
return {
|
|
11792
|
+
verb,
|
|
11793
|
+
summary: summary2,
|
|
11794
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
11795
|
+
outputSchema: OBJECT_OUTPUT$1,
|
|
11796
|
+
resultSchemaVersion: 1,
|
|
11797
|
+
access: { mode: "fixed", level: "read" },
|
|
11798
|
+
asyncMode: "sync",
|
|
11799
|
+
requiresSession: true,
|
|
11800
|
+
handler: (ctx) => call(ctx, method, {})
|
|
11801
|
+
};
|
|
11802
|
+
}
|
|
11803
|
+
function desired(verb, summary2, enabled) {
|
|
11804
|
+
const properties = { id: ID, ...enabled ? { version: { type: "string", minLength: 1 } } : {}, dry_run: { type: "boolean" } };
|
|
11805
|
+
return {
|
|
11806
|
+
verb,
|
|
11807
|
+
summary: summary2,
|
|
11808
|
+
positionals: [{ name: "id", description: "Package id, e.g. ext-core" }],
|
|
11809
|
+
options: [
|
|
11810
|
+
...enabled ? [{ name: "version", description: "A published version; the newest without it", type: "string" }] : [],
|
|
11811
|
+
{ name: "dry-run", property: "dry_run", description: "Only show what would change", type: "boolean" }
|
|
11812
|
+
],
|
|
11813
|
+
inputSchema: { type: "object", properties, required: ["id"], additionalProperties: false },
|
|
11814
|
+
outputSchema: OBJECT_OUTPUT$1,
|
|
11815
|
+
resultSchemaVersion: 1,
|
|
11816
|
+
access: { mode: "fixed", level: "write" },
|
|
11817
|
+
asyncMode: "sync",
|
|
11818
|
+
requiresSession: true,
|
|
11819
|
+
handler: (ctx, input) => call(ctx, input.dry_run === true ? "ext_tools.plan" : "ext_tools.set_desired", requestOf(input, enabled))
|
|
11820
|
+
};
|
|
11821
|
+
}
|
|
11822
|
+
function createExtToolsModule() {
|
|
11823
|
+
return {
|
|
11824
|
+
name: "ext-tools",
|
|
11825
|
+
summary: "Manage the extension tool packages every Agent of the Zone shares",
|
|
11826
|
+
commands: [
|
|
11827
|
+
read("list", "The packages published in the Repo, and what each provides", "ext_tools.catalog"),
|
|
11828
|
+
read("status", "Package by node: what is asked for and where each node got to", "ext_tools.status"),
|
|
11829
|
+
desired("enable", "Enable or upgrade a package, with the packages it requires", true),
|
|
11830
|
+
desired("disable", "Disable a package; refused while an enabled package requires it", false),
|
|
11831
|
+
{
|
|
11832
|
+
verb: "import",
|
|
11833
|
+
summary: "Put an already built .pikg (an official release asset) into the Repo unchanged",
|
|
11834
|
+
positionals: [{ name: "pikg", description: "Local .pikg file" }],
|
|
11835
|
+
inputSchema: { type: "object", properties: { pikg: { type: "string", minLength: 1 } }, required: ["pikg"], additionalProperties: false },
|
|
11836
|
+
outputSchema: OBJECT_OUTPUT$1,
|
|
11837
|
+
resultSchemaVersion: 1,
|
|
11838
|
+
access: { mode: "fixed", level: "write" },
|
|
11839
|
+
asyncMode: "sync",
|
|
11840
|
+
requiresSession: true,
|
|
11841
|
+
handler: async (ctx, input) => {
|
|
11842
|
+
const staging = await stageLocalPikg(ctx, String(input.pikg));
|
|
11843
|
+
return await call(ctx, "ext_tools.import", { handle: staging.handle });
|
|
11844
|
+
}
|
|
11845
|
+
}
|
|
11846
|
+
]
|
|
11847
|
+
};
|
|
11848
|
+
}
|
|
11702
11849
|
const SERVICE = "aiworkspace";
|
|
11703
11850
|
const OBJECT_OUTPUT = { type: "object", additionalProperties: true };
|
|
11704
11851
|
const WORKSPACE_OPTION = { name: "workspace", property: "workspace_id", description: "Workspace id (ws_…)", type: "string", required: true };
|
|
@@ -13087,6 +13234,7 @@ function createRegistry(pikgDependencies, appDependencies, logDependencies, diag
|
|
|
13087
13234
|
registry.register(createBucketModule());
|
|
13088
13235
|
registry.register(createObjModule());
|
|
13089
13236
|
registry.register(createExecutorModule());
|
|
13237
|
+
registry.register(createExtToolsModule());
|
|
13090
13238
|
registry.register(createAiwsModule());
|
|
13091
13239
|
return registry;
|
|
13092
13240
|
}
|