dsh-reference-anything 0.4.3 → 0.5.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.
Files changed (122) hide show
  1. package/NOTICE.md +58 -0
  2. package/README.md +159 -70
  3. package/cordis.patch.yml +17 -15
  4. package/images/agents/LICENSE +22 -0
  5. package/images/agents/README.md +3 -0
  6. package/images/agents/antigravity.svg +1 -0
  7. package/images/agents/chatgpt.svg +1 -0
  8. package/images/agents/claude.svg +1 -0
  9. package/images/agents/cline.svg +1 -0
  10. package/images/agents/codex.svg +1 -0
  11. package/images/agents/continue.svg +1 -0
  12. package/images/agents/crush.svg +1 -0
  13. package/images/agents/cursor.svg +1 -0
  14. package/images/agents/dsh.svg +1 -0
  15. package/images/agents/gemini.svg +1 -0
  16. package/images/agents/goose.svg +1 -0
  17. package/images/agents/grokbuild.svg +1 -0
  18. package/images/agents/hermes.svg +1 -0
  19. package/images/agents/kilocode.svg +1 -0
  20. package/images/agents/kimi.svg +1 -0
  21. package/images/agents/mimocode.svg +1 -0
  22. package/images/agents/openclaw.svg +1 -0
  23. package/images/agents/opencode.svg +1 -0
  24. package/images/agents/pi.svg +1 -0
  25. package/images/agents/qoder.svg +1 -0
  26. package/images/agents/qwen.svg +1 -0
  27. package/images/agents/reasonix.svg +6 -0
  28. package/images/agents/teleagent.svg +1 -0
  29. package/images/agents/trae.svg +1 -0
  30. package/images/agents/vibe.svg +1 -0
  31. package/images/agents/workbuddy.svg +37 -0
  32. package/images/agents/zcode.svg +1 -0
  33. package/images/agents/zed.svg +1 -0
  34. package/lib/agent-scan-cache.d.ts +13 -0
  35. package/lib/agent-scan-cache.js +43 -0
  36. package/lib/chat-import-compatibility.d.ts +18 -0
  37. package/lib/chat-import-compatibility.js +87 -0
  38. package/lib/chat-import-discovery.d.ts +32 -0
  39. package/lib/chat-import-discovery.js +17 -0
  40. package/lib/chat-import-reader.d.ts +27 -0
  41. package/lib/chat-import-reader.js +111 -0
  42. package/lib/chat-import-runtime.d.ts +4 -0
  43. package/lib/chat-import-runtime.js +4 -0
  44. package/lib/client/index.d.ts +5 -0
  45. package/lib/client.js +4 -33741
  46. package/lib/contract.d.ts +65 -4
  47. package/lib/contract.js +24 -4
  48. package/lib/conversation-availability.d.ts +13 -0
  49. package/lib/conversation-availability.js +76 -0
  50. package/lib/errors.d.ts +2 -2
  51. package/lib/host.d.ts +104 -11
  52. package/lib/host.js +202 -14
  53. package/lib/index.d.ts +3 -1
  54. package/lib/index.js +31 -3
  55. package/lib/local-conversation-reader.d.ts +3 -0
  56. package/lib/local-conversation-reader.js +81 -0
  57. package/lib/local-conversation-scanner.d.ts +18 -0
  58. package/lib/local-conversation-scanner.js +55 -0
  59. package/lib/local-locator.d.ts +14 -0
  60. package/lib/local-locator.js +34 -0
  61. package/lib/local-plugins.d.ts +6 -0
  62. package/lib/local-plugins.js +119 -0
  63. package/lib/local-reference-tools.d.ts +4 -0
  64. package/lib/local-reference-tools.js +195 -0
  65. package/lib/local-reference.d.ts +118 -0
  66. package/lib/local-reference.js +289 -0
  67. package/lib/opencli.d.ts +5 -2
  68. package/lib/opencli.js +88 -64
  69. package/lib/reference.d.ts +5 -3
  70. package/lib/reference.js +167 -72
  71. package/lib/render.d.ts +1 -1
  72. package/lib/render.js +4 -4
  73. package/lib/retain.d.ts +14 -0
  74. package/lib/retain.js +1 -1
  75. package/lib/serialize.d.ts +1 -1
  76. package/lib/serialize.js +2 -2
  77. package/lib/sources/local-agent/index.d.ts +23 -16
  78. package/lib/sources/local-agent/index.js +101 -15
  79. package/lib/store/spec.d.ts +104 -7
  80. package/lib/sync/index.js +4 -0
  81. package/lib/tool.d.ts +2 -0
  82. package/lib/tool.js +36 -41
  83. package/lib/typert.js +3 -0
  84. package/lib/types.d.ts +2 -0
  85. package/lib/update.d.ts +2 -0
  86. package/lib/update.js +12 -0
  87. package/lib/uri-codec.d.ts +1 -0
  88. package/lib/uri-codec.js +64 -3
  89. package/lib/uri.d.ts +1 -10
  90. package/lib/uri.js +16 -5
  91. package/lib/web.js +3 -1
  92. package/lib/wire.d.ts +200 -0
  93. package/lib/wire.js +38 -13
  94. package/opencli-plugin/common.js +5 -3
  95. package/opencli-plugin/opencli-plugin.json +1 -1
  96. package/opencli-plugin/package.json +1 -1
  97. package/package.json +30 -4
  98. package/release-notes/0.4.4/commands.png +0 -0
  99. package/release-notes/0.4.4/demos/agent-import.gif +0 -0
  100. package/release-notes/0.4.4/demos/chat-import-upgrade.gif +0 -0
  101. package/release-notes/0.4.4/demos/folders.gif +0 -0
  102. package/release-notes/0.4.4/demos/local-plugins.gif +0 -0
  103. package/release-notes/0.4.4/demos/shortcuts.gif +0 -0
  104. package/release-notes/0.4.4/features.json +36 -0
  105. package/release-notes/0.4.4/files.png +0 -0
  106. package/release-notes/0.5.0/demos/agent-import.gif +0 -0
  107. package/release-notes/0.5.0/demos/chat-import-upgrade.gif +0 -0
  108. package/release-notes/0.5.0/demos/folders.gif +0 -0
  109. package/release-notes/0.5.0/demos/local-plugins.gif +0 -0
  110. package/release-notes/0.5.0/demos/local-references.gif +0 -0
  111. package/release-notes/0.5.0/demos/shortcuts.gif +0 -0
  112. package/release-notes/0.5.0/features.json +65 -0
  113. package/release-notes/README.md +36 -0
  114. package/vendor/chat-import-reader/LICENSE +22 -0
  115. package/vendor/chat-import-reader/LICENSE.fzstd +21 -0
  116. package/vendor/chat-import-reader/README.md +48 -0
  117. package/vendor/chat-import-reader/availability-worker.mjs +114 -0
  118. package/vendor/chat-import-reader/parsers.d.mts +6 -0
  119. package/vendor/chat-import-reader/parsers.mjs +11168 -0
  120. package/vendor/chat-import-reader/scan-worker.mjs +7 -0
  121. package/vendor/chat-import-reader/scanners.mjs +4286 -0
  122. package/vendor/chat-import-reader/upstream-sha256.json +101 -0
