codehere 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +36 -192
  2. package/dist/application/use-cases/check-claimed-tests.js +81 -0
  3. package/dist/application/use-cases/detect-test-weakening.js +237 -0
  4. package/dist/application/use-cases/rerun-tests.js +110 -7
  5. package/dist/index.js +38 -1212
  6. package/dist/infrastructure/orchestration/artifacts-extractor.js +2 -323
  7. package/dist/presentation/cli/commands/check-command.js +178 -23
  8. package/dist/presentation/cli/commands/help-command.js +21 -285
  9. package/dist/ui.js +5 -236
  10. package/dist/utils/version.js +0 -6
  11. package/package.json +9 -38
  12. package/dist/application/services/verdict-service.js +0 -154
  13. package/dist/application/use-cases/assess-cross-vendor.js +0 -126
  14. package/dist/application/use-cases/build-cross-vendor-verdict.js +0 -118
  15. package/dist/application/use-cases/domain-trust.js +0 -110
  16. package/dist/application/use-cases/export-aat.js +0 -107
  17. package/dist/application/use-cases/generate-acceptance-criteria.js +0 -223
  18. package/dist/application/use-cases/generate-final-report.js +0 -259
  19. package/dist/application/use-cases/generate-narration.js +0 -130
  20. package/dist/application/use-cases/generate-thread-title.js +0 -181
  21. package/dist/application/use-cases/narrator-prompt-template.js +0 -158
  22. package/dist/application/use-cases/plan-auto-review.js +0 -57
  23. package/dist/application/use-cases/reconcile-audit.js +0 -100
  24. package/dist/application/use-cases/search-sessions.js +0 -70
  25. package/dist/application/use-cases/should-auto-review.js +0 -71
  26. package/dist/application/use-cases/thread-export.js +0 -245
  27. package/dist/application/use-cases/verify-claim.js +0 -456
  28. package/dist/application/use-cases/write-pass.js +0 -277
  29. package/dist/domain/audit.js +0 -11
  30. package/dist/domain/services/codebase-detector.js +0 -85
  31. package/dist/domain/task.js +0 -91
  32. package/dist/error-handler.js +0 -139
  33. package/dist/infrastructure/completion/bash-completion.js +0 -29
  34. package/dist/infrastructure/completion/fish-completion.js +0 -17
  35. package/dist/infrastructure/completion/zsh-completion.js +0 -25
  36. package/dist/infrastructure/config/config-manager.js +0 -174
  37. package/dist/infrastructure/config/product-context.js +0 -49
  38. package/dist/infrastructure/context/adapters/drawio-source.js +0 -157
  39. package/dist/infrastructure/context/adapters/figma-source.js +0 -198
  40. package/dist/infrastructure/context/adapters/github-issue-source.js +0 -160
  41. package/dist/infrastructure/context/adapters/linear-source.js +0 -190
  42. package/dist/infrastructure/context/context-resolver.js +0 -144
  43. package/dist/infrastructure/context/context-source.js +0 -114
  44. package/dist/infrastructure/context/github-api.js +0 -110
  45. package/dist/infrastructure/context/github-device-flow.js +0 -65
  46. package/dist/infrastructure/context/oauth-flow.js +0 -207
  47. package/dist/infrastructure/context/oauth-store.js +0 -122
  48. package/dist/infrastructure/context/registry-bootstrap.js +0 -95
  49. package/dist/infrastructure/context/write-pass-resolver.js +0 -106
  50. package/dist/infrastructure/cost/budget-config.js +0 -114
  51. package/dist/infrastructure/cost/cost-router.js +0 -97
  52. package/dist/infrastructure/cost/spend-aggregator.js +0 -222
  53. package/dist/infrastructure/cost/team-ledger.js +0 -355
  54. package/dist/infrastructure/discovery/discovery-log.js +0 -85
  55. package/dist/infrastructure/hooks/audit-tip-signature.js +0 -336
  56. package/dist/infrastructure/hooks/claude-sdk-hook.js +0 -1018
  57. package/dist/infrastructure/hooks/hook-mode.js +0 -87
  58. package/dist/infrastructure/hooks/mirror-tool-call-to-audit.js +0 -49
  59. package/dist/infrastructure/hooks/pre-prompt-scan.js +0 -122
  60. package/dist/infrastructure/hooks/session-analyzer.js +0 -177
  61. package/dist/infrastructure/observability/execution-tracer.js +0 -227
  62. package/dist/infrastructure/orchestration/agent-adapter.js +0 -13
  63. package/dist/infrastructure/orchestration/agent-installer.js +0 -101
  64. package/dist/infrastructure/orchestration/agents-config-seed.js +0 -68
  65. package/dist/infrastructure/orchestration/aider-adapter.js +0 -611
  66. package/dist/infrastructure/orchestration/cassette-recorder.js +0 -120
  67. package/dist/infrastructure/orchestration/claude-code-adapter.js +0 -592
  68. package/dist/infrastructure/orchestration/codex-adapter.js +0 -574
  69. package/dist/infrastructure/orchestration/conductor-adapter.js +0 -416
  70. package/dist/infrastructure/orchestration/context-handoff.js +0 -162
  71. package/dist/infrastructure/orchestration/control/codex-control-surface.js +0 -99
  72. package/dist/infrastructure/orchestration/control/control-surface.js +0 -15
  73. package/dist/infrastructure/orchestration/detect-ollama.js +0 -75
  74. package/dist/infrastructure/orchestration/failover-classifier.js +0 -151
  75. package/dist/infrastructure/orchestration/failover-config.js +0 -67
  76. package/dist/infrastructure/orchestration/failover-policy.js +0 -106
  77. package/dist/infrastructure/orchestration/gemini-adapter.js +0 -663
  78. package/dist/infrastructure/orchestration/generic-cli-adapter.js +0 -689
  79. package/dist/infrastructure/orchestration/graphify-context.js +0 -209
  80. package/dist/infrastructure/orchestration/memory-injector.js +0 -380
  81. package/dist/infrastructure/orchestration/mocks/mock-agent-repl.js +0 -388
  82. package/dist/infrastructure/orchestration/mocks/mock-codex-app-server.js +0 -73
  83. package/dist/infrastructure/orchestration/mocks/mock-synthesis.js +0 -83
  84. package/dist/infrastructure/orchestration/mocks/resolve-agent-spawn.js +0 -37
  85. package/dist/infrastructure/orchestration/opencode-adapter.js +0 -580
  86. package/dist/infrastructure/orchestration/progress-aggregator.js +0 -906
  87. package/dist/infrastructure/orchestration/readiness.js +0 -103
  88. package/dist/infrastructure/orchestration/session-manager.js +0 -1590
  89. package/dist/infrastructure/orchestration/session-persistence.js +0 -394
  90. package/dist/infrastructure/orchestration/thread-key-store.js +0 -127
  91. package/dist/infrastructure/orchestration/write-pass-store.js +0 -38
  92. package/dist/infrastructure/protocols/cloud-sync.js +0 -207
  93. package/dist/infrastructure/protocols/mcp-helpers.js +0 -25
  94. package/dist/infrastructure/protocols/mcp-server-impl.js +0 -3935
  95. package/dist/infrastructure/protocols/mcp-tools.js +0 -401
  96. package/dist/infrastructure/protocols/probe-port.js +0 -36
  97. package/dist/infrastructure/protocols/thread-phase.js +0 -105
  98. package/dist/infrastructure/protocols/ui/app-script-artifacts.js +0 -121
  99. package/dist/infrastructure/protocols/ui/app-script-audit-footer.js +0 -44
  100. package/dist/infrastructure/protocols/ui/app-script-audit-verify.js +0 -56
  101. package/dist/infrastructure/protocols/ui/app-script-composer-cost.js +0 -588
  102. package/dist/infrastructure/protocols/ui/app-script-context-sources.js +0 -168
  103. package/dist/infrastructure/protocols/ui/app-script-conversation.js +0 -67
  104. package/dist/infrastructure/protocols/ui/app-script-drawer.js +0 -115
  105. package/dist/infrastructure/protocols/ui/app-script-failover.js +0 -133
  106. package/dist/infrastructure/protocols/ui/app-script-github.js +0 -113
  107. package/dist/infrastructure/protocols/ui/app-script-observer.js +0 -104
  108. package/dist/infrastructure/protocols/ui/app-script-onboarding.js +0 -80
  109. package/dist/infrastructure/protocols/ui/app-script-overlay.js +0 -203
  110. package/dist/infrastructure/protocols/ui/app-script-recovery.js +0 -136
  111. package/dist/infrastructure/protocols/ui/app-script-render.js +0 -166
  112. package/dist/infrastructure/protocols/ui/app-script-share.js +0 -78
  113. package/dist/infrastructure/protocols/ui/app-script-sidebar.js +0 -194
  114. package/dist/infrastructure/protocols/ui/app-script-tour.js +0 -78
  115. package/dist/infrastructure/protocols/ui/app-script-wpass.js +0 -312
  116. package/dist/infrastructure/protocols/ui/app-script.js +0 -2998
  117. package/dist/infrastructure/protocols/ui/font-faces.js +0 -7
  118. package/dist/infrastructure/protocols/ui/styles.js +0 -2147
  119. package/dist/infrastructure/protocols/ui/tokens.js +0 -96
  120. package/dist/infrastructure/protocols/ui-page-v2.js +0 -320
  121. package/dist/infrastructure/protocols/verify-page.js +0 -1677
  122. package/dist/infrastructure/security/file-collection.js +0 -118
  123. package/dist/infrastructure/security/fix-code.js +0 -144
  124. package/dist/infrastructure/security/fix-secret.js +0 -89
  125. package/dist/infrastructure/security/permissions-config.js +0 -235
  126. package/dist/infrastructure/security/scan-types.js +0 -10
  127. package/dist/infrastructure/security/ship-scan.js +0 -195
  128. package/dist/infrastructure/security/trust-scorer.js +0 -724
  129. package/dist/infrastructure/security/vibe-checks.js +0 -99
  130. package/dist/infrastructure/storage/atomic-write.js +0 -86
  131. package/dist/infrastructure/storage/cross-tool-agents.js +0 -268
  132. package/dist/infrastructure/storage/project-thread-migration.js +0 -237
  133. package/dist/infrastructure/storage/project-thread-mirror.js +0 -671
  134. package/dist/infrastructure/storage/project-thread-reader.js +0 -409
  135. package/dist/infrastructure/storage/project-thread-title-backfill.js +0 -214
  136. package/dist/monitoring.js +0 -212
  137. package/dist/presentation/cli/commands/audit-command.js +0 -201
  138. package/dist/presentation/cli/commands/budget-command.js +0 -79
  139. package/dist/presentation/cli/commands/config-command.js +0 -125
  140. package/dist/presentation/cli/commands/context-source-command.js +0 -217
  141. package/dist/presentation/cli/commands/hook-command.js +0 -265
  142. package/dist/presentation/cli/commands/init-command.js +0 -590
  143. package/dist/presentation/cli/commands/memory-command.js +0 -1031
  144. package/dist/presentation/cli/commands/narrator-command.js +0 -101
  145. package/dist/presentation/cli/commands/permission-command.js +0 -105
  146. package/dist/presentation/cli/commands/protocols-builder.js +0 -254
  147. package/dist/presentation/cli/commands/protocols-command.js +0 -84
  148. package/dist/presentation/cli/commands/repo-map-builder.js +0 -247
  149. package/dist/presentation/cli/commands/report-command.js +0 -403
  150. package/dist/presentation/cli/commands/scan-command.js +0 -52
  151. package/dist/presentation/cli/commands/scan-tool-command.js +0 -110
  152. package/dist/presentation/cli/commands/search-command.js +0 -51
  153. package/dist/presentation/cli/commands/setup-command.js +0 -330
  154. package/dist/presentation/cli/commands/status-command.js +0 -614
  155. package/dist/presentation/cli/commands/team-command.js +0 -256
  156. package/dist/presentation/cli/commands/thread-command.js +0 -370
  157. package/dist/presentation/cli/commands/trust-command.js +0 -328
  158. package/dist/presentation/cli/commands/verify-command.js +0 -298
  159. package/dist/presentation/cli/error-display.js +0 -328
  160. package/dist/presentation/cli/repl.js +0 -805
  161. package/dist/presentation/cli/task-deliverable.js +0 -153
  162. package/dist/testing/cassette.js +0 -125
  163. package/dist/testing/replay-adapter.js +0 -147
