@qvac/core 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -327,7 +327,13 @@ const methods = new Map([
327
327
  ['@assistant/set-blind-peering', 159],
328
328
  [159, '@assistant/set-blind-peering'],
329
329
  ['@assistant/blind-peering-watch', 160],
330
- [160, '@assistant/blind-peering-watch']
330
+ [160, '@assistant/blind-peering-watch'],
331
+ ['@assistant/list-agent-folders', 161],
332
+ [161, '@assistant/list-agent-folders'],
333
+ ['@assistant/add-agent-folder', 162],
334
+ [162, '@assistant/add-agent-folder'],
335
+ ['@assistant/remove-agent-folder', 163],
336
+ [163, '@assistant/remove-agent-folder']
331
337
  ])
332
338
 
333
339
  class HRPC {
@@ -495,7 +501,10 @@ class HRPC {
495
501
  ['@assistant/set-auto-download-models', getEncoding('@assistant/set-auto-download-models-request')],
496
502
  ['@assistant/fork-chat', getEncoding('@assistant/fork-chat-request')],
497
503
  ['@assistant/set-blind-peering', getEncoding('@assistant/blind-peering')],
498
- ['@assistant/blind-peering-watch', getEncoding('@assistant/empty')]
504
+ ['@assistant/blind-peering-watch', getEncoding('@assistant/empty')],
505
+ ['@assistant/list-agent-folders', getEncoding('@assistant/agent-folders-request')],
506
+ ['@assistant/add-agent-folder', getEncoding('@assistant/add-agent-folder-request')],
507
+ ['@assistant/remove-agent-folder', getEncoding('@assistant/remove-agent-folder-request')]
499
508
  ])
