@dsh-workbench/shared 1.1.4 → 1.1.6

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 (81) hide show
  1. package/dist/api/host-write.d.ts +4 -1
  2. package/dist/api/workbench-client.d.ts +2 -0
  3. package/dist/components/ApprovalPlan.css +7 -8
  4. package/dist/config/constants.d.ts +4 -0
  5. package/dist/config/constants.js +4 -0
  6. package/dist/contract/approval.d.ts +4 -0
  7. package/dist/contract/approval.js +4 -0
  8. package/dist/contract/command.d.ts +33 -0
  9. package/dist/contract/command.js +1 -1
  10. package/dist/contract/needs.d.ts +17 -0
  11. package/dist/contract/needs.js +41 -1
  12. package/dist/contract/protocol/bundle-install.d.ts +2 -0
  13. package/dist/contract/protocol/market-index.d.ts +3 -1
  14. package/dist/contract/protocol/market-index.js +2 -0
  15. package/dist/contract/unit.d.ts +10 -0
  16. package/dist/host/adapter-types.d.ts +2 -0
  17. package/dist/host/data-error.d.ts +2 -0
  18. package/dist/host/data-error.js +3 -0
  19. package/dist/host/http.js +1 -0
  20. package/dist/host/install-failure.d.ts +49 -0
  21. package/dist/host/install-failure.js +167 -0
  22. package/dist/host/installed-sources.d.ts +10 -0
  23. package/dist/host/installed-sources.js +64 -0
  24. package/dist/host/lib-install.d.ts +12 -1
  25. package/dist/host/lib-install.js +33 -1
  26. package/dist/host/market-index-claim.d.ts +2 -0
  27. package/dist/host/market-index-claim.js +7 -0
  28. package/dist/host/market-index-doc.d.ts +56 -0
  29. package/dist/host/market-index-doc.js +1 -0
  30. package/dist/host/market-index-parse.d.ts +23 -0
  31. package/dist/host/market-index-parse.js +485 -0
  32. package/dist/host/market-index.d.ts +13 -21
  33. package/dist/host/market-index.js +120 -368
  34. package/dist/host/paths.d.ts +7 -0
  35. package/dist/host/paths.js +17 -0
  36. package/dist/host/runtime-links.d.ts +7 -0
  37. package/dist/host/runtime-links.js +25 -0
  38. package/dist/host/tool-approval.d.ts +4 -2
  39. package/dist/host/tool-approval.js +4 -2
  40. package/dist/host.d.ts +3 -0
  41. package/dist/host.js +3 -0
  42. package/dist/i18n/en.js +50 -4
  43. package/dist/i18n/index.d.ts +51 -5
  44. package/dist/i18n/zh.d.ts +50 -4
  45. package/dist/i18n/zh.js +50 -4
  46. package/dist/index.d.ts +1 -0
  47. package/dist/index.js +1 -0
  48. package/package.json +1 -1
  49. package/src/api/host-write.ts +5 -1
  50. package/src/api/workbench-client.ts +2 -0
  51. package/src/components/ApprovalPlan.css +7 -8
  52. package/src/config/constants.ts +6 -0
  53. package/src/contract/__tests__/needs.test.ts +53 -0
  54. package/src/contract/approval.ts +4 -0
  55. package/src/contract/command.ts +22 -0
  56. package/src/contract/needs.ts +56 -1
  57. package/src/contract/protocol/bundle-install.ts +3 -0
  58. package/src/contract/protocol/market-index.ts +4 -0
  59. package/src/contract/unit.ts +11 -0
  60. package/src/host/__tests__/market-index.test.ts +114 -0
  61. package/src/host/adapter-types.ts +2 -0
  62. package/src/host/data-error.ts +3 -1
  63. package/src/host/http.ts +1 -0
  64. package/src/host/install-failure.test.ts +121 -0
  65. package/src/host/install-failure.ts +198 -0
  66. package/src/host/installed-sources.test.ts +80 -0
  67. package/src/host/installed-sources.ts +73 -0
  68. package/src/host/lib-install.ts +38 -2
  69. package/src/host/market-index-claim.ts +9 -0
  70. package/src/host/market-index-doc.ts +62 -0
  71. package/src/host/market-index-parse.ts +482 -0
  72. package/src/host/market-index.ts +162 -357
  73. package/src/host/paths.test.ts +26 -0
  74. package/src/host/paths.ts +18 -0
  75. package/src/host/runtime-links.test.ts +31 -0
  76. package/src/host/runtime-links.ts +23 -0
  77. package/src/host/tool-approval.ts +11 -4
  78. package/src/host.ts +3 -0
  79. package/src/i18n/en.ts +51 -4
  80. package/src/i18n/zh.ts +51 -4
  81. package/src/index.ts +1 -0