@@ -1,101 +0,0 @@
1
- /**
2
- * Agent installer — runs the install command for a registered adapter.
3
- *
4
- * Principle #10 (non-technical users first-class): the user clicks a button,
5
- * codehere runs the install, streams output back to the UI. No terminal, no
6
- * copy-paste. If brew isn't present, we fall back to curl/sh or npm-based
7
- * installers. On success, re-check readiness and tell the UI to refresh.
8
- *
9
- * Security: the command comes from adapter source code (built-ins) or from
10
- * the user's own ~/.codehere/agents.yaml (generic adapters) — never from an
11
- * HTTP request parameter. We refuse to execute an arbitrary command supplied
12
- * over the wire.
13
- */
14
- import { spawn } from 'child_process';
15
- import { EventEmitter } from 'events';
16
- /** Execute an install command in a shell so chained commands (&& / || / |)
17
- * work. We need the user's shell rc loaded so brew / npm / path extensions
18
- * resolve — default: `$SHELL -lc "<command>"`. */
19
- export function runInstallCommand(command) {
20
- const emitter = new EventEmitter();
21
- const buffer = [];
22
- let statusValue = 'running';
23
- const startedAt = Date.now();
24
- const emit = (event) => {
25
- buffer.push(event);
26
- emitter.emit('event', event);
27
- };
28
- const shell = process.env.SHELL || '/bin/zsh';
29
- let child;
30
- try {
31
- child = spawn(shell, ['-lc', command], {
32
- env: process.env,
33
- stdio: ['ignore', 'pipe', 'pipe'],
34
- });
35
- }
36
- catch (err) {
37
- statusValue = 'failed';
38
- const msg = err instanceof Error ? err.message : String(err);
39
- queueMicrotask(() => emit({ type: 'error', data: msg }));
40
- return {
41
- get status() {
42
- return statusValue;
43
- },
44
- subscribe(handler) {
45
- for (const e of buffer)
46
- handler(e);
47
- emitter.on('event', handler);
48
- return () => emitter.off('event', handler);
49
- },
50
- kill() {
51
- /* not running */
52
- },
53
- };
54
- }
55
- child.stdout?.on('data', (chunk) => {
56
- emit({ type: 'out', data: chunk.toString('utf-8') });
57
- });
58
- child.stderr?.on('data', (chunk) => {
59
- emit({ type: 'err', data: chunk.toString('utf-8') });
60
- });
61
- child.on('exit', (code) => {
62
- statusValue = code === 0 ? 'completed' : 'failed';
63
- emit({ type: 'done', code, durationMs: Date.now() - startedAt });
64
- });
65
- child.on('error', (err) => {
66
- statusValue = 'failed';
67
- emit({ type: 'error', data: err.message });
68
- });
69
- return {
70
- get status() {
71
- return statusValue;
72
- },
73
- subscribe(handler) {
74
- for (const e of buffer)
75
- handler(e);
76
- emitter.on('event', handler);
77
- return () => emitter.off('event', handler);
78
- },
79
- kill() {
80
- if (statusValue !== 'running')
81
- return;
82
- try {
83
- child.kill('SIGTERM');
84
- }
85
- catch {
86
- /* already dead */
87
- }
88
- },
89
- };
90
- }
91
- /** Convenience: install a registered adapter. Returns null if adapter has no
92
- * installHint configured or is already installed. */
93
- export function installAgent(adapter) {
94
- if (!adapter.checkReadiness)
95
- return null;
96
- const readiness = adapter.checkReadiness();
97
- if (readiness.state !== 'needs_install' || !readiness.installHint?.command)
98
- return null;
99
- return runInstallCommand(readiness.installHint.command);
100
- }
101
- //# sourceMappingURL=agent-installer.js.map
@@ -1,68 +0,0 @@
1
- import { writeFileAtomic } from '../storage/atomic-write.js';
2
- /**
3
- * Seed ~/.codehere/agents.yaml on first daemon start.
4
- *
5
- * Ships with ONE pre-wired generic adapter — Cursor — because it's been verified
6
- * on a real machine (cursor-agent headless, authed via the Cursor subscription).
7
- * It stays hidden in the UI until `cursor-agent` is installed + logged in, so it
8
- * never inflates the agent count dishonestly. Any other CLI agent: users add their
9
- * own entry to `~/.codehere/agents.yaml` and restart the daemon.
10
- *
11
- * Rationale: the bar for shipping a scaffolded entry is "verified on a real
12
- * machine," not "plausible." Cursor met it; the rest stay opt-in via the YAML.
13
- *
14
- * Re-seed never overwrites an existing file.
15
- */
16
- import { existsSync, mkdirSync } from 'fs';
17
- import { homedir } from 'os';
18
- import { join, dirname } from 'path';
19
- const CONFIG_PATH = join(process.env.CODEHERE_HOME || homedir(), '.codehere', 'agents.yaml');
20
- const DEFAULT_YAML = `# codehere — pluggable agent adapters
21
- #
22
- # Built-in adapters (no configuration needed — just install the CLI):
23
- # - Claude Code
24
- # - Codex
25
- # - Aider
26
- # - OpenCode
27
- #
28
- # To add a CLI-based AI coding agent not in the built-in list, uncomment
29
- # and adapt the example below. Safety hook + audit log wrap every subprocess
30
- # regardless of agent, so adding an adapter does not bypass any security
31
- # layer.
32
- #
33
- # agents:
34
- # - id: my-agent
35
- # label: My Agent
36
- # command: my-agent-cli # must be on PATH
37
- # args: [--headless] # fixed args before the prompt
38
- # prompt_via: argv # or "stdin"
39
- # process_pattern: (?:^|/)my-agent-cli(?:\\\\s|$)
40
- # format: text # or "jsonl" if the CLI streams JSON
41
- # install_command: brew install my-agent-cli # optional · enables "Install" button
42
- # install_url: https://example.com/docs # optional · docs link
43
-
44
- # Cursor — verified on a real machine (2026-06-22): cursor-agent runs headless and
45
- # authenticates with your Cursor subscription, so it's a cost-bounded cross-vendor
46
- # peer to the metered APIs. Hidden until \`cursor-agent\` is installed + logged in.
47
- agents:
48
- - id: cursor
49
- label: Cursor
50
- command: cursor-agent
51
- args: [-p, --output-format, stream-json, -f, --model, gpt-5.5-high]
52
- prompt_via: argv
53
- format: jsonl
54
- install_command: curl https://cursor.com/install -fsS | bash
55
- install_url: https://docs.cursor.com/cli
56
- `;
57
- export function seedAgentsConfig() {
58
- try {
59
- if (existsSync(CONFIG_PATH))
60
- return;
61
- mkdirSync(dirname(CONFIG_PATH), { recursive: true });
62
- writeFileAtomic(CONFIG_PATH, DEFAULT_YAML);
63
- }
64
- catch {
65
- /* best-effort */
66
- }
67
- }
68
- //# sourceMappingURL=agents-config-seed.js.map