500
509
  this._responseEncodings = new Map([
501
510
  ['@assistant/config-get', getEncoding('@assistant/config-value')],
@@ -658,7 +667,10 @@ class HRPC {
658
667
  ['@assistant/set-auto-download-models', getEncoding('@assistant/app-config')],
659
668
  ['@assistant/fork-chat', getEncoding('@assistant/chat')],
660
669
  ['@assistant/set-blind-peering', getEncoding('@assistant/blind-peering')],
661
- ['@assistant/blind-peering-watch', getEncoding('@assistant/blind-peering')]
670
+ ['@assistant/blind-peering-watch', getEncoding('@assistant/blind-peering')],
671
+ ['@assistant/list-agent-folders', getEncoding('@assistant/agent-folders')],
672
+ ['@assistant/add-agent-folder', getEncoding('@assistant/agent-folders')],
673
+ ['@assistant/remove-agent-folder', getEncoding('@assistant/agent-folders')]
662
674
  ])
663
675
  this._rpc = new RPC(stream, async (req) => {
664
676
  const command = methods.get(req.command)
@@ -1400,6 +1412,18 @@ class HRPC {
1400
1412
  return this._callSync('@assistant/blind-peering-watch', args)
1401
1413
  }
1402
1414
 
1415
+ async listAgentFolders(args) {
1416
+ return this._call('@assistant/list-agent-folders', args)
1417
+ }
1418
+
1419
+ async addAgentFolder(args) {
1420
+ return this._call('@assistant/add-agent-folder', args)
1421
+ }
1422
+
1423
+ async removeAgentFolder(args) {
1424
+ return this._call('@assistant/remove-agent-folder', args)
1425
+ }
1426
+
1403
1427
  onConfigGet(responseFn) {
1404
1428
  this._handlers['@assistant/config-get'] = responseFn
1405
1429
  }
@@ -2044,6 +2068,18 @@ class HRPC {
2044
2068
  this._handlers['@assistant/blind-peering-watch'] = responseFn
2045
2069
  }
2046
2070
 
2071
+ onListAgentFolders(responseFn) {
2072
+ this._handlers['@assistant/list-agent-folders'] = responseFn
2073
+ }
2074
+
2075
+ onAddAgentFolder(responseFn) {
2076
+ this._handlers['@assistant/add-agent-folder'] = responseFn
2077
+ }
2078
+
2079
+ onRemoveAgentFolder(responseFn) {
2080
+ this._handlers['@assistant/remove-agent-folder'] = responseFn
2081
+ }
2082
+
2047
2083
  _requestIsStream(command) {
2048
2084
  return [
2049
2085
  '@assistant/upload-attachment',
@@ -10519,6 +10519,153 @@ const encoding304 = {
10519
10519
  }
10520
10520
  }
10521
10521
 
10522
+ const encoding305_enum = {
10523
+ read: 'read',
10524
+ write: 'write'
10525
+ }
10526
+
10527
+ // @assistant/agent-folder-access enum
10528
+ const encoding305 = {
10529
+ preencode (state, m) {
10530
+ state.end++ // max enum is 2 so always one byte
10531
+ },
10532
+ encode (state, m) {
10533
+ switch (m) {
10534
+ case 'read':
10535
+ c.uint.encode(state, 1)
10536
+ break
10537
+ case 'write':
10538
+ c.uint.encode(state, 2)
10539
+ break
10540
+ default:
10541
+ throw new Error('Unknown enum')
10542
+ }
10543
+ },
10544
+ decode (state) {
10545
+ switch (c.uint.decode(state)) {
10546
+ case 1:
10547
+ return 'read'
10548
+ case 2:
10549
+ return 'write'
10550
+ default: return null
10551
+ }
10552
+ }
10553
+ }
10554
+
10555
+ // @assistant/agent-folder
10556
+ const encoding306 = {
10557
+ preencode(state, m) {
10558
+ c.string.preencode(state, m.path)
10559
+ encoding305.preencode(state, m.access)
10560
+ },
10561
+ encode(state, m) {
10562
+ c.string.encode(state, m.path)
10563
+ encoding305.encode(state, m.access)
10564
+ },
10565
+ decode(state) {
10566
+ const r0 = c.string.decode(state)
10567
+ const r1 = encoding305.decode(state)
10568
+
10569
+ return {
10570
+ path: r0,
10571
+ access: r1
10572
+ }
10573
+ }
10574
+ }
10575
+
10576
+ // @assistant/agent-folders-request
10577
+ const encoding307 = {
10578
+ preencode(state, m) {
10579
+ c.string.preencode(state, m.agentId)
10580
+ },
10581
+ encode(state, m) {
10582
+ c.string.encode(state, m.agentId)
10583
+ },
10584
+ decode(state) {
10585
+ const r0 = c.string.decode(state)
10586
+
10587
+ return {
10588
+ agentId: r0
10589
+ }
10590
+ }
10591
+ }
10592
+
10593
+ // @assistant/agent-folders.folders
10594
+ const encoding308_1 = c.array(c.frame(encoding306))
10595
+
10596
+ // @assistant/agent-folders
10597
+ const encoding308 = {
10598
+ preencode(state, m) {
10599
+ c.string.preencode(state, m.agentId)
10600
+ state.end++ // max flag is 1 so always one byte
10601
+
10602
+ if (m.folders) encoding308_1.preencode(state, m.folders)
10603
+ },
10604
+ encode(state, m) {
10605
+ const flags = m.folders ? 1 : 0
10606
+
10607
+ c.string.encode(state, m.agentId)
10608
+ c.uint.encode(state, flags)
10609
+
10610
+ if (m.folders) encoding308_1.encode(state, m.folders)
10611
+ },
10612
+ decode(state) {
10613
+ const r0 = c.string.decode(state)
10614
+ const flags = c.uint.decode(state)
10615
+
10616
+ return {
10617
+ agentId: r0,
10618
+ folders: (flags & 1) !== 0 ? encoding308_1.decode(state) : null
10619
+ }
10620
+ }
10621
+ }
10622
+
10623
+ // @assistant/add-agent-folder-request
10624
+ const encoding309 = {
10625
+ preencode(state, m) {
10626
+ c.string.preencode(state, m.agentId)
10627
+ c.string.preencode(state, m.path)
10628
+ encoding305.preencode(state, m.access)
10629
+ },
10630
+ encode(state, m) {
10631
+ c.string.encode(state, m.agentId)
10632
+ c.string.encode(state, m.path)
10633
+ encoding305.encode(state, m.access)
10634
+ },
10635
+ decode(state) {
10636
+ const r0 = c.string.decode(state)
10637
+ const r1 = c.string.decode(state)
10638
+ const r2 = encoding305.decode(state)
10639
+
10640
+ return {
10641
+ agentId: r0,
10642
+ path: r1,
10643
+ access: r2
10644
+ }
10645
+ }
10646
+ }
10647
+
10648
+ // @assistant/remove-agent-folder-request
10649
+ const encoding310 = {
10650
+ preencode(state, m) {
10651
+ c.string.preencode(state, m.agentId)
10652
+ c.string.preencode(state, m.path)
10653
+ },
10654
+ encode(state, m) {
10655
+ c.string.encode(state, m.agentId)
10656
+ c.string.encode(state, m.path)
10657
+ },
10658
+ decode(state) {
10659
+ const r0 = c.string.decode(state)
10660
+ const r1 = c.string.decode(state)
10661
+
10662
+ return {
10663
+ agentId: r0,
10664
+ path: r1
10665
+ }
10666
+ }
10667
+ }
10668
+
10522
10669
  // @assistant/model-info-list.memory, deferred due to recusive use
10523
10670
  const encoding156_1 = c.frame(encoding302)
10524
10671
 
@@ -10612,6 +10759,8 @@ function getEnum(name) {
10612
10759
  return encoding245_enum
10613
10760
  case '@assistant/model-use':
10614
10761
  return encoding297_enum
10762
+ case '@assistant/agent-folder-access':
10763
+ return encoding305_enum
10615
10764
  default:
10616
10765
  throw new Error('Enum not found ' + name)
10617
10766
  }
@@ -11229,6 +11378,18 @@ function getEncoding(name) {
11229
11378
  return encoding303
11230
11379
  case '@assistant/delete-agent-request':
11231
11380
  return encoding304
11381
+ case '@assistant/agent-folder-access':
11382
+ return encoding305
11383
+ case '@assistant/agent-folder':
11384
+ return encoding306
11385
+ case '@assistant/agent-folders-request':
11386
+ return encoding307
11387
+ case '@assistant/agent-folders':
11388
+ return encoding308
11389
+ case '@assistant/add-agent-folder-request':
11390
+ return encoding309
11391
+ case '@assistant/remove-agent-folder-request':
11392
+ return encoding310
11232
11393
  default:
11233
11394
  throw new Error('Encoder not found ' + name)
11234
11395
  }
@@ -10519,6 +10519,153 @@ const encoding304 = {
10519
10519
  }
10520
10520
  }
10521
10521
 
10522
+ const encoding305_enum = {
10523
+ read: 'read',
10524
+ write: 'write'
10525
+ }
10526
+
10527
+ // @assistant/agent-folder-access enum
10528
+ const encoding305 = {
10529
+ preencode (state, m) {
10530
+ state.end++ // max enum is 2 so always one byte
10531
+ },
10532
+ encode (state, m) {
10533
+ switch (m) {
10534
+ case 'read':
10535
+ c.uint.encode(state, 1)
10536
+ break
10537
+ case 'write':
10538
+ c.uint.encode(state, 2)
10539
+ break
10540
+ default:
10541
+ throw new Error('Unknown enum')
10542
+ }
10543
+ },
10544
+ decode (state) {
10545
+ switch (c.uint.decode(state)) {
10546
+ case 1:
10547
+ return 'read'
10548
+ case 2:
10549
+ return 'write'
10550
+ default: return null
10551
+ }
10552
+ }
10553
+ }
10554
+
10555
+ // @assistant/agent-folder
10556
+ const encoding306 = {
10557
+ preencode(state, m) {
10558
+ c.string.preencode(state, m.path)
10559
+ encoding305.preencode(state, m.access)
10560
+ },
10561
+ encode(state, m) {
10562
+ c.string.encode(state, m.path)
10563
+ encoding305.encode(state, m.access)
10564
+ },
10565
+ decode(state) {
10566
+ const r0 = c.string.decode(state)
10567
+ const r1 = encoding305.decode(state)
10568
+
10569
+ return {
10570
+ path: r0,
10571
+ access: r1
10572
+ }
10573
+ }
10574
+ }
10575
+
10576
+ // @assistant/agent-folders-request
10577
+ const encoding307 = {
10578
+ preencode(state, m) {
10579
+ c.string.preencode(state, m.agentId)
10580
+ },
10581
+ encode(state, m) {
10582
+ c.string.encode(state, m.agentId)
10583
+ },
10584
+ decode(state) {
10585
+ const r0 = c.string.decode(state)
10586
+
10587
+ return {
10588
+ agentId: r0
10589
+ }
10590
+ }
10591
+ }
10592
+
10593
+ // @assistant/agent-folders.folders
10594
+ const encoding308_1 = c.array(c.frame(encoding306))
10595
+
10596
+ // @assistant/agent-folders
10597
+ const encoding308 = {
10598
+ preencode(state, m) {
10599
+ c.string.preencode(state, m.agentId)
10600
+ state.end++ // max flag is 1 so always one byte
10601
+
10602
+ if (m.folders) encoding308_1.preencode(state, m.folders)
10603
+ },
10604
+ encode(state, m) {
10605
+ const flags = m.folders ? 1 : 0
10606
+
10607
+ c.string.encode(state, m.agentId)
10608
+ c.uint.encode(state, flags)
10609
+
10610
+ if (m.folders) encoding308_1.encode(state, m.folders)
10611
+ },
10612
+ decode(state) {
10613
+ const r0 = c.string.decode(state)
10614
+ const flags = c.uint.decode(state)
10615
+
10616
+ return {
10617
+ agentId: r0,
10618
+ folders: (flags & 1) !== 0 ? encoding308_1.decode(state) : null
10619
+ }
10620
+ }
10621
+ }
10622
+
10623
+ // @assistant/add-agent-folder-request
10624
+ const encoding309 = {
10625
+ preencode(state, m) {
10626
+ c.string.preencode(state, m.agentId)
10627
+ c.string.preencode(state, m.path)
10628
+ encoding305.preencode(state, m.access)
10629
+ },
10630
+ encode(state, m) {
10631
+ c.string.encode(state, m.agentId)
10632
+ c.string.encode(state, m.path)
10633
+ encoding305.encode(state, m.access)
10634
+ },
10635
+ decode(state) {
10636
+ const r0 = c.string.decode(state)
10637
+ const r1 = c.string.decode(state)
10638
+ const r2 = encoding305.decode(state)
10639
+
10640
+ return {
10641
+ agentId: r0,
10642
+ path: r1,
10643
+ access: r2
10644
+ }
10645
+ }
10646
+ }
10647
+
10648
+ // @assistant/remove-agent-folder-request
10649
+ const encoding310 = {
10650
+ preencode(state, m) {
10651
+ c.string.preencode(state, m.agentId)
10652
+ c.string.preencode(state, m.path)
10653
+ },
10654
+ encode(state, m) {
10655
+ c.string.encode(state, m.agentId)
10656
+ c.string.encode(state, m.path)
10657
+ },
10658
+ decode(state) {
10659
+ const r0 = c.string.decode(state)
10660
+ const r1 = c.string.decode(state)
10661
+
10662
+ return {
10663
+ agentId: r0,
10664
+ path: r1
10665
+ }
10666
+ }
10667
+ }
10668
+
10522
10669
  // @assistant/model-info-list.memory, deferred due to recusive use
10523
10670
  const encoding156_1 = c.frame(encoding302)
10524
10671
 
@@ -10612,6 +10759,8 @@ function getEnum(name) {
10612
10759
  return encoding245_enum
10613
10760
  case '@assistant/model-use':
10614
10761
  return encoding297_enum
10762
+ case '@assistant/agent-folder-access':
10763
+ return encoding305_enum
10615
10764
  default:
10616
10765
  throw new Error('Enum not found ' + name)
10617
10766
  }
@@ -11229,6 +11378,18 @@ function getEncoding(name) {
11229
11378
  return encoding303
11230
11379
  case '@assistant/delete-agent-request':
11231
11380
  return encoding304
11381
+ case '@assistant/agent-folder-access':
11382
+ return encoding305
11383
+ case '@assistant/agent-folder':
11384
+ return encoding306
11385
+ case '@assistant/agent-folders-request':
11386
+ return encoding307
11387
+ case '@assistant/agent-folders':
11388
+ return encoding308
11389
+ case '@assistant/add-agent-folder-request':
11390
+ return encoding309
11391
+ case '@assistant/remove-agent-folder-request':
11392
+ return encoding310
11232
11393
  default:
11233
11394
  throw new Error('Encoder not found ' + name)
11234
11395
  }
@@ -8773,6 +8773,122 @@
8773
8773
  "version": 1
8774
8774
  }
8775
8775
  ]
8776
+ },
8777
+ {
8778
+ "name": "agent-folder-access",
8779
+ "namespace": "assistant",
8780
+ "offset": 1,
8781
+ "enum": [
8782
+ {
8783
+ "key": "read",
8784
+ "version": 1
8785
+ },
8786
+ {
8787
+ "key": "write",
8788
+ "version": 1
8789
+ }
8790
+ ],
8791
+ "strings": true
8792
+ },
8793
+ {
8794
+ "name": "agent-folder",
8795
+ "namespace": "assistant",
8796
+ "compact": false,
8797
+ "flagsPosition": -1,
8798
+ "fields": [
8799
+ {
8800
+ "name": "path",
8801
+ "required": true,
8802
+ "type": "string",
8803
+ "version": 1
8804
+ },
8805
+ {
8806
+ "name": "access",
8807
+ "required": true,
8808
+ "type": "@assistant/agent-folder-access",
8809
+ "version": 1
8810
+ }
8811
+ ]
8812
+ },
8813
+ {
8814
+ "name": "agent-folders-request",
8815
+ "namespace": "assistant",
8816
+ "compact": false,
8817
+ "flagsPosition": -1,
8818
+ "fields": [
8819
+ {
8820
+ "name": "agentId",
8821
+ "required": true,
8822
+ "type": "string",
8823
+ "version": 1
8824
+ }
8825
+ ]
8826
+ },
8827
+ {
8828
+ "name": "agent-folders",
8829
+ "namespace": "assistant",
8830
+ "compact": false,
8831
+ "flagsPosition": 1,
8832
+ "fields": [
8833
+ {
8834
+ "name": "agentId",
8835
+ "required": true,
8836
+ "type": "string",
8837
+ "version": 1
8838
+ },
8839
+ {
8840
+ "name": "folders",
8841
+ "array": true,
8842
+ "type": "@assistant/agent-folder",
8843
+ "version": 1
8844
+ }
8845
+ ]
8846
+ },
8847
+ {
8848
+ "name": "add-agent-folder-request",
8849
+ "namespace": "assistant",
8850
+ "compact": false,
8851
+ "flagsPosition": -1,
8852
+ "fields": [
8853
+ {
8854
+ "name": "agentId",
8855
+ "required": true,
8856
+ "type": "string",
8857
+ "version": 1
8858
+ },
8859
+ {
8860
+ "name": "path",
8861
+ "required": true,
8862
+ "type": "string",
8863
+ "version": 1
8864
+ },
8865
+ {
8866
+ "name": "access",
8867
+ "required": true,
8868
+ "type": "@assistant/agent-folder-access",
8869
+ "version": 1
8870
+ }
8871
+ ]
8872
+ },
8873
+ {
8874
+ "name": "remove-agent-folder-request",
8875
+ "namespace": "assistant",
8876
+ "compact": false,
8877
+ "flagsPosition": -1,
8878
+ "fields": [
8879
+ {
8880
+ "name": "agentId",
8881
+ "required": true,
8882
+ "type": "string",
8883
+ "version": 1
8884
+ },
8885
+ {
8886
+ "name": "path",
8887
+ "required": true,
8888
+ "type": "string",
8889
+ "version": 1
8890
+ }
8891
+ ]
8776
8892
  }
