harnery 0.9.0 → 0.10.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 (201) hide show
  1. package/README.md +1 -0
  2. package/dist/commander.d.ts.map +1 -1
  3. package/dist/commander.js +6 -0
  4. package/dist/commands/agents.d.ts +24 -0
  5. package/dist/commands/agents.d.ts.map +1 -1
  6. package/dist/commands/agents.js +244 -13
  7. package/dist/commands/backup.d.ts +5 -4
  8. package/dist/commands/backup.d.ts.map +1 -1
  9. package/dist/commands/backup.js +15 -14
  10. package/dist/commands/browse.d.ts.map +1 -1
  11. package/dist/commands/browse.js +27 -1
  12. package/dist/commands/claude-desktop.d.ts +19 -0
  13. package/dist/commands/claude-desktop.d.ts.map +1 -0
  14. package/dist/commands/claude-desktop.js +168 -0
  15. package/dist/commands/context.d.ts.map +1 -1
  16. package/dist/commands/context.js +149 -1
  17. package/dist/commands/doctor.d.ts.map +1 -1
  18. package/dist/commands/doctor.js +2 -3
  19. package/dist/commands/eml.d.ts +32 -0
  20. package/dist/commands/eml.d.ts.map +1 -1
  21. package/dist/commands/eml.js +16 -3
  22. package/dist/commands/harness.d.ts +11 -0
  23. package/dist/commands/harness.d.ts.map +1 -0
  24. package/dist/commands/harness.js +118 -0
  25. package/dist/commands/presence.d.ts +9 -4
  26. package/dist/commands/presence.d.ts.map +1 -1
  27. package/dist/commands/presence.js +88 -5
  28. package/dist/commands/relay.d.ts +9 -0
  29. package/dist/commands/relay.d.ts.map +1 -0
  30. package/dist/commands/relay.js +143 -0
  31. package/dist/commands/sync.d.ts.map +1 -1
  32. package/dist/commands/sync.js +5 -0
  33. package/dist/commands/workflow.d.ts.map +1 -1
  34. package/dist/commands/workflow.js +8 -15
  35. package/dist/core/agents/canonical-emit.d.ts +15 -0
  36. package/dist/core/agents/canonical-emit.d.ts.map +1 -1
  37. package/dist/core/agents/canonical-emit.js +41 -3
  38. package/dist/core/agents/cli.js +4 -2
  39. package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
  40. package/dist/core/agents/render/prompt-context.js +44 -3
  41. package/dist/core/agents/render/session-context.d.ts.map +1 -1
  42. package/dist/core/agents/render/session-context.js +26 -1
  43. package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
  44. package/dist/core/agents/rules/commit-conflict.js +4 -37
  45. package/dist/core/agents/session-events.d.ts.map +1 -1
  46. package/dist/core/agents/session-events.js +16 -43
  47. package/dist/core/agents/state/heartbeat-projector.d.ts.map +1 -1
  48. package/dist/core/agents/state/heartbeat-projector.js +11 -2
  49. package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
  50. package/dist/core/agents/state/heartbeat-writer.js +3 -3
  51. package/dist/core/agents/state/names.d.ts +38 -3
  52. package/dist/core/agents/state/names.d.ts.map +1 -1
  53. package/dist/core/agents/state/names.js +46 -7
  54. package/dist/core/agents/state/pidmap.d.ts +5 -1
  55. package/dist/core/agents/state/pidmap.d.ts.map +1 -1
  56. package/dist/core/agents/state/pidmap.js +58 -2
  57. package/dist/core/agents/state/stale-sweep.d.ts +3 -2
  58. package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
  59. package/dist/core/agents/state/stale-sweep.js +6 -6
  60. package/dist/core/config.d.ts +68 -11
  61. package/dist/core/config.d.ts.map +1 -1
  62. package/dist/core/config.js +191 -25
  63. package/dist/core/context/index.d.ts +144 -0
  64. package/dist/core/context/index.d.ts.map +1 -0
  65. package/dist/core/context/index.js +380 -0
  66. package/dist/core/harnesses/bench.d.ts +29 -0
  67. package/dist/core/harnesses/bench.d.ts.map +1 -0
  68. package/dist/core/harnesses/bench.js +151 -0
  69. package/dist/core/harnesses/index.d.ts +9 -0
  70. package/dist/core/harnesses/index.d.ts.map +1 -0
  71. package/dist/core/harnesses/index.js +4 -0
  72. package/dist/core/harnesses/profiles.d.ts +62 -0
  73. package/dist/core/harnesses/profiles.d.ts.map +1 -0
  74. package/dist/core/harnesses/profiles.js +115 -0
  75. package/dist/core/harnesses/registry.d.ts +15 -0
  76. package/dist/core/harnesses/registry.d.ts.map +1 -0
  77. package/dist/core/harnesses/registry.js +113 -0
  78. package/dist/core/harnesses/types.d.ts +64 -0
  79. package/dist/core/harnesses/types.d.ts.map +1 -0
  80. package/dist/core/harnesses/types.js +20 -0
  81. package/dist/core/hooks/cli.js +280 -63
  82. package/dist/core/hooks/events/schema.d.ts +38 -1
  83. package/dist/core/hooks/events/schema.d.ts.map +1 -1
  84. package/dist/core/hooks/harness/events.d.ts.map +1 -1
  85. package/dist/core/hooks/harness/events.js +3 -0
  86. package/dist/core/hooks/harness/parse.d.ts +1 -1
  87. package/dist/core/hooks/harness/parse.d.ts.map +1 -1
  88. package/dist/core/hooks/harness/parse.js +4 -0
  89. package/dist/core/presence/blob.d.ts +40 -0
  90. package/dist/core/presence/blob.d.ts.map +1 -0
  91. package/dist/core/presence/blob.js +91 -0
  92. package/dist/core/presence/git.d.ts +68 -0
  93. package/dist/core/presence/git.d.ts.map +1 -0
  94. package/dist/core/presence/git.js +173 -0
  95. package/dist/core/presence/index.d.ts +74 -0
  96. package/dist/core/presence/index.d.ts.map +1 -0
  97. package/dist/core/presence/index.js +224 -0
  98. package/dist/core/presence/relay-client.d.ts +39 -0
  99. package/dist/core/presence/relay-client.d.ts.map +1 -0
  100. package/dist/core/presence/relay-client.js +295 -0
  101. package/dist/core/presence/relay-protocol.d.ts +94 -0
  102. package/dist/core/presence/relay-protocol.d.ts.map +1 -0
  103. package/dist/core/presence/relay-protocol.js +169 -0
  104. package/dist/core/workflow/billing.d.ts +1 -1
  105. package/dist/core/workflow/billing.d.ts.map +1 -1
  106. package/dist/core/workflow/billing.js +7 -1
  107. package/dist/core/workflow/engine.d.ts.map +1 -1
  108. package/dist/core/workflow/engine.js +11 -2
  109. package/dist/core/workflow/harnesses.d.ts +3 -3
  110. package/dist/core/workflow/harnesses.d.ts.map +1 -1
  111. package/dist/core/workflow/harnesses.js +8 -17
  112. package/dist/core/workflow/spawn-claude.d.ts +4 -1
  113. package/dist/core/workflow/spawn-claude.d.ts.map +1 -1
  114. package/dist/core/workflow/spawn-claude.js +39 -18
  115. package/dist/core/workflow/spawn-codex.d.ts +4 -1
  116. package/dist/core/workflow/spawn-codex.d.ts.map +1 -1
  117. package/dist/core/workflow/spawn-codex.js +44 -22
  118. package/dist/core/workflow/spawn-cursor.d.ts +4 -1
  119. package/dist/core/workflow/spawn-cursor.d.ts.map +1 -1
  120. package/dist/core/workflow/spawn-cursor.js +35 -16
  121. package/dist/core/workflow/types.d.ts +9 -2
  122. package/dist/core/workflow/types.d.ts.map +1 -1
  123. package/dist/lib/browser/client.d.ts +16 -0
  124. package/dist/lib/browser/client.d.ts.map +1 -1
  125. package/dist/lib/browser/client.js +22 -0
  126. package/dist/lib/browser/index.d.ts +1 -0
  127. package/dist/lib/browser/index.d.ts.map +1 -1
  128. package/dist/lib/browser/index.js +1 -0
  129. package/dist/lib/browser/launch-args.d.ts +21 -0
  130. package/dist/lib/browser/launch-args.d.ts.map +1 -0
  131. package/dist/lib/browser/launch-args.js +32 -0
  132. package/dist/lib/claude-desktop.d.ts +105 -0
  133. package/dist/lib/claude-desktop.d.ts.map +1 -0
  134. package/dist/lib/claude-desktop.js +217 -0
  135. package/dist/lib/docs-lint.d.ts.map +1 -1
  136. package/dist/lib/docs-lint.js +5 -2
  137. package/dist/lib/identities/assume.d.ts +51 -0
  138. package/dist/lib/identities/assume.d.ts.map +1 -0
  139. package/dist/lib/identities/assume.js +274 -0
  140. package/dist/lib/identities/index.d.ts +7 -7
  141. package/dist/lib/identities/index.d.ts.map +1 -1
  142. package/dist/lib/identities/index.js +24 -24
  143. package/dist/lib/instructions/templates.d.ts.map +1 -1
  144. package/dist/lib/instructions/templates.js +15 -2
  145. package/package.json +12 -1
  146. package/schemas/config.schema.json +88 -19
  147. package/src/commander.ts +6 -0
  148. package/src/commands/agents.ts +280 -14
  149. package/src/commands/backup.ts +17 -16
  150. package/src/commands/browse.ts +32 -0
  151. package/src/commands/claude-desktop.ts +215 -0
  152. package/src/commands/context.ts +174 -1
  153. package/src/commands/doctor.ts +2 -3
  154. package/src/commands/eml.ts +22 -4
  155. package/src/commands/harness.ts +147 -0
  156. package/src/commands/presence.ts +111 -5
  157. package/src/commands/relay.ts +160 -0
  158. package/src/commands/sync.ts +4 -0
  159. package/src/commands/workflow.ts +9 -18
  160. package/src/core/agents/canonical-emit.ts +41 -3
  161. package/src/core/agents/cli.ts +4 -2
  162. package/src/core/agents/render/prompt-context.ts +48 -3
  163. package/src/core/agents/render/session-context.ts +27 -1
  164. package/src/core/agents/rules/commit-conflict.ts +4 -33
  165. package/src/core/agents/session-events.ts +15 -39
  166. package/src/core/agents/state/heartbeat-projector.ts +10 -1
  167. package/src/core/agents/state/heartbeat-writer.ts +3 -2
  168. package/src/core/agents/state/names.ts +68 -9
  169. package/src/core/agents/state/pidmap.ts +59 -2
  170. package/src/core/agents/state/stale-sweep.ts +6 -11
  171. package/src/core/config.ts +248 -24
  172. package/src/core/context/index.ts +575 -0
  173. package/src/core/harnesses/bench.ts +214 -0
  174. package/src/core/harnesses/index.ts +31 -0
  175. package/src/core/harnesses/profiles.ts +141 -0
  176. package/src/core/harnesses/registry.ts +140 -0
  177. package/src/core/harnesses/types.ts +90 -0
  178. package/src/core/hooks/cli.ts +331 -62
  179. package/src/core/hooks/events/schema.ts +68 -0
  180. package/src/core/hooks/harness/events.ts +3 -0
  181. package/src/core/hooks/harness/parse.ts +7 -1
  182. package/src/core/presence/blob.ts +125 -0
  183. package/src/core/presence/git.ts +191 -0
  184. package/src/core/presence/index.ts +274 -0
  185. package/src/core/presence/relay-client.ts +322 -0
  186. package/src/core/presence/relay-protocol.ts +246 -0
  187. package/src/core/workflow/billing.ts +8 -2
  188. package/src/core/workflow/engine.ts +11 -2
  189. package/src/core/workflow/harnesses.ts +14 -19
  190. package/src/core/workflow/spawn-claude.ts +39 -20
  191. package/src/core/workflow/spawn-codex.ts +47 -28
  192. package/src/core/workflow/spawn-cursor.ts +37 -18
  193. package/src/core/workflow/types.ts +9 -2
  194. package/src/lib/browser/client.ts +37 -0
  195. package/src/lib/browser/index.ts +1 -0
  196. package/src/lib/browser/launch-args.ts +33 -0
  197. package/src/lib/claude-desktop.ts +293 -0
  198. package/src/lib/docs-lint.ts +5 -2
  199. package/src/lib/identities/assume.ts +363 -0
  200. package/src/lib/identities/index.ts +28 -24
  201. package/src/lib/instructions/templates.ts +16 -2
