@a-company/gnomon 0.0.0-stage → 8.0.2

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 (71) hide show
  1. package/README.md +126 -2
  2. package/dist/agent.d.ts +28 -0
  3. package/dist/agent.js +45708 -0
  4. package/dist/build-id.json +1 -0
  5. package/dist/cli/gnomon.js +53946 -0
  6. package/dist/cli/gnomond.js +47744 -0
  7. package/dist/gnomon-local/cli.js +897 -0
  8. package/dist/index.d.ts +3477 -0
  9. package/dist/index.js +13698 -0
  10. package/dist/loops.d.ts +440 -0
  11. package/dist/loops.js +4706 -0
  12. package/dist/signer-CQ3Bpe7G.d.ts +158 -0
  13. package/dist/transport/gnomon-web.js +688 -0
  14. package/gnomon-mods/.purpose +143 -0
  15. package/gnomon-mods/constellation/README.md +27 -0
  16. package/gnomon-mods/constellation/fixtures/map-the-idea.golden.json +19 -0
  17. package/gnomon-mods/constellation/fixtures/map-the-idea.json +3 -0
  18. package/gnomon-mods/constellation/fixtures/summarize-the-session.golden.json +20 -0
  19. package/gnomon-mods/constellation/fixtures/summarize-the-session.json +3 -0
  20. package/gnomon-mods/constellation/fixtures/two-blocks.golden.json +4 -0
  21. package/gnomon-mods/constellation/fixtures/two-blocks.json +3 -0
  22. package/gnomon-mods/constellation/gnomon-manifest.json +68 -0
  23. package/gnomon-mods/constellation/skills/constellation-desk/SKILL.md +35 -0
  24. package/gnomon-mods/ledger/README.md +10 -0
  25. package/gnomon-mods/ledger/fixtures/breaker.golden.json +28 -0
  26. package/gnomon-mods/ledger/fixtures/breaker.json +80 -0
  27. package/gnomon-mods/ledger/fixtures/compacted.golden.json +42 -0
  28. package/gnomon-mods/ledger/fixtures/compacted.json +103 -0
  29. package/gnomon-mods/ledger/fixtures/over-budget.golden.json +24 -0
  30. package/gnomon-mods/ledger/fixtures/over-budget.json +86 -0
  31. package/gnomon-mods/ledger/fixtures/strip-reduced.golden.json +23 -0
  32. package/gnomon-mods/ledger/fixtures/strip-reduced.json +76 -0
  33. package/gnomon-mods/ledger/fixtures/strip.golden.json +18 -0
  34. package/gnomon-mods/ledger/fixtures/strip.json +68 -0
  35. package/gnomon-mods/ledger/gnomon-manifest.json +16 -0
  36. package/gnomon-mods/ledger/index.mjs +77 -0
  37. package/gnomon-mods/ledger/model.mjs +237 -0
  38. package/gnomon-mods/neurons/README.md +31 -0
  39. package/gnomon-mods/neurons/fixtures/capture-a-decision.golden.json +20 -0
  40. package/gnomon-mods/neurons/fixtures/capture-a-decision.json +3 -0
  41. package/gnomon-mods/neurons/fixtures/capture-a-learning.golden.json +19 -0
  42. package/gnomon-mods/neurons/fixtures/capture-a-learning.json +3 -0
  43. package/gnomon-mods/neurons/fixtures/search-the-brain.golden.json +19 -0
  44. package/gnomon-mods/neurons/fixtures/search-the-brain.json +3 -0
  45. package/gnomon-mods/neurons/fixtures/undeclared-kind.golden.json +9 -0
  46. package/gnomon-mods/neurons/fixtures/undeclared-kind.json +3 -0
  47. package/gnomon-mods/neurons/gnomon-manifest.json +87 -0
  48. package/gnomon-mods/neurons/skills/neurons-desk/SKILL.md +44 -0
  49. package/gnomon-mods/paradigm-context/README.md +9 -0
  50. package/gnomon-mods/paradigm-context/fixtures/empty.golden.json +28 -0
  51. package/gnomon-mods/paradigm-context/fixtures/empty.json +48 -0
  52. package/gnomon-mods/paradigm-context/fixtures/full-dark.golden.json +497 -0
  53. package/gnomon-mods/paradigm-context/fixtures/full-dark.json +134 -0
  54. package/gnomon-mods/paradigm-context/fixtures/full.golden.json +497 -0
  55. package/gnomon-mods/paradigm-context/fixtures/full.json +134 -0
  56. package/gnomon-mods/paradigm-context/fixtures/stale.golden.json +205 -0
  57. package/gnomon-mods/paradigm-context/fixtures/stale.json +69 -0
  58. package/gnomon-mods/paradigm-context/fixtures/unfocused.golden.json +28 -0
  59. package/gnomon-mods/paradigm-context/fixtures/unfocused.json +14 -0
  60. package/gnomon-mods/paradigm-context/gnomon-manifest.json +15 -0
  61. package/gnomon-mods/paradigm-context/index.mjs +64 -0
  62. package/gnomon-mods/paradigm-context/model.mjs +137 -0
  63. package/gnomon-mods/workshop/README.md +12 -0
  64. package/gnomon-mods/workshop/fixtures/strip-reduced.golden.json +56 -0
  65. package/gnomon-mods/workshop/fixtures/strip-reduced.json +16 -0
  66. package/gnomon-mods/workshop/fixtures/strip.golden.json +56 -0
  67. package/gnomon-mods/workshop/fixtures/strip.json +16 -0
  68. package/gnomon-mods/workshop/gnomon-manifest.json +14 -0
  69. package/gnomon-mods/workshop/index.mjs +73 -0
  70. package/gnomon-mods/workshop/model.mjs +152 -0
  71. package/package.json +80 -4
