buckyos 0.7.154 → 0.7.155

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.
Files changed (58) hide show
  1. package/cli/core/app.ts +2 -0
  2. package/cli/core/task.ts +2 -1
  3. package/cli/dist/cli.mjs +235 -94
  4. package/cli/dist/cli.mjs.map +1 -1
  5. package/cli/modules/obj.ts +163 -0
  6. package/cli/version.ts +1 -1
  7. package/dist/aiworkspace_client.d.ts +9 -0
  8. package/dist/aiworkspace_client.d.ts.map +1 -1
  9. package/dist/browser.cjs +1 -1
  10. package/dist/browser.cjs.map +1 -1
  11. package/dist/browser.d.ts +1 -0
  12. package/dist/browser.d.ts.map +1 -1
  13. package/dist/browser.mjs +183 -182
  14. package/dist/browser.mjs.map +1 -1
  15. package/dist/executor_client-022a19b9.js +13 -0
  16. package/dist/executor_client-022a19b9.js.map +1 -0
  17. package/dist/{executor_client-dde508e1.mjs → executor_client-78ad0749.mjs} +597 -188
  18. package/dist/executor_client-78ad0749.mjs.map +1 -0
  19. package/dist/hybrid_sso.d.ts +2 -1
  20. package/dist/hybrid_sso.d.ts.map +1 -1
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.mjs +188 -185
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/msg_center_client.d.ts +4 -3
  28. package/dist/msg_center_client.d.ts.map +1 -1
  29. package/dist/{ndn_types-bbb1f6a6.mjs → namelib-b41b10cc.mjs} +2683 -2683
  30. package/dist/namelib-b41b10cc.mjs.map +1 -0
  31. package/dist/namelib-f8ff0045.js +2 -0
  32. package/dist/namelib-f8ff0045.js.map +1 -0
  33. package/dist/node.cjs +1 -1
  34. package/dist/node.cjs.map +1 -1
  35. package/dist/node.d.ts +1 -0
  36. package/dist/node.d.ts.map +1 -1
  37. package/dist/node.mjs +183 -182
  38. package/dist/node.mjs.map +1 -1
  39. package/dist/object_url.d.ts +65 -0
  40. package/dist/object_url.d.ts.map +1 -0
  41. package/dist/provision.cjs +1 -1
  42. package/dist/provision.cjs.map +1 -1
  43. package/dist/provision.mjs +1 -1
  44. package/dist/sdk_core.d.ts +1 -1
  45. package/dist/sdk_core.d.ts.map +1 -1
  46. package/dist/task_mgr_client.d.ts +2 -0
  47. package/dist/task_mgr_client.d.ts.map +1 -1
  48. package/dist/{tus_client-d313689e.mjs → tus_client-04080b1e.mjs} +2 -2
  49. package/dist/{tus_client-d313689e.mjs.map → tus_client-04080b1e.mjs.map} +1 -1
  50. package/dist/{tus_client-65c5fc5e.js → tus_client-4f7254e9.js} +2 -2
  51. package/dist/{tus_client-65c5fc5e.js.map → tus_client-4f7254e9.js.map} +1 -1
  52. package/package.json +1 -1
  53. package/dist/executor_client-cafb8a35.js +0 -13
  54. package/dist/executor_client-cafb8a35.js.map +0 -1
  55. package/dist/executor_client-dde508e1.mjs.map +0 -1
  56. package/dist/ndn_types-08dc9ef1.js +0 -2
  57. package/dist/ndn_types-08dc9ef1.js.map +0 -1
  58. package/dist/ndn_types-bbb1f6a6.mjs.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, ndm_proxy, ExecutorCommandStream } from "buckyos/node";
5
+ import { BuckyOSSDK, RuntimeType, buckyos, namelib, VerifyHubClient, createAppInstanceId, parseSessionTokenClaims, ndn, taskMgrTaskEventPath, ndm_proxy, objectUrl as objectUrl$1, ExecutorCommandStream } from "buckyos/node";
6
6
  import * as provisionSdk from "buckyos/provision";
7
7
  import { createHash } from "node:crypto";
8
8
  import { readFile, writeFile, readdir, stat, lstat, realpath, mkdtemp, rename, rm, mkdir, chmod, symlink, copyFile, open } from "node:fs/promises";
@@ -2498,7 +2498,7 @@ function replPrompt(config) {
2498
2498
  return `buckyos[${profile}|${zone}|${identity}]> `;
2499
2499
  }
2500
2500
  const EMPTY_INPUT$3 = { type: "object", properties: {}, additionalProperties: false };