@@ -31,12 +31,7 @@
31
31
  "type": "integer",
32
32
  "minimum": 30,
33
33
  "default": 600,
34
- "description": "How stale a peer heartbeat can get before the sweeper prunes it."
35
- },
36
- "name_pool": {
37
- "type": "string",
38
- "default": "default",
39
- "description": "Which agent-name pool to draw from. 'default' / 'hurricane' / a custom pool id."
34
+ "description": "How stale a peer heartbeat can get before the sweeper prunes it. Env override: HARNERY_AGENT_COORD_FRESHNESS."
40
35
  }
41
36
  }
42
37
  },
@@ -48,7 +43,7 @@
48
43
  "type": "integer",
49
44
  "minimum": 1024,
50
45
  "maximum": 65535,
51
- "default": 7777,
46
+ "default": 9000,
52
47
  "description": "Port that `harn web up` binds to."
53
48
  },
54
49
  "bind": {
@@ -77,35 +72,109 @@
77
72
  }
78
73
  }
79
74
  },
75
+ "tools": {
76
+ "type": "object",
77
+ "additionalProperties": false,
78
+ "description": "Managed-tool provisioning consent.",
79
+ "properties": {
80
+ "ripgrep": {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "properties": {
84
+ "autoInstall": {
85
+ "type": "boolean",
86
+ "default": false,
87
+ "description": "Allow `grep` to download the pinned, checksum-verified ripgrep into the harnery tools dir on first miss. Env override: HARNERY_TOOLS_AUTOINSTALL=1|0."
88
+ }
89
+ }
90
+ }
91
+ }
92
+ },
93
+ "workflow": {
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "properties": {
97
+ "subscriptionOnly": {
98
+ "type": "boolean",
99
+ "default": false,
100
+ "description": "Pin `workflow run` to subscription billing: API-key vars are scrubbed from every child env. Stamped true by `harn init` when the key is absent. Env override: HARNERY_WORKFLOW_SUBSCRIPTION_ONLY=1|0."
101
+ }
102
+ }
103
+ },
104
+ "skills": {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "properties": {
108
+ "exclude": {
109
+ "type": "array",
110
+ "items": { "type": "string" },
111
+ "default": [],
112
+ "description": "Shipped harnery skills this repo suppresses (e.g. because it maintains richer host-specific versions)."
113
+ }
114
+ }
115
+ },
116
+ "presence": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "description": "Cross-machine session presence (decision record 0016).",
120
+ "properties": {
121
+ "enabled": {
122
+ "type": "boolean",
123
+ "default": true,
124
+ "description": "Presence over git refs (refs/harnery/presence/<machine> on origin). On by default when an origin remote exists; fail-silent everywhere. Env override: HARNERY_PRESENCE=1|0."
125
+ },
126
+ "relay": {
127
+ "type": "string",
128
+ "description": "Optional live-socket upgrade: a wss:// relay URL (public reference: wss://relay.harnery.com; self-host via `harn relay serve` or relay/worker/). Hooks keep a per-machine daemon connected; git refs stay on as the floor. Env override: HARNERY_PRESENCE_RELAY=<url|0>."
129
+ }
130
+ }
131
+ },
80
132
  "backup": {
81
133
  "type": "object",
82
134
  "additionalProperties": false,
135
+ "description": "`harn backup` (restic) defaults. Env overrides: HARNERY_RESTIC_REPO, HARNERY_RESTIC_PASSWORD_FILE. `harn backup` is manual (init/snapshot/prune/...); there is no auto-snapshot scheduler.",
83
136
  "properties": {
84
137
  "repo": {
85
138
  "type": "string",
86
- "description": "restic repository URL. Common: 'rclone:gdrive:harnery-backup/<project>' for Google Drive."
139
+ "description": "restic repository path or URL. Default: ~/.cache/harnery/restic-repo. Common remote form: 'rclone:gdrive:harnery-backup/<project>'."
87
140
  },
88
- "schedule": {
141
+ "password_file": {
89
142
  "type": "string",
90
- "enum": ["off", "daily", "hourly"],
91
- "default": "off",
92
- "description": "Auto-snapshot cadence. 'off' = manual only."
143
+ "description": "File holding the restic repo password. Default: ~/.config/harnery/restic-password (autogenerated on `harn backup init`)."
144
+ },
145
+ "keep_daily": {
146
+ "type": "integer",
147
+ "minimum": 0,
148
+ "default": 7,
149
+ "description": "Daily snapshots to keep on `harn backup prune` (overridable per run with --keep-daily)."
150
+ },
151
+ "keep_weekly": {
152
+ "type": "integer",
153
+ "minimum": 0,
154
+ "default": 4,
155
+ "description": "Weekly snapshots to keep on `harn backup prune` (overridable with --keep-weekly)."
156
+ },
157
+ "keep_monthly": {
158
+ "type": "integer",
159
+ "minimum": 0,
160
+ "default": 6,
161
+ "description": "Monthly snapshots to keep on `harn backup prune` (overridable with --keep-monthly)."
93
162
  }
94
163
  }
95
164
  },
96
165
  "sync": {
97
166
  "type": "object",
98
167
  "additionalProperties": false,
168
+ "description": "`harn sync` (rclone) defaults for the curated cross-machine subset (identities/, scratch/archived/, councils/). Env overrides: HARNERY_SYNC_REMOTE, HARNERY_SYNC_PREFIX. `harn sync init` also records these in ~/.config/harnery/sync.json (a lower-precedence fallback than this section).",
99
169
  "properties": {
100
- "enabled": {
101
- "type": "boolean",
102
- "default": false,
103
- "description": "Enable cross-machine sync via Google Drive."
170
+ "remote": {
171
+ "type": "string",
172
+ "description": "rclone remote name (e.g. 'gdrive'). Set up the remote with `rclone config`; harnery doesn't wrap the OAuth flow."
104
173
  },
105
- "drive_folder": {
174
+ "prefix": {
106
175
  "type": "string",
107
- "default": "harnery-sync",
108
- "description": "Folder name in Google Drive that holds the synced subset."
176
+ "default": "harnery",
177
+ "description": "Subpath under the rclone remote root that holds the synced subset."
109
178
  }
110
179
  }
111
180
  }
package/src/commander.ts CHANGED
@@ -23,6 +23,7 @@ import { registerBackupCommand } from "./commands/backup.ts";
23
23
  import { registerBrowseCommand } from "./commands/browse.ts";
24
24
  import { registerBrowseAiCommand } from "./commands/browse-ai.ts";
25
25
  import { registerCallersCommand } from "./commands/callers.ts";
26
+ import { registerClaudeDesktopCommand } from "./commands/claude-desktop.ts";
26
27
  import { registerCompletionCommand } from "./commands/completion.ts";
27
28
  import { registerConfigGetCommand } from "./commands/config-get.ts";
28
29
  import { registerContextCommand } from "./commands/context.ts";
@@ -38,10 +39,12 @@ import { registerEnvCommand } from "./commands/env.ts";
38
39
  import { registerFetchCommand } from "./commands/fetch.ts";
39
40
  import { registerFileHistoryCommand } from "./commands/file-history.ts";
40
41
  import { registerGrepCommand } from "./commands/grep.ts";
42
+ import { registerHarnessCommand } from "./commands/harness.ts";
41
43
  import { registerInitCommand } from "./commands/init.ts";
42
44
  import { registerOutlineCommand } from "./commands/outline.ts";
43
45
  import { registerPresenceCommand } from "./commands/presence.ts";
44
46
  import { registerReadCommand } from "./commands/read.ts";
47
+ import { registerRelayCommand } from "./commands/relay.ts";
45
48
  import { registerScratchCommand } from "./commands/scratch.ts";
46
49
  import { registerSessionCommand } from "./commands/session.ts";
47
50
  import { registerSyncCommand } from "./commands/sync.ts";
@@ -251,6 +254,7 @@ export function createHarneryProgram(opts: HarneryContextOpts = {}): Command {
251
254
  registerEmlCommand(program, emit);
252
255
  registerEnvCommand(program, emit, opts.context);
253
256
  registerPresenceCommand(program, emit);
257
+ registerRelayCommand(program, emit);
254
258
  registerConfigGetCommand(program, emit);
255
259
  registerFileHistoryCommand(program, emit);
256
260
  registerOutlineCommand(program, emit);
@@ -259,6 +263,7 @@ export function createHarneryProgram(opts: HarneryContextOpts = {}): Command {
259
263
  registerCallersCommand(program, emit, opts.context);
260
264
  registerEditBatchCommand(program, emit);
261
265
  registerGrepCommand(program, emit, opts.context);
266
+ registerHarnessCommand(program, emit);
262
267
  registerCookiesCommand(program, emit);
263
268
  registerFetchCommand(program, emit, opts.context);
264
269
  registerReadCommand(program, emit);
@@ -277,6 +282,7 @@ export function createHarneryProgram(opts: HarneryContextOpts = {}): Command {
277
282
  registerInitCommand(program, emit, opts.binName);
278
283
  registerDeinitCommand(program, emit, opts.binName);
279
284
  registerBackupCommand(program, emit);
285
+ registerClaudeDesktopCommand(program, emit);
280
286
  registerSyncCommand(program, emit);
281
287
  registerWorkflowCommand(program, emit);
282
288
  if (include("web")) registerWebCommand(program, emit);