@isaacriehm/cairn 0.1.0 → 0.1.3
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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/backprop/id.d.ts +0 -14
- package/dist/backprop/id.js +0 -40
- package/dist/backprop/id.js.map +0 -1
- package/dist/backprop/index.d.ts +0 -23
- package/dist/backprop/index.js +0 -21
- package/dist/backprop/index.js.map +0 -1
- package/dist/backprop/prompt.d.ts +0 -16
- package/dist/backprop/prompt.js +0 -101
- package/dist/backprop/prompt.js.map +0 -1
- package/dist/backprop/runner.d.ts +0 -18
- package/dist/backprop/runner.js +0 -95
- package/dist/backprop/runner.js.map +0 -1
- package/dist/backprop/schema.d.ts +0 -61
- package/dist/backprop/schema.js +0 -55
- package/dist/backprop/schema.js.map +0 -1
- package/dist/backprop/types.d.ts +0 -101
- package/dist/backprop/types.js +0 -24
- package/dist/backprop/types.js.map +0 -1
- package/dist/backprop/writer.d.ts +0 -27
- package/dist/backprop/writer.js +0 -301
- package/dist/backprop/writer.js.map +0 -1
- package/dist/claude/error.d.ts +0 -33
- package/dist/claude/error.js +0 -58
- package/dist/claude/error.js.map +0 -1
- package/dist/claude/index.d.ts +0 -3
- package/dist/claude/index.js +0 -3
- package/dist/claude/index.js.map +0 -1
- package/dist/claude/runner.d.ts +0 -11
- package/dist/claude/runner.js +0 -132
- package/dist/claude/runner.js.map +0 -1
- package/dist/claude/types.d.ts +0 -52
- package/dist/claude/types.js +0 -14
- package/dist/claude/types.js.map +0 -1
- package/dist/cli/daemon.d.ts +0 -54
- package/dist/cli/daemon.js +0 -351
- package/dist/cli/daemon.js.map +0 -1
- package/dist/cli/install.d.ts +0 -52
- package/dist/cli/install.js +0 -308
- package/dist/cli/install.js.map +0 -1
- package/dist/cli/mirror.d.ts +0 -1
- package/dist/cli/mirror.js +0 -97
- package/dist/cli/mirror.js.map +0 -1
- package/dist/cli/run.d.ts +0 -1
- package/dist/cli/run.js +0 -174
- package/dist/cli/run.js.map +0 -1
- package/dist/cli/task.d.ts +0 -18
- package/dist/cli/task.js +0 -137
- package/dist/cli/task.js.map +0 -1
- package/dist/cli/watch.d.ts +0 -1
- package/dist/cli/watch.js +0 -73
- package/dist/cli/watch.js.map +0 -1
- package/dist/decision-capture/capture.d.ts +0 -57
- package/dist/decision-capture/capture.js +0 -186
- package/dist/decision-capture/capture.js.map +0 -1
- package/dist/decision-capture/extractor.d.ts +0 -20
- package/dist/decision-capture/extractor.js +0 -103
- package/dist/decision-capture/extractor.js.map +0 -1
- package/dist/decision-capture/id.d.ts +0 -14
- package/dist/decision-capture/id.js +0 -44
- package/dist/decision-capture/id.js.map +0 -1
- package/dist/decision-capture/index.d.ts +0 -25
- package/dist/decision-capture/index.js +0 -21
- package/dist/decision-capture/index.js.map +0 -1
- package/dist/decision-capture/prompt.d.ts +0 -15
- package/dist/decision-capture/prompt.js +0 -68
- package/dist/decision-capture/prompt.js.map +0 -1
- package/dist/decision-capture/refinement-prompt.d.ts +0 -25
- package/dist/decision-capture/refinement-prompt.js +0 -146
- package/dist/decision-capture/refinement-prompt.js.map +0 -1
- package/dist/decision-capture/refinement-schema.d.ts +0 -52
- package/dist/decision-capture/refinement-schema.js +0 -61
- package/dist/decision-capture/refinement-schema.js.map +0 -1
- package/dist/decision-capture/refinement.d.ts +0 -60
- package/dist/decision-capture/refinement.js +0 -439
- package/dist/decision-capture/refinement.js.map +0 -1
- package/dist/decision-capture/schema.d.ts +0 -70
- package/dist/decision-capture/schema.js +0 -71
- package/dist/decision-capture/schema.js.map +0 -1
- package/dist/decision-capture/types.d.ts +0 -201
- package/dist/decision-capture/types.js +0 -20
- package/dist/decision-capture/types.js.map +0 -1
- package/dist/decision-capture/writer.d.ts +0 -90
- package/dist/decision-capture/writer.js +0 -267
- package/dist/decision-capture/writer.js.map +0 -1
- package/dist/frontend/discord/acl.d.ts +0 -6
- package/dist/frontend/discord/acl.js +0 -19
- package/dist/frontend/discord/acl.js.map +0 -1
- package/dist/frontend/discord/channels.d.ts +0 -29
- package/dist/frontend/discord/channels.js +0 -58
- package/dist/frontend/discord/channels.js.map +0 -1
- package/dist/frontend/discord/classifier.d.ts +0 -16
- package/dist/frontend/discord/classifier.js +0 -29
- package/dist/frontend/discord/classifier.js.map +0 -1
- package/dist/frontend/discord/index.d.ts +0 -118
- package/dist/frontend/discord/index.js +0 -1104
- package/dist/frontend/discord/index.js.map +0 -1
- package/dist/frontend/discord/slash.d.ts +0 -18
- package/dist/frontend/discord/slash.js +0 -90
- package/dist/frontend/discord/slash.js.map +0 -1
- package/dist/frontend/inbox.d.ts +0 -17
- package/dist/frontend/inbox.js +0 -30
- package/dist/frontend/inbox.js.map +0 -1
- package/dist/frontend/index.d.ts +0 -8
- package/dist/frontend/index.js +0 -6
- package/dist/frontend/index.js.map +0 -1
- package/dist/frontend/stub/index.d.ts +0 -58
- package/dist/frontend/stub/index.js +0 -144
- package/dist/frontend/stub/index.js.map +0 -1
- package/dist/frontend/types.d.ts +0 -247
- package/dist/frontend/types.js +0 -15
- package/dist/frontend/types.js.map +0 -1
- package/dist/gc/apply.d.ts +0 -26
- package/dist/gc/apply.js +0 -48
- package/dist/gc/apply.js.map +0 -1
- package/dist/gc/canary.d.ts +0 -42
- package/dist/gc/canary.js +0 -134
- package/dist/gc/canary.js.map +0 -1
- package/dist/gc/classify.d.ts +0 -25
- package/dist/gc/classify.js +0 -89
- package/dist/gc/classify.js.map +0 -1
- package/dist/gc/doc-gardening.d.ts +0 -29
- package/dist/gc/doc-gardening.js +0 -146
- package/dist/gc/doc-gardening.js.map +0 -1
- package/dist/gc/frontmatter.d.ts +0 -35
- package/dist/gc/frontmatter.js +0 -111
- package/dist/gc/frontmatter.js.map +0 -1
- package/dist/gc/generator-drift.d.ts +0 -28
- package/dist/gc/generator-drift.js +0 -53
- package/dist/gc/generator-drift.js.map +0 -1
- package/dist/gc/index.d.ts +0 -35
- package/dist/gc/index.js +0 -26
- package/dist/gc/index.js.map +0 -1
- package/dist/gc/quality-update.d.ts +0 -23
- package/dist/gc/quality-update.js +0 -69
- package/dist/gc/quality-update.js.map +0 -1
- package/dist/gc/stub-hits.d.ts +0 -31
- package/dist/gc/stub-hits.js +0 -125
- package/dist/gc/stub-hits.js.map +0 -1
- package/dist/gc/sweep.d.ts +0 -56
- package/dist/gc/sweep.js +0 -178
- package/dist/gc/sweep.js.map +0 -1
- package/dist/gc/types.d.ts +0 -129
- package/dist/gc/types.js +0 -26
- package/dist/gc/types.js.map +0 -1
- package/dist/ground/drift.d.ts +0 -8
- package/dist/ground/drift.js +0 -23
- package/dist/ground/drift.js.map +0 -1
- package/dist/ground/frontmatter.d.ts +0 -20
- package/dist/ground/frontmatter.js +0 -49
- package/dist/ground/frontmatter.js.map +0 -1
- package/dist/ground/glob.d.ts +0 -10
- package/dist/ground/glob.js +0 -46
- package/dist/ground/glob.js.map +0 -1
- package/dist/ground/index.d.ts +0 -14
- package/dist/ground/index.js +0 -10
- package/dist/ground/index.js.map +0 -1
- package/dist/ground/ledgers.d.ts +0 -18
- package/dist/ground/ledgers.js +0 -103
- package/dist/ground/ledgers.js.map +0 -1
- package/dist/ground/manifest.d.ts +0 -10
- package/dist/ground/manifest.js +0 -88
- package/dist/ground/manifest.js.map +0 -1
- package/dist/ground/paths.d.ts +0 -20
- package/dist/ground/paths.js +0 -61
- package/dist/ground/paths.js.map +0 -1
- package/dist/ground/quality-grades.d.ts +0 -11
- package/dist/ground/quality-grades.js +0 -98
- package/dist/ground/quality-grades.js.map +0 -1
- package/dist/ground/schemas.d.ts +0 -306
- package/dist/ground/schemas.js +0 -188
- package/dist/ground/schemas.js.map +0 -1
- package/dist/ground/walk.d.ts +0 -7
- package/dist/ground/walk.js +0 -53
- package/dist/ground/walk.js.map +0 -1
- package/dist/init/detect.d.ts +0 -25
- package/dist/init/detect.js +0 -336
- package/dist/init/detect.js.map +0 -1
- package/dist/init/index.d.ts +0 -14
- package/dist/init/index.js +0 -9
- package/dist/init/index.js.map +0 -1
- package/dist/init/init.d.ts +0 -68
- package/dist/init/init.js +0 -673
- package/dist/init/init.js.map +0 -1
- package/dist/init/mapper.d.ts +0 -160
- package/dist/init/mapper.js +0 -248
- package/dist/init/mapper.js.map +0 -1
- package/dist/init/prompts.d.ts +0 -70
- package/dist/init/prompts.js +0 -80
- package/dist/init/prompts.js.map +0 -1
- package/dist/init/secrets.d.ts +0 -18
- package/dist/init/secrets.js +0 -76
- package/dist/init/secrets.js.map +0 -1
- package/dist/init/seed.d.ts +0 -21
- package/dist/init/seed.js +0 -75
- package/dist/init/seed.js.map +0 -1
- package/dist/init/setup-runners.d.ts +0 -17
- package/dist/init/setup-runners.js +0 -70
- package/dist/init/setup-runners.js.map +0 -1
- package/dist/init/types.d.ts +0 -59
- package/dist/init/types.js +0 -10
- package/dist/init/types.js.map +0 -1
- package/dist/init/walker.d.ts +0 -53
- package/dist/init/walker.js +0 -460
- package/dist/init/walker.js.map +0 -1
- package/dist/init/workflow-block.d.ts +0 -34
- package/dist/init/workflow-block.js +0 -110
- package/dist/init/workflow-block.js.map +0 -1
- package/dist/logger.d.ts +0 -3
- package/dist/logger.js +0 -23
- package/dist/logger.js.map +0 -1
- package/dist/mcp/context.d.ts +0 -16
- package/dist/mcp/context.js +0 -8
- package/dist/mcp/context.js.map +0 -1
- package/dist/mcp/errors.d.ts +0 -17
- package/dist/mcp/errors.js +0 -23
- package/dist/mcp/errors.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -10
- package/dist/mcp/index.js +0 -7
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/path-allowlist.d.ts +0 -25
- package/dist/mcp/path-allowlist.js +0 -66
- package/dist/mcp/path-allowlist.js.map +0 -1
- package/dist/mcp/result.d.ts +0 -8
- package/dist/mcp/result.js +0 -18
- package/dist/mcp/result.js.map +0 -1
- package/dist/mcp/schemas.d.ts +0 -153
- package/dist/mcp/schemas.js +0 -135
- package/dist/mcp/schemas.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -11
- package/dist/mcp/server.js +0 -58
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/telemetry.d.ts +0 -15
- package/dist/mcp/telemetry.js +0 -13
- package/dist/mcp/telemetry.js.map +0 -1
- package/dist/mcp/tools/append.d.ts +0 -8
- package/dist/mcp/tools/append.js +0 -33
- package/dist/mcp/tools/append.js.map +0 -1
- package/dist/mcp/tools/archive.d.ts +0 -8
- package/dist/mcp/tools/archive.js +0 -49
- package/dist/mcp/tools/archive.js.map +0 -1
- package/dist/mcp/tools/ask-operator.d.ts +0 -34
- package/dist/mcp/tools/ask-operator.js +0 -93
- package/dist/mcp/tools/ask-operator.js.map +0 -1
- package/dist/mcp/tools/canonical-for-topic.d.ts +0 -6
- package/dist/mcp/tools/canonical-for-topic.js +0 -40
- package/dist/mcp/tools/canonical-for-topic.js.map +0 -1
- package/dist/mcp/tools/decision-get.d.ts +0 -6
- package/dist/mcp/tools/decision-get.js +0 -49
- package/dist/mcp/tools/decision-get.js.map +0 -1
- package/dist/mcp/tools/decisions-for-symbol.d.ts +0 -7
- package/dist/mcp/tools/decisions-for-symbol.js +0 -42
- package/dist/mcp/tools/decisions-for-symbol.js.map +0 -1
- package/dist/mcp/tools/decisions-in-scope.d.ts +0 -7
- package/dist/mcp/tools/decisions-in-scope.js +0 -47
- package/dist/mcp/tools/decisions-in-scope.js.map +0 -1
- package/dist/mcp/tools/drop-task.d.ts +0 -12
- package/dist/mcp/tools/drop-task.js +0 -47
- package/dist/mcp/tools/drop-task.js.map +0 -1
- package/dist/mcp/tools/get-full.d.ts +0 -7
- package/dist/mcp/tools/get-full.js +0 -46
- package/dist/mcp/tools/get-full.js.map +0 -1
- package/dist/mcp/tools/ground-get.d.ts +0 -7
- package/dist/mcp/tools/ground-get.js +0 -80
- package/dist/mcp/tools/ground-get.js.map +0 -1
- package/dist/mcp/tools/index.d.ts +0 -3
- package/dist/mcp/tools/index.js +0 -44
- package/dist/mcp/tools/index.js.map +0 -1
- package/dist/mcp/tools/invariant-get.d.ts +0 -6
- package/dist/mcp/tools/invariant-get.js +0 -49
- package/dist/mcp/tools/invariant-get.js.map +0 -1
- package/dist/mcp/tools/invariants-in-scope.d.ts +0 -7
- package/dist/mcp/tools/invariants-in-scope.js +0 -65
- package/dist/mcp/tools/invariants-in-scope.js.map +0 -1
- package/dist/mcp/tools/query-history.d.ts +0 -9
- package/dist/mcp/tools/query-history.js +0 -33
- package/dist/mcp/tools/query-history.js.map +0 -1
- package/dist/mcp/tools/record-decision.d.ts +0 -14
- package/dist/mcp/tools/record-decision.js +0 -101
- package/dist/mcp/tools/record-decision.js.map +0 -1
- package/dist/mcp/tools/record-run-event.d.ts +0 -10
- package/dist/mcp/tools/record-run-event.js +0 -28
- package/dist/mcp/tools/record-run-event.js.map +0 -1
- package/dist/mcp/tools/search.d.ts +0 -9
- package/dist/mcp/tools/search.js +0 -165
- package/dist/mcp/tools/search.js.map +0 -1
- package/dist/mcp/tools/supersedes-chain.d.ts +0 -6
- package/dist/mcp/tools/supersedes-chain.js +0 -66
- package/dist/mcp/tools/supersedes-chain.js.map +0 -1
- package/dist/mcp/tools/timeline.d.ts +0 -9
- package/dist/mcp/tools/timeline.js +0 -65
- package/dist/mcp/tools/timeline.js.map +0 -1
- package/dist/mcp/tools/types.d.ts +0 -9
- package/dist/mcp/tools/types.js +0 -2
- package/dist/mcp/tools/types.js.map +0 -1
- package/dist/mirror/clone.d.ts +0 -6
- package/dist/mirror/clone.js +0 -48
- package/dist/mirror/clone.js.map +0 -1
- package/dist/mirror/dirty-overlap.d.ts +0 -13
- package/dist/mirror/dirty-overlap.js +0 -77
- package/dist/mirror/dirty-overlap.js.map +0 -1
- package/dist/mirror/index.d.ts +0 -7
- package/dist/mirror/index.js +0 -7
- package/dist/mirror/index.js.map +0 -1
- package/dist/mirror/paths.d.ts +0 -18
- package/dist/mirror/paths.js +0 -45
- package/dist/mirror/paths.js.map +0 -1
- package/dist/mirror/push.d.ts +0 -9
- package/dist/mirror/push.js +0 -27
- package/dist/mirror/push.js.map +0 -1
- package/dist/mirror/state.d.ts +0 -4
- package/dist/mirror/state.js +0 -36
- package/dist/mirror/state.js.map +0 -1
- package/dist/mirror/sync.d.ts +0 -9
- package/dist/mirror/sync.js +0 -33
- package/dist/mirror/sync.js.map +0 -1
- package/dist/mirror/types.d.ts +0 -77
- package/dist/mirror/types.js +0 -2
- package/dist/mirror/types.js.map +0 -1
- package/dist/orchestrator/activity-summarizer.d.ts +0 -33
- package/dist/orchestrator/activity-summarizer.js +0 -120
- package/dist/orchestrator/activity-summarizer.js.map +0 -1
- package/dist/orchestrator/inbox.d.ts +0 -78
- package/dist/orchestrator/inbox.js +0 -115
- package/dist/orchestrator/inbox.js.map +0 -1
- package/dist/orchestrator/index.d.ts +0 -9
- package/dist/orchestrator/index.js +0 -7
- package/dist/orchestrator/index.js.map +0 -1
- package/dist/orchestrator/orchestrator.d.ts +0 -154
- package/dist/orchestrator/orchestrator.js +0 -2437
- package/dist/orchestrator/orchestrator.js.map +0 -1
- package/dist/orchestrator/prompt.d.ts +0 -19
- package/dist/orchestrator/prompt.js +0 -50
- package/dist/orchestrator/prompt.js.map +0 -1
- package/dist/orchestrator/queue.d.ts +0 -21
- package/dist/orchestrator/queue.js +0 -80
- package/dist/orchestrator/queue.js.map +0 -1
- package/dist/orchestrator/run-log.d.ts +0 -53
- package/dist/orchestrator/run-log.js +0 -92
- package/dist/orchestrator/run-log.js.map +0 -1
- package/dist/orchestrator/runner.d.ts +0 -56
- package/dist/orchestrator/runner.js +0 -172
- package/dist/orchestrator/runner.js.map +0 -1
- package/dist/orchestrator/tool-digest.d.ts +0 -35
- package/dist/orchestrator/tool-digest.js +0 -116
- package/dist/orchestrator/tool-digest.js.map +0 -1
- package/dist/orchestrator/types.d.ts +0 -263
- package/dist/orchestrator/types.js +0 -2
- package/dist/orchestrator/types.js.map +0 -1
- package/dist/orchestrator/workspace.d.ts +0 -21
- package/dist/orchestrator/workspace.js +0 -31
- package/dist/orchestrator/workspace.js.map +0 -1
- package/dist/profiles/index.d.ts +0 -3
- package/dist/profiles/index.js +0 -3
- package/dist/profiles/index.js.map +0 -1
- package/dist/profiles/registry.d.ts +0 -5
- package/dist/profiles/registry.js +0 -31
- package/dist/profiles/registry.js.map +0 -1
- package/dist/profiles/types.d.ts +0 -48
- package/dist/profiles/types.js +0 -11
- package/dist/profiles/types.js.map +0 -1
- package/dist/profiles/unknown.d.ts +0 -9
- package/dist/profiles/unknown.js +0 -17
- package/dist/profiles/unknown.js.map +0 -1
- package/dist/reviewer/index.d.ts +0 -6
- package/dist/reviewer/index.js +0 -5
- package/dist/reviewer/index.js.map +0 -1
- package/dist/reviewer/prompt.d.ts +0 -11
- package/dist/reviewer/prompt.js +0 -132
- package/dist/reviewer/prompt.js.map +0 -1
- package/dist/reviewer/remediation.d.ts +0 -15
- package/dist/reviewer/remediation.js +0 -61
- package/dist/reviewer/remediation.js.map +0 -1
- package/dist/reviewer/reviewer.d.ts +0 -9
- package/dist/reviewer/reviewer.js +0 -89
- package/dist/reviewer/reviewer.js.map +0 -1
- package/dist/reviewer/schema.d.ts +0 -45
- package/dist/reviewer/schema.js +0 -43
- package/dist/reviewer/schema.js.map +0 -1
- package/dist/reviewer/types.d.ts +0 -74
- package/dist/reviewer/types.js +0 -14
- package/dist/reviewer/types.js.map +0 -1
- package/dist/sensors/attestation.d.ts +0 -44
- package/dist/sensors/attestation.js +0 -262
- package/dist/sensors/attestation.js.map +0 -1
- package/dist/sensors/catalog.d.ts +0 -41
- package/dist/sensors/catalog.js +0 -123
- package/dist/sensors/catalog.js.map +0 -1
- package/dist/sensors/decisions.d.ts +0 -30
- package/dist/sensors/decisions.js +0 -393
- package/dist/sensors/decisions.js.map +0 -1
- package/dist/sensors/diff.d.ts +0 -27
- package/dist/sensors/diff.js +0 -148
- package/dist/sensors/diff.js.map +0 -1
- package/dist/sensors/index.d.ts +0 -13
- package/dist/sensors/index.js +0 -9
- package/dist/sensors/index.js.map +0 -1
- package/dist/sensors/remediation.d.ts +0 -20
- package/dist/sensors/remediation.js +0 -65
- package/dist/sensors/remediation.js.map +0 -1
- package/dist/sensors/runner.d.ts +0 -44
- package/dist/sensors/runner.js +0 -95
- package/dist/sensors/runner.js.map +0 -1
- package/dist/sensors/structural.d.ts +0 -30
- package/dist/sensors/structural.js +0 -204
- package/dist/sensors/structural.js.map +0 -1
- package/dist/sensors/stub-catalog.d.ts +0 -39
- package/dist/sensors/stub-catalog.js +0 -115
- package/dist/sensors/stub-catalog.js.map +0 -1
- package/dist/sensors/types.d.ts +0 -135
- package/dist/sensors/types.js +0 -14
- package/dist/sensors/types.js.map +0 -1
- package/dist/tier0/classify.d.ts +0 -5
- package/dist/tier0/classify.js +0 -91
- package/dist/tier0/classify.js.map +0 -1
- package/dist/tier0/index.d.ts +0 -3
- package/dist/tier0/index.js +0 -3
- package/dist/tier0/index.js.map +0 -1
- package/dist/tier0/ollama.d.ts +0 -22
- package/dist/tier0/ollama.js +0 -63
- package/dist/tier0/ollama.js.map +0 -1
- package/dist/tier0/types.d.ts +0 -24
- package/dist/tier0/types.js +0 -7
- package/dist/tier0/types.js.map +0 -1
- package/dist/tightener/index.d.ts +0 -4
- package/dist/tightener/index.js +0 -4
- package/dist/tightener/index.js.map +0 -1
- package/dist/tightener/prompt.d.ts +0 -3
- package/dist/tightener/prompt.js +0 -67
- package/dist/tightener/prompt.js.map +0 -1
- package/dist/tightener/schema.d.ts +0 -68
- package/dist/tightener/schema.js +0 -44
- package/dist/tightener/schema.js.map +0 -1
- package/dist/tightener/tighten.d.ts +0 -2
- package/dist/tightener/tighten.js +0 -66
- package/dist/tightener/tighten.js.map +0 -1
- package/dist/tightener/types.d.ts +0 -74
- package/dist/tightener/types.js +0 -6
- package/dist/tightener/types.js.map +0 -1
- package/dist/uat/bundle.d.ts +0 -68
- package/dist/uat/bundle.js +0 -168
- package/dist/uat/bundle.js.map +0 -1
- package/dist/uat/index.d.ts +0 -15
- package/dist/uat/index.js +0 -10
- package/dist/uat/index.js.map +0 -1
- package/dist/uat/persistent.d.ts +0 -64
- package/dist/uat/persistent.js +0 -206
- package/dist/uat/persistent.js.map +0 -1
- package/dist/uat/probes/cli.d.ts +0 -11
- package/dist/uat/probes/cli.js +0 -107
- package/dist/uat/probes/cli.js.map +0 -1
- package/dist/uat/probes/http.d.ts +0 -12
- package/dist/uat/probes/http.js +0 -139
- package/dist/uat/probes/http.js.map +0 -1
- package/dist/uat/probes/index.d.ts +0 -21
- package/dist/uat/probes/index.js +0 -30
- package/dist/uat/probes/index.js.map +0 -1
- package/dist/uat/probes/integration.d.ts +0 -18
- package/dist/uat/probes/integration.js +0 -188
- package/dist/uat/probes/integration.js.map +0 -1
- package/dist/uat/probes/sql/config.d.ts +0 -14
- package/dist/uat/probes/sql/config.js +0 -57
- package/dist/uat/probes/sql/config.js.map +0 -1
- package/dist/uat/probes/sql/index.d.ts +0 -29
- package/dist/uat/probes/sql/index.js +0 -43
- package/dist/uat/probes/sql/index.js.map +0 -1
- package/dist/uat/probes/sql/mysql.d.ts +0 -12
- package/dist/uat/probes/sql/mysql.js +0 -96
- package/dist/uat/probes/sql/mysql.js.map +0 -1
- package/dist/uat/probes/sql/pg.d.ts +0 -20
- package/dist/uat/probes/sql/pg.js +0 -102
- package/dist/uat/probes/sql/pg.js.map +0 -1
- package/dist/uat/probes/sql/sqlite.d.ts +0 -9
- package/dist/uat/probes/sql/sqlite.js +0 -58
- package/dist/uat/probes/sql/sqlite.js.map +0 -1
- package/dist/uat/probes/sql/types.d.ts +0 -46
- package/dist/uat/probes/sql/types.js +0 -10
- package/dist/uat/probes/sql/types.js.map +0 -1
- package/dist/uat/probes/sql.d.ts +0 -9
- package/dist/uat/probes/sql.js +0 -119
- package/dist/uat/probes/sql.js.map +0 -1
- package/dist/uat/probes/ui.d.ts +0 -19
- package/dist/uat/probes/ui.js +0 -244
- package/dist/uat/probes/ui.js.map +0 -1
- package/dist/uat/prompt.d.ts +0 -10
- package/dist/uat/prompt.js +0 -85
- package/dist/uat/prompt.js.map +0 -1
- package/dist/uat/question.d.ts +0 -50
- package/dist/uat/question.js +0 -139
- package/dist/uat/question.js.map +0 -1
- package/dist/uat/rejection.d.ts +0 -58
- package/dist/uat/rejection.js +0 -163
- package/dist/uat/rejection.js.map +0 -1
- package/dist/uat/runner.d.ts +0 -6
- package/dist/uat/runner.js +0 -96
- package/dist/uat/runner.js.map +0 -1
- package/dist/uat/schema.d.ts +0 -322
- package/dist/uat/schema.js +0 -189
- package/dist/uat/schema.js.map +0 -1
- package/dist/uat/types.d.ts +0 -268
- package/dist/uat/types.js +0 -18
- package/dist/uat/types.js.map +0 -1
- package/dist/uat/uat.d.ts +0 -89
- package/dist/uat/uat.js +0 -256
- package/dist/uat/uat.js.map +0 -1
- package/dist/voice/index.d.ts +0 -4
- package/dist/voice/index.js +0 -4
- package/dist/voice/index.js.map +0 -1
- package/dist/voice/model.d.ts +0 -23
- package/dist/voice/model.js +0 -46
- package/dist/voice/model.js.map +0 -1
- package/dist/voice/pipe.d.ts +0 -9
- package/dist/voice/pipe.js +0 -47
- package/dist/voice/pipe.js.map +0 -1
- package/dist/voice/transcribe.d.ts +0 -3
- package/dist/voice/transcribe.js +0 -43
- package/dist/voice/transcribe.js.map +0 -1
- package/dist/voice/types.d.ts +0 -26
- package/dist/voice/types.js +0 -9
- package/dist/voice/types.js.map +0 -1
- package/dist/watch/daemon.d.ts +0 -21
- package/dist/watch/daemon.js +0 -143
- package/dist/watch/daemon.js.map +0 -1
- package/dist/watch/index.d.ts +0 -4
- package/dist/watch/index.js +0 -3
- package/dist/watch/index.js.map +0 -1
- package/dist/watch/regenerate.d.ts +0 -25
- package/dist/watch/regenerate.js +0 -51
- package/dist/watch/regenerate.js.map +0 -1
package/dist/mirror/push.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { simpleGit } from "simple-git";
|
|
2
|
-
import { logger } from "../logger.js";
|
|
3
|
-
import { requireMirrorRecord } from "./state.js";
|
|
4
|
-
const log = logger("mirror.push");
|
|
5
|
-
/**
|
|
6
|
-
* Pushes the mirror's current HEAD to origin. Caller commits first.
|
|
7
|
-
*
|
|
8
|
-
* Force pushes are refused unless `force: true` is explicitly set; the only
|
|
9
|
-
* time the harness sets that is during recovery flows that have explicit
|
|
10
|
-
* operator authorization. Routine pushes never force.
|
|
11
|
-
*/
|
|
12
|
-
export async function pushMirror(opts) {
|
|
13
|
-
const record = requireMirrorRecord(opts.projectName);
|
|
14
|
-
const branch = opts.branch ?? record.defaultBranch;
|
|
15
|
-
const repo = simpleGit(record.mirrorPath);
|
|
16
|
-
const sha = (await repo.revparse(["HEAD"])).trim();
|
|
17
|
-
log.info({ projectName: opts.projectName, branch, sha, force: opts.force === true }, "pushing");
|
|
18
|
-
const args = ["origin", branch];
|
|
19
|
-
if (opts.force === true)
|
|
20
|
-
args.unshift("--force-with-lease");
|
|
21
|
-
const result = await repo.push(args);
|
|
22
|
-
const pushedAt = new Date().toISOString();
|
|
23
|
-
const raw = JSON.stringify(result);
|
|
24
|
-
log.info({ projectName: opts.projectName, branch, sha }, "push complete");
|
|
25
|
-
return { sha, branch, pushedAt, raw };
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=push.js.map
|
package/dist/mirror/push.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/mirror/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAiB;IAChD,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC;IACnD,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAE1C,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,GAAG,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC;IAEhG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;QAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE5D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAEnC,GAAG,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,eAAe,CAAC,CAAC;IAC1E,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AACxC,CAAC"}
|
package/dist/mirror/state.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { MirrorRecord, ProjectName } from "./types.js";
|
|
2
|
-
export declare function readMirrorRecord(projectName: ProjectName): MirrorRecord | null;
|
|
3
|
-
export declare function writeMirrorRecord(record: MirrorRecord): void;
|
|
4
|
-
export declare function requireMirrorRecord(projectName: ProjectName): MirrorRecord;
|
package/dist/mirror/state.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { dirname } from "node:path";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { mirrorRecordPath } from "./paths.js";
|
|
5
|
-
const MirrorRecordSchema = z.object({
|
|
6
|
-
projectName: z.string().min(1),
|
|
7
|
-
userTreePath: z.string().min(1),
|
|
8
|
-
originUrl: z.string().min(1),
|
|
9
|
-
defaultBranch: z.string().min(1),
|
|
10
|
-
mirrorPath: z.string().min(1),
|
|
11
|
-
lastSyncedAt: z.string().nullable(),
|
|
12
|
-
lastSha: z.string().nullable(),
|
|
13
|
-
createdAt: z.string().min(1),
|
|
14
|
-
});
|
|
15
|
-
export function readMirrorRecord(projectName) {
|
|
16
|
-
const path = mirrorRecordPath(projectName);
|
|
17
|
-
if (!existsSync(path))
|
|
18
|
-
return null;
|
|
19
|
-
const raw = readFileSync(path, "utf8");
|
|
20
|
-
const parsed = JSON.parse(raw);
|
|
21
|
-
return MirrorRecordSchema.parse(parsed);
|
|
22
|
-
}
|
|
23
|
-
export function writeMirrorRecord(record) {
|
|
24
|
-
const validated = MirrorRecordSchema.parse(record);
|
|
25
|
-
const path = mirrorRecordPath(record.projectName);
|
|
26
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
27
|
-
writeFileSync(path, `${JSON.stringify(validated, null, 2)}\n`, "utf8");
|
|
28
|
-
}
|
|
29
|
-
export function requireMirrorRecord(projectName) {
|
|
30
|
-
const record = readMirrorRecord(projectName);
|
|
31
|
-
if (!record) {
|
|
32
|
-
throw new Error(`No mirror record for project "${projectName}". Run \`harness mirror init\` first.`);
|
|
33
|
-
}
|
|
34
|
-
return record;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=state.js.map
|
package/dist/mirror/state.js.map
DELETED
|
@@ -1 +0,0 @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Y,CAAC;IAC1C,OAAO,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAoB;IACpD,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAClD,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,WAAwB;IAC1D,MAAM,MAAM,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,iCAAiC,WAAW,uCAAuC,CACpF,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/mirror/sync.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SyncOptions, SyncResult } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Pins the mirror to origin/<branch> via fetch + reset --hard. Caller is
|
|
4
|
-
* responsible for ensuring no in-flight task is touching the mirror — the
|
|
5
|
-
* orchestrator gates this on the FIFO queue idle state.
|
|
6
|
-
*
|
|
7
|
-
* Returns the SHA pin captured immediately after the reset.
|
|
8
|
-
*/
|
|
9
|
-
export declare function syncMirror(opts: SyncOptions): Promise<SyncResult>;
|
package/dist/mirror/sync.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { simpleGit } from "simple-git";
|
|
2
|
-
import { logger } from "../logger.js";
|
|
3
|
-
import { readMirrorRecord, requireMirrorRecord, writeMirrorRecord } from "./state.js";
|
|
4
|
-
const log = logger("mirror.sync");
|
|
5
|
-
/**
|
|
6
|
-
* Pins the mirror to origin/<branch> via fetch + reset --hard. Caller is
|
|
7
|
-
* responsible for ensuring no in-flight task is touching the mirror — the
|
|
8
|
-
* orchestrator gates this on the FIFO queue idle state.
|
|
9
|
-
*
|
|
10
|
-
* Returns the SHA pin captured immediately after the reset.
|
|
11
|
-
*/
|
|
12
|
-
export async function syncMirror(opts) {
|
|
13
|
-
const record = requireMirrorRecord(opts.projectName);
|
|
14
|
-
const branch = opts.branch ?? record.defaultBranch;
|
|
15
|
-
const repo = simpleGit(record.mirrorPath);
|
|
16
|
-
log.info({ projectName: opts.projectName, branch }, "fetching origin");
|
|
17
|
-
await repo.fetch("origin");
|
|
18
|
-
log.info({ projectName: opts.projectName, target: `origin/${branch}` }, "hard-resetting mirror");
|
|
19
|
-
await repo.reset(["--hard", `origin/${branch}`]);
|
|
20
|
-
const sha = (await repo.revparse(["HEAD"])).trim();
|
|
21
|
-
const syncedAt = new Date().toISOString();
|
|
22
|
-
// Re-read in case another process wrote in parallel; merge sync fields only.
|
|
23
|
-
const fresh = readMirrorRecord(opts.projectName) ?? record;
|
|
24
|
-
writeMirrorRecord({
|
|
25
|
-
...fresh,
|
|
26
|
-
defaultBranch: fresh.defaultBranch === branch ? fresh.defaultBranch : fresh.defaultBranch,
|
|
27
|
-
lastSyncedAt: syncedAt,
|
|
28
|
-
lastSha: sha,
|
|
29
|
-
});
|
|
30
|
-
log.info({ projectName: opts.projectName, sha, branch }, "sync complete");
|
|
31
|
-
return { sha, branch, syncedAt };
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=sync.js.map
|
package/dist/mirror/sync.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/mirror/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC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KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa;QACzF,YAAY,EAAE,QAAQ;QACtB,OAAO,EAAE,GAAG;KACb,CAAC,CAAC;IAEH,GAAG,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,eAAe,CAAC,CAAC;IAC1E,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACnC,CAAC"}
|
package/dist/mirror/types.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Project-name slug used as the directory key under
|
|
3
|
-
* ~/.local/harness/{repos,state}/<name>/.
|
|
4
|
-
*
|
|
5
|
-
* Normalized by `normalizeProjectName` from package.json `name` (preferred)
|
|
6
|
-
* or directory name. Lowercased; non-alphanumerics → underscores.
|
|
7
|
-
*/
|
|
8
|
-
export type ProjectName = string;
|
|
9
|
-
/**
|
|
10
|
-
* Persisted at ~/.local/harness/state/<projectName>/mirror.json.
|
|
11
|
-
*
|
|
12
|
-
* Owned by the harness; the user's working tree at userTreePath is sacred —
|
|
13
|
-
* harness reads it for dirty-overlap checks, never writes.
|
|
14
|
-
*/
|
|
15
|
-
export interface MirrorRecord {
|
|
16
|
-
projectName: ProjectName;
|
|
17
|
-
/** Absolute path to the user's primary working tree. Read-only for harness. */
|
|
18
|
-
userTreePath: string;
|
|
19
|
-
/** Origin URL discovered at adoption (or supplied). */
|
|
20
|
-
originUrl: string;
|
|
21
|
-
/** Default branch (resolved at adoption from origin/HEAD). */
|
|
22
|
-
defaultBranch: string;
|
|
23
|
-
/** Absolute path to the parallel mirror clone. */
|
|
24
|
-
mirrorPath: string;
|
|
25
|
-
/** ISO timestamp of last successful sync. */
|
|
26
|
-
lastSyncedAt: string | null;
|
|
27
|
-
/** SHA at HEAD after last sync. */
|
|
28
|
-
lastSha: string | null;
|
|
29
|
-
/** ISO timestamp the record was created. */
|
|
30
|
-
createdAt: string;
|
|
31
|
-
}
|
|
32
|
-
export interface SyncResult {
|
|
33
|
-
/** SHA pin captured immediately after fetch + reset. */
|
|
34
|
-
sha: string;
|
|
35
|
-
/** Branch the mirror is pinned to (default origin/<defaultBranch>). */
|
|
36
|
-
branch: string;
|
|
37
|
-
syncedAt: string;
|
|
38
|
-
}
|
|
39
|
-
export interface PushResult {
|
|
40
|
-
/** SHA pushed to origin. */
|
|
41
|
-
sha: string;
|
|
42
|
-
branch: string;
|
|
43
|
-
pushedAt: string;
|
|
44
|
-
/** Stdout from git push, kept for the run event log. */
|
|
45
|
-
raw: string;
|
|
46
|
-
}
|
|
47
|
-
export interface DirtyOverlapResult {
|
|
48
|
-
/** Files with un-committed changes in the user's working tree. */
|
|
49
|
-
dirtyFiles: string[];
|
|
50
|
-
/** Subset of dirtyFiles that match any of the run's target globs. */
|
|
51
|
-
overlappingFiles: string[];
|
|
52
|
-
/** True iff overlappingFiles is non-empty. */
|
|
53
|
-
overlap: boolean;
|
|
54
|
-
}
|
|
55
|
-
export interface CloneOptions {
|
|
56
|
-
projectName: ProjectName;
|
|
57
|
-
userTreePath: string;
|
|
58
|
-
originUrl: string;
|
|
59
|
-
defaultBranch?: string;
|
|
60
|
-
}
|
|
61
|
-
export interface SyncOptions {
|
|
62
|
-
projectName: ProjectName;
|
|
63
|
-
/** Override default branch for this sync (rare). */
|
|
64
|
-
branch?: string;
|
|
65
|
-
}
|
|
66
|
-
export interface PushOptions {
|
|
67
|
-
projectName: ProjectName;
|
|
68
|
-
/** Branch to push; defaults to record.defaultBranch. */
|
|
69
|
-
branch?: string;
|
|
70
|
-
/** Set to true only when explicitly authorized; otherwise refuse force pushes. */
|
|
71
|
-
force?: boolean;
|
|
72
|
-
}
|
|
73
|
-
export interface DirtyOverlapOptions {
|
|
74
|
-
projectName: ProjectName;
|
|
75
|
-
/** Globs from the dispatched run's tightened spec (target_path_globs). */
|
|
76
|
-
targetGlobs: string[];
|
|
77
|
-
}
|
package/dist/mirror/types.js
DELETED
package/dist/mirror/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/mirror/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tier-0 (Ollama llama3.2:3b) summarizer for the implementer's
|
|
3
|
-
* stream-jsonl events.
|
|
4
|
-
*
|
|
5
|
-
* The per-task channel's live status embed shows a static phase badge
|
|
6
|
-
* during the long `running` phase (60-300s typical). Operators want
|
|
7
|
-
* insight into WHAT the agent is doing — which file it's reading,
|
|
8
|
-
* what command it's running, what it's planning. Tier-0 is fast +
|
|
9
|
-
* cheap (~200ms locally, $0/call) so we can refresh on a tight
|
|
10
|
-
* cadence without burning Anthropic plan quota.
|
|
11
|
-
*
|
|
12
|
-
* Input: a sliding window of recent stream-jsonl events.
|
|
13
|
-
* Output: a single-line, present-progressive description (≤120 chars).
|
|
14
|
-
*
|
|
15
|
-
* Failures (Ollama down, parse errors, timeout) return "Working…"
|
|
16
|
-
* gracefully — the live status badge keeps moving, just without the
|
|
17
|
-
* activity nuance.
|
|
18
|
-
*/
|
|
19
|
-
export interface SummarizeActivityArgs {
|
|
20
|
-
/** Recent stream-jsonl events; the function picks out the load-bearing ones. */
|
|
21
|
-
events: ReadonlyArray<Record<string, unknown>>;
|
|
22
|
-
/** Ollama host. Default = process.env OLLAMA_HOST or http://localhost:11434. */
|
|
23
|
-
host?: string;
|
|
24
|
-
/** Ollama model. Default = llama3.2:3b. */
|
|
25
|
-
model?: string;
|
|
26
|
-
/** Per-call timeout. Default 6_000 ms — Tier-0 should be <1s typically. */
|
|
27
|
-
timeoutMs?: number;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Summarize the agent's current activity from a sliding window of
|
|
31
|
-
* events. Returns one line ≤120 chars. Never throws.
|
|
32
|
-
*/
|
|
33
|
-
export declare function summarizeActivity(args: SummarizeActivityArgs): Promise<string>;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tier-0 (Ollama llama3.2:3b) summarizer for the implementer's
|
|
3
|
-
* stream-jsonl events.
|
|
4
|
-
*
|
|
5
|
-
* The per-task channel's live status embed shows a static phase badge
|
|
6
|
-
* during the long `running` phase (60-300s typical). Operators want
|
|
7
|
-
* insight into WHAT the agent is doing — which file it's reading,
|
|
8
|
-
* what command it's running, what it's planning. Tier-0 is fast +
|
|
9
|
-
* cheap (~200ms locally, $0/call) so we can refresh on a tight
|
|
10
|
-
* cadence without burning Anthropic plan quota.
|
|
11
|
-
*
|
|
12
|
-
* Input: a sliding window of recent stream-jsonl events.
|
|
13
|
-
* Output: a single-line, present-progressive description (≤120 chars).
|
|
14
|
-
*
|
|
15
|
-
* Failures (Ollama down, parse errors, timeout) return "Working…"
|
|
16
|
-
* gracefully — the live status badge keeps moving, just without the
|
|
17
|
-
* activity nuance.
|
|
18
|
-
*/
|
|
19
|
-
import { logger } from "../logger.js";
|
|
20
|
-
import { DEFAULT_OLLAMA_HOST, DEFAULT_OLLAMA_MODEL, ollamaGenerate, } from "../tier0/index.js";
|
|
21
|
-
const log = logger("orchestrator.activity");
|
|
22
|
-
const SYSTEM_PROMPT = `You describe what a coding agent is currently doing, in present-progressive English.
|
|
23
|
-
|
|
24
|
-
OUTPUT RULES:
|
|
25
|
-
- ONE LINE only.
|
|
26
|
-
- Maximum 120 characters.
|
|
27
|
-
- No emoji, no markdown, no quotes, no preamble.
|
|
28
|
-
- Start with a verb-ing form: "Reading", "Editing", "Running", "Searching", "Planning", "Thinking".
|
|
29
|
-
- Mention the file path, command, or pattern when present.
|
|
30
|
-
- If you can't tell from the events, output: "Working…".
|
|
31
|
-
|
|
32
|
-
Examples:
|
|
33
|
-
Reading core/src/integrations/oauth.ts
|
|
34
|
-
Editing platform/api/routes/admin.ts
|
|
35
|
-
Running pnpm exec tsc -b
|
|
36
|
-
Searching repo for "process.env"
|
|
37
|
-
Planning migration of session middleware`;
|
|
38
|
-
/**
|
|
39
|
-
* Summarize the agent's current activity from a sliding window of
|
|
40
|
-
* events. Returns one line ≤120 chars. Never throws.
|
|
41
|
-
*/
|
|
42
|
-
export async function summarizeActivity(args) {
|
|
43
|
-
const compact = compactEvents(args.events);
|
|
44
|
-
if (compact.length === 0)
|
|
45
|
-
return "Working…";
|
|
46
|
-
const prompt = `Recent events:\n${compact}\n\nWhat is the agent doing right now?`;
|
|
47
|
-
try {
|
|
48
|
-
const res = await ollamaGenerate({
|
|
49
|
-
host: args.host ?? DEFAULT_OLLAMA_HOST,
|
|
50
|
-
model: args.model ?? DEFAULT_OLLAMA_MODEL,
|
|
51
|
-
prompt,
|
|
52
|
-
system: SYSTEM_PROMPT,
|
|
53
|
-
timeoutMs: args.timeoutMs ?? 6_000,
|
|
54
|
-
});
|
|
55
|
-
const raw = (res.response ?? "").trim();
|
|
56
|
-
const firstLine = raw.split("\n")[0] ?? "";
|
|
57
|
-
return firstLine.replace(/^["'`]+|["'`]+$/g, "").slice(0, 120) || "Working…";
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
log.debug({ err: String(err) }, "tier-0 activity summarize failed");
|
|
61
|
-
return "Working…";
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Pull the load-bearing signals out of stream-jsonl events: tool_use
|
|
66
|
-
* names + paths/commands, and the agent's text snippets. Cap at 12
|
|
67
|
-
* lines so the prompt stays small. Skip user (tool_result) blocks —
|
|
68
|
-
* they're verbose and the surrounding tool_use already captures the
|
|
69
|
-
* intent.
|
|
70
|
-
*/
|
|
71
|
-
function compactEvents(events) {
|
|
72
|
-
const lines = [];
|
|
73
|
-
const recent = events.slice(-30);
|
|
74
|
-
for (const e of recent) {
|
|
75
|
-
if (e["type"] !== "assistant")
|
|
76
|
-
continue;
|
|
77
|
-
const message = e["message"];
|
|
78
|
-
const content = message?.["content"];
|
|
79
|
-
if (!Array.isArray(content))
|
|
80
|
-
continue;
|
|
81
|
-
for (const item of content) {
|
|
82
|
-
if (typeof item !== "object" || item === null)
|
|
83
|
-
continue;
|
|
84
|
-
const it = item;
|
|
85
|
-
const itemType = it["type"];
|
|
86
|
-
if (itemType === "tool_use") {
|
|
87
|
-
const name = typeof it["name"] === "string" ? it["name"] : "?";
|
|
88
|
-
const input = it["input"] ?? {};
|
|
89
|
-
if (name === "Read" || name === "Edit" || name === "Write" || name === "NotebookEdit") {
|
|
90
|
-
const path = input["file_path"] ?? input["path"];
|
|
91
|
-
lines.push(`${name}: ${typeof path === "string" ? path : "?"}`);
|
|
92
|
-
}
|
|
93
|
-
else if (name === "Bash") {
|
|
94
|
-
const cmd = typeof input["command"] === "string" ? input["command"] : "?";
|
|
95
|
-
lines.push(`Bash: ${cmd.slice(0, 140)}`);
|
|
96
|
-
}
|
|
97
|
-
else if (name === "Glob" || name === "Grep") {
|
|
98
|
-
const pattern = typeof input["pattern"] === "string" ? input["pattern"] : "?";
|
|
99
|
-
const path = input["path"];
|
|
100
|
-
lines.push(`${name}: ${pattern.slice(0, 80)}${typeof path === "string" ? ` in ${path}` : ""}`);
|
|
101
|
-
}
|
|
102
|
-
else if (name === "Task") {
|
|
103
|
-
const desc = typeof input["description"] === "string" ? input["description"] : "?";
|
|
104
|
-
lines.push(`Task: ${desc.slice(0, 100)}`);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
lines.push(name);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
else if (itemType === "text") {
|
|
111
|
-
const text = typeof it["text"] === "string" ? it["text"] : "";
|
|
112
|
-
if (text.length > 0) {
|
|
113
|
-
lines.push(`Said: ${text.slice(0, 200)}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return lines.slice(-12).join("\n");
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=activity-summarizer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1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EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;gBAC5C,CAAC;qBAAM,CAAC;oBACN,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC;iBAAM,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;gBAC/B,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAE,EAAE,CAAC,MAAM,CAAY,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1E,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACpB,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { InboxTaskRow } from "./types.js";
|
|
2
|
-
export declare const INBOX_DIR_REL = ".harness/inbox";
|
|
3
|
-
export declare const INBOX_PROCESSED_REL = ".harness/inbox/processed";
|
|
4
|
-
/** Ensure the inbox + processed directories exist. */
|
|
5
|
-
export declare function ensureInboxDirs(repoRoot: string): Promise<void>;
|
|
6
|
-
/**
|
|
7
|
-
* List unprocessed inbox files (sorted by filename, which encodes timestamp).
|
|
8
|
-
* Skips directories — `processed/` is the only known subdir.
|
|
9
|
-
*/
|
|
10
|
-
export declare function listInboxFiles(repoRoot: string): Promise<string[]>;
|
|
11
|
-
export declare function readInboxRow(file: string): Promise<unknown>;
|
|
12
|
-
/** True iff the row's `kind === "task"` and the inner `task` looks valid. */
|
|
13
|
-
export declare function isTaskRow(row: unknown): row is InboxTaskRow;
|
|
14
|
-
/**
|
|
15
|
-
* Decision-direction inbox row shape — produced by the Discord adapter when
|
|
16
|
-
* the operator submits `/direction <text>` OR free-texts a message that
|
|
17
|
-
* Tier-0 classifies as `direction`. Both routes land here for the
|
|
18
|
-
* orchestrator's decision-capture step.
|
|
19
|
-
*/
|
|
20
|
-
export interface InboxDirectionRow {
|
|
21
|
-
kind: "slash" | "free_text";
|
|
22
|
-
source: string;
|
|
23
|
-
received_at: string;
|
|
24
|
-
/** Slash-only — the slash event with options.text. */
|
|
25
|
-
slash?: {
|
|
26
|
-
command: string;
|
|
27
|
-
options: Record<string, string | number | boolean>;
|
|
28
|
-
authorId: string;
|
|
29
|
-
channelId?: string;
|
|
30
|
-
guildId?: string;
|
|
31
|
-
messageId?: string;
|
|
32
|
-
receivedAt: string;
|
|
33
|
-
};
|
|
34
|
-
/** Free-text-only — the classified message body. */
|
|
35
|
-
free_text?: {
|
|
36
|
-
intent: string;
|
|
37
|
-
rawText: string;
|
|
38
|
-
authorId: string;
|
|
39
|
-
channelId?: string;
|
|
40
|
-
guildId?: string;
|
|
41
|
-
messageId?: string;
|
|
42
|
-
receivedAt: string;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* True iff the row is a Decision-capture trigger:
|
|
47
|
-
* - kind=slash, slash.command === "direction"
|
|
48
|
-
* - kind=free_text, free_text.intent === "direction"
|
|
49
|
-
*/
|
|
50
|
-
export declare function isDirectionRow(row: unknown): row is InboxDirectionRow;
|
|
51
|
-
/** Pull the raw direction text out of a direction row. */
|
|
52
|
-
export declare function directionTextOf(row: InboxDirectionRow): string;
|
|
53
|
-
/** Pull the author id out of a direction row. */
|
|
54
|
-
export declare function directionAuthorOf(row: InboxDirectionRow): string;
|
|
55
|
-
/** Pull channel id out of a direction row, when present. */
|
|
56
|
-
export declare function directionChannelOf(row: InboxDirectionRow): string | undefined;
|
|
57
|
-
/**
|
|
58
|
-
* Generic slash-event inbox row — covers /halt, /status, /queue, /eval,
|
|
59
|
-
* /resume, /oops, /help, /agent, /ship-anyway. The orchestrator routes by
|
|
60
|
-
* `slash.command`. /direction is intercepted earlier by `isDirectionRow`
|
|
61
|
-
* so it never reaches this guard's handler chain.
|
|
62
|
-
*/
|
|
63
|
-
export interface InboxSlashRow {
|
|
64
|
-
kind: "slash";
|
|
65
|
-
source: string;
|
|
66
|
-
received_at: string;
|
|
67
|
-
slash: {
|
|
68
|
-
command: string;
|
|
69
|
-
options: Record<string, string | number | boolean>;
|
|
70
|
-
authorId: string;
|
|
71
|
-
channelId?: string;
|
|
72
|
-
guildId?: string;
|
|
73
|
-
messageId?: string;
|
|
74
|
-
receivedAt: string;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export declare function isSlashRow(row: unknown): row is InboxSlashRow;
|
|
78
|
-
export declare function moveToProcessed(repoRoot: string, file: string, outcome: "succeeded" | "failed" | "ignored"): Promise<string>;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { mkdir, readFile, readdir, rename } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { logger } from "../logger.js";
|
|
4
|
-
const log = logger("orchestrator.inbox");
|
|
5
|
-
export const INBOX_DIR_REL = ".harness/inbox";
|
|
6
|
-
export const INBOX_PROCESSED_REL = ".harness/inbox/processed";
|
|
7
|
-
/** Ensure the inbox + processed directories exist. */
|
|
8
|
-
export async function ensureInboxDirs(repoRoot) {
|
|
9
|
-
await mkdir(join(repoRoot, INBOX_DIR_REL), { recursive: true });
|
|
10
|
-
await mkdir(join(repoRoot, INBOX_PROCESSED_REL), { recursive: true });
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* List unprocessed inbox files (sorted by filename, which encodes timestamp).
|
|
14
|
-
* Skips directories — `processed/` is the only known subdir.
|
|
15
|
-
*/
|
|
16
|
-
export async function listInboxFiles(repoRoot) {
|
|
17
|
-
const dir = join(repoRoot, INBOX_DIR_REL);
|
|
18
|
-
let entries;
|
|
19
|
-
try {
|
|
20
|
-
entries = await readdir(dir);
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
if (err.code === "ENOENT")
|
|
24
|
-
return [];
|
|
25
|
-
throw err;
|
|
26
|
-
}
|
|
27
|
-
return entries
|
|
28
|
-
.filter((name) => name.endsWith(".json"))
|
|
29
|
-
.sort()
|
|
30
|
-
.map((name) => join(dir, name));
|
|
31
|
-
}
|
|
32
|
-
export async function readInboxRow(file) {
|
|
33
|
-
const text = await readFile(file, "utf8");
|
|
34
|
-
return JSON.parse(text);
|
|
35
|
-
}
|
|
36
|
-
/** True iff the row's `kind === "task"` and the inner `task` looks valid. */
|
|
37
|
-
export function isTaskRow(row) {
|
|
38
|
-
if (typeof row !== "object" || row === null)
|
|
39
|
-
return false;
|
|
40
|
-
const r = row;
|
|
41
|
-
if (r["kind"] !== "task")
|
|
42
|
-
return false;
|
|
43
|
-
const t = r["task"];
|
|
44
|
-
if (typeof t !== "object" || t === null)
|
|
45
|
-
return false;
|
|
46
|
-
const tt = t;
|
|
47
|
-
return typeof tt["rawText"] === "string" && typeof tt["authorId"] === "string";
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* True iff the row is a Decision-capture trigger:
|
|
51
|
-
* - kind=slash, slash.command === "direction"
|
|
52
|
-
* - kind=free_text, free_text.intent === "direction"
|
|
53
|
-
*/
|
|
54
|
-
export function isDirectionRow(row) {
|
|
55
|
-
if (typeof row !== "object" || row === null)
|
|
56
|
-
return false;
|
|
57
|
-
const r = row;
|
|
58
|
-
if (r["kind"] === "slash") {
|
|
59
|
-
const s = r["slash"];
|
|
60
|
-
if (typeof s !== "object" || s === null)
|
|
61
|
-
return false;
|
|
62
|
-
const ss = s;
|
|
63
|
-
return ss["command"] === "direction" && typeof ss["authorId"] === "string";
|
|
64
|
-
}
|
|
65
|
-
if (r["kind"] === "free_text") {
|
|
66
|
-
const f = r["free_text"];
|
|
67
|
-
if (typeof f !== "object" || f === null)
|
|
68
|
-
return false;
|
|
69
|
-
const ff = f;
|
|
70
|
-
return (ff["intent"] === "direction" &&
|
|
71
|
-
typeof ff["rawText"] === "string" &&
|
|
72
|
-
typeof ff["authorId"] === "string");
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
/** Pull the raw direction text out of a direction row. */
|
|
77
|
-
export function directionTextOf(row) {
|
|
78
|
-
if (row.kind === "slash") {
|
|
79
|
-
const text = row.slash?.options["text"];
|
|
80
|
-
return typeof text === "string" ? text : "";
|
|
81
|
-
}
|
|
82
|
-
return row.free_text?.rawText ?? "";
|
|
83
|
-
}
|
|
84
|
-
/** Pull the author id out of a direction row. */
|
|
85
|
-
export function directionAuthorOf(row) {
|
|
86
|
-
if (row.kind === "slash")
|
|
87
|
-
return row.slash?.authorId ?? "";
|
|
88
|
-
return row.free_text?.authorId ?? "";
|
|
89
|
-
}
|
|
90
|
-
/** Pull channel id out of a direction row, when present. */
|
|
91
|
-
export function directionChannelOf(row) {
|
|
92
|
-
if (row.kind === "slash")
|
|
93
|
-
return row.slash?.channelId;
|
|
94
|
-
return row.free_text?.channelId;
|
|
95
|
-
}
|
|
96
|
-
export function isSlashRow(row) {
|
|
97
|
-
if (typeof row !== "object" || row === null)
|
|
98
|
-
return false;
|
|
99
|
-
const r = row;
|
|
100
|
-
if (r["kind"] !== "slash")
|
|
101
|
-
return false;
|
|
102
|
-
const s = r["slash"];
|
|
103
|
-
if (typeof s !== "object" || s === null)
|
|
104
|
-
return false;
|
|
105
|
-
const ss = s;
|
|
106
|
-
return (typeof ss["command"] === "string" && typeof ss["authorId"] === "string");
|
|
107
|
-
}
|
|
108
|
-
export async function moveToProcessed(repoRoot, file, outcome) {
|
|
109
|
-
const base = file.split("/").pop() ?? "";
|
|
110
|
-
const dest = join(repoRoot, INBOX_PROCESSED_REL, `${base.replace(/\.json$/, "")}.${outcome}.json`);
|
|
111
|
-
await rename(file, dest);
|
|
112
|
-
log.debug({ from: file, to: dest }, "inbox row moved to processed");
|
|
113
|
-
return dest;
|
|
114
|
-
}
|
|
115
|
-
//# sourceMapp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C;AACd,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { Orchestrator } from "./orchestrator.js";
|
|
2
|
-
export { ensureInboxDirs, INBOX_DIR_REL, INBOX_PROCESSED_REL, isTaskRow, listInboxFiles, moveToProcessed, readInboxRow, } from "./inbox.js";
|
|
3
|
-
export { QUEUE_FILE_REL, TaskQueue } from "./queue.js";
|
|
4
|
-
export { prepareWorkspace } from "./workspace.js";
|
|
5
|
-
export { runImplementer } from "./runner.js";
|
|
6
|
-
export { loadWorkflowTemplate, renderTemplate } from "./prompt.js";
|
|
7
|
-
export type { ImplementerOptions, ImplementerResult, } from "./runner.js";
|
|
8
|
-
export type { WorkspacePrepResult } from "./workspace.js";
|
|
9
|
-
export type { InboxTaskRow, OrchestratorOptions, QueueEntry, RunMeta, RunPhase, } from "./types.js";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { Orchestrator } from "./orchestrator.js";
|
|
2
|
-
export { ensureInboxDirs, INBOX_DIR_REL, INBOX_PROCESSED_REL, isTaskRow, listInboxFiles, moveToProcessed, readInboxRow, } from "./inbox.js";
|
|
3
|
-
export { QUEUE_FILE_REL, TaskQueue } from "./queue.js";
|
|
4
|
-
export { prepareWorkspace } from "./workspace.js";
|
|
5
|
-
export { runImplementer } from "./runner.js";
|
|
6
|
-
export { loadWorkflowTemplate, renderTemplate } from "./prompt.js";
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,eAAe,EACf,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|