@ai-workbench/remote-agent 0.8.5 → 0.8.11

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 (190) hide show
  1. package/README.md +49 -8
  2. package/dist/acp.d.ts +22 -2
  3. package/dist/acp.js +143 -25
  4. package/dist/approval-label.d.ts +1 -1
  5. package/dist/approval-label.js +15 -3
  6. package/dist/broker-runtime.js +40 -8
  7. package/dist/broker.js +5 -1
  8. package/dist/claude-local.d.ts +37 -0
  9. package/dist/claude-local.js +207 -0
  10. package/dist/client.js +71 -2
  11. package/dist/conversation-details.d.ts +0 -1
  12. package/dist/conversation-details.js +37 -7
  13. package/dist/employee-endpoint.d.ts +91 -0
  14. package/dist/employee-endpoint.js +141 -0
  15. package/dist/employee-exec.d.ts +53 -0
  16. package/dist/employee-exec.js +423 -0
  17. package/dist/employee-location.d.ts +66 -0
  18. package/dist/employee-location.js +51 -0
  19. package/dist/employee-mcp.d.ts +42 -0
  20. package/dist/employee-mcp.js +181 -0
  21. package/dist/employee-native.d.ts +18 -0
  22. package/dist/employee-native.js +38 -0
  23. package/dist/employee-provider.d.ts +42 -0
  24. package/dist/employee-provider.js +326 -0
  25. package/dist/employee-relay.d.ts +18 -0
  26. package/dist/employee-relay.js +49 -0
  27. package/dist/employee-shell.d.ts +26 -0
  28. package/dist/employee-shell.js +89 -0
  29. package/dist/employee-ssh.d.ts +22 -0
  30. package/dist/employee-ssh.js +123 -0
  31. package/dist/employee-tools.d.ts +117 -0
  32. package/dist/employee-tools.js +292 -0
  33. package/dist/employee-workspace.d.ts +26 -0
  34. package/dist/employee-workspace.js +61 -0
  35. package/dist/index.d.ts +6 -0
  36. package/dist/index.js +235 -41
  37. package/dist/input.d.ts +11 -0
  38. package/dist/input.js +61 -23
  39. package/dist/local-user-turn.d.ts +24 -0
  40. package/dist/local-user-turn.js +103 -0
  41. package/dist/model-catalog.d.ts +18 -2
  42. package/dist/model-catalog.js +101 -36
  43. package/dist/model-defaults.d.ts +29 -0
  44. package/dist/model-defaults.js +62 -0
  45. package/dist/model-input-retention.d.ts +16 -0
  46. package/dist/model-input-retention.js +129 -0
  47. package/dist/presentation.d.ts +1 -1
  48. package/dist/presentation.js +52 -2
  49. package/dist/provider.d.ts +39 -2
  50. package/dist/provider.js +69 -13
  51. package/dist/readiness.js +1 -1
  52. package/dist/recovery.d.ts +14 -1
  53. package/dist/recovery.js +11 -2
  54. package/dist/remote-details.d.ts +7 -0
  55. package/dist/remote-details.js +11 -1
  56. package/dist/workspace-source-confirmation.d.ts +4 -0
  57. package/dist/workspace-source-confirmation.js +12 -0
  58. package/dist/workspace-source.d.ts +25 -0
  59. package/dist/workspace-source.js +136 -0
  60. package/helpers/ripgrep/LICENSE-vscode +13 -0
  61. package/helpers/ripgrep/PROVENANCE.md +9 -0
  62. package/helpers/ripgrep/darwin-arm64/rg +0 -0
  63. package/helpers/ripgrep/darwin-x64/rg +0 -0
  64. package/helpers/ripgrep/manifest.json +56 -0
  65. package/helpers/ripgrep/notices/COPYING-ripgrep +3 -0
  66. package/helpers/ripgrep/notices/DEPENDENCIES.json +946 -0
  67. package/helpers/ripgrep/notices/LICENCE-PCRE2.md +103 -0
  68. package/helpers/ripgrep/notices/LICENSE-MIT-ripgrep +21 -0
  69. package/helpers/ripgrep/notices/UNLICENSE-ripgrep +24 -0
  70. package/helpers/ripgrep/notices/aho-corasick-1.1.3/COPYING +3 -0
  71. package/helpers/ripgrep/notices/aho-corasick-1.1.3/LICENSE-MIT +21 -0
  72. package/helpers/ripgrep/notices/aho-corasick-1.1.3/UNLICENSE +24 -0
  73. package/helpers/ripgrep/notices/anyhow-1.0.100/LICENSE-APACHE +176 -0
  74. package/helpers/ripgrep/notices/anyhow-1.0.100/LICENSE-MIT +23 -0
  75. package/helpers/ripgrep/notices/arbitrary-1.4.2/LICENSE-APACHE +201 -0
  76. package/helpers/ripgrep/notices/arbitrary-1.4.2/LICENSE-MIT +27 -0
  77. package/helpers/ripgrep/notices/bstr-1.12.0/COPYING +8 -0
  78. package/helpers/ripgrep/notices/bstr-1.12.0/LICENSE-APACHE +201 -0
  79. package/helpers/ripgrep/notices/bstr-1.12.0/LICENSE-MIT +21 -0
  80. package/helpers/ripgrep/notices/cc-1.2.41/LICENSE-APACHE +201 -0
  81. package/helpers/ripgrep/notices/cc-1.2.41/LICENSE-MIT +25 -0
  82. package/helpers/ripgrep/notices/cfg-if-1.0.4/LICENSE-APACHE +201 -0
  83. package/helpers/ripgrep/notices/cfg-if-1.0.4/LICENSE-MIT +25 -0
  84. package/helpers/ripgrep/notices/crossbeam-channel-0.5.15/LICENSE-APACHE +201 -0
  85. package/helpers/ripgrep/notices/crossbeam-channel-0.5.15/LICENSE-MIT +27 -0
  86. package/helpers/ripgrep/notices/crossbeam-channel-0.5.15/LICENSE-THIRD-PARTY +593 -0
  87. package/helpers/ripgrep/notices/crossbeam-deque-0.8.6/LICENSE-APACHE +201 -0
  88. package/helpers/ripgrep/notices/crossbeam-deque-0.8.6/LICENSE-MIT +27 -0
  89. package/helpers/ripgrep/notices/crossbeam-epoch-0.9.18/LICENSE-APACHE +201 -0
  90. package/helpers/ripgrep/notices/crossbeam-epoch-0.9.18/LICENSE-MIT +27 -0
  91. package/helpers/ripgrep/notices/crossbeam-utils-0.8.21/LICENSE-APACHE +201 -0
  92. package/helpers/ripgrep/notices/crossbeam-utils-0.8.21/LICENSE-MIT +27 -0
  93. package/helpers/ripgrep/notices/derive_arbitrary-1.4.2/LICENSE-APACHE +201 -0
  94. package/helpers/ripgrep/notices/derive_arbitrary-1.4.2/LICENSE-MIT +27 -0
  95. package/helpers/ripgrep/notices/encoding_rs-0.8.35/COPYRIGHT +17 -0
  96. package/helpers/ripgrep/notices/encoding_rs-0.8.35/LICENSE-APACHE +202 -0
  97. package/helpers/ripgrep/notices/encoding_rs-0.8.35/LICENSE-MIT +25 -0
  98. package/helpers/ripgrep/notices/encoding_rs-0.8.35/LICENSE-WHATWG +26 -0
  99. package/helpers/ripgrep/notices/encoding_rs_io-0.1.7/COPYING +8 -0
  100. package/helpers/ripgrep/notices/encoding_rs_io-0.1.7/LICENSE-APACHE +201 -0
  101. package/helpers/ripgrep/notices/encoding_rs_io-0.1.7/LICENSE-MIT +21 -0
  102. package/helpers/ripgrep/notices/find-msvc-tools-0.1.4/LICENSE-APACHE +201 -0
  103. package/helpers/ripgrep/notices/find-msvc-tools-0.1.4/LICENSE-MIT +25 -0
  104. package/helpers/ripgrep/notices/getrandom-0.3.4/LICENSE-APACHE +201 -0
  105. package/helpers/ripgrep/notices/getrandom-0.3.4/LICENSE-MIT +26 -0
  106. package/helpers/ripgrep/notices/glob-0.3.3/LICENSE-APACHE +201 -0
  107. package/helpers/ripgrep/notices/glob-0.3.3/LICENSE-MIT +25 -0
  108. package/helpers/ripgrep/notices/itoa-1.0.15/LICENSE-APACHE +176 -0
  109. package/helpers/ripgrep/notices/itoa-1.0.15/LICENSE-MIT +23 -0
  110. package/helpers/ripgrep/notices/jobserver-0.1.34/LICENSE-APACHE +201 -0
  111. package/helpers/ripgrep/notices/jobserver-0.1.34/LICENSE-MIT +25 -0
  112. package/helpers/ripgrep/notices/lexopt-0.3.1/LICENSE +19 -0
  113. package/helpers/ripgrep/notices/libc-0.2.177/LICENSE-APACHE +176 -0
  114. package/helpers/ripgrep/notices/libc-0.2.177/LICENSE-MIT +25 -0
  115. package/helpers/ripgrep/notices/log-0.4.28/LICENSE-APACHE +201 -0
  116. package/helpers/ripgrep/notices/log-0.4.28/LICENSE-MIT +25 -0
  117. package/helpers/ripgrep/notices/memchr-2.7.6/COPYING +3 -0
  118. package/helpers/ripgrep/notices/memchr-2.7.6/LICENSE-MIT +21 -0
  119. package/helpers/ripgrep/notices/memchr-2.7.6/UNLICENSE +24 -0
  120. package/helpers/ripgrep/notices/memmap2-0.9.8/LICENSE-APACHE +201 -0
  121. package/helpers/ripgrep/notices/memmap2-0.9.8/LICENSE-MIT +26 -0
  122. package/helpers/ripgrep/notices/msvc_spectre_libs-0.1.3/LICENSE +21 -0
  123. package/helpers/ripgrep/notices/pcre2-0.2.11/COPYING +3 -0
  124. package/helpers/ripgrep/notices/pcre2-0.2.11/LICENSE-MIT +21 -0
  125. package/helpers/ripgrep/notices/pcre2-0.2.11/UNLICENSE +24 -0
  126. package/helpers/ripgrep/notices/pcre2-sys-0.2.10/COPYING +3 -0
  127. package/helpers/ripgrep/notices/pcre2-sys-0.2.10/LICENSE-MIT +21 -0
  128. package/helpers/ripgrep/notices/pcre2-sys-0.2.10/UNLICENSE +24 -0
  129. package/helpers/ripgrep/notices/pkg-config-0.3.32/LICENSE-APACHE +201 -0
  130. package/helpers/ripgrep/notices/pkg-config-0.3.32/LICENSE-MIT +25 -0
  131. package/helpers/ripgrep/notices/proc-macro2-1.0.101/LICENSE-APACHE +176 -0
  132. package/helpers/ripgrep/notices/proc-macro2-1.0.101/LICENSE-MIT +23 -0
  133. package/helpers/ripgrep/notices/quote-1.0.41/LICENSE-APACHE +176 -0
  134. package/helpers/ripgrep/notices/quote-1.0.41/LICENSE-MIT +23 -0
  135. package/helpers/ripgrep/notices/r-efi-5.3.0/AUTHORS +74 -0
  136. package/helpers/ripgrep/notices/regex-1.12.2/LICENSE-APACHE +201 -0
  137. package/helpers/ripgrep/notices/regex-1.12.2/LICENSE-MIT +25 -0
  138. package/helpers/ripgrep/notices/regex-automata-0.4.13/LICENSE-APACHE +201 -0
  139. package/helpers/ripgrep/notices/regex-automata-0.4.13/LICENSE-MIT +25 -0
  140. package/helpers/ripgrep/notices/regex-syntax-0.8.8/LICENSE-APACHE +201 -0
  141. package/helpers/ripgrep/notices/regex-syntax-0.8.8/LICENSE-MIT +25 -0
  142. package/helpers/ripgrep/notices/regex-syntax-0.8.8/src/unicode_tables/LICENSE-UNICODE +57 -0
  143. package/helpers/ripgrep/notices/ryu-1.0.20/LICENSE-APACHE +176 -0
  144. package/helpers/ripgrep/notices/ryu-1.0.20/LICENSE-BOOST +23 -0
  145. package/helpers/ripgrep/notices/same-file-1.0.6/COPYING +3 -0
  146. package/helpers/ripgrep/notices/same-file-1.0.6/LICENSE-MIT +21 -0
  147. package/helpers/ripgrep/notices/same-file-1.0.6/UNLICENSE +24 -0
  148. package/helpers/ripgrep/notices/serde-1.0.228/LICENSE-APACHE +176 -0
  149. package/helpers/ripgrep/notices/serde-1.0.228/LICENSE-MIT +23 -0
  150. package/helpers/ripgrep/notices/serde_core-1.0.228/LICENSE-APACHE +176 -0
  151. package/helpers/ripgrep/notices/serde_core-1.0.228/LICENSE-MIT +23 -0
  152. package/helpers/ripgrep/notices/serde_derive-1.0.228/LICENSE-APACHE +176 -0
  153. package/helpers/ripgrep/notices/serde_derive-1.0.228/LICENSE-MIT +23 -0
  154. package/helpers/ripgrep/notices/serde_json-1.0.145/LICENSE-APACHE +176 -0
  155. package/helpers/ripgrep/notices/serde_json-1.0.145/LICENSE-MIT +23 -0
  156. package/helpers/ripgrep/notices/shlex-1.3.0/LICENSE-APACHE +13 -0
  157. package/helpers/ripgrep/notices/shlex-1.3.0/LICENSE-MIT +21 -0
  158. package/helpers/ripgrep/notices/syn-2.0.106/LICENSE-APACHE +176 -0
  159. package/helpers/ripgrep/notices/syn-2.0.106/LICENSE-MIT +23 -0
  160. package/helpers/ripgrep/notices/termcolor-1.4.1/COPYING +3 -0
  161. package/helpers/ripgrep/notices/termcolor-1.4.1/LICENSE-MIT +21 -0
  162. package/helpers/ripgrep/notices/termcolor-1.4.1/UNLICENSE +24 -0
  163. package/helpers/ripgrep/notices/textwrap-0.16.2/LICENSE +21 -0
  164. package/helpers/ripgrep/notices/tikv-jemalloc-sys-0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7/LICENSE-APACHE +201 -0
  165. package/helpers/ripgrep/notices/tikv-jemalloc-sys-0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7/LICENSE-MIT +25 -0
  166. package/helpers/ripgrep/notices/tikv-jemalloc-sys-0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc/COPYING +27 -0
  167. package/helpers/ripgrep/notices/tikv-jemallocator-0.6.0/LICENSE-APACHE +201 -0
  168. package/helpers/ripgrep/notices/tikv-jemallocator-0.6.0/LICENSE-MIT +25 -0
  169. package/helpers/ripgrep/notices/unicode-ident-1.0.19/LICENSE-APACHE +176 -0
  170. package/helpers/ripgrep/notices/unicode-ident-1.0.19/LICENSE-MIT +23 -0
  171. package/helpers/ripgrep/notices/unicode-ident-1.0.19/LICENSE-UNICODE +39 -0
  172. package/helpers/ripgrep/notices/walkdir-2.5.0/COPYING +3 -0
  173. package/helpers/ripgrep/notices/walkdir-2.5.0/LICENSE-MIT +21 -0
  174. package/helpers/ripgrep/notices/walkdir-2.5.0/UNLICENSE +24 -0
  175. package/helpers/ripgrep/notices/wasip2-1.0.1+wasi-0.2.4/LICENSE-APACHE +201 -0
  176. package/helpers/ripgrep/notices/wasip2-1.0.1+wasi-0.2.4/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  177. package/helpers/ripgrep/notices/wasip2-1.0.1+wasi-0.2.4/LICENSE-MIT +23 -0
  178. package/helpers/ripgrep/notices/winapi-util-0.1.11/COPYING +3 -0
  179. package/helpers/ripgrep/notices/winapi-util-0.1.11/LICENSE-MIT +21 -0
  180. package/helpers/ripgrep/notices/winapi-util-0.1.11/UNLICENSE +24 -0
  181. package/helpers/ripgrep/notices/windows-link-0.2.1/license-apache-2.0 +201 -0
  182. package/helpers/ripgrep/notices/windows-link-0.2.1/license-mit +21 -0
  183. package/helpers/ripgrep/notices/windows-sys-0.61.2/license-apache-2.0 +201 -0
  184. package/helpers/ripgrep/notices/windows-sys-0.61.2/license-mit +21 -0
  185. package/helpers/ripgrep/notices/wit-bindgen-0.46.0/LICENSE-APACHE +201 -0
  186. package/helpers/ripgrep/notices/wit-bindgen-0.46.0/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  187. package/helpers/ripgrep/notices/wit-bindgen-0.46.0/LICENSE-MIT +23 -0
  188. package/locale/en.json +1 -1
  189. package/locale/zh.json +2 -2
  190. package/package.json +29 -11
