@twinsearth/w2m-dsh-plugin 2.0.4 → 2.0.5

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 (69) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +8 -0
  4. package/bin/w2m-joint.mjs +69 -7
  5. package/codex/mcp-servers.toml +1 -1
  6. package/docs/acceptance/2.0.5/RELEASE-205.json +21 -0
  7. package/docs/acceptance/2.0.5/RELEASE-2050.json +22 -0
  8. package/docs/adr/0001-collaboration-crdt.md +59 -0
  9. package/lib/client.js +146 -8
  10. package/package.json +2 -2
  11. package/plugin.json +1 -1
  12. package/src/agent/agent.mjs +97 -36
  13. package/src/agent/artifact-delivery.mjs +89 -0
  14. package/src/agent/caps.mjs +16 -2
  15. package/src/agent/sinks/git-sink.mjs +78 -0
  16. package/src/agent/sinks/ssh-sink.mjs +83 -0
  17. package/src/agent/sse-cursor.mjs +16 -0
  18. package/src/agent/sse-watchdog.mjs +71 -0
  19. package/src/plugin/dataplane-sink-route.mjs +113 -0
  20. package/src/plugin/fleet-chat-route.mjs +11 -0
  21. package/src/plugin/joint-dev/dispatch.mjs +5 -1
  22. package/src/plugin/joint-dev/merge-approval.mjs +115 -0
  23. package/src/plugin/joint-dev/progress.mjs +107 -0
  24. package/src/plugin/joint-dev/relay-dispatch.mjs +52 -22
  25. package/src/plugin/project-stream-route.mjs +58 -0
  26. package/src/plugin/tools-joint.mjs +6 -1
  27. package/src/plugin/tools.mjs +25 -5
  28. package/src/relay/fleet-messages.mjs +48 -24
  29. package/src/relay/project-room.mjs +47 -2
  30. package/src/relay/server.mjs +11 -5
  31. package/src/relay/state.mjs +63 -3
  32. package/src/util/chat-crypto.mjs +70 -1
  33. package/docs/COLLAB/COLLABORATION-MODEL.md +0 -240
  34. package/docs/COLLAB/EXECUTION-AUTH-MODEL.md +0 -361
  35. package/docs/COLLAB/M1-ACCEPTANCE-RUNBOOK.md +0 -70
  36. package/docs/COLLAB/M1-MAINTENANCE.md +0 -313
  37. package/docs/COLLAB/M2-TASK-GRANT.md +0 -231
  38. package/docs/COLLAB/M3-GIT-NATIVE-TASKS.md +0 -291
  39. package/docs/COLLAB/M4-PROJECT-ROOM.md +0 -260
  40. package/docs/COLLAB/M5-MULTI-CLIENT-PRIMITIVES.md +0 -263
  41. package/docs/COLLAB/M6-CROSS-NETWORK-RELIABILITY.md +0 -231
  42. package/docs/COLLAB/M7-METRICS-ACCEPTANCE.md +0 -263
  43. package/docs/COLLAB/TASK-MODEL.md +0 -281
  44. package/docs/acceptance/1.9.10/RELEASE-1910.json +0 -21
  45. package/docs/acceptance/1.9.11/RELEASE-1911.json +0 -20
  46. package/docs/acceptance/1.9.12/RELEASE-1912.json +0 -20
  47. package/docs/acceptance/1.9.13/RELEASE-1913.json +0 -20
  48. package/docs/acceptance/1.9.14/RELEASE-1914.json +0 -20
  49. package/docs/acceptance/1.9.15/RELEASE-1915.json +0 -22
  50. package/docs/acceptance/1.9.16/RELEASE-1916.json +0 -21
  51. package/docs/acceptance/1.9.17/RELEASE-1917.json +0 -20
  52. package/docs/acceptance/1.9.19/RELEASE-1919.json +0 -21
  53. package/docs/acceptance/1.9.20/RELEASE-1920.json +0 -22
  54. package/docs/acceptance/1.9.4/RELEASE-194.json +0 -23
  55. package/docs/acceptance/1.9.5/RELEASE-195.json +0 -23
  56. package/docs/acceptance/1.9.6/RELEASE-196.json +0 -22
  57. package/docs/acceptance/1.9.7/RELEASE-197.json +0 -21
  58. package/docs/acceptance/1.9.8/RELEASE-198.json +0 -21
  59. package/docs/acceptance/1.9.9/RELEASE-199.json +0 -21
  60. package/lib/client.js.bak2 +0 -640
  61. package/src/plugin/dataflow.mjs +0 -72
  62. package/src/plugin/fleet-target.mjs.bak-arch2 +0 -812
  63. package/src/plugin/fleet-target.mjs.bak-archive +0 -812
  64. package/src/plugin/tofuture/report.mjs +0 -44
  65. package/src/plugin/tools.mjs.bak-c7 +0 -7029
  66. package/src/relay/tofuture-whitelist.mjs +0 -46
  67. package/src/util/data-plane.mjs +0 -180
  68. package/src/util/sealed-object.mjs +0 -141
  69. package/src/util/tofuture-hmac.mjs +0 -30