@@ -0,0 +1,23 @@
1
+ import { existsSync, mkdirSync, symlinkSync } from 'node:fs';
2
+ import { dirname } from 'node:path';
3
+ import { OPENCLI_NPM_PACKAGE, libsPrefix, toolchainOpencliDir } from './paths.js';
4
+
5
+ /**
6
+ * 让共用依赖也能 import opencli:把隔离运行时里那份 opencli 链接到 libs 的 node_modules。
7
+ * 跑在 libs 里的命令(比如 opencli-workflow 带的 gitops)会按包名找 @jackwener/opencli,
8
+ * 找不到就起不来 —— 它不在 libs 的依赖里,是运行时提供的那一份。
9
+ * @returns 这次真的建了链接就 `true`;已经有了、或运行时那份还没装,就是 `false`。
10
+ */
11
+ export function ensureLibsOpencliPeer(): boolean {
12
+ const link = `${libsPrefix()}/node_modules/${OPENCLI_NPM_PACKAGE}`;
13
+ if (existsSync(link)) return false;
14
+ const target = toolchainOpencliDir();
15
+ if (!existsSync(target)) return false;
16
+ try {
17
+ mkdirSync(dirname(link), { recursive: true });
18
+ symlinkSync(target, link);
19
+ return true;
20
+ } catch {
21
+ return false;
22
+ }
23
+ }
@@ -1,3 +1,7 @@
1
+ export { APPROVAL_NOTE_ARG } from '../contract/approval.js';
2
+
3
+ import { APPROVAL_NOTE_ARG } from '../contract/approval.js';
4
+
1
5
  export type AskDecision =
