@intutic/cli 2.4.0 → 2.5.1

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 (157) hide show
  1. package/README.md +27 -16
  2. package/dist/cli.js +56 -12
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/attenuate.d.ts +9 -8
  5. package/dist/commands/attenuate.d.ts.map +1 -1
  6. package/dist/commands/attenuate.js +18 -11
  7. package/dist/commands/attenuate.js.map +1 -1
  8. package/dist/commands/budget.d.ts.map +1 -1
  9. package/dist/commands/budget.js +3 -6
  10. package/dist/commands/budget.js.map +1 -1
  11. package/dist/commands/chaos.d.ts +40 -0
  12. package/dist/commands/chaos.d.ts.map +1 -0
  13. package/dist/commands/chaos.js +253 -0
  14. package/dist/commands/chaos.js.map +1 -0
  15. package/dist/commands/connect.d.ts +7 -0
  16. package/dist/commands/connect.d.ts.map +1 -1
  17. package/dist/commands/connect.js +79 -31
  18. package/dist/commands/connect.js.map +1 -1
  19. package/dist/commands/disconnect.d.ts +11 -1
  20. package/dist/commands/disconnect.d.ts.map +1 -1
  21. package/dist/commands/disconnect.js +18 -3
  22. package/dist/commands/disconnect.js.map +1 -1
  23. package/dist/commands/doctor.d.ts +7 -0
  24. package/dist/commands/doctor.d.ts.map +1 -1
  25. package/dist/commands/doctor.js +21 -17
  26. package/dist/commands/doctor.js.map +1 -1
  27. package/dist/commands/enforce.d.ts +14 -1
  28. package/dist/commands/enforce.d.ts.map +1 -1
  29. package/dist/commands/enforce.js +21 -3
  30. package/dist/commands/enforce.js.map +1 -1
  31. package/dist/commands/exec.d.ts +29 -1
  32. package/dist/commands/exec.d.ts.map +1 -1
  33. package/dist/commands/exec.js +72 -35
  34. package/dist/commands/exec.js.map +1 -1
  35. package/dist/commands/gateway.d.ts.map +1 -1
  36. package/dist/commands/gateway.js +3 -3
  37. package/dist/commands/gateway.js.map +1 -1
  38. package/dist/commands/guardrails.d.ts.map +1 -1
  39. package/dist/commands/guardrails.js +10 -8
  40. package/dist/commands/guardrails.js.map +1 -1
  41. package/dist/commands/integrity.d.ts.map +1 -1
  42. package/dist/commands/integrity.js +4 -1
  43. package/dist/commands/integrity.js.map +1 -1
  44. package/dist/commands/judge.d.ts.map +1 -1
  45. package/dist/commands/judge.js +6 -9
  46. package/dist/commands/judge.js.map +1 -1
  47. package/dist/commands/login.js +4 -4
  48. package/dist/commands/login.js.map +1 -1
  49. package/dist/commands/policy.d.ts +16 -0
  50. package/dist/commands/policy.d.ts.map +1 -1
  51. package/dist/commands/policy.js +90 -8
  52. package/dist/commands/policy.js.map +1 -1
  53. package/dist/commands/siem.d.ts.map +1 -1
  54. package/dist/commands/siem.js.map +1 -1
  55. package/dist/commands/skill.d.ts +52 -1
  56. package/dist/commands/skill.d.ts.map +1 -1
  57. package/dist/commands/skill.js +147 -40
  58. package/dist/commands/skill.js.map +1 -1
  59. package/dist/commands/sops.d.ts +61 -50
  60. package/dist/commands/sops.d.ts.map +1 -1
  61. package/dist/commands/sops.js +425 -166
  62. package/dist/commands/sops.js.map +1 -1
  63. package/dist/commands/start.d.ts.map +1 -1
  64. package/dist/commands/start.js +2 -1
  65. package/dist/commands/start.js.map +1 -1
  66. package/dist/commands/status.d.ts.map +1 -1
  67. package/dist/commands/status.js +2 -1
  68. package/dist/commands/status.js.map +1 -1
  69. package/dist/commands/traces.d.ts.map +1 -1
  70. package/dist/commands/traces.js +4 -3
  71. package/dist/commands/traces.js.map +1 -1
  72. package/dist/config/paths.d.ts +15 -9
  73. package/dist/config/paths.d.ts.map +1 -1
  74. package/dist/config/paths.js +24 -10
  75. package/dist/config/paths.js.map +1 -1
  76. package/dist/harness/ag2.d.ts +4 -2
  77. package/dist/harness/ag2.d.ts.map +1 -1
  78. package/dist/harness/ag2.js +4 -2
  79. package/dist/harness/ag2.js.map +1 -1
  80. package/dist/harness/autogen.d.ts +10 -11
  81. package/dist/harness/autogen.d.ts.map +1 -1
  82. package/dist/harness/autogen.js +14 -15
  83. package/dist/harness/autogen.js.map +1 -1
  84. package/dist/harness/detector.d.ts.map +1 -1
  85. package/dist/harness/detector.js +5 -2
  86. package/dist/harness/detector.js.map +1 -1
  87. package/dist/harness/openhands.d.ts.map +1 -1
  88. package/dist/harness/openhands.js +3 -4
  89. package/dist/harness/openhands.js.map +1 -1
  90. package/dist/harness/windsurf.d.ts.map +1 -1
  91. package/dist/harness/windsurf.js +4 -2
  92. package/dist/harness/windsurf.js.map +1 -1
  93. package/dist/lib/api.d.ts +7 -3
  94. package/dist/lib/api.d.ts.map +1 -1
  95. package/dist/lib/caTrust.d.ts +43 -1
  96. package/dist/lib/caTrust.d.ts.map +1 -1
  97. package/dist/lib/caTrust.js +109 -9
  98. package/dist/lib/caTrust.js.map +1 -1
  99. package/dist/lib/chaos/experiment.d.ts +18 -0
  100. package/dist/lib/chaos/experiment.d.ts.map +1 -0
  101. package/dist/lib/chaos/experiment.js +40 -0
  102. package/dist/lib/chaos/experiment.js.map +1 -0
  103. package/dist/lib/chaos/probes.d.ts +97 -0
  104. package/dist/lib/chaos/probes.d.ts.map +1 -0
  105. package/dist/lib/chaos/probes.js +191 -0
  106. package/dist/lib/chaos/probes.js.map +1 -0
  107. package/dist/lib/chaos/runner.d.ts +131 -0
  108. package/dist/lib/chaos/runner.d.ts.map +1 -0
  109. package/dist/lib/chaos/runner.js +340 -0
  110. package/dist/lib/chaos/runner.js.map +1 -0
  111. package/dist/lib/chaos/workspace.d.ts +70 -0
  112. package/dist/lib/chaos/workspace.d.ts.map +1 -0
  113. package/dist/lib/chaos/workspace.js +216 -0
  114. package/dist/lib/chaos/workspace.js.map +1 -0
  115. package/dist/lib/ciscoScanner.d.ts +9 -4
  116. package/dist/lib/ciscoScanner.d.ts.map +1 -1
  117. package/dist/lib/ciscoScanner.js +42 -8
  118. package/dist/lib/ciscoScanner.js.map +1 -1
  119. package/dist/lib/decisionsLogRefresh.d.ts.map +1 -1
  120. package/dist/lib/decisionsLogRefresh.js +6 -2
  121. package/dist/lib/decisionsLogRefresh.js.map +1 -1
  122. package/dist/lib/enforcementState.d.ts +7 -0
  123. package/dist/lib/enforcementState.d.ts.map +1 -1
  124. package/dist/lib/enforcementState.js +9 -0
  125. package/dist/lib/enforcementState.js.map +1 -1
  126. package/dist/lib/gitHooks.d.ts.map +1 -1
  127. package/dist/lib/gitHooks.js +6 -4
  128. package/dist/lib/gitHooks.js.map +1 -1
  129. package/dist/lib/mdmManifest.d.ts.map +1 -1
  130. package/dist/lib/mdmManifest.js +33 -3
  131. package/dist/lib/mdmManifest.js.map +1 -1
  132. package/dist/lib/proxyBinary.d.ts +11 -0
  133. package/dist/lib/proxyBinary.d.ts.map +1 -1
  134. package/dist/lib/proxyBinary.js +16 -0
  135. package/dist/lib/proxyBinary.js.map +1 -1
  136. package/dist/lib/sandbox/firecracker.d.ts.map +1 -1
  137. package/dist/lib/sandbox/firecracker.js +4 -1
  138. package/dist/lib/sandbox/firecracker.js.map +1 -1
  139. package/dist/lib/sandbox/image.d.ts +13 -4
  140. package/dist/lib/sandbox/image.d.ts.map +1 -1
  141. package/dist/lib/sandbox/image.js +25 -8
  142. package/dist/lib/sandbox/image.js.map +1 -1
  143. package/dist/lib/sandbox/oci.d.ts.map +1 -1
  144. package/dist/lib/sandbox/oci.js +18 -3
  145. package/dist/lib/sandbox/oci.js.map +1 -1
  146. package/dist/lib/sandbox/types.d.ts +6 -0
  147. package/dist/lib/sandbox/types.d.ts.map +1 -1
  148. package/dist/lib/sopFrontMatter.d.ts +35 -0
  149. package/dist/lib/sopFrontMatter.d.ts.map +1 -1
  150. package/dist/lib/sopFrontMatter.js +60 -0
  151. package/dist/lib/sopFrontMatter.js.map +1 -1
  152. package/package.json +6 -5
  153. package/resources/chaos/credential-revoked.yaml +28 -0
  154. package/resources/chaos/poisoned-readme.yaml +29 -0
  155. package/resources/chaos/registry-down.yaml +25 -0
  156. package/resources/sandbox/Dockerfile.node +19 -0
  157. package/resources/sandbox/firecracker-launch.sh +8 -7