@@ -1,44 +0,0 @@
1
- /**
2
- * ToFuture identity report (S2): collect every NIC, HMAC it, send only HMACs.
3
- *
4
- * Raw MAC/IP values exist only inside this function's local scope. The request body carries
5
- * `{v, machine_id, ts_ms, nonce, entries:[{kind, salt_id, hmac}]}` and nothing else.
6
- */
7
- import { networkInterfaces } from 'node:os';
8
- import { randomBytes } from 'node:crypto';
9
-
10
- import { identityHmac } from '../../util/tofuture-hmac.mjs';
11
-
12
- export function collectIdentityEntries(machineId, fleetKey) {
13
- const entries = [];
14
- for (const rows of Object.values(networkInterfaces())) {
15
- for (const row of rows ?? []) {
16
- const mac = typeof row?.mac === 'string' ? row.mac.trim() : '';
17
- if (mac !== '' && mac !== '00:00:00:00:00:00') entries.push(identityHmac(fleetKey, machineId, 'mac', mac.toLowerCase()));
18
- const family = row?.family === 4 || row?.family === 'IPv4' ? 'ipv4' : (row?.family === 6 || row?.family === 'IPv6' ? 'ipv6' : null);
19
- if (family !== null && typeof row?.address === 'string' && row.address !== '') entries.push(identityHmac(fleetKey, machineId, family, row.address));
20
- }
21
- }
22
- return entries;
23
- }
24
-
25
- export function buildIdentifyBody({ machineId, fleetKey, now = Date.now() }) {
26
- return { v: 1, machine_id: machineId, ts_ms: now, nonce: randomBytes(12).toString('hex'), entries: collectIdentityEntries(machineId, fleetKey) };
27
- }
28
-
29
- /**
30
- * @param {{request: Function, rabbitUrl: string, token: string, machineId: string, fleetKey: string, signal?: AbortSignal}} input
31
- * @returns {Promise<{ok: boolean, matched?: boolean, code?: string}>} — never carries identifiers
32
- */
33
- export async function reportIdentity(input) {
34
- if (typeof input?.fleetKey !== 'string' || input.fleetKey === '') return { ok: false, code: 'HIDDEN_STATE_NO_KEY' };
35
- const body = buildIdentifyBody({ machineId: input.machineId, fleetKey: input.fleetKey });
36
- try {
37
- const result = await input.request({ rabbitUrl: input.rabbitUrl, token: input.token, method: 'POST', pathname: '/v1/tofuture/identify', body, signal: input.signal });
38
- // The relay answers 204 for both outcomes; a non-2xx is a transport/shape failure, not membership.
39
- if (result?.ok === true) return { ok: true };
40
- return { ok: false, code: result?.error?.code ?? 'TOFUTURE_REPORT_REFUSED' };
41
- } catch {
42
- return { ok: false, code: 'TOFUTURE_REPORT_FAILED' };
43
- }
44
- }