8777
8893
  ]
8778
8894
  }
@@ -1891,6 +1891,33 @@ export interface AssistantDeleteAgentRequest {
1891
1891
  keepChats?: boolean
1892
1892
  }
1893
1893
 
1894
+ export type AssistantAgentFolderAccess = "read" | "write"
1895
+
1896
+ export interface AssistantAgentFolder {
1897
+ path: string
1898
+ access: AssistantAgentFolderAccess
1899
+ }
1900
+
1901
+ export interface AssistantAgentFoldersRequest {
1902
+ agentId: string
1903
+ }
1904
+
1905
+ export interface AssistantAgentFolders {
1906
+ agentId: string
1907
+ folders?: AssistantAgentFolder[] | null
1908
+ }
1909
+
1910
+ export interface AssistantAddAgentFolderRequest {
1911
+ agentId: string
1912
+ path: string
1913
+ access: AssistantAgentFolderAccess
1914
+ }
1915
+
1916
+ export interface AssistantRemoveAgentFolderRequest {
1917
+ agentId: string
1918
+ path: string
1919
+ }
1920
+
1894
1921
  export interface SchemaTypes {
1895
1922
  "@assistant/empty": AssistantEmpty
1896
1923
  "@assistant/ok-response": AssistantOkResponse
@@ -2197,4 +2224,10 @@ export interface SchemaTypes {
2197
2224
  "@assistant/model-memory": AssistantModelMemory
2198
2225
  "@assistant/device-scope": AssistantDeviceScope
2199
2226
  "@assistant/delete-agent-request": AssistantDeleteAgentRequest
2227
+ "@assistant/agent-folder-access": AssistantAgentFolderAccess
2228
+ "@assistant/agent-folder": AssistantAgentFolder
2229
+ "@assistant/agent-folders-request": AssistantAgentFoldersRequest
2230
+ "@assistant/agent-folders": AssistantAgentFolders
2231
+ "@assistant/add-agent-folder-request": AssistantAddAgentFolderRequest
2232
+ "@assistant/remove-agent-folder-request": AssistantRemoveAgentFolderRequest
2200
2233
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/core",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "type": "module",
5
5
  "description": "Peer-to-peer AI across your devices",
6
6
  "engines": {
@@ -158,6 +158,7 @@
158
158
  "error-codes": "bare examples/error-codes.mjs",
159
159
  "model-downloads-held": "bare examples/model-downloads-held.mjs",
160
160
  "blind-peering": "bare examples/blind-peering.mjs",
161
+ "agent-folders": "bare examples/agent-folders.mjs",
161
162
  "chunks-delta-watch": "bare examples/chunks-delta-watch.mjs",
162
163
  "mesh-pair-and-migrate": "bare examples/mesh-pair-and-migrate.mjs",
163
164
  "mesh-scoped-catalog": "bare examples/mesh-scoped-catalog.mjs",
package/tui/README.md CHANGED
@@ -79,6 +79,16 @@ an explicit root — it puts the SDK home and its lock on a scratch
79
79
  `<dir>/sdk-home`. Models are still shared; `QVAC_MODEL_CACHE_PATH` isolates
80
80
  those too.
81
81
 
82
+ The file tools (reading, listing, searching and editing files) reach an agent
83
+ only with a shared folder. `/folders add <path> rw` shares one with the active
84
+ agent on this device, `/folders` lists them and `/folders remove <path>` stops
85
+ sharing one; `ro` in place of `rw` keeps it read-only. With `--storage` or
86
+ `--temp`, share a folder outside that root: Core refuses the app's own storage.
87
+
88
+ ```
89
+ /folders add ~/scratch/site rw
90
+ ```
91
+
82
92
  The TUI copies its mesh invite to the clipboard on ctrl+y. With no clipboard
83
93
  command (a container, ssh) it asks your terminal to set the clipboard with
84
94
  OSC 52, which the terminal has to allow. A running TUI moves
package/tui/app.mjs CHANGED
@@ -41,6 +41,7 @@ import { exportMarkdown } from './lib/export.mjs'
41
41
  import { paintSelection, selectionText } from './lib/select.mjs'
42
42
  import { center, splash } from './lib/splash.mjs'
43
43
  import { wrapBlock, wrapLine } from './lib/wrap.mjs'
44
+ import { foldersCommand } from './lib/folders-command.mjs'
44
45
  import { knowledgeCommand } from './lib/knowledge-command.mjs'
45
46
  import { describeMove } from './lib/move-command.mjs'
46
47
  import { forkCut } from './lib/fork-command.mjs'
@@ -266,6 +267,15 @@ const COMMANDS = [
266
267
  },
267
268
  { name: 'meshes', desc: 'list the meshes this device belongs to', palette: true },
268
269
  { name: 'cred', desc: 'set a credential value for this agent' },
270
+ {
271
+ name: 'folders',
272
+ desc: 'the folders on this device the agent may read or edit with its file tools',
273
+ sub: [
274
+ { name: 'list', desc: 'the shared folders, each ro or rw' },
275
+ { name: 'add', desc: '<path> [ro|rw] — share a folder, read-only unless rw' },
276
+ { name: 'remove', desc: '<path> — stop sharing a folder' }
277
+ ]
278
+ },
269
279
  { name: 'connect', desc: 'OAuth-connect a skill for this agent', palette: true },
270
280
  {
271
281
  name: 'my-device',
@@ -1680,7 +1690,8 @@ const AGENT_COMMANDS = new Set([
1680
1690
  'skill',
1681
1691
  'scope',
1682
1692
  'connect',
1683
- 'cred'
1693
+ 'cred',
1694
+ 'folders'
1684
1695
  ])
1685
1696
  const NO_AGENT = 'no agent in this mesh · /agent new <name> or /agent use <name|id>'
1686
1697
 
@@ -2487,6 +2498,7 @@ export class ChatApp {
2487
2498
  '',
2488
2499
  'Advanced',
2489
2500
  ' /cred <key> <value> — set a credential by hand for this agent (e.g. /cred github_access_token ghp_…); /skills, enter on the skill, fills this in for you',
2501
+ ' /folders — the folders on this device the agent may use with its file tools · /folders add <path> [ro|rw] — share one, read-only unless rw · /folders remove <path>',
2490
2502
  ' /scope skills all|selected — switch scope',
2491
2503
  ' /join <qvac://device/… or qvac://workspace/…> — preview who you would join as (ctrl+y copies this mesh’s invite) · /join yes — confirm it (a device invite retires this device’s mesh, a member invite adds one beside it) · /join cancel — abort a join in progress',
2492
2504
  ' /leave — leave the active mesh; the device lands on another mesh it can write to, or mints a fresh account',
@@ -3584,6 +3596,22 @@ export class ChatApp {
3584
3596
  })
3585
3597
  }
3586
3598
 
3599
+ if (cmd === 'folders') {
3600
+ return [
3601
+ this,
3602
+ async () => {
3603
+ const provider = agent.providerDeviceId
3604
+ const remote = provider && !(await this._hostedHere(provider))
3605
+ const host = remote ? this._deviceName(b4a.toHex(provider)) : null
3606
+ const lent = agent.lenderDeviceId
3607
+ const borrows = lent && !(await this._hostedHere(lent))
3608
+ const lender = borrows ? this._deviceName(b4a.toHex(lent)) : null
3609
+
3610
+ return foldersCommand(engine, { agent, host, lender }, rawArgs)
3611
+ }
3612
+ ]
3613
+ }
3614
+
3587
3615
  if (cmd === 'cred') {
3588
3616
  const [key, ...valueParts] = rest
3589
3617
  const value = valueParts.join(' ')