@@ -1,74 +1,85 @@
1
+ /**
2
+ * What `sops push <name>` reads: the folder `.intutic/sops/<name>/` when
3
+ * there is one, else the single file `.intutic/sops/<name>.md` (or `<name>`
4
+ * given with its `.md`). The file form is the layout `sops pull` writes and
5
+ * the proxy enforces, so a pulled, edited SOP pushes back by its file name.
6
+ */
7
+ export declare function resolvePushTarget(sopsRoot: string, name: string): Promise<{
8
+ dir: string;
9
+ files: string[];
10
+ } | {
11
+ error: string;
12
+ }>;
1
13
  /**
2
14
  * `intutic sops push <name>` — one control-plane SOP per file under
3
- * `.intutic/sops/<name>/*.md`, each carrying that file's own declared
4
- * `title:`/`risk_tier:`/`version:` front matter rather than the folder's
5
- * name and two hardcoded constants.
15
+ * `.intutic/sops/<name>/*.md` (or the single file `.intutic/sops/<name>.md`),
16
+ * each carrying that file's own declared `title:`/`risk_tier:`/`version:`
17
+ * front matter.
6
18
  *
7
- * Previously concatenated every file in the folder into one blob under one
8
- * title derived from the folder name, and always sent `risk_tier: 'LOW'`,
9
- * `version: '1.0.0'` regardless of what the files declared — a folder of
10
- * five SOPs at five different risk tiers pushed as one LOW-tier SOP whose
11
- * title named none of them. Per-file push is what the DB plane can actually
12
- * represent faithfully: `sop_registry` has no concept of "a folder of SOPs,"
13
- * only individual rows.
19
+ * A file that records the SOP it was synced with (`intutic_id:`, written by
20
+ * `sops pull` and by a previous push) updates that SOP in place through
21
+ * `PUT /api/v1/sops/:id`, the same edit path as the dashboard: a DRAFT is
22
+ * edited in place, and an approved SOP gets a new DRAFT version while the
23
+ * approved one keeps enforcing until the draft is promoted. The recorded
24
+ * `intutic_revision:` goes along as `version_counter`, so an edit made on the
25
+ * server since the file was synced is refused (409) instead of overwritten;
26
+ * `--force` sends the server's current counter instead. A file with no record
27
+ * creates a new SOP. Either way, a successful push writes the SOP's id and
28
+ * counter back into the file's front matter (a forked DRAFT's id, when the
29
+ * edit forked one), keeping every other line of the file.
14
30
  *
15
- * Front matter is stripped before the body is sent as `markdownContent` —
16
- * `formatOrgSopConstraints` in `routes/judge.ts` interpolates that field
17
- * verbatim into the judge's system prompt, and a `---\nrisk_tier: HIGH\n---`
18
- * block in the middle of it is noise no judge prompt should carry.
19
- * Declarative enforcement keys (`deny_tools:`, `requires_before:`, ...) have
20
- * no `sop_registry` column, so they are lost from the DB-plane row exactly
21
- * as they always were — this fixes what already had somewhere to go
22
- * (title, risk tier, version), not what does not.
31
+ * Front matter is stripped before the body is sent as `markdown_content` —
32
+ * the judge reads that field verbatim. Declarative enforcement keys
33
+ * (`deny_tools:`, `requires_before:`, ...) have no `sop_registry` column, so
34
+ * they stay file-plane only.
23
35
  */
