sentinelayer-cli 0.1.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 (124) hide show
  1. package/README.md +996 -0
  2. package/bin/create-sentinelayer.js +5 -0
  3. package/bin/sentinelayer-cli.js +5 -0
  4. package/bin/sl.js +5 -0
  5. package/package.json +54 -0
  6. package/src/agents/jules/config/definition.js +209 -0
  7. package/src/agents/jules/config/system-prompt.js +175 -0
  8. package/src/agents/jules/error-intake.js +51 -0
  9. package/src/agents/jules/fix-cycle.js +377 -0
  10. package/src/agents/jules/loop.js +367 -0
  11. package/src/agents/jules/pulse.js +319 -0
  12. package/src/agents/jules/stream.js +186 -0
  13. package/src/agents/jules/swarm/file-scanner.js +74 -0
  14. package/src/agents/jules/swarm/index.js +11 -0
  15. package/src/agents/jules/swarm/orchestrator.js +362 -0
  16. package/src/agents/jules/swarm/pattern-hunter.js +123 -0
  17. package/src/agents/jules/swarm/sub-agent.js +308 -0
  18. package/src/agents/jules/tools/auth-audit.js +222 -0
  19. package/src/agents/jules/tools/dispatch.js +327 -0
  20. package/src/agents/jules/tools/file-edit.js +180 -0
  21. package/src/agents/jules/tools/file-read.js +100 -0
  22. package/src/agents/jules/tools/frontend-analyze.js +570 -0
  23. package/src/agents/jules/tools/glob.js +168 -0
  24. package/src/agents/jules/tools/grep.js +228 -0
  25. package/src/agents/jules/tools/index.js +29 -0
  26. package/src/agents/jules/tools/path-guards.js +161 -0
  27. package/src/agents/jules/tools/runtime-audit.js +409 -0
  28. package/src/agents/jules/tools/shell.js +383 -0
  29. package/src/ai/aidenid.js +945 -0
  30. package/src/ai/client.js +508 -0
  31. package/src/ai/domain-target-store.js +268 -0
  32. package/src/ai/identity-store.js +270 -0
  33. package/src/ai/site-store.js +145 -0
  34. package/src/audit/agents/architecture.js +180 -0
  35. package/src/audit/agents/compliance.js +179 -0
  36. package/src/audit/agents/documentation.js +165 -0
  37. package/src/audit/agents/performance.js +145 -0
  38. package/src/audit/agents/security.js +215 -0
  39. package/src/audit/agents/testing.js +172 -0
  40. package/src/audit/orchestrator.js +557 -0
  41. package/src/audit/package.js +204 -0
  42. package/src/audit/registry.js +284 -0
  43. package/src/audit/replay.js +103 -0
  44. package/src/auth/http.js +113 -0
  45. package/src/auth/service.js +848 -0
  46. package/src/auth/session-store.js +345 -0
  47. package/src/cli.js +244 -0
  48. package/src/commands/ai/identity-lifecycle.js +1337 -0
  49. package/src/commands/ai/provision-governance.js +1246 -0
  50. package/src/commands/ai/shared.js +147 -0
  51. package/src/commands/ai.js +11 -0
  52. package/src/commands/apply.js +19 -0
  53. package/src/commands/audit.js +1147 -0
  54. package/src/commands/auth.js +366 -0
  55. package/src/commands/chat.js +191 -0
  56. package/src/commands/config.js +184 -0
  57. package/src/commands/cost.js +311 -0
  58. package/src/commands/daemon/core.js +850 -0
  59. package/src/commands/daemon/extended.js +1048 -0
  60. package/src/commands/daemon/shared.js +213 -0
  61. package/src/commands/daemon.js +11 -0
  62. package/src/commands/guide.js +174 -0
  63. package/src/commands/ingest.js +58 -0
  64. package/src/commands/init.js +55 -0
  65. package/src/commands/legacy-args.js +30 -0
  66. package/src/commands/mcp.js +404 -0
  67. package/src/commands/omargate.js +21 -0
  68. package/src/commands/persona.js +27 -0
  69. package/src/commands/plugin.js +260 -0
  70. package/src/commands/policy.js +132 -0
  71. package/src/commands/prompt.js +238 -0
  72. package/src/commands/review.js +704 -0
  73. package/src/commands/scan.js +788 -0
  74. package/src/commands/spec.js +716 -0
  75. package/src/commands/swarm.js +651 -0
  76. package/src/commands/telemetry.js +202 -0
  77. package/src/commands/watch.js +510 -0
  78. package/src/config/agent-dictionary.js +182 -0
  79. package/src/config/io.js +56 -0
  80. package/src/config/paths.js +18 -0
  81. package/src/config/schema.js +55 -0
  82. package/src/config/service.js +184 -0
  83. package/src/cost/budget.js +235 -0
  84. package/src/cost/history.js +188 -0
  85. package/src/cost/tracker.js +171 -0
  86. package/src/daemon/artifact-lineage.js +534 -0
  87. package/src/daemon/assignment-ledger.js +770 -0
  88. package/src/daemon/ast-parser-layer.js +258 -0
  89. package/src/daemon/budget-governor.js +633 -0
  90. package/src/daemon/callgraph-overlay.js +646 -0
  91. package/src/daemon/error-worker.js +626 -0
  92. package/src/daemon/hybrid-mapper.js +929 -0
  93. package/src/daemon/jira-lifecycle.js +632 -0
  94. package/src/daemon/operator-control.js +657 -0
  95. package/src/daemon/reliability-lane.js +471 -0
  96. package/src/daemon/watchdog.js +971 -0
  97. package/src/guide/generator.js +316 -0
  98. package/src/ingest/engine.js +918 -0
  99. package/src/legacy-cli.js +2435 -0
  100. package/src/mcp/registry.js +695 -0
  101. package/src/memory/blackboard.js +301 -0
  102. package/src/memory/retrieval.js +581 -0
  103. package/src/plugin/manifest.js +553 -0
  104. package/src/policy/packs.js +144 -0
  105. package/src/prompt/generator.js +106 -0
  106. package/src/review/ai-review.js +669 -0
  107. package/src/review/local-review.js +1284 -0
  108. package/src/review/replay.js +235 -0
  109. package/src/review/report.js +664 -0
  110. package/src/review/spec-binding.js +487 -0
  111. package/src/scan/generator.js +351 -0
  112. package/src/spec/generator.js +519 -0
  113. package/src/spec/regenerate.js +237 -0
  114. package/src/spec/templates.js +91 -0
  115. package/src/swarm/dashboard.js +247 -0
  116. package/src/swarm/factory.js +363 -0
  117. package/src/swarm/pentest.js +934 -0
  118. package/src/swarm/registry.js +419 -0
  119. package/src/swarm/report.js +158 -0
  120. package/src/swarm/runtime.js +576 -0
  121. package/src/swarm/scenario-dsl.js +272 -0
  122. package/src/telemetry/ledger.js +302 -0
  123. package/src/ui/markdown.js +220 -0
  124. package/src/ui/progress.js +100 -0