@@ -0,0 +1,136 @@
1
+ import { isDeepStrictEqual } from 'node:util';
2
+ import { sanitizeDisplayLabel } from "./conversation-details.js";
3
+ import { NeedError } from "./remote.js";
4
+ const fail = (code) => new NeedError(code, '工作区来源尚未确认,本轮未执行;你的原话仍保留。', '当前工作区来源及原始员工输入');
5
+ const codeOf = (value) => value instanceof NeedError ? value.code : 'WORKSPACE_SOURCE_CONFIRMATION_FAILED';
6
+ const diagnosticFailure = (error, diagnostic) => Object.assign(new NeedError('CONVERSATION_DETAILS_FAILED', '工作区来源诊断未能保存,本轮已停止;原话保留。', '原错误代码 ' + codeOf(error) + ';诊断错误代码 ' + codeOf(diagnostic)), { cause: new AggregateError([error, diagnostic], 'WORKSPACE_SOURCE_AND_DIAGNOSTIC_FAILED') });
7
+ /** Explicit human source transition only. No source selection is inferred from a folder path. */
8
+ export async function confirmLegacyWorkspaceSource(get, api, request, hooks) {
9
+ let initialContext = { workspaceId: null, bindingId: null, source: null, status: null };
10
+ let diagnosticAttempted = false;
11
+ try {
12
+ request.signal?.throwIfAborted();
13
+ if (api.getContractInfo?.().workspaceLocations !== 1 || typeof api.getWorkspaceLocationState !== 'function')
14
+ return;
15
+ if (!api.getWorkspaceLocationState().items.some(item => item.source === 'legacy-host' && item.status === 'legacy-confirmation-required'))
16
+ return;
17
+ const workspace = { ...await hooks.workspace(request) };
18
+ request.signal?.throwIfAborted();
19
+ const snapshot = api.getWorkspaceLocationState(), rows = snapshot.items.filter(item => item.workspaceId === workspace.id), row = rows[0];
20
+ if (rows.length !== 1 || row?.status !== 'legacy-confirmation-required' || row.source !== 'legacy-host')
21
+ return;
22
+ const frozen = structuredClone(row);
23
+ initialContext = { workspaceId: frozen.workspaceId, bindingId: frozen.bindingId, source: frozen.source, status: frozen.status };
24
+ const connection = api.getConnectionState(), turn = { ...hooks.currentUserTurn(request) };
25
+ const name = sanitizeDisplayLabel(row.workspaceName).replace(/[\u0000-\u001f\u007f\u202a-\u202e\u2066-\u2069]/g, '').trim();
26
+ if (!name || name.includes('[已脱敏:'))
27
+ throw fail('WORKSPACE_SOURCE_CONFIRMATION_UNAVAILABLE');
28
+ const question = '这个工作区以前用的是主机上的文件夹。要改用本机的『' + name + '』文件夹吗?';
29
+ const record = (code, outcome, current = frozen, stage = 'source-confirmation') => hooks.record(request, { kind: 'need', severity: outcome === 'confirmed' ? 'info' : 'action-required', code, summary: outcome === 'confirmation-required' ? question : outcome === 'confirmed' ? '已确认改用本机文件夹,继续处理本轮原始请求。' : '本轮工作区来源确认未完成;原始请求保留,未执行。', payload: { phase: 'workspace-source-admission', stage, workspaceId: workspace.id, bindingId: current.bindingId, source: current.source, status: current.status, outcome } });
30
+ // Persistence precedes the question; a failed diagnostic is not retried in this path.
31
+ diagnosticAttempted = true;
32
+ await record('WORKSPACE_SOURCE_CONFIRMATION_REQUIRED', 'confirmation-required');
33
+ let terminalDiagnostic = false;
34
+ async function stable(requireOldSource) {
35
+ request.signal?.throwIfAborted();
36
+ if (get() !== api || api.getContractInfo?.().workspaceLocations !== 1 || typeof api.getWorkspaceLocationState !== 'function')
37
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
38
+ const now = api.getConnectionState(), location = api.getWorkspaceLocationState();
39
+ if (now.phase !== 'connected' || connection.phase !== 'connected' || now.instanceId !== connection.instanceId || now.epoch !== connection.epoch || location.phase !== 'ready' || location.instanceId !== connection.instanceId || location.epoch !== connection.epoch || snapshot.phase !== 'ready' || snapshot.instanceId !== connection.instanceId || snapshot.epoch !== connection.epoch)
40
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
41
+ const currentWorkspace = await hooks.workspace(request);
42
+ request.signal?.throwIfAborted();
43
+ if (!isDeepStrictEqual(currentWorkspace, workspace))
44
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
45
+ if (!isDeepStrictEqual(hooks.currentUserTurn(request), turn))
46
+ throw fail('LOCAL_USER_TURN_CHANGED');
47
+ // Re-read after awaits. Only the explicit successful L selection may replace the frozen binding.
48
+ if (get() !== api)
49
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
50
+ const after = api.getConnectionState(), state = api.getWorkspaceLocationState();
51
+ if (after.phase !== 'connected' || after.instanceId !== connection.instanceId || after.epoch !== connection.epoch || state.phase !== 'ready' || state.instanceId !== connection.instanceId || state.epoch !== connection.epoch)
52
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
53
+ const current = state.items.filter(item => item.workspaceId === workspace.id);
54
+ if (current.length !== 1 || current[0].localPath !== workspace.path || requireOldSource && (current[0].bindingId !== frozen.bindingId || current[0].source !== frozen.source || current[0].status !== frozen.status))
55
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
56
+ return current[0];
57
+ }
58
+ try {
59
+ await stable(true);
60
+ if (typeof api.selectWorkspaceLocation !== 'function')
61
+ throw fail('DEPENDENCY_REQUIRED');
62
+ const decision = await hooks.confirm({ question, action: '改用本机文件夹' }, request);
63
+ request.signal?.throwIfAborted();
64
+ if (decision !== 'allowed-once') {
65
+ const code = decision === 'rejected' ? 'WORKSPACE_SOURCE_CONFIRMATION_DECLINED' : decision === 'cancelled' ? 'ABORTED' : 'WORKSPACE_SOURCE_CONFIRMATION_UNAVAILABLE';
66
+ terminalDiagnostic = true;
67
+ await record(code, decision === 'rejected' ? 'declined' : decision === 'cancelled' ? 'cancelled' : 'failed');
68
+ throw fail(code);
69
+ }
70
+ await stable(true);
71
+ // The await continuation itself is a boundary: already-observed cancellation,
72
+ // replacement input or source withdrawal must not start the L mutation.
73
+ request.signal?.throwIfAborted();
74
+ if (get() !== api || typeof api.getWorkspaceLocationState !== 'function')
75
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
76
+ const atChoice = api.getConnectionState(), choiceState = api.getWorkspaceLocationState(), choiceRows = choiceState.items.filter(item => item.workspaceId === workspace.id);
77
+ if (atChoice.phase !== 'connected' || atChoice.instanceId !== connection.instanceId || atChoice.epoch !== connection.epoch || choiceState.phase !== 'ready' || choiceState.instanceId !== connection.instanceId || choiceState.epoch !== connection.epoch || choiceRows.length !== 1 || choiceRows[0].bindingId !== frozen.bindingId || choiceRows[0].source !== frozen.source || choiceRows[0].status !== frozen.status || choiceRows[0].localPath !== workspace.path)
78
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
79
+ if (!isDeepStrictEqual(hooks.currentUserTurn(request), turn))
80
+ throw fail('LOCAL_USER_TURN_CHANGED');
81
+ const selected = await api.selectWorkspaceLocation({ instanceId: connection.instanceId, epoch: connection.epoch, workspaceId: workspace.id, expectedBindingId: frozen.bindingId, source: 'local' });
82
+ request.signal?.throwIfAborted();
83
+ if (!selected.ok)
84
+ throw new NeedError(selected.error.code, selected.error.message, selected.error.requires);
85
+ const current = await stable(false), value = selected.value, returned = value.items.filter(item => item.workspaceId === workspace.id);
86
+ if (value.phase !== 'ready' || value.instanceId !== connection.instanceId || value.epoch !== connection.epoch || returned.length !== 1 || returned[0].source !== 'local' || returned[0].status !== 'selected' || !returned[0].bindingId || returned[0].bindingId === frozen.bindingId || returned[0].localPath !== workspace.path || current.source !== 'local' || current.status !== 'selected' || current.bindingId !== returned[0].bindingId)
87
+ throw fail('WORKSPACE_SOURCE_SELECTION_UNCONFIRMED');
88
+ const selectedBinding = returned[0].bindingId;
89
+ const assertSelected = () => {
90
+ request.signal?.throwIfAborted();
91
+ if (get() !== api || typeof api.getWorkspaceLocationState !== 'function')
92
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
93
+ const c = api.getConnectionState(), s = api.getWorkspaceLocationState(), items = s.items.filter(item => item.workspaceId === workspace.id);
94
+ if (c.phase !== 'connected' || c.instanceId !== connection.instanceId || c.epoch !== connection.epoch || s.phase !== 'ready' || s.instanceId !== connection.instanceId || s.epoch !== connection.epoch || items.length !== 1 || items[0].source !== 'local' || items[0].status !== 'selected' || items[0].bindingId !== selectedBinding || items[0].localPath !== workspace.path)
95
+ throw fail('EMPLOYEE_CONTEXT_CHANGED');
96
+ if (!isDeepStrictEqual(hooks.currentUserTurn(request), turn))
97
+ throw fail('LOCAL_USER_TURN_CHANGED');
98
+ };
99
+ terminalDiagnostic = true;
100
+ await record('WORKSPACE_SOURCE_CONFIRMED', 'confirmed', current);
101
+ terminalDiagnostic = false;
102
+ await stable(false);
103
+ assertSelected();
104
+ return { assertCurrent: assertSelected, async recordFailure(error, stage) {
105
+ try {
106
+ await record(request.signal?.aborted ? 'ABORTED' : codeOf(error), request.signal?.aborted ? 'cancelled' : 'failed', current, stage);
107
+ }
108
+ catch (diagnostic) {
109
+ throw diagnosticFailure(error, diagnostic);
110
+ }
111
+ } };
112
+ }
113
+ catch (error) {
114
+ if (!terminalDiagnostic) {
115
+ try {
116
+ await record(request.signal?.aborted ? 'ABORTED' : codeOf(error), request.signal?.aborted ? 'cancelled' : 'failed');
117
+ }
118
+ catch (diagnostic) {
119
+ throw diagnosticFailure(error, diagnostic);
120
+ }
121
+ }
122
+ throw error;
123
+ }
124
+ }
125
+ catch (error) {
126
+ if (!diagnosticAttempted) {
127
+ try {
128
+ await hooks.record(request, { kind: 'need', severity: 'action-required', code: request.signal?.aborted ? 'ABORTED' : codeOf(error), summary: '无法核对本轮工作区来源,已停止;原话保留。', payload: { phase: 'workspace-source-admission', stage: 'source-context', ...initialContext, outcome: request.signal?.aborted ? 'cancelled' : 'failed' } });
129
+ }
130
+ catch (diagnostic) {
131
+ throw diagnosticFailure(error, diagnostic);
132
+ }
133
+ }
134
+ throw error;
135
+ }
136
+ }
@@ -0,0 +1,13 @@
1
+ vscode-ripgrep
2
+
3
+ Copyright (c) Microsoft Corporation
4
+
5
+ All rights reserved.
6
+
7
+ MIT License
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,9 @@
1
+ # Bundled Mac search component
2
+
3
+ Original unmodified binaries from Microsoft @vscode/ripgrep-universal 1.18.0. The npm integrity/SHA256, per-file SHA/bytes and upstream release archives are in manifest.json. Both npm binaries were compared byte for byte with the pinned Microsoft release assets (v15.0.1). No employee download/install hook or PATH lookup.
4
+
5
+ Microsoft packaging tag v1.18.0 commit d22dec46c67fc8c5d307c9b18dba2792efd1f016 locks ripgrep-prebuilt v15.0.1 commit 67202aaafb17aecd9b5b7046d5b7baa92b05237a. Its config pins upstream ripgrep15.0.0 plus the retained Microsoft patch (Windows/ARM-musl adjustments); reported binaries are ripgrep15.0.0 with PCRE2 10.45. Upstream source: https://github.com/BurntSushi/ripgrep/tree/15.0.0 ; vendor source/config: https://github.com/microsoft/ripgrep-prebuilt/tree/v15.0.1 ; npm wrapper: https://github.com/microsoft/vscode-ripgrep/tree/v1.18.0 . Source-input hashes are retained in manifest.json. This is vendor artifact provenance, not a local reproducible build attestation; exact vendor compiler invocation/runtime std build was not independently attested.
6
+
7
+ LICENSE-vscode retains Microsoft packaging MIT text. notices/ contains ripgrep MIT/Unlicense/COPYING, PCRE2 licence, and a conservative full upstream Cargo.lock dependency superset plus Microsoft's Windows-only msvc_spectre_libs. Every crate archive matches its Cargo checksum; DEPENDENCIES.json identifies original package, version, licence and retained texts. r-efi licence is embedded in AUTHORS. wasip2 texts omitted from its crate were retrieved at its .cargo_vcs_info.json exact source commit. Superset inclusion is not a claim all non-Mac/build/test crates are linked into these Mac binaries. prepare-ripgrep-notices.py regenerates notices from the retained pinned inputs.
8
+
9
+ Runtime validates shipped rg size/SHA256, executable regular file, macOS arm64/x64 only. No strip/sign/byte alteration by X. Arm64 actual PCRE2 operation is fixture-tested; x64 is byte/inventory verified, not executed on this arm64 Mac. macOS SDK/system libraries are supplied by the OS; binaries have no Homebrew dylib dependency. The plugin message/output bound uses named acpMaxMessageBytes. Other platforms fail explicitly rather than host fallback.
Binary file
Binary file
@@ -0,0 +1,56 @@
1
+ {
2
+ "npm": "@vscode/ripgrep-universal@1.18.0",
3
+ "source": "https://registry.npmjs.org/@vscode/ripgrep-universal/-/ripgrep-universal-1.18.0.tgz",
4
+ "archiveSha256": "76a03f429dc13a90f53b60995211a54308ab4f67b2521bac00f9c4be953dff52",
5
+ "integrity": "sha512-kgrAVy1L/v/8erAjo+I720ifTf7o4rvYUwgsuEu97XAEBtPT9sk3HhcSgFpxMydvNmwdJtXo9/AVee7JjocTrg==",
6
+ "files": {
7
+ "darwin-arm64": {
8
+ "bytes": 4528512,
9
+ "sha256": "6ef40346bf31fcce79d9614c7745c198542925a0c7d4911e1ffe794c53392ac1"
10
+ },
11
+ "darwin-x64": {
12
+ "bytes": 4742676,
13
+ "sha256": "f999495980a5e6f1e7d26461ef5768b4013a62df610ed7d77a8b2de247a5b228"
14
+ }
15
+ },
16
+ "vendorRelease": "microsoft/ripgrep-prebuilt@v15.0.1",
17
+ "vendorCommit": "67202aaafb17aecd9b5b7046d5b7baa92b05237a",
18
+ "sourceRipgrep": "BurntSushi/ripgrep@15.0.0",
19
+ "reportedVersion": "ripgrep 15.0.0 / PCRE2 10.45",
20
+ "sourceInputs": [
21
+ {
22
+ "file": "vscode-build.json",
23
+ "sha256": "fcf6b245175385854a06785ae990546fe0d197ceb65ec9ca58860a5817f07abd"
24
+ },
25
+ {
26
+ "file": "vscode-binaries.lock.json",
27
+ "sha256": "0bd421f46e3ee2f127290f67e73adb240e1311162d6d33c25121849e5f2beadc"
28
+ },
29
+ {
30
+ "file": "prebuilt-config.json",
31
+ "sha256": "71bc7b3ecdd5442001f74896a738eafb3b831ee5a183e128067fe6b6d6b64ea7"
32
+ },
33
+ {
34
+ "file": "prebuilt-build-build.sh",
35
+ "sha256": "cf0d97cafca064c763d3ceeebe8b2f7647f5b4b35710b37c74804a4d3e1b3929"
36
+ },
37
+ {
38
+ "file": "prebuilt-patches-0001-resolve-binskim-issues.patch",
39
+ "sha256": "45f8b58bba714c446de407f93120f557736b45fad6f43ea283077201646a1be7"
40
+ },
41
+ {
42
+ "file": "ripgrep-lock",
43
+ "sha256": "257bfa1eeacfa4d8222e2c50f9d2f8d15ef07e96adee46eaa87839f3b6cfa3b4"
44
+ }
45
+ ],
46
+ "vendorArchives": {
47
+ "darwin-arm64": {
48
+ "sha256": "2fa16464fd8638588a67c7fc172d3c4b57fbdc65dff366e10b0b0e90734628a6",
49
+ "url": "https://github.com/microsoft/ripgrep-prebuilt/releases/download/v15.0.1/ripgrep-v15.0.1-aarch64-apple-darwin.tar.gz"
50
+ },
51
+ "darwin-x64": {
52
+ "sha256": "591c693e80bb444ef1907b2a906feb9c77bcafe1cdf509107cc75dcf0e875bd2",
53
+ "url": "https://github.com/microsoft/ripgrep-prebuilt/releases/download/v15.0.1/ripgrep-v15.0.1-x86_64-apple-darwin.tar.gz"
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,3 @@
1
+ This project is dual-licensed under the Unlicense and MIT licenses.
2
+
3
+ You may use this code under the terms of either license.