package/lib/uri.d.ts CHANGED
@@ -1,16 +1,7 @@
1
- /**
2
- * Canonical `dsh-ref:` URI and the inline mention that carries it.
3
- *
4
- * A reference is two opaque strings, either of which may contain any character
5
- * a JavaScript string can hold. JSON-encoding the pair before base64url means
6
- * quotes, slashes, backslashes, newlines, and astral characters all survive
7
- * without a delimiter the payload could itself spell.
8
- *
9
- * @module dsh-reference-anything/uri
10
- */
11
1
  import type { ReferenceInput, ReferenceRef } from './types.ts';
12
2
  import { encodeReferenceUri, REFERENCE_SCHEME } from './uri-codec.ts';
13
3
  export { encodeReferenceUri, REFERENCE_SCHEME };
4
+ export declare function referenceReadHandle(ref: ReferenceRef): string;
14
5
  /**
15
6
  * Decode one canonical reference URI.
16
7
  *
package/lib/uri.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { LOCAL_REFERENCE_SCHEME, LOCAL_REFERENCE_OPEN, LOCAL_REFERENCE_CLOSE, localLocatorId, localLocatorFromId, validateLocalLocator } from "./local-locator.js";
1
2
  /**
2
3
  * Canonical `dsh-ref:` URI and the inline mention that carries it.
3
4
  *
@@ -9,8 +10,12 @@
9
10
  * @module dsh-reference-anything/uri
10
11
  */
11
12
  import { ReferenceAnythingError } from "./errors.js";
12
- import { decodeReferenceUriUnchecked, encodeReferenceUri, REFERENCE_SCHEME } from "./uri-codec.js";
13
+ import { createHash } from 'node:crypto';
14
+ import { decodeReferenceUriUnchecked, encodeReferenceUri, encodeLegacyReferenceUri, REFERENCE_SCHEME } from "./uri-codec.js";
13
15
  export { encodeReferenceUri, REFERENCE_SCHEME };
16
+ export function referenceReadHandle(ref) {
17
+ return `ref:${createHash('sha256').update(encodeLegacyReferenceUri(ref)).digest('hex').slice(0, 24)}`;
18
+ }
14
19
  /**
15
20
  * Decode one canonical reference URI.
16
21
  *
@@ -52,13 +57,19 @@ export function formatReferenceMention(ref, label) {
52
57
  */
