@stringsync/splates 0.0.60 → 1.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/artifact.d.ts +2 -2
- package/blockers.d.ts +1 -1
- package/config.d.ts +12 -0
- package/config.js +0 -0
- package/creds.d.ts +2 -2
- package/evals.d.ts +2 -2
- package/flags.d.ts +4 -4
- package/handoff.d.ts +3 -4
- package/hook.d.ts +2 -2
- package/index.js +108 -108
- package/lane.d.ts +2 -2
- package/mirror.d.ts +14 -0
- package/mirror.js +22 -0
- package/package.json +12 -4
- package/projects.d.ts +2 -2
- package/queue.d.ts +2 -2
- package/replica.d.ts +2 -2
- package/server.d.ts +2 -2
- package/setup.d.ts +2 -2
- package/ship.d.ts +2 -2
- package/slots.d.ts +2 -2
- package/splates.d.ts +2 -2
- package/task.d.ts +2 -2
- package/tunnel.d.ts +2 -2
- package/vendor/@stringsync/splates-server/LICENSE +21 -0
- package/vendor/@stringsync/splates-server/age.d.ts +2 -0
- package/vendor/@stringsync/splates-server/agents/acp-extensions.d.ts +92 -0
- package/vendor/@stringsync/splates-server/agents/agents.d.ts +19 -0
- package/vendor/@stringsync/splates-server/agents/compaction.d.ts +17 -0
- package/vendor/@stringsync/splates-server/agents/connection.d.ts +191 -0
- package/vendor/@stringsync/splates-server/agents/errors.d.ts +8 -0
- package/vendor/@stringsync/splates-server/agents/fold.d.ts +45 -0
- package/vendor/@stringsync/splates-server/agents/index.d.ts +16 -0
- package/vendor/@stringsync/splates-server/agents/index.js +60 -0
- package/vendor/@stringsync/splates-server/agents/process.d.ts +67 -0
- package/vendor/@stringsync/splates-server/agents/scratch.d.ts +7 -0
- package/vendor/@stringsync/splates-server/agents/shared-browser.d.ts +47 -0
- package/vendor/@stringsync/splates-server/agents/start-lock.d.ts +24 -0
- package/vendor/@stringsync/splates-server/agents/stream.d.ts +91 -0
- package/vendor/@stringsync/splates-server/agents/tool-calls.d.ts +18 -0
- package/vendor/@stringsync/splates-server/agents/watch.d.ts +46 -0
- package/vendor/@stringsync/splates-server/agents/watched.d.ts +43 -0
- package/vendor/@stringsync/splates-server/artifacts/artifact.d.ts +33 -0
- package/vendor/@stringsync/splates-server/artifacts/artifacts.d.ts +162 -0
- package/vendor/@stringsync/splates-server/artifacts/attach.d.ts +31 -0
- package/vendor/@stringsync/splates-server/artifacts/attachments.d.ts +50 -0
- package/vendor/@stringsync/splates-server/artifacts/index.d.ts +8 -0
- package/vendor/@stringsync/splates-server/artifacts/index.js +38 -0
- package/vendor/@stringsync/splates-server/artifacts/room.d.ts +46 -0
- package/vendor/@stringsync/splates-server/artifacts/routes.d.ts +22 -0
- package/vendor/@stringsync/splates-server/artifacts/viewers.d.ts +6 -0
- package/vendor/@stringsync/splates-server/auto-pick/classes.d.ts +29 -0
- package/vendor/@stringsync/splates-server/auto-pick/classify.d.ts +60 -0
- package/vendor/@stringsync/splates-server/auto-pick/clef.d.ts +15 -0
- package/vendor/@stringsync/splates-server/auto-pick/decide.d.ts +78 -0
- package/vendor/@stringsync/splates-server/auto-pick/defaults.d.ts +3 -0
- package/vendor/@stringsync/splates-server/auto-pick/follow-up.d.ts +25 -0
- package/vendor/@stringsync/splates-server/auto-pick/index.d.ts +24 -0
- package/vendor/@stringsync/splates-server/auto-pick/jev.d.ts +38 -0
- package/vendor/@stringsync/splates-server/auto-pick/judge.d.ts +21 -0
- package/vendor/@stringsync/splates-server/auto-pick/judged.d.ts +33 -0
- package/vendor/@stringsync/splates-server/auto-pick/key.d.ts +6 -0
- package/vendor/@stringsync/splates-server/auto-pick/lift.d.ts +18 -0
- package/vendor/@stringsync/splates-server/auto-pick/queue.d.ts +30 -0
- package/vendor/@stringsync/splates-server/auto-pick/rank.d.ts +10 -0
- package/vendor/@stringsync/splates-server/auto-pick/record.d.ts +19 -0
- package/vendor/@stringsync/splates-server/auto-pick/routes.d.ts +25 -0
- package/vendor/@stringsync/splates-server/auto-pick/rule-names.d.ts +9 -0
- package/vendor/@stringsync/splates-server/auto-pick/rules-routes.d.ts +49 -0
- package/vendor/@stringsync/splates-server/auto-pick/rules.d.ts +97 -0
- package/vendor/@stringsync/splates-server/auto-pick/start.d.ts +79 -0
- package/vendor/@stringsync/splates-server/auto-pick/store.d.ts +25 -0
- package/vendor/@stringsync/splates-server/auto-pick/system-one.d.ts +60 -0
- package/vendor/@stringsync/splates-server/auto-pick/trial.d.ts +32 -0
- package/vendor/@stringsync/splates-server/board/backlog.d.ts +4 -0
- package/vendor/@stringsync/splates-server/board/blocked-warning.d.ts +7 -0
- package/vendor/@stringsync/splates-server/board/browser.d.ts +8 -0
- package/vendor/@stringsync/splates-server/board/change-lane.d.ts +12 -0
- package/vendor/@stringsync/splates-server/board/deferral.d.ts +87 -0
- package/vendor/@stringsync/splates-server/board/elsewhere-links.d.ts +26 -0
- package/vendor/@stringsync/splates-server/board/elsewhere.d.ts +119 -0
- package/vendor/@stringsync/splates-server/board/index.d.ts +21 -0
- package/vendor/@stringsync/splates-server/board/index.js +112 -0
- package/vendor/@stringsync/splates-server/board/lane.d.ts +69 -0
- package/vendor/@stringsync/splates-server/board/lanes-from-tags.d.ts +17 -0
- package/vendor/@stringsync/splates-server/board/lanes.d.ts +117 -0
- package/vendor/@stringsync/splates-server/board/routes.d.ts +54 -0
- package/vendor/@stringsync/splates-server/board/store.d.ts +74 -0
- package/vendor/@stringsync/splates-server/board/task-edit.d.ts +81 -0
- package/vendor/@stringsync/splates-server/board/task-file.d.ts +24 -0
- package/vendor/@stringsync/splates-server/board/task-journal.d.ts +9 -0
- package/vendor/@stringsync/splates-server/board/task-lanes.d.ts +95 -0
- package/vendor/@stringsync/splates-server/board/task-list.d.ts +40 -0
- package/vendor/@stringsync/splates-server/board/task.d.ts +301 -0
- package/vendor/@stringsync/splates-server/board/tasks.d.ts +172 -0
- package/vendor/@stringsync/splates-server/chunk-files-jkqj87yx.js +14 -0
- package/vendor/@stringsync/splates-server/chunk-maps-mnjqydx4.txt +1 -0
- package/vendor/@stringsync/splates-server/chunks-3jkzx1q9.txt +1 -0
- package/vendor/@stringsync/splates-server/comma-list.d.ts +2 -0
- package/vendor/@stringsync/splates-server/comma-list.js +6 -0
- package/vendor/@stringsync/splates-server/config/browser.d.ts +1 -0
- package/vendor/@stringsync/splates-server/config/config.d.ts +210 -0
- package/vendor/@stringsync/splates-server/config/index.d.ts +6 -0
- package/vendor/@stringsync/splates-server/config/index.js +42 -0
- package/vendor/@stringsync/splates-server/config/legacy-names.d.ts +70 -0
- package/vendor/@stringsync/splates-server/config/legacy-ps.d.ts +32 -0
- package/vendor/@stringsync/splates-server/config/load.d.ts +46 -0
- package/vendor/@stringsync/splates-server/config/source.d.ts +7 -0
- package/vendor/@stringsync/splates-server/config/type-config.d.ts +14 -0
- package/vendor/@stringsync/splates-server/conversations/answered.d.ts +7 -0
- package/vendor/@stringsync/splates-server/conversations/archive.d.ts +16 -0
- package/vendor/@stringsync/splates-server/conversations/background.d.ts +21 -0
- package/vendor/@stringsync/splates-server/conversations/browser.d.ts +12 -0
- package/vendor/@stringsync/splates-server/conversations/choice.d.ts +8 -0
- package/vendor/@stringsync/splates-server/conversations/compact.d.ts +6 -0
- package/vendor/@stringsync/splates-server/conversations/conversation.d.ts +420 -0
- package/vendor/@stringsync/splates-server/conversations/conversations.d.ts +181 -0
- package/vendor/@stringsync/splates-server/conversations/entry.d.ts +286 -0
- package/vendor/@stringsync/splates-server/conversations/events.d.ts +36 -0
- package/vendor/@stringsync/splates-server/conversations/files.d.ts +62 -0
- package/vendor/@stringsync/splates-server/conversations/given.d.ts +18 -0
- package/vendor/@stringsync/splates-server/conversations/heard.d.ts +8 -0
- package/vendor/@stringsync/splates-server/conversations/host.d.ts +176 -0
- package/vendor/@stringsync/splates-server/conversations/index.d.ts +22 -0
- package/vendor/@stringsync/splates-server/conversations/index.js +80 -0
- package/vendor/@stringsync/splates-server/conversations/listing.d.ts +15 -0
- package/vendor/@stringsync/splates-server/conversations/log.d.ts +117 -0
- package/vendor/@stringsync/splates-server/conversations/messages.d.ts +23 -0
- package/vendor/@stringsync/splates-server/conversations/name.d.ts +38 -0
- package/vendor/@stringsync/splates-server/conversations/options.d.ts +87 -0
- package/vendor/@stringsync/splates-server/conversations/outside.d.ts +14 -0
- package/vendor/@stringsync/splates-server/conversations/reference.d.ts +2 -0
- package/vendor/@stringsync/splates-server/conversations/routes.d.ts +109 -0
- package/vendor/@stringsync/splates-server/conversations/search.d.ts +15 -0
- package/vendor/@stringsync/splates-server/conversations/spent.d.ts +19 -0
- package/vendor/@stringsync/splates-server/conversations/state.d.ts +606 -0
- package/vendor/@stringsync/splates-server/conversations/stream.d.ts +34 -0
- package/vendor/@stringsync/splates-server/conversations/transcript.d.ts +9 -0
- package/vendor/@stringsync/splates-server/conversations/tree.d.ts +11 -0
- package/vendor/@stringsync/splates-server/conversations/turn-end.d.ts +30 -0
- package/vendor/@stringsync/splates-server/conversations/turns.d.ts +134 -0
- package/vendor/@stringsync/splates-server/conversations/updates.d.ts +21 -0
- package/vendor/@stringsync/splates-server/creds/creds.d.ts +86 -0
- package/vendor/@stringsync/splates-server/creds/index.d.ts +6 -0
- package/vendor/@stringsync/splates-server/creds/index.js +28 -0
- package/vendor/@stringsync/splates-server/creds/key-file.d.ts +21 -0
- package/vendor/@stringsync/splates-server/creds/requests.d.ts +54 -0
- package/vendor/@stringsync/splates-server/creds/routes.d.ts +16 -0
- package/vendor/@stringsync/splates-server/creds/stores.d.ts +37 -0
- package/vendor/@stringsync/splates-server/dictate/connection.d.ts +18 -0
- package/vendor/@stringsync/splates-server/dictate/dictate.d.ts +16 -0
- package/vendor/@stringsync/splates-server/dictate/index.d.ts +4 -0
- package/vendor/@stringsync/splates-server/dictate/personal.d.ts +26 -0
- package/vendor/@stringsync/splates-server/dictate/transcriber.d.ts +16 -0
- package/vendor/@stringsync/splates-server/dictate/vocabulary.d.ts +12 -0
- package/vendor/@stringsync/splates-server/evals/agents-routes.d.ts +27 -0
- package/vendor/@stringsync/splates-server/evals/agents.d.ts +25 -0
- package/vendor/@stringsync/splates-server/evals/contract.d.ts +73 -0
- package/vendor/@stringsync/splates-server/evals/done.d.ts +11 -0
- package/vendor/@stringsync/splates-server/evals/import.d.ts +10 -0
- package/vendor/@stringsync/splates-server/evals/index.d.ts +19 -0
- package/vendor/@stringsync/splates-server/evals/index.js +40 -0
- package/vendor/@stringsync/splates-server/evals/inspect.d.ts +66 -0
- package/vendor/@stringsync/splates-server/evals/launch-routes.d.ts +39 -0
- package/vendor/@stringsync/splates-server/evals/launch.d.ts +123 -0
- package/vendor/@stringsync/splates-server/evals/routes.d.ts +39 -0
- package/vendor/@stringsync/splates-server/evals/store.d.ts +17 -0
- package/vendor/@stringsync/splates-server/evals/target.d.ts +3 -0
- package/vendor/@stringsync/splates-server/evals/types.d.ts +105 -0
- package/vendor/@stringsync/splates-server/exit.d.ts +55 -0
- package/vendor/@stringsync/splates-server/exit.js +12 -0
- package/vendor/@stringsync/splates-server/git-identity.d.ts +17 -0
- package/vendor/@stringsync/splates-server/git-process.d.ts +8 -0
- package/vendor/@stringsync/splates-server/git.d.ts +168 -0
- package/vendor/@stringsync/splates-server/hooks/commands.d.ts +31 -0
- package/vendor/@stringsync/splates-server/hooks/edit.d.ts +24 -0
- package/vendor/@stringsync/splates-server/hooks/events.d.ts +20 -0
- package/vendor/@stringsync/splates-server/hooks/groomer.d.ts +8 -0
- package/vendor/@stringsync/splates-server/hooks/index.d.ts +17 -0
- package/vendor/@stringsync/splates-server/hooks/index.js +61 -0
- package/vendor/@stringsync/splates-server/hooks/now.d.ts +9 -0
- package/vendor/@stringsync/splates-server/hooks/routes.d.ts +39 -0
- package/vendor/@stringsync/splates-server/hooks/runner.d.ts +75 -0
- package/vendor/@stringsync/splates-server/hooks/runs.d.ts +38 -0
- package/vendor/@stringsync/splates-server/hooks/schedule.d.ts +10 -0
- package/vendor/@stringsync/splates-server/hooks/scheduler.d.ts +28 -0
- package/vendor/@stringsync/splates-server/hooks/store.d.ts +110 -0
- package/vendor/@stringsync/splates-server/index-01z7ycdk.js +6 -0
- package/vendor/@stringsync/splates-server/index-0jttnv86.js +1309 -0
- package/vendor/@stringsync/splates-server/index-5axhdy8c.js +692 -0
- package/vendor/@stringsync/splates-server/index-76t8y8h5.js +779 -0
- package/vendor/@stringsync/splates-server/index-7s01973c.js +2356 -0
- package/vendor/@stringsync/splates-server/index-acbcm66f.js +1468 -0
- package/vendor/@stringsync/splates-server/index-caep3sde.js +27140 -0
- package/vendor/@stringsync/splates-server/index-e9z7s5hh.js +641 -0
- package/vendor/@stringsync/splates-server/index-g18nxyn7.js +99 -0
- package/vendor/@stringsync/splates-server/index-kmzdvvt0.js +23 -0
- package/vendor/@stringsync/splates-server/index-raqrwzdq.js +952 -0
- package/vendor/@stringsync/splates-server/index-t9w5a8ed.js +60 -0
- package/vendor/@stringsync/splates-server/limited.d.ts +8 -0
- package/vendor/@stringsync/splates-server/log.d.ts +14 -0
- package/vendor/@stringsync/splates-server/log.js +32 -0
- package/vendor/@stringsync/splates-server/merge/attribution.d.ts +24 -0
- package/vendor/@stringsync/splates-server/merge/batch.d.ts +119 -0
- package/vendor/@stringsync/splates-server/merge/blame.d.ts +21 -0
- package/vendor/@stringsync/splates-server/merge/branches.d.ts +151 -0
- package/vendor/@stringsync/splates-server/merge/charge.d.ts +18 -0
- package/vendor/@stringsync/splates-server/merge/clear-gate.d.ts +7 -0
- package/vendor/@stringsync/splates-server/merge/cores.d.ts +60 -0
- package/vendor/@stringsync/splates-server/merge/estimates.d.ts +28 -0
- package/vendor/@stringsync/splates-server/merge/finish.d.ts +43 -0
- package/vendor/@stringsync/splates-server/merge/follow.d.ts +50 -0
- package/vendor/@stringsync/splates-server/merge/gate.d.ts +108 -0
- package/vendor/@stringsync/splates-server/merge/github-app.d.ts +99 -0
- package/vendor/@stringsync/splates-server/merge/github-refused.d.ts +5 -0
- package/vendor/@stringsync/splates-server/merge/groups.d.ts +8 -0
- package/vendor/@stringsync/splates-server/merge/index.d.ts +19 -0
- package/vendor/@stringsync/splates-server/merge/index.js +46 -0
- package/vendor/@stringsync/splates-server/merge/landed.d.ts +28 -0
- package/vendor/@stringsync/splates-server/merge/landing.d.ts +38 -0
- package/vendor/@stringsync/splates-server/merge/local-landing.d.ts +11 -0
- package/vendor/@stringsync/splates-server/merge/merge-state.d.ts +37 -0
- package/vendor/@stringsync/splates-server/merge/merge.d.ts +45 -0
- package/vendor/@stringsync/splates-server/merge/output.d.ts +19 -0
- package/vendor/@stringsync/splates-server/merge/phases.d.ts +27 -0
- package/vendor/@stringsync/splates-server/merge/pre-lock.d.ts +28 -0
- package/vendor/@stringsync/splates-server/merge/preflight.d.ts +16 -0
- package/vendor/@stringsync/splates-server/merge/queue-failures.d.ts +11 -0
- package/vendor/@stringsync/splates-server/merge/rebase.d.ts +34 -0
- package/vendor/@stringsync/splates-server/merge/recent-failures.d.ts +10 -0
- package/vendor/@stringsync/splates-server/merge/refusal.d.ts +58 -0
- package/vendor/@stringsync/splates-server/merge/split.d.ts +34 -0
- package/vendor/@stringsync/splates-server/merge/steps.d.ts +37 -0
- package/vendor/@stringsync/splates-server/merge/test-report.d.ts +29 -0
- package/vendor/@stringsync/splates-server/merge/timing.d.ts +20 -0
- package/vendor/@stringsync/splates-server/merge/trunk.d.ts +69 -0
- package/vendor/@stringsync/splates-server/models/codex-limits.d.ts +19 -0
- package/vendor/@stringsync/splates-server/models/effort.d.ts +22 -0
- package/vendor/@stringsync/splates-server/models/index.d.ts +13 -0
- package/vendor/@stringsync/splates-server/models/index.js +76 -0
- package/vendor/@stringsync/splates-server/models/kimi-limits.d.ts +37 -0
- package/vendor/@stringsync/splates-server/models/kimi-usage.d.ts +19 -0
- package/vendor/@stringsync/splates-server/models/kimi.d.ts +10 -0
- package/vendor/@stringsync/splates-server/models/limits.d.ts +32 -0
- package/vendor/@stringsync/splates-server/models/models.d.ts +36 -0
- package/vendor/@stringsync/splates-server/models/offered.d.ts +47 -0
- package/vendor/@stringsync/splates-server/models/opencode-usage.d.ts +37 -0
- package/vendor/@stringsync/splates-server/models/roster.d.ts +130 -0
- package/vendor/@stringsync/splates-server/plans/asked.d.ts +99 -0
- package/vendor/@stringsync/splates-server/plans/browser.d.ts +13 -0
- package/vendor/@stringsync/splates-server/plans/decided.d.ts +12 -0
- package/vendor/@stringsync/splates-server/plans/demo.d.ts +29 -0
- package/vendor/@stringsync/splates-server/plans/index.d.ts +16 -0
- package/vendor/@stringsync/splates-server/plans/index.js +137 -0
- package/vendor/@stringsync/splates-server/plans/needs.d.ts +131 -0
- package/vendor/@stringsync/splates-server/plans/permission.d.ts +64 -0
- package/vendor/@stringsync/splates-server/plans/plan.d.ts +223 -0
- package/vendor/@stringsync/splates-server/plans/prompts.d.ts +148 -0
- package/vendor/@stringsync/splates-server/plans/reply.d.ts +45 -0
- package/vendor/@stringsync/splates-server/plans/run-command.d.ts +21 -0
- package/vendor/@stringsync/splates-server/plans/store.d.ts +26 -0
- package/vendor/@stringsync/splates-server/plans/unanswered.d.ts +15 -0
- package/vendor/@stringsync/splates-server/ports/index.d.ts +8 -0
- package/vendor/@stringsync/splates-server/ports/index.js +36 -0
- package/vendor/@stringsync/splates-server/ports/list.d.ts +22 -0
- package/vendor/@stringsync/splates-server/ports/routes.d.ts +64 -0
- package/vendor/@stringsync/splates-server/ports/slot-tunnel.d.ts +24 -0
- package/vendor/@stringsync/splates-server/ports/slot.d.ts +28 -0
- package/vendor/@stringsync/splates-server/ports/slots.d.ts +150 -0
- package/vendor/@stringsync/splates-server/ports/socket.d.ts +26 -0
- package/vendor/@stringsync/splates-server/ports/task-ports.d.ts +39 -0
- package/vendor/@stringsync/splates-server/prices/index.d.ts +2 -0
- package/vendor/@stringsync/splates-server/prices/prices.d.ts +65 -0
- package/vendor/@stringsync/splates-server/projects/everywhere-routes.d.ts +110 -0
- package/vendor/@stringsync/splates-server/projects/everywhere.d.ts +43 -0
- package/vendor/@stringsync/splates-server/projects/general.d.ts +4 -0
- package/vendor/@stringsync/splates-server/projects/index.d.ts +10 -0
- package/vendor/@stringsync/splates-server/projects/index.js +36 -0
- package/vendor/@stringsync/splates-server/projects/init.d.ts +28 -0
- package/vendor/@stringsync/splates-server/projects/picker.d.ts +64 -0
- package/vendor/@stringsync/splates-server/projects/projects.d.ts +155 -0
- package/vendor/@stringsync/splates-server/projects/reaches.d.ts +26 -0
- package/vendor/@stringsync/splates-server/push/index.d.ts +2 -0
- package/vendor/@stringsync/splates-server/push/notices.d.ts +44 -0
- package/vendor/@stringsync/splates-server/push/push.d.ts +91 -0
- package/vendor/@stringsync/splates-server/queue/commands.d.ts +44 -0
- package/vendor/@stringsync/splates-server/queue/index.d.ts +7 -0
- package/vendor/@stringsync/splates-server/queue/index.js +44 -0
- package/vendor/@stringsync/splates-server/queue/moves.d.ts +15 -0
- package/vendor/@stringsync/splates-server/queue/name.d.ts +9 -0
- package/vendor/@stringsync/splates-server/queue/order.d.ts +50 -0
- package/vendor/@stringsync/splates-server/queue/runner.d.ts +129 -0
- package/vendor/@stringsync/splates-server/records/elsewhere.d.ts +27 -0
- package/vendor/@stringsync/splates-server/records/events.d.ts +556 -0
- package/vendor/@stringsync/splates-server/records/format.d.ts +92 -0
- package/vendor/@stringsync/splates-server/records/home.d.ts +72 -0
- package/vendor/@stringsync/splates-server/records/index.d.ts +10 -0
- package/vendor/@stringsync/splates-server/records/index.js +40 -0
- package/vendor/@stringsync/splates-server/records/journal.d.ts +65 -0
- package/vendor/@stringsync/splates-server/records/lease-lock.d.ts +29 -0
- package/vendor/@stringsync/splates-server/records/migration.d.ts +94 -0
- package/vendor/@stringsync/splates-server/records/one-task-store.d.ts +15 -0
- package/vendor/@stringsync/splates-server/records/repository.d.ts +137 -0
- package/vendor/@stringsync/splates-server/records/task-files.d.ts +8 -0
- package/vendor/@stringsync/splates-server/records/task-stages.d.ts +7 -0
- package/vendor/@stringsync/splates-server/records/to-sqlite.d.ts +3 -0
- package/vendor/@stringsync/splates-server/replica/aws-sign.d.ts +30 -0
- package/vendor/@stringsync/splates-server/replica/dir.d.ts +17 -0
- package/vendor/@stringsync/splates-server/replica/index.d.ts +14 -0
- package/vendor/@stringsync/splates-server/replica/index.js +29 -0
- package/vendor/@stringsync/splates-server/replica/layout.d.ts +45 -0
- package/vendor/@stringsync/splates-server/replica/place.d.ts +31 -0
- package/vendor/@stringsync/splates-server/replica/replica.d.ts +37 -0
- package/vendor/@stringsync/splates-server/replica/replicator.d.ts +102 -0
- package/vendor/@stringsync/splates-server/replica/restore.d.ts +40 -0
- package/vendor/@stringsync/splates-server/replica/s3.d.ts +45 -0
- package/vendor/@stringsync/splates-server/replica/shipped.d.ts +2 -0
- package/vendor/@stringsync/splates-server/replica/status.d.ts +18 -0
- package/vendor/@stringsync/splates-server/server/assets.d.ts +35 -0
- package/vendor/@stringsync/splates-server/server/automations.d.ts +26 -0
- package/vendor/@stringsync/splates-server/server/chunk-files.d.ts +4 -0
- package/vendor/@stringsync/splates-server/server/conflict-watch.d.ts +22 -0
- package/vendor/@stringsync/splates-server/server/early-warning.d.ts +7 -0
- package/vendor/@stringsync/splates-server/server/general.d.ts +53 -0
- package/vendor/@stringsync/splates-server/server/groomer.d.ts +53 -0
- package/vendor/@stringsync/splates-server/server/held.d.ts +10 -0
- package/vendor/@stringsync/splates-server/server/http.d.ts +76 -0
- package/vendor/@stringsync/splates-server/server/index.d.ts +16 -0
- package/vendor/@stringsync/splates-server/server/index.js +14342 -0
- package/vendor/@stringsync/splates-server/server/interrupt.d.ts +24 -0
- package/vendor/@stringsync/splates-server/server/loop-watch.d.ts +12 -0
- package/vendor/@stringsync/splates-server/server/migrations.d.ts +46 -0
- package/vendor/@stringsync/splates-server/server/options.d.ts +143 -0
- package/vendor/@stringsync/splates-server/server/pages.d.ts +35 -0
- package/vendor/@stringsync/splates-server/server/ports.d.ts +11 -0
- package/vendor/@stringsync/splates-server/server/premerge.d.ts +61 -0
- package/vendor/@stringsync/splates-server/server/project-watch.d.ts +94 -0
- package/vendor/@stringsync/splates-server/server/project.d.ts +239 -0
- package/vendor/@stringsync/splates-server/server/pulse.d.ts +8 -0
- package/vendor/@stringsync/splates-server/server/release.d.ts +41 -0
- package/vendor/@stringsync/splates-server/server/replicas.d.ts +23 -0
- package/vendor/@stringsync/splates-server/server/restart.d.ts +177 -0
- package/vendor/@stringsync/splates-server/server/runtime-deps.d.ts +19 -0
- package/vendor/@stringsync/splates-server/server/server.d.ts +19 -0
- package/vendor/@stringsync/splates-server/server/servers.d.ts +31 -0
- package/vendor/@stringsync/splates-server/server/serving.d.ts +28 -0
- package/vendor/@stringsync/splates-server/server/shared.d.ts +14 -0
- package/vendor/@stringsync/splates-server/server/skills.d.ts +16 -0
- package/vendor/@stringsync/splates-server/server/sockets.d.ts +13 -0
- package/vendor/@stringsync/splates-server/server/start-settings.d.ts +15 -0
- package/vendor/@stringsync/splates-server/server/start.d.ts +21 -0
- package/vendor/@stringsync/splates-server/server/suite-grant.d.ts +26 -0
- package/vendor/@stringsync/splates-server/server/supervise.d.ts +81 -0
- package/vendor/@stringsync/splates-server/server/ticketed-lock.d.ts +80 -0
- package/vendor/@stringsync/splates-server/server/update-records.d.ts +8 -0
- package/vendor/@stringsync/splates-server/server/update.d.ts +56 -0
- package/vendor/@stringsync/splates-server/server/versions.d.ts +53 -0
- package/vendor/@stringsync/splates-server/setup/area-auto-pick.d.ts +7 -0
- package/vendor/@stringsync/splates-server/setup/area-dictation.d.ts +3 -0
- package/vendor/@stringsync/splates-server/setup/area-droplet.d.ts +3 -0
- package/vendor/@stringsync/splates-server/setup/area-evals.d.ts +3 -0
- package/vendor/@stringsync/splates-server/setup/area-github.d.ts +8 -0
- package/vendor/@stringsync/splates-server/setup/area-native.d.ts +7 -0
- package/vendor/@stringsync/splates-server/setup/area-opencode.d.ts +5 -0
- package/vendor/@stringsync/splates-server/setup/area-remote.d.ts +3 -0
- package/vendor/@stringsync/splates-server/setup/area-replica.d.ts +3 -0
- package/vendor/@stringsync/splates-server/setup/area-workers.d.ts +5 -0
- package/vendor/@stringsync/splates-server/setup/areas.d.ts +7 -0
- package/vendor/@stringsync/splates-server/setup/checks.d.ts +8 -0
- package/vendor/@stringsync/splates-server/setup/fields.d.ts +69 -0
- package/vendor/@stringsync/splates-server/setup/index.d.ts +8 -0
- package/vendor/@stringsync/splates-server/setup/index.js +25 -0
- package/vendor/@stringsync/splates-server/setup/opencode-model-error.d.ts +3 -0
- package/vendor/@stringsync/splates-server/setup/opencode-models.d.ts +44 -0
- package/vendor/@stringsync/splates-server/setup/opencode-recipe.d.ts +33 -0
- package/vendor/@stringsync/splates-server/setup/opencode-routes.d.ts +17 -0
- package/vendor/@stringsync/splates-server/setup/opencode.d.ts +61 -0
- package/vendor/@stringsync/splates-server/setup/project.d.ts +10 -0
- package/vendor/@stringsync/splates-server/setup/routes.d.ts +31 -0
- package/vendor/@stringsync/splates-server/setup/setup.d.ts +235 -0
- package/vendor/@stringsync/splates-server/setup/step-problem.d.ts +3 -0
- package/vendor/@stringsync/splates-server/setup/undo.d.ts +80 -0
- package/vendor/@stringsync/splates-server/ship/approval-watch.d.ts +57 -0
- package/vendor/@stringsync/splates-server/ship/approval.d.ts +17 -0
- package/vendor/@stringsync/splates-server/ship/cascade-routes.d.ts +25 -0
- package/vendor/@stringsync/splates-server/ship/cascade.d.ts +70 -0
- package/vendor/@stringsync/splates-server/ship/commands.d.ts +26 -0
- package/vendor/@stringsync/splates-server/ship/git.d.ts +31 -0
- package/vendor/@stringsync/splates-server/ship/graph.d.ts +60 -0
- package/vendor/@stringsync/splates-server/ship/history.d.ts +51 -0
- package/vendor/@stringsync/splates-server/ship/index.d.ts +28 -0
- package/vendor/@stringsync/splates-server/ship/live.d.ts +40 -0
- package/vendor/@stringsync/splates-server/ship/mechanical.d.ts +30 -0
- package/vendor/@stringsync/splates-server/ship/npm-terminal.d.ts +14 -0
- package/vendor/@stringsync/splates-server/ship/plan.d.ts +90 -0
- package/vendor/@stringsync/splates-server/ship/progress.d.ts +3 -0
- package/vendor/@stringsync/splates-server/ship/published-notice.d.ts +29 -0
- package/vendor/@stringsync/splates-server/ship/record.d.ts +55 -0
- package/vendor/@stringsync/splates-server/ship/registry.d.ts +13 -0
- package/vendor/@stringsync/splates-server/ship/release-events.d.ts +47 -0
- package/vendor/@stringsync/splates-server/ship/release-steps.d.ts +66 -0
- package/vendor/@stringsync/splates-server/ship/routes.d.ts +14 -0
- package/vendor/@stringsync/splates-server/ship/run.d.ts +132 -0
- package/vendor/@stringsync/splates-server/ship/selection.d.ts +36 -0
- package/vendor/@stringsync/splates-server/ship/served.d.ts +4 -0
- package/vendor/@stringsync/splates-server/ship/stages.d.ts +69 -0
- package/vendor/@stringsync/splates-server/ship/steps.d.ts +69 -0
- package/vendor/@stringsync/splates-server/ship/token-request.d.ts +11 -0
- package/vendor/@stringsync/splates-server/ship/token.d.ts +21 -0
- package/vendor/@stringsync/splates-server/spend/adapters.d.ts +5 -0
- package/vendor/@stringsync/splates-server/spend/billing.d.ts +38 -0
- package/vendor/@stringsync/splates-server/spend/index.d.ts +15 -0
- package/vendor/@stringsync/splates-server/spend/plans.d.ts +45 -0
- package/vendor/@stringsync/splates-server/spend/providers.d.ts +45 -0
- package/vendor/@stringsync/splates-server/spend/rates.d.ts +23 -0
- package/vendor/@stringsync/splates-server/spend/report.d.ts +39 -0
- package/vendor/@stringsync/splates-server/spend/routes.d.ts +46 -0
- package/vendor/@stringsync/splates-server/spend/spend.d.ts +15 -0
- package/vendor/@stringsync/splates-server/spend/totals.d.ts +63 -0
- package/vendor/@stringsync/splates-server/spend/turn.d.ts +39 -0
- package/vendor/@stringsync/splates-server/stats/adherence.d.ts +40 -0
- package/vendor/@stringsync/splates-server/stats/baselines.d.ts +55 -0
- package/vendor/@stringsync/splates-server/stats/budget-routes.d.ts +21 -0
- package/vendor/@stringsync/splates-server/stats/fact-tasks.d.ts +19 -0
- package/vendor/@stringsync/splates-server/stats/finding-facts.d.ts +37 -0
- package/vendor/@stringsync/splates-server/stats/findings.d.ts +89 -0
- package/vendor/@stringsync/splates-server/stats/index.d.ts +12 -0
- package/vendor/@stringsync/splates-server/stats/index.js +30 -0
- package/vendor/@stringsync/splates-server/stats/landed.d.ts +14 -0
- package/vendor/@stringsync/splates-server/stats/outcomes.d.ts +207 -0
- package/vendor/@stringsync/splates-server/stats/overrides.d.ts +19 -0
- package/vendor/@stringsync/splates-server/stats/routes.d.ts +23 -0
- package/vendor/@stringsync/splates-server/stats/scry-models.d.ts +22 -0
- package/vendor/@stringsync/splates-server/stats/skill-checks.d.ts +59 -0
- package/vendor/@stringsync/splates-server/stats/stats.d.ts +176 -0
- package/vendor/@stringsync/splates-server/stats/task-log.d.ts +67 -0
- package/vendor/@stringsync/splates-server/storage/atomic.d.ts +13 -0
- package/vendor/@stringsync/splates-server/storage/collection.d.ts +30 -0
- package/vendor/@stringsync/splates-server/storage/document.d.ts +26 -0
- package/vendor/@stringsync/splates-server/storage/fs-collection.d.ts +26 -0
- package/vendor/@stringsync/splates-server/storage/fs-document.d.ts +16 -0
- package/vendor/@stringsync/splates-server/storage/fs-log.d.ts +31 -0
- package/vendor/@stringsync/splates-server/storage/fs.d.ts +48 -0
- package/vendor/@stringsync/splates-server/storage/index.d.ts +11 -0
- package/vendor/@stringsync/splates-server/storage/index.js +18 -0
- package/vendor/@stringsync/splates-server/storage/json.d.ts +10 -0
- package/vendor/@stringsync/splates-server/storage/key.d.ts +7 -0
- package/vendor/@stringsync/splates-server/storage/log.d.ts +60 -0
- package/vendor/@stringsync/splates-server/storage/schema.d.ts +7 -0
- package/vendor/@stringsync/splates-server/storage/sqlite-collection.d.ts +31 -0
- package/vendor/@stringsync/splates-server/storage/sqlite-db.d.ts +62 -0
- package/vendor/@stringsync/splates-server/storage/sqlite-document.d.ts +20 -0
- package/vendor/@stringsync/splates-server/storage/sqlite-import.d.ts +11 -0
- package/vendor/@stringsync/splates-server/storage/sqlite-keys.d.ts +17 -0
- package/vendor/@stringsync/splates-server/storage/sqlite-lock.d.ts +25 -0
- package/vendor/@stringsync/splates-server/storage/sqlite-log.d.ts +31 -0
- package/vendor/@stringsync/splates-server/storage/sqlite.d.ts +53 -0
- package/vendor/@stringsync/splates-server/storage/storage.d.ts +87 -0
- package/vendor/@stringsync/splates-server/table.d.ts +5 -0
- package/vendor/@stringsync/splates-server/tasks/add.d.ts +45 -0
- package/vendor/@stringsync/splates-server/tasks/browser.d.ts +5 -0
- package/vendor/@stringsync/splates-server/tasks/checkpoint.d.ts +39 -0
- package/vendor/@stringsync/splates-server/tasks/claim.d.ts +14 -0
- package/vendor/@stringsync/splates-server/tasks/conflicts.d.ts +19 -0
- package/vendor/@stringsync/splates-server/tasks/diff.d.ts +29 -0
- package/vendor/@stringsync/splates-server/tasks/dispatched.d.ts +15 -0
- package/vendor/@stringsync/splates-server/tasks/editors.d.ts +22 -0
- package/vendor/@stringsync/splates-server/tasks/finished.d.ts +81 -0
- package/vendor/@stringsync/splates-server/tasks/follow.d.ts +48 -0
- package/vendor/@stringsync/splates-server/tasks/index.d.ts +30 -0
- package/vendor/@stringsync/splates-server/tasks/index.js +90 -0
- package/vendor/@stringsync/splates-server/tasks/landings.d.ts +17 -0
- package/vendor/@stringsync/splates-server/tasks/list.d.ts +18 -0
- package/vendor/@stringsync/splates-server/tasks/merge-output.d.ts +13 -0
- package/vendor/@stringsync/splates-server/tasks/open.d.ts +15 -0
- package/vendor/@stringsync/splates-server/tasks/overlaps.d.ts +16 -0
- package/vendor/@stringsync/splates-server/tasks/path.d.ts +13 -0
- package/vendor/@stringsync/splates-server/tasks/recommend.d.ts +30 -0
- package/vendor/@stringsync/splates-server/tasks/remove.d.ts +47 -0
- package/vendor/@stringsync/splates-server/tasks/retry.d.ts +35 -0
- package/vendor/@stringsync/splates-server/tasks/routes.d.ts +23 -0
- package/vendor/@stringsync/splates-server/tasks/show.d.ts +137 -0
- package/vendor/@stringsync/splates-server/tasks/snapshot.d.ts +86 -0
- package/vendor/@stringsync/splates-server/tasks/started-records.d.ts +71 -0
- package/vendor/@stringsync/splates-server/tasks/wait.d.ts +47 -0
- package/vendor/@stringsync/splates-server/tasks/worktree-checkouts.d.ts +10 -0
- package/vendor/@stringsync/splates-server/tasks/worktree-service.d.ts +151 -0
- package/vendor/@stringsync/splates-server/tasks/worktree.d.ts +342 -0
- package/vendor/@stringsync/splates-server/terminal/connection.d.ts +19 -0
- package/vendor/@stringsync/splates-server/terminal/held.d.ts +22 -0
- package/vendor/@stringsync/splates-server/terminal/index.d.ts +7 -0
- package/vendor/@stringsync/splates-server/terminal/pty.d.ts +45 -0
- package/vendor/@stringsync/splates-server/terminal/remote-pty.d.ts +34 -0
- package/vendor/@stringsync/splates-server/terminal/shell.d.ts +70 -0
- package/vendor/@stringsync/splates-server/terminal/spawn.d.ts +22 -0
- package/vendor/@stringsync/splates-server/terminal/terminal.d.ts +52 -0
- package/vendor/@stringsync/splates-server/tunnel/access.d.ts +61 -0
- package/vendor/@stringsync/splates-server/tunnel/cloudflare-api.d.ts +25 -0
- package/vendor/@stringsync/splates-server/tunnel/cloudflare-error.d.ts +5 -0
- package/vendor/@stringsync/splates-server/tunnel/cloudflared.d.ts +43 -0
- package/vendor/@stringsync/splates-server/tunnel/index.d.ts +14 -0
- package/vendor/@stringsync/splates-server/tunnel/index.js +70 -0
- package/vendor/@stringsync/splates-server/tunnel/machine.d.ts +18 -0
- package/vendor/@stringsync/splates-server/tunnel/provider.d.ts +37 -0
- package/vendor/@stringsync/splates-server/tunnel/remove.d.ts +35 -0
- package/vendor/@stringsync/splates-server/tunnel/saved-ports-host.d.ts +26 -0
- package/vendor/@stringsync/splates-server/tunnel/saved.d.ts +63 -0
- package/vendor/@stringsync/splates-server/tunnel/setup.d.ts +123 -0
- package/vendor/@stringsync/splates-server/tunnel/tunnel.d.ts +38 -0
- package/vendor/@stringsync/splates-server/workers/admin.d.ts +37 -0
- package/vendor/@stringsync/splates-server/workers/call-host.d.ts +68 -0
- package/vendor/@stringsync/splates-server/workers/channel.d.ts +90 -0
- package/vendor/@stringsync/splates-server/workers/connection.d.ts +24 -0
- package/vendor/@stringsync/splates-server/workers/coordinator-state.d.ts +44 -0
- package/vendor/@stringsync/splates-server/workers/daemon.d.ts +128 -0
- package/vendor/@stringsync/splates-server/workers/darwin-footprint.d.ts +7 -0
- package/vendor/@stringsync/splates-server/workers/darwin-temperature.d.ts +7 -0
- package/vendor/@stringsync/splates-server/workers/frame-too-large.d.ts +5 -0
- package/vendor/@stringsync/splates-server/workers/git.d.ts +11 -0
- package/vendor/@stringsync/splates-server/workers/gone.d.ts +36 -0
- package/vendor/@stringsync/splates-server/workers/identity.d.ts +30 -0
- package/vendor/@stringsync/splates-server/workers/index.d.ts +40 -0
- package/vendor/@stringsync/splates-server/workers/index.js +90 -0
- package/vendor/@stringsync/splates-server/workers/lifecycle.d.ts +14 -0
- package/vendor/@stringsync/splates-server/workers/list.d.ts +93 -0
- package/vendor/@stringsync/splates-server/workers/load.d.ts +55 -0
- package/vendor/@stringsync/splates-server/workers/local-id.d.ts +11 -0
- package/vendor/@stringsync/splates-server/workers/local-update.d.ts +81 -0
- package/vendor/@stringsync/splates-server/workers/log-file.d.ts +24 -0
- package/vendor/@stringsync/splates-server/workers/machine.d.ts +47 -0
- package/vendor/@stringsync/splates-server/workers/orphan.d.ts +31 -0
- package/vendor/@stringsync/splates-server/workers/os-sensors.d.ts +49 -0
- package/vendor/@stringsync/splates-server/workers/placement.d.ts +39 -0
- package/vendor/@stringsync/splates-server/workers/process-host.d.ts +60 -0
- package/vendor/@stringsync/splates-server/workers/process.d.ts +33 -0
- package/vendor/@stringsync/splates-server/workers/protocol.d.ts +153 -0
- package/vendor/@stringsync/splates-server/workers/pty-host.d.ts +35 -0
- package/vendor/@stringsync/splates-server/workers/queue.d.ts +39 -0
- package/vendor/@stringsync/splates-server/workers/records.d.ts +43 -0
- package/vendor/@stringsync/splates-server/workers/registry.d.ts +101 -0
- package/vendor/@stringsync/splates-server/workers/replay.d.ts +25 -0
- package/vendor/@stringsync/splates-server/workers/routes.d.ts +119 -0
- package/vendor/@stringsync/splates-server/workers/run-options.d.ts +11 -0
- package/vendor/@stringsync/splates-server/workers/run.d.ts +10 -0
- package/vendor/@stringsync/splates-server/workers/scheduler.d.ts +171 -0
- package/vendor/@stringsync/splates-server/workers/server-of.d.ts +23 -0
- package/vendor/@stringsync/splates-server/workers/server-socket.d.ts +25 -0
- package/vendor/@stringsync/splates-server/workers/session.d.ts +240 -0
- package/vendor/@stringsync/splates-server/workers/socket.d.ts +21 -0
- package/vendor/@stringsync/splates-server/workers/unix-listener.d.ts +23 -0
- package/vendor/@stringsync/splates-server/workers/unix-socket.d.ts +30 -0
- package/vendor/@stringsync/splates-server/workers/websocket-socket.d.ts +24 -0
- package/vendor/@stringsync/splates-server/workers/worker.d.ts +98 -0
- package/vendor/core/LICENSE +21 -0
- package/vendor/core/abort/aborts.d.ts +10 -0
- package/vendor/core/abort/index.d.ts +1 -0
- package/vendor/core/abort/index.js +24 -0
- package/vendor/core/assert/assert-error.d.ts +4 -0
- package/vendor/core/assert/assert.d.ts +24 -0
- package/vendor/core/assert/ensure.d.ts +18 -0
- package/vendor/core/assert/index.d.ts +3 -0
- package/vendor/core/assert/index.js +75 -0
- package/vendor/core/cmd/cli.d.ts +70 -0
- package/vendor/core/cmd/command.d.ts +96 -0
- package/vendor/core/cmd/deps.d.ts +12 -0
- package/vendor/core/cmd/help.d.ts +16 -0
- package/vendor/core/cmd/index.d.ts +6 -0
- package/vendor/core/cmd/index.js +477 -0
- package/vendor/core/cmd/middleware.d.ts +15 -0
- package/vendor/core/cmd/timed.d.ts +15 -0
- package/vendor/core/creds/credential-proxy.d.ts +55 -0
- package/vendor/core/creds/credential-source.d.ts +19 -0
- package/vendor/core/creds/credentials.d.ts +28 -0
- package/vendor/core/creds/dotenv-file.d.ts +22 -0
- package/vendor/core/creds/environment.d.ts +18 -0
- package/vendor/core/creds/index.d.ts +8 -0
- package/vendor/core/creds/index.js +337 -0
- package/vendor/core/creds/memory-secret-store.d.ts +33 -0
- package/vendor/core/creds/secret-store.d.ts +14 -0
- package/vendor/core/creds/system-secret-store.d.ts +49 -0
- package/vendor/core/dictate/buffered-sink.d.ts +9 -0
- package/vendor/core/dictate/cue.d.ts +10 -0
- package/vendor/core/dictate/dictation-failure.d.ts +5 -0
- package/vendor/core/dictate/dictation-link.d.ts +18 -0
- package/vendor/core/dictate/dictation-message.d.ts +24 -0
- package/vendor/core/dictate/dictation-relay.d.ts +28 -0
- package/vendor/core/dictate/index.d.ts +10 -0
- package/vendor/core/dictate/index.js +132 -0
- package/vendor/core/dictate/microphone.d.ts +42 -0
- package/vendor/core/dictate/openai-transcriber.d.ts +22 -0
- package/vendor/core/dictate/openai-transcription.d.ts +27 -0
- package/vendor/core/dictate/pcm.d.ts +5 -0
- package/vendor/core/dictate/pcm16-encoder.d.ts +20 -0
- package/vendor/core/dictate/server.d.ts +1 -0
- package/vendor/core/dictate/server.js +153 -0
- package/vendor/core/dictate/transcriber.d.ts +23 -0
- package/vendor/core/disposable/async-disposer.d.ts +15 -0
- package/vendor/core/disposable/async-resource.d.ts +4 -0
- package/vendor/core/disposable/disposables.d.ts +8 -0
- package/vendor/core/disposable/disposer.d.ts +13 -0
- package/vendor/core/disposable/index.d.ts +5 -0
- package/vendor/core/disposable/index.js +96 -0
- package/vendor/core/disposable/resource.d.ts +4 -0
- package/vendor/core/events/dispatcher.d.ts +18 -0
- package/vendor/core/events/eventful.d.ts +7 -0
- package/vendor/core/events/events.d.ts +14 -0
- package/vendor/core/events/index.d.ts +4 -0
- package/vendor/core/events/index.js +75 -0
- package/vendor/core/events/noop-events.d.ts +6 -0
- package/vendor/core/id/counter-id-provider.d.ts +6 -0
- package/vendor/core/id/id-provider.d.ts +7 -0
- package/vendor/core/id/index.d.ts +3 -0
- package/vendor/core/id/index.js +17 -0
- package/vendor/core/id/uuid-provider.d.ts +11 -0
- package/vendor/core/index-qk5dj664.js +4 -0
- package/vendor/core/log/color.d.ts +22 -0
- package/vendor/core/log/composite-logger.d.ts +7 -0
- package/vendor/core/log/console-logger.d.ts +6 -0
- package/vendor/core/log/index.d.ts +8 -0
- package/vendor/core/log/index.js +154 -0
- package/vendor/core/log/level-prefix-logger.d.ts +12 -0
- package/vendor/core/log/logger.d.ts +12 -0
- package/vendor/core/log/mdc-logger.d.ts +14 -0
- package/vendor/core/log/memory-logger.d.ts +8 -0
- package/vendor/core/log/prefix-logger.d.ts +12 -0
- package/vendor/core/md/index.d.ts +2 -0
- package/vendor/core/md/index.js +182 -0
- package/vendor/core/md/markdown.d.ts +56 -0
- package/vendor/core/md/writer.d.ts +22 -0
- package/vendor/core/push/base64url.d.ts +2 -0
- package/vendor/core/push/encrypt.d.ts +12 -0
- package/vendor/core/push/index.d.ts +4 -0
- package/vendor/core/push/index.js +137 -0
- package/vendor/core/push/push-failure.d.ts +7 -0
- package/vendor/core/push/pusher.d.ts +24 -0
- package/vendor/core/push/vapid.d.ts +18 -0
- package/vendor/core/push/web-pusher.d.ts +20 -0
- package/vendor/core/ship/artifact/artifact.d.ts +52 -0
- package/vendor/core/ship/bundle/bun-bundle.d.ts +71 -0
- package/vendor/core/ship/bundle/bundle-artifact.d.ts +21 -0
- package/vendor/core/ship/bundle/bundle.d.ts +13 -0
- package/vendor/core/ship/bundle/published.d.ts +45 -0
- package/vendor/core/ship/bundle/reach.d.ts +43 -0
- package/vendor/core/ship/bundle/vendor-bundle.d.ts +47 -0
- package/vendor/core/ship/cut.d.ts +64 -0
- package/vendor/core/ship/dry-run.d.ts +63 -0
- package/vendor/core/ship/git/cli-git.d.ts +25 -0
- package/vendor/core/ship/git/git-artifact.d.ts +23 -0
- package/vendor/core/ship/git/git.d.ts +19 -0
- package/vendor/core/ship/github/cli-github.d.ts +31 -0
- package/vendor/core/ship/github/cli-workflows.d.ts +25 -0
- package/vendor/core/ship/github/github-artifact.d.ts +18 -0
- package/vendor/core/ship/github/github.d.ts +10 -0
- package/vendor/core/ship/github/login.d.ts +3 -0
- package/vendor/core/ship/github/workflows.d.ts +27 -0
- package/vendor/core/ship/index.d.ts +26 -0
- package/vendor/core/ship/index.js +3203 -0
- package/vendor/core/ship/mirror/agent-files.d.ts +6 -0
- package/vendor/core/ship/mirror/mirror-build.d.ts +63 -0
- package/vendor/core/ship/mirror/mirror-guard.d.ts +10 -0
- package/vendor/core/ship/mirror/mirror-options.d.ts +75 -0
- package/vendor/core/ship/mirror/mirror-step.d.ts +109 -0
- package/vendor/core/ship/mirror/mirror-tooling.d.ts +59 -0
- package/vendor/core/ship/mirror/source-manifest.d.ts +27 -0
- package/vendor/core/ship/order.d.ts +15 -0
- package/vendor/core/ship/publish-workflow.d.ts +32 -0
- package/vendor/core/ship/registry/github-actions.d.ts +76 -0
- package/vendor/core/ship/registry/npm-registry.d.ts +70 -0
- package/vendor/core/ship/registry/registry-artifact.d.ts +31 -0
- package/vendor/core/ship/registry/registry.d.ts +85 -0
- package/vendor/core/ship/release-file.d.ts +22 -0
- package/vendor/core/ship/release-options.d.ts +122 -0
- package/vendor/core/ship/release.d.ts +61 -0
- package/vendor/core/ship/releases.d.ts +119 -0
- package/vendor/core/ship/shipped.d.ts +54 -0
- package/vendor/core/ship/skill-artifact.d.ts +27 -0
- package/vendor/core/ship/step-events.d.ts +91 -0
- package/vendor/core/ship/step-runner.d.ts +16 -0
- package/vendor/core/ship/step.d.ts +49 -0
- package/vendor/core/ship/trust.d.ts +11 -0
- package/vendor/core/ship/version.d.ts +9 -0
- package/vendor/core/ship/workspace/manifest-workspace.d.ts +61 -0
- package/vendor/core/ship/workspace/workspace.d.ts +29 -0
- package/vendor/core/skills/index.d.ts +1 -0
- package/vendor/core/skills/index.js +77 -0
- package/vendor/core/skills/project-skills.d.ts +53 -0
- package/vendor/core/system/fs/fs.d.ts +58 -0
- package/vendor/core/system/fs/node-fs.d.ts +18 -0
- package/vendor/core/system/glob/glob.d.ts +11 -0
- package/vendor/core/system/glob/node-glob.d.ts +12 -0
- package/vendor/core/system/heavy/heavy-jobs.d.ts +84 -0
- package/vendor/core/system/host-mapper/file-host-mapper.d.ts +20 -0
- package/vendor/core/system/host-mapper/host-mapper.d.ts +11 -0
- package/vendor/core/system/host-mapper/noop-host-mapper.d.ts +4 -0
- package/vendor/core/system/index.d.ts +25 -0
- package/vendor/core/system/index.js +1385 -0
- package/vendor/core/system/ip-provider/darwin-ip-provider.d.ts +6 -0
- package/vendor/core/system/ip-provider/ip-provider.d.ts +8 -0
- package/vendor/core/system/ip-provider/linux-ip-provider.d.ts +6 -0
- package/vendor/core/system/ip-provider/platform-ip-provider.d.ts +6 -0
- package/vendor/core/system/ip-provider/sequential-ip-provider.d.ts +6 -0
- package/vendor/core/system/ip-provider/static-ip-provider.d.ts +8 -0
- package/vendor/core/system/ip-provider/win32-ip-provider.d.ts +6 -0
- package/vendor/core/system/lock/file-lock.d.ts +50 -0
- package/vendor/core/system/lock/lock.d.ts +11 -0
- package/vendor/core/system/lock/memory-lock.d.ts +13 -0
- package/vendor/core/system/port-provider/open-port-provider.d.ts +38 -0
- package/vendor/core/system/port-provider/port-provider.d.ts +14 -0
- package/vendor/core/system/process-like/process-like.d.ts +22 -0
- package/vendor/core/system/ps/file-process.d.ts +40 -0
- package/vendor/core/system/ps/listening.d.ts +20 -0
- package/vendor/core/system/ps/node-ps.d.ts +39 -0
- package/vendor/core/system/ps/ps.d.ts +161 -0
- package/vendor/core/system/ps/reap.d.ts +22 -0
- package/vendor/core/system/undumpable.d.ts +32 -0
- package/vendor/core/system/walk.d.ts +10 -0
- package/vendor/core/time/clock/clock.d.ts +5 -0
- package/vendor/core/time/clock/system-clock.d.ts +5 -0
- package/vendor/core/time/debouncer.d.ts +25 -0
- package/vendor/core/time/duration.d.ts +38 -0
- package/vendor/core/time/index.d.ts +13 -0
- package/vendor/core/time/index.js +271 -0
- package/vendor/core/time/sleep.d.ts +2 -0
- package/vendor/core/time/stopwatch.d.ts +34 -0
- package/vendor/core/time/throttler.d.ts +26 -0
- package/vendor/core/time/time-ago.d.ts +14 -0
- package/vendor/core/time/timeouts.d.ts +12 -0
- package/vendor/core/time/timer/system-timer.d.ts +7 -0
- package/vendor/core/time/timer/timer.d.ts +11 -0
- package/vendor/core/time/wall-clock/system-wall-clock.d.ts +4 -0
- package/vendor/core/time/wall-clock/wall-clock.d.ts +14 -0
- package/waiting.d.ts +2 -2
- package/worker.d.ts +2 -2
|
@@ -0,0 +1,1309 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LEGACY_PLAN_FILE2
|
|
3
|
+
} from "./index-g18nxyn7.js";
|
|
4
|
+
|
|
5
|
+
// plans/demo.ts
|
|
6
|
+
var DEMO = /^### 🎬 Demo(?::[ \t]*(.*?))?[ \t]*$/;
|
|
7
|
+
var STEP = /^(\d+)\.[ \t]+(.+)$/;
|
|
8
|
+
function demoAt(lines, start, until) {
|
|
9
|
+
const title = DEMO.exec(lines[start]);
|
|
10
|
+
if (title === null) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const first = lines.findIndex((line, at) => at > start && at < until && STEP.exec(line)?.[1] === "1");
|
|
14
|
+
const steps = [];
|
|
15
|
+
let end = first === -1 ? until : first;
|
|
16
|
+
if (first !== -1) {
|
|
17
|
+
let body = [];
|
|
18
|
+
for (let i = first;i < lines.length; i += 1) {
|
|
19
|
+
const line = lines[i];
|
|
20
|
+
const item = STEP.exec(line);
|
|
21
|
+
if (item !== null && item[1] === String(steps.length + 1)) {
|
|
22
|
+
body = [];
|
|
23
|
+
steps.push({
|
|
24
|
+
number: item[1],
|
|
25
|
+
action: (item[2] ?? "").trim(),
|
|
26
|
+
expect: ""
|
|
27
|
+
});
|
|
28
|
+
end = i + 1;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (line.trim() === "") {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (!/^[ \t]/.test(line)) {
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
body.push(...lines.slice(end, i).map(() => ""), line);
|
|
38
|
+
steps.at(-1).expect = dedented(body);
|
|
39
|
+
end = i + 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
demo: {
|
|
44
|
+
title: title[1] || null,
|
|
45
|
+
intro: trimmed(lines.slice(start + 1, first === -1 ? until : first)),
|
|
46
|
+
steps
|
|
47
|
+
},
|
|
48
|
+
end
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function isDemoTitle(line) {
|
|
52
|
+
return DEMO.test(line);
|
|
53
|
+
}
|
|
54
|
+
function dedented(lines) {
|
|
55
|
+
const indent = Math.min(...lines.filter((line) => line.trim() !== "").map((line) => /^[ \t]*/.exec(line)?.[0].length ?? 0));
|
|
56
|
+
return trimmed(lines.map((line) => line.slice(indent)));
|
|
57
|
+
}
|
|
58
|
+
function trimmed(lines) {
|
|
59
|
+
return lines.join(`
|
|
60
|
+
`).replace(/^\n+|\s+$/g, "");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// plans/permission.ts
|
|
64
|
+
function queueIsSettled2(proposal, todos) {
|
|
65
|
+
const { lane, tasks } = proposal;
|
|
66
|
+
const mine = lane === null ? tasks.flatMap((id) => todos.filter((todo) => todo.id === id)) : todos.filter((todo) => todo.lane === lane);
|
|
67
|
+
const byTask = lane === null || mine.length === 1;
|
|
68
|
+
return mine.filter((todo) => todo.takenBy === null).every((todo) => todo.stage === "queued" || !byTask && todo.unqueuedFor !== undefined);
|
|
69
|
+
}
|
|
70
|
+
function asksPermission(line) {
|
|
71
|
+
return [PERMISSION, GRANT_PERMISSION, EVALS_PERMISSION, RUN_PERMISSION].some((each) => each.test(line));
|
|
72
|
+
}
|
|
73
|
+
function permissionOf(line, body) {
|
|
74
|
+
const permission = PERMISSION.exec(line);
|
|
75
|
+
const evals = EVALS_PERMISSION.exec(line);
|
|
76
|
+
const run = RUN_PERMISSION.exec(line);
|
|
77
|
+
const grant = GRANT_PERMISSION.exec(line);
|
|
78
|
+
if (run !== null) {
|
|
79
|
+
const rows = body.split(`
|
|
80
|
+
`);
|
|
81
|
+
const at = rows.findIndex((each) => RUN_COMMAND.test(each));
|
|
82
|
+
const command = at < 0 ? "" : RUN_COMMAND.exec(rows[at])?.[1];
|
|
83
|
+
return {
|
|
84
|
+
action: "run-command",
|
|
85
|
+
lane: null,
|
|
86
|
+
tasks: [],
|
|
87
|
+
title: run[1] || null,
|
|
88
|
+
body: rows.filter((_, index) => index !== at).join(`
|
|
89
|
+
`).replace(/^\n+|\s+$/g, ""),
|
|
90
|
+
command
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (grant !== null) {
|
|
94
|
+
return {
|
|
95
|
+
action: "grant",
|
|
96
|
+
lane: null,
|
|
97
|
+
tasks: [],
|
|
98
|
+
title: grant[4] || null,
|
|
99
|
+
body: body.replace(COMMAND_LINE, "").replace(/^\n+|\s+$/g, ""),
|
|
100
|
+
grant: {
|
|
101
|
+
in: grant[1],
|
|
102
|
+
reach: grant[2],
|
|
103
|
+
from: grant[3]
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (evals !== null) {
|
|
108
|
+
const scenarios = [];
|
|
109
|
+
let baseline = null;
|
|
110
|
+
let reps;
|
|
111
|
+
const prose = body.split(`
|
|
112
|
+
`).filter((each) => {
|
|
113
|
+
const scenario = EVAL_PROBE.exec(each);
|
|
114
|
+
if (scenario !== null) {
|
|
115
|
+
scenarios.push(scenario[1]);
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
const base = EVAL_BASELINE.exec(each);
|
|
119
|
+
if (base !== null) {
|
|
120
|
+
baseline = base[1];
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
const times = EVAL_REPS.exec(each);
|
|
124
|
+
if (times !== null && Number(times[1]) > 0) {
|
|
125
|
+
reps = Number(times[1]);
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
action: "run-evals",
|
|
132
|
+
lane: null,
|
|
133
|
+
tasks: [],
|
|
134
|
+
title: evals[2] || null,
|
|
135
|
+
body: prose.join(`
|
|
136
|
+
`).replace(/^\n+|\s+$/g, ""),
|
|
137
|
+
evals: {
|
|
138
|
+
skill: evals[1],
|
|
139
|
+
scenarios,
|
|
140
|
+
baseline,
|
|
141
|
+
...reps === undefined ? {} : { reps }
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
if (permission !== null) {
|
|
146
|
+
const lane = permission[2] ?? permission[3] ?? permission[6];
|
|
147
|
+
return {
|
|
148
|
+
action: permission[1] === undefined ? "queue" : "remove-lane",
|
|
149
|
+
lane: lane === undefined ? null : Number(lane),
|
|
150
|
+
tasks: Array.from((permission[5] ?? permission[7] ?? "").matchAll(/\d+/g), Number),
|
|
151
|
+
...permission[4] === undefined ? {} : { project: permission[4] },
|
|
152
|
+
title: permission[8] || null,
|
|
153
|
+
body: body.replace(COMMAND_LINE, "").replace(/^\n+|\s+$/g, "")
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
var EVALS_PERMISSION = /^## 🔐 Permission: run evals (\S+?)(?::[ \t]*(.*?))?[ \t]*$/;
|
|
159
|
+
var EVAL_PROBE = /^[-*][ \t]+`([^`\s]+)`(?:[ \t].*)?$/;
|
|
160
|
+
var EVAL_BASELINE = /^Baseline:[ \t]*`([^`\s]+)`[ \t]*$/;
|
|
161
|
+
var EVAL_REPS = /^Repetitions:[ \t]*(\d+)[ \t]*$/;
|
|
162
|
+
var RUN_PERMISSION = /^## 🔐 Permission: run command(?::[ \t]*(.*?))?[ \t]*$/;
|
|
163
|
+
var RUN_COMMAND = /^`([^`\n]+)`[ \t]*$/;
|
|
164
|
+
var PERMISSION = /^## (?:🔐 Permission: (?:(remove) lane (\d+)|queue (?:lane (\d+)|(?:([\w.-]+) )?(#\d+(?:,[ \t]*#\d+)*)))|📥 Queue (?:lane (\d+)|(#\d+(?:,[ \t]*#\d+)*)))(?::[ \t]*(.*?))?[ \t]*$/;
|
|
165
|
+
var GRANT_PERMISSION = /^## 🔐 Permission: grant ([\w.-]+) (read|queue|tasks) to ([\w.-]+)(?::[ \t]*(.*?))?[ \t]*$/;
|
|
166
|
+
var COMMAND_LINE = /^`splates [^`\n]+`[ \t]*$/gm;
|
|
167
|
+
|
|
168
|
+
// plans/plan.ts
|
|
169
|
+
import { Markdown } from "../../core/md/index.js";
|
|
170
|
+
var PLAN_FILE2 = "SPLATES.md";
|
|
171
|
+
|
|
172
|
+
class Plans2 {
|
|
173
|
+
fs;
|
|
174
|
+
constructor(fs) {
|
|
175
|
+
this.fs = fs;
|
|
176
|
+
}
|
|
177
|
+
read(tree) {
|
|
178
|
+
return this.fs.read(`${tree}/${PLAN_FILE2}`).catch(() => this.fs.read(`${tree}/${LEGACY_PLAN_FILE2}`)).catch(() => null);
|
|
179
|
+
}
|
|
180
|
+
async exclude(gitDir) {
|
|
181
|
+
const info = `${gitDir}/info`;
|
|
182
|
+
const excluded = await this.fs.read(`${info}/exclude`).catch(() => "");
|
|
183
|
+
if (!excluded.split(`
|
|
184
|
+
`).includes(PLAN_FILE2)) {
|
|
185
|
+
await this.fs.mkdir(info);
|
|
186
|
+
await this.fs.write(`${info}/exclude`, `${excluded.trimEnd()}
|
|
187
|
+
${PLAN_FILE2}
|
|
188
|
+
`.trimStart());
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
var STUB_STEPS = [
|
|
193
|
+
"list the steps here as `- [ ]` items",
|
|
194
|
+
"fill in Goal and list the steps here as `- [ ]` items"
|
|
195
|
+
];
|
|
196
|
+
var SECTIONS = ["Goal", "Next", "Verification", "Demo", "Blocked", "Outcome"];
|
|
197
|
+
var REQUIRED = ["Goal"];
|
|
198
|
+
var QUESTION = /^[ \t]*- \[[ xX]\] [Qq]?\d+\./m;
|
|
199
|
+
function goalLine2(text) {
|
|
200
|
+
const md = Markdown.parse(text);
|
|
201
|
+
if (!md.has("Goal")) {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
const line = md.section("Goal").body.split(`
|
|
205
|
+
`).find((line) => line.trim() !== "");
|
|
206
|
+
return line === undefined ? null : line.trim();
|
|
207
|
+
}
|
|
208
|
+
function sectionApart2(text, name) {
|
|
209
|
+
const md = Markdown.parse(text);
|
|
210
|
+
const found = md.sections.find((each) => each.level === 2 && each.heading.toLowerCase() === name.toLowerCase());
|
|
211
|
+
if (found === undefined) {
|
|
212
|
+
return { section: null, rest: text };
|
|
213
|
+
}
|
|
214
|
+
const lines = md.text.split(`
|
|
215
|
+
`);
|
|
216
|
+
const next = md.sections.find((each) => each.line > found.line && each.level <= 2);
|
|
217
|
+
const start = found.line - 1;
|
|
218
|
+
const end = next === undefined ? lines.length : next.line - 1;
|
|
219
|
+
return {
|
|
220
|
+
section: lines.slice(start, end).join(`
|
|
221
|
+
`).trim(),
|
|
222
|
+
rest: [...lines.slice(0, start), ...lines.slice(end)].join(`
|
|
223
|
+
`)
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function outcomeOf2(text) {
|
|
227
|
+
const md = Markdown.parse(text);
|
|
228
|
+
return md.has("Outcome") ? md.section("Outcome").body.trim() : "";
|
|
229
|
+
}
|
|
230
|
+
function goalOf2(text) {
|
|
231
|
+
const md = Markdown.parse(text);
|
|
232
|
+
return md.has("Goal") ? md.section("Goal").body.trim() : "";
|
|
233
|
+
}
|
|
234
|
+
var ITEM = /^[ \t]*- \[([ xX])\] [Qq]?(\d+)\.[ \t]*(.*)$/;
|
|
235
|
+
var ARROW = " → ";
|
|
236
|
+
var FOLLOW_UP = /^[ \t]+→[ \t]+(.*)$/;
|
|
237
|
+
var CHOICE = /^([ \t]+)- (?:\(([a-z])\)|\[([a-z])\]|([a-z])\.)[ \t]+(.+?)[ \t]*$/;
|
|
238
|
+
var CHOSEN = /[ \t]*\(chosen\)$/i;
|
|
239
|
+
var SIZE = /^\(([a-z]+)\)[ \t]+/;
|
|
240
|
+
function sized(text) {
|
|
241
|
+
const size = SIZE.exec(text);
|
|
242
|
+
return size === null ? { text, size: null } : { text: text.slice(size[0].length), size: size[1] };
|
|
243
|
+
}
|
|
244
|
+
function questions2(text) {
|
|
245
|
+
return items(sectionLines(text, "Blocked"));
|
|
246
|
+
}
|
|
247
|
+
function openQuestions2(text) {
|
|
248
|
+
return questions2(text).filter((asked) => !asked.done && asked.reply === null);
|
|
249
|
+
}
|
|
250
|
+
function items(lines) {
|
|
251
|
+
const found = [];
|
|
252
|
+
let last;
|
|
253
|
+
for (const { line } of lines) {
|
|
254
|
+
const asked = question(line);
|
|
255
|
+
if (asked !== null) {
|
|
256
|
+
last = { asked, body: [] };
|
|
257
|
+
found.push(last);
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
if (line.trim() !== "" && !/^[ \t]/.test(line)) {
|
|
261
|
+
last = undefined;
|
|
262
|
+
}
|
|
263
|
+
if (last === undefined) {
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
const followUp = FOLLOW_UP.exec(line);
|
|
267
|
+
if (followUp !== null) {
|
|
268
|
+
last.asked.followUps.push((followUp[1] ?? "").trim());
|
|
269
|
+
} else if (!offers(last.asked, line)) {
|
|
270
|
+
last.body.push(line);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return found.map(({ asked, body }) => settled(asked, body));
|
|
274
|
+
}
|
|
275
|
+
var INDENTS = new WeakMap;
|
|
276
|
+
function offers(asked, line) {
|
|
277
|
+
const choice = CHOICE.exec(line);
|
|
278
|
+
if (choice === null) {
|
|
279
|
+
const last = asked.choices.at(-1);
|
|
280
|
+
const indent = /^[ \t]*/.exec(line)?.[0].length ?? 0;
|
|
281
|
+
if (last === undefined || line.trim() === "" || indent <= (INDENTS.get(last) ?? indent)) {
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
last.body = last.body === "" ? line : `${last.body}
|
|
285
|
+
${line}`;
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
const [, indent = "", one, any, order, text = ""] = choice;
|
|
289
|
+
const offered = {
|
|
290
|
+
key: one ?? any ?? order ?? "",
|
|
291
|
+
text: text.replace(CHOSEN, ""),
|
|
292
|
+
body: "",
|
|
293
|
+
why: "",
|
|
294
|
+
chosen: CHOSEN.test(text)
|
|
295
|
+
};
|
|
296
|
+
INDENTS.set(offered, indent.length);
|
|
297
|
+
asked.choices.push(offered);
|
|
298
|
+
asked.pick ??= one !== undefined ? "one" : any !== undefined ? "any" : "order";
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
function settled(asked, body) {
|
|
302
|
+
asked.body = dedent(body);
|
|
303
|
+
for (const choice of asked.choices) {
|
|
304
|
+
Object.assign(choice, reasoned(dedent(choice.body.split(`
|
|
305
|
+
`))));
|
|
306
|
+
}
|
|
307
|
+
return asked;
|
|
308
|
+
}
|
|
309
|
+
var WHY = /^why:[ \t]*(.*)$/i;
|
|
310
|
+
function reasoned(body) {
|
|
311
|
+
const lines = body.split(`
|
|
312
|
+
`);
|
|
313
|
+
const at = lines.findIndex((line) => WHY.test(line));
|
|
314
|
+
if (at === -1) {
|
|
315
|
+
return { body, why: "" };
|
|
316
|
+
}
|
|
317
|
+
return {
|
|
318
|
+
body: dedent(lines.filter((_, index) => index !== at)),
|
|
319
|
+
why: (WHY.exec(lines[at] ?? "")?.[1] ?? "").trim()
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function dedent(lines) {
|
|
323
|
+
const indents = lines.filter((line) => line.trim() !== "").map((line) => /^[ \t]*/.exec(line)?.[0].length ?? 0);
|
|
324
|
+
const cut = indents.length === 0 ? 0 : Math.min(...indents);
|
|
325
|
+
return lines.map((line) => line.slice(cut).trimEnd()).join(`
|
|
326
|
+
`).replace(/^\n+|\s+$/g, "");
|
|
327
|
+
}
|
|
328
|
+
function picks2(text) {
|
|
329
|
+
const asked = questions2(text);
|
|
330
|
+
const met = asked.map(metPick).filter((each) => each !== null);
|
|
331
|
+
return {
|
|
332
|
+
asked: asked.length,
|
|
333
|
+
picked: met.length,
|
|
334
|
+
overturned: met.filter((each) => each === "overturned").length,
|
|
335
|
+
amended: met.filter((each) => each === "amended").length
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
function metPick(asked) {
|
|
339
|
+
const chosen = asked.choices.find((choice) => choice.chosen);
|
|
340
|
+
const reply = asked.reply ?? "";
|
|
341
|
+
const [lead, wrapped, bare] = /^(?:- )?(?:\(([a-z])\)|([a-z])(?=[.,]|$))/i.exec(reply) ?? [];
|
|
342
|
+
const key = wrapped ?? bare;
|
|
343
|
+
if (chosen === undefined || key === undefined || asked.pick !== "one") {
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
if (key.toLowerCase() !== chosen.key) {
|
|
347
|
+
return "overturned";
|
|
348
|
+
}
|
|
349
|
+
return /[a-z0-9]/i.test(reply.slice(lead?.length ?? 0)) || asked.followUps.length > 0 ? "amended" : "kept";
|
|
350
|
+
}
|
|
351
|
+
function decisions2(text) {
|
|
352
|
+
return questions2(text).map((item) => ({
|
|
353
|
+
number: item.number,
|
|
354
|
+
text: item.text,
|
|
355
|
+
size: item.size,
|
|
356
|
+
ended: metPick(item)
|
|
357
|
+
}));
|
|
358
|
+
}
|
|
359
|
+
var STEP2 = /^[ \t]*- \[ \][ \t]*(.*)$/;
|
|
360
|
+
function unfinished2(text) {
|
|
361
|
+
const md = Markdown.parse(text);
|
|
362
|
+
const next = md.has("Next") ? md.section("Next").body.split(`
|
|
363
|
+
`) : [];
|
|
364
|
+
return {
|
|
365
|
+
questions: questions2(text).filter((asked) => !asked.done).map((asked) => asked.number),
|
|
366
|
+
steps: next.flatMap((line) => {
|
|
367
|
+
const step = STEP2.exec(line)?.[1];
|
|
368
|
+
return step === undefined ? [] : [step.trim()];
|
|
369
|
+
})
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function ready2({ questions, steps }) {
|
|
373
|
+
return questions.length === 0 && steps.length === 0;
|
|
374
|
+
}
|
|
375
|
+
function whatIsLeft2({ questions, steps }) {
|
|
376
|
+
return [
|
|
377
|
+
questions.length > 0 ? `questions ${questions.join(", ")} unchecked under ## Blocked` : "",
|
|
378
|
+
steps.length > 0 ? `${steps.length} step${steps.length === 1 ? "" : "s"} unchecked under ## Next` : ""
|
|
379
|
+
].filter(Boolean).join(" and ");
|
|
380
|
+
}
|
|
381
|
+
function question(line) {
|
|
382
|
+
const item = ITEM.exec(line);
|
|
383
|
+
if (item === null) {
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
const [, check = " ", number = "", rest = ""] = item;
|
|
387
|
+
const arrow = rest.indexOf(ARROW);
|
|
388
|
+
const { text, size } = sized((arrow === -1 ? rest : rest.slice(0, arrow)).trim());
|
|
389
|
+
return {
|
|
390
|
+
number,
|
|
391
|
+
done: check !== " ",
|
|
392
|
+
text,
|
|
393
|
+
size,
|
|
394
|
+
body: "",
|
|
395
|
+
reply: arrow === -1 ? null : rest.slice(arrow + ARROW.length).trim(),
|
|
396
|
+
followUps: [],
|
|
397
|
+
choices: [],
|
|
398
|
+
pick: null
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
function sectionLines(text, name) {
|
|
402
|
+
const { sections } = Markdown.parse(text);
|
|
403
|
+
const at = sections.findIndex((section) => section.heading.toLowerCase() === name.toLowerCase());
|
|
404
|
+
const blocked = sections[at];
|
|
405
|
+
if (blocked === undefined) {
|
|
406
|
+
return [];
|
|
407
|
+
}
|
|
408
|
+
const lines = text.split(`
|
|
409
|
+
`);
|
|
410
|
+
const end = sections.slice(at + 1).find((later) => later.level <= blocked.level)?.line ?? lines.length + 1;
|
|
411
|
+
return lines.slice(blocked.line, end - 1).map((line, offset) => ({ index: blocked.line + offset, line }));
|
|
412
|
+
}
|
|
413
|
+
function checkPlan2(text, { task }) {
|
|
414
|
+
const md = Markdown.parse(text);
|
|
415
|
+
const problems = [];
|
|
416
|
+
const section = (name) => md.has(name) ? md.section(name).body : null;
|
|
417
|
+
if (md.title !== task) {
|
|
418
|
+
problems.push(md.title === null ? `no title: the first line should be "# ${task}"` : `title is "# ${md.title}", should be "# ${task}"`);
|
|
419
|
+
}
|
|
420
|
+
for (const name of REQUIRED) {
|
|
421
|
+
if (!md.has(name)) {
|
|
422
|
+
problems.push(`no ## ${name} section`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
if (section("Goal") === "") {
|
|
426
|
+
problems.push("## Goal is empty: say in a line or two what done means");
|
|
427
|
+
}
|
|
428
|
+
const blocked = section("Blocked");
|
|
429
|
+
if (blocked !== null && !QUESTION.test(blocked)) {
|
|
430
|
+
problems.push("## Blocked lists nothing: add `- [ ] 1.` items for what the user must answer");
|
|
431
|
+
}
|
|
432
|
+
const numbers = questions2(text).map((item) => item.number);
|
|
433
|
+
const twice = [
|
|
434
|
+
...new Set(numbers.filter((each, at) => numbers.indexOf(each) !== at))
|
|
435
|
+
];
|
|
436
|
+
if (twice.length > 0) {
|
|
437
|
+
problems.push(`${twice.join(", ")} numbered twice under ## Blocked: new questions continue from the highest`);
|
|
438
|
+
}
|
|
439
|
+
const known = [...SECTIONS, "Notes"].map((section) => section.toLowerCase());
|
|
440
|
+
for (const section of md.sections) {
|
|
441
|
+
if (section.level === 2 && !known.includes(section.heading.toLowerCase())) {
|
|
442
|
+
problems.push(`unexpected section "## ${section.heading}" (line ${section.line}): keep to ${SECTIONS.join(", ")}`);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return problems;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// plans/asked.ts
|
|
449
|
+
function stretches2(text) {
|
|
450
|
+
const held = CUT.get(text);
|
|
451
|
+
if (held !== undefined) {
|
|
452
|
+
return held;
|
|
453
|
+
}
|
|
454
|
+
const found = cut(text);
|
|
455
|
+
if (CUT.size >= CUT_HELD) {
|
|
456
|
+
CUT.delete(CUT.keys().next().value);
|
|
457
|
+
}
|
|
458
|
+
CUT.set(text, found);
|
|
459
|
+
return found;
|
|
460
|
+
}
|
|
461
|
+
var CUT = new Map;
|
|
462
|
+
var CUT_HELD = 256;
|
|
463
|
+
function cut(text) {
|
|
464
|
+
const lines = text.split(`
|
|
465
|
+
`);
|
|
466
|
+
const found = [];
|
|
467
|
+
let from = 0;
|
|
468
|
+
let fenced = false;
|
|
469
|
+
for (let i = 0;i < lines.length; i += 1) {
|
|
470
|
+
const line = lines[i];
|
|
471
|
+
if (FENCE.test(line)) {
|
|
472
|
+
fenced = !fenced;
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
if (fenced) {
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
const title = REVIEW.exec(line);
|
|
479
|
+
const end = title === null ? -1 : lines.findIndex((each, at) => at > i && each.trim() === REVIEW_END);
|
|
480
|
+
if (title !== null && end !== -1) {
|
|
481
|
+
found.push(...prose(lines.slice(from, i)));
|
|
482
|
+
found.push({
|
|
483
|
+
type: "review",
|
|
484
|
+
review: {
|
|
485
|
+
task: title[1],
|
|
486
|
+
base: title[2],
|
|
487
|
+
...reviewOf(lines.slice(i + 1, end))
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
from = end + 1;
|
|
491
|
+
i = end;
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
const proposed = PROPOSED.exec(line);
|
|
495
|
+
if (proposed !== null) {
|
|
496
|
+
const end = endAt(lines, i + 1);
|
|
497
|
+
found.push(...prose(lines.slice(from, i)));
|
|
498
|
+
found.push({
|
|
499
|
+
type: "proposal",
|
|
500
|
+
proposal: {
|
|
501
|
+
subject: proposed[1],
|
|
502
|
+
body: trimmed2(lines.slice(i + 1, end))
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
from = end;
|
|
506
|
+
i = end - 1;
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
const demo = demoHere(lines, i);
|
|
510
|
+
if (demo !== null) {
|
|
511
|
+
found.push(...prose(lines.slice(from, i)));
|
|
512
|
+
found.push({ type: "demo", demo: demo.demo });
|
|
513
|
+
from = demo.end;
|
|
514
|
+
i = demo.end - 1;
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
const kept = keptAt(lines, i);
|
|
518
|
+
if (kept !== null) {
|
|
519
|
+
found.push(...prose(lines.slice(from, i)));
|
|
520
|
+
found.push(kept.stretch);
|
|
521
|
+
from = kept.end;
|
|
522
|
+
i = kept.end - 1;
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
if (ITEM2.exec(line)?.[1] !== "1") {
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
528
|
+
const list = listAt(lines, i);
|
|
529
|
+
if (list === null) {
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
found.push(...prose(lines.slice(from, i)));
|
|
533
|
+
found.push({ type: "questions", questions: list.questions });
|
|
534
|
+
from = list.end;
|
|
535
|
+
i = list.end - 1;
|
|
536
|
+
}
|
|
537
|
+
found.push(...prose(lines.slice(from)));
|
|
538
|
+
return found;
|
|
539
|
+
}
|
|
540
|
+
var ASKS = /\?(?:[ \t]+\([^()]*\))?$/;
|
|
541
|
+
var ASKS_THEN = /^(.*?\?(?:[ \t]+\([^()]*\))?)[ \t]+(\S.*)$/;
|
|
542
|
+
var MERGED = /^## ✅ Merged (\S+) onto (\S+)[ \t]*$/;
|
|
543
|
+
var DONE = /^## ✅ Done(?::[ \t]*(.*?))?[ \t]*$/;
|
|
544
|
+
var ENDED = /^## (?:(🛑) Removed|(⏸)\uFE0F? Deferred|⚠\uFE0F? Escalated) (\S+?)(?::[ \t]*(.*?))?[ \t]*$/;
|
|
545
|
+
var WORKING_TASK = /^## ⏳ Working (\S+?)(?::[ \t]*(.*?))?[ \t]*$/;
|
|
546
|
+
var PROPOSAL = /^### 📝 (.+?) \[#(\d+)\][ \t]*$/;
|
|
547
|
+
var HEADING = /^#{1,3}[ \t]/;
|
|
548
|
+
var REVIEW = /^## 🔍 Ready to merge (\S+) onto (\S+)[ \t]*$/;
|
|
549
|
+
var REVIEW_END = 'Reply "merge", or say what to change.';
|
|
550
|
+
var PROPOSED = /^## 💡 Proposed (.+?)[ \t]*$/;
|
|
551
|
+
var CHECKS = /^Checks:[ \t]*(.*)$/;
|
|
552
|
+
var FAILED = /^Failed:[ \t]*(.*)$/;
|
|
553
|
+
var ITEM2 = /^(\d+)\.[ \t]+(.+)$/;
|
|
554
|
+
var FENCE = /^[ \t]*(```|~~~)/;
|
|
555
|
+
function keptAt(lines, start) {
|
|
556
|
+
const line = lines[start];
|
|
557
|
+
const merged = MERGED.exec(line);
|
|
558
|
+
const done = DONE.exec(line);
|
|
559
|
+
const ended = ENDED.exec(line);
|
|
560
|
+
const workingTask = WORKING_TASK.exec(line);
|
|
561
|
+
const proposed = PROPOSAL.exec(line);
|
|
562
|
+
const asking = asksPermission(line);
|
|
563
|
+
if (!asking && merged === null && done === null && ended === null && workingTask === null && proposed === null) {
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
const end = proposed !== null ? paragraphEnd(lines, start + 1, endAt(lines, start + 1)) : endAt(lines, start + 1);
|
|
567
|
+
const body = lines.slice(start + 1, end).join(`
|
|
568
|
+
`).replace(/^\n+|\s+$/g, "");
|
|
569
|
+
if (asking) {
|
|
570
|
+
return {
|
|
571
|
+
stretch: {
|
|
572
|
+
type: "permission",
|
|
573
|
+
permission: permissionOf(line, body)
|
|
574
|
+
},
|
|
575
|
+
end
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
if (proposed !== null) {
|
|
579
|
+
return {
|
|
580
|
+
stretch: {
|
|
581
|
+
type: "todo",
|
|
582
|
+
todo: {
|
|
583
|
+
id: Number(proposed[2]),
|
|
584
|
+
subject: proposed[1],
|
|
585
|
+
body
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
end
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
const source = lines.slice(start, end).join(`
|
|
592
|
+
`).replace(/\s+$/, "");
|
|
593
|
+
const report = merged !== null ? {
|
|
594
|
+
ending: "merged",
|
|
595
|
+
task: merged[1],
|
|
596
|
+
base: merged[2],
|
|
597
|
+
reason: null,
|
|
598
|
+
body,
|
|
599
|
+
source
|
|
600
|
+
} : done !== null ? {
|
|
601
|
+
ending: "done",
|
|
602
|
+
task: "",
|
|
603
|
+
base: null,
|
|
604
|
+
reason: done[1] || null,
|
|
605
|
+
body,
|
|
606
|
+
source
|
|
607
|
+
} : workingTask !== null ? {
|
|
608
|
+
ending: "working",
|
|
609
|
+
task: workingTask[1],
|
|
610
|
+
base: null,
|
|
611
|
+
reason: workingTask[2] || null,
|
|
612
|
+
body,
|
|
613
|
+
source
|
|
614
|
+
} : {
|
|
615
|
+
ending: ended?.[1] !== undefined ? "removed" : ended?.[2] !== undefined ? "deferred" : "escalated",
|
|
616
|
+
task: ended?.[3],
|
|
617
|
+
base: null,
|
|
618
|
+
reason: ended?.[4] || null,
|
|
619
|
+
body,
|
|
620
|
+
source
|
|
621
|
+
};
|
|
622
|
+
return { stretch: { type: "report", report }, end };
|
|
623
|
+
}
|
|
624
|
+
function reviewOf(lines) {
|
|
625
|
+
const { body, demo } = withDemo(lines);
|
|
626
|
+
let rest = body.split(`
|
|
627
|
+
`);
|
|
628
|
+
const named = (line) => {
|
|
629
|
+
const at = rest.findIndex((said) => line.test(said));
|
|
630
|
+
if (at === -1) {
|
|
631
|
+
return [];
|
|
632
|
+
}
|
|
633
|
+
const found = Array.from(rest[at].matchAll(/`([^`]+)`/g), (code) => code[1]);
|
|
634
|
+
rest = rest.toSpliced(at, rest[at + 1]?.trim() === "" ? 2 : 1);
|
|
635
|
+
return found;
|
|
636
|
+
};
|
|
637
|
+
const checks = named(CHECKS);
|
|
638
|
+
const failed = named(FAILED);
|
|
639
|
+
const gap = rest.findIndex((line) => line.trim() === "");
|
|
640
|
+
return {
|
|
641
|
+
summary: trimmed2(gap === -1 ? rest : rest.slice(0, gap)),
|
|
642
|
+
demo,
|
|
643
|
+
checks,
|
|
644
|
+
failed,
|
|
645
|
+
details: gap === -1 ? "" : trimmed2(rest.slice(gap))
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
function withDemo(lines) {
|
|
649
|
+
const at = lines.findIndex((_, index) => demoHere(lines, index) !== null);
|
|
650
|
+
const found = at === -1 ? null : demoHere(lines, at);
|
|
651
|
+
if (found === null) {
|
|
652
|
+
return { body: trimmed2(lines), demo: null };
|
|
653
|
+
}
|
|
654
|
+
return {
|
|
655
|
+
body: trimmed2([...lines.slice(0, at), ...lines.slice(found.end)]),
|
|
656
|
+
demo: found.demo
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
function demoHere(lines, start) {
|
|
660
|
+
return isDemoTitle(lines[start]) ? demoAt(lines, start, endAt(lines, start + 1)) : null;
|
|
661
|
+
}
|
|
662
|
+
function trimmed2(lines) {
|
|
663
|
+
return lines.join(`
|
|
664
|
+
`).replace(/^\n+|\s+$/g, "");
|
|
665
|
+
}
|
|
666
|
+
function paragraphEnd(lines, start, end) {
|
|
667
|
+
let begun = false;
|
|
668
|
+
let fenced = false;
|
|
669
|
+
for (let i = start;i < end; i += 1) {
|
|
670
|
+
const line = lines[i];
|
|
671
|
+
if (FENCE.test(line)) {
|
|
672
|
+
fenced = !fenced;
|
|
673
|
+
}
|
|
674
|
+
if (line.trim() !== "") {
|
|
675
|
+
begun = true;
|
|
676
|
+
} else if (begun && !fenced) {
|
|
677
|
+
return i;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return end;
|
|
681
|
+
}
|
|
682
|
+
function endAt(lines, start) {
|
|
683
|
+
let fenced = false;
|
|
684
|
+
for (let i = start;i < lines.length; i += 1) {
|
|
685
|
+
const line = lines[i];
|
|
686
|
+
if (FENCE.test(line)) {
|
|
687
|
+
fenced = !fenced;
|
|
688
|
+
continue;
|
|
689
|
+
}
|
|
690
|
+
if (!fenced && (HEADING.test(line) || ITEM2.exec(line)?.[1] === "1" && listAt(lines, i) !== null)) {
|
|
691
|
+
return i;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
return lines.length;
|
|
695
|
+
}
|
|
696
|
+
function listAt(lines, start) {
|
|
697
|
+
const items = [];
|
|
698
|
+
let end = start;
|
|
699
|
+
for (let i = start;i < lines.length; i += 1) {
|
|
700
|
+
const line = lines[i];
|
|
701
|
+
const item = ITEM2.exec(line);
|
|
702
|
+
if (item !== null && item[1] === String(items.length + 1)) {
|
|
703
|
+
items.push({ asked: question2(item[1], item[2] ?? ""), body: [] });
|
|
704
|
+
end = i + 1;
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
if (line.trim() === "") {
|
|
708
|
+
continue;
|
|
709
|
+
}
|
|
710
|
+
if (!/^[ \t]/.test(line)) {
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
const last = items.at(-1);
|
|
714
|
+
last.body.push(...lines.slice(end, i).map(() => ""));
|
|
715
|
+
if (!offers(last.asked, line)) {
|
|
716
|
+
last.body.push(line);
|
|
717
|
+
}
|
|
718
|
+
end = i + 1;
|
|
719
|
+
}
|
|
720
|
+
if (!items.every(asks)) {
|
|
721
|
+
return null;
|
|
722
|
+
}
|
|
723
|
+
return {
|
|
724
|
+
questions: items.map(({ asked, body }) => settled(asked, body)),
|
|
725
|
+
end
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
function asks({ asked, body }) {
|
|
729
|
+
if (ASKS.test(asked.text)) {
|
|
730
|
+
return true;
|
|
731
|
+
}
|
|
732
|
+
const then = ASKS_THEN.exec(asked.text);
|
|
733
|
+
if (then !== null) {
|
|
734
|
+
asked.text = then[1];
|
|
735
|
+
const indent = /^[ \t]*/.exec(body.find((line) => line.trim()) ?? "");
|
|
736
|
+
body.unshift(`${indent?.[0] ?? ""}${then[2]}`);
|
|
737
|
+
return true;
|
|
738
|
+
}
|
|
739
|
+
return asked.choices.length > 0;
|
|
740
|
+
}
|
|
741
|
+
function question2(number, line) {
|
|
742
|
+
return {
|
|
743
|
+
number,
|
|
744
|
+
done: false,
|
|
745
|
+
...sized(line.trim()),
|
|
746
|
+
body: "",
|
|
747
|
+
reply: null,
|
|
748
|
+
followUps: [],
|
|
749
|
+
choices: [],
|
|
750
|
+
pick: null
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
function prose(lines) {
|
|
754
|
+
const text = lines.join(`
|
|
755
|
+
`).replace(/^\n+|\s+$/g, "");
|
|
756
|
+
return text === "" ? [] : [{ type: "text", text }];
|
|
757
|
+
}
|
|
758
|
+
// plans/decided.ts
|
|
759
|
+
function madeByYou2(outcome) {
|
|
760
|
+
return decided2(outcome).reduce((total, [, count]) => total + count, 0);
|
|
761
|
+
}
|
|
762
|
+
function decided2(outcome) {
|
|
763
|
+
if (outcome.decisions !== undefined) {
|
|
764
|
+
return outcome.decisions.filter((each) => each.how !== "assumed").map((each) => [each, 1]);
|
|
765
|
+
}
|
|
766
|
+
const picked = outcome.picksAsked ?? 0;
|
|
767
|
+
const overturned = outcome.picksOverturned ?? 0;
|
|
768
|
+
const amended = outcome.picksAmended ?? 0;
|
|
769
|
+
const unsized = (ended, count) => [
|
|
770
|
+
{ size: null, ended },
|
|
771
|
+
Math.max(0, count)
|
|
772
|
+
];
|
|
773
|
+
return [
|
|
774
|
+
unsized("kept", picked - overturned - amended),
|
|
775
|
+
unsized("amended", amended),
|
|
776
|
+
unsized("overturned", overturned),
|
|
777
|
+
unsized(null, (outcome.questionsAsked ?? 0) - picked)
|
|
778
|
+
].filter(([, count]) => count > 0);
|
|
779
|
+
}
|
|
780
|
+
function keptDecisions2(outcome) {
|
|
781
|
+
return outcome.decisions !== undefined || outcome.questionsAsked !== undefined;
|
|
782
|
+
}
|
|
783
|
+
// plans/needs.ts
|
|
784
|
+
import { Markdown as Markdown2 } from "../../core/md/index.js";
|
|
785
|
+
import { Duration } from "../../core/time/index.js";
|
|
786
|
+
function needs2({
|
|
787
|
+
tasks,
|
|
788
|
+
conversations,
|
|
789
|
+
todos,
|
|
790
|
+
now = Date.now()
|
|
791
|
+
}) {
|
|
792
|
+
const live = tasks.filter(isLive);
|
|
793
|
+
const found = [
|
|
794
|
+
...conversations.filter((each) => !each.archived).map((conversation) => {
|
|
795
|
+
const task = live.find((each) => each.task === conversation.task) ?? null;
|
|
796
|
+
return {
|
|
797
|
+
conversation,
|
|
798
|
+
task,
|
|
799
|
+
need: need2(task, conversation, now, todos)
|
|
800
|
+
};
|
|
801
|
+
}),
|
|
802
|
+
...externals2(tasks, conversations, now)
|
|
803
|
+
];
|
|
804
|
+
return answeredThrough2(found, conversations).sort((one, other) => KINDS.indexOf(one.need.kind) - KINDS.indexOf(other.need.kind) || pressing(one.need, other.need));
|
|
805
|
+
}
|
|
806
|
+
var KINDS = ["waiting", "assuming", "working", "idle"];
|
|
807
|
+
function isLive(task) {
|
|
808
|
+
return ["working", "merging"].includes(task.status);
|
|
809
|
+
}
|
|
810
|
+
function externals2(tasks, conversations, now = Date.now()) {
|
|
811
|
+
const listed = conversations.filter((each) => !each.archived);
|
|
812
|
+
return tasks.filter((task) => isLive(task) && !task.dispatched && !listed.some((each) => each.task === task.task)).map((task) => ({
|
|
813
|
+
conversation: null,
|
|
814
|
+
task,
|
|
815
|
+
need: needOfExternal2(task, conversations, now)
|
|
816
|
+
}));
|
|
817
|
+
}
|
|
818
|
+
function needOfExternal2(task, conversations, now = Date.now()) {
|
|
819
|
+
const asked = need2(task, null, now);
|
|
820
|
+
const left = orphaned2(task, conversations);
|
|
821
|
+
if (left === null) {
|
|
822
|
+
return asked;
|
|
823
|
+
}
|
|
824
|
+
return {
|
|
825
|
+
kind: "waiting",
|
|
826
|
+
why: "orphaned",
|
|
827
|
+
subject: left.subject,
|
|
828
|
+
since: left.since,
|
|
829
|
+
questions: "questions" in asked ? asked.questions : []
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
function orphaned2(task, conversations) {
|
|
833
|
+
if (!isLive(task) || task.dispatched || task.lease === "held") {
|
|
834
|
+
return null;
|
|
835
|
+
}
|
|
836
|
+
const listed = conversations.filter((each) => !each.archived);
|
|
837
|
+
const on = listed.filter((each) => each.task === task.task);
|
|
838
|
+
if (on.length > 0) {
|
|
839
|
+
return on.every((each) => each.status === "failed") ? { subject: "Its agent failed", since: task.activeAt } : null;
|
|
840
|
+
}
|
|
841
|
+
if (answersTo2({ conversation: null, task }, conversations) !== null) {
|
|
842
|
+
return null;
|
|
843
|
+
}
|
|
844
|
+
if (task.takenBy === null) {
|
|
845
|
+
return {
|
|
846
|
+
subject: "No conversation here is on it",
|
|
847
|
+
since: task.activeAt
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
const by = conversations.find((each) => each.id === task.takenBy);
|
|
851
|
+
if (by === undefined) {
|
|
852
|
+
return { subject: "Its conversation is gone", since: task.activeAt };
|
|
853
|
+
}
|
|
854
|
+
return by.archived ? { subject: "Its conversation was archived", since: task.activeAt } : null;
|
|
855
|
+
}
|
|
856
|
+
var ASKED_QUIET2 = Duration.mins(3);
|
|
857
|
+
function working(task) {
|
|
858
|
+
const subject = task?.plan ? doing(task.plan) : null;
|
|
859
|
+
const since = task?.mergeSince ? { mergeSince: task.mergeSince } : {};
|
|
860
|
+
if (task?.status === "merging" || task?.gate === "running") {
|
|
861
|
+
return { kind: "working", subject, merge: "running", ...since };
|
|
862
|
+
}
|
|
863
|
+
if (task?.gate !== "queued") {
|
|
864
|
+
return { kind: "working", subject };
|
|
865
|
+
}
|
|
866
|
+
const place = task.mergePlace === null ? {} : { mergePlace: task.mergePlace };
|
|
867
|
+
return { kind: "working", subject, merge: "queued", ...since, ...place };
|
|
868
|
+
}
|
|
869
|
+
function need2(task, conversation, now = Date.now(), todos) {
|
|
870
|
+
const open = task?.plan ? openQuestions2(task.plan) : [];
|
|
871
|
+
const waiting = (why, subject, since = null, questions = open) => ({ kind: "waiting", why, subject, since, questions });
|
|
872
|
+
const ask = conversation?.ask ?? null;
|
|
873
|
+
if (ask !== null) {
|
|
874
|
+
return waiting("ask", ask.type === "permission" ? ask.title : ask.message, ask.at);
|
|
875
|
+
}
|
|
876
|
+
if (conversation?.status === "failed") {
|
|
877
|
+
return waiting("failed", conversation.error ?? "Failed");
|
|
878
|
+
}
|
|
879
|
+
const [first] = open;
|
|
880
|
+
if (conversation === null) {
|
|
881
|
+
const at = task?.activeAt ?? null;
|
|
882
|
+
if (first !== undefined && at !== null && now - Date.parse(at) >= ASKED_QUIET2.ms) {
|
|
883
|
+
return waiting("questions", first.text, at);
|
|
884
|
+
}
|
|
885
|
+
return first !== undefined ? { kind: "assuming", subject: first.text, questions: open } : working(task);
|
|
886
|
+
}
|
|
887
|
+
const running = conversation.status === "running" || conversation.status === "starting";
|
|
888
|
+
if (running) {
|
|
889
|
+
return first !== undefined ? { kind: "assuming", subject: first.text, questions: open } : working(task);
|
|
890
|
+
}
|
|
891
|
+
if (task?.mergeSince != null) {
|
|
892
|
+
return working(task);
|
|
893
|
+
}
|
|
894
|
+
if (conversation.evaluating === true) {
|
|
895
|
+
return first !== undefined ? { kind: "assuming", subject: first.text, questions: open } : { ...working(task), evals: true };
|
|
896
|
+
}
|
|
897
|
+
const last = conversation.messages.at(-1);
|
|
898
|
+
const ended = last?.until ?? last?.at ?? null;
|
|
899
|
+
if (first !== undefined) {
|
|
900
|
+
return waiting("questions", first.text, ended);
|
|
901
|
+
}
|
|
902
|
+
const asked = askedIn(conversation);
|
|
903
|
+
const [lead] = asked;
|
|
904
|
+
if (lead !== undefined) {
|
|
905
|
+
return waiting("questions", lead.text, ended, asked);
|
|
906
|
+
}
|
|
907
|
+
const permission = permissionIn(conversation, todos);
|
|
908
|
+
if (permission !== null) {
|
|
909
|
+
return waiting("ask", permission, ended);
|
|
910
|
+
}
|
|
911
|
+
const review = reviewIn(conversation);
|
|
912
|
+
return review !== null ? waiting("review", review, ended) : { kind: "idle" };
|
|
913
|
+
}
|
|
914
|
+
function askedIn(conversation) {
|
|
915
|
+
return stretches2(lastWords(conversation) ?? "").flatMap((stretch) => stretch.type === "questions" ? stretch.questions : []);
|
|
916
|
+
}
|
|
917
|
+
function permissionIn(conversation, todos) {
|
|
918
|
+
for (const stretch of stretches2(lastWords(conversation) ?? "")) {
|
|
919
|
+
if (stretch.type !== "permission") {
|
|
920
|
+
continue;
|
|
921
|
+
}
|
|
922
|
+
const { permission } = stretch;
|
|
923
|
+
if (permission.action === "queue" && permission.project === undefined && todos !== undefined && queueIsSettled2(permission, todos)) {
|
|
924
|
+
continue;
|
|
925
|
+
}
|
|
926
|
+
return permission.title ?? "Permission";
|
|
927
|
+
}
|
|
928
|
+
return null;
|
|
929
|
+
}
|
|
930
|
+
function reviewIn(conversation) {
|
|
931
|
+
for (const stretch of stretches2(lastWords(conversation) ?? "")) {
|
|
932
|
+
if (stretch.type === "review") {
|
|
933
|
+
return stretch.review.summary || "Ready to merge";
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
return null;
|
|
937
|
+
}
|
|
938
|
+
function lastWords(conversation) {
|
|
939
|
+
const last = conversation.messages.at(-1);
|
|
940
|
+
if (last?.role !== "agent") {
|
|
941
|
+
return null;
|
|
942
|
+
}
|
|
943
|
+
return last.parts.flatMap((part) => part.type === "text" ? [part.text] : []).join(`
|
|
944
|
+
|
|
945
|
+
`);
|
|
946
|
+
}
|
|
947
|
+
function answeredThrough2(found, conversations) {
|
|
948
|
+
const handedOut = (entry) => answersTo2(entry, conversations)?.id ?? null;
|
|
949
|
+
const relayed = (entry) => handedOut(entry) !== null && entry.need.kind === "waiting" && entry.need.why !== "failed";
|
|
950
|
+
const lifted = new Map;
|
|
951
|
+
for (const entry of found.filter(relayed).toSorted((one, other) => Number(other.need.kind === "waiting" && other.need.why === "ask") - Number(one.need.kind === "waiting" && one.need.why === "ask"))) {
|
|
952
|
+
const by = handedOut(entry);
|
|
953
|
+
const via = entry.task?.task ?? entry.conversation?.task ?? entry.conversation?.title;
|
|
954
|
+
if (!lifted.has(by) && entry.need.kind === "waiting") {
|
|
955
|
+
lifted.set(by, via == null ? entry.need : { ...entry.need, via });
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
return found.map((entry) => {
|
|
959
|
+
if (relayed(entry)) {
|
|
960
|
+
const running = entry.conversation?.status === "running" || entry.conversation?.status === "starting";
|
|
961
|
+
const plan = entry.task?.plan;
|
|
962
|
+
return {
|
|
963
|
+
...entry,
|
|
964
|
+
need: running ? { kind: "working", subject: plan ? doing(plan) : null } : { kind: "idle" }
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
const wait = lifted.get(entry.conversation?.id ?? "");
|
|
968
|
+
const takes = wait?.kind === "waiting" && (wait.why === "ask" ? entry.need.kind !== "waiting" : entry.need.kind === "idle");
|
|
969
|
+
if (wait !== undefined && takes) {
|
|
970
|
+
return { ...entry, need: wait };
|
|
971
|
+
}
|
|
972
|
+
if (wait?.kind === "waiting" && wait.why !== "ask" && entry.need.kind === "working") {
|
|
973
|
+
const { subject, questions, via } = wait;
|
|
974
|
+
return {
|
|
975
|
+
...entry,
|
|
976
|
+
need: {
|
|
977
|
+
kind: "assuming",
|
|
978
|
+
subject,
|
|
979
|
+
questions,
|
|
980
|
+
...via === undefined ? {} : { via }
|
|
981
|
+
}
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
return entry;
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
function answersTo2({ conversation, task }, conversations) {
|
|
988
|
+
if (conversation !== null) {
|
|
989
|
+
return null;
|
|
990
|
+
}
|
|
991
|
+
const caller = task?.caller ?? null;
|
|
992
|
+
return caller === null ? null : conversations.find((each) => each.id === caller && !each.archived) ?? null;
|
|
993
|
+
}
|
|
994
|
+
function pressing(one, other) {
|
|
995
|
+
if (one.kind === "waiting" && other.kind === "waiting") {
|
|
996
|
+
const at = (need) => need.since === null ? Number.POSITIVE_INFINITY : Date.parse(need.since);
|
|
997
|
+
return at(one) - at(other) || 0;
|
|
998
|
+
}
|
|
999
|
+
if (one.kind === "assuming" && other.kind === "assuming") {
|
|
1000
|
+
return other.questions.length - one.questions.length;
|
|
1001
|
+
}
|
|
1002
|
+
return 0;
|
|
1003
|
+
}
|
|
1004
|
+
var STEPS = /^[ \t]*- \[ \][ \t]+(.+)$/gm;
|
|
1005
|
+
function doing(plan) {
|
|
1006
|
+
return nextStep(plan) ?? goalLine2(plan);
|
|
1007
|
+
}
|
|
1008
|
+
function nextStep(plan) {
|
|
1009
|
+
const md = Markdown2.parse(plan);
|
|
1010
|
+
if (!md.has("Next")) {
|
|
1011
|
+
return null;
|
|
1012
|
+
}
|
|
1013
|
+
for (const [, step] of md.section("Next").body.matchAll(STEPS)) {
|
|
1014
|
+
const trimmed = step?.trim();
|
|
1015
|
+
if (trimmed !== undefined && !STUB_STEPS.includes(trimmed)) {
|
|
1016
|
+
return trimmed;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
return null;
|
|
1020
|
+
}
|
|
1021
|
+
var TASK2 = "task/";
|
|
1022
|
+
function openedBy2(row) {
|
|
1023
|
+
return row.conversation?.id ?? `${TASK2}${row.task?.task ?? ""}`;
|
|
1024
|
+
}
|
|
1025
|
+
// plans/prompts.ts
|
|
1026
|
+
function taskNumberReference2(id) {
|
|
1027
|
+
return `[SPLATES TASK #${id}]`;
|
|
1028
|
+
}
|
|
1029
|
+
var UNTRIAGED2 = "untriaged";
|
|
1030
|
+
function eventReference2(name, numbers, task) {
|
|
1031
|
+
const about = [
|
|
1032
|
+
...numbers.map((id) => `#${id}`),
|
|
1033
|
+
...task === null ? [] : [task]
|
|
1034
|
+
];
|
|
1035
|
+
return `[SPLATES EVENT ${[name, ...about].join(" ")}]`;
|
|
1036
|
+
}
|
|
1037
|
+
function scheduleReference2(automation) {
|
|
1038
|
+
return `[SPLATES SCHEDULE ${automation}]`;
|
|
1039
|
+
}
|
|
1040
|
+
function groomReference2(id) {
|
|
1041
|
+
return `[SPLATES GROOM #${id}]`;
|
|
1042
|
+
}
|
|
1043
|
+
function sortReference2(ids) {
|
|
1044
|
+
return `[SPLATES SORT ${ids.map((id) => `#${id}`).join(" ")}]`;
|
|
1045
|
+
}
|
|
1046
|
+
function taskReference2(task) {
|
|
1047
|
+
return `[SPLATES TASK ${task}]`;
|
|
1048
|
+
}
|
|
1049
|
+
function handOffReference2(task, transcript) {
|
|
1050
|
+
return `${taskReference2(task)}
|
|
1051
|
+
|
|
1052
|
+
The agent before you on this task stopped without handing it over, so its SPLATES.md may be behind. What it said and did last is in ${transcript}: read its end before going on.`;
|
|
1053
|
+
}
|
|
1054
|
+
function continuedReference2(transcript) {
|
|
1055
|
+
return `This conversation continues one the person started in General, outside any project. What was said there is in ${transcript}: read it, then carry on with that work here, starting a task before changing code.`;
|
|
1056
|
+
}
|
|
1057
|
+
function setupReference2(step) {
|
|
1058
|
+
return `[SPLATES SETUP ${step}]`;
|
|
1059
|
+
}
|
|
1060
|
+
function isUpdate2(text) {
|
|
1061
|
+
return /^\[SPLATES (?:(?:REPORT|IDLE) [^\]]+|TASK (?:DONE|OPEN|ADDED) #\d+|GROOM #\d+|SORT(?: #\d+)+|LANES DONE)\]$/.test(directive2(text));
|
|
1062
|
+
}
|
|
1063
|
+
function evalsDoneReference2(batch) {
|
|
1064
|
+
return `[SPLATES EVALS DONE ${batch}]`;
|
|
1065
|
+
}
|
|
1066
|
+
var CHECKPOINT2 = "[SPLATES CHECKPOINT]";
|
|
1067
|
+
var RESUME2 = "[SPLATES RESUME]";
|
|
1068
|
+
var RECONNECT2 = "[SPLATES RECONNECT]";
|
|
1069
|
+
var MERGE2 = "[SPLATES MERGE]";
|
|
1070
|
+
var RUN_ALLOWED2 = "[SPLATES RUN ALLOWED]";
|
|
1071
|
+
var RUN_DENIED2 = "[SPLATES RUN DENIED]";
|
|
1072
|
+
var RETRIED2 = "[SPLATES RETRIED]";
|
|
1073
|
+
var GRANTED2 = "[SPLATES GRANTED]";
|
|
1074
|
+
var GRANT_DENIED2 = "[SPLATES GRANT DENIED]";
|
|
1075
|
+
var APPROVE2 = "[SPLATES APPROVE]";
|
|
1076
|
+
var DEFER2 = "[SPLATES DEFER]";
|
|
1077
|
+
var DICTATED2 = "(Dictated by voice: words that sound alike may be swapped, and names in this project misspelled. Read a near miss as the closest name in the project, and ask before acting on a reading that changes what you do.)";
|
|
1078
|
+
var DIRECTIVES2 = /\[(?:SPLATES|ARBOR) [A-Z]+(?: [^\]\s]+)*\]/g;
|
|
1079
|
+
var LEADING = /^\s*(\[(?:SPLATES|ARBOR) [A-Z]+(?: [^\]\s]+)*\])(?:\s+|$)/;
|
|
1080
|
+
function leadingDirectives2(text) {
|
|
1081
|
+
const directives = [];
|
|
1082
|
+
let rest = text;
|
|
1083
|
+
for (let found = LEADING.exec(rest);found !== null; found = LEADING.exec(rest)) {
|
|
1084
|
+
directives.push(directive2(found[1]));
|
|
1085
|
+
rest = rest.slice(found[0].length);
|
|
1086
|
+
}
|
|
1087
|
+
return { directives, rest };
|
|
1088
|
+
}
|
|
1089
|
+
var LEGACY_DIRECTIVE = "[ARBOR ";
|
|
1090
|
+
var LEGACY_TODO = /^\[SPLATES TODO (?=(?:(?:DONE|OPEN|ADDED) )?#\d+\]$)/;
|
|
1091
|
+
function directive2(text) {
|
|
1092
|
+
const trimmed = text.trim();
|
|
1093
|
+
const splates = trimmed.startsWith(LEGACY_DIRECTIVE) ? `[SPLATES ${trimmed.slice(LEGACY_DIRECTIVE.length)}` : trimmed;
|
|
1094
|
+
return splates.replace(LEGACY_TODO, "[SPLATES TASK ");
|
|
1095
|
+
}
|
|
1096
|
+
// plans/reply.ts
|
|
1097
|
+
var QUOTED = /^> \*\*(.+)\*\*[ \t]*$/;
|
|
1098
|
+
var ANYTHING_ELSE = "Anything else?";
|
|
1099
|
+
var PICKED = /^(?:-|\d+\.)[ \t]+\(([a-z])\)(?=[ \t]|$)/;
|
|
1100
|
+
function replyOf2(questions, answers, more) {
|
|
1101
|
+
const parts = [];
|
|
1102
|
+
questions.forEach((asked, at) => {
|
|
1103
|
+
const answer = answers[at] ?? null;
|
|
1104
|
+
if (answer === null || isEmpty2(answer)) {
|
|
1105
|
+
return;
|
|
1106
|
+
}
|
|
1107
|
+
const picks = answer.picks.map((key, index) => {
|
|
1108
|
+
const choice = asked.choices.find((each) => each.key === key);
|
|
1109
|
+
const mark = asked.pick === "order" ? `${index + 1}.` : "-";
|
|
1110
|
+
return `${mark} (${key}) ${choice?.text ?? ""}`.trimEnd();
|
|
1111
|
+
});
|
|
1112
|
+
parts.push([
|
|
1113
|
+
`> **${asked.text}**`,
|
|
1114
|
+
picks.join(`
|
|
1115
|
+
`),
|
|
1116
|
+
escaped(answer.words.trim(), asked.choices)
|
|
1117
|
+
].filter((part) => part !== "").join(`
|
|
1118
|
+
|
|
1119
|
+
`));
|
|
1120
|
+
});
|
|
1121
|
+
if (more.trim() !== "") {
|
|
1122
|
+
const words = escaped(more.trim(), []);
|
|
1123
|
+
parts.push(parts.length === 0 ? words : `> **${ANYTHING_ELSE}**
|
|
1124
|
+
|
|
1125
|
+
${words}`);
|
|
1126
|
+
}
|
|
1127
|
+
return parts.join(`
|
|
1128
|
+
|
|
1129
|
+
`);
|
|
1130
|
+
}
|
|
1131
|
+
function isEmpty2(answer) {
|
|
1132
|
+
return answer.picks.length === 0 && answer.words.trim() === "";
|
|
1133
|
+
}
|
|
1134
|
+
function takenOf2(asked) {
|
|
1135
|
+
return {
|
|
1136
|
+
picks: asked.choices.filter((choice) => choice.chosen).map((choice) => choice.key),
|
|
1137
|
+
words: ""
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
function changes2(asked, answer) {
|
|
1141
|
+
const taken = takenOf2(asked).picks;
|
|
1142
|
+
return !isEmpty2(answer) && (answer.words.trim() !== "" || answer.picks.length !== taken.length || answer.picks.some((key) => !taken.includes(key)));
|
|
1143
|
+
}
|
|
1144
|
+
function quotedIn2(text, asked) {
|
|
1145
|
+
const lines = text.split(`
|
|
1146
|
+
`);
|
|
1147
|
+
const at = lines.findIndex((line) => {
|
|
1148
|
+
const quoted = QUOTED.exec(line);
|
|
1149
|
+
return quoted !== null && sameLine(quoted[1], asked.text);
|
|
1150
|
+
});
|
|
1151
|
+
if (at === -1) {
|
|
1152
|
+
return null;
|
|
1153
|
+
}
|
|
1154
|
+
const next = lines.findIndex((line, index) => index > at && QUOTED.test(line));
|
|
1155
|
+
const rest = lines.slice(at + 1, next === -1 ? lines.length : next);
|
|
1156
|
+
let from = rest.findIndex((line) => line.trim() !== "");
|
|
1157
|
+
from = from === -1 ? rest.length : from;
|
|
1158
|
+
const picks = [];
|
|
1159
|
+
for (;from < rest.length; from += 1) {
|
|
1160
|
+
const key = picked(rest[from], asked.choices);
|
|
1161
|
+
if (key === null) {
|
|
1162
|
+
break;
|
|
1163
|
+
}
|
|
1164
|
+
picks.push(key);
|
|
1165
|
+
}
|
|
1166
|
+
return {
|
|
1167
|
+
picks,
|
|
1168
|
+
words: rest.slice(from).map(unescaped).join(`
|
|
1169
|
+
`).trim()
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
function answerIn2(text, asked) {
|
|
1173
|
+
const quoted = quotedIn2(text, asked);
|
|
1174
|
+
if (quoted !== null) {
|
|
1175
|
+
return quoted;
|
|
1176
|
+
}
|
|
1177
|
+
for (const line of text.split(`
|
|
1178
|
+
`)) {
|
|
1179
|
+
const found = replyLine(asked).exec(line);
|
|
1180
|
+
if (found !== null) {
|
|
1181
|
+
const [picks, rest] = asked.choices.length === 0 ? [undefined, found[1]] : [found[1], found[2]];
|
|
1182
|
+
return {
|
|
1183
|
+
picks: (picks ?? "").split(/[ \t]*,[ \t]*/).filter(Boolean),
|
|
1184
|
+
words: (rest ?? "").replace(picks ? /^:?[ \t]?/ : /^[ \t]/, "").trim()
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
return null;
|
|
1189
|
+
}
|
|
1190
|
+
function besides2(text, asked) {
|
|
1191
|
+
const lines = text.split(`
|
|
1192
|
+
`);
|
|
1193
|
+
const last = lines.findLastIndex((line) => {
|
|
1194
|
+
const quoted = QUOTED.exec(line);
|
|
1195
|
+
return quoted !== null && sameLine(quoted[1], ANYTHING_ELSE);
|
|
1196
|
+
});
|
|
1197
|
+
const quoted = lines.findIndex((line) => QUOTED.test(line));
|
|
1198
|
+
return (last !== -1 ? lines.slice(last + 1) : quoted === -1 ? lines : lines.slice(0, quoted)).filter((line) => !asked.some((each) => replyLine(each).test(line))).map(unescaped).join(`
|
|
1199
|
+
`).trim();
|
|
1200
|
+
}
|
|
1201
|
+
function escaped(words, choices) {
|
|
1202
|
+
return words.split(`
|
|
1203
|
+
`).map((line, at) => QUOTED.test(line) || at === 0 && picked(line, choices) !== null ? `\\${line}` : line).join(`
|
|
1204
|
+
`);
|
|
1205
|
+
}
|
|
1206
|
+
function unescaped(line) {
|
|
1207
|
+
const rest = line.slice(1);
|
|
1208
|
+
return line.startsWith("\\") && (QUOTED.test(rest) || PICKED.test(rest)) ? rest : line;
|
|
1209
|
+
}
|
|
1210
|
+
function picked(line, choices) {
|
|
1211
|
+
const key = PICKED.exec(line)?.[1];
|
|
1212
|
+
return choices.some((choice) => choice.key === key) ? key ?? null : null;
|
|
1213
|
+
}
|
|
1214
|
+
function sameLine(one, other) {
|
|
1215
|
+
const plain = (text) => text.replace(/\s+/g, " ").trim().toLowerCase();
|
|
1216
|
+
return plain(one) === plain(other);
|
|
1217
|
+
}
|
|
1218
|
+
function replyLine({ number, choices }) {
|
|
1219
|
+
const keys = choices.map((choice) => choice.key).join("");
|
|
1220
|
+
const picks = keys === "" ? "" : `(?:[ \\t]+([${keys}](?:[ \\t]*,[ \\t]*[${keys}])*)(?![a-z]))?`;
|
|
1221
|
+
return new RegExp(`^${number}\\.${picks}(.*)$`);
|
|
1222
|
+
}
|
|
1223
|
+
// plans/store.ts
|
|
1224
|
+
class PlanStore2 {
|
|
1225
|
+
fs;
|
|
1226
|
+
plans;
|
|
1227
|
+
kept;
|
|
1228
|
+
constructor(fs, storage) {
|
|
1229
|
+
this.fs = fs;
|
|
1230
|
+
this.plans = new Plans2(fs);
|
|
1231
|
+
this.kept = storage.collection("plans");
|
|
1232
|
+
}
|
|
1233
|
+
async save(task, tree) {
|
|
1234
|
+
const plan = await this.plans.read(tree);
|
|
1235
|
+
if (plan === null) {
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
await this.kept.write(this.at(task), plan);
|
|
1239
|
+
}
|
|
1240
|
+
async drop(task) {
|
|
1241
|
+
await this.kept.remove(this.at(task));
|
|
1242
|
+
}
|
|
1243
|
+
async restore(task, tree) {
|
|
1244
|
+
if (await this.plans.read(tree) !== null) {
|
|
1245
|
+
return false;
|
|
1246
|
+
}
|
|
1247
|
+
const kept = await this.kept.read(this.at(task)).catch(() => null);
|
|
1248
|
+
if (kept === null) {
|
|
1249
|
+
return false;
|
|
1250
|
+
}
|
|
1251
|
+
await this.fs.write(`${tree}/${PLAN_FILE2}`, kept);
|
|
1252
|
+
return true;
|
|
1253
|
+
}
|
|
1254
|
+
at(task) {
|
|
1255
|
+
return `${task}.md`;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
// plans/unanswered.ts
|
|
1259
|
+
function unanswered2(open, messages) {
|
|
1260
|
+
const done = new Set;
|
|
1261
|
+
messages.forEach((message, at) => {
|
|
1262
|
+
if (message.role !== "user") {
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
const text = textOf(message);
|
|
1266
|
+
const before = messages[at - 1];
|
|
1267
|
+
for (const asked of open) {
|
|
1268
|
+
if (quotedIn2(text, asked) !== null) {
|
|
1269
|
+
done.add(asked);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
if (before?.role === "agent") {
|
|
1273
|
+
for (const card of asks2(before)) {
|
|
1274
|
+
const same = open.find((asked) => alike(asked, card));
|
|
1275
|
+
if (same !== undefined && answerIn2(text, card) !== null) {
|
|
1276
|
+
done.add(same);
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
});
|
|
1281
|
+
return open.filter((asked) => !done.has(asked));
|
|
1282
|
+
}
|
|
1283
|
+
function asks2(message) {
|
|
1284
|
+
const said = message.parts.findLast((part) => part.type === "text" && part.text.trim() !== "");
|
|
1285
|
+
if (said?.type !== "text") {
|
|
1286
|
+
return [];
|
|
1287
|
+
}
|
|
1288
|
+
return stretches2(said.text).flatMap((stretch) => stretch.type === "questions" ? stretch.questions : []);
|
|
1289
|
+
}
|
|
1290
|
+
function textOf(message) {
|
|
1291
|
+
return message.parts.map((part) => part.type === "text" ? part.text : "").join("").trim();
|
|
1292
|
+
}
|
|
1293
|
+
function alike(one, other) {
|
|
1294
|
+
const plain = (text) => text.replace(/\s+/g, " ").trim().toLowerCase();
|
|
1295
|
+
return plain(one.text) === plain(other.text);
|
|
1296
|
+
}
|
|
1297
|
+
function waitsOnYou2({ conversation, need }) {
|
|
1298
|
+
if (conversation === null) {
|
|
1299
|
+
return false;
|
|
1300
|
+
}
|
|
1301
|
+
if (need.kind === "waiting" && need.why !== "questions") {
|
|
1302
|
+
return true;
|
|
1303
|
+
}
|
|
1304
|
+
if (need.kind === "idle" || need.kind === "working" || need.kind === "assuming") {
|
|
1305
|
+
return false;
|
|
1306
|
+
}
|
|
1307
|
+
return unanswered2(need.questions, conversation.messages).length > 0;
|
|
1308
|
+
}
|
|
1309
|
+
export { queueIsSettled2, PLAN_FILE2, Plans2, goalLine2, sectionApart2, outcomeOf2, goalOf2, questions2, openQuestions2, picks2, decisions2, unfinished2, ready2, whatIsLeft2, checkPlan2, stretches2, madeByYou2, decided2, keptDecisions2, needs2, externals2, needOfExternal2, orphaned2, ASKED_QUIET2, need2, answeredThrough2, answersTo2, TASK2, openedBy2, taskNumberReference2, UNTRIAGED2, eventReference2, scheduleReference2, groomReference2, sortReference2, taskReference2, handOffReference2, continuedReference2, setupReference2, isUpdate2, evalsDoneReference2, CHECKPOINT2, RESUME2, RECONNECT2, MERGE2, RUN_ALLOWED2, RUN_DENIED2, RETRIED2, GRANTED2, GRANT_DENIED2, APPROVE2, DEFER2, DICTATED2, DIRECTIVES2, leadingDirectives2, directive2, replyOf2, isEmpty2, takenOf2, changes2, quotedIn2, answerIn2, besides2, PlanStore2, unanswered2, waitsOnYou2 };
|