@intutic/cli 2.2.0 → 2.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 (344) hide show
  1. package/README.md +8 -8
  2. package/dist/cli.d.ts +0 -1
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +481 -19
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/apiCommand.d.ts +40 -0
  7. package/dist/commands/apiCommand.d.ts.map +1 -0
  8. package/dist/commands/apiCommand.js +88 -0
  9. package/dist/commands/apiCommand.js.map +1 -0
  10. package/dist/commands/budget.d.ts +4 -0
  11. package/dist/commands/budget.d.ts.map +1 -1
  12. package/dist/commands/budget.js +8 -0
  13. package/dist/commands/budget.js.map +1 -1
  14. package/dist/commands/compliance.d.ts +122 -0
  15. package/dist/commands/compliance.d.ts.map +1 -0
  16. package/dist/commands/compliance.js +278 -0
  17. package/dist/commands/compliance.js.map +1 -0
  18. package/dist/commands/connect.d.ts +26 -1
  19. package/dist/commands/connect.d.ts.map +1 -1
  20. package/dist/commands/connect.js +109 -51
  21. package/dist/commands/connect.js.map +1 -1
  22. package/dist/commands/credentials.d.ts +1 -1
  23. package/dist/commands/credentials.js +1 -1
  24. package/dist/commands/decision.d.ts +4 -4
  25. package/dist/commands/decision.js +4 -4
  26. package/dist/commands/disconnect.d.ts +4 -0
  27. package/dist/commands/disconnect.d.ts.map +1 -1
  28. package/dist/commands/disconnect.js +17 -3
  29. package/dist/commands/disconnect.js.map +1 -1
  30. package/dist/commands/doctor.d.ts +0 -1
  31. package/dist/commands/doctor.d.ts.map +1 -1
  32. package/dist/commands/doctor.js +0 -1
  33. package/dist/commands/doctor.js.map +1 -1
  34. package/dist/commands/enforce.d.ts +1 -1
  35. package/dist/commands/enforce.js +1 -1
  36. package/dist/commands/enterprise.d.ts +3 -2
  37. package/dist/commands/enterprise.d.ts.map +1 -1
  38. package/dist/commands/enterprise.js +11 -3
  39. package/dist/commands/enterprise.js.map +1 -1
  40. package/dist/commands/env.js +1 -1
  41. package/dist/commands/exec.d.ts +2 -3
  42. package/dist/commands/exec.d.ts.map +1 -1
  43. package/dist/commands/exec.js +4 -5
  44. package/dist/commands/exec.js.map +1 -1
  45. package/dist/commands/gateLiveness.d.ts +15 -0
  46. package/dist/commands/gateLiveness.d.ts.map +1 -0
  47. package/dist/commands/gateLiveness.js +34 -0
  48. package/dist/commands/gateLiveness.js.map +1 -0
  49. package/dist/commands/gateway.d.ts +14 -4
  50. package/dist/commands/gateway.d.ts.map +1 -1
  51. package/dist/commands/gateway.js +34 -4
  52. package/dist/commands/gateway.js.map +1 -1
  53. package/dist/commands/github.d.ts +20 -0
  54. package/dist/commands/github.d.ts.map +1 -0
  55. package/dist/commands/github.js +41 -0
  56. package/dist/commands/github.js.map +1 -0
  57. package/dist/commands/guardrails.d.ts +28 -2
  58. package/dist/commands/guardrails.d.ts.map +1 -1
  59. package/dist/commands/guardrails.js +233 -24
  60. package/dist/commands/guardrails.js.map +1 -1
  61. package/dist/commands/init.d.ts +1 -2
  62. package/dist/commands/init.d.ts.map +1 -1
  63. package/dist/commands/init.js +1 -2
  64. package/dist/commands/init.js.map +1 -1
  65. package/dist/commands/install-daemon.d.ts +1 -1
  66. package/dist/commands/install-daemon.js +2 -2
  67. package/dist/commands/integrity.d.ts +10 -2
  68. package/dist/commands/integrity.d.ts.map +1 -1
  69. package/dist/commands/integrity.js +3 -3
  70. package/dist/commands/integrity.js.map +1 -1
  71. package/dist/commands/inventory.d.ts +60 -0
  72. package/dist/commands/inventory.d.ts.map +1 -0
  73. package/dist/commands/inventory.js +141 -0
  74. package/dist/commands/inventory.js.map +1 -0
  75. package/dist/commands/judge.d.ts +1 -1
  76. package/dist/commands/judge.js +2 -2
  77. package/dist/commands/judge.js.map +1 -1
  78. package/dist/commands/login.d.ts +0 -1
  79. package/dist/commands/login.d.ts.map +1 -1
  80. package/dist/commands/login.js +0 -1
  81. package/dist/commands/login.js.map +1 -1
  82. package/dist/commands/logout.d.ts +0 -1
  83. package/dist/commands/logout.d.ts.map +1 -1
  84. package/dist/commands/logout.js +0 -1
  85. package/dist/commands/logout.js.map +1 -1
  86. package/dist/commands/mcp.d.ts +31 -0
  87. package/dist/commands/mcp.d.ts.map +1 -0
  88. package/dist/commands/mcp.js +65 -0
  89. package/dist/commands/mcp.js.map +1 -0
  90. package/dist/commands/notifications.d.ts +54 -0
  91. package/dist/commands/notifications.d.ts.map +1 -0
  92. package/dist/commands/notifications.js +151 -0
  93. package/dist/commands/notifications.js.map +1 -0
  94. package/dist/commands/org.d.ts +3 -3
  95. package/dist/commands/org.js +3 -3
  96. package/dist/commands/policy.d.ts +6 -1
  97. package/dist/commands/policy.d.ts.map +1 -1
  98. package/dist/commands/policy.js +77 -37
  99. package/dist/commands/policy.js.map +1 -1
  100. package/dist/commands/rollback.d.ts.map +1 -1
  101. package/dist/commands/rollback.js +3 -1
  102. package/dist/commands/rollback.js.map +1 -1
  103. package/dist/commands/routing.d.ts +1 -1
  104. package/dist/commands/routing.js +1 -1
  105. package/dist/commands/rules.d.ts +74 -0
  106. package/dist/commands/rules.d.ts.map +1 -0
  107. package/dist/commands/rules.js +283 -0
  108. package/dist/commands/rules.js.map +1 -0
  109. package/dist/commands/settings.d.ts +43 -0
  110. package/dist/commands/settings.d.ts.map +1 -0
  111. package/dist/commands/settings.js +108 -0
  112. package/dist/commands/settings.js.map +1 -0
  113. package/dist/commands/setup.d.ts +1 -1
  114. package/dist/commands/setup.js +1 -1
  115. package/dist/commands/siem.d.ts +53 -0
  116. package/dist/commands/siem.d.ts.map +1 -0
  117. package/dist/commands/siem.js +132 -0
  118. package/dist/commands/siem.js.map +1 -0
  119. package/dist/commands/skill.d.ts +5 -5
  120. package/dist/commands/skill.js +7 -7
  121. package/dist/commands/skill.js.map +1 -1
  122. package/dist/commands/status.d.ts +0 -1
  123. package/dist/commands/status.d.ts.map +1 -1
  124. package/dist/commands/status.js +2 -3
  125. package/dist/commands/status.js.map +1 -1
  126. package/dist/commands/syncContext.d.ts +0 -1
  127. package/dist/commands/syncContext.d.ts.map +1 -1
  128. package/dist/commands/syncContext.js +0 -1
  129. package/dist/commands/syncContext.js.map +1 -1
  130. package/dist/commands/team.d.ts +2 -2
  131. package/dist/commands/team.js +2 -2
  132. package/dist/commands/traces.d.ts +0 -3
  133. package/dist/commands/traces.d.ts.map +1 -1
  134. package/dist/commands/traces.js +0 -3
  135. package/dist/commands/traces.js.map +1 -1
  136. package/dist/commands/usage.d.ts +41 -0
  137. package/dist/commands/usage.d.ts.map +1 -0
  138. package/dist/commands/usage.js +129 -0
  139. package/dist/commands/usage.js.map +1 -0
  140. package/dist/commands/whoami.d.ts +0 -1
  141. package/dist/commands/whoami.d.ts.map +1 -1
  142. package/dist/commands/whoami.js +0 -1
  143. package/dist/commands/whoami.js.map +1 -1
  144. package/dist/config/keychain.d.ts +0 -1
  145. package/dist/config/keychain.d.ts.map +1 -1
  146. package/dist/config/keychain.js +0 -1
  147. package/dist/config/keychain.js.map +1 -1
  148. package/dist/config/paths.d.ts +0 -1
  149. package/dist/config/paths.d.ts.map +1 -1
  150. package/dist/config/paths.js +0 -1
  151. package/dist/config/paths.js.map +1 -1
  152. package/dist/config/store.d.ts +0 -1
  153. package/dist/config/store.d.ts.map +1 -1
  154. package/dist/config/store.js +0 -1
  155. package/dist/config/store.js.map +1 -1
  156. package/dist/harness/ag2.d.ts +1 -1
  157. package/dist/harness/ag2.js +1 -1
  158. package/dist/harness/agentFramework.d.ts +1 -1
  159. package/dist/harness/agentFramework.js +1 -1
  160. package/dist/harness/agenticOrchestrator.d.ts +1 -1
  161. package/dist/harness/agenticOrchestrator.js +2 -2
  162. package/dist/harness/agenticOrchestrator.js.map +1 -1
  163. package/dist/harness/agentsMd.d.ts +24 -0
  164. package/dist/harness/agentsMd.d.ts.map +1 -0
  165. package/dist/harness/agentsMd.js +28 -0
  166. package/dist/harness/agentsMd.js.map +1 -0
  167. package/dist/harness/aider.d.ts +3 -1
  168. package/dist/harness/aider.d.ts.map +1 -1
  169. package/dist/harness/aider.js +9 -7
  170. package/dist/harness/aider.js.map +1 -1
  171. package/dist/harness/antigravity.d.ts +23 -5
  172. package/dist/harness/antigravity.d.ts.map +1 -1
  173. package/dist/harness/antigravity.js +45 -55
  174. package/dist/harness/antigravity.js.map +1 -1
  175. package/dist/harness/autogen.d.ts +1 -1
  176. package/dist/harness/autogen.js +2 -2
  177. package/dist/harness/autogen.js.map +1 -1
  178. package/dist/harness/claudeCode.d.ts +22 -1
  179. package/dist/harness/claudeCode.d.ts.map +1 -1
  180. package/dist/harness/claudeCode.js +47 -3
  181. package/dist/harness/claudeCode.js.map +1 -1
  182. package/dist/harness/cline.d.ts.map +1 -1
  183. package/dist/harness/cline.js +14 -23
  184. package/dist/harness/cline.js.map +1 -1
  185. package/dist/harness/codex.d.ts +6 -1
  186. package/dist/harness/codex.d.ts.map +1 -1
  187. package/dist/harness/codex.js +23 -21
  188. package/dist/harness/codex.js.map +1 -1
  189. package/dist/harness/continue.d.ts +10 -4
  190. package/dist/harness/continue.d.ts.map +1 -1
  191. package/dist/harness/continue.js +22 -22
  192. package/dist/harness/continue.js.map +1 -1
  193. package/dist/harness/cursor.d.ts +5 -2
  194. package/dist/harness/cursor.d.ts.map +1 -1
  195. package/dist/harness/cursor.js +19 -23
  196. package/dist/harness/cursor.js.map +1 -1
  197. package/dist/harness/detector.d.ts +0 -1
  198. package/dist/harness/detector.d.ts.map +1 -1
  199. package/dist/harness/detector.js +0 -1
  200. package/dist/harness/detector.js.map +1 -1
  201. package/dist/harness/dsh.d.ts +5 -3
  202. package/dist/harness/dsh.d.ts.map +1 -1
  203. package/dist/harness/dsh.js +17 -29
  204. package/dist/harness/dsh.js.map +1 -1
  205. package/dist/harness/eve.d.ts +3 -4
  206. package/dist/harness/eve.d.ts.map +1 -1
  207. package/dist/harness/eve.js +3 -4
  208. package/dist/harness/eve.js.map +1 -1
  209. package/dist/harness/githubCopilot.d.ts +4 -1
  210. package/dist/harness/githubCopilot.d.ts.map +1 -1
  211. package/dist/harness/githubCopilot.js +12 -20
  212. package/dist/harness/githubCopilot.js.map +1 -1
  213. package/dist/harness/goose.d.ts +7 -3
  214. package/dist/harness/goose.d.ts.map +1 -1
  215. package/dist/harness/goose.js +18 -21
  216. package/dist/harness/goose.js.map +1 -1
  217. package/dist/harness/grok.d.ts +2 -2
  218. package/dist/harness/grok.d.ts.map +1 -1
  219. package/dist/harness/grok.js +13 -24
  220. package/dist/harness/grok.js.map +1 -1
  221. package/dist/harness/hermes.d.ts +6 -0
  222. package/dist/harness/hermes.d.ts.map +1 -1
  223. package/dist/harness/hermes.js +17 -16
  224. package/dist/harness/hermes.js.map +1 -1
  225. package/dist/harness/muse.d.ts +3 -7
  226. package/dist/harness/muse.d.ts.map +1 -1
  227. package/dist/harness/muse.js +15 -35
  228. package/dist/harness/muse.js.map +1 -1
  229. package/dist/harness/n8n.d.ts +13 -14
  230. package/dist/harness/n8n.d.ts.map +1 -1
  231. package/dist/harness/n8n.js +21 -181
  232. package/dist/harness/n8n.js.map +1 -1
  233. package/dist/harness/openWebUI.d.ts.map +1 -1
  234. package/dist/harness/openWebUI.js +5 -4
  235. package/dist/harness/openWebUI.js.map +1 -1
  236. package/dist/harness/openaiAgents.d.ts +1 -1
  237. package/dist/harness/openaiAgents.js +2 -2
  238. package/dist/harness/openaiAgents.js.map +1 -1
  239. package/dist/harness/openclaw.d.ts +8 -0
  240. package/dist/harness/openclaw.d.ts.map +1 -1
  241. package/dist/harness/openclaw.js +27 -12
  242. package/dist/harness/openclaw.js.map +1 -1
  243. package/dist/harness/opencode.d.ts +4 -5
  244. package/dist/harness/opencode.d.ts.map +1 -1
  245. package/dist/harness/opencode.js +15 -30
  246. package/dist/harness/opencode.js.map +1 -1
  247. package/dist/harness/openhands.d.ts +9 -3
  248. package/dist/harness/openhands.d.ts.map +1 -1
  249. package/dist/harness/openhands.js +30 -24
  250. package/dist/harness/openhands.js.map +1 -1
  251. package/dist/harness/pi.d.ts +7 -2
  252. package/dist/harness/pi.d.ts.map +1 -1
  253. package/dist/harness/pi.js +19 -18
  254. package/dist/harness/pi.js.map +1 -1
  255. package/dist/harness/rooCode.d.ts +12 -5
  256. package/dist/harness/rooCode.d.ts.map +1 -1
  257. package/dist/harness/rooCode.js +23 -39
  258. package/dist/harness/rooCode.js.map +1 -1
  259. package/dist/harness/rulesFiles.d.ts +53 -0
  260. package/dist/harness/rulesFiles.d.ts.map +1 -0
  261. package/dist/harness/rulesFiles.js +106 -0
  262. package/dist/harness/rulesFiles.js.map +1 -0
  263. package/dist/harness/smolagents.d.ts +2 -2
  264. package/dist/harness/smolagents.js +3 -3
  265. package/dist/harness/smolagents.js.map +1 -1
  266. package/dist/harness/types.d.ts +20 -6
  267. package/dist/harness/types.d.ts.map +1 -1
  268. package/dist/harness/types.js +1 -95
  269. package/dist/harness/types.js.map +1 -1
  270. package/dist/harness/windsurf.d.ts +6 -1
  271. package/dist/harness/windsurf.d.ts.map +1 -1
  272. package/dist/harness/windsurf.js +21 -24
  273. package/dist/harness/windsurf.js.map +1 -1
  274. package/dist/harness/xirp.d.ts +1 -2
  275. package/dist/harness/xirp.d.ts.map +1 -1
  276. package/dist/harness/xirp.js +2 -3
  277. package/dist/harness/xirp.js.map +1 -1
  278. package/dist/lib/api.d.ts +27 -1
  279. package/dist/lib/api.d.ts.map +1 -1
  280. package/dist/lib/api.js +55 -18
  281. package/dist/lib/api.js.map +1 -1
  282. package/dist/lib/ciscoScanner.d.ts +1 -1
  283. package/dist/lib/ciscoScanner.js +1 -1
  284. package/dist/lib/decisionsLogRefresh.d.ts.map +1 -1
  285. package/dist/lib/decisionsLogRefresh.js +6 -7
  286. package/dist/lib/decisionsLogRefresh.js.map +1 -1
  287. package/dist/lib/deviceReport.d.ts +15 -0
  288. package/dist/lib/deviceReport.d.ts.map +1 -1
  289. package/dist/lib/deviceReport.js +30 -0
  290. package/dist/lib/deviceReport.js.map +1 -1
  291. package/dist/lib/gitHooks.d.ts +0 -1
  292. package/dist/lib/gitHooks.d.ts.map +1 -1
  293. package/dist/lib/gitHooks.js +8 -9
  294. package/dist/lib/gitHooks.js.map +1 -1
  295. package/dist/lib/gracefulShutdown.d.ts +1 -1
  296. package/dist/lib/gracefulShutdown.js +1 -1
  297. package/dist/lib/hash.d.ts +0 -1
  298. package/dist/lib/hash.d.ts.map +1 -1
  299. package/dist/lib/hash.js +0 -1
  300. package/dist/lib/hash.js.map +1 -1
  301. package/dist/lib/inventory.d.ts +47 -0
  302. package/dist/lib/inventory.d.ts.map +1 -0
  303. package/dist/lib/inventory.js +106 -0
  304. package/dist/lib/inventory.js.map +1 -0
  305. package/dist/lib/logger.d.ts +0 -1
  306. package/dist/lib/logger.d.ts.map +1 -1
  307. package/dist/lib/logger.js +0 -1
  308. package/dist/lib/logger.js.map +1 -1
  309. package/dist/lib/mdmManifest.d.ts +30 -2
  310. package/dist/lib/mdmManifest.d.ts.map +1 -1
  311. package/dist/lib/mdmManifest.js +50 -2
  312. package/dist/lib/mdmManifest.js.map +1 -1
  313. package/dist/lib/onboarding.d.ts +0 -1
  314. package/dist/lib/onboarding.d.ts.map +1 -1
  315. package/dist/lib/onboarding.js +1 -2
  316. package/dist/lib/onboarding.js.map +1 -1
  317. package/dist/lib/policySnapshot.d.ts +3 -2
  318. package/dist/lib/policySnapshot.d.ts.map +1 -1
  319. package/dist/lib/policySnapshot.js +6 -3
  320. package/dist/lib/policySnapshot.js.map +1 -1
  321. package/dist/lib/process.d.ts +5 -1
  322. package/dist/lib/process.d.ts.map +1 -1
  323. package/dist/lib/process.js +13 -4
  324. package/dist/lib/process.js.map +1 -1
  325. package/dist/lib/providerProbe.d.ts +2 -2
  326. package/dist/lib/providerProbe.js +2 -2
  327. package/dist/lib/sandbox/firecracker.d.ts +3 -3
  328. package/dist/lib/sandbox/firecracker.js +3 -3
  329. package/dist/lib/sandbox/index.d.ts +2 -2
  330. package/dist/lib/sandbox/index.js +2 -2
  331. package/dist/lib/sandbox/oci.d.ts +1 -1
  332. package/dist/lib/sandbox/oci.js +1 -1
  333. package/dist/lib/sandbox/types.d.ts +1 -1
  334. package/dist/lib/sandbox/types.js +1 -1
  335. package/dist/lib/sopFrontMatter.d.ts +1 -1
  336. package/dist/lib/sopFrontMatter.js +1 -1
  337. package/package.json +6 -5
  338. package/resources/sandbox/Dockerfile +1 -1
  339. package/resources/sandbox/entrypoint.sh +4 -4
  340. package/resources/sandbox/firecracker-launch.sh +1 -1
  341. package/dist/harness/base.d.ts +0 -24
  342. package/dist/harness/base.d.ts.map +0 -1
  343. package/dist/harness/base.js +0 -74
  344. package/dist/harness/base.js.map +0 -1