53
58
  export function parseReferenceText(text) {
54
59
  const references = [];
55
- const pattern = /@\[((?:\\.|[^\\\]])*)\]\((dsh-ref:[^\s)]*)\)|(dsh-ref:[A-Za-z0-9_-]+)/gu;
56
- const rendered = text.replace(pattern, (_match, rawLabel, markdownUri, bareUri) => {
60
+ const withLocators = text.replace(/<local-agent-reference>([\s\S]*?)<\/local-agent-reference>/gu, (_match, json) => {
61
+ const value = JSON.parse(json);
62
+ const locator = validateLocalLocator(value);
63
+ references.push({ ref: { source: 'local-agent', id: localLocatorId(locator) }, label: typeof value.label === 'string' ? value.label : locator.sessionId });
64
+ return `@${typeof value.label === 'string' ? value.label : locator.sessionId}`;
65
+ });
66
+ const pattern = /@\[((?:\\.|[^\\\]])*)\]\(((?:dsh-ref:|dsh-local:)[^\s)]*)\)|((?:dsh-ref:[A-Za-z0-9_-]+|dsh-local:\?[^\s<>]+))/gu;
67
+ const rendered = withLocators.replace(pattern, (_match, rawLabel, markdownUri, bareUri) => {
57
68
  const uri = markdownUri ?? bareUri;
58
69
  if (uri === undefined)
59
70
  throw invalidUri(String(_match));
60
71
  const ref = decodeReferenceUri(uri);
61
- const label = rawLabel === undefined ? ref.id : unescapeLabel(rawLabel);
72
+ const label = rawLabel === undefined ? (ref.source === 'local-agent' ? localLocatorFromId(ref.id).sessionId : ref.id) : unescapeLabel(rawLabel);
62
73
  references.push({ ref, label });
63
74
  return `@${label}`;
64
75
  });