@@ -0,0 +1,106 @@
1
+ export const SUPPORTED_PROMPT_TARGETS = Object.freeze([
2
+ "claude",
3
+ "cursor",
4
+ "copilot",
5
+ "codex",
6
+ "generic",
7
+ ]);
8
+
9
+ const TARGET_GUIDANCE = Object.freeze({
10
+ claude: [
11
+ "Use strict PR-scoped execution with explicit plan -> implement -> verify loop.",
12
+ "Prioritize deterministic checks before optional AI-dependent steps.",
13
+ "Record evidence for every claim in the final report.",
14
+ ],
15
+ cursor: [
16
+ "Apply edits in small, reviewable commits.",
17
+ "Keep changes aligned with existing project conventions and tests.",
18
+ "Run local verification before proposing follow-up iterations.",
19
+ ],
20
+ copilot: [
21
+ "Generate code with strong type and error-path handling.",
22
+ "Avoid introducing implicit behavior changes in existing modules.",
23
+ "Include targeted tests for all new logic paths.",
24
+ ],
25
+ codex: [
26
+ "Operate autonomously but keep one PR scope at a time.",
27
+ "Use deterministic ingest/spec context as primary source of truth.",
28
+ "Fail closed when requirements are ambiguous or unsafe.",
29
+ ],
30
+ generic: [
31
+ "Follow the provided spec exactly.",
32
+ "Implement in incremental, verifiable steps.",
33
+ "Document assumptions and unresolved risks.",
34
+ ],
35
+ });
36
+
37
+ function normalizeTarget(target) {
38
+ const normalized = String(target || "generic").trim().toLowerCase();
39
+ if (!SUPPORTED_PROMPT_TARGETS.includes(normalized)) {
40
+ throw new Error(
41
+ `Unsupported prompt target '${target}'. Use one of: ${SUPPORTED_PROMPT_TARGETS.join(", ")}`
42
+ );
43
+ }
44
+ return normalized;
45
+ }
46
+
47
+ function buildAgentHeader(target) {
48
+ const headers = {
49
+ claude: "Claude Code execution prompt",
50
+ cursor: "Cursor execution prompt",
51
+ copilot: "GitHub Copilot execution prompt",
52
+ codex: "Codex execution prompt",
53
+ generic: "Generic execution prompt",
54
+ };
55
+ return headers[target] || headers.generic;
56
+ }
57
+
58
+ export function resolvePromptTarget(target) {
59
+ return normalizeTarget(target);
60
+ }
61
+
62
+ export function defaultPromptFileName(target) {
63
+ const normalized = normalizeTarget(target);
64
+ if (normalized === "generic") {
65
+ return "PROMPT.md";
66
+ }
67
+ return `PROMPT_${normalized}.md`;
68
+ }
69
+
70
+ export function generateExecutionPrompt({
71
+ specMarkdown,
72
+ target = "generic",
73
+ projectPath,
74
+ generatedAt = new Date().toISOString(),
75
+ } = {}) {
76
+ const resolvedTarget = normalizeTarget(target);
77
+ const guidance = TARGET_GUIDANCE[resolvedTarget] || TARGET_GUIDANCE.generic;
78
+
79
+ const specText = String(specMarkdown || "").trim();
80
+ if (!specText) {
81
+ throw new Error("Spec content is empty. Generate or provide a spec before creating a prompt.");
82
+ }
83
+
84
+ const guidanceMarkdown = guidance.map((item, index) => `${index + 1}. ${item}`).join("\n");
85
+
86
+ return `# ${buildAgentHeader(resolvedTarget)}
87
+
88
+ Generated: ${generatedAt}
89
+ Agent target: ${resolvedTarget}
90
+ Workspace: ${projectPath || "(not provided)"}
91
+
92
+ ## Operating Rules
93
+ ${guidanceMarkdown}
94
+
95
+ ## Execution Workflow
96
+ 1. Read the full spec and derive a concrete PR-scoped implementation plan.
97
+ 2. Implement only the current scope with deterministic checkpoints.
98
+ 3. Run verification commands and capture outcomes.
99
+ 4. Report findings first (bugs/regressions), then summarize changes.
100
+
101
+ ## Source Spec (Authoritative)
102
+ \n\`\`\`markdown
103
+ ${specText}
104
+ \`\`\`
105
+ `;
106
+ }