2
6
  | {
3
7
  readonly kind: 'ask';
@@ -16,8 +20,6 @@ export interface ApprovalDetail {
16
20
 
17
21
  export type ApprovalFacts = ApprovalDetail | { readonly blocked: string };
18
22
 
19
- export const APPROVAL_NOTE_ARG = 'approval_note';
20
-
21
23
  export const APPROVAL_NOTE_LIMIT = 40;
22
24
 
23
25
  export const APPROVAL_DETAIL_LIMIT = 20;
@@ -77,7 +79,8 @@ export interface ApprovalCall {
77
79
 
78
80
  /**
79
81
  * 套件对一次写调用给出的判定:`read` 只是看看、`allow` 会写但本套件不问、`deny` 这一次根本跑不成
80
- * (连问都不该问,`reason` 原样交给 agent)、`ask` 要用户点头(`question` 接在明细后,`fallback` 是没明细时的整句)。
82
+ * (连问都不该问,`reason` 原样交给 agent)、`ask` 要用户点头(`question` 接在明细后,`fallback` 是没明细时的整句;
83
+ * `noteInDetail` 为真表示套件把 agent 的附注画在自己的详情座里,标题只留动作、不再追加)。
81
84
  */
82
85
  export type ApprovalVerdict =
83
86
  | { readonly kind: 'read' }
@@ -91,6 +94,7 @@ export type ApprovalVerdict =
91
94
  readonly reason: string;
92
95
  readonly question: ApprovalDetail;
93
96
  readonly fallback: ApprovalDetail;
97
+ readonly noteInDetail?: boolean;
94
98
  };
95
99
 
96
100
  export type ApprovalPolicy = (call: ApprovalCall) => ApprovalVerdict | undefined;
@@ -168,9 +172,12 @@ export async function approvalFor(
168
172
 
169
173
  if (context.skipAsk === true) return undefined;
170
174
 
175
+ const note =
176
+ context.declaredNote === true && verdict.noteInDetail !== true ? approvalNoteOf(call) : undefined;
177
+
171
178
  return {
172
179
  kind: 'ask',
173
180
  reason: verdict.reason,
174
- displayReason: compose(facts, verdict, context.declaredNote === true ? approvalNoteOf(call) : undefined),
181
+ displayReason: compose(facts, verdict, note),
175
182
  };
176
183
  }
package/src/host.ts CHANGED
@@ -42,6 +42,8 @@ export * from './host/data-root.js';
42
42
  export * from './host/shell-text.js';
43
43
  export * from './host/shell.js';
44
44
  export * from './host/data-error.js';
45
+ export * from './host/install-failure.js';
46
+ export * from './host/runtime-links.js';
45
47
  export * from './host/provision.js';
46
48
  export * from './host/channel-plugin.js';
47
49
  export * from './host/recipe.js';
@@ -75,3 +77,4 @@ export * from './host/version-range.js';
75
77
  export * from './host/market-index.js';
76
78
  export * from './host/market-index-claim.js';
77
79
  export * from './host/changelog.js';
80
+ export * from './host/installed-sources.js';
package/src/i18n/en.ts CHANGED
@@ -134,11 +134,14 @@ export const en: Record<keyof WorkbenchMessages, string> = {
134
134
  'panels.market.update': 'Update',
135
135
  'panels.market.swapSlow': 'Not swapped yet — maybe a slow or failed download. Press Update again; if it stays like this, restart dsh.',
136
136
  'panels.market.removeSlow': 'Not removed yet — maybe a slow network or an uninstall that did not finish. Check again in a moment; if it stays like this, restart dsh.',
137
- 'panels.market.updateNoChange': 'Update failed: still {from}. The newest on the registry is {latest} — press Update again.',
137
+ 'panels.market.updateNoChange': 'Update did not swap in: still {from}; the registry has {latest}.',
138
138
  'panels.market.updateUnknownVersion': '(unknown)',
139
139
  'panels.market.updateGone': 'Update failed: the module is gone after the update.',
140
140
  'panels.market.updateRestored': 'Update failed: the new version could not be found after the update, so {version} was put back.',
141
- 'panels.market.updateBehind': 'Installed {installed}, but the newest on the registry is {latest} — not the latest; you can update once more.',
141
+ 'panels.market.updateBehind': 'Installed {installed}, but the registry has {latest}.',
142
+ 'panels.market.updateStuck.title': 'Update did not swap in',
143
+ 'panels.market.updateStuck.factNoChange': 'Still {from} on disk; the registry has {latest}.',
144
+ 'panels.market.updateStuck.copiedHint': 'Paste it into a terminal, then restart the workbench once.',
142
145
  'panels.market.selfUpdateFailed': 'Workbench update failed: {reason}',
143
146
  'panels.market.selfUpdateUnknown': 'the outside process left no reason (see ~/.dsh/workbench/self-update.log)',
144
147
  'panels.market.selfUpdateRolledBack': 'Workbench update failed; rolled back to {version}.',
@@ -156,6 +159,41 @@ export const en: Record<keyof WorkbenchMessages, string> = {
156
159
  'panels.market.confirmNo': 'Cancel',
157
160
  'panels.market.noMarketSource': 'The index has no newer version of this module (refresh the index and retry)',
158
161
  'panels.market.failed': 'Failed: {reason}',
162
+ 'panels.market.askAgent': 'Ask the agent',
163
+ 'panels.market.askAgentCopied': 'Copied',
164
+ 'panels.market.askAgentText':
165
+ 'This workbench module cannot be used: "{name}" (unit {unit}) — {reason}. Work out what is missing and how to add it, then confirm it works.',
166
+ 'panels.market.failure.permission': "Didn't install: no write access",
167
+ 'panels.market.failure.diskFull': "Didn't install: the disk is full",
168
+ 'panels.market.failure.sandbox': "Didn't install: the system blocked it",
169
+ 'panels.market.failure.unknown': "Didn't install: cause not recognised",
170
+ 'panels.market.failure.factOwner': '{path} belongs to {owner}, and this account ({me}) cannot write to it. Hand it back to yourself (asks for your login password).',
171
+ 'panels.market.failure.factMode': '{path} is mode {mode}, so this account cannot write to it.',
172
+ 'panels.market.failure.factSpace': 'The disk holding {path} is full.',
173
+ 'panels.market.failure.factStuck': 'This command ran in a restricted environment and cannot write to {path}.',
174
+ 'panels.market.failure.nowhere': '(the directory was not identified)',
175
+ 'panels.market.failure.copyFix': 'Copy the fix command',
176
+ 'panels.market.failure.copied': 'Copied',
177
+ 'panels.market.failure.copiedHint': 'Paste it in a terminal, run it, then click Check again.',
178
+ 'panels.market.failure.askAgent': 'Copy for the agent',
179
+ 'panels.market.failure.askAgentText': 'Installing this module could not write: `{command}` exited {code} at {path}. Work out whether the sandbox or file permissions blocked it, then install again somewhere writable.',
180
+ 'panels.market.failure.askAgentHint': 'Paste it into the chat and let the agent carry on.',
181
+ 'panels.market.failure.recheck': 'Check again',
182
+ 'panels.market.failure.showOutput': 'Show install output',
183
+ 'panels.market.failure.hideOutput': 'Hide install output',
184
+ 'panels.market.failure.term.commandLine': 'command on line {line}',
185
+ 'panels.market.failure.term.signal': 'killed by {signal}',
186
+ 'panels.market.failure.term.exitCode': 'exit code {exitCode}',
187
+ 'panels.market.failure.term.noExitCode': 'no exit code',
188
+ 'panels.market.failure.term.running': 'running',
189
+ 'panels.market.failure.term.failed': 'failed',
190
+ 'panels.market.failure.term.done': 'done',
191
+ 'panels.market.failure.term.copy': 'Copy',
192
+ 'panels.market.failure.term.copied': 'Copied',
193
+ 'panels.market.failure.term.noOutput': 'No output',
194
+ 'panels.market.failure.term.collapse': 'Collapse',
195
+ 'panels.market.failure.term.expandAria': 'Show the remaining {hidden} lines',
196
+ 'panels.market.failure.term.expand': 'Show {hidden} lines',
159
197
  'panels.market.needEnv': 'Set {env} in the terminal that started the workbench first',
160
198
  'panels.market.needCommands': 'Missing commands: {commands}',
161
199
  'panels.market.needBinary': 'Install the {command} command first',
@@ -192,9 +230,13 @@ export const en: Record<keyof WorkbenchMessages, string> = {
192
230
  'panels.market.restartNeeded': 'The new version is installed — restart once to pick it up.',
193
231
  'panels.market.foot': 'After installing, enable it in the panel page of that project.',
194
232
  'panels.market.checkUpdates': 'Check for updates',
233
+ 'panels.market.checkAll': 'Check all updates',
195
234
  'panels.market.checkingNow': 'Checking…',
196
235
  'panels.market.checkFailed': 'The last check failed. Check your connection and retry.',
197
236
  'panels.market.checkedAt': 'Last checked: {time}',
237
+ 'panels.market.latestPartial': 'Could not check {n} modules',
238
+ 'panels.market.latestNoRegistry': 'No source configured — the latest version was not checked',
239
+ 'panels.market.latestProbeFailed': 'Could not reach the source — try again later',
198
240
  'panels.market.justNow': 'just now',
199
241
  'panels.market.minutesAgo': '{n} min ago',
200
242
  'panels.market.hoursAgo': '{n} h ago',
@@ -255,6 +297,8 @@ export const en: Record<keyof WorkbenchMessages, string> = {
255
297
  'panels.market.add.failurePermission': 'No write permission, cannot install',
256
298
  'panels.market.add.failureBuildBlocked': 'A dependency wants to run install scripts; you have to allow it first',
257
299
  'panels.market.add.failureIntegrity': 'The downloaded package failed its integrity check',
300
+ 'panels.market.add.failureStopProfile': 'The old copy is still in use (the workbench has this module loaded), so this dsh version will not overwrite it in place.',
301
+ 'panels.market.add.failureCancelled': 'This run was cancelled and nothing changed.',
258
302
  'panels.market.add.failureTimeout': 'The install timed out',
259
303
  'panels.market.add.failurePnpmMissing': 'pnpm was not found, cannot install',
260
304
  'panels.market.add.failureInstalled':
@@ -339,7 +383,7 @@ export const en: Record<keyof WorkbenchMessages, string> = {
339
383
  'panels.discover.missingIndex': 'This repository has no {path} yet.',
340
384
  'panels.discover.initTitle': 'Initialize this repository as a module market index?',
341
385
  'panels.discover.initCta': 'Initialize market index',
342
- 'panels.discover.initWhat': 'It will write market.json and README.md on {branch}, commit once, and push. Modules you publish from this workbench will commit their build files under packages/<package-name>/. The repository stays owned by its owner.',
386
+ 'panels.discover.initWhat': 'It will write the index directory market/ and README.md on {branch}, commit once, and push. Modules you publish from this workbench will commit their build files under artifacts/<package-name>/<version>/ and their entry under market/<package-name>/<version>.json. The repository stays owned by its owner.',
343
387
  'panels.discover.initBranch': 'Branch',
344
388
  'panels.discover.initBranchHint': 'The index and build files go to this branch; an empty repository gets it created.',
345
389
  'panels.discover.initBranchBad': 'Use only letters, digits, dots, underscores, slashes, or dashes in a branch name.',
@@ -670,6 +714,9 @@ export const en: Record<keyof WorkbenchMessages, string> = {
670
714
  'approval.longTask.what': 'Task to stop',
671
715
  'approval.longTask.signal':
672
716
  'stopping only sends an interrupt signal \u2014 wrapping up the run is up to the module',
717
+ 'approval.plugin.name': 'Plugin',
718
+ 'approval.plugin.command': 'Command',
719
+ 'approval.plugin.note': 'Agent says',
673
720
  'approval.publish.module': 'Module',
674
721
  'approval.publish.target': 'Target',
675
722
  'approval.publish.version': 'Version',
@@ -689,7 +736,7 @@ export const en: Record<keyof WorkbenchMessages, string> = {
689
736
  'approval.publish.artifacts': 'Build files',
690
737
  'approval.publish.index': 'Index',
691
738
  'approval.publish.commits': 'Commits',
692
- 'approval.publish.twoCommits': 'build files + market.json in 2 commits, one push',
739
+ 'approval.publish.twoCommits': 'build files + entry file in 2 commits, one push',
693
740
  'approval.publish.reading': 'Reading…',
694
741
  'approval.publish.changelog': 'Changelog for {version}',
695
742
  'approval.publish.changelogPending': 'This release writes the {version} changelog entry',
package/src/i18n/zh.ts CHANGED
@@ -133,11 +133,14 @@ export const zh = {
133
133
  'panels.market.update': '更新',
134
134
  'panels.market.swapSlow': '还没换上:可能网慢或没装上。再点一次「更新」;一直这样就把 dsh 重启一遍。',
135
135
  'panels.market.removeSlow': '还没卸掉:可能网慢或卸载没走完。等一下再看;一直这样就把 dsh 重启一遍。',
136
- 'panels.market.updateNoChange': '更新失败:还是 {from};源上最新是 {latest},可以再点一次「更新」。',
136
+ 'panels.market.updateNoChange': '更新没换上:还是 {from};源上最新是 {latest}。',
137
137
  'panels.market.updateUnknownVersion': '(问不到)',
138
138
  'panels.market.updateGone': '更新失败:更新后找不到这个模块。',
139
139
  'panels.market.updateRestored': '更新失败:更新后找不到新版本,已把 {version} 装回去。',
140
- 'panels.market.updateBehind': '装上了 {installed},但源上最新是 {latest} —— 没更到最新,可以再点一次。',
140
+ 'panels.market.updateBehind': '装上了 {installed},但源上最新是 {latest}。',
141
+ 'panels.market.updateStuck.title': '更新没换上',
142
+ 'panels.market.updateStuck.factNoChange': '盘上还是 {from};源上最新是 {latest}。',
143
+ 'panels.market.updateStuck.copiedHint': '粘到终端跑一次,跑完重启一次工作台。',
141
144
  'panels.market.selfUpdateFailed': '工作台更新失败:{reason}',
142
145
  'panels.market.selfUpdateUnknown': '外部进程没留下原因(看 ~/.dsh/workbench/self-update.log)',
143
146
  'panels.market.selfUpdateRolledBack': '工作台更新失败,已回滚到 {version}。',
@@ -153,6 +156,41 @@ export const zh = {
153
156
  'panels.market.confirmNo': '取消',
154
157
  'panels.market.noMarketSource': '索引里没有这个模块的新版本(刷新一次索引再试)',
155
158
  'panels.market.failed': '没成功:{reason}',
159
+ 'panels.market.askAgent': '问 agent',
160
+ 'panels.market.askAgentCopied': '已复制',
161
+ 'panels.market.askAgentText':
162
+ '工作台里「{name}」(单元 {unit})用不了:{reason}。帮我查清缺什么、怎么补,补完确认真能用。',
163
+ 'panels.market.failure.permission': '没装上:没有写入权限',
164
+ 'panels.market.failure.diskFull': '没装上:磁盘满了',
165
+ 'panels.market.failure.sandbox': '没装上:被系统拦住了',
166
+ 'panels.market.failure.unknown': '没装上:原因没认出来',
167
+ 'panels.market.failure.factOwner': '{path} 属于 {owner},当前账号({me})写不进去。把它还给自己就行(会要开机密码)。',
168
+ 'panels.market.failure.factMode': '{path} 的权限是 {mode},当前账号没有写权限。',
169
+ 'panels.market.failure.factSpace': '{path} 所在的磁盘满了。',
170
+ 'panels.market.failure.factStuck': '这条命令跑在受限环境里,写不进 {path}。',
171
+ 'panels.market.failure.nowhere': '(没认出是哪个目录)',
172
+ 'panels.market.failure.copyFix': '复制修复命令',
173
+ 'panels.market.failure.copied': '已复制',
174
+ 'panels.market.failure.copiedHint': '粘到终端跑一次,回来点「再检测」。',
175
+ 'panels.market.failure.askAgent': '复制给 agent',
176
+ 'panels.market.failure.askAgentText': '装这个模块时写不进去:`{command}` 退出码 {code},卡在 {path}。帮我看看是被沙箱拦的还是权限问题,换一条能写进去的路再装。',
177
+ 'panels.market.failure.askAgentHint': '粘到对话里,让 agent 接着弄。',
178
+ 'panels.market.failure.recheck': '再检测',
179
+ 'panels.market.failure.showOutput': '查看安装输出',
180
+ 'panels.market.failure.hideOutput': '收起安装输出',
181
+ 'panels.market.failure.term.commandLine': '第 {line} 行的命令',
182
+ 'panels.market.failure.term.signal': '被 {signal} 终止',
183
+ 'panels.market.failure.term.exitCode': '退出码 {exitCode}',
184
+ 'panels.market.failure.term.noExitCode': '没有退出码',
185
+ 'panels.market.failure.term.running': '在跑',
186
+ 'panels.market.failure.term.failed': '没跑通',
187
+ 'panels.market.failure.term.done': '跑完了',
188
+ 'panels.market.failure.term.copy': '复制',
189
+ 'panels.market.failure.term.copied': '已复制',
190
+ 'panels.market.failure.term.noOutput': '没有输出',
191
+ 'panels.market.failure.term.collapse': '收起',
192
+ 'panels.market.failure.term.expandAria': '展开剩下的 {hidden} 行',
193
+ 'panels.market.failure.term.expand': '展开 {hidden} 行',
156
194
  'panels.market.needEnv': '先在启动工作台的终端里设 {env}',
157
195
  'panels.market.needCommands': '缺这几条命令:{commands}',
158
196
  'panels.market.needBinary': '先装 {command} 命令',
@@ -189,9 +227,13 @@ export const zh = {
189
227
  'panels.market.restartNeeded': '新版装好了,重启一次才生效。',
190
228
  'panels.market.foot': '装好后到那个项目的面板页勾选它,模块才会出现。',
191
229
  'panels.market.checkUpdates': '检查更新',
230
+ 'panels.market.checkAll': '检查全部更新',
192
231
  'panels.market.checkingNow': '正在检查…',
193
232
  'panels.market.checkFailed': '最近一次没查到,检查网络后重试',
194
233
  'panels.market.checkedAt': '最近检查:{time}',
234
+ 'panels.market.latestPartial': '{n} 个模块没查成',
235
+ 'panels.market.latestNoRegistry': '没配来源,未检查新版',
236
+ 'panels.market.latestProbeFailed': '问不到源,稍后重试',
195
237
  'panels.market.justNow': '刚刚',
196
238
  'panels.market.minutesAgo': '{n} 分钟前',
197
239
  'panels.market.hoursAgo': '{n} 小时前',
@@ -252,6 +294,8 @@ export const zh = {
252
294
  'panels.market.add.failurePermission': '没有写入权限,无法安装',
253
295
  'panels.market.add.failureBuildBlocked': '有依赖的安装脚本需要你允许后才能继续',
254
296
  'panels.market.add.failureIntegrity': '下载的安装包校验失败',
297
+ 'panels.market.add.failureStopProfile': '旧版还在用着(工作台正加载这个模块),这一版 dsh 不肯就地覆盖。',
298
+ 'panels.market.add.failureCancelled': '这次操作被取消了,什么都没动。',
255
299
  'panels.market.add.failureTimeout': '安装超时',
256
300
  'panels.market.add.failurePnpmMissing': '没有找到 pnpm,无法安装',
257
301
  'panels.market.add.failureInstalled':
@@ -336,7 +380,7 @@ export const zh = {
336
380
  'panels.discover.missingIndex': '仓库里还没有索引文件 {path}',
337
381
  'panels.discover.initTitle': '把这个仓库初始化成模块市场索引?',
338
382
  'panels.discover.initCta': '初始化成市场索引',
339
- 'panels.discover.initWhat': '会在 {branch} 分支写 market.json 与 README.md,提交一次并推上去;之后从这个工作台发布的模块会把打包好的文件提交到按包名分的 packages/<包名>/。仓库的写权限归它的所有者。',
383
+ 'panels.discover.initWhat': '会在 {branch} 分支写索引目录 market/ 与 README.md,提交一次并推上去;之后从这个工作台发布的模块会把打包好的文件提交到 artifacts/<包名>/<版本>/,条目写到 market/<包名>/<版本>.json。仓库的写权限归它的所有者。',
340
384
  'panels.discover.initBranch': '分支',
341
385
  'panels.discover.initBranchHint': '索引和打包文件都发到这个分支;空仓库会新建它。',
342
386
  'panels.discover.initBranchBad': '分支名只能用字母、数字、点、下划线、斜杠或短横线',
@@ -665,6 +709,9 @@ export const zh = {
665
709
  'approval.record.noSwitch': '录完不会替你切回来(左栏底部会亮一条状态)',
666
710
  'approval.longTask.what': '要停的那次任务',
667
711
  'approval.longTask.signal': '停了只是让工作台发出中断信号 —— 这次任务怎么收尾由模块自己负责',
712
+ 'approval.plugin.name': '插件',
713
+ 'approval.plugin.command': '命令',
714
+ 'approval.plugin.note': 'agent 说',
668
715
  'approval.publish.module': '模块',
669
716
  'approval.publish.target': '目标',
670
717
  'approval.publish.version': '版本',
@@ -684,7 +731,7 @@ export const zh = {
684
731
  'approval.publish.artifacts': '打包文件',
685
732
  'approval.publish.index': '索引',
686
733
  'approval.publish.commits': '提交',
687
- 'approval.publish.twoCommits': '打包文件 + market.json 两次提交,一次推送',
734
+ 'approval.publish.twoCommits': '打包文件 + 条目文件两次提交,一次推送',
688
735
  'approval.publish.reading': '读取中…',
689
736
  'approval.publish.changelog': '{version} 的更新日志',
690
737
  'approval.publish.changelogPending': '{version} 这一版会写进更新日志,随包发布',
package/src/index.ts CHANGED
@@ -35,6 +35,7 @@ export * from './components/board-module.js';
35
35
  export * from './components/icons.js';
36
36
  export * from './config/constants.js';
37
37
  export * from './config/storage.js';
38
+ export * from './contract/approval.js';
38
39
  export * from './contract/blocker.js';
39
40
  export * from './contract/data.js';
40
41
  export * from './contract/extension.js';