grok-bot-cli 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/gbot.mjs CHANGED
@@ -11045,6 +11045,14 @@ const agentSummarySchema = zod__rspack_import_3/* .object */.Ikc({
11045
11045
  notifyOnAgentUpdates: zod__rspack_import_3/* .boolean */.zMY().optional(),
11046
11046
  title: zod__rspack_import_3/* .string */.YjP().optional()
11047
11047
  }).strict();
11048
+ const skillSchema = zod__rspack_import_3/* .object */.Ikc({
11049
+ description: zod__rspack_import_3/* .string */.YjP(),
11050
+ id: zod__rspack_import_3/* .string */.YjP(),
11051
+ name: zod__rspack_import_3/* .string */.YjP(),
11052
+ pluginId: zod__rspack_import_3/* .string */.YjP().optional(),
11053
+ source: zod__rspack_import_3/* .string */.YjP(),
11054
+ sourceRef: zod__rspack_import_3/* .string */.YjP().optional()
11055
+ }).strict();
11048
11056
  const createFieldsSchema = zod__rspack_import_3/* .object */.Ikc({
11049
11057
  avatarColor: avatarColorSchema.optional(),
11050
11058
  avatarShape: avatarShapeSchema.optional(),
@@ -11087,6 +11095,7 @@ __webpack_require__.d(__webpack_exports__, {
11087
11095
  }, {
11088
11096
  FS: openBackendFromInput,
11089
11097
  R9: failureDocumentSchema,
11098
+ b7: skillSchema,
11090
11099
  bY: createFieldsSchema,
11091
11100
  cp: toCreateInput,
11092
11101
  lK: backendFlagsSchema,
@@ -13673,6 +13682,202 @@ __webpack_require__.d(__webpack_exports__, {
13673
13682
  });
13674
13683
 
13675
13684
 
13685
+ },
13686
+ "./src/cli/skills/add.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
13687
+ __webpack_require__.r(__webpack_exports__);
13688
+ /* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
13689
+ /* import */ var node_fs_promises__rspack_import_1 = __webpack_require__("node:fs/promises");
13690
+ /* import */ var node_path__rspack_import_2 = __webpack_require__("node:path");
13691
+ /* import */ var _agent_bundle_runtime__rspack_import_5 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
13692
+ /* import */ var zod__rspack_import_4 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
13693
+ /* import */ var _shared_js__rspack_import_3 = __webpack_require__("./src/cli/_shared.ts");
13694
+
13695
+
13696
+
13697
+
13698
+
13699
+
13700
+ const config = {
13701
+ description: 'Add a SKILL.md to the shared skill library. Every bot sees it.',
13702
+ inputJsonSchema: {
13703
+ additionalProperties: false,
13704
+ properties: {
13705
+ dir: {
13706
+ description: 'Agents directory for --files mode',
13707
+ type: 'string'
13708
+ },
13709
+ files: {
13710
+ description: 'Force the on-disk agents store',
13711
+ type: 'boolean'
13712
+ },
13713
+ gateway: {
13714
+ description: 'Force the live gateway',
13715
+ type: 'boolean'
13716
+ },
13717
+ path: {
13718
+ description: 'SKILL.md file, or a directory holding one',
13719
+ type: 'string'
13720
+ }
13721
+ },
13722
+ required: [
13723
+ 'path'
13724
+ ],
13725
+ type: 'object'
13726
+ },
13727
+ positionals: [
13728
+ 'path'
13729
+ ]
13730
+ };
13731
+ const inputSchema = _shared_js__rspack_import_3/* .backendFlagsSchema.extend */.lK.extend({
13732
+ path: zod__rspack_import_4/* .string */.YjP().min(1)
13733
+ }).strict();
13734
+ const resultSchema = _shared_js__rspack_import_3/* .skillSchema */.b7;
13735
+ const skillFile = async (path)=>{
13736
+ const target = (0,node_path__rspack_import_2.resolve)(path);
13737
+ return (await (0,node_fs_promises__rspack_import_1.stat)(target)).isDirectory() ? (0,node_path__rspack_import_2.join)(target, 'SKILL.md') : target;
13738
+ };
13739
+ async function skillsAdd({ input }) {
13740
+ const markdown = await (0,node_fs_promises__rspack_import_1.readFile)(await skillFile(input.path), 'utf8');
13741
+ const backend = await (0,_shared_js__rspack_import_3/* .openBackendFromInput */.FS)(input);
13742
+ const skill = resultSchema.parse(await backend.addSkill(markdown));
13743
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
13744
+ value: skill,
13745
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
13746
+ children: `Added skill ${skill.name} (${skill.id}) to the shared library`
13747
+ })
13748
+ });
13749
+ }
13750
+
13751
+ __webpack_require__.d(__webpack_exports__, {
13752
+ "default": () => (skillsAdd)
13753
+ }, {
13754
+ config: config,
13755
+ inputSchema: inputSchema,
13756
+ resultSchema: resultSchema
13757
+ });
13758
+
13759
+
13760
+ },
13761
+ "./src/cli/skills/list.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
13762
+ __webpack_require__.r(__webpack_exports__);
13763
+ /* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
13764
+ /* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
13765
+ /* import */ var zod__rspack_import_2 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
13766
+ /* import */ var _shared_js__rspack_import_1 = __webpack_require__("./src/cli/_shared.ts");
13767
+
13768
+
13769
+
13770
+
13771
+ const config = {
13772
+ description: 'List the skill library every bot in this Grok Bot shares.',
13773
+ inputJsonSchema: {
13774
+ additionalProperties: false,
13775
+ properties: {
13776
+ dir: {
13777
+ description: 'Agents directory for --files mode',
13778
+ type: 'string'
13779
+ },
13780
+ files: {
13781
+ description: 'Force the on-disk agents store',
13782
+ type: 'boolean'
13783
+ },
13784
+ gateway: {
13785
+ description: 'Force the live gateway',
13786
+ type: 'boolean'
13787
+ }
13788
+ },
13789
+ type: 'object'
13790
+ }
13791
+ };
13792
+ const inputSchema = _shared_js__rspack_import_1/* .backendFlagsSchema */.lK;
13793
+ const resultSchema = zod__rspack_import_2/* .array */.YOg(_shared_js__rspack_import_1/* .skillSchema */.b7);
13794
+ async function skillsList({ input }) {
13795
+ const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
13796
+ const skills = resultSchema.parse(await backend.skills());
13797
+ const lines = skills.map((s)=>`${s.id} ${s.name} [${s.source}]${s.description ? ` ${s.description}` : ''}`);
13798
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
13799
+ value: skills,
13800
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
13801
+ children: lines.length > 0 ? lines.join('\n') : 'No skills.'
13802
+ })
13803
+ });
13804
+ }
13805
+
13806
+ __webpack_require__.d(__webpack_exports__, {
13807
+ "default": () => (skillsList)
13808
+ }, {
13809
+ config: config,
13810
+ inputSchema: inputSchema,
13811
+ resultSchema: resultSchema
13812
+ });
13813
+
13814
+
13815
+ },
13816
+ "./src/cli/skills/remove.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
13817
+ __webpack_require__.r(__webpack_exports__);
13818
+ /* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
13819
+ /* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
13820
+ /* import */ var zod__rspack_import_2 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
13821
+ /* import */ var _shared_js__rspack_import_1 = __webpack_require__("./src/cli/_shared.ts");
13822
+
13823
+
13824
+
13825
+
13826
+ const config = {
13827
+ description: 'Remove a library skill by id or name. Every bot loses it.',
13828
+ inputJsonSchema: {
13829
+ additionalProperties: false,
13830
+ properties: {
13831
+ dir: {
13832
+ description: 'Agents directory for --files mode',
13833
+ type: 'string'
13834
+ },
13835
+ files: {
13836
+ description: 'Force the on-disk agents store',
13837
+ type: 'boolean'
13838
+ },
13839
+ gateway: {
13840
+ description: 'Force the live gateway',
13841
+ type: 'boolean'
13842
+ },
13843
+ skill: {
13844
+ description: 'Skill id or name',
13845
+ type: 'string'
13846
+ }
13847
+ },
13848
+ required: [
13849
+ 'skill'
13850
+ ],
13851
+ type: 'object'
13852
+ },
13853
+ positionals: [
13854
+ 'skill'
13855
+ ]
13856
+ };
13857
+ const inputSchema = _shared_js__rspack_import_1/* .backendFlagsSchema.extend */.lK.extend({
13858
+ skill: zod__rspack_import_2/* .string */.YjP().min(1)
13859
+ }).strict();
13860
+ const resultSchema = _shared_js__rspack_import_1/* .skillSchema */.b7;
13861
+ async function skillsRemove({ input }) {
13862
+ const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
13863
+ const skill = resultSchema.parse(await backend.removeSkill(input.skill));
13864
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
13865
+ value: skill,
13866
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
13867
+ children: `Removed skill ${skill.name} (${skill.id}) from the shared library`
13868
+ })
13869
+ });
13870
+ }
13871
+
13872
+ __webpack_require__.d(__webpack_exports__, {
13873
+ "default": () => (skillsRemove)
13874
+ }, {
13875
+ config: config,
13876
+ inputSchema: inputSchema,
13877
+ resultSchema: resultSchema
13878
+ });
13879
+
13880
+
13676
13881
  },
