phaedo-mcp 0.2.1 → 0.3.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 (62) hide show
  1. package/NOTICE +17 -0
  2. package/README.md +51 -9
  3. package/action-binding.js +82 -0
  4. package/agreement.js +38 -0
  5. package/ap2.js +214 -0
  6. package/autonomy-promotion.js +280 -0
  7. package/build-package.mjs +25 -10
  8. package/capture-a11y.js +116 -0
  9. package/capture-local.js +85 -0
  10. package/capture-sync.js +99 -0
  11. package/consult-core.js +81 -19
  12. package/consult-policy.js +427 -33
  13. package/consult.js +25 -3
  14. package/delegation-sync.js +89 -0
  15. package/escalation-policy.sample.json +13 -0
  16. package/escalation.js +383 -0
  17. package/fingerprint-source.js +78 -4
  18. package/health.js +54 -0
  19. package/hooks/session-end.mjs +240 -0
  20. package/install.mjs +164 -21
  21. package/lib/capture-home.js +46 -0
  22. package/lib/domain.js +101 -0
  23. package/lib/is-main.js +40 -0
  24. package/lib/phaedo-crypto.js +17 -1
  25. package/package.json +26 -6
  26. package/pairing.js +5 -1
  27. package/phone-source.js +92 -12
  28. package/projection.js +4 -1
  29. package/pull.js +19 -3
  30. package/receipts-sync.js +197 -0
  31. package/receipts.js +69 -16
  32. package/server.js +305 -15
  33. package/server.json +4 -4
  34. package/signing-audit.js +111 -0
  35. package/signing-request.js +217 -0
  36. package/signing.js +176 -0
  37. package/vendor/authored-source.js +250 -0
  38. package/vendor/capabilities.js +203 -0
  39. package/vendor/capture/capture-core.js +67 -0
  40. package/vendor/capture/detectors.js +287 -0
  41. package/vendor/capture/exchanges.js +77 -0
  42. package/vendor/capture/model-detect.js +195 -0
  43. package/vendor/capture/owner.js +35 -0
  44. package/vendor/capture/package.json +4 -0
  45. package/vendor/capture/source-id.js +56 -0
  46. package/vendor/capture/state.js +148 -0
  47. package/vendor/capture/transcript.js +153 -0
  48. package/vendor/commitments.js +169 -0
  49. package/vendor/context-block.js +251 -18
  50. package/vendor/envelope.js +50 -4
  51. package/vendor/extraction/capture-combine.js +160 -0
  52. package/vendor/extraction/catalog.js +232 -0
  53. package/vendor/extraction/delta-lift.js +109 -0
  54. package/vendor/extraction/fingerprint-update.js +227 -0
  55. package/vendor/extraction/package.json +4 -0
  56. package/vendor/extraction/persist.js +40 -0
  57. package/vendor/extraction/reconcile.js +269 -0
  58. package/vendor/extraction/resolve.js +178 -0
  59. package/vendor/extraction/rule-promotion.js +137 -0
  60. package/vendor/kdf.js +20 -1
  61. package/vendor/protocol.js +7 -0
  62. package/vendored-files.mjs +82 -0
@@ -33,6 +33,13 @@
33
33
  // pair_key so the store-and-forward fingerprint envelope is decryptable by
34
34
  // either device with no live session — and never reuses any other role's key.
35
35
  FP_SYNC_KEY: 'phaedo-fp-sync-v0.1',
36
+ // §5 User Configuration SYNC key. A distinct sub-key of pair_key, mirroring
37
+ // FP_SYNC_KEY. NOT the §5.5 `phaedo:config:enc:v0.1` context — that one derives
38
+ // from MASTER key material, which never leaves the vault device (§7.4), so it can
39
+ // only ever encrypt a device-LOCAL at-rest copy. A config artifact that must be
40
+ // opened by the paired extension has to be sealed under something both devices can
41
+ // derive, which is pair_key. The two keys coexist: §5.5 for at-rest, this for transit.
42
+ CONFIG_SYNC_KEY: 'phaedo-config-sync-v0.1',
36
43
  },
37
44
 
38
45
  /** Sizes in bytes — fixed by spec §7.2. */