2501
- const OBJECT_OUTPUT$e = { type: "object", additionalProperties: true };
2501
+ const OBJECT_OUTPUT$f = { type: "object", additionalProperties: true };
2502
2502
  function createAuthModule() {
2503
2503
  return {
2504
2504
  name: "auth",
@@ -2508,7 +2508,7 @@ function createAuthModule() {
2508
2508
  verb: "whoami",
2509
2509
  summary: "Show the effective principal and application identity",
2510
2510
  inputSchema: EMPTY_INPUT$3,
2511
- outputSchema: OBJECT_OUTPUT$e,
2511
+ outputSchema: OBJECT_OUTPUT$f,
2512
2512
  resultSchemaVersion: 1,
2513
2513
  access: { mode: "fixed", level: "read" },
2514
2514
  asyncMode: "sync",
@@ -2526,7 +2526,7 @@ function createAuthModule() {
2526
2526
  verb: "session-status",
2527
2527
  summary: "Show the in-memory session state without exposing credentials",
2528
2528
  inputSchema: EMPTY_INPUT$3,
2529
- outputSchema: OBJECT_OUTPUT$e,
2529
+ outputSchema: OBJECT_OUTPUT$f,
2530
2530
  resultSchemaVersion: 1,
2531
2531
  access: { mode: "fixed", level: "read" },
2532
2532
  asyncMode: "sync",
@@ -2547,7 +2547,7 @@ const EMPTY_INPUT$2 = {
2547
2547
  properties: {},
2548
2548
  additionalProperties: false
2549
2549
  };
2550
- const OBJECT_OUTPUT$d = { type: "object", additionalProperties: true };
2550
+ const OBJECT_OUTPUT$e = { type: "object", additionalProperties: true };
2551
2551
  function createCoreModules(registry) {
2552
2552
  return [createCommandModule(registry), createConfigModule(), createCompletionModule(registry)];
2553
2553
  }
@@ -2560,7 +2560,7 @@ function createCommandModule(registry) {
2560
2560
  verb: "list",
2561
2561
  summary: "List registered modules and commands",
2562
2562
  inputSchema: EMPTY_INPUT$2,
2563
- outputSchema: OBJECT_OUTPUT$d,
2563
+ outputSchema: OBJECT_OUTPUT$e,
2564
2564
  resultSchemaVersion: 1,
2565
2565
  access: { mode: "fixed", level: "read" },
2566
2566
  asyncMode: "sync",
@@ -2593,7 +2593,7 @@ function createCommandModule(registry) {
2593
2593
  required: ["target_module", "target_verb"],
2594
2594
  additionalProperties: false
2595
2595
  },
2596
- outputSchema: OBJECT_OUTPUT$d,
2596
+ outputSchema: OBJECT_OUTPUT$e,
2597
2597
  resultSchemaVersion: 1,
2598
2598
  access: { mode: "fixed", level: "read" },
2599
2599
  asyncMode: "sync",
@@ -2615,7 +2615,7 @@ function createConfigModule() {
2615
2615
  verb: "list",
2616
2616
  summary: "List the global configuration and available profiles",
2617
2617
  inputSchema: EMPTY_INPUT$2,
2618
- outputSchema: OBJECT_OUTPUT$d,
2618
+ outputSchema: OBJECT_OUTPUT$e,
2619
2619
  resultSchemaVersion: 1,
2620
2620
  access: { mode: "fixed", level: "read" },
2621
2621
  asyncMode: "sync",
@@ -2646,7 +2646,7 @@ function createConfigModule() {
2646
2646
  },
2647
2647
  additionalProperties: false
2648
2648
  },
2649
- outputSchema: OBJECT_OUTPUT$d,
2649
+ outputSchema: OBJECT_OUTPUT$e,
2650
2650
  resultSchemaVersion: 1,
2651
2651
  access: { mode: "fixed", level: "read" },
2652
2652
  asyncMode: "sync",
@@ -2692,7 +2692,7 @@ function createConfigModule() {
2692
2692
  required: ["key", "value"],
2693
2693
  additionalProperties: false
2694
2694
  },
2695
- outputSchema: OBJECT_OUTPUT$d,
2695
+ outputSchema: OBJECT_OUTPUT$e,
2696
2696
  resultSchemaVersion: 1,
2697
2697
  access: { mode: "fixed", level: "write" },
2698
2698
  asyncMode: "sync",
@@ -2732,7 +2732,7 @@ function createConfigModule() {
2732
2732
  required: ["profile_name"],
2733
2733
  additionalProperties: false
2734
2734
  },
2735
- outputSchema: OBJECT_OUTPUT$d,
2735
+ outputSchema: OBJECT_OUTPUT$e,
2736
2736
  resultSchemaVersion: 1,
2737
2737
  access: { mode: "fixed", level: "write" },
2738
2738
  asyncMode: "sync",
@@ -2764,7 +2764,7 @@ function createConfigModule() {
2764
2764
  properties: { effective: { type: "boolean" } },
2765
2765
  additionalProperties: false
2766
2766
  },
2767
- outputSchema: OBJECT_OUTPUT$d,
2767
+ outputSchema: OBJECT_OUTPUT$e,
2768
2768
  resultSchemaVersion: 1,
2769
2769
  access: { mode: "fixed", level: "read" },
2770
2770
  asyncMode: "sync",
@@ -3006,7 +3006,7 @@ async function buckyosInfo(ctx) {
3006
3006
  );
3007
3007
  }
3008
3008
  const SERVICE_NAME = "system_config";
3009
- const OBJECT_OUTPUT$c = { type: "object", additionalProperties: false };
3009
+ const OBJECT_OUTPUT$d = { type: "object", additionalProperties: false };
3010
3010
  const KEY_INPUT = {
3011
3011
  type: "object",
3012
3012
  properties: { key: { type: "string", minLength: 1 } },
@@ -3024,7 +3024,7 @@ function createSystemConfigModule() {
3024
3024
  positionals: [{ name: "key", description: "System-config key" }],
3025
3025
  inputSchema: KEY_INPUT,
3026
3026
  outputSchema: {
3027
- ...OBJECT_OUTPUT$c,
3027
+ ...OBJECT_OUTPUT$d,
3028
3028
  properties: {
3029
3029
  key: { type: "string" },
3030
3030
  value: { type: "string" },
@@ -3067,7 +3067,7 @@ function createSystemConfigModule() {
3067
3067
  additionalProperties: false
3068
3068
  },
3069
3069
  outputSchema: {
3070
- ...OBJECT_OUTPUT$c,
3070
+ ...OBJECT_OUTPUT$d,
3071
3071
  properties: {
3072
3072
  key: { type: "string" },
3073
3073
  items: { type: "array", items: { type: "string" } }
@@ -3121,7 +3121,7 @@ function setCommand() {
3121
3121
  additionalProperties: false
3122
3122
  },
3123
3123
  outputSchema: {
3124
- ...OBJECT_OUTPUT$c,
3124
+ ...OBJECT_OUTPUT$d,
3125
3125
  properties: { key: { type: "string" }, updated: { type: "boolean" } },
3126
3126
  required: ["key", "updated"]
3127
3127
  },
@@ -3160,7 +3160,7 @@ function setFileCommand() {
3160
3160
  additionalProperties: false
3161
3161
  },
3162
3162
  outputSchema: {
3163
- ...OBJECT_OUTPUT$c,
3163
+ ...OBJECT_OUTPUT$d,
3164
3164
  properties: { key: { type: "string" }, updated: { type: "boolean" } },
3165
3165
  required: ["key", "updated"]
3166
3166
  },
@@ -3197,7 +3197,7 @@ function mutationCommand(options) {
3197
3197
  additionalProperties: false
3198
3198
  },
3199
3199
  outputSchema: {
3200
- ...OBJECT_OUTPUT$c,
3200
+ ...OBJECT_OUTPUT$d,
3201
3201
  properties: {
3202
3202
  key: { type: "string" },
3203
3203
  [options.resultProperty]: { type: "boolean" }
@@ -5205,7 +5205,7 @@ function validateContentHandlers(value, permissions) {
5205
5205
  }
5206
5206
  return value;
5207
5207
  }
5208
- const PACKAGE_VERSION = "0.7.154";
5208
+ const PACKAGE_VERSION = "0.7.155";
5209
5209
  const TOOL_VERSION = PACKAGE_VERSION;
5210
5210
  const SDK_VERSION = PACKAGE_VERSION;
5211
5211
  const PROTOCOL_VERSION = "1";
@@ -5222,7 +5222,7 @@ const VERSION$1 = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
5222
5222
  const SHA256_ID = /^sha256:[0-9a-f]{64}$/;
5223
5223
  const OBJECT_ID = /^(?:appdoc|pkg):[0-9a-f]{64}$/;
5224
5224
  const SAFE_GENERATED_FILE = /^[A-Za-z0-9._-]+$/;
5225
- const OBJECT_OUTPUT$b = { type: "object", additionalProperties: true };
5225
+ const OBJECT_OUTPUT$c = { type: "object", additionalProperties: true };
5226
5226
  const APP_KINDS = ["static-web", "script", "docker", "agent-skills"];
5227
5227
  const PATH_KINDS = {
5228
5228
  "static-web": { key: "web", category: "web", selectorType: "static" },
@@ -5265,7 +5265,7 @@ function createPikgModule(dependencies = {}) {
5265
5265
  properties: { meta_dir: { type: "string", minLength: 1 } },
5266
5266
  additionalProperties: false
5267
5267
  },
5268
- outputSchema: OBJECT_OUTPUT$b,
5268
+ outputSchema: OBJECT_OUTPUT$c,
5269
5269
  resultSchemaVersion: 1,
5270
5270
  access: { mode: "fixed", level: "read" },
5271
5271
  asyncMode: "sync",
@@ -5312,7 +5312,7 @@ function createPikgModule(dependencies = {}) {
5312
5312
  },
5313
5313
  additionalProperties: false
5314
5314
  },
5315
- outputSchema: OBJECT_OUTPUT$b,
5315
+ outputSchema: OBJECT_OUTPUT$c,
5316
5316
  resultSchemaVersion: 1,
5317
5317
  access: { mode: "fixed", level: "write" },
5318
5318
  asyncMode: "sync",
@@ -5337,7 +5337,7 @@ function createPikgModule(dependencies = {}) {
5337
5337
  properties: { meta_dir: { type: "string", minLength: 1 } },
5338
5338
  additionalProperties: false
5339
5339
  },
5340
- outputSchema: OBJECT_OUTPUT$b,
5340
+ outputSchema: OBJECT_OUTPUT$c,
5341
5341
  resultSchemaVersion: 1,
5342
5342
  access: { mode: "fixed", level: "write" },
5343
5343
  asyncMode: "sync",
@@ -5358,7 +5358,7 @@ function createPikgModule(dependencies = {}) {
5358
5358
  properties: { dist_dir: { type: "string", minLength: 1 } },
5359
5359
  additionalProperties: false
5360
5360
  },
5361
- outputSchema: OBJECT_OUTPUT$b,
5361
+ outputSchema: OBJECT_OUTPUT$c,
5362
5362
  resultSchemaVersion: 1,
5363
5363
  access: { mode: "fixed", level: "write" },
5364
5364
  asyncMode: "sync",
@@ -5378,7 +5378,7 @@ function createPikgModule(dependencies = {}) {
5378
5378
  required: ["pikg_path"],
5379
5379
  additionalProperties: false
5380
5380
  },
5381
- outputSchema: OBJECT_OUTPUT$b,
5381
+ outputSchema: OBJECT_OUTPUT$c,
5382
5382
  resultSchemaVersion: 1,
5383
5383
  access: { mode: "fixed", level: "read" },
5384
5384
  asyncMode: "sync",
@@ -5399,7 +5399,7 @@ function createPikgModule(dependencies = {}) {
5399
5399
  properties: { meta_dir: { type: "string", minLength: 1 } },
5400
5400
  additionalProperties: false
5401
5401
  },
5402
- outputSchema: OBJECT_OUTPUT$b,
5402
+ outputSchema: OBJECT_OUTPUT$c,
5403
5403
  resultSchemaVersion: 1,
5404
5404
  access: { mode: "fixed", level: "destructive" },
5405
5405
  asyncMode: "sync",
@@ -6532,7 +6532,7 @@ async function waitForTask(ctx, taskId, options = {}) {
6532
6532
  try {
6533
6533
  const remaining = Math.max(1, (ctx.deadline ?? Date.now()) - Date.now());
6534
6534
  const eventSignal = AbortSignal.any([ctx.signal, AbortSignal.timeout(remaining)]);
6535
- reader = await ctx.clients.createEventReader?.(`/task_mgr/${taskId}`, eventSignal);
6535
+ reader = await ctx.clients.createEventReader?.(taskMgrTaskEventPath(taskId), eventSignal);
6536
6536
  } catch {
6537
6537
  reader = void 0;
6538
6538
  }
@@ -6669,7 +6669,7 @@ const CONTROL_PANEL_SERVICE = "control-panel";
6669
6669
  const PLAN_SCHEMA_VERSION = 4;
6670
6670
  const STAGING_RELEASE_TIMEOUT_MS = 5e3;
6671
6671
  const ZIP_LOCAL_MAGIC = [80, 75, 3, 4];
6672
- const OBJECT_OUTPUT$a = { type: "object", additionalProperties: true };
6672
+ const OBJECT_OUTPUT$b = { type: "object", additionalProperties: true };
6673
6673
  const INSTALL_POLICIES = [
6674
6674
  "strict-public",
6675
6675
  "normal",
@@ -6720,7 +6720,7 @@ function cancelCommand$1() {
6720
6720
  required: ["task_id"],
6721
6721
  additionalProperties: false
6722
6722
  },
6723
- outputSchema: OBJECT_OUTPUT$a,
6723
+ outputSchema: OBJECT_OUTPUT$b,
6724
6724
  resultSchemaVersion: 1,
6725
6725
  access: { mode: "fixed", level: "write" },
6726
6726
  asyncMode: "sync",
@@ -6755,7 +6755,7 @@ function fetchCommand(dependencies) {
6755
6755
  target: { type: "object", additionalProperties: true },
6756
6756
  install_params: { type: "object", additionalProperties: true }
6757
6757
  }),
6758
- outputSchema: OBJECT_OUTPUT$a,
6758
+ outputSchema: OBJECT_OUTPUT$b,
6759
6759
  resultSchemaVersion: 1,
6760
6760
  access: { mode: "fixed", level: "read" },
6761
6761
  asyncMode: "sync",
@@ -6772,7 +6772,7 @@ function listCommand$2() {
6772
6772
  verb: "list",
6773
6773
  summary: "List visible installed Apps",
6774
6774
  inputSchema: emptyInputSchema(),
6775
- outputSchema: OBJECT_OUTPUT$a,
6775
+ outputSchema: OBJECT_OUTPUT$b,
6776
6776
  resultSchemaVersion: 1,
6777
6777
  access: { mode: "fixed", level: "read" },
6778
6778
  asyncMode: "sync",
@@ -6830,7 +6830,7 @@ function installCommand(dependencies) {
6830
6830
  no_wait: { type: "boolean" },
6831
6831
  policy: { type: "string", enum: [...INSTALL_POLICIES] }
6832
6832
  }),
6833
- outputSchema: OBJECT_OUTPUT$a,
6833
+ outputSchema: OBJECT_OUTPUT$b,
6834
6834
  resultSchemaVersion: 1,
6835
6835
  access: { mode: "fixed", level: "write" },
6836
6836
  asyncMode: "either",
@@ -6874,7 +6874,7 @@ function upgradeCommand(dependencies) {
6874
6874
  },
6875
6875
  additionalProperties: false
6876
6876
  },
6877
- outputSchema: OBJECT_OUTPUT$a,
6877
+ outputSchema: OBJECT_OUTPUT$b,
6878
6878
  resultSchemaVersion: 1,
6879
6879
  access: { mode: "fixed", level: "write" },
6880
6880
  asyncMode: "either",
@@ -7003,7 +7003,7 @@ function statusCommand$1() {
7003
7003
  properties: { app_name: { type: "string", minLength: 1 } },
7004
7004
  additionalProperties: false
7005
7005
  },
7006
- outputSchema: OBJECT_OUTPUT$a,
7006
+ outputSchema: OBJECT_OUTPUT$b,
7007
7007
  resultSchemaVersion: 1,
7008
7008
  access: { mode: "fixed", level: "read" },
7009
7009
  asyncMode: "sync",
@@ -7074,7 +7074,7 @@ function publishCommand() {
7074
7074
  required: ["local_dir", "app_doc"],
7075
7075
  additionalProperties: false
7076
7076
  },
7077
- outputSchema: OBJECT_OUTPUT$a,
7077
+ outputSchema: OBJECT_OUTPUT$b,
7078
7078
  resultSchemaVersion: 1,
7079
7079
  access: { mode: "fixed", level: "write" },
7080
7080
  asyncMode: "sync",
@@ -7591,7 +7591,7 @@ async function stagePikg(ctx, snapshot, purpose) {
7591
7591
  throw new ToolError("AUTH_REQUIRED", "authenticated session is required", 3);
7592
7592
  const token = (await session.ensureValid()).token;
7593
7593
  const proxy = ndm_proxy.createNdmProxyClient({
7594
- endpoint: gatewayOrigin$2(ctx.connection.endpoint),
7594
+ endpoint: gatewayOrigin$3(ctx.connection.endpoint),
7595
7595
  sessionToken: token,
7596
7596
  fetcher: (request, init) => fetch(normalizeNdmRequestUrl(request), { ...init, signal: ctx.signal })
7597
7597
  });
@@ -8128,7 +8128,7 @@ function validatePikgSnapshot(bytes) {
8128
8128
  throw new UsageError("INVALID_PIKG", "PIKG magic mismatch: expected a ZIP container");
8129
8129
  }
8130
8130
  }
8131
- function gatewayOrigin$2(endpoint) {
8131
+ function gatewayOrigin$3(endpoint) {
8132
8132
  const url = new URL(endpoint);
8133
8133
  const marker = url.pathname.indexOf("/kapi");
8134
8134
  url.pathname = marker >= 0 ? url.pathname.slice(0, marker) || "/" : "/";
@@ -8200,7 +8200,7 @@ function selectorCommand(options) {
8200
8200
  required: ["app_name"],
8201
8201
  additionalProperties: false
8202
8202
  },
8203
- outputSchema: OBJECT_OUTPUT$a,
8203
+ outputSchema: OBJECT_OUTPUT$b,
8204
8204
  resultSchemaVersion: 1,
8205
8205
  access: { mode: "fixed", level: options.access },
8206
8206
  asyncMode: options.asyncMode,
@@ -8364,7 +8364,7 @@ function toHex(bytes) {
8364
8364
  return [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
8365
8365
  }
8366
8366
  const CONTROL_PANEL$3 = "control-panel";
8367
- const OBJECT_OUTPUT$9 = { type: "object", additionalProperties: true };
8367
+ const OBJECT_OUTPUT$a = { type: "object", additionalProperties: true };
8368
8368
  function createDiagnosticModule(dependencies = {}) {
8369
8369
  return {
8370
8370
  name: "diagnostic",
@@ -8403,7 +8403,7 @@ function collectCommand() {
8403
8403
  required: ["services"],
8404
8404
  additionalProperties: false
8405
8405
  },
8406
- outputSchema: OBJECT_OUTPUT$9,
8406
+ outputSchema: OBJECT_OUTPUT$a,
8407
8407
  resultSchemaVersion: 1,
8408
8408
  access: { mode: "fixed", level: "privileged" },
8409
8409
  asyncMode: "task",
@@ -8457,7 +8457,7 @@ function exportCommand$2(dependencies) {
8457
8457
  required: ["bundle_id", "path"],
8458
8458
  additionalProperties: false
8459
8459
  },
8460
- outputSchema: OBJECT_OUTPUT$9,
8460
+ outputSchema: OBJECT_OUTPUT$a,
8461
8461
  resultSchemaVersion: 1,
8462
8462
  access: { mode: "fixed", level: "privileged" },
8463
8463
  asyncMode: "sync",
@@ -8499,7 +8499,7 @@ function compact$2(value) {
8499
8499
  return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== void 0));
8500
8500
  }
8501
8501
  const CONTROL_PANEL$2 = "control-panel";
8502
- const OBJECT_OUTPUT$8 = { type: "object", additionalProperties: true };
8502
+ const OBJECT_OUTPUT$9 = { type: "object", additionalProperties: true };
8503
8503
  const LOG_LEVELS = ["error", "warning", "info", "debug", "trace"];
8504
8504
  function createLogModule(dependencies = {}) {
8505
8505
  return {
@@ -8520,7 +8520,7 @@ function servicesCommand() {
8520
8520
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
8521
8521
  outputSchema: {
8522
8522
  type: "object",
8523
- properties: { services: { type: "array", items: OBJECT_OUTPUT$8 } },
8523
+ properties: { services: { type: "array", items: OBJECT_OUTPUT$9 } },
8524
8524
  required: ["services"],
8525
8525
  additionalProperties: false
8526
8526
  },
@@ -8593,7 +8593,7 @@ function tailCommand(dependencies) {
8593
8593
  }
8594
8594
  ],
8595
8595
  inputSchema: filterSchema({ from: { type: "string", enum: ["start", "end"] } }),
8596
- outputSchema: OBJECT_OUTPUT$8,
8596
+ outputSchema: OBJECT_OUTPUT$9,
8597
8597
  resultSchemaVersion: 1,
8598
8598
  access: { mode: "fixed", level: "read" },
8599
8599
  asyncMode: "stream",
@@ -8649,7 +8649,7 @@ function exportCommand$1(dependencies) {
8649
8649
  ...filterSchema({ path: { type: "string", minLength: 1 } }),
8650
8650
  required: ["path"]
8651
8651
  },
8652
- outputSchema: OBJECT_OUTPUT$8,
8652
+ outputSchema: OBJECT_OUTPUT$9,
8653
8653
  resultSchemaVersion: 1,
8654
8654
  access: { mode: "fixed", level: "read" },
8655
8655
  asyncMode: "sync",
@@ -8801,7 +8801,7 @@ function abortableSleep(milliseconds, signal) {
8801
8801
  }
8802
8802
  const TASK_MANAGER = "task-manager";
8803
8803
  const CONTROL_PANEL$1 = "control-panel";
8804
- const OBJECT_OUTPUT$7 = { type: "object", additionalProperties: true };
8804
+ const OBJECT_OUTPUT$8 = { type: "object", additionalProperties: true };
8805
8805
  function createTaskModule() {
8806
8806
  return {
8807
8807
  name: "task",
@@ -8904,7 +8904,7 @@ function getCommand$2() {
8904
8904
  required: ["task_id"],
8905
8905
  additionalProperties: false
8906
8906
  },
8907
- outputSchema: OBJECT_OUTPUT$7,
8907
+ outputSchema: OBJECT_OUTPUT$8,
8908
8908
  resultSchemaVersion: 1,
8909
8909
  access: { mode: "fixed", level: "read" },
8910
8910
  asyncMode: "sync",
@@ -8945,7 +8945,7 @@ function waitCommand() {
8945
8945
  summary: "Stream changes until a Task becomes terminal",
8946
8946
  positionals: [{ name: "task_id", description: "Opaque Task ID", required: true }],
8947
8947
  inputSchema: taskIdSchema(),
8948
- outputSchema: OBJECT_OUTPUT$7,
8948
+ outputSchema: OBJECT_OUTPUT$8,
8949
8949
  resultSchemaVersion: 1,
8950
8950
  access: { mode: "fixed", level: "read" },
8951
8951
  asyncMode: "stream",
@@ -8996,7 +8996,7 @@ function cancelCommand() {
8996
8996
  required: ["task_id"],
8997
8997
  additionalProperties: false
8998
8998
  },
8999
- outputSchema: OBJECT_OUTPUT$7,
8999
+ outputSchema: OBJECT_OUTPUT$8,
9000
9000
  resultSchemaVersion: 1,
9001
9001
  access: { mode: "fixed", level: "write" },
9002
9002
  asyncMode: "sync",
@@ -9039,7 +9039,7 @@ function retryCommand() {
9039
9039
  required: ["task_id"],
9040
9040
  additionalProperties: false
9041
9041
  },
9042
- outputSchema: OBJECT_OUTPUT$7,
9042
+ outputSchema: OBJECT_OUTPUT$8,
9043
9043
  resultSchemaVersion: 1,
9044
9044
  access: { mode: "fixed", level: "write" },
9045
9045
  asyncMode: "either",
@@ -9113,7 +9113,7 @@ function invalidResponse$1(label) {
9113
9113
  throw new ToolError("INVALID_SERVICE_RESPONSE", `${label} is invalid`, EXIT_INTERNAL);
9114
9114
  }
9115
9115
  const sdk = provisionSdk;
9116
- const OBJECT_OUTPUT$6 = { type: "object", additionalProperties: true };
9116
+ const OBJECT_OUTPUT$7 = { type: "object", additionalProperties: true };
9117
9117
  const ROOT_OPTION = {
9118
9118
  name: "root",
9119
9119
  description: "Installed BuckyOS root on this machine (BUCKYOS_ROOT); read by status/check, written by activate",
@@ -9197,7 +9197,7 @@ function statusCommand(deps) {
9197
9197
  additionalProperties: false
9198
9198
  },
9199
9199
  outputSchema: {
9200
- ...OBJECT_OUTPUT$6,
9200
+ ...OBJECT_OUTPUT$7,
9201
9201
  properties: {
9202
9202
  root: { type: "string" },
9203
9203
  state: {
@@ -9235,7 +9235,7 @@ function checkCommand(deps) {
9235
9235
  additionalProperties: false
9236
9236
  },
9237
9237
  outputSchema: {
9238
- ...OBJECT_OUTPUT$6,
9238
+ ...OBJECT_OUTPUT$7,
9239
9239
  properties: {
9240
9240
  ready: { type: "boolean" },
9241
9241
  root: { type: "string" },
@@ -9283,7 +9283,7 @@ function activateCommand(deps) {
9283
9283
  additionalProperties: false
9284
9284
  },
9285
9285
  outputSchema: {
9286
- ...OBJECT_OUTPUT$6,
9286
+ ...OBJECT_OUTPUT$7,
9287
9287
  properties: {
9288
9288
  root: { type: "string" },
9289
9289
  state: { type: "string", enum: ["configured"] },
@@ -9565,7 +9565,7 @@ function inputFingerprint(input) {
9565
9565
  hash.update(new TextEncoder().encode(JSON.stringify(material)));
9566
9566
  return hash.digestHex();
9567
9567
  }
9568
- const OBJECT_OUTPUT$5 = { type: "object", additionalProperties: true };
9568
+ const OBJECT_OUTPUT$6 = { type: "object", additionalProperties: true };
9569
9569
  const SKILL_KINDS = ["cmd", "goal"];
9570
9570
  const SKILLS_SUB_PKG = "agent_skills";
9571
9571
  const SKILL_DIRS = ["cmd_skills", "goal_skills", "tools"];
@@ -9602,7 +9602,7 @@ function createSkillModule() {
9602
9602
  required: ["agent_id"],
9603
9603
  additionalProperties: false
9604
9604
  },
9605
- outputSchema: OBJECT_OUTPUT$5,
9605
+ outputSchema: OBJECT_OUTPUT$6,
9606
9606
  resultSchemaVersion: 1,
9607
9607
  access: { mode: "fixed", level: "read" },
9608
9608
  asyncMode: "sync",
@@ -9641,7 +9641,7 @@ function createSkillModule() {
9641
9641
  required: ["pikg_path", "agent_id"],
9642
9642
  additionalProperties: false
9643
9643
  },
9644
- outputSchema: OBJECT_OUTPUT$5,
9644
+ outputSchema: OBJECT_OUTPUT$6,
9645
9645
  resultSchemaVersion: 1,
9646
9646
  access: { mode: "fixed", level: "write" },
9647
9647
  asyncMode: "sync",
@@ -9668,7 +9668,7 @@ function createSkillModule() {
9668
9668
  required: ["name", "agent_id"],
9669
9669
  additionalProperties: false
9670
9670
  },
9671
- outputSchema: OBJECT_OUTPUT$5,
9671
+ outputSchema: OBJECT_OUTPUT$6,
9672
9672
  resultSchemaVersion: 1,
9673
9673
  access: { mode: "fixed", level: "destructive" },
9674
9674
  asyncMode: "sync",
@@ -9789,7 +9789,7 @@ function base64(bytes) {
9789
9789
  return btoa(binary);
9790
9790
  }
9791
9791
  const CONTROL_PANEL = "control-panel";
9792
- const OBJECT_OUTPUT$4 = { type: "object", additionalProperties: true };
9792
+ const OBJECT_OUTPUT$5 = { type: "object", additionalProperties: true };
9793
9793
  const AGENT_POSITIONAL = {
9794
9794
  name: "agent_id",
9795
9795
  description: "Agent ID as `agent list` prints it (raw host name, e.g. jarvis.example.zone)"
@@ -9813,7 +9813,7 @@ function createAgentModule() {
9813
9813
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
9814
9814
  outputSchema: {
9815
9815
  type: "object",
9816
- properties: { agents: { type: "array", items: OBJECT_OUTPUT$4 } },
9816
+ properties: { agents: { type: "array", items: OBJECT_OUTPUT$5 } },
9817
9817
  required: ["agents"],
9818
9818
  additionalProperties: false
9819
9819
  },
@@ -9839,7 +9839,7 @@ function createAgentModule() {
9839
9839
  summary: "Get one Agent: profile, settings, install state, template, and runtime",
9840
9840
  positionals: [AGENT_POSITIONAL],
9841
9841
  inputSchema: AGENT_INPUT,
9842
- outputSchema: OBJECT_OUTPUT$4,
9842
+ outputSchema: OBJECT_OUTPUT$5,
9843
9843
  resultSchemaVersion: 1,
9844
9844
  access: { mode: "fixed", level: "read" },
9845
9845
  asyncMode: "sync",
@@ -9852,7 +9852,7 @@ function createAgentModule() {
9852
9852
  summary: "Get the public profile (display name, bio, avatar) of an Agent",
9853
9853
  positionals: [AGENT_POSITIONAL],
9854
9854
  inputSchema: AGENT_INPUT,
9855
- outputSchema: OBJECT_OUTPUT$4,
9855
+ outputSchema: OBJECT_OUTPUT$5,
9856
9856
  resultSchemaVersion: 1,
9857
9857
  access: { mode: "fixed", level: "read" },
9858
9858
  asyncMode: "sync",
@@ -9893,8 +9893,8 @@ function createAgentModule() {
9893
9893
  type: "object",
9894
9894
  properties: {
9895
9895
  agent_id: { type: "string" },
9896
- before: OBJECT_OUTPUT$4,
9897
- profile: OBJECT_OUTPUT$4
9896
+ before: OBJECT_OUTPUT$5,
9897
+ profile: OBJECT_OUTPUT$5
9898
9898
  },
9899
9899
  required: ["agent_id", "before", "profile"],
9900
9900
  additionalProperties: false
@@ -9939,7 +9939,7 @@ async function callAgent(ctx, method, params) {
9939
9939
  }
9940
9940
  }
9941
9941
  const AICC = "aicc";
9942
- const OBJECT_OUTPUT$3 = { type: "object", additionalProperties: true };
9942
+ const OBJECT_OUTPUT$4 = { type: "object", additionalProperties: true };
9943
9943
  const EMPTY_INPUT = { type: "object", properties: {}, additionalProperties: false };
9944
9944
  const RANGES = ["last1d", "last7d", "last30d"];
9945
9945
  const GROUPS = [
@@ -9957,13 +9957,13 @@ function createAiModule() {
9957
9957
  name: "ai",
9958
9958
  summary: "Read AI provider, routing, usage and token quota state of the AICC service",
9959
9959
  commands: [
9960
- readCommand$1({
9960
+ readCommand$2({
9961
9961
  verb: "providers",
9962
9962
  summary: "List configured AI provider instances with auth, health, and model inventory",
9963
9963
  method: "provider.list",
9964
9964
  description: "Credentials are reported only as configured/kind; secrets are never returned."
9965
9965
  }),
9966
- readCommand$1({
9966
+ readCommand$2({
9967
9967
  verb: "routing",
9968
9968
  summary: "Get the AICC routing overlay and its settings revision",
9969
9969
  method: "routing.get",
@@ -9987,7 +9987,7 @@ function quotaCommand() {
9987
9987
  properties: { app: { type: "string", minLength: 1 } },
9988
9988
  additionalProperties: false
9989
9989
  },
9990
- outputSchema: OBJECT_OUTPUT$3,
9990
+ outputSchema: OBJECT_OUTPUT$4,
9991
9991
  resultSchemaVersion: 1,
9992
9992
  access: { mode: "fixed", level: "read" },
9993
9993
  asyncMode: "sync",
@@ -9999,13 +9999,13 @@ function quotaCommand() {
9999
9999
  )
10000
10000
  };
10001
10001
  }
10002
- function readCommand$1(options) {
10002
+ function readCommand$2(options) {
10003
10003
  return {
10004
10004
  verb: options.verb,
10005
10005
  summary: options.summary,
10006
10006
  description: options.description,
10007
10007
  inputSchema: EMPTY_INPUT,
10008
- outputSchema: OBJECT_OUTPUT$3,
10008
+ outputSchema: OBJECT_OUTPUT$4,
10009
10009
  resultSchemaVersion: 1,
10010
10010
  access: { mode: "fixed", level: "read" },
10011
10011
  asyncMode: "sync",
@@ -10057,7 +10057,7 @@ function usageCommand() {
10057
10057
  },
10058
10058
  additionalProperties: false
10059
10059
  },
10060
- outputSchema: OBJECT_OUTPUT$3,
10060
+ outputSchema: OBJECT_OUTPUT$4,
10061
10061
  resultSchemaVersion: 1,
10062
10062
  access: { mode: "fixed", level: "read" },
10063
10063
  asyncMode: "sync",
@@ -10102,7 +10102,7 @@ function timeRange(input) {
10102
10102
  }
10103
10103
  return { kind: "explicit", start_time_ms: since, end_time_ms: until ?? Date.now() };
10104
10104
  }
10105
- const OBJECT_OUTPUT$2 = { type: "object", additionalProperties: true };
10105
+ const OBJECT_OUTPUT$3 = { type: "object", additionalProperties: true };
10106
10106
  const DAY_MS$1 = 864e5;
10107
10107
  const EXPIRES_HELP = "1d, 7d (default), 30d, none, or an RFC 3339 time";
10108
10108
  function createShareModule() {
@@ -10124,7 +10124,7 @@ async function openNfsp(ctx) {
10124
10124
  if (!session)
10125
10125
  throw new ToolError("AUTH_REQUIRED", "authenticated session is required", 3);
10126
10126
  const token = (await session.ensureValid()).token;
10127
- const base = gatewayOrigin$1(ctx.connection.endpoint);
10127
+ const base = gatewayOrigin$2(ctx.connection.endpoint);
10128
10128
  let seq = 0;
10129
10129
  const post = async (method, body) => {
10130
10130
  const response = await fetch(`${base}/nfs/v1/${method}`, {
@@ -10155,7 +10155,7 @@ async function openNfsp(ctx) {
10155
10155
  call: (method, args, write = false) => post(method, { session: sessionId, args: { ...args, source_hint: "cli" }, ...write ? { seq: ++seq } : {} })
10156
10156
  };
10157
10157
  }
10158
- function gatewayOrigin$1(endpoint) {
10158
+ function gatewayOrigin$2(endpoint) {
10159
10159
  const url = new URL(endpoint);
10160
10160
  const marker = url.pathname.indexOf("/kapi");
10161
10161
  url.pathname = marker >= 0 ? url.pathname.slice(0, marker) || "/" : "/";
@@ -10213,7 +10213,7 @@ function createCommand() {
10213
10213
  required: ["path"],
10214
10214
  additionalProperties: false
10215
10215
  },
10216
- outputSchema: OBJECT_OUTPUT$2,
10216
+ outputSchema: OBJECT_OUTPUT$3,
10217
10217
  resultSchemaVersion: 1,
10218
10218
  access: { mode: "fixed", level: "write" },
10219
10219
  asyncMode: "either",
@@ -10282,7 +10282,7 @@ function listCommand() {
10282
10282
  },
10283
10283
  additionalProperties: false
10284
10284
  },
10285
- outputSchema: OBJECT_OUTPUT$2,
10285
+ outputSchema: OBJECT_OUTPUT$3,
10286
10286
  resultSchemaVersion: 1,
10287
10287
  access: { mode: "fixed", level: "read" },
10288
10288
  asyncMode: "sync",
@@ -10314,7 +10314,7 @@ function getCommand$1() {
10314
10314
  required: ["share_id"],
10315
10315
  additionalProperties: false
10316
10316
  },
10317
- outputSchema: OBJECT_OUTPUT$2,
10317
+ outputSchema: OBJECT_OUTPUT$3,
10318
10318
  resultSchemaVersion: 1,
10319
10319
  access: { mode: "fixed", level: "read" },
10320
10320
  asyncMode: "sync",
@@ -10351,7 +10351,7 @@ function updateCommand() {
10351
10351
  required: ["share_id"],
10352
10352
  additionalProperties: false
10353
10353
  },
10354
- outputSchema: OBJECT_OUTPUT$2,
10354
+ outputSchema: OBJECT_OUTPUT$3,
10355
10355
  resultSchemaVersion: 1,
10356
10356
  access: { mode: "fixed", level: "write" },
10357
10357
  asyncMode: "sync",
@@ -10395,7 +10395,7 @@ function stopCommand() {
10395
10395
  required: ["share_id"],
10396
10396
  additionalProperties: false
10397
10397
  },
10398
- outputSchema: OBJECT_OUTPUT$2,
10398
+ outputSchema: OBJECT_OUTPUT$3,
10399
10399
  resultSchemaVersion: 1,
10400
10400
  access: { mode: "fixed", level: "destructive" },
10401
10401
  asyncMode: "sync",
@@ -10427,7 +10427,7 @@ function statsCommand() {
10427
10427
  },
10428
10428
  additionalProperties: false
10429
10429
  },
10430
- outputSchema: OBJECT_OUTPUT$2,
10430
+ outputSchema: OBJECT_OUTPUT$3,
10431
10431
  resultSchemaVersion: 1,
10432
10432
  access: { mode: "fixed", level: "read" },
10433
10433
  asyncMode: "sync",
@@ -10446,7 +10446,7 @@ function statsCommand() {
10446
10446
  }
10447
10447
  };
10448
10448
  }
10449
- const OBJECT_OUTPUT$1 = { type: "object", additionalProperties: true };
10449
+ const OBJECT_OUTPUT$2 = { type: "object", additionalProperties: true };
10450
10450
  const SERVICE$1 = "nfs-server";
10451
10451
  const MAX_PUT_BYTES = 32 * 1024 * 1024;
10452
10452
  const DAY_MS = 864e5;
@@ -10501,7 +10501,7 @@ async function call$1(ctx, method, params) {
10501
10501
  throw error;
10502
10502
  }
10503
10503
  }
10504
- function gatewayOrigin(endpoint) {
10504
+ function gatewayOrigin$1(endpoint) {
10505
10505
  const url = new URL(endpoint);
10506
10506
  const marker = url.pathname.indexOf("/kapi");
10507
10507
  url.pathname = marker >= 0 ? url.pathname.slice(0, marker) || "/" : "/";
@@ -10512,7 +10512,7 @@ function gatewayOrigin(endpoint) {
10512
10512
  function objectUrl(ctx, target, query = {}) {
10513
10513
  const qs = new URLSearchParams(query).toString();
10514
10514
  const key = target.key.split("/").map(encodeURIComponent).join("/");
10515
- return `${gatewayOrigin(ctx.connection.endpoint)}/bucket/v1/${target.bucketId}/${key}${qs ? `?${qs}` : ""}`;
10515
+ return `${gatewayOrigin$1(ctx.connection.endpoint)}/bucket/v1/${target.bucketId}/${key}${qs ? `?${qs}` : ""}`;
10516
10516
  }
10517
10517
  async function bearer(ctx) {
10518
10518
  if (!ctx.session)
@@ -10551,7 +10551,7 @@ function lsCommand() {
10551
10551
  },
10552
10552
  additionalProperties: false
10553
10553
  },
10554
- outputSchema: OBJECT_OUTPUT$1,
10554
+ outputSchema: OBJECT_OUTPUT$2,
10555
10555
  resultSchemaVersion: 1,
10556
10556
  access: { mode: "fixed", level: "read" },
10557
10557
  asyncMode: "sync",
@@ -10584,7 +10584,7 @@ function statCommand() {
10584
10584
  required: ["target"],
10585
10585
  additionalProperties: false
10586
10586
  },
10587
- outputSchema: OBJECT_OUTPUT$1,
10587
+ outputSchema: OBJECT_OUTPUT$2,
10588
10588
  resultSchemaVersion: 1,
10589
10589
  access: { mode: "fixed", level: "read" },
10590
10590
  asyncMode: "sync",
@@ -10625,7 +10625,7 @@ function putCommand() {
10625
10625
  required: ["target", "file"],
10626
10626
  additionalProperties: false
10627
10627
  },
10628
- outputSchema: OBJECT_OUTPUT$1,
10628
+ outputSchema: OBJECT_OUTPUT$2,
10629
10629
  resultSchemaVersion: 1,
10630
10630
  access: { mode: "fixed", level: "write" },
10631
10631
  asyncMode: "sync",
@@ -10674,7 +10674,7 @@ function getCommand() {
10674
10674
  required: ["target", "output"],
10675
10675
  additionalProperties: false
10676
10676
  },
10677
- outputSchema: OBJECT_OUTPUT$1,
10677
+ outputSchema: OBJECT_OUTPUT$2,
10678
10678
  resultSchemaVersion: 1,
10679
10679
  access: { mode: "fixed", level: "read" },
10680
10680
  asyncMode: "sync",
@@ -10712,7 +10712,7 @@ function rmCommand() {
10712
10712
  required: ["target"],
10713
10713
  additionalProperties: false
10714
10714
  },
10715
- outputSchema: OBJECT_OUTPUT$1,
10715
+ outputSchema: OBJECT_OUTPUT$2,
10716
10716
  resultSchemaVersion: 1,
10717
10717
  access: { mode: "fixed", level: "write" },
10718
10718
  asyncMode: "sync",
@@ -10743,7 +10743,7 @@ function linkCommand() {
10743
10743
  required: ["target"],
10744
10744
  additionalProperties: false
10745
10745
  },
10746
- outputSchema: OBJECT_OUTPUT$1,
10746
+ outputSchema: OBJECT_OUTPUT$2,
10747
10747
  resultSchemaVersion: 1,
10748
10748
  access: { mode: "fixed", level: "write" },
10749
10749
  asyncMode: "sync",
@@ -10763,7 +10763,7 @@ function linkCommand() {
10763
10763
  expires_at: expiresAt,
10764
10764
  max_uses: input.max_uses
10765
10765
  });
10766
- return { ...issued, url: `${gatewayOrigin(ctx.connection.endpoint)}${String(issued.path)}` };
10766
+ return { ...issued, url: `${gatewayOrigin$1(ctx.connection.endpoint)}${String(issued.path)}` };
10767
10767
  }
10768
10768
  };
10769
10769
  }
@@ -10772,7 +10772,7 @@ function s3KeysCommand() {
10772
10772
  verb: "s3-keys",
10773
10773
  summary: "List your S3 access keys (secrets are shown only when created)",
10774
10774
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
10775
- outputSchema: OBJECT_OUTPUT$1,
10775
+ outputSchema: OBJECT_OUTPUT$2,
10776
10776
  resultSchemaVersion: 1,
10777
10777
  access: { mode: "fixed", level: "read" },
10778
10778
  asyncMode: "sync",
@@ -10796,7 +10796,7 @@ function s3KeyCreateCommand() {
10796
10796
  required: ["app"],
10797
10797
  additionalProperties: false
10798
10798
  },
10799
- outputSchema: OBJECT_OUTPUT$1,
10799
+ outputSchema: OBJECT_OUTPUT$2,
10800
10800
  resultSchemaVersion: 1,
10801
10801
  access: { mode: "fixed", level: "write" },
10802
10802
  asyncMode: "sync",
@@ -10812,7 +10812,7 @@ function s3KeyCreateCommand() {
10812
10812
  scope: prefix ? { prefix } : void 0,
10813
10813
  expires_at: expiresAt
10814
10814
  });
10815
- return { ...key, endpoint: `${gatewayOrigin(ctx.connection.endpoint)}/s3`, region: "us-east-1", path_style: true };
10815
+ return { ...key, endpoint: `${gatewayOrigin$1(ctx.connection.endpoint)}/s3`, region: "us-east-1", path_style: true };
10816
10816
  }
10817
10817
  };
10818
10818
  }
@@ -10827,7 +10827,7 @@ function s3KeyRevokeCommand() {
10827
10827
  required: ["access_key_id"],
10828
10828
  additionalProperties: false
10829
10829
  },
10830
- outputSchema: OBJECT_OUTPUT$1,
10830
+ outputSchema: OBJECT_OUTPUT$2,
10831
10831
  resultSchemaVersion: 1,
10832
10832
  access: { mode: "fixed", level: "write" },
10833
10833
  asyncMode: "sync",
@@ -10836,6 +10836,146 @@ function s3KeyRevokeCommand() {
10836
10836
  handler: async (ctx, input) => await call$1(ctx, "bucket.revoke_s3_key", { access_key_id: requiredInputString(input, "access_key_id") })
10837
10837
  };
10838
10838
  }
10839
+ const OBJECT_OUTPUT$1 = { type: "object", additionalProperties: true };
10840
+ const URL_ARG = { name: "url", description: "obj:// cyfs:// file:// https:// url, or //<service>/... /abs/path shorthand", required: true };
10841
+ function createObjModule() {
10842
+ return {
10843
+ name: "obj",
10844
+ summary: "Resolve system URLs and read DID Objects (obj://, cyfs://, file://, https://)",
10845
+ commands: [resolveCommand(), readCommand$1()]
10846
+ };
10847
+ }
10848
+ function gatewayOrigin(endpoint) {
10849
+ const url = new URL(endpoint);
10850
+ const marker = url.pathname.indexOf("/kapi");
10851
+ url.pathname = marker >= 0 ? url.pathname.slice(0, marker) || "/" : "/";
10852
+ url.search = "";
10853
+ url.hash = "";
10854
+ return url.toString().replace(/\/$/, "");
10855
+ }
10856
+ function parse(raw) {
10857
+ try {
10858
+ return objectUrl$1.parseObjectUrl(objectUrl$1.expandInputShorthand(raw));
10859
+ } catch (error) {
10860
+ throw new UsageError("INVALID_ARGUMENT", error instanceof Error ? error.message : String(error));
10861
+ }
10862
+ }
10863
+ function endpointOf(ctx, url) {
10864
+ const origin = gatewayOrigin(ctx.connection.endpoint);
10865
+ if (url.kind === "obj") {
10866
+ const query = objectUrl$1.formatObjectUrl(url).split("?")[1];
10867
+ return `${origin}/kapi/${url.host.name}/obj${url.path}${query ? `?${query}` : ""}`;
10868
+ }
10869
+ if (url.kind === "cyfs_path" && (url.zone === null || url.zone === ctx.connection.zone)) {
10870
+ return `${origin}/kapi/dfs/obj${url.path.replace(/\/$/, "")}`;
10871
+ }
10872
+ if (url.kind === "web")
10873
+ return url.url;
10874
+ return null;
10875
+ }
10876
+ function describe(ctx, url) {
10877
+ const out = {
10878
+ canonical: objectUrl$1.formatObjectUrl(url),
10879
+ kind: url.kind === "obj" ? `obj_${url.host.kind}` : url.kind,
10880
+ rbac_resource_key: objectUrl$1.rbacResourceKey(url, ctx.connection.zone),
10881
+ endpoint: endpointOf(ctx, url)
10882
+ };
10883
+ if (url.kind === "obj") {
10884
+ out.host = url.host.name;
10885
+ out.event_pattern = objectUrl$1.objectEventPattern(url);
10886
+ }
10887
+ if (url.kind === "file")
10888
+ out.device = url.deviceId ?? "(empty host: the source runtime, else the Zone default device)";
10889
+ if (url.kind === "cyfs_object")
10890
+ out.obj_id = url.objId.toString();
10891
+ return out;
10892
+ }
10893
+ function resolveCommand() {
10894
+ return {
10895
+ verb: "resolve",
10896
+ summary: "Normalize a URL and show its identity, RBAC key, events and endpoint (no access check)",
10897
+ positionals: [URL_ARG],
10898
+ inputSchema: { type: "object", properties: { url: { type: "string", minLength: 1 } }, required: ["url"], additionalProperties: false },
10899
+ outputSchema: OBJECT_OUTPUT$1,
10900
+ resultSchemaVersion: 1,
10901
+ access: { mode: "fixed", level: "read" },
10902
+ asyncMode: "sync",
10903
+ requiresSession: false,
10904
+ examples: ["buckyos obj resolve obj://msg-center/owners/did:bns:alice/sessions", "buckyos obj resolve //config/boot/config", "buckyos obj resolve cyfs:///home/alice/a.md"],
10905
+ handler: (ctx, input) => Promise.resolve(describe(ctx, parse(requiredInputString(input, "url"))))
10906
+ };
10907
+ }
10908
+ async function getJson(ctx, url) {
10909
+ const headers = { accept: "application/json" };
10910
+ if (ctx.session)
10911
+ headers.authorization = `Bearer ${(await ctx.session.ensureValid()).token}`;
10912
+ const response = await fetch(url, { headers, signal: ctx.signal });
10913
+ const text2 = await response.text();
10914
+ if (!response.ok) {
10915
+ const code = response.status === 403 || response.status === 401 ? "PERMISSION_DENIED" : response.status === 404 ? "NOT_FOUND" : "OBJECT_READ_FAILED";
10916
+ throw new ToolError(code, `${url}: HTTP ${response.status} ${text2.slice(0, 300)}`);
10917
+ }
10918
+ try {
10919
+ return JSON.parse(text2);
10920
+ } catch {
10921
+ throw new ToolError("INVALID_SERVICE_RESPONSE", `${url} did not answer JSON`, EXIT_INTERNAL);
10922
+ }
10923
+ }
10924
+ function readCommand$1() {
10925
+ return {
10926
+ verb: "read",
10927
+ summary: "Read a DID Object: its Card, Profile (properties, actions, events) and summary properties",
10928
+ positionals: [URL_ARG],
10929
+ options: [{ name: "property", description: "Read these properties instead of the summary ones (comma separated)", type: "string" }],
10930
+ inputSchema: {
10931
+ type: "object",
10932
+ properties: { url: { type: "string", minLength: 1 }, property: { type: "string", minLength: 1 } },
10933
+ required: ["url"],
10934
+ additionalProperties: false
10935
+ },
10936
+ outputSchema: OBJECT_OUTPUT$1,
10937
+ resultSchemaVersion: 1,
10938
+ access: { mode: "fixed", level: "read" },
10939
+ asyncMode: "sync",
10940
+ requiresSession: true,
10941
+ examples: ["buckyos obj read obj://aiworkspace/ws_1/entities/e_1", "buckyos obj read obj://xiaobai.test.buckyos.io/sessions/s-1 --property report"],
10942
+ handler: async (ctx, input) => {
10943
+ const url = parse(requiredInputString(input, "url"));
10944
+ const endpoint = endpointOf(ctx, url);
10945
+ if (!endpoint)
10946
+ throw new ToolError("UNSUPPORTED_OBJECT", `${objectUrl$1.formatObjectUrl(url)} has no DID Object endpoint; read it as a file or content object`);
10947
+ const card = await getJson(ctx, endpoint);
10948
+ const service = (card.service ?? []).find((s) => s.type === "DIDObjectService");
10949
+ if (!service)
10950
+ throw new ToolError("INVALID_SERVICE_RESPONSE", `${endpoint} answered no DID Object Card`, EXIT_INTERNAL);
10951
+ const serviceEndpoint = String(service.serviceEndpoint).replace(/\/$/, "");
10952
+ const profileUrl = new URL(String(service.profile), `${serviceEndpoint}/`).toString();
10953
+ const profile = await getJson(ctx, profileUrl);
10954
+ const wanted = typeof input.property === "string" ? input.property.split(",").map((p) => p.trim()).filter(Boolean) : profile["x-buckyos:summary_props"] ?? [];
10955
+ const properties = {};
10956
+ for (const name of wanted) {
10957
+ if (!profile.properties?.[name])
10958
+ throw new UsageError("INVALID_ARGUMENT", `property ${name} is not declared by the object`);
10959
+ properties[name] = await getJson(ctx, `${serviceEndpoint}/props/${encodeURIComponent(name)}`);
10960
+ }
10961
+ return {
10962
+ ...describe(ctx, url),
10963
+ object_did: card.id,
10964
+ also_known_as: card.alsoKnownAs ?? [],
10965
+ title: profile.title,
10966
+ description: profile.description,
10967
+ kind: service.kind ?? profile["x-buckyos:kind"],
10968
+ traits: profile["x-buckyos:traits"] ?? [],
10969
+ declared: {
10970
+ properties: Object.keys(profile.properties ?? {}),
10971
+ actions: Object.fromEntries(Object.entries(profile.actions ?? {}).map(([name, a]) => [name, { risk: a["x-buckyos:risk"], rbac: a["x-buckyos:rbac"] }])),
10972
+ events: Object.fromEntries(Object.entries(profile.events ?? {}).map(([name, e]) => [name, e["x-buckyos:kevent"]]))
10973
+ },
10974
+ properties
10975
+ };
10976
+ }
10977
+ };
10978
+ }
10839
10979
  const text = { type: "string", minLength: 1 };
10840
10980
  const object = { type: "object", additionalProperties: true };
10841
10981
  const targetProperties = {
@@ -11715,6 +11855,7 @@ function createRegistry(pikgDependencies, appDependencies, logDependencies, diag
11715
11855
  registry.register(createAiModule());
11716
11856
  registry.register(createShareModule());
11717
11857
  registry.register(createBucketModule());
11858
+ registry.register(createObjModule());
11718
11859
  registry.register(createExecutorModule());
11719
11860
  registry.register(createAiwsModule());
11720
11861
  return registry;