@matteeh/osq 0.1.0 → 0.2.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.
- package/README.md +415 -72
- package/dist/cli/approve.d.ts +13 -3
- package/dist/cli/approve.d.ts.map +1 -1
- package/dist/cli/approve.js +59 -4
- package/dist/cli/approve.js.map +1 -1
- package/dist/cli/bin.js +0 -0
- package/dist/cli/confirm.d.ts +21 -0
- package/dist/cli/confirm.d.ts.map +1 -0
- package/dist/cli/confirm.js +28 -0
- package/dist/cli/confirm.js.map +1 -0
- package/dist/cli/doctor.d.ts +13 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +23 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/done.d.ts +12 -0
- package/dist/cli/done.d.ts.map +1 -0
- package/dist/cli/done.js +26 -0
- package/dist/cli/done.js.map +1 -0
- package/dist/cli/inbox.d.ts +22 -0
- package/dist/cli/inbox.d.ts.map +1 -0
- package/dist/cli/inbox.js +41 -0
- package/dist/cli/inbox.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +127 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.d.ts +1 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +9 -3
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/lint.d.ts +26 -0
- package/dist/cli/lint.d.ts.map +1 -0
- package/dist/cli/lint.js +60 -0
- package/dist/cli/lint.js.map +1 -0
- package/dist/cli/migrate.d.ts +18 -0
- package/dist/cli/migrate.d.ts.map +1 -0
- package/dist/cli/migrate.js +42 -0
- package/dist/cli/migrate.js.map +1 -0
- package/dist/cli/new.js +1 -1
- package/dist/cli/new.js.map +1 -1
- package/dist/cli/plan-queue.d.ts +50 -0
- package/dist/cli/plan-queue.d.ts.map +1 -0
- package/dist/cli/plan-queue.js +167 -0
- package/dist/cli/plan-queue.js.map +1 -0
- package/dist/cli/plan.d.ts +35 -0
- package/dist/cli/plan.d.ts.map +1 -0
- package/dist/cli/plan.js +153 -0
- package/dist/cli/plan.js.map +1 -0
- package/dist/cli/queue.d.ts +9 -0
- package/dist/cli/queue.d.ts.map +1 -0
- package/dist/cli/queue.js +24 -0
- package/dist/cli/queue.js.map +1 -0
- package/dist/cli/reject.d.ts +8 -0
- package/dist/cli/reject.d.ts.map +1 -0
- package/dist/cli/reject.js +18 -0
- package/dist/cli/reject.js.map +1 -0
- package/dist/cli/report.d.ts +1 -1
- package/dist/cli/report.d.ts.map +1 -1
- package/dist/cli/report.js +141 -14
- package/dist/cli/report.js.map +1 -1
- package/dist/cli/retry.d.ts +7 -0
- package/dist/cli/retry.d.ts.map +1 -0
- package/dist/cli/retry.js +29 -0
- package/dist/cli/retry.js.map +1 -0
- package/dist/cli/serve.d.ts +30 -0
- package/dist/cli/serve.d.ts.map +1 -0
- package/dist/cli/serve.js +136 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +7 -1
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/show.d.ts +2 -1
- package/dist/cli/show.d.ts.map +1 -1
- package/dist/cli/show.js +20 -3
- package/dist/cli/show.js.map +1 -1
- package/dist/cli/status.d.ts +1 -1
- package/dist/cli/status.d.ts.map +1 -1
- package/dist/cli/status.js +2 -2
- package/dist/cli/status.js.map +1 -1
- package/dist/cli/watch.d.ts +9 -6
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +15 -2
- package/dist/cli/watch.js.map +1 -1
- package/dist/core/foundation/config-codex.d.ts +22 -0
- package/dist/core/foundation/config-codex.d.ts.map +1 -0
- package/dist/core/foundation/config-codex.js +58 -0
- package/dist/core/foundation/config-codex.js.map +1 -0
- package/dist/core/foundation/config-doctor.d.ts +14 -0
- package/dist/core/foundation/config-doctor.d.ts.map +1 -0
- package/dist/core/foundation/config-doctor.js +29 -0
- package/dist/core/foundation/config-doctor.js.map +1 -0
- package/dist/core/foundation/config-env.d.ts +3 -0
- package/dist/core/foundation/config-env.d.ts.map +1 -0
- package/dist/core/foundation/config-env.js +22 -0
- package/dist/core/foundation/config-env.js.map +1 -0
- package/dist/core/foundation/config-gates.d.ts +22 -0
- package/dist/core/foundation/config-gates.d.ts.map +1 -0
- package/dist/core/foundation/config-gates.js +43 -0
- package/dist/core/foundation/config-gates.js.map +1 -0
- package/dist/core/foundation/config-pi.d.ts +64 -0
- package/dist/core/foundation/config-pi.d.ts.map +1 -0
- package/dist/core/foundation/config-pi.js +131 -0
- package/dist/core/foundation/config-pi.js.map +1 -0
- package/dist/core/foundation/config-planning.d.ts +24 -0
- package/dist/core/foundation/config-planning.d.ts.map +1 -0
- package/dist/core/foundation/config-planning.js +60 -0
- package/dist/core/foundation/config-planning.js.map +1 -0
- package/dist/core/foundation/config-queue.d.ts +15 -0
- package/dist/core/foundation/config-queue.d.ts.map +1 -0
- package/dist/core/foundation/config-queue.js +24 -0
- package/dist/core/foundation/config-queue.js.map +1 -0
- package/dist/core/foundation/config-serve.d.ts +20 -0
- package/dist/core/foundation/config-serve.d.ts.map +1 -0
- package/dist/core/foundation/config-serve.js +35 -0
- package/dist/core/foundation/config-serve.js.map +1 -0
- package/dist/core/{config.d.ts → foundation/config.d.ts} +34 -3
- package/dist/core/foundation/config.d.ts.map +1 -0
- package/dist/core/{config.js → foundation/config.js} +35 -18
- package/dist/core/foundation/config.js.map +1 -0
- package/dist/core/foundation/doctor-managed.d.ts +13 -0
- package/dist/core/foundation/doctor-managed.d.ts.map +1 -0
- package/dist/core/foundation/doctor-managed.js +77 -0
- package/dist/core/foundation/doctor-managed.js.map +1 -0
- package/dist/core/foundation/doctor.d.ts +19 -0
- package/dist/core/foundation/doctor.d.ts.map +1 -0
- package/dist/core/foundation/doctor.js +187 -0
- package/dist/core/foundation/doctor.js.map +1 -0
- package/dist/core/foundation/harness-catalog.d.ts +96 -0
- package/dist/core/foundation/harness-catalog.d.ts.map +1 -0
- package/dist/core/foundation/harness-catalog.js +182 -0
- package/dist/core/foundation/harness-catalog.js.map +1 -0
- package/dist/core/foundation/init-blocks.d.ts +33 -0
- package/dist/core/foundation/init-blocks.d.ts.map +1 -0
- package/dist/core/foundation/init-blocks.js +165 -0
- package/dist/core/foundation/init-blocks.js.map +1 -0
- package/dist/core/foundation/init-managed.d.ts +10 -0
- package/dist/core/foundation/init-managed.d.ts.map +1 -0
- package/dist/core/foundation/init-managed.js +115 -0
- package/dist/core/foundation/init-managed.js.map +1 -0
- package/dist/core/foundation/init.d.ts +18 -0
- package/dist/core/foundation/init.d.ts.map +1 -0
- package/dist/core/foundation/init.js +113 -0
- package/dist/core/foundation/init.js.map +1 -0
- package/dist/core/{logger.d.ts → foundation/logger.d.ts} +1 -0
- package/dist/core/foundation/logger.d.ts.map +1 -0
- package/dist/core/{logger.js → foundation/logger.js} +18 -2
- package/dist/core/foundation/logger.js.map +1 -0
- package/dist/core/{new.d.ts → foundation/new.d.ts} +3 -0
- package/dist/core/foundation/new.d.ts.map +1 -0
- package/dist/core/foundation/new.js +206 -0
- package/dist/core/foundation/new.js.map +1 -0
- package/dist/core/foundation/package-root.d.ts +9 -0
- package/dist/core/foundation/package-root.d.ts.map +1 -0
- package/dist/core/foundation/package-root.js +11 -0
- package/dist/core/foundation/package-root.js.map +1 -0
- package/dist/core/lifecycle/done.d.ts +17 -0
- package/dist/core/lifecycle/done.d.ts.map +1 -0
- package/dist/core/lifecycle/done.js +97 -0
- package/dist/core/lifecycle/done.js.map +1 -0
- package/dist/core/lifecycle/reject.d.ts +26 -0
- package/dist/core/lifecycle/reject.d.ts.map +1 -0
- package/dist/core/lifecycle/reject.js +83 -0
- package/dist/core/lifecycle/reject.js.map +1 -0
- package/dist/core/lifecycle/retry-transition.d.ts +23 -0
- package/dist/core/lifecycle/retry-transition.d.ts.map +1 -0
- package/dist/core/lifecycle/retry-transition.js +41 -0
- package/dist/core/lifecycle/retry-transition.js.map +1 -0
- package/dist/core/lifecycle/retry.d.ts +18 -0
- package/dist/core/lifecycle/retry.d.ts.map +1 -0
- package/dist/core/lifecycle/retry.js +179 -0
- package/dist/core/lifecycle/retry.js.map +1 -0
- package/dist/core/report/approval-flags.d.ts +29 -0
- package/dist/core/report/approval-flags.d.ts.map +1 -0
- package/dist/core/report/approval-flags.js +138 -0
- package/dist/core/report/approval-flags.js.map +1 -0
- package/dist/core/report/planning-economics.d.ts +39 -0
- package/dist/core/report/planning-economics.d.ts.map +1 -0
- package/dist/core/report/planning-economics.js +168 -0
- package/dist/core/report/planning-economics.js.map +1 -0
- package/dist/core/report/planning-observed.d.ts +59 -0
- package/dist/core/report/planning-observed.d.ts.map +1 -0
- package/dist/core/report/planning-observed.js +135 -0
- package/dist/core/report/planning-observed.js.map +1 -0
- package/dist/core/report/planning-records.d.ts +69 -0
- package/dist/core/report/planning-records.d.ts.map +1 -0
- package/dist/core/report/planning-records.js +149 -0
- package/dist/core/report/planning-records.js.map +1 -0
- package/dist/core/report/planning-slice-lookup.d.ts +13 -0
- package/dist/core/report/planning-slice-lookup.d.ts.map +1 -0
- package/dist/core/report/planning-slice-lookup.js +146 -0
- package/dist/core/report/planning-slice-lookup.js.map +1 -0
- package/dist/core/report/planning-slice-measures.d.ts +17 -0
- package/dist/core/report/planning-slice-measures.d.ts.map +1 -0
- package/dist/core/report/planning-slice-measures.js +85 -0
- package/dist/core/report/planning-slice-measures.js.map +1 -0
- package/dist/core/report/planning-slice-record.d.ts +4 -0
- package/dist/core/report/planning-slice-record.d.ts.map +1 -0
- package/dist/core/report/planning-slice-record.js +66 -0
- package/dist/core/report/planning-slice-record.js.map +1 -0
- package/dist/core/report/planning-slice-turns.d.ts +13 -0
- package/dist/core/report/planning-slice-turns.d.ts.map +1 -0
- package/dist/core/report/planning-slice-turns.js +41 -0
- package/dist/core/report/planning-slice-turns.js.map +1 -0
- package/dist/core/report/planning-slice.d.ts +70 -0
- package/dist/core/report/planning-slice.d.ts.map +1 -0
- package/dist/core/report/planning-slice.js +147 -0
- package/dist/core/report/planning-slice.js.map +1 -0
- package/dist/core/report/planning.d.ts +31 -0
- package/dist/core/report/planning.d.ts.map +1 -0
- package/dist/core/report/planning.js +75 -0
- package/dist/core/report/planning.js.map +1 -0
- package/dist/core/report/report-events.d.ts +52 -0
- package/dist/core/report/report-events.d.ts.map +1 -0
- package/dist/core/report/report-events.js +198 -0
- package/dist/core/report/report-events.js.map +1 -0
- package/dist/core/report/report-pre-spawn.d.ts +25 -0
- package/dist/core/report/report-pre-spawn.d.ts.map +1 -0
- package/dist/core/report/report-pre-spawn.js +40 -0
- package/dist/core/report/report-pre-spawn.js.map +1 -0
- package/dist/core/report/report-retries.d.ts +30 -0
- package/dist/core/report/report-retries.d.ts.map +1 -0
- package/dist/core/report/report-retries.js +100 -0
- package/dist/core/report/report-retries.js.map +1 -0
- package/dist/core/report/report.d.ts +276 -0
- package/dist/core/report/report.d.ts.map +1 -0
- package/dist/core/report/report.js +1421 -0
- package/dist/core/report/report.js.map +1 -0
- package/dist/core/{lock.d.ts → run/lock.d.ts} +6 -0
- package/dist/core/run/lock.d.ts.map +1 -0
- package/dist/core/{lock.js → run/lock.js} +7 -15
- package/dist/core/run/lock.js.map +1 -0
- package/dist/core/run/manifest.d.ts +39 -0
- package/dist/core/run/manifest.d.ts.map +1 -0
- package/dist/core/run/manifest.js +137 -0
- package/dist/core/run/manifest.js.map +1 -0
- package/dist/core/run/scope-hash.d.ts +71 -0
- package/dist/core/run/scope-hash.d.ts.map +1 -0
- package/dist/core/run/scope-hash.js +177 -0
- package/dist/core/run/scope-hash.js.map +1 -0
- package/dist/core/run/scope.d.ts +30 -0
- package/dist/core/run/scope.d.ts.map +1 -0
- package/dist/core/run/scope.js +193 -0
- package/dist/core/run/scope.js.map +1 -0
- package/dist/core/run/summary.d.ts +8 -0
- package/dist/core/run/summary.d.ts.map +1 -0
- package/dist/core/run/summary.js +25 -0
- package/dist/core/run/summary.js.map +1 -0
- package/dist/core/run/verification.d.ts +23 -0
- package/dist/core/run/verification.d.ts.map +1 -0
- package/dist/core/run/verification.js +78 -0
- package/dist/core/run/verification.js.map +1 -0
- package/dist/core/spec/approve.d.ts +31 -0
- package/dist/core/spec/approve.d.ts.map +1 -0
- package/dist/core/spec/approve.js +111 -0
- package/dist/core/spec/approve.js.map +1 -0
- package/dist/core/spec/delta.d.ts +77 -0
- package/dist/core/spec/delta.d.ts.map +1 -0
- package/dist/core/spec/delta.js +581 -0
- package/dist/core/spec/delta.js.map +1 -0
- package/dist/core/spec/digest-capability.d.ts +17 -0
- package/dist/core/spec/digest-capability.d.ts.map +1 -0
- package/dist/core/spec/digest-capability.js +89 -0
- package/dist/core/spec/digest-capability.js.map +1 -0
- package/dist/core/spec/digest-flags.d.ts +22 -0
- package/dist/core/spec/digest-flags.d.ts.map +1 -0
- package/dist/core/spec/digest-flags.js +194 -0
- package/dist/core/spec/digest-flags.js.map +1 -0
- package/dist/core/spec/digest-verify-starts.d.ts +5 -0
- package/dist/core/spec/digest-verify-starts.d.ts.map +1 -0
- package/dist/core/spec/digest-verify-starts.js +31 -0
- package/dist/core/spec/digest-verify-starts.js.map +1 -0
- package/dist/core/spec/digest.d.ts +43 -0
- package/dist/core/spec/digest.d.ts.map +1 -0
- package/dist/core/spec/digest.js +175 -0
- package/dist/core/spec/digest.js.map +1 -0
- package/dist/core/spec/hasher.d.ts +11 -0
- package/dist/core/spec/hasher.d.ts.map +1 -0
- package/dist/core/{hasher.js → spec/hasher.js} +27 -3
- package/dist/core/spec/hasher.js.map +1 -0
- package/dist/core/spec/linter.d.ts +79 -0
- package/dist/core/spec/linter.d.ts.map +1 -0
- package/dist/core/spec/linter.js +826 -0
- package/dist/core/spec/linter.js.map +1 -0
- package/dist/core/spec/migrate.d.ts +54 -0
- package/dist/core/spec/migrate.d.ts.map +1 -0
- package/dist/core/spec/migrate.js +297 -0
- package/dist/core/spec/migrate.js.map +1 -0
- package/dist/core/spec/openspec-version.d.ts +30 -0
- package/dist/core/spec/openspec-version.d.ts.map +1 -0
- package/dist/core/spec/openspec-version.js +118 -0
- package/dist/core/spec/openspec-version.js.map +1 -0
- package/dist/core/spec/parser.d.ts +82 -0
- package/dist/core/spec/parser.d.ts.map +1 -0
- package/dist/core/spec/parser.js +221 -0
- package/dist/core/spec/parser.js.map +1 -0
- package/dist/core/spec/verify-paths.d.ts +18 -0
- package/dist/core/spec/verify-paths.d.ts.map +1 -0
- package/dist/core/spec/verify-paths.js +139 -0
- package/dist/core/spec/verify-paths.js.map +1 -0
- package/dist/core/spec/verify-starts.d.ts +45 -0
- package/dist/core/spec/verify-starts.d.ts.map +1 -0
- package/dist/core/spec/verify-starts.js +61 -0
- package/dist/core/spec/verify-starts.js.map +1 -0
- package/dist/core/status/inbox-cursor.d.ts +10 -0
- package/dist/core/status/inbox-cursor.d.ts.map +1 -0
- package/dist/core/status/inbox-cursor.js +33 -0
- package/dist/core/status/inbox-cursor.js.map +1 -0
- package/dist/core/status/inbox-projection.d.ts +15 -0
- package/dist/core/status/inbox-projection.d.ts.map +1 -0
- package/dist/core/status/inbox-projection.js +20 -0
- package/dist/core/status/inbox-projection.js.map +1 -0
- package/dist/core/status/inbox-text.d.ts +4 -0
- package/dist/core/status/inbox-text.d.ts.map +1 -0
- package/dist/core/status/inbox-text.js +48 -0
- package/dist/core/status/inbox-text.js.map +1 -0
- package/dist/core/status/inbox.d.ts +53 -0
- package/dist/core/status/inbox.d.ts.map +1 -0
- package/dist/core/status/inbox.js +167 -0
- package/dist/core/status/inbox.js.map +1 -0
- package/dist/core/status/layout.d.ts +29 -0
- package/dist/core/status/layout.d.ts.map +1 -0
- package/dist/core/status/layout.js +77 -0
- package/dist/core/status/layout.js.map +1 -0
- package/dist/core/status/queue-parser.d.ts +13 -0
- package/dist/core/status/queue-parser.d.ts.map +1 -0
- package/dist/core/status/queue-parser.js +88 -0
- package/dist/core/status/queue-parser.js.map +1 -0
- package/dist/core/status/queue-planning.d.ts +62 -0
- package/dist/core/status/queue-planning.d.ts.map +1 -0
- package/dist/core/status/queue-planning.js +158 -0
- package/dist/core/status/queue-planning.js.map +1 -0
- package/dist/core/status/queue-report-detail.d.ts +50 -0
- package/dist/core/status/queue-report-detail.d.ts.map +1 -0
- package/dist/core/status/queue-report-detail.js +140 -0
- package/dist/core/status/queue-report-detail.js.map +1 -0
- package/dist/core/status/queue-report.d.ts +14 -0
- package/dist/core/status/queue-report.d.ts.map +1 -0
- package/dist/core/status/queue-report.js +41 -0
- package/dist/core/status/queue-report.js.map +1 -0
- package/dist/core/status/queue-state.d.ts +53 -0
- package/dist/core/status/queue-state.d.ts.map +1 -0
- package/dist/core/status/queue-state.js +167 -0
- package/dist/core/status/queue-state.js.map +1 -0
- package/dist/core/status/queue.d.ts +7 -0
- package/dist/core/status/queue.d.ts.map +1 -0
- package/dist/core/status/queue.js +4 -0
- package/dist/core/status/queue.js.map +1 -0
- package/dist/core/status/show.d.ts +102 -0
- package/dist/core/status/show.d.ts.map +1 -0
- package/dist/core/status/show.js +704 -0
- package/dist/core/status/show.js.map +1 -0
- package/dist/core/status/state.d.ts +56 -0
- package/dist/core/status/state.d.ts.map +1 -0
- package/dist/core/status/state.js +187 -0
- package/dist/core/status/state.js.map +1 -0
- package/dist/core/status/status.d.ts +23 -0
- package/dist/core/status/status.d.ts.map +1 -0
- package/dist/core/status/status.js +173 -0
- package/dist/core/status/status.js.map +1 -0
- package/dist/core/web/web-data-change.d.ts +10 -0
- package/dist/core/web/web-data-change.d.ts.map +1 -0
- package/dist/core/web/web-data-change.js +106 -0
- package/dist/core/web/web-data-change.js.map +1 -0
- package/dist/core/web/web-data-folders.d.ts +39 -0
- package/dist/core/web/web-data-folders.d.ts.map +1 -0
- package/dist/core/web/web-data-folders.js +125 -0
- package/dist/core/web/web-data-folders.js.map +1 -0
- package/dist/core/web/web-data-graph.d.ts +8 -0
- package/dist/core/web/web-data-graph.d.ts.map +1 -0
- package/dist/core/web/web-data-graph.js +113 -0
- package/dist/core/web/web-data-graph.js.map +1 -0
- package/dist/core/web/web-data-lifecycle.d.ts +43 -0
- package/dist/core/web/web-data-lifecycle.d.ts.map +1 -0
- package/dist/core/web/web-data-lifecycle.js +141 -0
- package/dist/core/web/web-data-lifecycle.js.map +1 -0
- package/dist/core/web/web-data-observations.d.ts +30 -0
- package/dist/core/web/web-data-observations.d.ts.map +1 -0
- package/dist/core/web/web-data-observations.js +181 -0
- package/dist/core/web/web-data-observations.js.map +1 -0
- package/dist/core/web/web-data-tokens.d.ts +29 -0
- package/dist/core/web/web-data-tokens.d.ts.map +1 -0
- package/dist/core/web/web-data-tokens.js +62 -0
- package/dist/core/web/web-data-tokens.js.map +1 -0
- package/dist/core/web/web-data-types.d.ts +156 -0
- package/dist/core/web/web-data-types.d.ts.map +1 -0
- package/dist/core/web/web-data-types.js +15 -0
- package/dist/core/web/web-data-types.js.map +1 -0
- package/dist/core/web/web-data.d.ts +10 -0
- package/dist/core/web/web-data.d.ts.map +1 -0
- package/dist/core/web/web-data.js +8 -0
- package/dist/core/web/web-data.js.map +1 -0
- package/dist/core/web/web-events.d.ts +54 -0
- package/dist/core/web/web-events.d.ts.map +1 -0
- package/dist/core/web/web-events.js +162 -0
- package/dist/core/web/web-events.js.map +1 -0
- package/dist/core/web/web-export.d.ts +18 -0
- package/dist/core/web/web-export.d.ts.map +1 -0
- package/dist/core/web/web-export.js +112 -0
- package/dist/core/web/web-export.js.map +1 -0
- package/dist/core/web/web-server.d.ts +34 -0
- package/dist/core/web/web-server.d.ts.map +1 -0
- package/dist/core/web/web-server.js +182 -0
- package/dist/core/web/web-server.js.map +1 -0
- package/dist/core/web/web-static.d.ts +20 -0
- package/dist/core/web/web-static.d.ts.map +1 -0
- package/dist/core/web/web-static.js +104 -0
- package/dist/core/web/web-static.js.map +1 -0
- package/dist/harness/{agy.d.ts → agy/agy.d.ts} +8 -6
- package/dist/harness/agy/agy.d.ts.map +1 -0
- package/dist/harness/{agy.js → agy/agy.js} +49 -34
- package/dist/harness/agy/agy.js.map +1 -0
- package/dist/harness/claude/claude-turns.d.ts +29 -0
- package/dist/harness/claude/claude-turns.d.ts.map +1 -0
- package/dist/harness/claude/claude-turns.js +162 -0
- package/dist/harness/claude/claude-turns.js.map +1 -0
- package/dist/harness/claude/claude-usage.d.ts +12 -0
- package/dist/harness/claude/claude-usage.d.ts.map +1 -0
- package/dist/harness/claude/claude-usage.js +144 -0
- package/dist/harness/claude/claude-usage.js.map +1 -0
- package/dist/harness/codex/codex-observe-usage.d.ts +6 -0
- package/dist/harness/codex/codex-observe-usage.d.ts.map +1 -0
- package/dist/harness/codex/codex-observe-usage.js +215 -0
- package/dist/harness/codex/codex-observe-usage.js.map +1 -0
- package/dist/harness/codex/codex-prompt.d.ts +17 -0
- package/dist/harness/codex/codex-prompt.d.ts.map +1 -0
- package/dist/harness/codex/codex-prompt.js +43 -0
- package/dist/harness/codex/codex-prompt.js.map +1 -0
- package/dist/harness/codex/codex-stream.d.ts +23 -0
- package/dist/harness/codex/codex-stream.d.ts.map +1 -0
- package/dist/harness/codex/codex-stream.js +182 -0
- package/dist/harness/codex/codex-stream.js.map +1 -0
- package/dist/harness/codex/codex-usage.d.ts +26 -0
- package/dist/harness/codex/codex-usage.d.ts.map +1 -0
- package/dist/harness/codex/codex-usage.js +122 -0
- package/dist/harness/codex/codex-usage.js.map +1 -0
- package/dist/harness/codex/codex.d.ts +16 -0
- package/dist/harness/codex/codex.d.ts.map +1 -0
- package/dist/harness/codex/codex.js +92 -0
- package/dist/harness/codex/codex.js.map +1 -0
- package/dist/harness/index.d.ts +11 -2
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +24 -9
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/mock.d.ts +5 -2
- package/dist/harness/mock.d.ts.map +1 -1
- package/dist/harness/mock.js +10 -11
- package/dist/harness/mock.js.map +1 -1
- package/dist/harness/opencode/opencode-observe-usage.d.ts +4 -0
- package/dist/harness/opencode/opencode-observe-usage.d.ts.map +1 -0
- package/dist/harness/opencode/opencode-observe-usage.js +100 -0
- package/dist/harness/opencode/opencode-observe-usage.js.map +1 -0
- package/dist/harness/opencode/opencode-usage.d.ts +24 -0
- package/dist/harness/opencode/opencode-usage.d.ts.map +1 -0
- package/dist/harness/opencode/opencode-usage.js +181 -0
- package/dist/harness/opencode/opencode-usage.js.map +1 -0
- package/dist/harness/{opencode.d.ts → opencode/opencode.d.ts} +10 -7
- package/dist/harness/opencode/opencode.d.ts.map +1 -0
- package/dist/harness/{opencode.js → opencode/opencode.js} +159 -70
- package/dist/harness/opencode/opencode.js.map +1 -0
- package/dist/harness/pi/pi-args.d.ts +9 -0
- package/dist/harness/pi/pi-args.d.ts.map +1 -0
- package/dist/harness/pi/pi-args.js +33 -0
- package/dist/harness/pi/pi-args.js.map +1 -0
- package/dist/harness/pi/pi-stream.d.ts +27 -0
- package/dist/harness/pi/pi-stream.d.ts.map +1 -0
- package/dist/harness/pi/pi-stream.js +176 -0
- package/dist/harness/pi/pi-stream.js.map +1 -0
- package/dist/harness/pi/pi-tools.d.ts +5 -0
- package/dist/harness/pi/pi-tools.d.ts.map +1 -0
- package/dist/harness/pi/pi-tools.js +31 -0
- package/dist/harness/pi/pi-tools.js.map +1 -0
- package/dist/harness/pi/pi.d.ts +11 -0
- package/dist/harness/pi/pi.d.ts.map +1 -0
- package/dist/harness/pi/pi.js +109 -0
- package/dist/harness/pi/pi.js.map +1 -0
- package/dist/harness/prompt.d.ts +11 -0
- package/dist/harness/prompt.d.ts.map +1 -0
- package/dist/harness/prompt.js +105 -0
- package/dist/harness/prompt.js.map +1 -0
- package/dist/harness/types.d.ts +289 -8
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js +125 -0
- package/dist/harness/types.js.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/watcher/archive-verify.d.ts +9 -0
- package/dist/watcher/archive-verify.d.ts.map +1 -0
- package/dist/watcher/archive-verify.js +80 -0
- package/dist/watcher/archive-verify.js.map +1 -0
- package/dist/watcher/archiver.d.ts +14 -2
- package/dist/watcher/archiver.d.ts.map +1 -1
- package/dist/watcher/archiver.js +112 -33
- package/dist/watcher/archiver.js.map +1 -1
- package/dist/watcher/attempt.d.ts +19 -0
- package/dist/watcher/attempt.d.ts.map +1 -0
- package/dist/watcher/attempt.js +94 -0
- package/dist/watcher/attempt.js.map +1 -0
- package/dist/watcher/auto-retry.d.ts +11 -0
- package/dist/watcher/auto-retry.d.ts.map +1 -0
- package/dist/watcher/auto-retry.js +180 -0
- package/dist/watcher/auto-retry.js.map +1 -0
- package/dist/watcher/build-project.d.ts +11 -0
- package/dist/watcher/build-project.d.ts.map +1 -0
- package/dist/watcher/build-project.js +36 -0
- package/dist/watcher/build-project.js.map +1 -0
- package/dist/watcher/build.d.ts +27 -0
- package/dist/watcher/build.d.ts.map +1 -0
- package/dist/watcher/build.js +165 -0
- package/dist/watcher/build.js.map +1 -0
- package/dist/watcher/change-verify.d.ts +25 -0
- package/dist/watcher/change-verify.d.ts.map +1 -0
- package/dist/watcher/change-verify.js +57 -0
- package/dist/watcher/change-verify.js.map +1 -0
- package/dist/watcher/dev.d.ts +51 -0
- package/dist/watcher/dev.d.ts.map +1 -0
- package/dist/watcher/dev.js +124 -0
- package/dist/watcher/dev.js.map +1 -0
- package/dist/watcher/failure-reason.d.ts +7 -0
- package/dist/watcher/failure-reason.d.ts.map +1 -0
- package/dist/watcher/failure-reason.js +2 -0
- package/dist/watcher/failure-reason.js.map +1 -0
- package/dist/watcher/fingerprint.d.ts +19 -0
- package/dist/watcher/fingerprint.d.ts.map +1 -0
- package/dist/watcher/fingerprint.js +82 -0
- package/dist/watcher/fingerprint.js.map +1 -0
- package/dist/watcher/heartbeat.d.ts +33 -0
- package/dist/watcher/heartbeat.d.ts.map +1 -0
- package/dist/watcher/heartbeat.js +135 -0
- package/dist/watcher/heartbeat.js.map +1 -0
- package/dist/watcher/lock.d.ts +10 -0
- package/dist/watcher/lock.d.ts.map +1 -0
- package/dist/watcher/lock.js +14 -0
- package/dist/watcher/lock.js.map +1 -0
- package/dist/watcher/loop.d.ts +26 -6
- package/dist/watcher/loop.d.ts.map +1 -1
- package/dist/watcher/loop.js +154 -37
- package/dist/watcher/loop.js.map +1 -1
- package/dist/watcher/measures.d.ts +46 -0
- package/dist/watcher/measures.d.ts.map +1 -0
- package/dist/watcher/measures.js +203 -0
- package/dist/watcher/measures.js.map +1 -0
- package/dist/watcher/outcome.d.ts +34 -0
- package/dist/watcher/outcome.d.ts.map +1 -0
- package/dist/watcher/outcome.js +131 -0
- package/dist/watcher/outcome.js.map +1 -0
- package/dist/watcher/regression.d.ts +43 -0
- package/dist/watcher/regression.d.ts.map +1 -0
- package/dist/watcher/regression.js +178 -0
- package/dist/watcher/regression.js.map +1 -0
- package/dist/watcher/runner.d.ts +6 -68
- package/dist/watcher/runner.d.ts.map +1 -1
- package/dist/watcher/runner.js +74 -523
- package/dist/watcher/runner.js.map +1 -1
- package/dist/watcher/spawn.d.ts +48 -0
- package/dist/watcher/spawn.d.ts.map +1 -0
- package/dist/watcher/spawn.js +135 -0
- package/dist/watcher/spawn.js.map +1 -0
- package/dist/watcher/task-verify.d.ts +59 -0
- package/dist/watcher/task-verify.d.ts.map +1 -0
- package/dist/watcher/task-verify.js +108 -0
- package/dist/watcher/task-verify.js.map +1 -0
- package/dist/watcher/verify.d.ts +44 -0
- package/dist/watcher/verify.d.ts.map +1 -0
- package/dist/watcher/verify.js +156 -0
- package/dist/watcher/verify.js.map +1 -0
- package/package.json +21 -9
- package/templates/PLANNER.md +77 -0
- package/templates/openspec/config.yaml +24 -0
- package/templates/openspec/schemas/osq/README.md +30 -0
- package/templates/openspec/schemas/osq/schema.yaml +133 -0
- package/templates/openspec/schemas/osq/templates/proposal.md +66 -0
- package/templates/openspec/schemas/osq/templates/spec.md +13 -0
- package/templates/openspec/schemas/osq/templates/tasks.md +11 -0
- package/templates/proposal.md +66 -0
- package/templates/tasks.md +5 -0
- package/ui/dist/assets/index-CZYeQ8la.js +9 -0
- package/ui/dist/assets/index-D6zVSjO7.css +1 -0
- package/ui/dist/index.html +14 -0
- package/dist/core/approve.d.ts +0 -11
- package/dist/core/approve.d.ts.map +0 -1
- package/dist/core/approve.js +0 -52
- package/dist/core/approve.js.map +0 -1
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/config.js.map +0 -1
- package/dist/core/hasher.d.ts +0 -4
- package/dist/core/hasher.d.ts.map +0 -1
- package/dist/core/hasher.js.map +0 -1
- package/dist/core/init.d.ts +0 -12
- package/dist/core/init.d.ts.map +0 -1
- package/dist/core/init.js +0 -151
- package/dist/core/init.js.map +0 -1
- package/dist/core/linter.d.ts +0 -8
- package/dist/core/linter.d.ts.map +0 -1
- package/dist/core/linter.js +0 -100
- package/dist/core/linter.js.map +0 -1
- package/dist/core/lock.d.ts.map +0 -1
- package/dist/core/lock.js.map +0 -1
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/logger.js.map +0 -1
- package/dist/core/new.d.ts.map +0 -1
- package/dist/core/new.js +0 -79
- package/dist/core/new.js.map +0 -1
- package/dist/core/parser.d.ts +0 -32
- package/dist/core/parser.d.ts.map +0 -1
- package/dist/core/parser.js +0 -87
- package/dist/core/parser.js.map +0 -1
- package/dist/core/report.d.ts +0 -54
- package/dist/core/report.d.ts.map +0 -1
- package/dist/core/report.js +0 -475
- package/dist/core/report.js.map +0 -1
- package/dist/core/show.d.ts +0 -50
- package/dist/core/show.d.ts.map +0 -1
- package/dist/core/show.js +0 -374
- package/dist/core/show.js.map +0 -1
- package/dist/core/state.d.ts +0 -25
- package/dist/core/state.d.ts.map +0 -1
- package/dist/core/state.js +0 -180
- package/dist/core/state.js.map +0 -1
- package/dist/core/status.d.ts +0 -10
- package/dist/core/status.d.ts.map +0 -1
- package/dist/core/status.js +0 -106
- package/dist/core/status.js.map +0 -1
- package/dist/harness/agy.d.ts.map +0 -1
- package/dist/harness/agy.js.map +0 -1
- package/dist/harness/opencode.d.ts.map +0 -1
- package/dist/harness/opencode.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { parseSpecMdFromFolder } from '../core/spec/parser.js';
|
|
2
|
+
import { runVerificationGateResult } from './verify.js';
|
|
3
|
+
/** Deterministic marker with reason, command, numeric exit code, timeout, output. */
|
|
4
|
+
export function formatChangeVerifyMarker(command, result) {
|
|
5
|
+
const output = result.output.trim() || '(no output)';
|
|
6
|
+
return [
|
|
7
|
+
'---',
|
|
8
|
+
'reason: change_verify_red',
|
|
9
|
+
...(result.timedOut ? ['timed_out: true'] : []),
|
|
10
|
+
`command: ${JSON.stringify(command)}`,
|
|
11
|
+
`exit_code: ${result.exitCode}`,
|
|
12
|
+
'---',
|
|
13
|
+
`Change-level verification ${result.timedOut ? 'timed out' : 'failed'} after task verification passed.`,
|
|
14
|
+
output,
|
|
15
|
+
'',
|
|
16
|
+
].join('\n');
|
|
17
|
+
}
|
|
18
|
+
/** Marker used when an approved proposal exposes no change-level verify command. */
|
|
19
|
+
export function formatMissingChangeVerifyMarker() {
|
|
20
|
+
return [
|
|
21
|
+
'---',
|
|
22
|
+
'reason: change_verify_red',
|
|
23
|
+
'---',
|
|
24
|
+
'Proposal change-level verify is missing or unreadable; cannot gate task completion.',
|
|
25
|
+
'',
|
|
26
|
+
].join('\n');
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Run the proposal's change-level verify after a passing task verify. Returns a
|
|
30
|
+
* passing outcome when the gate is disabled or green, otherwise failure
|
|
31
|
+
* evidence for the runner's single `fail` path. The shared gate entrypoint owns
|
|
32
|
+
* the single `verify_ran` event, attributed to the established `change` target.
|
|
33
|
+
*/
|
|
34
|
+
export async function runChangeVerifyGate(projectRoot, specFolderPath, config) {
|
|
35
|
+
if (config.gates?.changeVerifyAfterTask === false)
|
|
36
|
+
return { ok: true };
|
|
37
|
+
const specData = await parseSpecMdFromFolder(specFolderPath);
|
|
38
|
+
const command = specData?.verify ?? '';
|
|
39
|
+
if (!command) {
|
|
40
|
+
return {
|
|
41
|
+
ok: false,
|
|
42
|
+
marker: formatMissingChangeVerifyMarker(),
|
|
43
|
+
error: 'Change-level verify command is missing',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const result = await runVerificationGateResult(projectRoot, command, config.timeouts.verifyTimeoutSeconds ?? 600, { specFolderPath, taskNumber: 'change' });
|
|
47
|
+
if (result.passed)
|
|
48
|
+
return { ok: true };
|
|
49
|
+
const output = result.output.trim() || '(no output)';
|
|
50
|
+
return {
|
|
51
|
+
ok: false,
|
|
52
|
+
marker: formatChangeVerifyMarker(command, result),
|
|
53
|
+
error: result.error ?? `Change verify failed: ${output}`,
|
|
54
|
+
...(result.timedOut ? { extra: 'timed_out: true' } : {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=change-verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-verify.js","sourceRoot":"","sources":["../../src/watcher/change-verify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAA+B,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAWrF,qFAAqF;AACrF,MAAM,UAAU,wBAAwB,CAAC,OAAe,EAAE,MAA8B;IACtF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,aAAa,CAAC;IACrD,OAAO;QACL,KAAK;QACL,2BAA2B;QAC3B,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,YAAY,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QACrC,cAAc,MAAM,CAAC,QAAQ,EAAE;QAC/B,KAAK;QACL,6BAA6B,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,kCAAkC;QACvG,M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,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ChildProcess } from 'node:child_process';
|
|
2
|
+
export declare const DEV_WORKER_ENV = "OSQ_DEV_WORKER";
|
|
3
|
+
export declare const EXIT_SIGINT = 130;
|
|
4
|
+
/**
|
|
5
|
+
* Options accepted by `osq watch`. Declared here, in the watcher tier, so the
|
|
6
|
+
* CLI can consume them without the watcher importing from `src/cli`.
|
|
7
|
+
*/
|
|
8
|
+
export interface WatchCommandOptions {
|
|
9
|
+
once?: boolean;
|
|
10
|
+
dir?: string;
|
|
11
|
+
harness?: string;
|
|
12
|
+
verbose?: boolean;
|
|
13
|
+
quiet?: boolean;
|
|
14
|
+
symbols?: boolean;
|
|
15
|
+
allowStale?: boolean;
|
|
16
|
+
dev?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Command used to (re)spawn the watcher worker through `tsx`. */
|
|
19
|
+
export interface DevWorkerSpec {
|
|
20
|
+
command: string;
|
|
21
|
+
args: string[];
|
|
22
|
+
env: NodeJS.ProcessEnv;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build the worker invocation for dev mode: execute the CLI's TypeScript entry
|
|
26
|
+
* through `tsx` so editing `src/` is picked up on restart. `--dev` itself is not
|
|
27
|
+
* forwarded, and `OSQ_DEV_WORKER` tells `watchCommand` it is already inside a
|
|
28
|
+
* supervised worker so it starts the loop instead of the supervisor again.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildWorkerInvocation(options: WatchCommandOptions, packageRoot?: string): DevWorkerSpec;
|
|
31
|
+
export interface DevWatchHandle {
|
|
32
|
+
close: () => unknown;
|
|
33
|
+
}
|
|
34
|
+
/** Injection seams so the supervisor's restart state machine is testable. */
|
|
35
|
+
export interface DevSupervisorOverrides {
|
|
36
|
+
packageRoot?: string;
|
|
37
|
+
spawnWorker?: (spec: DevWorkerSpec) => ChildProcess;
|
|
38
|
+
watchSource?: (sourceDir: string, onChange: () => void) => DevWatchHandle;
|
|
39
|
+
onSignal?: (handler: () => void) => () => void;
|
|
40
|
+
exit?: (code: number) => void;
|
|
41
|
+
logError?: (message: string) => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Dev-mode supervisor: runs the watcher as a child process through `tsx` from
|
|
45
|
+
* `src/` and watches `src/` with chokidar. A source change only signals the
|
|
46
|
+
* worker (SIGINT); the worker's own SIGINT handler finishes the running task
|
|
47
|
+
* before exiting, after which the supervisor spawns a fresh worker that loads
|
|
48
|
+
* the updated code. A user SIGINT shuts both down without restarting.
|
|
49
|
+
*/
|
|
50
|
+
export declare function runDevSupervisor(options: WatchCommandOptions, overrides?: DevSupervisorOverrides): Promise<void>;
|
|
51
|
+
//# sourceMappingURL=dev.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/watcher/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAC;AAM9D,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,WAAW,MAAM,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAKD,kEAAkE;AAClE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,mBAAmB,EAC5B,WAAW,GAAE,MAAqB,GACjC,aAAa,CAWf;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,OAAO,CAAC;CACtB;AAED,6EAA6E;AAC7E,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,YAAY,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,cAAc,CAAC;IAC1E,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAC/C,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAiBD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,mBAAmB,EAC5B,SAAS,GAAE,sBAA2B,GACrC,OAAO,CAAC,IAAI,CAAC,CA+Ef"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { watch } from 'chokidar';
|
|
6
|
+
export const DEV_WORKER_ENV = 'OSQ_DEV_WORKER';
|
|
7
|
+
export const EXIT_SIGINT = 130;
|
|
8
|
+
/** Package root of the running osq build: `src/watcher/` or `dist/watcher/`. */
|
|
9
|
+
const PACKAGE_ROOT = path.resolve(fileURLToPath(new URL('../../', import.meta.url)));
|
|
10
|
+
/**
|
|
11
|
+
* Build the worker invocation for dev mode: execute the CLI's TypeScript entry
|
|
12
|
+
* through `tsx` so editing `src/` is picked up on restart. `--dev` itself is not
|
|
13
|
+
* forwarded, and `OSQ_DEV_WORKER` tells `watchCommand` it is already inside a
|
|
14
|
+
* supervised worker so it starts the loop instead of the supervisor again.
|
|
15
|
+
*/
|
|
16
|
+
export function buildWorkerInvocation(options, packageRoot = PACKAGE_ROOT) {
|
|
17
|
+
const args = ['--import', 'tsx', path.join(packageRoot, 'src', 'cli', 'bin.ts'), 'watch'];
|
|
18
|
+
if (options.once)
|
|
19
|
+
args.push('--once');
|
|
20
|
+
if (options.verbose)
|
|
21
|
+
args.push('--verbose');
|
|
22
|
+
if (options.quiet)
|
|
23
|
+
args.push('--quiet');
|
|
24
|
+
if (options.allowStale)
|
|
25
|
+
args.push('--allow-stale');
|
|
26
|
+
return {
|
|
27
|
+
command: process.execPath,
|
|
28
|
+
args,
|
|
29
|
+
env: { ...process.env, [DEV_WORKER_ENV]: '1' },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function defaultSpawnWorker(spec) {
|
|
33
|
+
return spawn(spec.command, spec.args, { env: spec.env, stdio: 'inherit' });
|
|
34
|
+
}
|
|
35
|
+
function defaultWatchSource(sourceDir, onChange) {
|
|
36
|
+
const handle = watch(sourceDir, { ignoreInitial: true });
|
|
37
|
+
handle.on('all', onChange);
|
|
38
|
+
return { close: () => handle.close() };
|
|
39
|
+
}
|
|
40
|
+
function defaultOnSignal(handler) {
|
|
41
|
+
process.on('SIGINT', handler);
|
|
42
|
+
return () => process.removeListener('SIGINT', handler);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Dev-mode supervisor: runs the watcher as a child process through `tsx` from
|
|
46
|
+
* `src/` and watches `src/` with chokidar. A source change only signals the
|
|
47
|
+
* worker (SIGINT); the worker's own SIGINT handler finishes the running task
|
|
48
|
+
* before exiting, after which the supervisor spawns a fresh worker that loads
|
|
49
|
+
* the updated code. A user SIGINT shuts both down without restarting.
|
|
50
|
+
*/
|
|
51
|
+
export async function runDevSupervisor(options, overrides = {}) {
|
|
52
|
+
const packageRoot = overrides.packageRoot ?? PACKAGE_ROOT;
|
|
53
|
+
const sourceDir = path.join(packageRoot, 'src');
|
|
54
|
+
const exit = overrides.exit ?? ((code) => process.exit(code));
|
|
55
|
+
const logError = overrides.logError ?? ((message) => console.error(message));
|
|
56
|
+
const sourceStat = await fs.stat(sourceDir).catch(() => null);
|
|
57
|
+
if (!sourceStat?.isDirectory()) {
|
|
58
|
+
logError(`osq --dev requires a source checkout with src/ (looked in ${sourceDir}).`);
|
|
59
|
+
exit(1);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const spawnWorker = overrides.spawnWorker ?? defaultSpawnWorker;
|
|
63
|
+
const watchSource = overrides.watchSource ?? defaultWatchSource;
|
|
64
|
+
const onSignal = overrides.onSignal ?? defaultOnSignal;
|
|
65
|
+
let currentWorker = null;
|
|
66
|
+
let restartPending = false;
|
|
67
|
+
let shuttingDown = false;
|
|
68
|
+
let finalized = false;
|
|
69
|
+
let watcherHandle = null;
|
|
70
|
+
let detachSignal = () => { };
|
|
71
|
+
let resolveDone = () => { };
|
|
72
|
+
const done = new Promise((resolve) => {
|
|
73
|
+
resolveDone = resolve;
|
|
74
|
+
});
|
|
75
|
+
const finalize = (code) => {
|
|
76
|
+
if (finalized)
|
|
77
|
+
return;
|
|
78
|
+
finalized = true;
|
|
79
|
+
detachSignal();
|
|
80
|
+
watcherHandle?.close();
|
|
81
|
+
resolveDone();
|
|
82
|
+
exit(code);
|
|
83
|
+
};
|
|
84
|
+
const startWorker = () => {
|
|
85
|
+
const spec = buildWorkerInvocation(options, packageRoot);
|
|
86
|
+
const worker = spawnWorker(spec);
|
|
87
|
+
currentWorker = worker;
|
|
88
|
+
worker.on('exit', (code) => {
|
|
89
|
+
currentWorker = null;
|
|
90
|
+
if (shuttingDown) {
|
|
91
|
+
finalize(EXIT_SIGINT);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (restartPending) {
|
|
95
|
+
restartPending = false;
|
|
96
|
+
startWorker();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
finalize(typeof code === 'number' ? code : 0);
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
const requestRestart = () => {
|
|
103
|
+
if (shuttingDown || restartPending)
|
|
104
|
+
return;
|
|
105
|
+
restartPending = true;
|
|
106
|
+
currentWorker?.kill('SIGINT');
|
|
107
|
+
};
|
|
108
|
+
const handleSigint = () => {
|
|
109
|
+
if (shuttingDown || finalized)
|
|
110
|
+
return;
|
|
111
|
+
shuttingDown = true;
|
|
112
|
+
restartPending = false;
|
|
113
|
+
if (!currentWorker) {
|
|
114
|
+
finalize(EXIT_SIGINT);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
currentWorker.kill('SIGINT');
|
|
118
|
+
};
|
|
119
|
+
detachSignal = onSignal(handleSigint);
|
|
120
|
+
startWorker();
|
|
121
|
+
watcherHandle = watchSource(sourceDir, requestRestart);
|
|
122
|
+
await done;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/watcher/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAiB/B,gFAAgF;AAChF,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,GAAG,C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;QAChD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,GAAS,EAAE;QAChC,IAAI,YAAY,IAAI,cAAc;YAAE,OAAO;QAC3C,cAAc,GAAG,IAAI,CAAC;QACtB,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,GAAS,EAAE;QAC9B,IAAI,YAAY,IAAI,SAAS;YAAE,OAAO;QACtC,YAAY,GAAG,IAAI,CAAC;QACpB,cAAc,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,QAAQ,CAAC,WAAW,CAAC,CAAC;YACtB,OAAO;QACT,CAAC;QACD,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEtC,WAAW,EAAE,CAAC;IACd,aAAa,GAAG,WAAW,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAEvD,MAAM,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every terminal reason a task attempt can be recorded as dead under. Kept in
|
|
3
|
+
* its own module so `outcome.ts` stays within the strict runner line budget as
|
|
4
|
+
* the reason set grows.
|
|
5
|
+
*/
|
|
6
|
+
export type RunTaskFailureReason = 'spec_conflict' | 'already_running' | 'no_result' | 'verify_red' | 'verify_precondition' | 'verify_path_missing' | 'change_verify_red' | 'crashed' | 'timeout' | 'undeclared_test_change' | 'regressed';
|
|
7
|
+
//# sourceMappingURL=failure-reason.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure-reason.d.ts","sourceRoot":"","sources":["../../src/watcher/failure-reason.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC5B,eAAe,GACf,iBAAiB,GACjB,WAAW,GACX,YAAY,GACZ,qBAAqB,GACrB,qBAAqB,GACrB,mBAAmB,GACnB,SAAS,GACT,SAAS,GACT,wBAAwB,GACxB,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure-reason.js","sourceRoot":"","sources":["../../src/watcher/failure-reason.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Strip ANSI escape sequences (CSI and OSC) from terminal text. */
|
|
2
|
+
export declare function stripAnsi(text: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Normalize a dead marker body for fingerprinting: drop ANSI codes, replace the
|
|
5
|
+
* project root, temp-directory paths, timestamps, durations, and PIDs with fixed
|
|
6
|
+
* placeholders, and leave every other byte untouched.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeFailureBody(body: string, projectRoot?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* `sha256:<hex>` over the frontmatter `reason`, a newline, and the normalized
|
|
11
|
+
* body after the frontmatter. Content without frontmatter has an empty reason.
|
|
12
|
+
*/
|
|
13
|
+
export declare function markerFingerprint(content: string, projectRoot?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Insert `fingerprint: sha256:<hex>` inside the marker's frontmatter. Content
|
|
16
|
+
* without frontmatter gains a minimal block; every other byte is preserved.
|
|
17
|
+
*/
|
|
18
|
+
export declare function addFingerprint(content: string, projectRoot?: string): string;
|
|
19
|
+
//# sourceMappingURL=fingerprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint.d.ts","sourceRoot":"","sources":["../../src/watcher/fingerprint.ts"],"names":[],"mappings":"AAwCA,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAa/E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAO/E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5E"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import { parseFrontmatter } from '../core/spec/parser.js';
|
|
5
|
+
// Built from a char code so the escape byte never appears as a regex control
|
|
6
|
+
// character literal.
|
|
7
|
+
const ANSI_PATTERN = new RegExp(`${String.fromCharCode(27)}\\[[0-9;?]*[ -/]*[@-~]|${String.fromCharCode(27)}\\][^\\u0007]*(?:\\u0007|${String.fromCharCode(27)}\\\\)`, 'g');
|
|
8
|
+
const ISO_TIMESTAMP = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?/g;
|
|
9
|
+
const DURATION = /\(?\b\d+(?:\.\d+)?(?:ms|s|m|h)\b\)?/g;
|
|
10
|
+
// A number that follows a duration key, as node:test prints `duration_ms: 3.8`
|
|
11
|
+
// and TAP prints `# duration_ms 92.9`, keeping the key and separator.
|
|
12
|
+
const DURATION_KEY = /(\bduration(?:_ms|_s)?\b[ \t]*[:=]?[ \t]*)\d+(?:\.\d+)?/gi;
|
|
13
|
+
const PID = /\bpid\s*[:=]?\s*\d+/gi;
|
|
14
|
+
function escapeRegExp(value) {
|
|
15
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
16
|
+
}
|
|
17
|
+
/** Matches a path below the OS temp directory, both as reported and resolved. */
|
|
18
|
+
function tempPathPattern() {
|
|
19
|
+
const roots = new Set();
|
|
20
|
+
try {
|
|
21
|
+
roots.add(os.tmpdir());
|
|
22
|
+
roots.add(fs.realpathSync(os.tmpdir()));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
roots.add(os.tmpdir());
|
|
26
|
+
}
|
|
27
|
+
const present = [...roots].filter((root) => root.length > 0);
|
|
28
|
+
if (present.length === 0)
|
|
29
|
+
return null;
|
|
30
|
+
const alternation = present.map(escapeRegExp).join('|');
|
|
31
|
+
return new RegExp(`(?:${alternation})/[^/\\s'"]+`, 'g');
|
|
32
|
+
}
|
|
33
|
+
const TEMP_PATH = tempPathPattern();
|
|
34
|
+
/** Strip ANSI escape sequences (CSI and OSC) from terminal text. */
|
|
35
|
+
export function stripAnsi(text) {
|
|
36
|
+
return text.replace(ANSI_PATTERN, '');
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Normalize a dead marker body for fingerprinting: drop ANSI codes, replace the
|
|
40
|
+
* project root, temp-directory paths, timestamps, durations, and PIDs with fixed
|
|
41
|
+
* placeholders, and leave every other byte untouched.
|
|
42
|
+
*/
|
|
43
|
+
export function normalizeFailureBody(body, projectRoot) {
|
|
44
|
+
let normalized = stripAnsi(body);
|
|
45
|
+
if (projectRoot) {
|
|
46
|
+
normalized = normalized.split(projectRoot).join('<root>');
|
|
47
|
+
}
|
|
48
|
+
if (TEMP_PATH) {
|
|
49
|
+
normalized = normalized.replace(TEMP_PATH, '<tmp>');
|
|
50
|
+
}
|
|
51
|
+
return normalized
|
|
52
|
+
.replace(ISO_TIMESTAMP, '<time>')
|
|
53
|
+
.replace(DURATION, '<duration>')
|
|
54
|
+
.replace(DURATION_KEY, '$1<duration>')
|
|
55
|
+
.replace(PID, 'pid <pid>');
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* `sha256:<hex>` over the frontmatter `reason`, a newline, and the normalized
|
|
59
|
+
* body after the frontmatter. Content without frontmatter has an empty reason.
|
|
60
|
+
*/
|
|
61
|
+
export function markerFingerprint(content, projectRoot) {
|
|
62
|
+
const { data, body } = parseFrontmatter(content);
|
|
63
|
+
const reason = typeof data.reason === 'string' ? data.reason : '';
|
|
64
|
+
const digest = createHash('sha256')
|
|
65
|
+
.update(`${reason}\n${normalizeFailureBody(body, projectRoot)}`)
|
|
66
|
+
.digest('hex');
|
|
67
|
+
return `sha256:${digest}`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Insert `fingerprint: sha256:<hex>` inside the marker's frontmatter. Content
|
|
71
|
+
* without frontmatter gains a minimal block; every other byte is preserved.
|
|
72
|
+
*/
|
|
73
|
+
export function addFingerprint(content, projectRoot) {
|
|
74
|
+
const fingerprint = markerFingerprint(content, projectRoot);
|
|
75
|
+
const match = content.match(/^(---\r?\n(?:[\s\S]*?\r?\n)?)(---)/);
|
|
76
|
+
if (!match) {
|
|
77
|
+
return `---\nfingerprint: ${fingerprint}\n---\n${content}`;
|
|
78
|
+
}
|
|
79
|
+
const head = match[1];
|
|
80
|
+
return `${head}fingerprint: ${fingerprint}\n${content.slice(head.length)}`;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=fingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../../src/watcher/fingerprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,6EAA6E;AAC7E,qBAAqB;AACrB,MAAM,YAAY,GAAG,IAAI,MAAM,CAC7B,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,0BAA0B,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,4BAA4B,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,OAAO,EACrI,GAAG,CACJ,CAAC;AAEF,MAAM,aAAa,GAAG,uEAAuE,CAAC;AAC9F,MAAM,QAAQ,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C;QACX,OAAO,qBAAqB,WAAW,UAAU,OAAO,EAAE,CAAC;IAC7D,CAAC;IACD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACtB,OAAO,GAAG,IAAI,gBAAgB,WAAW,KAAK,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { relativizeToolSummary } from '../core/run/summary.js';
|
|
2
|
+
export { relativizeToolSummary };
|
|
3
|
+
export interface TaskHeartbeatStats {
|
|
4
|
+
elapsedSeconds: number;
|
|
5
|
+
eventCount: number;
|
|
6
|
+
totalTokens: number;
|
|
7
|
+
toolCount: number;
|
|
8
|
+
cost?: number;
|
|
9
|
+
lastToolSummary?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Snapshot of task progress. Counters are maintained in memory and advanced
|
|
13
|
+
* with only the bytes appended since the previous poll; tool summaries are
|
|
14
|
+
* stored relativized to `projectRoot` for display.
|
|
15
|
+
*/
|
|
16
|
+
export declare function computeTaskHeartbeatStats(specFolderPath: string, taskNumber: string, startTime: number, projectRoot?: string): Promise<TaskHeartbeatStats>;
|
|
17
|
+
/** Drop the in-memory counters for a finished task so the map does not grow. */
|
|
18
|
+
export declare function clearTaskHeartbeatStats(specFolderPath: string, taskNumber: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Compact token count for the live status row and the heartbeat line: below
|
|
21
|
+
* 1000 as an integer, below 1M as `X.Xk`, at or above 1M as `X.XM`. A value
|
|
22
|
+
* that rounds up to `1000.0k` rolls over to `1.0M` so the suffix never grows.
|
|
23
|
+
*/
|
|
24
|
+
export declare function formatTokens(tokens: number): string;
|
|
25
|
+
/**
|
|
26
|
+
* Single-line running status row. The logger owns the animated spinner and
|
|
27
|
+
* terminal-width truncation, so this assembles the full row and leaves fitting
|
|
28
|
+
* to the sink.
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatTaskStatusRow(taskNumber: string, stats: TaskHeartbeatStats): string;
|
|
31
|
+
/** Periodic heartbeat line shared by the 1s TTY row and the non-TTY log. */
|
|
32
|
+
export declare function formatTaskHeartbeatLine(taskNumber: string, stats: TaskHeartbeatStats): string;
|
|
33
|
+
//# sourceMappingURL=heartbeat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"","sources":["../../src/watcher/heartbeat.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAuBD;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,CA0E7B;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAGxF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAYnD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAgBzF;AAED,4EAA4E;AAC5E,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAE7F"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { relativizeToolSummary } from '../core/run/summary.js';
|
|
4
|
+
import { asRecord } from '../harness/stream.js';
|
|
5
|
+
// Re-exported from core so existing watcher/status consumers keep importing it
|
|
6
|
+
// from the heartbeat module.
|
|
7
|
+
export { relativizeToolSummary };
|
|
8
|
+
const heartbeatAccumulators = new Map();
|
|
9
|
+
function createHeartbeatAccumulator() {
|
|
10
|
+
return { byteOffset: 0, eventCount: 0, totalTokens: 0, toolCount: 0, cost: 0, hasCost: false };
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Snapshot of task progress. Counters are maintained in memory and advanced
|
|
14
|
+
* with only the bytes appended since the previous poll; tool summaries are
|
|
15
|
+
* stored relativized to `projectRoot` for display.
|
|
16
|
+
*/
|
|
17
|
+
export async function computeTaskHeartbeatStats(specFolderPath, taskNumber, startTime, projectRoot) {
|
|
18
|
+
const elapsedSeconds = Number(((Date.now() - startTime) / 1000).toFixed(1));
|
|
19
|
+
const eventFilePath = path.join(specFolderPath, '.run', 'events', `${taskNumber}.jsonl`);
|
|
20
|
+
let content = '';
|
|
21
|
+
try {
|
|
22
|
+
content = await fs.readFile(eventFilePath, 'utf8');
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
heartbeatAccumulators.delete(eventFilePath);
|
|
26
|
+
return { elapsedSeconds, eventCount: 0, totalTokens: 0, toolCount: 0 };
|
|
27
|
+
}
|
|
28
|
+
let accumulator = heartbeatAccumulators.get(eventFilePath);
|
|
29
|
+
if (!accumulator || accumulator.byteOffset > content.length) {
|
|
30
|
+
accumulator = createHeartbeatAccumulator();
|
|
31
|
+
}
|
|
32
|
+
const fresh = content.slice(accumulator.byteOffset);
|
|
33
|
+
const lastNewline = fresh.lastIndexOf('\n');
|
|
34
|
+
if (lastNewline !== -1) {
|
|
35
|
+
const complete = fresh.slice(0, lastNewline);
|
|
36
|
+
accumulator.byteOffset += lastNewline + 1;
|
|
37
|
+
for (const line of complete.split('\n')) {
|
|
38
|
+
if (!line.trim()) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
accumulator.eventCount += 1;
|
|
42
|
+
let parsed;
|
|
43
|
+
try {
|
|
44
|
+
parsed = JSON.parse(line);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Ignore malformed lines rather than losing the whole heartbeat.
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const event = asRecord(parsed);
|
|
51
|
+
if (!event) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const data = asRecord(event.data);
|
|
55
|
+
if (event.type === 'tokens') {
|
|
56
|
+
accumulator.totalTokens += Number(data?.totalTokens ?? 0) || 0;
|
|
57
|
+
const cost = Number(data?.cost);
|
|
58
|
+
if (Number.isFinite(cost)) {
|
|
59
|
+
accumulator.cost += cost;
|
|
60
|
+
accumulator.hasCost = true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else if (event.type === 'tool') {
|
|
64
|
+
accumulator.toolCount += 1;
|
|
65
|
+
const summary = data?.summary;
|
|
66
|
+
if (typeof summary === 'string') {
|
|
67
|
+
accumulator.lastToolSummary = relativizeToolSummary(summary, projectRoot);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
heartbeatAccumulators.set(eventFilePath, accumulator);
|
|
73
|
+
const stats = {
|
|
74
|
+
elapsedSeconds,
|
|
75
|
+
eventCount: accumulator.eventCount,
|
|
76
|
+
totalTokens: accumulator.totalTokens,
|
|
77
|
+
toolCount: accumulator.toolCount,
|
|
78
|
+
};
|
|
79
|
+
if (accumulator.hasCost) {
|
|
80
|
+
stats.cost = accumulator.cost;
|
|
81
|
+
}
|
|
82
|
+
if (accumulator.lastToolSummary !== undefined) {
|
|
83
|
+
stats.lastToolSummary = accumulator.lastToolSummary;
|
|
84
|
+
}
|
|
85
|
+
return stats;
|
|
86
|
+
}
|
|
87
|
+
/** Drop the in-memory counters for a finished task so the map does not grow. */
|
|
88
|
+
export function clearTaskHeartbeatStats(specFolderPath, taskNumber) {
|
|
89
|
+
const eventFilePath = path.join(specFolderPath, '.run', 'events', `${taskNumber}.jsonl`);
|
|
90
|
+
heartbeatAccumulators.delete(eventFilePath);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Compact token count for the live status row and the heartbeat line: below
|
|
94
|
+
* 1000 as an integer, below 1M as `X.Xk`, at or above 1M as `X.XM`. A value
|
|
95
|
+
* that rounds up to `1000.0k` rolls over to `1.0M` so the suffix never grows.
|
|
96
|
+
*/
|
|
97
|
+
export function formatTokens(tokens) {
|
|
98
|
+
if (tokens < 1000) {
|
|
99
|
+
return tokens.toString();
|
|
100
|
+
}
|
|
101
|
+
if (tokens < 1_000_000) {
|
|
102
|
+
const k = (tokens / 1000).toFixed(1);
|
|
103
|
+
if (k === '1000.0') {
|
|
104
|
+
return '1.0M';
|
|
105
|
+
}
|
|
106
|
+
return `${k}k`;
|
|
107
|
+
}
|
|
108
|
+
return `${(tokens / 1_000_000).toFixed(1)}M`;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Single-line running status row. The logger owns the animated spinner and
|
|
112
|
+
* terminal-width truncation, so this assembles the full row and leaves fitting
|
|
113
|
+
* to the sink.
|
|
114
|
+
*/
|
|
115
|
+
export function formatTaskStatusRow(taskNumber, stats) {
|
|
116
|
+
const segments = [
|
|
117
|
+
`task ${taskNumber}`,
|
|
118
|
+
`${stats.elapsedSeconds}s`,
|
|
119
|
+
`${stats.toolCount} tools`,
|
|
120
|
+
`${formatTokens(stats.totalTokens)} tokens`,
|
|
121
|
+
];
|
|
122
|
+
if (typeof stats.cost === 'number' && Number.isFinite(stats.cost)) {
|
|
123
|
+
segments.push(`$${stats.cost.toFixed(4)}`);
|
|
124
|
+
}
|
|
125
|
+
const base = segments.join(' · ');
|
|
126
|
+
if (!stats.lastToolSummary) {
|
|
127
|
+
return base;
|
|
128
|
+
}
|
|
129
|
+
return `${base} · ${stats.lastToolSummary}`;
|
|
130
|
+
}
|
|
131
|
+
/** Periodic heartbeat line shared by the 1s TTY row and the non-TTY log. */
|
|
132
|
+
export function formatTaskHeartbeatLine(taskNumber, stats) {
|
|
133
|
+
return `task ${taskNumber} heartbeat (elapsed: ${stats.elapsedSeconds}s, events: ${stats.eventCount}, tokens: ${formatTokens(stats.totalTokens)})`;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=heartbeat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat.js","sourceRoot":"","sources":["../../src/watcher/heartbeat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,+EAA+E;AAC/E,6BAA6B;AAC7B,OAAO,EAAE,qBAAqB,EAAE,CAAC;AA0BjC,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAgC,CAAC;AAEtE,SAAS,0BAA0B;IACjC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjG,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,cAAsB,EACtB,UAAkB,EAClB,SAAiB,EACjB,WAAoB;IAEpB,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,MA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CAAC,KAAK,CAAC,WAAW,CAAC,SAAS;KAC5C,CAAC;IACF,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAClE,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,GAAG,IAAI,MAAM,KAAK,CAAC,eAAe,EAAE,CAAC;AAC9C,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,uBAAuB,CAAC,UAAkB,EAAE,KAAyB;IACnF,OAAO,QAAQ,UAAU,wBAAwB,KAAK,CAAC,cAAc,cAAc,KAAK,CAAC,UAAU,aAAa,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;AACrJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type LockResult } from '../core/run/lock.js';
|
|
2
|
+
/**
|
|
3
|
+
* Acquire the exclusive running lock for a task's `.run` directory. Thin
|
|
4
|
+
* wrapper over the core lock so the watcher tier owns a single integration
|
|
5
|
+
* point.
|
|
6
|
+
*/
|
|
7
|
+
export declare function acquireTaskLock(runDir: string, taskNumber: string | number): Promise<LockResult>;
|
|
8
|
+
/** Release the task lock, tolerating an already-absent marker. */
|
|
9
|
+
export declare function releaseTaskLock(runDir: string, taskNumber: string | number): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/watcher/lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAA4B,MAAM,qBAAqB,CAAC;AAEhF;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,MAAM,GAC1B,OAAO,CAAC,UAAU,CAAC,CAErB;AAED,kEAAkE;AAClE,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { acquireLock, releaseLock } from '../core/run/lock.js';
|
|
2
|
+
/**
|
|
3
|
+
* Acquire the exclusive running lock for a task's `.run` directory. Thin
|
|
4
|
+
* wrapper over the core lock so the watcher tier owns a single integration
|
|
5
|
+
* point.
|
|
6
|
+
*/
|
|
7
|
+
export async function acquireTaskLock(runDir, taskNumber) {
|
|
8
|
+
return acquireLock(runDir, taskNumber);
|
|
9
|
+
}
|
|
10
|
+
/** Release the task lock, tolerating an already-absent marker. */
|
|
11
|
+
export async function releaseTaskLock(runDir, taskNumber) {
|
|
12
|
+
await releaseLock(runDir, taskNumber);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/watcher/lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAc,EACd,UAA2B;IAE3B,OAAO,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC;AAED,kEAAkE;AAClE,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAc,EAAE,UAA2B;IAC/E,MAAM,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AACxC,CAAC"}
|