@@ -0,0 +1,82 @@
1
+ // The single source of truth for WHICH monorepo modules the published MCP server carries.
2
+ //
3
+ // Two consumers have to agree on this list and previously each kept its own copy:
4
+ // - mcp/build-package.mjs copies them into mcp/vendor/ at pack time
5
+ // - scripts/export-public-repo.mjs ships them into the public open-core repo
6
+ //
7
+ // They drifted, and the drift was invisible because each list is correct in isolation.
8
+ // `commitments.js` was added to the vendor set when §5.7 shipped (v0.1.49) and never added
9
+ // to the export, and the export never carried `capture/` or the extraction modules at all —
10
+ // so the public repo could not run `npm run build` or `npm test`, because `mcp/vendor/` is
11
+ // gitignored there and rebuilt at pack time. Nobody noticed because nothing exercised the
12
+ // public tree end to end.
13
+ //
14
+ // Same shape as the other "two lists that must agree" bugs in this codebase: make it ONE
15
+ // list, and assert the tie. scripts/test_public_export.mjs is the assertion.
16
+ //
17
+ // NOTE ON WHAT IS PUBLIC: every file named here already ships publicly, verbatim, inside the
18
+ // `phaedo-mcp` npm tarball. Listing them for the open-core git repo discloses nothing new.
19
+ // The proprietary parts — the trained models, the corpus generation, the extension and mobile
20
+ // surfaces — are not here and must not be added.
21
+
22
+ /** Root-level modules vendored into mcp/vendor/. */
23
+ export const ROOT_FILES = [
24
+ 'authored-source.js',
25
+ 'capabilities.js',
26
+ 'context-block.js',
27
+ 'protocol.js',
28
+ 'envelope.js',
29
+ 'kdf.js',
30
+ 'identity.js',
31
+ 'commitments.js',
32
+ ];
33
+
34
+ /** capture/ — the capture hook + tier-3 fold closure, vendored to mcp/vendor/capture/. */
35
+ export const CAPTURE_FILES = [
36
+ 'transcript.js',
37
+ 'exchanges.js',
38
+ 'capture-core.js',
39
+ 'detectors.js',
40
+ 'model-detect.js',
41
+ 'source-id.js',
42
+ 'state.js',
43
+ 'owner.js',
44
+ 'package.json',
45
+ ];
46
+
47
+ /** extraction/ — vendored to mcp/vendor/extraction/. */
48
+ export const EXTRACTION_FILES = [
49
+ 'delta-lift.js',
50
+ 'persist.js',
51
+ 'reconcile.js',
52
+ 'rule-promotion.js',
53
+ 'capture-combine.js',
54
+ 'fingerprint-update.js',
55
+ 'resolve.js',
56
+ 'catalog.js',
57
+ 'package.json',
58
+ ];
59
+
60
+ /**
61
+ * Extra root modules the PUBLIC repo needs that are NOT vendored into the npm package.
62
+ *
63
+ * These exist so the public tree's own test suites can actually run. Shipping a repo whose
64
+ * tests are present but unrunnable is worse than not shipping them: it reads as coverage
65
+ * that does not exist.
66
+ *
67
+ * - `sync-merge.js` — mcp/test-delegation-sync.mjs locks the extension-side merge round-trip
68
+ * through `../sync-merge.js`.
69
+ * - `migration.js` — spec/test-schemas.mjs imports it (§4.2 envelope + §4.7 layer-key
70
+ * migration; the producer↔schema tie asserts against it).
71
+ * - `export.js` — spec/test-vectors.mjs needs it for the §8.2 bootstrap-export vectors.
72
+ * - `user-config.js` — spec/test-schemas.mjs imports it (§5 User Configuration sibling
73
+ * artifact; the schema tie asserts the producer against it).
74
+ *
75
+ * Unlike ROOT_FILES these are NOT already public via the npm tarball, so adding to this list
76
+ * is a real disclosure decision. `migration.js`, `export.js` and `user-config.js` were
77
+ * owner-approved 2026-07-25 on a stated test: each is a reference implementation of a
78
+ * PUBLISHED spec section (§4.2/§4.7, §8.2, §5) containing no model, no corpus and no key
79
+ * material — which is precisely what an open-core spec repo is for. Each was read before
80
+ * being added, not assumed. Apply the same test before adding anything else here.
81
+ */
82
+ export const EXPORT_ONLY_ROOT_FILES = ['sync-merge.js', 'migration.js', 'export.js', 'user-config.js'];