@twinsearth/w2m-dsh-plugin 2.0.3 → 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 (72) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +17 -0
  4. package/README.md +187 -462
  5. package/bin/w2m-joint.mjs +69 -7
  6. package/codex/mcp-servers.toml +1 -1
  7. package/docs/acceptance/2.0.4/RELEASE-2040.json +22 -0
  8. package/docs/acceptance/2.0.5/RELEASE-205.json +21 -0
  9. package/docs/acceptance/2.0.5/RELEASE-2050.json +22 -0
  10. package/docs/adr/0001-collaboration-crdt.md +59 -0
  11. package/lib/client.js +2754 -2599
  12. package/package.json +2 -2
  13. package/plugin.json +1 -1
  14. package/src/agent/agent.mjs +97 -36
  15. package/src/agent/artifact-delivery.mjs +89 -0
  16. package/src/agent/caps.mjs +16 -2
  17. package/src/agent/sinks/git-sink.mjs +78 -0
  18. package/src/agent/sinks/ssh-sink.mjs +83 -0
  19. package/src/agent/sse-cursor.mjs +16 -0
  20. package/src/agent/sse-watchdog.mjs +71 -0
  21. package/src/plugin/dataplane-sink-route.mjs +113 -0
  22. package/src/plugin/fleet-chat-route.mjs +11 -0
  23. package/src/plugin/gpw.mjs +99 -15
  24. package/src/plugin/joint-dev/dispatch.mjs +5 -1
  25. package/src/plugin/joint-dev/merge-approval.mjs +115 -0
  26. package/src/plugin/joint-dev/progress.mjs +107 -0
  27. package/src/plugin/joint-dev/relay-dispatch.mjs +52 -22
  28. package/src/plugin/project-stream-route.mjs +58 -0
  29. package/src/plugin/tools-joint.mjs +6 -1
  30. package/src/plugin/tools.mjs +25 -5
  31. package/src/relay/fleet-messages.mjs +48 -24
  32. package/src/relay/project-room.mjs +47 -2
  33. package/src/relay/server.mjs +11 -5
  34. package/src/relay/state.mjs +63 -3
  35. package/src/util/chat-crypto.mjs +70 -1
  36. package/docs/COLLAB/COLLABORATION-MODEL.md +0 -240
  37. package/docs/COLLAB/EXECUTION-AUTH-MODEL.md +0 -361
  38. package/docs/COLLAB/M1-ACCEPTANCE-RUNBOOK.md +0 -70
  39. package/docs/COLLAB/M1-MAINTENANCE.md +0 -313
  40. package/docs/COLLAB/M2-TASK-GRANT.md +0 -231
  41. package/docs/COLLAB/M3-GIT-NATIVE-TASKS.md +0 -291
  42. package/docs/COLLAB/M4-PROJECT-ROOM.md +0 -260
  43. package/docs/COLLAB/M5-MULTI-CLIENT-PRIMITIVES.md +0 -263
  44. package/docs/COLLAB/M6-CROSS-NETWORK-RELIABILITY.md +0 -231
  45. package/docs/COLLAB/M7-METRICS-ACCEPTANCE.md +0 -263
  46. package/docs/COLLAB/TASK-MODEL.md +0 -281
  47. package/docs/acceptance/1.9.10/RELEASE-1910.json +0 -21
  48. package/docs/acceptance/1.9.11/RELEASE-1911.json +0 -20
  49. package/docs/acceptance/1.9.12/RELEASE-1912.json +0 -20
  50. package/docs/acceptance/1.9.13/RELEASE-1913.json +0 -20
  51. package/docs/acceptance/1.9.14/RELEASE-1914.json +0 -20
  52. package/docs/acceptance/1.9.15/RELEASE-1915.json +0 -22
  53. package/docs/acceptance/1.9.16/RELEASE-1916.json +0 -21
  54. package/docs/acceptance/1.9.17/RELEASE-1917.json +0 -20
  55. package/docs/acceptance/1.9.19/RELEASE-1919.json +0 -21
  56. package/docs/acceptance/1.9.20/RELEASE-1920.json +0 -22
  57. package/docs/acceptance/1.9.4/RELEASE-194.json +0 -23
  58. package/docs/acceptance/1.9.5/RELEASE-195.json +0 -23
  59. package/docs/acceptance/1.9.6/RELEASE-196.json +0 -22
  60. package/docs/acceptance/1.9.7/RELEASE-197.json +0 -21
  61. package/docs/acceptance/1.9.8/RELEASE-198.json +0 -21
  62. package/docs/acceptance/1.9.9/RELEASE-199.json +0 -21
  63. package/lib/client.js.bak2 +0 -640
  64. package/src/plugin/dataflow.mjs +0 -72
  65. package/src/plugin/fleet-target.mjs.bak-arch2 +0 -812
  66. package/src/plugin/fleet-target.mjs.bak-archive +0 -812
  67. package/src/plugin/tofuture/report.mjs +0 -44
  68. package/src/plugin/tools.mjs.bak-c7 +0 -7029
  69. package/src/relay/tofuture-whitelist.mjs +0 -46
  70. package/src/util/data-plane.mjs +0 -180
  71. package/src/util/sealed-object.mjs +0 -141
  72. 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
- }