24
36
  export declare function runSopsPush(name: string, opts: {
25
37
  dev?: boolean;
26
38
  org?: boolean;
39
+ force?: boolean;
40
+ create?: boolean;
27
41
  }): Promise<void>;
28
42
  /**
29
- * `intutic sops pull` — the round trip `push` never had: every workspace SOP
30
- * on the control plane, written to `.intutic/sops/<slug-of-title>.md` with
31
- * front matter reconstructed from the row (`title:`, `risk_tier:`,
32
- * `version:`).
43
+ * `intutic sops pull` — every workspace SOP on the control plane, written
44
+ * with front matter reconstructed from the row (`title:`, `risk_tier:`,
45
+ * `version:`) plus the sync record `sops push` reads: `intutic_id:` (the
46
+ * SOP) and `intutic_revision:` (its `version_counter`).
47
+ *
48
+ * A SOP lands in the local file that already records its id — flat or in a
49
+ * `<name>/` folder — and otherwise in `.intutic/sops/<slug-of-title>.md`. An
50
+ * existing file keeps its other front-matter lines (the enforcing keys the
51
+ * proxy reads); only the synced keys and the body are replaced. An approved
52
+ * version is skipped when a local file already tracks its DRAFT successor,
53
+ * so a push that forked a draft does not come back as a second file.
33
54
  *
34
55
  * Refuses to overwrite a file it did not itself write most recently, unless
35
56
  * `--force` is passed. The check is a recorded hash, not a live diff: every
36
- * file this command writes carries `content_hash: sha256(body)` in its own
37
- * front matter (see `renderSopFile`), and a later pull compares that
38
- * recorded value against the CURRENT local body's hash — not against the
39
- * control plane's. A mismatch means a human edited the file since the last
40
- * pull; a match means nothing local changed, so pulling fresh content from
41
- * the plane (which may itself have changed) is safe. A file with no
42
- * recorded hash at all — hand-authored, or only ever pushed — is treated as
43
- * unverifiable and always requires `--force`, since overwriting a
44
- * hand-written SOP the first time this command sees it would be the
45
- * expensive direction to get wrong.
57
+ * file this command writes carries `content_hash: sha256(body)`, and a later
58
+ * pull compares that against the CURRENT local body's hash. A mismatch means
59
+ * a human edited the file since; a file with no recorded hash at all —
60
+ * hand-authored — is treated as unverifiable and always requires `--force`.
46
61
  */
