@matteeh/osq 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-flags.d.ts +21 -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 +42 -0
- package/dist/core/spec/digest.d.ts.map +1 -0
- package/dist/core/spec/digest.js +170 -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 +287 -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.d.ts +24 -0
- package/dist/watcher/build.d.ts.map +1 -0
- package/dist/watcher/build.js +169 -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 +53 -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 +32 -0
- package/dist/watcher/outcome.d.ts.map +1 -0
- package/dist/watcher/outcome.js +127 -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 +175 -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 +130 -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,104 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { PACKAGE_ROOT } from '../foundation/package-root.js';
|
|
4
|
+
/**
|
|
5
|
+
* Static dashboard delivery. Every request resolves to one regular file below
|
|
6
|
+
* the package-root `ui/dist` directory; there is no SPA fallback beyond the
|
|
7
|
+
* index request, no traversal, and no directory listing.
|
|
8
|
+
*/
|
|
9
|
+
const UI_SUBPATH = ['ui', 'dist'];
|
|
10
|
+
const INDEX_FILE = 'index.html';
|
|
11
|
+
/** Package-root `ui/dist` for both `src/core` under tsx and `dist/core` shipped. */
|
|
12
|
+
export function resolveUiDir() {
|
|
13
|
+
return path.join(PACKAGE_ROOT, ...UI_SUBPATH);
|
|
14
|
+
}
|
|
15
|
+
/** Self-only policy for the generated application plus same-origin SSE. */
|
|
16
|
+
export const UI_CONTENT_SECURITY_POLICY = [
|
|
17
|
+
"default-src 'self'",
|
|
18
|
+
"script-src 'self'",
|
|
19
|
+
"style-src 'self' 'unsafe-inline'",
|
|
20
|
+
"img-src 'self'",
|
|
21
|
+
"font-src 'self'",
|
|
22
|
+
"connect-src 'self'",
|
|
23
|
+
"object-src 'none'",
|
|
24
|
+
"base-uri 'self'",
|
|
25
|
+
"form-action 'none'",
|
|
26
|
+
"frame-ancestors 'none'",
|
|
27
|
+
].join('; ');
|
|
28
|
+
const CONTENT_TYPES = {
|
|
29
|
+
'.html': 'text/html; charset=utf-8',
|
|
30
|
+
'.js': 'text/javascript; charset=utf-8',
|
|
31
|
+
'.mjs': 'text/javascript; charset=utf-8',
|
|
32
|
+
'.css': 'text/css; charset=utf-8',
|
|
33
|
+
'.json': 'application/json; charset=utf-8',
|
|
34
|
+
'.map': 'application/json; charset=utf-8',
|
|
35
|
+
'.svg': 'image/svg+xml',
|
|
36
|
+
'.png': 'image/png',
|
|
37
|
+
'.jpg': 'image/jpeg',
|
|
38
|
+
'.jpeg': 'image/jpeg',
|
|
39
|
+
'.gif': 'image/gif',
|
|
40
|
+
'.webp': 'image/webp',
|
|
41
|
+
'.avif': 'image/avif',
|
|
42
|
+
'.ico': 'image/x-icon',
|
|
43
|
+
'.woff': 'font/woff',
|
|
44
|
+
'.woff2': 'font/woff2',
|
|
45
|
+
'.txt': 'text/plain; charset=utf-8',
|
|
46
|
+
};
|
|
47
|
+
const REVALIDATE = 'no-cache';
|
|
48
|
+
const IMMUTABLE = 'public, max-age=31536000, immutable';
|
|
49
|
+
const FINGERPRINT = /-[A-Za-z0-9_]{8,}\./;
|
|
50
|
+
/** Fingerprinted build assets may be cached immutably; everything else revalidates. */
|
|
51
|
+
export function isFingerprintedAsset(fileName) {
|
|
52
|
+
return FINGERPRINT.test(fileName);
|
|
53
|
+
}
|
|
54
|
+
/** Decode a URL pathname once, rejecting malformed escapes and null bytes. */
|
|
55
|
+
function decodePathname(pathname) {
|
|
56
|
+
try {
|
|
57
|
+
const decoded = decodeURIComponent(pathname);
|
|
58
|
+
return decoded.includes('\0') ? null : decoded;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function isInside(root, target) {
|
|
65
|
+
const relative = path.relative(root, target);
|
|
66
|
+
return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Resolve `pathname` to one regular file inside `uiDir`. Returns null for
|
|
70
|
+
* malformed escapes, traversal, dot segments, directories, and absent files.
|
|
71
|
+
* `/` and `/index.html` both resolve to the application shell.
|
|
72
|
+
*/
|
|
73
|
+
export async function resolveStaticFile(pathname, uiDir = resolveUiDir()) {
|
|
74
|
+
const decoded = decodePathname(pathname);
|
|
75
|
+
if (decoded === null)
|
|
76
|
+
return null;
|
|
77
|
+
const segments = decoded.split('/').filter((segment) => segment !== '');
|
|
78
|
+
if (segments.some((segment) => segment === '.' || segment === '..'))
|
|
79
|
+
return null;
|
|
80
|
+
const root = path.resolve(uiDir);
|
|
81
|
+
const target = segments.length === 0
|
|
82
|
+
? path.join(root, INDEX_FILE)
|
|
83
|
+
: path.resolve(root, segments.join(path.sep));
|
|
84
|
+
if (!isInside(root, target))
|
|
85
|
+
return null;
|
|
86
|
+
const stat = await fs.lstat(target).catch(() => null);
|
|
87
|
+
if (!stat || !stat.isFile())
|
|
88
|
+
return null;
|
|
89
|
+
const body = await fs.readFile(target);
|
|
90
|
+
const extension = path.extname(target).toLowerCase();
|
|
91
|
+
const isHtml = extension === '.html';
|
|
92
|
+
const cacheControl = isHtml
|
|
93
|
+
? REVALIDATE
|
|
94
|
+
: isFingerprintedAsset(path.basename(target))
|
|
95
|
+
? IMMUTABLE
|
|
96
|
+
: REVALIDATE;
|
|
97
|
+
return {
|
|
98
|
+
body,
|
|
99
|
+
contentType: CONTENT_TYPES[extension] ?? 'application/octet-stream',
|
|
100
|
+
cacheControl,
|
|
101
|
+
isHtml,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=web-static.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-static.js","sourceRoot":"","sources":["../../../src/core/web/web-static.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D;;;;GAIG;AAEH,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAClC,MAAM,UAAU,GAAG,YAAY,CAAC;AAEhC,oFAAoF;AACpF,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,UAAU,CAAC,CAAC;AAChD,CAAC;AAED,2EAA2E;AAC3E,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,oBAAoB;IACpB,mBAAmB;IACnB,kCAAkC;IAClC,gBAAgB;IAChB,iBAAiB;IACjB,oBAAoB;IACpB,mBAAmB;IACnB,iBAAiB;IACjB,oBAAoB;IACpB,wBAAwB;CACzB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,aAAa,GAA2B;IAC5C,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,gCAAg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,SAAS,KAAK,OAAO,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM;QACzB,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC3C,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,UAAU,CAAC;IACjB,OAAO;QACL,IAAI;QACJ,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,IAAI,0BAA0B;QACnE,YAAY;QACZ,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { Logger } from '
|
|
3
|
-
import { EventStreamParser } from '
|
|
4
|
-
import { type HarnessAdapter, type SpawnResult, type SpawnTaskOptions, type ToolEventData } from '
|
|
1
|
+
import { type OsqConfig } from '../../core/foundation/config.js';
|
|
2
|
+
import type { Logger } from '../../core/foundation/logger.js';
|
|
3
|
+
import { EventStreamParser } from '../stream.js';
|
|
4
|
+
import { type HarnessAdapter, type InteractiveSessionOptions, type InteractiveUsage, type ReadInteractiveUsageOptions, type SpawnResult, type SpawnTaskOptions, type ToolEventData } from '../types.js';
|
|
5
5
|
export declare function resolveAgyBinary(): Promise<string>;
|
|
6
6
|
export declare function buildAgyPrompt(options: SpawnTaskOptions): string;
|
|
7
7
|
export declare function buildAgyArgs(options: SpawnTaskOptions): string[];
|
|
@@ -15,17 +15,19 @@ export interface AgyStreamTokensData {
|
|
|
15
15
|
}
|
|
16
16
|
export declare function extractAgyTokens(event: unknown): AgyStreamTokensData | null;
|
|
17
17
|
export declare function extractAgyToolEvent(event: unknown): ToolEventData | null;
|
|
18
|
-
export declare function processAgyStdoutLine(line: string, specFolderPath: string, taskNumber: string, logger?: Logger): Promise<void>;
|
|
18
|
+
export declare function processAgyStdoutLine(line: string, specFolderPath: string, taskNumber: string, logger?: Logger, projectRoot?: string): Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* Compatibility subclass retained for existing callers and tests; the buffering
|
|
21
21
|
* and serialization logic lives entirely in the shared {@link EventStreamParser}.
|
|
22
22
|
*/
|
|
23
23
|
export declare class AgyEventStreamParser extends EventStreamParser {
|
|
24
|
-
constructor(specFolderPath: string, taskNumber: string, logger?: Logger);
|
|
24
|
+
constructor(specFolderPath: string, taskNumber: string, logger?: Logger, projectRoot?: string);
|
|
25
25
|
}
|
|
26
26
|
export declare class AgyAdapter implements HarnessAdapter {
|
|
27
27
|
readonly name = "agy";
|
|
28
28
|
setup(projectRoot: string, _config: OsqConfig): Promise<void>;
|
|
29
29
|
spawn(options: SpawnTaskOptions): Promise<SpawnResult>;
|
|
30
|
+
spawnInteractive(options: InteractiveSessionOptions): Promise<number>;
|
|
31
|
+
readInteractiveUsage(_options: ReadInteractiveUsageOptions): Promise<InteractiveUsage>;
|
|
30
32
|
}
|
|
31
33
|
//# sourceMappingURL=agy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agy.d.ts","sourceRoot":"","sources":["../../../src/harness/agy/agy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAI9D,OAAO,EACL,iBAAiB,EAIlB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAErB,KAAK,2BAA2B,EAChC,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAC;AAErB,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAgBxD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAEhE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,EAAE,CA2BhE;AAED,MAAM,WAAW,mBAAmB;I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|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { loadConfig } from '../../core/foundation/config.js';
|
|
6
|
+
import { relativizeToolSummary } from '../../core/run/summary.js';
|
|
7
|
+
import { spawnWithTimeout } from '../process.js';
|
|
8
|
+
import { buildExecutorPrompt } from '../prompt.js';
|
|
9
|
+
import { EventStreamParser, asRecord, firstNonEmptyString, resolveEventTimestamp, } from '../stream.js';
|
|
10
|
+
import { NULL_INTERACTIVE_USAGE, appendHarnessEvent, } from '../types.js';
|
|
7
11
|
export async function resolveAgyBinary() {
|
|
8
12
|
if (process.env.AGY_PATH) {
|
|
9
13
|
return process.env.AGY_PATH;
|
|
@@ -20,28 +24,7 @@ export async function resolveAgyBinary() {
|
|
|
20
24
|
return 'agy';
|
|
21
25
|
}
|
|
22
26
|
export function buildAgyPrompt(options) {
|
|
23
|
-
|
|
24
|
-
const taskRelPath = path.relative(projectRoot, path.join(specFolderPath, 'tasks', `${taskNumber}.md`));
|
|
25
|
-
const specRelPath = path.relative(projectRoot, path.join(specFolderPath, 'spec.md'));
|
|
26
|
-
const resultRelPath = path.relative(projectRoot, path.join(specFolderPath, '.run', 'results', `${taskNumber}.md`));
|
|
27
|
-
return [
|
|
28
|
-
'You are a coding agent working autonomously on an osq task. Follow AGENTS.md strictly.',
|
|
29
|
-
`Task File: ${taskRelPath}`,
|
|
30
|
-
`Parent Spec: ${specRelPath}`,
|
|
31
|
-
`Task Title: ${taskTitle}`,
|
|
32
|
-
`Scope: ${scope.join(', ')}`,
|
|
33
|
-
`Entry: ${entry.join(', ')}`,
|
|
34
|
-
`Verify Command: ${verifyCommand}`,
|
|
35
|
-
'',
|
|
36
|
-
'Rules:',
|
|
37
|
-
`1. Read ${taskRelPath}, ${specRelPath}, and features docs referenced in ${specRelPath}.`,
|
|
38
|
-
'2. Write tests for each acceptance line before implementing.',
|
|
39
|
-
'3. Keep all edits strictly inside scope.',
|
|
40
|
-
`4. Verify your work by running: ${verifyCommand}`,
|
|
41
|
-
`5. CRITICAL: Before exiting, you MUST write ${resultRelPath} documenting: changed, deviated, drift against features/, missing context, and next steps.`,
|
|
42
|
-
`6. Do not modify tasks.md, spec.md, or any file outside your scope and ${resultRelPath}.`,
|
|
43
|
-
`7. When done, write ${resultRelPath} and exit cleanly.`,
|
|
44
|
-
].join('\n');
|
|
27
|
+
return buildExecutorPrompt(options);
|
|
45
28
|
}
|
|
46
29
|
export function buildAgyArgs(options) {
|
|
47
30
|
const { config } = options;
|
|
@@ -130,17 +113,20 @@ export function extractAgyToolEvent(event) {
|
|
|
130
113
|
}
|
|
131
114
|
/**
|
|
132
115
|
* Single code path for tool observation: the events.jsonl entry and its verbose
|
|
133
|
-
* stderr log line are always emitted together
|
|
116
|
+
* stderr log line are always emitted together. The summary is relativized to the
|
|
117
|
+
* project root before it is written, so `events.jsonl` never carries absolute
|
|
118
|
+
* workspace paths.
|
|
134
119
|
*/
|
|
135
|
-
async function
|
|
120
|
+
async function emitObservedToolEvent(specFolderPath, taskNumber, toolEvent, timestamp, projectRoot, logger) {
|
|
121
|
+
const summary = relativizeToolSummary(toolEvent.summary, projectRoot);
|
|
136
122
|
await appendHarnessEvent(specFolderPath, taskNumber, {
|
|
137
123
|
type: 'tool',
|
|
138
124
|
timestamp,
|
|
139
|
-
data: { tool: toolEvent.tool, summary
|
|
125
|
+
data: { tool: toolEvent.tool, summary },
|
|
140
126
|
});
|
|
141
|
-
logger?.verbose(`[tool] ${toolEvent.tool}: ${
|
|
127
|
+
logger?.verbose(`[tool] ${toolEvent.tool}: ${summary}`);
|
|
142
128
|
}
|
|
143
|
-
export async function processAgyStdoutLine(line, specFolderPath, taskNumber, logger) {
|
|
129
|
+
export async function processAgyStdoutLine(line, specFolderPath, taskNumber, logger, projectRoot) {
|
|
144
130
|
const trimmed = line.trim();
|
|
145
131
|
if (!trimmed) {
|
|
146
132
|
return;
|
|
@@ -162,7 +148,7 @@ export async function processAgyStdoutLine(line, specFolderPath, taskNumber, log
|
|
|
162
148
|
}
|
|
163
149
|
const toolEvent = extractAgyToolEvent(eventObj);
|
|
164
150
|
if (toolEvent) {
|
|
165
|
-
await
|
|
151
|
+
await emitObservedToolEvent(specFolderPath, taskNumber, toolEvent, resolveEventTimestamp(eventObj), projectRoot, logger);
|
|
166
152
|
return;
|
|
167
153
|
}
|
|
168
154
|
// The result payload carries the completed assistant response. Partial
|
|
@@ -207,8 +193,8 @@ export async function processAgyStdoutLine(line, specFolderPath, taskNumber, log
|
|
|
207
193
|
* and serialization logic lives entirely in the shared {@link EventStreamParser}.
|
|
208
194
|
*/
|
|
209
195
|
export class AgyEventStreamParser extends EventStreamParser {
|
|
210
|
-
constructor(specFolderPath, taskNumber, logger) {
|
|
211
|
-
super((line) => processAgyStdoutLine(line, specFolderPath, taskNumber, logger));
|
|
196
|
+
constructor(specFolderPath, taskNumber, logger, projectRoot) {
|
|
197
|
+
super((line) => processAgyStdoutLine(line, specFolderPath, taskNumber, logger, projectRoot));
|
|
212
198
|
}
|
|
213
199
|
}
|
|
214
200
|
export class AgyAdapter {
|
|
@@ -221,7 +207,7 @@ export class AgyAdapter {
|
|
|
221
207
|
const { projectRoot, specFolderPath, taskNumber, timeoutSeconds = 1800 } = options;
|
|
222
208
|
const agyBin = await resolveAgyBinary();
|
|
223
209
|
const args = buildAgyArgs(options);
|
|
224
|
-
const streamParser = new EventStreamParser((line) => processAgyStdoutLine(line, specFolderPath, taskNumber, options.logger));
|
|
210
|
+
const streamParser = new EventStreamParser((line) => processAgyStdoutLine(line, specFolderPath, taskNumber, options.logger, projectRoot));
|
|
225
211
|
const result = await spawnWithTimeout({
|
|
226
212
|
command: agyBin,
|
|
227
213
|
args,
|
|
@@ -247,5 +233,34 @@ export class AgyAdapter {
|
|
|
247
233
|
elapsedMs: result.elapsedMs,
|
|
248
234
|
};
|
|
249
235
|
}
|
|
236
|
+
async spawnInteractive(options) {
|
|
237
|
+
const { prompt, cwd, model, agent } = options;
|
|
238
|
+
const config = await loadConfig(cwd).catch(() => undefined);
|
|
239
|
+
const agyBin = await resolveAgyBinary();
|
|
240
|
+
const args = ['-i', prompt];
|
|
241
|
+
if (model) {
|
|
242
|
+
args.push('--model', model);
|
|
243
|
+
}
|
|
244
|
+
if (agent) {
|
|
245
|
+
args.push('--agent', agent);
|
|
246
|
+
}
|
|
247
|
+
const dangerouslySkipPermissions = config?.agy?.dangerouslySkipPermissions ?? true;
|
|
248
|
+
if (dangerouslySkipPermissions) {
|
|
249
|
+
args.push('--dangerously-skip-permissions');
|
|
250
|
+
}
|
|
251
|
+
const child = spawn(agyBin, args, {
|
|
252
|
+
cwd,
|
|
253
|
+
env: process.env,
|
|
254
|
+
stdio: 'inherit',
|
|
255
|
+
});
|
|
256
|
+
return new Promise((resolve) => {
|
|
257
|
+
child.on('error', () => resolve(1));
|
|
258
|
+
child.on('close', (code) => resolve(code ?? 1));
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
async readInteractiveUsage(_options) {
|
|
262
|
+
// AGY has no confirmed local usage artifact in scope; timing is still exact.
|
|
263
|
+
return NULL_INTERACTIVE_USAGE;
|
|
264
|
+
}
|
|
250
265
|
}
|
|
251
266
|
//# sourceMappingURL=agy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agy.js","sourceRoot":"","sources":["../../../src/harness/agy/agy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAkB,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,iBAAi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,MAAM,EAAE,IAAI,EAAE;YAChC,GAAG;YACH,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;QAEH,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;YACrC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YACpC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,QAAqC;QAC9D,6EAA6E;QAC7E,OAAO,sBAAsB,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PlanningTurn } from '../../core/report/planning-slice.js';
|
|
2
|
+
/** Assistant tool names whose successful call counts as one planning edit. */
|
|
3
|
+
export declare const EDIT_TOOLS: Set<string>;
|
|
4
|
+
/**
|
|
5
|
+
* One Claude model response. `messageId` stays non-enumerable: it carries the
|
|
6
|
+
* native identity used when transcripts and their subagent files are merged,
|
|
7
|
+
* without changing the serialized `PlanningTurn` shape.
|
|
8
|
+
*/
|
|
9
|
+
export interface ClaudeTurn extends PlanningTurn {
|
|
10
|
+
readonly messageId: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** Session metadata and one turn per distinct native message of a transcript. */
|
|
13
|
+
export interface ClaudeTurns {
|
|
14
|
+
readonly sessionId: string | null;
|
|
15
|
+
readonly cwd: string | null;
|
|
16
|
+
readonly harnessVersion: string | null;
|
|
17
|
+
readonly sessionCost: number | null;
|
|
18
|
+
readonly turns: readonly ClaudeTurn[];
|
|
19
|
+
}
|
|
20
|
+
export declare function asRecord(value: unknown): Record<string, unknown> | undefined;
|
|
21
|
+
export declare function text(value: unknown): string | null;
|
|
22
|
+
export declare function validIso(value: unknown): string | null;
|
|
23
|
+
export declare function finiteNonNegative(value: unknown): number | null;
|
|
24
|
+
export declare function contentBlocks(record: Record<string, unknown>): Record<string, unknown>[];
|
|
25
|
+
/** JSONL records with malformed lines ignored; no content is retained. */
|
|
26
|
+
export declare function parseRecords(content: string): Record<string, unknown>[];
|
|
27
|
+
/** Group assistant records into one turn per distinct `message.id`. */
|
|
28
|
+
export declare function parseClaudeTurns(content: string): ClaudeTurns;
|
|
29
|
+
//# sourceMappingURL=claude-turns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-turns.d.ts","sourceRoot":"","sources":["../../../src/harness/claude/claude-turns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAExE,8EAA8E;AAC9E,eAAO,MAAM,UAAU,aAA6C,CAAC;AAErE;;;;GAIG;AACH,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;CACvC;AAkBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAI5E;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAElD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAGtD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAE/D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAMxF;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAYvE;AAmED,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAmD7D"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/** Assistant tool names whose successful call counts as one planning edit. */
|
|
2
|
+
export const EDIT_TOOLS = new Set(['Write', 'Edit', 'NotebookEdit']);
|
|
3
|
+
export function asRecord(value) {
|
|
4
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
5
|
+
? value
|
|
6
|
+
: undefined;
|
|
7
|
+
}
|
|
8
|
+
export function text(value) {
|
|
9
|
+
return typeof value === 'string' && value.length > 0 ? value : null;
|
|
10
|
+
}
|
|
11
|
+
export function validIso(value) {
|
|
12
|
+
if (typeof value !== 'string' || value.length === 0)
|
|
13
|
+
return null;
|
|
14
|
+
return Number.isFinite(Date.parse(value)) ? value : null;
|
|
15
|
+
}
|
|
16
|
+
export function finiteNonNegative(value) {
|
|
17
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null;
|
|
18
|
+
}
|
|
19
|
+
export function contentBlocks(record) {
|
|
20
|
+
const message = asRecord(record.message);
|
|
21
|
+
if (!Array.isArray(message?.content))
|
|
22
|
+
return [];
|
|
23
|
+
return message.content
|
|
24
|
+
.map((block) => asRecord(block))
|
|
25
|
+
.filter((block) => block !== undefined);
|
|
26
|
+
}
|
|
27
|
+
/** JSONL records with malformed lines ignored; no content is retained. */
|
|
28
|
+
export function parseRecords(content) {
|
|
29
|
+
const records = [];
|
|
30
|
+
for (const line of content.split('\n')) {
|
|
31
|
+
if (!line.trim())
|
|
32
|
+
continue;
|
|
33
|
+
try {
|
|
34
|
+
const parsed = asRecord(JSON.parse(line));
|
|
35
|
+
if (parsed)
|
|
36
|
+
records.push(parsed);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Malformed lines are ignored; the affected turn keeps null usage.
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return records;
|
|
43
|
+
}
|
|
44
|
+
function collectErrored(records) {
|
|
45
|
+
const errored = new Set();
|
|
46
|
+
for (const record of records) {
|
|
47
|
+
for (const block of contentBlocks(record)) {
|
|
48
|
+
if (block.type === 'tool_result' && block.is_error === true) {
|
|
49
|
+
const id = text(block.tool_use_id);
|
|
50
|
+
if (id)
|
|
51
|
+
errored.add(id);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return errored;
|
|
56
|
+
}
|
|
57
|
+
function editPath(block) {
|
|
58
|
+
const name = block.name;
|
|
59
|
+
if (typeof name !== 'string' || !EDIT_TOOLS.has(name))
|
|
60
|
+
return null;
|
|
61
|
+
const input = asRecord(block.input);
|
|
62
|
+
return name === 'NotebookEdit' ? text(input?.notebook_path) : text(input?.file_path);
|
|
63
|
+
}
|
|
64
|
+
function numberField(record, key) {
|
|
65
|
+
return record ? finiteNonNegative(record[key]) : null;
|
|
66
|
+
}
|
|
67
|
+
function hasUsage(message) {
|
|
68
|
+
return asRecord(message.usage) !== undefined;
|
|
69
|
+
}
|
|
70
|
+
function parseUsage(message) {
|
|
71
|
+
const usage = asRecord(message.usage);
|
|
72
|
+
const details = asRecord(usage?.output_tokens_details);
|
|
73
|
+
return {
|
|
74
|
+
input: numberField(usage, 'input_tokens'),
|
|
75
|
+
output: numberField(usage, 'output_tokens'),
|
|
76
|
+
cacheRead: numberField(usage, 'cache_read_input_tokens'),
|
|
77
|
+
cacheWrite: numberField(usage, 'cache_creation_input_tokens'),
|
|
78
|
+
reasoning: numberField(details, 'thinking_tokens'),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const EMPTY_USAGE = {
|
|
82
|
+
input: null,
|
|
83
|
+
output: null,
|
|
84
|
+
cacheRead: null,
|
|
85
|
+
cacheWrite: null,
|
|
86
|
+
reasoning: null,
|
|
87
|
+
};
|
|
88
|
+
function makeTurn(draft) {
|
|
89
|
+
const usage = draft.usage ?? EMPTY_USAGE;
|
|
90
|
+
const turn = {
|
|
91
|
+
timestamp: draft.earliest,
|
|
92
|
+
model: draft.model,
|
|
93
|
+
inputTokens: usage.input,
|
|
94
|
+
outputTokens: usage.output,
|
|
95
|
+
cacheReadTokens: usage.cacheRead,
|
|
96
|
+
cacheWriteTokens: usage.cacheWrite,
|
|
97
|
+
reasoningTokens: usage.reasoning,
|
|
98
|
+
cost: null,
|
|
99
|
+
edits: draft.edits,
|
|
100
|
+
};
|
|
101
|
+
Object.defineProperty(turn, 'messageId', { value: draft.id, enumerable: false });
|
|
102
|
+
return turn;
|
|
103
|
+
}
|
|
104
|
+
/** Group assistant records into one turn per distinct `message.id`. */
|
|
105
|
+
export function parseClaudeTurns(content) {
|
|
106
|
+
const records = parseRecords(content);
|
|
107
|
+
const errored = collectErrored(records);
|
|
108
|
+
const drafts = new Map();
|
|
109
|
+
let anonymous = 0;
|
|
110
|
+
let sessionId = null;
|
|
111
|
+
let cwd = null;
|
|
112
|
+
let harnessVersion = null;
|
|
113
|
+
let sessionCost = null;
|
|
114
|
+
for (const record of records) {
|
|
115
|
+
sessionId = sessionId ?? text(record.sessionId);
|
|
116
|
+
cwd = cwd ?? text(record.cwd);
|
|
117
|
+
harnessVersion = harnessVersion ?? text(record.version);
|
|
118
|
+
if (record.type === 'cost-state') {
|
|
119
|
+
sessionCost = finiteNonNegative(record.totalCostUSD);
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const message = asRecord(record.message);
|
|
123
|
+
const isAssistant = record.type === 'assistant' || message?.role === 'assistant';
|
|
124
|
+
const timestamp = validIso(record.timestamp);
|
|
125
|
+
if (!isAssistant || !timestamp)
|
|
126
|
+
continue;
|
|
127
|
+
const id = message ? text(message.id) : null;
|
|
128
|
+
const key = id ?? `\u0000anonymous:${anonymous++}`;
|
|
129
|
+
const draft = drafts.get(key) ?? {
|
|
130
|
+
id,
|
|
131
|
+
earliest: timestamp,
|
|
132
|
+
model: null,
|
|
133
|
+
usage: null,
|
|
134
|
+
edits: [],
|
|
135
|
+
};
|
|
136
|
+
if (timestamp < draft.earliest)
|
|
137
|
+
draft.earliest = timestamp;
|
|
138
|
+
if (draft.model === null && message)
|
|
139
|
+
draft.model = text(message.model);
|
|
140
|
+
if (draft.usage === null && message && hasUsage(message))
|
|
141
|
+
draft.usage = parseUsage(message);
|
|
142
|
+
drafts.set(key, draft);
|
|
143
|
+
for (const block of contentBlocks(record)) {
|
|
144
|
+
if (block.type !== 'tool_use')
|
|
145
|
+
continue;
|
|
146
|
+
const toolId = text(block.id);
|
|
147
|
+
if (toolId && errored.has(toolId))
|
|
148
|
+
continue;
|
|
149
|
+
const target = editPath(block);
|
|
150
|
+
if (target)
|
|
151
|
+
draft.edits.push(target);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
sessionId,
|
|
156
|
+
cwd,
|
|
157
|
+
harnessVersion,
|
|
158
|
+
sessionCost,
|
|
159
|
+
turns: [...drafts.values()].map(makeTurn),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=claude-turns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-turns.js","sourceRoot":"","sources":["../../../src/harness/claude/claude-turns.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;AAoCrE,MAAM,UAAU,QA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,UAAU;gBAAE,SAAS;YACxC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC9B,IAAI,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;gBAAE,SAAS;YAC5C,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,MAAM;gBAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO;QACL,SAAS;QACT,GAAG;QACH,cAAc;QACd,WAAW;QACX,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;KAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ObservedPlanningSession } from '../../core/report/planning-observed.js';
|
|
2
|
+
/** Resolve the Claude session store: explicit osq override, config dir, or home. */
|
|
3
|
+
export declare function resolveClaudeProjectsDir(env?: NodeJS.ProcessEnv, homeDir?: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Parse one Claude session JSONL body. Each assistant message becomes one turn
|
|
6
|
+
* carrying its own usage. A session without any edited path yields null; the
|
|
7
|
+
* observer derives no session-level usage, edits, or start and end times.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseClaudeSession(content: string): ObservedPlanningSession | null;
|
|
10
|
+
/** Recursively read and merge Claude sessions by native session id. */
|
|
11
|
+
export declare function readClaudePlanningSessions(projectsDir?: string): Promise<readonly ObservedPlanningSession[]>;
|
|
12
|
+
//# sourceMappingURL=claude-usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-usage.d.ts","sourceRoot":"","sources":["../../../src/harness/claude/claude-usage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAItF,oFAAoF;AACpF,wBAAgB,wBAAwB,CACtC,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,OAAO,GAAE,MAAqB,GAC7B,MAAM,CAMR;AAQD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB,GAAG,IAAI,CAalF;AAmGD,uEAAuE;AACvE,wBAAsB,0BAA0B,CAC9C,WAAW,GAAE,MAAmC,GAC/C,OAAO,CAAC,SAAS,uBAAuB,EAAE,CAAC,CAe7C"}
|