package/README.md CHANGED
@@ -1,3 +1,127 @@
1
- # Temporary Holding Version
1
+ # Gnomon
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Gnomon runs your Claude Code sessions for you on your Mac and asks before
4
+ anything that matters happens. It is a small local program, the **kernel**,
5
+ that starts Claude Code inside a sandbox and keeps a tamper-evident log of what
6
+ each session did. When a session needs your decision (a repo hook, a question,
7
+ a plan), it shows a **card**. You decide the card in a local web page, the
8
+ **GUI**, and every decision is signed after a Touch ID prompt from a helper that
9
+ keeps its keys in the Secure Enclave.
10
+
11
+ You use it much like `claude`: `cd` into a repo, type `gnomon`, and open the
12
+ page it prints. If you prefer an app, use Gnomon.app instead.
13
+
14
+ The design is in `docs/specs/gnomon.md`. The longer walkthrough, including the
15
+ DEV ONLY path, is [docs/guides/gnomon-dogfood.md](../../docs/guides/gnomon-dogfood.md).
16
+
17
+ ## What you need
18
+
19
+ - macOS 15 or later with SIP on, and Node 24 or later (22.14+ on 22.x and 23.7+ on 23.x also work: they have `--disable-sigusr1`).
20
+ - Claude Code from the **native installer** (`~/.local/bin/claude`), logged in
21
+ with your **subscription**. Gnomon refuses API billing (`BILLING_REFUSED`).
22
+ - `NODE_OPTIONS` **unset** in your shell. Gnomon refuses to run its kernel
23
+ under it (see Troubleshooting).
24
+
25
+ ## Install
26
+
27
+ From a clone of `a-paradigm` on the `feat/gnomon` branch:
28
+
29
+ ```sh
30
+ npm ci
31
+ npm run gnomon:install
32
+ ```
33
+
34
+ This builds the Gnomon packages and links `gnomon` into the first writable
35
+ directory of `/opt/homebrew/bin` or `/usr/local/bin`. You can run it again
36
+ safely. It does not use sudo, and it never reads or writes `~/.gnomon` or any
37
+ key. It refuses to replace a `gnomon` that is not a symlink, or a link to a
38
+ different clone, and tells you what to remove if you mean to switch.
39
+ `--no-build` skips the build (`node packages/gnomon/scripts/install-darwin.mjs --no-build`).
40
+
41
+ ## First run (once)
42
+
43
+ ```sh
44
+ node packages/gnomon-helper/scripts/build-darwin.mjs # the signed Secure Enclave helper
45
+ gnomon identity init --name <you> # two Touch ID prompts; <you> is lowercase: a-z 0-9 . _ -
46
+ gnomon identity status
47
+ ```
48
+
49
+ `identity init` asks for two Touch ID prompts. Each one ends with a short
50
+ digest that the terminal also prints. Check they match before you touch. If
51
+ you want to run the hardware test (`packages/gnomon-helper/README.md`), run it
52
+ **before** `identity init`.
53
+
54
+ ## Daily use
55
+
56
+ ```sh
57
+ cd ~/code/my-repo
58
+ gnomon
59
+ ```
60
+
61
+ `gnomon` starts the kernel in this terminal and opens Gnomon in your default
62
+ browser. The terminal says `opened in your browser` and still prints the
63
+ one-time URL below it: if no tab appeared, open that URL yourself within 60
64
+ seconds. (`gnomon setup` and `gnomon up` open your browser the same way.
65
+ `--no-open`, or `GNOMON_NO_OPEN=1` in scripts, prints the URL only. The URL
66
+ reaches the browser on the standard input of `/usr/bin/osascript`, never on a
67
+ command line, so `ps` cannot read it.) The new-session form opens with this repo's
68
+ top folder filled in (or the current folder, if you are not in a git repo; it
69
+ says so). Check the path, then click **open**. Nothing opens until you click.
70
+ The path is only a suggestion from your terminal, so the page shows it in full,
71
+ and it does not fill in a path with unusual characters; you type that yourself.
72
+
73
+ In the terminal: **Enter** opens (and prints) a fresh URL, and **q** or
74
+ **Ctrl-C** stops the kernel and its sessions. The URL is opened and printed only
75
+ from an interactive terminal; Gnomon.app (`up --wrapper`) never opens a browser.
76
+
77
+ Other commands (`gnomon help` lists them all):
78
+
79
+ - `gnomon up` starts the kernel the same way, without a folder suggestion.
80
+ - `gnomon session repin-claude` re-pins the Claude Code binary after it updates.
81
+ - `gnomon rules list | revoke` shows or removes standing always-allow rules.
82
+
83
+ **Gnomon.app** runs the same kernel without a terminal. Build it once with
84
+ `packages/gnomon-wrapper/README.md`, then double-click it. Use one or the other
85
+ at a time: only one kernel runs on your home.
86
+
87
+ ## Updating
88
+
89
+ ```sh
90
+ git pull
91
+ npm run gnomon:install # rebuilds, keeps the link
92
+ node packages/gnomon-wrapper/scripts/build-darwin.mjs # if you use Gnomon.app
93
+ ```
94
+
95
+ Rebuild Gnomon.app after every update. At build time the app pins the node it
96
+ runs and a hash of the kernel build, so a new build, a `git pull` or
97
+ `brew upgrade node` makes it refuse with "Rebuild the app" until you do.
98
+
99
+ Claude Code updates itself. After it does, opening a session is refused with
100
+ `claude_binary_changed`. Stop Gnomon, run `gnomon session repin-claude`, type
101
+ the confirmation, and start again.
102
+
103
+ ## Troubleshooting
104
+
105
+ | You see | Meaning | Do this |
106
+ |---|---|---|
107
+ | `REFUSED GNOMON unsafe-env` (or `UP`) | `NODE_OPTIONS` is set, or node was started with extra flags | `unset NODE_OPTIONS` (and remove it from your shell profile); run `gnomon` itself, whose first line passes the one flag it needs |
108
+ | `REFUSED GNOMON unprovisioned` | No identity on `~/.gnomon` yet | `gnomon identity init` |
109
+ | `REFUSED GNOMON already-running` (exit 3) | A kernel already runs on your home: Gnomon.app, another `gnomon`/`gnomon up`, or `gnomond`. The message names which one | Open a session for this folder in that window (**+ new**, or Cmd-N) and paste the path it prints. Or stop that instance and run `gnomon` again. A terminal command to open a folder in a running kernel (`gnomon open`) is planned, not built |
110
+ | `REFUSED INSTALL link` | A `gnomon` already exists in the bin directory and is not this clone's link | Remove it as the message says, then run the installer again |
111
+ | Gnomon.app says "Rebuild the app" | node or the kernel build changed since the app was built | `node packages/gnomon-wrapper/scripts/build-darwin.mjs` |
112
+ | `claude_binary_changed` when opening a session | Claude Code updated itself | `gnomon session repin-claude` |
113
+ | `gui not started` | stdout is not a terminal (a pipe or a file), so no URL was made | Run `gnomon` in a terminal window |
114
+
115
+ ## Where things live
116
+
117
+ - `~/.gnomon/`: your home. Keys (`keys/`), the hash-chained log, the Claude
118
+ pin. Do not copy the keys anywhere.
119
+ - The kernel's log rows are in that home; `gnomon replay` checks the chain.
120
+ - Gnomon.app writes `~/Library/Logs/Gnomon/kernel.log`, which names the node
121
+ and kernel it ran.
122
+ - Claude Code keeps its own transcripts under `~/.claude/` as usual.
123
+
124
+ ## For developers
125
+
126
+ `npm run build:gnomon && npm run test:gnomon` from the repo root. Package layout,
127
+ symbols and tests are described in `packages/gnomon/.purpose`.
@@ -0,0 +1,28 @@
1
+ import { S as Signer } from './signer-CQ3Bpe7G.js';
2
+ import 'node:crypto';
3
+
4
+ interface DeviceCredential {
5
+ principalId: string;
6
+ deviceId: string;
7
+ /** A `device`-class signer (identity/device-key.ts loadDeviceKey). */
8
+ signer: Signer;
9
+ }
10
+
11
+ declare const AGENT_KEY_ENV = "GNOMON_AGENT_KEY";
12
+ declare class LoopKernelUnavailable extends Error {
13
+ readonly why: 'no-endpoint' | 'not-running' | 'no-agent-key' | 'unverified-server';
14
+ constructor(why: 'no-endpoint' | 'not-running' | 'no-agent-key' | 'unverified-server', message: string);
15
+ }
16
+ interface LoopRequestOptions {
17
+ home?: string;
18
+ env?: Readonly<Record<string, string | undefined>>;
19
+ /** the client name in hello (default paradigm-mcp) */
20
+ clientName?: string;
21
+ }
22
+ /** The agent's device credential from the home, or why there is none. */
23
+ declare function agentDeviceOf(home: string, env?: Readonly<Record<string, string | undefined>>): DeviceCredential | string;
24
+ /** Append one `loop.request{op, …}` as the agent principal; the kernel's answer, or `{refused}`. */
25
+ declare function loopRequest(payload: Record<string, unknown>, o?: LoopRequestOptions): Promise<Record<string, unknown>>;
26
+
27
+ export { AGENT_KEY_ENV, LoopKernelUnavailable, agentDeviceOf, loopRequest };
28
+ export type { LoopRequestOptions };