shennian 0.5.2 → 0.5.4
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/shennian-adapter-host.js +4 -0
- package/dist/publish-build-manifest.json +144 -74
- package/dist/resources/agent-adapters/claude.md +33 -0
- package/dist/resources/agent-adapters/codex.md +33 -0
- package/dist/resources/agent-adapters/cursor.md +32 -0
- package/dist/resources/agent-adapters/custom.md +40 -0
- package/dist/resources/agent-adapters/opencode.md +31 -0
- package/dist/resources/agent-adapters/pi-coding-agent.md +31 -0
- package/dist/resources/agent-adapters/workbuddy.md +32 -0
- package/dist/src/adapter-kit/check.js +4 -0
- package/dist/src/adapter-kit/host.js +2 -0
- package/dist/src/adapter-kit/official-adapters.js +1 -0
- package/dist/src/adapter-kit/registry.js +2 -0
- package/dist/src/adapter-kit/submission-client.js +1 -0
- package/dist/src/adapter-kit/types.js +1 -0
- package/dist/src/agents/acp/client-services.js +1 -1
- package/dist/src/agents/acp/process-client.js +1 -1
- package/dist/src/agents/config-status.js +1 -1
- package/dist/src/agents/custom.js +5 -4
- package/dist/src/agents/detect.js +1 -1
- package/dist/src/agents/model-registry/cache.js +1 -1
- package/dist/src/agents/model-registry/discovery.js +3 -3
- package/dist/src/agents/model-registry/opencode-api.js +1 -1
- package/dist/src/agents/model-registry/service.js +1 -1
- package/dist/src/agents/node-adapter.js +7 -0
- package/dist/src/agents/opencode.js +1 -1
- package/dist/src/agents/pi-coding-agent.js +3 -3
- package/dist/src/agents/pi-turn-diagnostics.js +1 -0
- package/dist/src/agents/process-tree.js +1 -0
- package/dist/src/agents/public-agent-client.js +1 -0
- package/dist/src/commands/adapter.js +49 -0
- package/dist/src/commands/agent-readiness.js +2 -2
- package/dist/src/commands/agent-workspace.js +3 -0
- package/dist/src/commands/agent.js +2 -2
- package/dist/src/commands/room.js +4 -3
- package/dist/src/commands/runtime.js +5 -5
- package/dist/src/commands/support.js +4 -0
- package/dist/src/daemon-ipc/agent-readiness.js +1 -1
- package/dist/src/index.js +3 -3
- package/dist/src/manager/runtime.js +4 -4
- package/dist/src/room/activation-policy.js +1 -1
- package/dist/src/room/activation-service.js +2 -1
- package/dist/src/room/attachment-upload.js +1 -1
- package/dist/src/room/invite-bootstrap.js +1 -1
- package/dist/src/room/live-delivery.js +1 -1
- package/dist/src/room/managed-prompt-composer.js +2 -2
- package/dist/src/room/managed-room-ipc.js +2 -2
- package/dist/src/room/mirror-sync-service.js +1 -1
- package/dist/src/room/public-room-client.js +1 -1
- package/dist/src/room/room-action-client.js +1 -1
- package/dist/src/session/handlers/agent-workspace-validation.js +1 -1
- package/dist/src/session/handlers/chat-recovery.js +1 -1
- package/dist/src/session/handlers/chat.js +1 -1
- package/dist/src/session/manager.js +1 -1
- package/dist/src/session/queue-helpers.js +8 -3
- package/dist/src/session/queue.js +1 -1
- package/dist/src/support/support-client.js +1 -0
- package/node_modules/@shennian/wire/dist/adapter-submission.js +1 -0
- package/node_modules/@shennian/wire/dist/index.js +1 -1
- package/node_modules/@shennian/wire/dist/session.js +1 -1
- package/node_modules/@shennian/wire/dist/support.js +1 -0
- package/package.json +4 -4
- package/dist/src/agents/acp/process-tree.js +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import t from"node:path";import{runAdapterRuntimeHost as o}from"../src/adapter-kit/host.js";const s=process.argv[2],e=process.argv.indexOf("--workdir"),a=e>=0?process.argv[e+1]:process.cwd();s||(process.stderr.write(`Usage: shennian-adapter-host <adapter.mjs> [--workdir <path>]
|
|
3
|
+
`),process.exit(1)),o({entryPath:t.resolve(s),workDir:a}).catch(r=>{process.stderr.write(`${r instanceof Error?r.message:String(r)}
|
|
4
|
+
`),process.exitCode=1});
|
|
@@ -2,13 +2,48 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"jsMinified": true,
|
|
4
4
|
"minifier": "esbuild",
|
|
5
|
-
"fileCount":
|
|
5
|
+
"fileCount": 248,
|
|
6
6
|
"files": [
|
|
7
|
+
{
|
|
8
|
+
"file": "bin/shennian-adapter-host.js",
|
|
9
|
+
"beforeBytes": 814,
|
|
10
|
+
"afterBytes": 456
|
|
11
|
+
},
|
|
7
12
|
{
|
|
8
13
|
"file": "bin/shennian.js",
|
|
9
14
|
"beforeBytes": 46,
|
|
10
15
|
"afterBytes": 45
|
|
11
16
|
},
|
|
17
|
+
{
|
|
18
|
+
"file": "src/adapter-kit/check.js",
|
|
19
|
+
"beforeBytes": 12684,
|
|
20
|
+
"afterBytes": 6175
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"file": "src/adapter-kit/host.js",
|
|
24
|
+
"beforeBytes": 15582,
|
|
25
|
+
"afterBytes": 6812
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"file": "src/adapter-kit/official-adapters.js",
|
|
29
|
+
"beforeBytes": 2137,
|
|
30
|
+
"afterBytes": 996
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"file": "src/adapter-kit/registry.js",
|
|
34
|
+
"beforeBytes": 3595,
|
|
35
|
+
"afterBytes": 1606
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"file": "src/adapter-kit/submission-client.js",
|
|
39
|
+
"beforeBytes": 2231,
|
|
40
|
+
"afterBytes": 1159
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"file": "src/adapter-kit/types.js",
|
|
44
|
+
"beforeBytes": 365,
|
|
45
|
+
"afterBytes": 132
|
|
46
|
+
},
|
|
12
47
|
{
|
|
13
48
|
"file": "src/agent-env.js",
|
|
14
49
|
"beforeBytes": 11128,
|
|
@@ -41,8 +76,8 @@
|
|
|
41
76
|
},
|
|
42
77
|
{
|
|
43
78
|
"file": "src/agents/acp/client-services.js",
|
|
44
|
-
"beforeBytes":
|
|
45
|
-
"afterBytes":
|
|
79
|
+
"beforeBytes": 6337,
|
|
80
|
+
"afterBytes": 3536
|
|
46
81
|
},
|
|
47
82
|
{
|
|
48
83
|
"file": "src/agents/acp/discovery.js",
|
|
@@ -71,13 +106,8 @@
|
|
|
71
106
|
},
|
|
72
107
|
{
|
|
73
108
|
"file": "src/agents/acp/process-client.js",
|
|
74
|
-
"beforeBytes":
|
|
75
|
-
"afterBytes":
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"file": "src/agents/acp/process-tree.js",
|
|
79
|
-
"beforeBytes": 698,
|
|
80
|
-
"afterBytes": 371
|
|
109
|
+
"beforeBytes": 7305,
|
|
110
|
+
"afterBytes": 4421
|
|
81
111
|
},
|
|
82
112
|
{
|
|
83
113
|
"file": "src/agents/acp/types.js",
|
|
@@ -146,8 +176,8 @@
|
|
|
146
176
|
},
|
|
147
177
|
{
|
|
148
178
|
"file": "src/agents/config-status.js",
|
|
149
|
-
"beforeBytes":
|
|
150
|
-
"afterBytes":
|
|
179
|
+
"beforeBytes": 7855,
|
|
180
|
+
"afterBytes": 3923
|
|
151
181
|
},
|
|
152
182
|
{
|
|
153
183
|
"file": "src/agents/cursor-managed-permissions.js",
|
|
@@ -171,13 +201,13 @@
|
|
|
171
201
|
},
|
|
172
202
|
{
|
|
173
203
|
"file": "src/agents/custom.js",
|
|
174
|
-
"beforeBytes":
|
|
175
|
-
"afterBytes":
|
|
204
|
+
"beforeBytes": 22815,
|
|
205
|
+
"afterBytes": 12166
|
|
176
206
|
},
|
|
177
207
|
{
|
|
178
208
|
"file": "src/agents/detect.js",
|
|
179
|
-
"beforeBytes":
|
|
180
|
-
"afterBytes":
|
|
209
|
+
"beforeBytes": 5211,
|
|
210
|
+
"afterBytes": 2494
|
|
181
211
|
},
|
|
182
212
|
{
|
|
183
213
|
"file": "src/agents/event-terminal-gate.js",
|
|
@@ -201,18 +231,18 @@
|
|
|
201
231
|
},
|
|
202
232
|
{
|
|
203
233
|
"file": "src/agents/model-registry/cache.js",
|
|
204
|
-
"beforeBytes":
|
|
205
|
-
"afterBytes":
|
|
234
|
+
"beforeBytes": 1745,
|
|
235
|
+
"afterBytes": 673
|
|
206
236
|
},
|
|
207
237
|
{
|
|
208
238
|
"file": "src/agents/model-registry/discovery.js",
|
|
209
|
-
"beforeBytes":
|
|
210
|
-
"afterBytes":
|
|
239
|
+
"beforeBytes": 11267,
|
|
240
|
+
"afterBytes": 5313
|
|
211
241
|
},
|
|
212
242
|
{
|
|
213
243
|
"file": "src/agents/model-registry/opencode-api.js",
|
|
214
|
-
"beforeBytes":
|
|
215
|
-
"afterBytes":
|
|
244
|
+
"beforeBytes": 3259,
|
|
245
|
+
"afterBytes": 1580
|
|
216
246
|
},
|
|
217
247
|
{
|
|
218
248
|
"file": "src/agents/model-registry/parsers.js",
|
|
@@ -226,8 +256,8 @@
|
|
|
226
256
|
},
|
|
227
257
|
{
|
|
228
258
|
"file": "src/agents/model-registry/service.js",
|
|
229
|
-
"beforeBytes":
|
|
230
|
-
"afterBytes":
|
|
259
|
+
"beforeBytes": 9489,
|
|
260
|
+
"afterBytes": 3505
|
|
231
261
|
},
|
|
232
262
|
{
|
|
233
263
|
"file": "src/agents/model-registry/types.js",
|
|
@@ -244,6 +274,11 @@
|
|
|
244
274
|
"beforeBytes": 9705,
|
|
245
275
|
"afterBytes": 4410
|
|
246
276
|
},
|
|
277
|
+
{
|
|
278
|
+
"file": "src/agents/node-adapter.js",
|
|
279
|
+
"beforeBytes": 13949,
|
|
280
|
+
"afterBytes": 7399
|
|
281
|
+
},
|
|
247
282
|
{
|
|
248
283
|
"file": "src/agents/openclaw.js",
|
|
249
284
|
"beforeBytes": 11179,
|
|
@@ -256,8 +291,8 @@
|
|
|
256
291
|
},
|
|
257
292
|
{
|
|
258
293
|
"file": "src/agents/opencode.js",
|
|
259
|
-
"beforeBytes":
|
|
260
|
-
"afterBytes":
|
|
294
|
+
"beforeBytes": 13890,
|
|
295
|
+
"afterBytes": 7062
|
|
261
296
|
},
|
|
262
297
|
{
|
|
263
298
|
"file": "src/agents/pi-coding-agent-managed-permissions.js",
|
|
@@ -266,8 +301,8 @@
|
|
|
266
301
|
},
|
|
267
302
|
{
|
|
268
303
|
"file": "src/agents/pi-coding-agent.js",
|
|
269
|
-
"beforeBytes":
|
|
270
|
-
"afterBytes":
|
|
304
|
+
"beforeBytes": 28451,
|
|
305
|
+
"afterBytes": 15071
|
|
271
306
|
},
|
|
272
307
|
{
|
|
273
308
|
"file": "src/agents/pi-managed-extension.js",
|
|
@@ -284,11 +319,26 @@
|
|
|
284
319
|
"beforeBytes": 2397,
|
|
285
320
|
"afterBytes": 1328
|
|
286
321
|
},
|
|
322
|
+
{
|
|
323
|
+
"file": "src/agents/pi-turn-diagnostics.js",
|
|
324
|
+
"beforeBytes": 7200,
|
|
325
|
+
"afterBytes": 3920
|
|
326
|
+
},
|
|
287
327
|
{
|
|
288
328
|
"file": "src/agents/platform-instructions.js",
|
|
289
329
|
"beforeBytes": 2829,
|
|
290
330
|
"afterBytes": 1705
|
|
291
331
|
},
|
|
332
|
+
{
|
|
333
|
+
"file": "src/agents/process-tree.js",
|
|
334
|
+
"beforeBytes": 2647,
|
|
335
|
+
"afterBytes": 856
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"file": "src/agents/public-agent-client.js",
|
|
339
|
+
"beforeBytes": 3499,
|
|
340
|
+
"afterBytes": 2070
|
|
341
|
+
},
|
|
292
342
|
{
|
|
293
343
|
"file": "src/agents/runtime-compatibility.js",
|
|
294
344
|
"beforeBytes": 1587,
|
|
@@ -314,15 +364,25 @@
|
|
|
314
364
|
"beforeBytes": 18443,
|
|
315
365
|
"afterBytes": 9602
|
|
316
366
|
},
|
|
367
|
+
{
|
|
368
|
+
"file": "src/commands/adapter.js",
|
|
369
|
+
"beforeBytes": 19169,
|
|
370
|
+
"afterBytes": 13352
|
|
371
|
+
},
|
|
317
372
|
{
|
|
318
373
|
"file": "src/commands/agent-readiness.js",
|
|
319
|
-
"beforeBytes":
|
|
320
|
-
"afterBytes":
|
|
374
|
+
"beforeBytes": 8695,
|
|
375
|
+
"afterBytes": 6674
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"file": "src/commands/agent-workspace.js",
|
|
379
|
+
"beforeBytes": 10802,
|
|
380
|
+
"afterBytes": 6752
|
|
321
381
|
},
|
|
322
382
|
{
|
|
323
383
|
"file": "src/commands/agent.js",
|
|
324
|
-
"beforeBytes":
|
|
325
|
-
"afterBytes":
|
|
384
|
+
"beforeBytes": 6275,
|
|
385
|
+
"afterBytes": 3292
|
|
326
386
|
},
|
|
327
387
|
{
|
|
328
388
|
"file": "src/commands/daemon-instance-lock.js",
|
|
@@ -401,19 +461,24 @@
|
|
|
401
461
|
},
|
|
402
462
|
{
|
|
403
463
|
"file": "src/commands/room.js",
|
|
404
|
-
"beforeBytes":
|
|
405
|
-
"afterBytes":
|
|
464
|
+
"beforeBytes": 25537,
|
|
465
|
+
"afterBytes": 15202
|
|
406
466
|
},
|
|
407
467
|
{
|
|
408
468
|
"file": "src/commands/runtime.js",
|
|
409
|
-
"beforeBytes":
|
|
410
|
-
"afterBytes":
|
|
469
|
+
"beforeBytes": 5678,
|
|
470
|
+
"afterBytes": 3203
|
|
411
471
|
},
|
|
412
472
|
{
|
|
413
473
|
"file": "src/commands/schedule.js",
|
|
414
474
|
"beforeBytes": 1288,
|
|
415
475
|
"afterBytes": 936
|
|
416
476
|
},
|
|
477
|
+
{
|
|
478
|
+
"file": "src/commands/support.js",
|
|
479
|
+
"beforeBytes": 4571,
|
|
480
|
+
"afterBytes": 2964
|
|
481
|
+
},
|
|
417
482
|
{
|
|
418
483
|
"file": "src/commands/tools.js",
|
|
419
484
|
"beforeBytes": 1572,
|
|
@@ -436,8 +501,8 @@
|
|
|
436
501
|
},
|
|
437
502
|
{
|
|
438
503
|
"file": "src/daemon-ipc/agent-readiness.js",
|
|
439
|
-
"beforeBytes":
|
|
440
|
-
"afterBytes":
|
|
504
|
+
"beforeBytes": 5102,
|
|
505
|
+
"afterBytes": 2553
|
|
441
506
|
},
|
|
442
507
|
{
|
|
443
508
|
"file": "src/daemon-ipc/client.js",
|
|
@@ -511,8 +576,8 @@
|
|
|
511
576
|
},
|
|
512
577
|
{
|
|
513
578
|
"file": "src/index.js",
|
|
514
|
-
"beforeBytes":
|
|
515
|
-
"afterBytes":
|
|
579
|
+
"beforeBytes": 42923,
|
|
580
|
+
"afterBytes": 21315
|
|
516
581
|
},
|
|
517
582
|
{
|
|
518
583
|
"file": "src/log-redaction.js",
|
|
@@ -541,8 +606,8 @@
|
|
|
541
606
|
},
|
|
542
607
|
{
|
|
543
608
|
"file": "src/manager/runtime.js",
|
|
544
|
-
"beforeBytes":
|
|
545
|
-
"afterBytes":
|
|
609
|
+
"beforeBytes": 35692,
|
|
610
|
+
"afterBytes": 17388
|
|
546
611
|
},
|
|
547
612
|
{
|
|
548
613
|
"file": "src/manager/worker-ipc.js",
|
|
@@ -696,13 +761,13 @@
|
|
|
696
761
|
},
|
|
697
762
|
{
|
|
698
763
|
"file": "src/room/activation-policy.js",
|
|
699
|
-
"beforeBytes":
|
|
700
|
-
"afterBytes":
|
|
764
|
+
"beforeBytes": 2397,
|
|
765
|
+
"afterBytes": 1190
|
|
701
766
|
},
|
|
702
767
|
{
|
|
703
768
|
"file": "src/room/activation-service.js",
|
|
704
|
-
"beforeBytes":
|
|
705
|
-
"afterBytes":
|
|
769
|
+
"beforeBytes": 28830,
|
|
770
|
+
"afterBytes": 15852
|
|
706
771
|
},
|
|
707
772
|
{
|
|
708
773
|
"file": "src/room/attachment-cache.js",
|
|
@@ -711,8 +776,8 @@
|
|
|
711
776
|
},
|
|
712
777
|
{
|
|
713
778
|
"file": "src/room/attachment-upload.js",
|
|
714
|
-
"beforeBytes":
|
|
715
|
-
"afterBytes":
|
|
779
|
+
"beforeBytes": 7283,
|
|
780
|
+
"afterBytes": 3698
|
|
716
781
|
},
|
|
717
782
|
{
|
|
718
783
|
"file": "src/room/device-authorization-client.js",
|
|
@@ -726,8 +791,8 @@
|
|
|
726
791
|
},
|
|
727
792
|
{
|
|
728
793
|
"file": "src/room/invite-bootstrap.js",
|
|
729
|
-
"beforeBytes":
|
|
730
|
-
"afterBytes":
|
|
794
|
+
"beforeBytes": 4610,
|
|
795
|
+
"afterBytes": 2574
|
|
731
796
|
},
|
|
732
797
|
{
|
|
733
798
|
"file": "src/room/invite-qr.js",
|
|
@@ -736,8 +801,8 @@
|
|
|
736
801
|
},
|
|
737
802
|
{
|
|
738
803
|
"file": "src/room/live-delivery.js",
|
|
739
|
-
"beforeBytes":
|
|
740
|
-
"afterBytes":
|
|
804
|
+
"beforeBytes": 2677,
|
|
805
|
+
"afterBytes": 1539
|
|
741
806
|
},
|
|
742
807
|
{
|
|
743
808
|
"file": "src/room/managed-context.js",
|
|
@@ -746,8 +811,8 @@
|
|
|
746
811
|
},
|
|
747
812
|
{
|
|
748
813
|
"file": "src/room/managed-prompt-composer.js",
|
|
749
|
-
"beforeBytes":
|
|
750
|
-
"afterBytes":
|
|
814
|
+
"beforeBytes": 10674,
|
|
815
|
+
"afterBytes": 11637
|
|
751
816
|
},
|
|
752
817
|
{
|
|
753
818
|
"file": "src/room/managed-room-binding.js",
|
|
@@ -756,13 +821,13 @@
|
|
|
756
821
|
},
|
|
757
822
|
{
|
|
758
823
|
"file": "src/room/managed-room-ipc.js",
|
|
759
|
-
"beforeBytes":
|
|
760
|
-
"afterBytes":
|
|
824
|
+
"beforeBytes": 15570,
|
|
825
|
+
"afterBytes": 7327
|
|
761
826
|
},
|
|
762
827
|
{
|
|
763
828
|
"file": "src/room/mirror-sync-service.js",
|
|
764
|
-
"beforeBytes":
|
|
765
|
-
"afterBytes":
|
|
829
|
+
"beforeBytes": 12375,
|
|
830
|
+
"afterBytes": 5688
|
|
766
831
|
},
|
|
767
832
|
{
|
|
768
833
|
"file": "src/room/public-attachment-cache.js",
|
|
@@ -771,8 +836,8 @@
|
|
|
771
836
|
},
|
|
772
837
|
{
|
|
773
838
|
"file": "src/room/public-room-client.js",
|
|
774
|
-
"beforeBytes":
|
|
775
|
-
"afterBytes":
|
|
839
|
+
"beforeBytes": 6945,
|
|
840
|
+
"afterBytes": 4002
|
|
776
841
|
},
|
|
777
842
|
{
|
|
778
843
|
"file": "src/room/registration-authority.js",
|
|
@@ -786,8 +851,8 @@
|
|
|
786
851
|
},
|
|
787
852
|
{
|
|
788
853
|
"file": "src/room/room-action-client.js",
|
|
789
|
-
"beforeBytes":
|
|
790
|
-
"afterBytes":
|
|
854
|
+
"beforeBytes": 29942,
|
|
855
|
+
"afterBytes": 15253
|
|
791
856
|
},
|
|
792
857
|
{
|
|
793
858
|
"file": "src/room/room-binding-client.js",
|
|
@@ -891,8 +956,8 @@
|
|
|
891
956
|
},
|
|
892
957
|
{
|
|
893
958
|
"file": "src/session/handlers/agent-workspace-validation.js",
|
|
894
|
-
"beforeBytes":
|
|
895
|
-
"afterBytes":
|
|
959
|
+
"beforeBytes": 10525,
|
|
960
|
+
"afterBytes": 5385
|
|
896
961
|
},
|
|
897
962
|
{
|
|
898
963
|
"file": "src/session/handlers/agents.js",
|
|
@@ -916,8 +981,8 @@
|
|
|
916
981
|
},
|
|
917
982
|
{
|
|
918
983
|
"file": "src/session/handlers/chat-recovery.js",
|
|
919
|
-
"beforeBytes":
|
|
920
|
-
"afterBytes":
|
|
984
|
+
"beforeBytes": 6918,
|
|
985
|
+
"afterBytes": 3623
|
|
921
986
|
},
|
|
922
987
|
{
|
|
923
988
|
"file": "src/session/handlers/chat-session-lifecycle.js",
|
|
@@ -926,8 +991,8 @@
|
|
|
926
991
|
},
|
|
927
992
|
{
|
|
928
993
|
"file": "src/session/handlers/chat.js",
|
|
929
|
-
"beforeBytes":
|
|
930
|
-
"afterBytes":
|
|
994
|
+
"beforeBytes": 35377,
|
|
995
|
+
"afterBytes": 15049
|
|
931
996
|
},
|
|
932
997
|
{
|
|
933
998
|
"file": "src/session/handlers/control.js",
|
|
@@ -996,8 +1061,8 @@
|
|
|
996
1061
|
},
|
|
997
1062
|
{
|
|
998
1063
|
"file": "src/session/manager.js",
|
|
999
|
-
"beforeBytes":
|
|
1000
|
-
"afterBytes":
|
|
1064
|
+
"beforeBytes": 40963,
|
|
1065
|
+
"afterBytes": 21571
|
|
1001
1066
|
},
|
|
1002
1067
|
{
|
|
1003
1068
|
"file": "src/session/native-cleanup-outbox.js",
|
|
@@ -1036,8 +1101,8 @@
|
|
|
1036
1101
|
},
|
|
1037
1102
|
{
|
|
1038
1103
|
"file": "src/session/queue-helpers.js",
|
|
1039
|
-
"beforeBytes":
|
|
1040
|
-
"afterBytes":
|
|
1104
|
+
"beforeBytes": 9503,
|
|
1105
|
+
"afterBytes": 4628
|
|
1041
1106
|
},
|
|
1042
1107
|
{
|
|
1043
1108
|
"file": "src/session/queue-message.js",
|
|
@@ -1061,8 +1126,8 @@
|
|
|
1061
1126
|
},
|
|
1062
1127
|
{
|
|
1063
1128
|
"file": "src/session/queue.js",
|
|
1064
|
-
"beforeBytes":
|
|
1065
|
-
"afterBytes":
|
|
1129
|
+
"beforeBytes": 41453,
|
|
1130
|
+
"afterBytes": 18387
|
|
1066
1131
|
},
|
|
1067
1132
|
{
|
|
1068
1133
|
"file": "src/session/queued-chat-dispatch.js",
|
|
@@ -1119,6 +1184,11 @@
|
|
|
1119
1184
|
"beforeBytes": 164,
|
|
1120
1185
|
"afterBytes": 1
|
|
1121
1186
|
},
|
|
1187
|
+
{
|
|
1188
|
+
"file": "src/support/support-client.js",
|
|
1189
|
+
"beforeBytes": 3060,
|
|
1190
|
+
"afterBytes": 1656
|
|
1191
|
+
},
|
|
1122
1192
|
{
|
|
1123
1193
|
"file": "src/tools/markdown-to-pdf.js",
|
|
1124
1194
|
"beforeBytes": 15004,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Claude Code
|
|
2
|
+
|
|
3
|
+
## 神念如何接入
|
|
4
|
+
|
|
5
|
+
神念通过官方 `claude` CLI 接入本机已经安装并登录的 Claude Code。`packages/cli/src/agents/claude.ts` 用 `resolveBuiltinCommand('claude')` 定位可执行程序,并以子进程方式启动一次会话;不使用未发布的私有 API。
|
|
6
|
+
|
|
7
|
+
## 模型发现
|
|
8
|
+
|
|
9
|
+
模型 ID 通过运行时探测得到(`model-registry/discovery.ts`),不是写死在源码里的固定列表;探测失败时不会伪造一个"看起来正常"的模型。
|
|
10
|
+
|
|
11
|
+
## 会话生命周期
|
|
12
|
+
|
|
13
|
+
- `start`:拼出 CLI 参数并 spawn 子进程,建立一次新的原生会话。
|
|
14
|
+
- `send`:把当前用户消息传给同一个子进程/会话。
|
|
15
|
+
- `resume`:使用 `--resume <session-id>` 精确恢复对应的原生会话,不猜测"最近一次"。
|
|
16
|
+
- `stop`:终止当前子进程并释放资源。
|
|
17
|
+
|
|
18
|
+
## 系统提示词
|
|
19
|
+
|
|
20
|
+
Claude CLI 支持 `--append-system-prompt <text>` 参数;神念把当前会话的完整系统提示词通过这个参数传入,不拼接进第一条用户消息。首次 `start` 与之后的 `--resume` 都会重新带上该参数。
|
|
21
|
+
|
|
22
|
+
## 登录与环境
|
|
23
|
+
|
|
24
|
+
依赖用户本机已经完成的 Claude 账号登录状态;神念只刷新并转发当前用户环境(Provider Key、`PATH` 等),不写入或读取任何长期账号凭据的具体值到日志、协议或提交文件中。
|
|
25
|
+
|
|
26
|
+
## 可用性检查
|
|
27
|
+
|
|
28
|
+
完整检查覆盖:可执行程序可定位、动态模型非空、真实 `start → send → final`、`--append-system-prompt` 生效、`stop` 正常结束、`--resume` 精确恢复同一原生会话。
|
|
29
|
+
|
|
30
|
+
## 已知限制与排障
|
|
31
|
+
|
|
32
|
+
- 未安装或未登录 Claude CLI 时,`start` 会在启动阶段失败;先确认 `claude` 命令本身可以在终端正常工作。
|
|
33
|
+
- 模型探测依赖 CLI 自身的可用模型列表;账号权限变化会改变可选模型集合。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Codex
|
|
2
|
+
|
|
3
|
+
## 神念如何接入
|
|
4
|
+
|
|
5
|
+
神念通过 Codex 的 app-server 机制接入(`packages/cli/src/agents/codex.ts`、`codex-runtime.ts`、`codex-protocol.ts`),以 JSON-RPC 方式与本机 Codex 会话通信,而不是逐行解析普通终端输出。
|
|
6
|
+
|
|
7
|
+
## 模型发现
|
|
8
|
+
|
|
9
|
+
模型通过运行时探测获得;探测失败时使用一份内置的保底模型列表(`fallbackCodexModels()`)而不是直接判定 Agent 不可用,但保底列表仅作为探测失败的兜底展示,不代表已经验证该模型真实可回复。
|
|
10
|
+
|
|
11
|
+
## 会话生命周期
|
|
12
|
+
|
|
13
|
+
- `start`:建立一个新的 Codex thread。
|
|
14
|
+
- `send`:向当前 thread 发送一次用户回合。
|
|
15
|
+
- `resume`:通过 `thread/resume` 精确恢复指定 thread;神念内部注释明确标注"精确恢复是真实能力,终端检查 / Turn 重新挂载不是",即只保证按 ID 恢复这一项。
|
|
16
|
+
- `stop`:结束当前回合并释放子进程/连接。
|
|
17
|
+
|
|
18
|
+
## 系统提示词
|
|
19
|
+
|
|
20
|
+
Codex app-server 支持以配置方式声明指令来源(代码中的 `model_instructions_file` 配置项),神念据此把完整系统提示词写入真实的指令通道,而不是拼进用户消息正文。
|
|
21
|
+
|
|
22
|
+
## 登录与环境
|
|
23
|
+
|
|
24
|
+
依赖用户本机已经完成的 Codex 账号登录;神念只转发刷新后的当前用户环境,不写入长期账号凭据的具体值。
|
|
25
|
+
|
|
26
|
+
## 可用性检查
|
|
27
|
+
|
|
28
|
+
完整检查覆盖:app-server 可连接、动态模型非空、真实 `start → send → final`、指令注入生效、`stop` 正常结束、`thread/resume` 精确恢复同一 thread。
|
|
29
|
+
|
|
30
|
+
## 已知限制与排障
|
|
31
|
+
|
|
32
|
+
- 模型探测失败时展示的是保底列表,不代表已验证可用;仍需要一次真实 `check` 才能确认。
|
|
33
|
+
- Codex 的终端检查与 Turn 重新挂载能力有限,恢复能力目前只保证"按精确 ID 恢复"这一项。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Cursor Agent
|
|
2
|
+
|
|
3
|
+
## 神念如何接入
|
|
4
|
+
|
|
5
|
+
神念通过 `cursor-agent` CLI 接入(`packages/cli/src/agents/cursor.ts`),以子进程方式启动并解析输出。
|
|
6
|
+
|
|
7
|
+
## 模型发现
|
|
8
|
+
|
|
9
|
+
模型通过运行时探测获得(`model-registry/discovery.ts` 中的 Cursor 分支),不是写死在源码里的固定列表。
|
|
10
|
+
|
|
11
|
+
## 会话生命周期
|
|
12
|
+
|
|
13
|
+
- `start` / `send`:spawn `cursor-agent` 子进程并发送当前用户回合。
|
|
14
|
+
- `resume`:使用 `--resume <chat-id>` 精确恢复对应的原生会话。
|
|
15
|
+
- `stop`:终止当前子进程。
|
|
16
|
+
|
|
17
|
+
## 系统提示词
|
|
18
|
+
|
|
19
|
+
**当前实现不满足 Adapter 协议 V1 的系统提示词要求。** 代码里的系统提示词是通过 `buildInlineChannelPreamble(...)` 拼接在用户正文前面一起发送给 `cursor-agent`(见 `cursor.ts` 的 `send()`),而不是通过 Cursor 的独立 system/instructions 参数注入——因为 Cursor Agent CLI 目前没有暴露这样的参数。这正是协议 V1 明确禁止的"拼入用户正文",因此 Cursor 目前无法通过完整检查的系统提示词冲突测试。
|
|
20
|
+
|
|
21
|
+
## 登录与环境
|
|
22
|
+
|
|
23
|
+
依赖用户本机已经完成的 Cursor 账号登录。Cursor Agent 没有经过验证的、按调用范围移除 Provider 凭据的方式,因此神念不会为它单独下发 Provider 环境变量,而是依赖 Cursor 自身的登录态。
|
|
24
|
+
|
|
25
|
+
## 可用性检查
|
|
26
|
+
|
|
27
|
+
模型发现、`start/send/stop` 和精确 `resume` 目前可用;系统提示词检查会失败,因此 Cursor 目前不满足 Adapter V1 的完整检查,不进入正常可选列表。
|
|
28
|
+
|
|
29
|
+
## 已知限制与排障
|
|
30
|
+
|
|
31
|
+
- 系统提示词目前是内联拼接,不是真实的 system/instructions 通道;在 Cursor Agent CLI 提供对应参数之前,官方 Adapter 无法通过完整检查。
|
|
32
|
+
- 需要真实通过检查的场景,可以由本地 AI 参考 Adapter V1 尝试其他机器接口(如存在),并把结果提交给神念官方评审。
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 自定义 Node Adapter
|
|
2
|
+
|
|
3
|
+
## 神念如何接入
|
|
4
|
+
|
|
5
|
+
这一项不对应某个具体的第三方 Agent,而是神念自适应接入的入口:当官方 Adapter 无法适应你机器上的实际安装、网关或启动方式时,你的本地 AI 可以用 [神念 Adapter 协议 V1](../../../packages/agent-protocol/PROTOCOL.md) 写一个 `adapter.mjs`,交给独立 Shennian Client 内置的 Adapter Runtime 加载和检查。
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
shennian adapter init <目录> --name <名称>
|
|
9
|
+
shennian adapter check <adapter.mjs> --workdir <目录> [--model <模型>]
|
|
10
|
+
shennian adapter add <名称> --entry <adapter.mjs>
|
|
11
|
+
shennian adapter list
|
|
12
|
+
shennian adapter show custom:<名称>
|
|
13
|
+
shennian adapter remove <名称>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 模型发现
|
|
17
|
+
|
|
18
|
+
由你自己实现的 `listModels` 决定;必须每次从上游真实、动态发现,且至少返回一个模型。
|
|
19
|
+
|
|
20
|
+
## 会话生命周期
|
|
21
|
+
|
|
22
|
+
`start / send / stop / resume` 全部由你自己的 `adapter.mjs` 实现;Runtime 负责 JSON Lines、并发、取消、终态和错误归一,你不需要自己处理这些。
|
|
23
|
+
|
|
24
|
+
## 系统提示词
|
|
25
|
+
|
|
26
|
+
`start / resume` 必须接收 `systemPrompt`,并通过上游真实的 system/instructions 参数注入;`send` 不再携带系统提示词。`adapter check` 会用一次真实的冲突测试验证这一点,只把结果写文本代码位置,不要求可再验证的形式化证明。
|
|
27
|
+
|
|
28
|
+
## 登录与环境
|
|
29
|
+
|
|
30
|
+
`adapter check` 使用与官方 Agent 相同的、刷新过的当前用户环境,并过滤神念长期账号、机器和登录凭据;你的 Adapter 自己启动的子进程必须继承这份环境,不能用空环境覆盖 Provider Key。
|
|
31
|
+
|
|
32
|
+
## 可用性检查
|
|
33
|
+
|
|
34
|
+
见 [神念 Adapter 协议 V1](../../../packages/agent-protocol/PROTOCOL.md) 第 9 节的完整检查清单:模块契约、动态模型、真实 `start`、系统提示词冲突测试、`send` 终态、`stop`、精确 `resume`。全部通过后才能 `adapter add` 注册。
|
|
35
|
+
|
|
36
|
+
## 已知限制与排障
|
|
37
|
+
|
|
38
|
+
- `adapter add` 只接受指纹未变化、已经通过 `adapter check` 的文件;修改文件后需要重新 `check`。
|
|
39
|
+
- 检查失败时按返回的 `stage` 和错误码定位问题:`models`、`start`、`systemPrompt`、`send`、`stop`、`resume` 分别对应协议里的对应阶段。
|
|
40
|
+
- 通用实现完整通过检查后,可以在你确认的前提下生成一份脱敏文件提交给神念官方,参考 [Agent 自适应接入](../../features/local-agent-adapters.md) 第四节。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# OpenCode
|
|
2
|
+
|
|
3
|
+
## 神念如何接入
|
|
4
|
+
|
|
5
|
+
神念通过 OpenCode CLI 接入(`packages/cli/src/agents/opencode.ts`),以子进程方式启动并解析输出;模型清单还可以通过 OpenCode 自身的 API(`model-registry/opencode-api.ts`)查询。
|
|
6
|
+
|
|
7
|
+
## 模型发现
|
|
8
|
+
|
|
9
|
+
模型通过运行时探测获得,不是写死在源码里的固定列表。
|
|
10
|
+
|
|
11
|
+
## 会话生命周期
|
|
12
|
+
|
|
13
|
+
- `start` / `send`:spawn OpenCode 子进程并发送当前用户回合。
|
|
14
|
+
- `resume`:精确恢复对应原生会话。
|
|
15
|
+
- `stop`:终止当前子进程。
|
|
16
|
+
|
|
17
|
+
## 系统提示词
|
|
18
|
+
|
|
19
|
+
**当前实现不满足 Adapter 协议 V1 的系统提示词要求。** 和 Cursor 一样,系统提示词由 `buildInlineChannelPreamble(...)` 拼接在用户正文前一起发送(见 `opencode.ts` 的 `send()`),而不是通过独立的 system/instructions 参数注入。这是协议 V1 明确禁止的做法,OpenCode 目前无法通过完整检查的系统提示词冲突测试。
|
|
20
|
+
|
|
21
|
+
## 登录与环境
|
|
22
|
+
|
|
23
|
+
依赖用户本机已经完成的 OpenCode / Provider 登录;神念只转发刷新后的当前用户环境。
|
|
24
|
+
|
|
25
|
+
## 可用性检查
|
|
26
|
+
|
|
27
|
+
模型发现、`start/send/stop` 和精确 `resume` 目前可用;系统提示词检查会失败,因此 OpenCode 目前不满足 Adapter V1 的完整检查,不进入正常可选列表。
|
|
28
|
+
|
|
29
|
+
## 已知限制与排障
|
|
30
|
+
|
|
31
|
+
- 系统提示词目前是内联拼接,不是真实的 system/instructions 通道;需要确认 OpenCode 是否有等价的独立指令参数后才能补齐这项检查。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Pi Coding Agent
|
|
2
|
+
|
|
3
|
+
## 神念如何接入
|
|
4
|
+
|
|
5
|
+
神念通过 Pi Coding Agent 的 RPC 客户端接入(`packages/cli/src/agents/pi-coding-agent.ts`、`pi-rpc-client.ts`),以子进程 + RPC 的方式通信。
|
|
6
|
+
|
|
7
|
+
## 模型发现
|
|
8
|
+
|
|
9
|
+
模型通过运行时探测获得,不是写死在源码里的固定列表。
|
|
10
|
+
|
|
11
|
+
## 会话生命周期
|
|
12
|
+
|
|
13
|
+
- `start` / `send`:spawn 子进程并通过 RPC 发送当前用户回合。
|
|
14
|
+
- `resume`:精确恢复指定原生会话;代码在恢复失败并检测到 RPC 恢复了不同会话时会主动报错("Pi RPC resumed a different session"),拒绝把错误会话当作恢复成功。
|
|
15
|
+
- `stop`:终止当前子进程。
|
|
16
|
+
|
|
17
|
+
## 系统提示词
|
|
18
|
+
|
|
19
|
+
Pi Coding Agent 把完整系统提示词写入一个临时 `instructions.md` 文件,再通过 `--append-system-prompt <file>` 传给上游,属于真实的文件型 system/instructions 通道,不拼接进用户正文。
|
|
20
|
+
|
|
21
|
+
## 登录与环境
|
|
22
|
+
|
|
23
|
+
依赖用户本机已经完成的 Pi Coding Agent / Provider 登录;神念只转发刷新后的当前用户环境,并清理 `NO_COLOR` 等无害运行时标记。
|
|
24
|
+
|
|
25
|
+
## 可用性检查
|
|
26
|
+
|
|
27
|
+
完整检查覆盖:可执行程序可定位、动态模型非空、真实 `start → send → final`、`instructions.md` 文件注入生效、`stop` 正常结束、精确 `resume`(并拒绝任何非目标会话)。
|
|
28
|
+
|
|
29
|
+
## 已知限制与排障
|
|
30
|
+
|
|
31
|
+
- `resume` 明确拒绝"恢复了别的会话"这种情况;遇到此类错误说明上游把请求路由到了错误的原生会话,需要先排查 Pi Coding Agent 自身的会话管理。
|