@@ -73,7 +84,7 @@ export function parseReferenceText(text) {
73
84
  * @returns whether a full parse is worth running.
74
85
  */
75
86
  export function mayContainReference(text) {
76
- return text.includes(REFERENCE_SCHEME);
87
+ return text.includes(REFERENCE_SCHEME) || text.includes(LOCAL_REFERENCE_SCHEME) || (text.includes(LOCAL_REFERENCE_OPEN) && text.includes(LOCAL_REFERENCE_CLOSE));
77
88
  }
78
89
  function escapeLabel(label) {
79
90
  return label.replace(/[\\\]]/gu, match => `\\${match}`);
package/lib/web.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import { ReferenceAnythingRemote } from "./host.js";
2
2
  import { TYPERT_MANIFEST } from "./typert.js";
3
+ import { createPluginReferenceSource } from "./local-plugins.js";
3
4
  export const name = 'reference-anything-web';
4
5
  // ReferenceAnythingRemote looks up optional sources through ctx.get(). Making
5
6
  // cloud drives a required injection blocks all conversation endpoints when
6
7
  // that source is disabled or unavailable in the active profile.
7
- export const inject = ['typert', 'referenceChatHistory', 'openListManager'];
8
+ export const inject = ['typert', 'referenceChatHistory', 'openListManager', 'references'];
8
9
  export function apply(ctx) {
9
10
  new ReferenceAnythingRemote(ctx);
11
+ ctx.effect(() => ctx.references.registerSource(createPluginReferenceSource(ctx)), 'reference-anything-web.plugin-source');
10
12
  ctx.effect(() => {
11
13
  const dispose = ctx.typert.register(TYPERT_MANIFEST);
12
14
  return () => { void dispose(); };
package/lib/wire.d.ts CHANGED
@@ -10,7 +10,10 @@ export declare const providerSchema: z.ZodEnum<{
10
10
  }>;
11
11
  export type ChatProvider = z.infer<typeof providerSchema>;
12
12
  export declare const ALL_PROVIDERS: readonly ChatProvider[];
13
+ export declare const READABLE_LOCAL_AGENTS: readonly ["claude-code", "codex", "cursor", "qoder", "reasonix", "openclaw", "kimi", "grokbuild", "hermes", "gemini-cli", "pi", "opencode", "mimocode", "zcode"];
14
+ export declare const IMPORT_ONLY_AGENTS: readonly ["antigravity", "kilocode", "chatgpt", "workbuddy", "qwen", "continue", "cline", "goose", "dsh4", "zed", "crush", "teleagent", "trae", "vibe", "dsh"];
13
15
  export declare const localAgentSchema: z.ZodEnum<{
16
+ chatgpt: "chatgpt";
14
17
  kimi: "kimi";
15
18
  "claude-code": "claude-code";
16
19
  codex: "codex";
@@ -25,6 +28,20 @@ export declare const localAgentSchema: z.ZodEnum<{
25
28
  opencode: "opencode";
26
29
  mimocode: "mimocode";
27
30
  zcode: "zcode";
31
+ antigravity: "antigravity";
32
+ kilocode: "kilocode";
33
+ workbuddy: "workbuddy";
34
+ qwen: "qwen";
35
+ continue: "continue";
36
+ cline: "cline";
37
+ goose: "goose";
38
+ dsh4: "dsh4";
39
+ zed: "zed";
40
+ crush: "crush";
41
+ teleagent: "teleagent";
42
+ trae: "trae";
43
+ vibe: "vibe";
44
+ dsh: "dsh";
28
45
  }>;
29
46
  export type LocalAgent = z.infer<typeof localAgentSchema>;
30
47
  export declare const ALL_LOCAL_AGENTS: readonly LocalAgent[];
@@ -37,15 +54,34 @@ export declare const pickerSourceSchema: z.ZodEnum<{
37
54
  agents: "agents";
38
55
  conversations: "conversations";
39
56
  drives: "drives";
57
+ plugins: "plugins";
40
58
  }>;
41
59
  export type PickerSource = z.infer<typeof pickerSourceSchema>;
60
+ export declare const pickerSortSchema: z.ZodEnum<{
61
+ name: "name";
62
+ updated: "updated";
63
+ }>;
64
+ export type PickerSort = z.infer<typeof pickerSortSchema>;
42
65
  declare const pickerSourceSettingsSchema: z.ZodObject<{
43
66
  enabled: z.ZodBoolean;
44
67
  order: z.ZodNumber;
45
68
  limit: z.ZodNumber;
46
69
  maxCandidates: z.ZodDefault<z.ZodNumber>;
70
+ sort: z.ZodDefault<z.ZodEnum<{
71
+ name: "name";
72
+ updated: "updated";
73
+ }>>;
74
+ shortcut: z.ZodDefault<z.ZodString>;
75
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
76
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
47
77
  }, z.core.$strip>;
48
78
  export type PickerSourceSettings = z.infer<typeof pickerSourceSettingsSchema>;
79
+ export declare const agentActionsSchema: z.ZodObject<{
80
+ showImport: z.ZodDefault<z.ZodBoolean>;
81
+ showSummary: z.ZodDefault<z.ZodBoolean>;
82
+ skipConfirmation: z.ZodDefault<z.ZodBoolean>;
83
+ }, z.core.$strip>;
84
+ export type AgentActionsSettings = z.infer<typeof agentActionsSchema>;
49
85
  export declare const pickerSettingsSchema: z.ZodObject<{
50
86
  displayMode: z.ZodDefault<z.ZodEnum<{
51
87
  collapse: "collapse";
@@ -56,42 +92,109 @@ export declare const pickerSettingsSchema: z.ZodObject<{
56
92
  order: z.ZodNumber;
57
93
  limit: z.ZodNumber;
58
94
  maxCandidates: z.ZodDefault<z.ZodNumber>;
95
+ sort: z.ZodDefault<z.ZodEnum<{
96
+ name: "name";
97
+ updated: "updated";
98
+ }>>;
99
+ shortcut: z.ZodDefault<z.ZodString>;
100
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
101
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
59
102
  }, z.core.$strip>;
60
103
  skills: z.ZodObject<{
61
104
  enabled: z.ZodBoolean;
62
105
  order: z.ZodNumber;
63
106
  limit: z.ZodNumber;
64
107
  maxCandidates: z.ZodDefault<z.ZodNumber>;
108
+ sort: z.ZodDefault<z.ZodEnum<{
109
+ name: "name";
110
+ updated: "updated";
111
+ }>>;
112
+ shortcut: z.ZodDefault<z.ZodString>;
113
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
65
115
  }, z.core.$strip>;
66
116
  files: z.ZodObject<{
67
117
  enabled: z.ZodBoolean;
68
118
  order: z.ZodNumber;
69
119
  limit: z.ZodNumber;
70
120
  maxCandidates: z.ZodDefault<z.ZodNumber>;
121
+ sort: z.ZodDefault<z.ZodEnum<{
122
+ name: "name";
123
+ updated: "updated";
124
+ }>>;
125
+ shortcut: z.ZodDefault<z.ZodString>;
126
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
127
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
71
128
  }, z.core.$strip>;
72
129
  sessions: z.ZodObject<{
73
130
  enabled: z.ZodBoolean;
74
131
  order: z.ZodNumber;
75
132
  limit: z.ZodNumber;
76
133
  maxCandidates: z.ZodDefault<z.ZodNumber>;
134
+ sort: z.ZodDefault<z.ZodEnum<{
135
+ name: "name";
136
+ updated: "updated";
137
+ }>>;
138
+ shortcut: z.ZodDefault<z.ZodString>;
139
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
77
141
  }, z.core.$strip>;
78
142
  agents: z.ZodDefault<z.ZodObject<{
79
143
  enabled: z.ZodBoolean;
80
144
  order: z.ZodNumber;
81
145
  limit: z.ZodNumber;
82
146
  maxCandidates: z.ZodDefault<z.ZodNumber>;
147
+ sort: z.ZodDefault<z.ZodEnum<{
148
+ name: "name";
149
+ updated: "updated";
150
+ }>>;
151
+ shortcut: z.ZodDefault<z.ZodString>;
152
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
153
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
154
+ showImport: z.ZodDefault<z.ZodBoolean>;
155
+ showSummary: z.ZodDefault<z.ZodBoolean>;
156
+ skipConfirmation: z.ZodDefault<z.ZodBoolean>;
83
157
  }, z.core.$strip>>;
84
158
  conversations: z.ZodObject<{
85
159
  enabled: z.ZodBoolean;
86
160
  order: z.ZodNumber;
87
161
  limit: z.ZodNumber;
88
162
  maxCandidates: z.ZodDefault<z.ZodNumber>;
163
+ sort: z.ZodDefault<z.ZodEnum<{
164
+ name: "name";
165
+ updated: "updated";
166
+ }>>;
167
+ shortcut: z.ZodDefault<z.ZodString>;
168
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
169
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
89
170
  }, z.core.$strip>;
90
171
  drives: z.ZodDefault<z.ZodObject<{
91
172
  enabled: z.ZodBoolean;
92
173
  order: z.ZodNumber;
93
174
  limit: z.ZodNumber;
94
175
  maxCandidates: z.ZodDefault<z.ZodNumber>;
176
+ sort: z.ZodDefault<z.ZodEnum<{
177
+ name: "name";
178
+ updated: "updated";
179
+ }>>;
180
+ shortcut: z.ZodDefault<z.ZodString>;
181
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
183
+ }, z.core.$strip>>;
184
+ plugins: z.ZodDefault<z.ZodObject<{
185
+ enabled: z.ZodBoolean;
186
+ order: z.ZodNumber;
187
+ limit: z.ZodNumber;
188
+ maxCandidates: z.ZodDefault<z.ZodNumber>;
189
+ sort: z.ZodDefault<z.ZodEnum<{
190
+ name: "name";
191
+ updated: "updated";
192
+ }>>;
193
+ shortcut: z.ZodDefault<z.ZodString>;
194
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
195
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
196
+ onlyLive: z.ZodDefault<z.ZodBoolean>;
197
+ showDeepSeek: z.ZodDefault<z.ZodBoolean>;
95
198
  }, z.core.$strip>>;
96
199
  }, z.core.$strip>;
97
200
  export type PickerSettings = z.infer<typeof pickerSettingsSchema>;
@@ -127,6 +230,7 @@ export declare const settingsRecordSchema: z.ZodObject<{
127
230
  kimi: "kimi";
128
231
  }>>>;
129
232
  enabledAgents: z.ZodDefault<z.ZodArray<z.ZodEnum<{
233
+ chatgpt: "chatgpt";
130
234
  kimi: "kimi";
131
235
  "claude-code": "claude-code";
132
236
  codex: "codex";
@@ -141,8 +245,23 @@ export declare const settingsRecordSchema: z.ZodObject<{
141
245
  opencode: "opencode";
142
246
  mimocode: "mimocode";
143
247
  zcode: "zcode";
248
+ antigravity: "antigravity";
249
+ kilocode: "kilocode";
250
+ workbuddy: "workbuddy";
251
+ qwen: "qwen";
252
+ continue: "continue";
253
+ cline: "cline";
254
+ goose: "goose";
255
+ dsh4: "dsh4";
256
+ zed: "zed";
257
+ crush: "crush";
258
+ teleagent: "teleagent";
259
+ trae: "trae";
260
+ vibe: "vibe";
261
+ dsh: "dsh";
144
262
  }>>>;
145
263
  agentDirectories: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
264
+ chatgpt: "chatgpt";
146
265
  kimi: "kimi";
147
266
  "claude-code": "claude-code";
148
267
  codex: "codex";
@@ -157,6 +276,20 @@ export declare const settingsRecordSchema: z.ZodObject<{
157
276
  opencode: "opencode";
158
277
  mimocode: "mimocode";
159
278
  zcode: "zcode";
279
+ antigravity: "antigravity";
280
+ kilocode: "kilocode";
281
+ workbuddy: "workbuddy";
282
+ qwen: "qwen";
283
+ continue: "continue";
284
+ cline: "cline";
285
+ goose: "goose";
286
+ dsh4: "dsh4";
287
+ zed: "zed";
288
+ crush: "crush";
289
+ teleagent: "teleagent";
290
+ trae: "trae";
291
+ vibe: "vibe";
292
+ dsh: "dsh";
160
293
  }> & z.core.$partial, z.ZodString>>;
161
294
  enabledDriveMounts: z.ZodOptional<z.ZodArray<z.ZodString>>;
162
295
  maxReadTurns: z.ZodDefault<z.ZodNumber>;
@@ -174,42 +307,109 @@ export declare const settingsRecordSchema: z.ZodObject<{
174
307
  order: z.ZodNumber;
175
308
  limit: z.ZodNumber;
176
309
  maxCandidates: z.ZodDefault<z.ZodNumber>;
310
+ sort: z.ZodDefault<z.ZodEnum<{
311
+ name: "name";
312
+ updated: "updated";
313
+ }>>;
314
+ shortcut: z.ZodDefault<z.ZodString>;
315
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
316
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
177
317
  }, z.core.$strip>;
178
318
  skills: z.ZodObject<{
179
319
  enabled: z.ZodBoolean;
180
320
  order: z.ZodNumber;
181
321
  limit: z.ZodNumber;
182
322
  maxCandidates: z.ZodDefault<z.ZodNumber>;
323
+ sort: z.ZodDefault<z.ZodEnum<{
324
+ name: "name";
325
+ updated: "updated";
326
+ }>>;
327
+ shortcut: z.ZodDefault<z.ZodString>;
328
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
329
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
183
330
  }, z.core.$strip>;
184
331
  files: z.ZodObject<{
185
332
  enabled: z.ZodBoolean;
186
333
  order: z.ZodNumber;
187
334
  limit: z.ZodNumber;
188
335
  maxCandidates: z.ZodDefault<z.ZodNumber>;
336
+ sort: z.ZodDefault<z.ZodEnum<{
337
+ name: "name";
338
+ updated: "updated";
339
+ }>>;
340
+ shortcut: z.ZodDefault<z.ZodString>;
341
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
342
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
189
343
  }, z.core.$strip>;
190
344
  sessions: z.ZodObject<{
191
345
  enabled: z.ZodBoolean;
192
346
  order: z.ZodNumber;
193
347
  limit: z.ZodNumber;
194
348
  maxCandidates: z.ZodDefault<z.ZodNumber>;
349
+ sort: z.ZodDefault<z.ZodEnum<{
350
+ name: "name";
351
+ updated: "updated";
352
+ }>>;
353
+ shortcut: z.ZodDefault<z.ZodString>;
354
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
355
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
195
356
  }, z.core.$strip>;
196
357
  agents: z.ZodDefault<z.ZodObject<{
197
358
  enabled: z.ZodBoolean;
198
359
  order: z.ZodNumber;
199
360
  limit: z.ZodNumber;
200
361
  maxCandidates: z.ZodDefault<z.ZodNumber>;
362
+ sort: z.ZodDefault<z.ZodEnum<{
363
+ name: "name";
364
+ updated: "updated";
365
+ }>>;
366
+ shortcut: z.ZodDefault<z.ZodString>;
367
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
368
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
369
+ showImport: z.ZodDefault<z.ZodBoolean>;
370
+ showSummary: z.ZodDefault<z.ZodBoolean>;
371
+ skipConfirmation: z.ZodDefault<z.ZodBoolean>;
201
372
  }, z.core.$strip>>;
202
373
  conversations: z.ZodObject<{
203
374
  enabled: z.ZodBoolean;
204
375
  order: z.ZodNumber;
205
376
  limit: z.ZodNumber;
206
377
  maxCandidates: z.ZodDefault<z.ZodNumber>;
378
+ sort: z.ZodDefault<z.ZodEnum<{
379
+ name: "name";
380
+ updated: "updated";
381
+ }>>;
382
+ shortcut: z.ZodDefault<z.ZodString>;
383
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
384
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
207
385
  }, z.core.$strip>;
208
386
  drives: z.ZodDefault<z.ZodObject<{
209
387
  enabled: z.ZodBoolean;
210
388
  order: z.ZodNumber;
211
389
  limit: z.ZodNumber;
212
390
  maxCandidates: z.ZodDefault<z.ZodNumber>;
391
+ sort: z.ZodDefault<z.ZodEnum<{
392
+ name: "name";
393
+ updated: "updated";
394
+ }>>;
395
+ shortcut: z.ZodDefault<z.ZodString>;
396
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
397
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
398
+ }, z.core.$strip>>;
399
+ plugins: z.ZodDefault<z.ZodObject<{
400
+ enabled: z.ZodBoolean;
401
+ order: z.ZodNumber;
402
+ limit: z.ZodNumber;
403
+ maxCandidates: z.ZodDefault<z.ZodNumber>;
404
+ sort: z.ZodDefault<z.ZodEnum<{
405
+ name: "name";
406
+ updated: "updated";
407
+ }>>;
408
+ shortcut: z.ZodDefault<z.ZodString>;
409
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
410
+ sourceAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
411
+ onlyLive: z.ZodDefault<z.ZodBoolean>;
412
+ showDeepSeek: z.ZodDefault<z.ZodBoolean>;
213
413
  }, z.core.$strip>>;
214
414
  }, z.core.$strip>>;
215
415
  }, z.core.$strip>;
package/lib/wire.js CHANGED
@@ -2,19 +2,34 @@
2
2
  import { z } from 'zod';
3
3
  export const providerSchema = z.enum(['chatgpt', 'claude', 'gemini', 'deepseek', 'grok', 'kimi']);
4
4
  export const ALL_PROVIDERS = providerSchema.options;
5
- export const localAgentSchema = z.enum(['claude-code', 'codex', 'cursor', 'qoder', 'reasonix', 'openclaw', 'kimi', 'grokbuild', 'hermes', 'gemini-cli', 'pi', 'opencode', 'mimocode', 'zcode']);
5
+ export const READABLE_LOCAL_AGENTS = ['claude-code', 'codex', 'cursor', 'qoder', 'reasonix', 'openclaw', 'kimi', 'grokbuild', 'hermes', 'gemini-cli', 'pi', 'opencode', 'mimocode', 'zcode'];
6
+ export const IMPORT_ONLY_AGENTS = ['antigravity', 'kilocode', 'chatgpt', 'workbuddy', 'qwen', 'continue', 'cline', 'goose', 'dsh4', 'zed', 'crush', 'teleagent', 'trae', 'vibe', 'dsh'];
7
+ export const localAgentSchema = z.enum([...READABLE_LOCAL_AGENTS, ...IMPORT_ONLY_AGENTS]);
6
8
  export const ALL_LOCAL_AGENTS = localAgentSchema.options;
7
9
  export const LOCAL_AGENT_LABEL = {
8
10
  'claude-code': 'Claude Code', codex: 'Codex', cursor: 'Cursor', qoder: 'Qoder', reasonix: 'Reasonix',
9
11
  openclaw: 'OpenClaw', kimi: 'Kimi', grokbuild: 'Grok Build', hermes: 'Hermes', 'gemini-cli': 'Gemini CLI',
10
12
  pi: 'Pi', opencode: 'opencode', mimocode: 'mimocode', zcode: 'zcode',
13
+ antigravity: 'Antigravity', kilocode: 'Kilo Code', chatgpt: 'ChatGPT', workbuddy: 'WorkBuddy', qwen: 'Qwen Code',
14
+ continue: 'Continue', cline: 'Cline', goose: 'Goose', dsh4: 'DSH4', zed: 'Zed', crush: 'Crush', teleagent: 'TeleAgent', trae: 'Trae Work', vibe: 'Mistral Vibe', dsh: 'DSH',
11
15
  };
12
- export const pickerSourceSchema = z.enum(['commands', 'skills', 'files', 'sessions', 'agents', 'conversations', 'drives']);
16
+ export const pickerSourceSchema = z.enum(['commands', 'skills', 'files', 'sessions', 'agents', 'conversations', 'drives', 'plugins']);
17
+ export const pickerSortSchema = z.enum(['name', 'updated']);
13
18
  const pickerSourceSettingsSchema = z.object({
14
19
  enabled: z.boolean(),
15
20
  order: z.number().int().min(0).max(100),
16
21
  limit: z.number().int().min(1).max(50),
17
22
  maxCandidates: z.number().int().min(1).max(50).default(50),
23
+ sort: pickerSortSchema.default('updated'),
24
+ /** Optional extra token for `@token:` scoped searches. */
25
+ shortcut: z.string().regex(/^[^@:\s/]*(,[^@:\s/]+)*$/u).max(32).default(''),
26
+ aliases: z.array(z.string().regex(/^[^@:\s/]+$/u).max(32)).optional(),
27
+ sourceAliases: z.record(z.string(), z.array(z.string().regex(/^[^@:\s/]+$/u).max(32))).optional(),
28
+ });
29
+ export const agentActionsSchema = z.object({
30
+ showImport: z.boolean().default(true),
31
+ showSummary: z.boolean().default(false),
32
+ skipConfirmation: z.boolean().default(false),
18
33
  });
19
34
  export const pickerSettingsSchema = z.object({
20
35
  displayMode: z.enum(['collapse', 'native-scroll']).default('collapse'),
@@ -27,33 +42,43 @@ export const pickerSettingsSchema = z.object({
27
42
  // a saved record that has `picker` but predates this key would fail the whole
28
43
  // parse without it, and the medium — every setting in it — would be rejected.
29
44
  // Any key added here from now on needs the same treatment.
30
- agents: pickerSourceSettingsSchema.default({ enabled: true, order: 25, limit: 6, maxCandidates: 50 }),
45
+ agents: pickerSourceSettingsSchema.extend(agentActionsSchema.shape).default({ showImport: true, showSummary: false, skipConfirmation: false, enabled: true, order: 25, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['agent', 'cc', 'claude-code', 'codex', 'cursor', 'gemini-cli', 'qoder', 'reasonix', 'openclaw', 'hermes', 'pi', 'grokbuild', 'grok-build', 'kimi-cli', 'kimi-code', 'opencode', 'mimocode', 'mimo', 'zcode'] }),
31
46
  conversations: pickerSourceSettingsSchema,
32
47
  // Defaulted for the same reason as `agents` above: it arrived later still.
33
- drives: pickerSourceSettingsSchema.default({ enabled: true, order: 35, limit: 6, maxCandidates: 50 }),
48
+ drives: pickerSourceSettingsSchema.default({ enabled: true, order: 35, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['drive'] }),
49
+ plugins: pickerSourceSettingsSchema.extend({
50
+ onlyLive: z.boolean().default(false),
51
+ showDeepSeek: z.boolean().default(true),
52
+ }).default({ enabled: true, order: 40, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['plugin'], onlyLive: false, showDeepSeek: true }),
34
53
  });
35
54
  export const inputRenderModeSchema = z.enum(['pill', 'raw-text']);
36
55
  /** Defaults used before the user saves the General section. */
37
56
  export function defaultPickerSettings() {
38
57
  return {
39
58
  displayMode: 'collapse',
40
- commands: { enabled: true, order: 0, limit: 6, maxCandidates: 50 },
41
- skills: { enabled: true, order: 5, limit: 6, maxCandidates: 50 },
42
- files: { enabled: true, order: 10, limit: 6, maxCandidates: 50 },
43
- sessions: { enabled: true, order: 20, limit: 6, maxCandidates: 50 },
44
- agents: { enabled: true, order: 25, limit: 6, maxCandidates: 50 },
45
- conversations: { enabled: true, order: 30, limit: 6, maxCandidates: 50 },
46
- drives: { enabled: true, order: 35, limit: 6, maxCandidates: 50 },
59
+ commands: { enabled: true, order: 0, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['command'] },
60
+ skills: { enabled: true, order: 5, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['skill'] },
61
+ files: { enabled: true, order: 10, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['file'] },
62
+ sessions: { enabled: true, order: 20, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['session'] },
63
+ agents: { showImport: true, showSummary: false, skipConfirmation: false, enabled: true, order: 25, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['agent', 'cc', 'claude-code', 'codex', 'cursor', 'gemini-cli', 'qoder', 'reasonix', 'openclaw', 'hermes', 'pi', 'grokbuild', 'grok-build', 'kimi-cli', 'kimi-code', 'opencode', 'mimocode', 'mimo', 'zcode'] },
64
+ conversations: { enabled: true, order: 30, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['chat'] },
65
+ drives: { enabled: true, order: 35, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['drive'] },
66
+ plugins: { enabled: true, order: 40, limit: 6, maxCandidates: 50, sort: 'updated', shortcut: '', aliases: ['plugin'], onlyLive: false, showDeepSeek: true },
47
67
  };
48
68
  }
49
69
  /** Picker settings have a fixed schema, so explicit comparison is cheap and stable. */
50
70
  export function samePickerSettings(left, right) {
51
- if (left.displayMode !== right.displayMode)
71
+ if (left.displayMode !== right.displayMode || left.agents.showImport !== right.agents.showImport || left.agents.showSummary !== right.agents.showSummary || left.agents.skipConfirmation !== right.agents.skipConfirmation)
52
72
  return false;
53
73
  return pickerSourceSchema.options.every(key => left[key].enabled === right[key].enabled &&
54
74
  left[key].order === right[key].order &&
55
75
  left[key].limit === right[key].limit &&
56
- left[key].maxCandidates === right[key].maxCandidates);
76
+ left[key].maxCandidates === right[key].maxCandidates &&
77
+ left[key].sort === right[key].sort &&
78
+ left[key].shortcut === right[key].shortcut &&
79
+ JSON.stringify(left[key].aliases) === JSON.stringify(right[key].aliases) &&
80
+ JSON.stringify(left[key].sourceAliases) === JSON.stringify(right[key].sourceAliases) &&
81
+ (key !== 'plugins' || (left.plugins.onlyLive === right.plugins.onlyLive && left.plugins.showDeepSeek === right.plugins.showDeepSeek)));
57
82
  }
58
83
  export const settingsRecordSchema = z.object({
59
84
  opencliPath: z.string(),
@@ -77,7 +77,7 @@ function assertIdentityResult(result, domain, operation) {
77
77
  return result.identity
78
78
  }
79
79
 
80
- const PROVIDER_READY_TIMEOUT_MS = 1200
80
+ const PROVIDER_READY_TIMEOUT_MS = 10_000
81
81
  const PROVIDER_READY_INITIAL_DELAY_MS = 50
82
82
  const PROVIDER_READY_MAX_DELAY_MS = 400
83
83
 
@@ -264,14 +264,16 @@ export function registerProvider(config) {
264
264
  await navigate(page, config.home, { settleMs: 600 })
265
265
  const expectedScope = parseExpectedAccountScope(kwargs.accountScope)
266
266
  if (expectedScope) {
267
- const identity = await evaluate(page, config.whoamiScript, {}, `${config.site} detail identity`)
267
+ const identity = await evaluateWhenProviderReady(
268
+ page, config.whoamiScript, {}, `${config.site} detail identity`, { accepts: terminalIdentityResult },
269
+ )
268
270
  const stableIdentity = assertIdentityResult(identity, config.domain, `${config.site} detail`)
269
271
  const actualScope = createHash('sha256').update(`${config.provider.toLocaleLowerCase()}\0${stableIdentity}`).digest('hex')
270
272
  if (actualScope !== expectedScope) {
271
273
  throw new CommandExecutionError(`DSH_ACCOUNT_SCOPE_MISMATCH: ${config.site} detail: conversation belongs to a different logged-in account`)
272
274
  }
273
275
  }
274
- let result = await evaluate(page, config.detailScript, { id }, `${config.site} detail`)
276
+ let result = await evaluateWhenProviderReady(page, config.detailScript, { id }, `${config.site} detail`)
275
277
  if (result?.ok !== true && result?.code !== 'AUTH' && result?.code !== 'RATE_LIMIT' && config.fallbackScript) {
276
278
  await navigate(page, config.conversationUrl(id), { settleMs: 1800 })
277
279
  result = await evaluate(page, config.fallbackScript, { id }, `${config.site} detail fallback`)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-chat-history",
3
3
  "version": "0.2.3",
4
- "opencli": ">=1.8.6",
4
+ "opencli": ">=2.0.0",
5
5
  "description": "Full-history read adapters used by dsh-reference-anything"
6
6
  }
@@ -3,6 +3,6 @@
3
3
  "version": "0.2.3",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
- "@jackwener/opencli": ">=1.8.6"
6
+ "@jackwener/opencli": ">=2.0.0"
7
7
  }
8
8
  }