@@ -1,9 +1,15 @@
1
1
  /**
2
2
  * openhands.ts — OpenHands adapter (full implementation with hooks + llm.base_url).
3
3
  *
4
- * Merges SOP content ([intutic]) and llm.base_url ([llm]) into config.toml,
5
- * keeping the rest of the file, and injects PreToolUse hooks via
6
- * .openhands/hooks.json.
4
+ * - rules: `.openhands/microagents/intutic-governance.md`, a repository
5
+ * microagent with no triggers, which OpenHands keeps active in every
6
+ * conversation (V0's `microagent.py`: "no triggers -> REPO (always
7
+ * active)"; the V1 software-agent SDK loads the same directory as legacy
8
+ * skills, "no keywords -> always active"). Earlier versions put the rules
9
+ * in an `[intutic]` table of `config.toml`, which OpenHands never reads;
10
+ * connect drops that table and disconnect removes it;
11
+ * - `[llm] base_url` merged into `config.toml`, keeping the rest of the file;
12
+ * - the PreToolUse hook in `.openhands/hooks.json`.
7
13
  *
8
14
  * HLD §3.14 — Harness Onboarding Matrix
9
15
  * @module
@@ -15,10 +21,12 @@ import { hashFile } from '../lib/hash.js';
15
21
  import { writeOpenHandsHooks, mergeOpenHandsToml, isOpenHandsConfig } from '@intutic/sync-daemon/harness/openhandsHooks';
16
22
  import { keepOriginal } from '@intutic/sync-daemon';
17
23
  import { log } from '../lib/logger.js';
24
+ import { writeOwnRulesFile } from './rulesFiles.js';
18
25
  const CONFIG_FILE = 'config.toml';
26
+ const RULES_FILE = '.openhands/microagents/intutic-governance.md';
19
27
  export const openhandsAdapter = {
20
28
  type: HarnessType.OPENHANDS,
21
- configFileName: CONFIG_FILE,
29
+ configFileName: RULES_FILE,
22
30
  // `.openhands/` is OpenHands' own per-repository directory (`setup.sh`,
23
31
  // microagents). Without it, a `config.toml` counts only when it is an
24
32
  // OpenHands configuration: the file name alone matched every Hugo site and
@@ -38,39 +46,37 @@ export const openhandsAdapter = {
38
46
  return false;
39
47
  }
40
48
  },
49
+ /** The .openhands/hooks.json PreToolUse hook. */
50
+ async installGate(workspaceRoot, proxyUrl) {
51
+ await writeOpenHandsHooks(workspaceRoot, proxyUrl);
52
+ },
41
53
  async writeConfig(workspaceRoot, sops, proxyUrl) {
42
- const filePath = join(workspaceRoot, CONFIG_FILE);
43
- const instructions = sops.length > 0
44
- ? sops.map((sop) => `## ${sop.title}\n\n${sop.content}`).join('\n\n---\n\n')
45
- : '# Intutic governance active — no SOP rules configured yet.';
46
- // Merged into the user's config.toml: [llm] base_url and an [intutic]
47
- // table for the SOP text; everything else is kept. A file that does not
48
- // parse is left alone.
54
+ // Merged into the user's config.toml: [llm] base_url; everything else is
55
+ // kept. A file that does not parse is left alone.
56
+ const configPath = join(workspaceRoot, CONFIG_FILE);
49
57
  let raw = '';
50
58
  try {
51
- raw = await readFile(filePath, 'utf-8');
59
+ raw = await readFile(configPath, 'utf-8');
52
60
  }
53
61
  catch { /* no config.toml yet */ }
54
- const merged = mergeOpenHandsToml(raw, proxyUrl, instructions);
62
+ const merged = mergeOpenHandsToml(raw, proxyUrl);
55
63
  let written = null;
56
64
  if (merged === null) {
57
- log.warn(`${filePath} is not valid TOML — left untouched`);
65
+ log.warn(`${configPath} is not valid TOML — left untouched`);
58
66
  }
59
- else {
60
- const tmpPath = filePath + '.intutic-tmp';
61
- await keepOriginal(filePath, workspaceRoot);
62
- await mkdir(dirname(filePath), { recursive: true });
67
+ else if (merged !== raw) {
68
+ const tmpPath = configPath + '.intutic-tmp';
69
+ await keepOriginal(configPath, workspaceRoot);
70
+ await mkdir(dirname(configPath), { recursive: true });
63
71
  await writeFile(tmpPath, merged, 'utf-8');
64
- await rename(tmpPath, filePath);
65
- written = filePath;
72
+ await rename(tmpPath, configPath);
73
+ written = configPath;
66
74
  }
67
- // Inject .openhands/hooks.json PreToolUse hook
68
- await writeOpenHandsHooks(workspaceRoot, proxyUrl);
69
- return written;
75
+ return (await writeOwnRulesFile(workspaceRoot, RULES_FILE, sops, proxyUrl)) ?? written;
70
76
  },
71
77
  async readCurrentHash(workspaceRoot) {
72
78
  try {
73
- return await hashFile(join(workspaceRoot, CONFIG_FILE));
79
+ return await hashFile(join(workspaceRoot, RULES_FILE));
74
80
  }
75
81
  catch {
76
82
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"openhands.js","sourceRoot":"","sources":["../../src/harness/openhands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AACxH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAEtC,MAAM,WAAW,GAAG,aAAa,CAAA;AAEjC,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,IAAI,EAAE,WAAW,CAAC,SAAS;IAC3B,cAAc,EAAE,WAAW;IAE3B,wEAAwE;IACxE,sEAAsE;IACtE,2EAA2E;IAC3E,wCAAwC;IACxC,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,IA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C,CAAA;QAChD,IAAI,OAAO,GAAkB,IAAI,CAAA;QACjC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU,qCAAqC,CAAC,CAAA;QAC9D,CAAC;aAAM,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,UAAU,GAAG,cAAc,CAAA;YAC3C,MAAM,YAAY,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;YAC7C,MAAM,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;YACrD,MAAM,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;YACzC,MAAM,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;YACjC,OAAO,GAAG,UAAU,CAAA;QACtB,CAAC;QAED,OAAO,CAAC,MAAM,iBAAiB,CAAC,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,IAAI,OAAO,CAAA;IACxF,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,aAAqB;QACzC,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAA;QACxD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -1,8 +1,13 @@
1
1
  /**
2
2
  * pi.ts — Pi adapter.
3
3
  *
4
- * Detects Pi presence and invokes the sync-daemon hooks compiler
5
- * to inject Intutic pre-tool use gates.
4
+ * Detects Pi (its `~/.pi` home, or a project's `.pi` directory) and installs
5
+ * the gate: an extension in `~/.pi/agent/extensions/` (see piHooks.ts).
6
+ *
7
+ * Pi loads `AGENTS.md` from its agent directory and from every directory
8
+ * between where it runs and the filesystem root, so the rule sets go into the
9
+ * workspace's `AGENTS.md` through the shared writer (agentsMd.ts;
10
+ * https://github.com/earendil-works/pi/blob/6fb2e7815167e6b19006fc526d1a5d0f5f998787/packages/coding-agent/docs/configuration.md).
6
11
  *
7
12
  * HLD §3.14 — Harness Onboarding Matrix
8
13
  * @module
@@ -1 +1 @@
1
- {"version":3,"file":"pi.d.ts","sourceRoot":"","sources":["../../src/harness/pi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAOjD,eAAO,MAAM,SAAS,EAAE,eA+BvB,CAAA"}
1
+ {"version":3,"file":"pi.d.ts","sourceRoot":"","sources":["../../src/harness/pi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAQjD,eAAO,MAAM,SAAS,EAAE,eA4BvB,CAAA"}
@@ -1,8 +1,13 @@
1
1
  /**
2
2
  * pi.ts — Pi adapter.
3
3
  *
4
- * Detects Pi presence and invokes the sync-daemon hooks compiler
5
- * to inject Intutic pre-tool use gates.
4
+ * Detects Pi (its `~/.pi` home, or a project's `.pi` directory) and installs
5
+ * the gate: an extension in `~/.pi/agent/extensions/` (see piHooks.ts).
6
+ *
7
+ * Pi loads `AGENTS.md` from its agent directory and from every directory
8
+ * between where it runs and the filesystem root, so the rule sets go into the
9
+ * workspace's `AGENTS.md` through the shared writer (agentsMd.ts;
10
+ * https://github.com/earendil-works/pi/blob/6fb2e7815167e6b19006fc526d1a5d0f5f998787/packages/coding-agent/docs/configuration.md).
6
11
  *
7
12
  * HLD §3.14 — Harness Onboarding Matrix
8
13
  * @module
@@ -12,16 +17,17 @@ import { access } from 'node:fs/promises';
12
17
  import { existsSync } from 'node:fs';
13
18
  import { homedir } from 'node:os';
14
19
  import { HarnessType } from '@intutic/shared-types';
15
- import { hashFile } from '../lib/hash.js';
16
20
  import { loadCredentials } from '../config/store.js';
21
+ import { AGENTS_MD, agentsMdHash, writeAgentsMd } from './agentsMd.js';
17
22
  import { writePiHooks } from '@intutic/sync-daemon';
18
- const CONFIG_FILE = '.pi/hooks.json';
23
+ /** A project's Pi configuration directory (settings, extensions, MCP servers). */
24
+ const DETECT_FILE = '.pi';
19
25
  export const piAdapter = {
20
26
  type: HarnessType.PI,
21
- configFileName: CONFIG_FILE,
27
+ configFileName: AGENTS_MD,
22
28
  async detect(workspaceRoot) {
23
29
  const globalPi = join(homedir(), '.pi');
24
- const localPi = join(workspaceRoot, CONFIG_FILE);
30
+ const localPi = join(workspaceRoot, DETECT_FILE);
25
31
  try {
26
32
  if (existsSync(globalPi))
27
33
  return true;
@@ -32,20 +38,15 @@ export const piAdapter = {
32
38
  return false;
33
39
  }
34
40
  },
35
- async writeConfig(workspaceRoot, _sops, proxyUrl) {
36
- const filePath = join(workspaceRoot, CONFIG_FILE);
41
+ async installGate(workspaceRoot, proxyUrl) {
37
42
  const creds = await loadCredentials();
38
- const workspaceId = creds?.workspaceId || 'local';
39
- await writePiHooks(workspaceRoot, proxyUrl, workspaceId);
40
- return filePath;
43
+ await writePiHooks(workspaceRoot, proxyUrl, creds?.workspaceId || 'local');
41
44
  },
42
- async readCurrentHash(workspaceRoot) {
43
- try {
44
- return await hashFile(join(workspaceRoot, CONFIG_FILE));
45
- }
46
- catch {
47
- return null;
48
- }
45
+ writeConfig(workspaceRoot, sops, proxyUrl) {
46
+ return writeAgentsMd(workspaceRoot, sops, proxyUrl);
47
+ },
48
+ readCurrentHash(workspaceRoot) {
49
+ return agentsMdHash(workspaceRoot);
49
50
  },
50
51
  };
51
52
  //# sourceMappingURL=pi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pi.js","sourceRoot":"","sources":["../../src/harness/pi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UA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,CAAC,aAAqB,EAAE,QAAgB;QACvD,MAAM,KAAK,GAAG,MAAM,eAAe,EAAE,CAAA;QACrC,MAAM,YAAY,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,IAAI,OAAO,CAAC,CAAA;IAC5E,CAAC;IAED,WAAW,CAAC,aAAqB,EAAE,IAAoB,EAAE,QAAgB;QACvE,OAAO,aAAa,CAAC,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IACrD,CAAC;IAED,eAAe,CAAC,aAAqB;QACnC,OAAO,YAAY,CAAC,aAAa,CAAC,CAAA;IACpC,CAAC;CACF,CAAA"}
@@ -1,11 +1,18 @@
1
1
  /**
2
2
  * rooCode.ts — Roo Code adapter.
3
3
  *
4
- * Detects the Roo Code VS Code extension and writes Intutic governance rules
5
- * as .roorules. Roo Code has no hook system to install a tool-call gate into,
6
- * and keeps its API provider and base URL in its own settings panel rather
7
- * than in any file this adapter can write, so routing it through the proxy is
8
- * a manual step (see the Roo Code integration page).
4
+ * Detects the Roo Code VS Code extension and writes the rule sets into the
5
+ * workspace's `AGENTS.md` through the shared writer (agentsMd.ts). Roo reads
6
+ * `AGENTS.md` at the workspace root unless `roo-cline.useAgentRules` is off,
7
+ * the default being on. Not `.roo/rules/`: once that directory has a file,
8
+ * Roo stops reading a `.roorules` or `.clinerules` the user keeps
9
+ * (https://github.com/RooCodeInc/Roo-Code/blob/b867ec9145750d0ae1ff7f02d35406e9bf2a0b16/src/core/prompts/sections/custom-instructions.ts).
10
+ * Earlier versions overwrote `.roorules`; the user's own copy comes back.
11
+ *
12
+ * Roo Code has no hook system to install a tool-call gate into, and keeps its
13
+ * API provider and base URL in its own settings panel rather than in any file
14
+ * this adapter can write, so routing it through the proxy is a manual step
15
+ * (see the Roo Code integration page).
9
16
  *
10
17
  * HLD §3.14 — Harness Onboarding Matrix
11
18
  * @module
@@ -1 +1 @@
1
- {"version":3,"file":"rooCode.d.ts","sourceRoot":"","sources":["../../src/harness/rooCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAOjD,eAAO,MAAM,cAAc,EAAE,eAsD5B,CAAA"}
1
+ {"version":3,"file":"rooCode.d.ts","sourceRoot":"","sources":["../../src/harness/rooCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAMjD,eAAO,MAAM,cAAc,EAAE,eA8B5B,CAAA"}
@@ -1,11 +1,18 @@
1
1
  /**
2
2
  * rooCode.ts — Roo Code adapter.
3
3
  *
4
- * Detects the Roo Code VS Code extension and writes Intutic governance rules
5
- * as .roorules. Roo Code has no hook system to install a tool-call gate into,
6
- * and keeps its API provider and base URL in its own settings panel rather
7
- * than in any file this adapter can write, so routing it through the proxy is
8
- * a manual step (see the Roo Code integration page).
4
+ * Detects the Roo Code VS Code extension and writes the rule sets into the
5
+ * workspace's `AGENTS.md` through the shared writer (agentsMd.ts). Roo reads
6
+ * `AGENTS.md` at the workspace root unless `roo-cline.useAgentRules` is off,
7
+ * the default being on. Not `.roo/rules/`: once that directory has a file,
8
+ * Roo stops reading a `.roorules` or `.clinerules` the user keeps
9
+ * (https://github.com/RooCodeInc/Roo-Code/blob/b867ec9145750d0ae1ff7f02d35406e9bf2a0b16/src/core/prompts/sections/custom-instructions.ts).
10
+ * Earlier versions overwrote `.roorules`; the user's own copy comes back.
11
+ *
12
+ * Roo Code has no hook system to install a tool-call gate into, and keeps its
13
+ * API provider and base URL in its own settings panel rather than in any file
14
+ * this adapter can write, so routing it through the proxy is a manual step
15
+ * (see the Roo Code integration page).
9
16
  *
10
17
  * HLD §3.14 — Harness Onboarding Matrix
11
18
  * @module
@@ -14,16 +21,14 @@ import { access, readdir } from 'node:fs/promises';
14
21
  import { join } from 'node:path';
15
22
  import { homedir } from 'node:os';
16
23
  import { HarnessType } from '@intutic/shared-types';
17
- import { hashFile } from '../lib/hash.js';
18
- import { newIso } from '@intutic/id';
19
- import { writeOwnedFile } from '@intutic/sync-daemon';
20
- const CONFIG_FILE = '.roorules';
24
+ import { AGENTS_MD, agentsMdHash, writeAgentsMd } from './agentsMd.js';
25
+ import { retireLegacyRulesFile } from './rulesFiles.js';
26
+ const LEGACY_FILE = '.roorules';
21
27
  export const rooCodeAdapter = {
22
28
  type: HarnessType.ROO_CODE,
23
- configFileName: CONFIG_FILE,
29
+ configFileName: AGENTS_MD,
24
30
  async detect(workspaceRoot) {
25
- // Check for .roomodes or .roorules in workspace
26
- for (const marker of ['.roomodes', '.roorules']) {
31
+ for (const marker of ['.roomodes', LEGACY_FILE]) {
27
32
  try {
28
33
  await access(join(workspaceRoot, marker));
29
34
  return true;
@@ -32,41 +37,20 @@ export const rooCodeAdapter = {
32
37
  // fall through
33
38
  }
34
39
  }
35
- // Check for VS Code extension directory
36
40
  try {
37
- const extensionsDir = join(homedir(), '.vscode', 'extensions');
38
- const entries = await readdir(extensionsDir);
41
+ const entries = await readdir(join(homedir(), '.vscode', 'extensions'));
39
42
  return entries.some((entry) => entry.startsWith('rooveterinaryinc.roo-cline-'));
40
43
  }
41
44
  catch {
42
45
  return false;
43
46
  }
44
47
  },
45
- async writeConfig(workspaceRoot, sops, _proxyUrl) {
46
- const filePath = join(workspaceRoot, CONFIG_FILE);
47
- const instructions = sops.length > 0
48
- ? sops.map((sop) => `## ${sop.title}\n\n${sop.content}`).join('\n\n---\n\n')
49
- : '# Intutic governance active — no SOP rules configured yet.';
50
- const content = [
51
- '# Intutic Governance Rules (auto-generated)',
52
- '# DO NOT EDIT — managed by intutic sync daemon',
53
- `# Last sync: ${newIso()}`,
54
- '# NOTE: Roo Code has no hook system, so these rules are advisory.',
55
- '# Governance is enforced via the proxy and the drift guard.',
56
- '',
57
- instructions,
58
- '',
59
- ].join('\n');
60
- await writeOwnedFile(filePath, workspaceRoot, content);
61
- return filePath;
48
+ async writeConfig(workspaceRoot, sops, proxyUrl) {
49
+ await retireLegacyRulesFile(workspaceRoot, LEGACY_FILE);
50
+ return writeAgentsMd(workspaceRoot, sops, proxyUrl);
62
51
  },
63
- async readCurrentHash(workspaceRoot) {
64
- try {
65
- return await hashFile(join(workspaceRoot, CONFIG_FILE));
66
- }
67
- catch {
68
- return null;
69
- }
52
+ readCurrentHash(workspaceRoot) {
53
+ return agentsMdHash(workspaceRoot);
70
54
  },
71
55
  };
72
56
  //# sourceMappingURL=rooCode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rooCode.js","sourceRoot":"","sources":["../../src/harness/rooCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,MAAM,WAAW,GAAG,WAAW,CAAA;AAE/B,MAAM,CAAC,MAAM,cAAc,GAAoB;IAC7C,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,cAAc,EAAE,WAAW;IAE3B,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,gDAAgD;QAChD,KAAK,MAAM,MAAM,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC;YAChD,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAA;gBACzC,OAAO,IAAI,CAAA;YACb,CAAC;YAAC,MAAM,CAAC;gBACP,eAAe;YACjB,CAAC;QACH,CAAC;QAED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,CAAC,WAAW,CAAC,aAAqB,EAAE,IAAoB,EAAE,QAAgB;QAC7E,MAAM,qBAAqB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;QACvD,OAAO,aAAa,CAAC,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IACrD,CAAC;IAED,eAAe,CAAC,aAAqB;QACnC,OAAO,YAAY,CAAC,aAAa,CAAC,CAAA;IACpC,CAAC;CACF,CAAA"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * rulesFiles.ts — the two ways a rule set reaches a harness's instructions.
3
+ *
4
+ * Which file each harness reads is `HARNESS_RULES_FILES` in
5
+ * `@intutic/shared-types`, with the product documentation that says so. The
6
+ * adapters write through these helpers, and `rulesFiles.test.ts` checks every
7
+ * adapter writes where the map says and nowhere else.
8
+ *
9
+ * - {@link writeRulesSectionFile}: a file the user also writes (`CLAUDE.md`,
10
+ * `AGENTS.md`, `GEMINI.md`, `.goosehints`, ...). The rule sets go between
11
+ * the INTUTIC:RULES markers and the rest of the file is the user's.
12
+ * - {@link writeOwnRulesFile}: a file of Intutic's own in a directory the
13
+ * product reads every file of (`.cursor/rules/`, `.continue/rules/`, ...).
14
+ *
15
+ * Neither carries a sync time: the same rule sets give the same bytes, so a
16
+ * sync with nothing new leaves the file alone.
17
+ *
18
+ * @module
19
+ */
20
+ import type { SyncSopEntry } from '@intutic/shared-types';
21
+ /**
22
+ * One markdown section per SOP. Each SOP the control plane synced ends with
23
+ * its `sop://` pointer comment, which maps the rules in the file back to the
24
+ * SOP that produced them.
25
+ */
26
+ export declare function buildSopSections(sops: SyncSopEntry[]): string;
27
+ /**
28
+ * The rule sets as markdown: the generated header (which `intutic disconnect`
29
+ * recognises), the proxy URL, one section per SOP.
30
+ */
31
+ export declare function buildRulesBody(sops: SyncSopEntry[], proxyUrl: string, shape: 'section' | 'file'): string;
32
+ /**
33
+ * Writes the rule sets as the marked section of `relPath`. Nothing is written
34
+ * without a rule set. Returns the absolute path, or null.
35
+ */
36
+ export declare function writeRulesSectionFile(workspaceRoot: string, relPath: string, sops: SyncSopEntry[], proxyUrl: string): Promise<string | null>;
37
+ /** The section's hash: the user's own edits elsewhere in the file are not drift. */
38
+ export declare function rulesSectionHash(workspaceRoot: string, relPath: string): Promise<string | null>;
39
+ /**
40
+ * Writes the rule sets as Intutic's own file `relPath`, after `frontMatter`
41
+ * (the product's own keys, e.g. `alwaysApply: true`) when given. Nothing is
42
+ * written without a rule set. Returns the absolute path, or null.
43
+ */
44
+ export declare function writeOwnRulesFile(workspaceRoot: string, relPath: string, sops: SyncSopEntry[], proxyUrl: string, frontMatter?: string): Promise<string | null>;
45
+ /** The hash of a whole file Intutic owns; null when it does not exist. */
46
+ export declare function ownRulesFileHash(workspaceRoot: string, relPath: string): Promise<string | null>;
47
+ /**
48
+ * Takes back the whole rules file earlier versions wrote at `relPath`, a path
49
+ * the product has stopped reading or reads only as a legacy fallback: the
50
+ * user's original comes back, or the file goes when Intutic created it.
51
+ */
52
+ export declare function retireLegacyRulesFile(workspaceRoot: string, relPath: string): Promise<void>;
53
+ //# sourceMappingURL=rulesFiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rulesFiles.d.ts","sourceRoot":"","sources":["../../src/harness/rulesFiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIzD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,CAI7D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAWxG;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,YAAY,EAAE,EACpB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAKxB;AAED,oFAAoF;AACpF,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASrG;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,YAAY,EAAE,EACpB,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED,0EAA0E;AAC1E,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMrG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3F"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * rulesFiles.ts — the two ways a rule set reaches a harness's instructions.
3
+ *
4
+ * Which file each harness reads is `HARNESS_RULES_FILES` in
5
+ * `@intutic/shared-types`, with the product documentation that says so. The
6
+ * adapters write through these helpers, and `rulesFiles.test.ts` checks every
7
+ * adapter writes where the map says and nowhere else.
8
+ *
9
+ * - {@link writeRulesSectionFile}: a file the user also writes (`CLAUDE.md`,
10
+ * `AGENTS.md`, `GEMINI.md`, `.goosehints`, ...). The rule sets go between
11
+ * the INTUTIC:RULES markers and the rest of the file is the user's.
12
+ * - {@link writeOwnRulesFile}: a file of Intutic's own in a directory the
13
+ * product reads every file of (`.cursor/rules/`, `.continue/rules/`, ...).
14
+ *
15
+ * Neither carries a sync time: the same rule sets give the same bytes, so a
16
+ * sync with nothing new leaves the file alone.
17
+ *
18
+ * @module
19
+ */
20
+ import { join } from 'node:path';
21
+ import { readFile } from 'node:fs/promises';
22
+ import { retireRulesFile, rulesSectionOf, writeOwnedFile, writeRulesSection } from '@intutic/sync-daemon';
23
+ import { hashFile, hashString } from '../lib/hash.js';
24
+ /**
25
+ * One markdown section per SOP. Each SOP the control plane synced ends with
26
+ * its `sop://` pointer comment, which maps the rules in the file back to the
27
+ * SOP that produced them.
28
+ */
29
+ export function buildSopSections(sops) {
30
+ return sops
31
+ .map((sop) => `## ${sop.title}\n\n${sop.content}${sop.sopRef ? `\n${sop.sopRef}` : ''}`)
32
+ .join('\n\n---\n\n');
33
+ }
34
+ /**
35
+ * The rule sets as markdown: the generated header (which `intutic disconnect`
36
+ * recognises), the proxy URL, one section per SOP.
37
+ */
38
+ export function buildRulesBody(sops, proxyUrl, shape) {
39
+ return [
40
+ '# Intutic Governance Rules (auto-generated)',
41
+ shape === 'section'
42
+ ? '# DO NOT EDIT this section — managed by intutic sync daemon; edit outside the INTUTIC:RULES markers'
43
+ : '# DO NOT EDIT — managed by intutic sync daemon; put rules of your own in another file',
44
+ '',
45
+ `> **Proxy URL:** \`${proxyUrl}\``,
46
+ '',
47
+ buildSopSections(sops),
48
+ ].join('\n');
49
+ }
50
+ /**
51
+ * Writes the rule sets as the marked section of `relPath`. Nothing is written
52
+ * without a rule set. Returns the absolute path, or null.
53
+ */
54
+ export async function writeRulesSectionFile(workspaceRoot, relPath, sops, proxyUrl) {
55
+ if (sops.length === 0)
56
+ return null;
57
+ const filePath = join(workspaceRoot, relPath);
58
+ await writeRulesSection(filePath, workspaceRoot, buildRulesBody(sops, proxyUrl, 'section'));
59
+ return filePath;
60
+ }
61
+ /** The section's hash: the user's own edits elsewhere in the file are not drift. */
62
+ export async function rulesSectionHash(workspaceRoot, relPath) {
63
+ let content;
64
+ try {
65
+ content = await readFile(join(workspaceRoot, relPath), 'utf-8');
66
+ }
67
+ catch {
68
+ return null;
69
+ }
70
+ const section = rulesSectionOf(content);
71
+ return section === null ? null : hashString(section);
72
+ }
73
+ /**
74
+ * Writes the rule sets as Intutic's own file `relPath`, after `frontMatter`
75
+ * (the product's own keys, e.g. `alwaysApply: true`) when given. Nothing is
76
+ * written without a rule set. Returns the absolute path, or null.
77
+ */
78
+ export async function writeOwnRulesFile(workspaceRoot, relPath, sops, proxyUrl, frontMatter) {
79
+ if (sops.length === 0)
80
+ return null;
81
+ const filePath = join(workspaceRoot, relPath);
82
+ const body = `${buildRulesBody(sops, proxyUrl, 'file')}\n`;
83
+ const content = frontMatter ? `---\n${frontMatter.trimEnd()}\n---\n\n${body}` : body;
84
+ // Unchanged rule sets leave the file, and its modification time, alone.
85
+ if ((await readFile(filePath, 'utf-8').catch(() => null)) !== content)
86
+ await writeOwnedFile(filePath, workspaceRoot, content);
87
+ return filePath;
88
+ }
89
+ /** The hash of a whole file Intutic owns; null when it does not exist. */
90
+ export async function ownRulesFileHash(workspaceRoot, relPath) {
91
+ try {
92
+ return await hashFile(join(workspaceRoot, relPath));
93
+ }
94
+ catch {
95
+ return null;
96
+ }
97
+ }
98
+ /**
99
+ * Takes back the whole rules file earlier versions wrote at `relPath`, a path
100
+ * the product has stopped reading or reads only as a legacy fallback: the
101
+ * user's original comes back, or the file goes when Intutic created it.
102
+ */
103
+ export function retireLegacyRulesFile(workspaceRoot, relPath) {
104
+ return retireRulesFile(join(workspaceRoot, relPath), workspaceRoot);
105
+ }
106
+ //# sourceMappingURL=rulesFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rulesFiles.js","sourceRoot":"","sources":["../../src/harness/rulesFiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACzG,OAAO,EAAE,QAAQ,EAAE,UAAU,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ACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,aAAqB,EAAE,OAAe;IAC1E,OAAO,eAAe,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,CAAA;AACrE,CAAC"}
@@ -12,8 +12,8 @@
12
12
  * tool calls at all; its choke point is the generated Python CODE STRING,
13
13
  * gated by `intutic_clawde.gate.adapters.smolagents.IntuticPythonExecutor`
14
14
  * (wraps any `PythonExecutor`) — verified live against smolagents==1.26.0 by
15
- * driving a real `CodeAgent.run()` end to end. See that module's doc (and
16
- * TD-377) for what governing code TEXT does and does not cover.
15
+ * driving a real `CodeAgent.run()` end to end. See that module's doc for
16
+ * what governing code TEXT does and does not cover.
17
17
  *
18
18
  * HLD §3.14 — Harness Onboarding Matrix
19
19
  * @module
@@ -12,8 +12,8 @@
12
12
  * tool calls at all; its choke point is the generated Python CODE STRING,
13
13
  * gated by `intutic_clawde.gate.adapters.smolagents.IntuticPythonExecutor`
14
14
  * (wraps any `PythonExecutor`) — verified live against smolagents==1.26.0 by
15
- * driving a real `CodeAgent.run()` end to end. See that module's doc (and
16
- * TD-377) for what governing code TEXT does and does not cover.
15
+ * driving a real `CodeAgent.run()` end to end. See that module's doc for
16
+ * what governing code TEXT does and does not cover.
17
17
  *
18
18
  * HLD §3.14 — Harness Onboarding Matrix
19
19
  * @module
@@ -27,7 +27,7 @@ export const smolagentsAdapter = makeSdkGatedAdapter({
27
27
  pipInstall: 'intutic-clawde[smolagents]',
28
28
  importLine: 'from intutic_clawde.gate.adapters.smolagents import IntuticPythonExecutor',
29
29
  usageSummary: 'IntuticPythonExecutor gates CodeAgent\'s generated code text before running it; ' +
30
- 'ToolCallingAgent tools are covered by @guard/guard_tools instead (see TD-377).',
30
+ 'ToolCallingAgent tools are covered by @guard/guard_tools instead.',
31
31
  docsSlug: 'smolagents',
32
32
  });
33
33
  //# sourceMappingURL=smolagents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"smolagents.js","sourceRoot":"","sources":["../../src/harness/smolagents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IACnD,IAAI,EAAE,WAAW,CAAC,UAAU;IAC5B,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,CAAC,YAAY,CAAC;IACxB,UAAU,EAAE,4BAA4B;IACxC,UAAU,EAAE,2EAA2E;IACvF,YAAY,EACV,kFAAkF;QAClF,gFAAgF;IAClF,QAAQ,EAAE,YAAY;CACvB,CAAC,CAAA"}
1
+ {"version":3,"file":"smolagents.js","sourceRoot":"","sources":["../../src/harness/smolagents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IACnD,IAAI,EAAE,WAAW,CAAC,UAAU;IAC5B,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,CAAC,YAAY,CAAC;IACxB,UAAU,EAAE,4BAA4B;IACxC,UAAU,EAAE,2EAA2E;IACvF,YAAY,EACV,kFAAkF;QAClF,mEAAmE;IACrE,QAAQ,EAAE,YAAY;CACvB,CAAC,CAAA"}
@@ -5,7 +5,6 @@
5
5
  * config to its native config file, and read the current file hash.
6
6
  *
7
7
  * HLD §3.14 — Harness Onboarding Matrix
8
- * LLD #8 — Sync Daemon / CLI
9
8
  * @module
10
9
  */
11
10
  import type { HarnessType, SyncSopEntry } from '@intutic/shared-types';
@@ -13,18 +12,33 @@ import type { HarnessType, SyncSopEntry } from '@intutic/shared-types';
13
12
  export interface IHarnessAdapter {
14
13
  /** Harness type identifier. */
15
14
  readonly type: HarnessType;
16
- /** Config file name relative to workspace root. */
15
+ /**
16
+ * The file drift is tracked on, relative to the workspace root: the
17
+ * harness's rules file when it has one in the workspace (`rulesFileOf` in
18
+ * `@intutic/shared-types`), else the workspace file the adapter writes; ''
19
+ * for none.
20
+ */
17
21
  readonly configFileName: string;
18
22
  /** Detect whether this harness is present in the workspace. */
19
23
  detect(workspaceRoot: string): Promise<boolean>;
20
24
  /**
21
- * Write governance config to the harness's native config file.
22
- * Returns the absolute path written, or null if skipped.
25
+ * Install what governs this harness whatever rule sets the workspace has:
26
+ * its tool-call gate, and the proxy routing that rides with it. The gate
27
+ * enforces the built-in protections, the destructive-command tier, group
28
+ * rules and holds, none of which need a rule set, so `intutic connect` runs
29
+ * this for every configured harness. Absent when the harness has no gate
30
+ * Intutic installs.
31
+ */
32
+ installGate?(workspaceRoot: string, proxyUrl: string): Promise<void>;
33
+ /**
34
+ * Write the rule sets into the file the harness reads as standing
35
+ * instructions — the one `HARNESS_RULES_FILES` names, and no other.
36
+ * `intutic connect` calls it only when a rule set targets the harness, or
37
+ * on a forced sync. Returns the absolute path written, or null if nothing
38
+ * was.
23
39
  */
24
40
  writeConfig(workspaceRoot: string, sops: SyncSopEntry[], proxyUrl: string): Promise<string | null>;
25
41
  /** Read SHA-256 hash of current config file content. Returns null if file doesn't exist. */
26
42
  readCurrentHash(workspaceRoot: string): Promise<string | null>;
27
43
  }
28
- /** Harness config file mapping for file-based harnesses. */
29
- export declare const HARNESS_CONFIG_FILES: Record<HarnessType, string>;
30
44
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEtE,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC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