47
62
  export declare function runSopsPull(opts: {
48
63
  dev?: boolean;
49
64
  force?: boolean;
50
65
  }): Promise<void>;
51
66
  /**
52
- * `intutic sops status` — drift between `.intutic/sops/*.md` and the
53
- * control plane, read-only against the file system (the comparison itself
54
- * never writes a local file).
67
+ * `intutic sops status` — drift between the local SOP files (flat and
68
+ * `<name>/` folders) and the control plane, read-only against the file
69
+ * system.
55
70
  *
56
- * Matched by title, the same heuristic `pull` uses to name files: neither
57
- * plane has a stable identifier the other side carries (a pushed file has
58
- * no `sopId` until after the fact; a filename is not a title). A file
59
- * `pull` has never touched carries no `content_hash:` marker, so this
60
- * cannot tell "hand-authored, never pushed" apart from "hand-authored,
61
- * edited after an old pull" — both report `diverged` rather than guessing.
71
+ * A file that records its SOP (`intutic_id:`) is compared with that SOP; a
72
+ * file without one is matched by title, the heuristic `pull` used before
73
+ * files carried ids. `intutic_revision:` tells whether the server moved since
74
+ * the file was synced, so a file edited on both sides reports `diverged`
75
+ * rather than `local-ahead`. A file with no `content_hash:` marker cannot be
76
+ * told apart as "never pulled" or "edited after an old pull", so it reports
77
+ * `diverged` when its content differs.
62
78
  *
63
- * The comparison itself is computed entirely client-side, same as always.
64
- * What's new: once computed, every matched (non-`push-only`) result is
65
- * reported to `POST /api/v1/sops/git-drift-report`, best-effort — a live
66
- * sync-daemon reconciliation loop is still not attempted here (still "a
67
- * second project", per `apps/docs/guide/gitops-sops.md`), but a human or CI
68
- * job running this command on a schedule now leaves the compliance probe
69
- * (`sop_git_drift`) something to read instead of nothing. Report failures
70
- * never fail the command — the read-only status output above is already
71
- * complete and correct on its own.
79
+ * Every matched (non-`push-only`) result is reported to
80
+ * `POST /api/v1/sops/git-drift-report`, best-effort, so the compliance probe
81
+ * (`sop_git_drift`) has something to read. Report failures never fail the
82
+ * command.
72
83
  */
73
84
  export declare function runSopsStatus(opts: {
74
85
  dev?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"sops.d.ts","sourceRoot":"","sources":["../../src/commands/sops.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoGrG;AAeD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA+EzF;AAID;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgG1E;AAUD;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB3E;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAa3F"}
1
+ {"version":3,"file":"sops.d.ts","sourceRoot":"","sources":["../../src/commands/sops.ts"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