13677
13882
  "./src/cli/thread.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
13678
13883
  __webpack_require__.r(__webpack_exports__);
@@ -84237,9 +84442,9 @@ __webpack_require__.d(__webpack_exports__, {
84237
84442
  __webpack_require__.a(__webpack_module__, async function (__rspack_load_async_deps, __rspack_async_done) { try {
84238
84443
  /* import */ var agent_bundle_launch_env_layer__rspack_import_0 = __webpack_require__("./.agent-bundle-virtual/bin-gbot-0.mjs");
84239
84444
  /* import */ var agent_bundle_cli_entry__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/cli-entry.js");
84240
- /* import */ var _agent_bundle_runtime__rspack_import_36 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/49.js");
84241
- /* import */ var _agent_bundle_runtime__rspack_import_37 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/736.js");
84242
- /* import */ var _agent_bundle_runtime__rspack_import_38 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/index.js");
84445
+ /* import */ var _agent_bundle_runtime__rspack_import_39 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/49.js");
84446
+ /* import */ var _agent_bundle_runtime__rspack_import_40 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/736.js");
84447
+ /* import */ var _agent_bundle_runtime__rspack_import_41 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/index.js");
84243
84448
  /* import */ var node_url__rspack_import_2 = __webpack_require__("node:url");
84244
84449
  /* import */ var node_worker_threads__rspack_import_3 = __webpack_require__("node:worker_threads");
84245
84450
  /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_approvals_list_tsx__rspack_import_4 = __webpack_require__("./src/cli/approvals/list.tsx");
@@ -84273,7 +84478,10 @@ __webpack_require__.a(__webpack_module__, async function (__rspack_load_async_de
84273
84478
  /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_groups_update_tsx__rspack_import_32 = __webpack_require__("./src/cli/groups/update.tsx");
84274
84479
  /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_history_tsx__rspack_import_33 = __webpack_require__("./src/cli/history.tsx");
84275
84480
  /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_send_tsx__rspack_import_34 = __webpack_require__("./src/cli/send.tsx");
84276
- /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_thread_tsx__rspack_import_35 = __webpack_require__("./src/cli/thread.tsx");
84481
+ /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_add_tsx__rspack_import_35 = __webpack_require__("./src/cli/skills/add.tsx");
84482
+ /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_list_tsx__rspack_import_36 = __webpack_require__("./src/cli/skills/list.tsx");
84483
+ /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_remove_tsx__rspack_import_37 = __webpack_require__("./src/cli/skills/remove.tsx");
84484
+ /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_thread_tsx__rspack_import_38 = __webpack_require__("./src/cli/thread.tsx");
84277
84485
 
84278
84486
 
84279
84487
 
@@ -84342,8 +84550,14 @@ const route29 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_gro
84342
84550
 
84343
84551
  const route30 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_send_tsx__rspack_import_34, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_send_tsx__rspack_import_34);
84344
84552
 
84345
- const route31 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_thread_tsx__rspack_import_35, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_thread_tsx__rspack_import_35);
84346
- const pluginRoot = (0,_agent_bundle_runtime__rspack_import_36/* .resolvePluginRoot */.E7)({
84553
+ const route31 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_add_tsx__rspack_import_35, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_add_tsx__rspack_import_35);
84554
+
84555
+ const route32 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_list_tsx__rspack_import_36, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_list_tsx__rspack_import_36);
84556
+
84557
+ const route33 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_remove_tsx__rspack_import_37, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_remove_tsx__rspack_import_37);
84558
+
84559
+ const route34 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_thread_tsx__rspack_import_38, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_thread_tsx__rspack_import_38);
84560
+ const pluginRoot = (0,_agent_bundle_runtime__rspack_import_39/* .resolvePluginRoot */.E7)({
84347
84561
  fallback: (0,node_url__rspack_import_2.fileURLToPath)(new URL('..', import.meta.url)),
84348
84562
  stateAnchor: 'user-data'
84349
84563
  });
@@ -84446,8 +84660,17 @@ const routes = Object.freeze({
84446
84660
  "cli:send": Object.freeze({
84447
84661
  module: route30
84448
84662
  }),
84449
- "cli:thread": Object.freeze({
84663
+ "cli:skills/add": Object.freeze({
84450
84664
  module: route31
84665
+ }),
84666
+ "cli:skills/list": Object.freeze({
84667
+ module: route32
84668
+ }),
84669
+ "cli:skills/remove": Object.freeze({
84670
+ module: route33
84671
+ }),
84672
+ "cli:thread": Object.freeze({
84673
+ module: route34
84451
84674
  })
84452
84675
  });
84453
84676
  const commands = Object.freeze([
@@ -86099,6 +86322,135 @@ const commands = Object.freeze([
86099
86322
  "rendered": true,
86100
86323
  "routeId": "cli:send"
86101
86324
  },
86325
+ {
86326
+ "aliases": [],
86327
+ "description": "Add a SKILL.md to the shared skill library. Every bot sees it.",
86328
+ "exitCode": "zero",
86329
+ "options": [
86330
+ {
86331
+ "description": "Agents directory for --files mode",
86332
+ "key": "dir",
86333
+ "kind": "string",
86334
+ "option": "dir",
86335
+ "repeated": false,
86336
+ "required": false
86337
+ },
86338
+ {
86339
+ "description": "Force the on-disk agents store",
86340
+ "key": "files",
86341
+ "kind": "boolean",
86342
+ "option": "files",
86343
+ "repeated": false,
86344
+ "required": false
86345
+ },
86346
+ {
86347
+ "description": "Force the live gateway",
86348
+ "key": "gateway",
86349
+ "kind": "boolean",
86350
+ "option": "gateway",
86351
+ "repeated": false,
86352
+ "required": false
86353
+ },
86354
+ {
86355
+ "description": "SKILL.md file, or a directory holding one",
86356
+ "key": "path",
86357
+ "kind": "string",
86358
+ "option": "path",
86359
+ "positional": 0,
86360
+ "repeated": false,
86361
+ "required": true
86362
+ }
86363
+ ],
86364
+ "path": [
86365
+ "skills",
86366
+ "add"
86367
+ ],
86368
+ "rendered": true,
86369
+ "routeId": "cli:skills/add"
86370
+ },
86371
+ {
86372
+ "aliases": [],
86373
+ "description": "List the skill library every bot in this Grok Bot shares.",
86374
+ "exitCode": "zero",
86375
+ "options": [
86376
+ {
86377
+ "description": "Agents directory for --files mode",
86378
+ "key": "dir",
86379
+ "kind": "string",
86380
+ "option": "dir",
86381
+ "repeated": false,
86382
+ "required": false
86383
+ },
86384
+ {
86385
+ "description": "Force the on-disk agents store",
86386
+ "key": "files",
86387
+ "kind": "boolean",
86388
+ "option": "files",
86389
+ "repeated": false,
86390
+ "required": false
86391
+ },
86392
+ {
86393
+ "description": "Force the live gateway",
86394
+ "key": "gateway",
86395
+ "kind": "boolean",
86396
+ "option": "gateway",
86397
+ "repeated": false,
86398
+ "required": false
86399
+ }
86400
+ ],
86401
+ "path": [
86402
+ "skills",
86403
+ "list"
86404
+ ],
86405
+ "rendered": true,
86406
+ "routeId": "cli:skills/list"
86407
+ },
86408
+ {
86409
+ "aliases": [],
86410
+ "description": "Remove a library skill by id or name. Every bot loses it.",
86411
+ "exitCode": "zero",
86412
+ "options": [
86413
+ {
86414
+ "description": "Agents directory for --files mode",
86415
+ "key": "dir",
86416
+ "kind": "string",
86417
+ "option": "dir",
86418
+ "repeated": false,
86419
+ "required": false
86420
+ },
86421
+ {
86422
+ "description": "Force the on-disk agents store",
86423
+ "key": "files",
86424
+ "kind": "boolean",
86425
+ "option": "files",
86426
+ "repeated": false,
86427
+ "required": false
86428
+ },
86429
+ {
86430
+ "description": "Force the live gateway",
86431
+ "key": "gateway",
86432
+ "kind": "boolean",
86433
+ "option": "gateway",
86434
+ "repeated": false,
86435
+ "required": false
86436
+ },
86437
+ {
86438
+ "description": "Skill id or name",
86439
+ "key": "skill",
86440
+ "kind": "string",
86441
+ "option": "skill",
86442
+ "positional": 0,
86443
+ "repeated": false,
86444
+ "required": true
86445
+ }
86446
+ ],
86447
+ "path": [
86448
+ "skills",
86449
+ "remove"
86450
+ ],
86451
+ "rendered": true,
86452
+ "routeId": "cli:skills/remove"
86453
+ },
86102
86454
  {
86103
86455
  "aliases": [],
86104
86456
  "description": "Read the most recent messages in a Grok Bot bot or group thread.",
@@ -86227,27 +86579,27 @@ const execute = async (command, input, context)=>{
86227
86579
  instanceId: processLifetime.instanceId,
86228
86580
  pid: processLifetime.pid
86229
86581
  };
86230
- const result = await (0,_agent_bundle_runtime__rspack_import_37/* .runAgentRequest */.iC)({
86582
+ const result = await (0,_agent_bundle_runtime__rspack_import_40/* .runAgentRequest */.iC)({
86231
86583
  capabilities: {
86232
- command: (0,_agent_bundle_runtime__rspack_import_37/* .unavailable */.hU)(),
86233
- filesystem: (0,_agent_bundle_runtime__rspack_import_37/* .unavailable */.hU)(),
86234
- network: (0,_agent_bundle_runtime__rspack_import_37/* .unavailable */.hU)(),
86235
- projectRoot: (0,_agent_bundle_runtime__rspack_import_37/* .available */.qC)({
86584
+ command: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)(),
86585
+ filesystem: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)(),
86586
+ network: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)(),
86587
+ projectRoot: (0,_agent_bundle_runtime__rspack_import_40/* .available */.qC)({
86236
86588
  root: cwd
86237
86589
  }, 'derived')
86238
86590
  },
86239
- host: (0,_agent_bundle_runtime__rspack_import_37/* .unavailable */.hU)('unsupported-surface'),
86591
+ host: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)('unsupported-surface'),
86240
86592
  invocation: {
86241
86593
  kind: 'cli',
86242
86594
  operationId: command.routeId,
86243
86595
  surface: command.path.join(' ')
86244
86596
  },
86245
- lineage: (0,_agent_bundle_runtime__rspack_import_37/* .unavailable */.hU)('unsupported-surface'),
86597
+ lineage: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)('unsupported-surface'),
86246
86598
  plugin: pluginRoot.identity,
86247
86599
  process: processHit,
86248
86600
  signal: context.signal,
86249
- terminal: (0,_agent_bundle_runtime__rspack_import_37/* .available */.qC)(context.terminal, 'native'),
86250
- workspace: (0,_agent_bundle_runtime__rspack_import_37/* .available */.qC)({
86601
+ terminal: (0,_agent_bundle_runtime__rspack_import_40/* .available */.qC)(context.terminal, 'native'),
86602
+ workspace: (0,_agent_bundle_runtime__rspack_import_40/* .available */.qC)({
86251
86603
  root: cwd
86252
86604
  }, 'derived')
86253
86605
  }, async ()=>route.module.default({
@@ -86354,7 +86706,7 @@ const openRenderedSession = ({ invocation, limits, props, request, routeId, sign
86354
86706
  return stream;
86355
86707
  }
86356
86708
  });
86357
- const dispatcher = (0,_agent_bundle_runtime__rspack_import_38/* .createAgentRenderDispatcher */.jK)(host);
86709
+ const dispatcher = (0,_agent_bundle_runtime__rspack_import_41/* .createAgentRenderDispatcher */.jK)(host);
86358
86710
  return Object.freeze({
86359
86711
  close: async ()=>{
86360
86712
  await worker.terminate();
@@ -86402,7 +86754,7 @@ if (import.meta.main) {
86402
86754
  execute,
86403
86755
  name: "gbot",
86404
86756
  render,
86405
- version: "0.8.0"
86757
+ version: "0.9.0"
86406
86758
  });
86407
86759
  }
86408
86760
 
@@ -88676,7 +89028,10 @@ async function openBackend(opts) {
88676
89028
  removeGroupMember: (group, bot)=>_gateway_js__rspack_import_1/* .removeGroupMember */.A0(session, group, bot),
88677
89029
  send: (ref, prompt, extra)=>_gateway_js__rspack_import_1/* .sendPrompt */.LV(session, ref, prompt, extra),
88678
89030
  transcript: (ref, limit)=>_gateway_js__rspack_import_1/* .getTranscriptTail */.bA(session, ref, limit),
88679
- thread: (ref, rootId)=>_gateway_js__rspack_import_1/* .getThread */.fG(session, ref, rootId)
89031
+ thread: (ref, rootId)=>_gateway_js__rspack_import_1/* .getThread */.fG(session, ref, rootId),
89032
+ skills: ()=>_gateway_js__rspack_import_1/* .listSkills */.bG(session),
89033
+ addSkill: (markdown)=>_gateway_js__rspack_import_1/* .addSkill */.L5(session, markdown),
89034
+ removeSkill: (skillRef)=>_gateway_js__rspack_import_1/* .removeSkill */.uX(session, skillRef)
88680
89035
  };
88681
89036
  }
88682
89037
  const root = _store_js__rspack_import_0/* .resolveAgentsRoot */.v1(opts.root);
@@ -88700,6 +89055,15 @@ async function openBackend(opts) {
88700
89055
  },
88701
89056
  thread: async ()=>{
88702
89057
  throw new _store_js__rspack_import_0/* .StoreError */.AD("thread requires the live gateway");
89058
+ },
89059
+ skills: async ()=>{
89060
+ throw new _store_js__rspack_import_0/* .StoreError */.AD("skills requires the live gateway");
89061
+ },
89062
+ addSkill: async ()=>{
89063
+ throw new _store_js__rspack_import_0/* .StoreError */.AD("skills requires the live gateway");
89064
+ },
89065
+ removeSkill: async ()=>{
89066
+ throw new _store_js__rspack_import_0/* .StoreError */.AD("skills requires the live gateway");
88703
89067
  }
88704
89068
  };
88705
89069
  }
@@ -89710,6 +90074,88 @@ async function deleteAgent(session, ref) {
89710
90074
  });
89711
90075
  return rec;
89712
90076
  }
90077
+ // Grok Bot keeps one skill library per box. Every bot reads the same list, and the
90078
+ // workflow RPCs take any bot id only to say whose automations ride along.
90079
+ const SKILL_MAX_BODY_LENGTH = 100000;
90080
+ const SKILL_SOURCES = {
90081
+ workflow: "your library",
90082
+ managed: "team-managed",
90083
+ plugin: "a plugin",
90084
+ automation: "a scheduled automation"
90085
+ };
90086
+ function asSkill(skill) {
90087
+ return {
90088
+ id: String(skill.id),
90089
+ name: skill.name || "",
90090
+ description: skill.description || "",
90091
+ source: String(skill.source || "workflow"),
90092
+ ...skill.sourceRef ? {
90093
+ sourceRef: String(skill.sourceRef)
90094
+ } : {},
90095
+ ...skill.pluginId ? {
90096
+ pluginId: String(skill.pluginId)
90097
+ } : {}
90098
+ };
90099
+ }
90100
+ function asSkills(data) {
90101
+ const list = Array.isArray(data) ? data : Array.isArray(data?.workflows) ? data.workflows : [];
90102
+ return list.filter((s)=>s && s.id).map(asSkill);
90103
+ }
90104
+ async function anyBotId(session) {
90105
+ const bot = (await listAgents(session)).find((r)=>!r.isGroup);
90106
+ if (!bot) throw new GatewayError("Skills need at least one bot. Run gbot bots create first.");
90107
+ return bot.id;
90108
+ }
90109
+ async function listSkills(session) {
90110
+ return asSkills(await gatewayCall(session, "getAgentWorkflows", {
90111
+ id: await anyBotId(session)
90112
+ }));
90113
+ }
90114
+ async function addSkill(session, markdown) {
90115
+ const text = String(markdown);
90116
+ if (!text.trim()) throw new GatewayError("Skill markdown is empty.");
90117
+ if (text.length > SKILL_MAX_BODY_LENGTH) {
90118
+ throw new GatewayError(`Skill markdown is ${text.length} characters. Grok Bot truncates bodies over ${SKILL_MAX_BODY_LENGTH}; shorten it.`);
90119
+ }
90120
+ const id = await anyBotId(session);
90121
+ let data;
90122
+ try {
90123
+ data = await gatewayCall(session, "importAgentWorkflowText", {
90124
+ id,
90125
+ markdown: text
90126
+ });
90127
+ } catch (error) {
90128
+ if (error instanceof GatewayError && /response too large/.test(error.message)) {
90129
+ throw new GatewayError("Grok Bot echoed a skill list too large to read; the import may still have landed. Run gbot skills list.");
90130
+ }
90131
+ throw error;
90132
+ }
90133
+ const imported = data.result?.imported?.[0];
90134
+ if (!imported) {
90135
+ const reason = data.result?.skipped?.[0]?.reason || "rejected";
90136
+ throw new GatewayError(`Grok Bot did not import the skill (${reason}). It needs a name, a non-empty body, and library room.`);
90137
+ }
90138
+ return asSkills(data).find((s)=>s.id === String(imported.id)) ?? asSkill(imported);
90139
+ }
90140
+ async function removeSkill(session, skillRef) {
90141
+ const id = await anyBotId(session);
90142
+ const skills = asSkills(await gatewayCall(session, "getAgentWorkflows", {
90143
+ id
90144
+ }));
90145
+ const needle = String(skillRef).trim().toLowerCase();
90146
+ const matches = skills.filter((s)=>s.id.toLowerCase() === needle || s.name.toLowerCase() === needle);
90147
+ if (matches.length === 0) throw new GatewayError(`No skill "${skillRef}".`);
90148
+ if (matches.length > 1) throw new GatewayError(`Ambiguous skill name "${skillRef}". Use the id.`);
90149
+ if (matches[0].source !== "workflow") {
90150
+ const kind = SKILL_SOURCES[matches[0].source] || matches[0].source;
90151
+ throw new GatewayError(`"${matches[0].name}" is ${kind}, not a library skill. Manage it where it came from.`);
90152
+ }
90153
+ await gatewayCall(session, "deleteAgentWorkflow", {
90154
+ id,
90155
+ workflowId: matches[0].id
90156
+ });
90157
+ return matches[0];
90158
+ }
89713
90159
  function normalizeMemberIds(records, memberRefs) {
89714
90160
  const memberIds = new Set();
89715
90161
  for (const ref of memberRefs){
@@ -89884,6 +90330,7 @@ async function respondGrokApproval(session, ref, input) {
89884
90330
 
89885
90331
  __webpack_require__.d(__webpack_exports__, {
89886
90332
  A0: () => (removeGroupMember),
90333
+ L5: () => (addSkill),
89887
90334
  LV: () => (sendPrompt),
89888
90335
  MI: () => (listGrokApprovals),
89889
90336
  OR: () => (respondGrokApproval),
@@ -89892,9 +90339,11 @@ __webpack_require__.d(__webpack_exports__, {
89892
90339
  Td: () => (setGroupMembers),
89893
90340
  Vq: () => (connectGateway),
89894
90341
  bA: () => (getTranscriptTail),
90342
+ bG: () => (listSkills),
89895
90343
  fG: () => (getThread),
89896
90344
  nF: () => (hasGatewayAuth),
89897
90345
  qE: () => (resolveRef),
90346
+ uX: () => (removeSkill),
89898
90347
  vc: () => (listAgents),
89899
90348
  wj: () => (createGroup),
89900
90349
  x4: () => (updateAgent),
@@ -90981,7 +91430,7 @@ __webpack_require__.d(__webpack_exports__, {
90981
91430
 
90982
91431
  },
90983
91432
  "./package.json"(module) {
90984
- module.exports = {"rE":"0.8.0"}
91433
+ module.exports = {"rE":"0.9.0"}
90985
91434
 
90986
91435
  },
90987
91436
 
package/dist/install.mjs CHANGED
@@ -7,7 +7,7 @@ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'nod
7
7
  import { fileURLToPath } from 'node:url';
8
8
 
9
9
  const pluginName = "gbot";
10
- const pluginVersion = "0.8.0";
10
+ const pluginVersion = "0.9.0";
11
11
  const receiptFile = ".agent-bundle-install.json";
12
12
  const receiptFormat = "agent-bundle-install-receipt/2";
13
13
  const legacyReceiptFormat = "agent-bundle-install-receipt/1";