@stringsync/splates 0.0.61 → 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,1468 @@
|
|
|
1
|
+
import {
|
|
2
|
+
thinkingOf2,
|
|
3
|
+
effortsOf2,
|
|
4
|
+
effortSettings2,
|
|
5
|
+
pickSettings2,
|
|
6
|
+
CAP_PREFIX2,
|
|
7
|
+
body,
|
|
8
|
+
FsStorage2,
|
|
9
|
+
Prices,
|
|
10
|
+
inputKey,
|
|
11
|
+
textOf2,
|
|
12
|
+
Spend,
|
|
13
|
+
treeOf2,
|
|
14
|
+
modelOption2,
|
|
15
|
+
Offered2,
|
|
16
|
+
Roster2,
|
|
17
|
+
traitsOf2,
|
|
18
|
+
splatesHome2
|
|
19
|
+
} from "./index-caep3sde.js";
|
|
20
|
+
import {
|
|
21
|
+
Exit2,
|
|
22
|
+
fail2
|
|
23
|
+
} from "./index-t9w5a8ed.js";
|
|
24
|
+
import {
|
|
25
|
+
Plans2,
|
|
26
|
+
goalOf2
|
|
27
|
+
} from "./index-0jttnv86.js";
|
|
28
|
+
|
|
29
|
+
// auto-pick/classes.ts
|
|
30
|
+
var KIND_IDS = ["bugfix", "design", "open"];
|
|
31
|
+
var DEPTH_IDS = ["shallow", "moderate", "deep"];
|
|
32
|
+
var KINDS = [
|
|
33
|
+
question("bugfix", "Bugfix", "Does the task ask to find and fix a defect: something that fails, crashes or behaves other than it should?"),
|
|
34
|
+
question("design", "Design", "Does implementing the task require choosing between approaches, shaping an API or data model, or weighing trade-offs? Describing an already chosen solution carefully is not itself a design decision."),
|
|
35
|
+
question("open", "Open-ended", "Is the task open-ended or research-like, with investigation needed before the desired outcome is clear?")
|
|
36
|
+
];
|
|
37
|
+
var DEPTHS = [
|
|
38
|
+
{
|
|
39
|
+
id: "shallow",
|
|
40
|
+
label: "Shallow",
|
|
41
|
+
noul: {
|
|
42
|
+
type: "noul",
|
|
43
|
+
instructions: "Is the task's reasoning depth shallow: the hardest step is applying a known, direct change? Judge the work requested, not the length or care of the message, number of files, or amount of testing.",
|
|
44
|
+
criteria: {
|
|
45
|
+
true: "A long, careful message asking for a one-spot change is shallow. So are a specified CSS/layout adjustment, renaming across many files, wiring an existing pattern, or applying an explicit solution. Copying an existing page behavior into a CLI command, or bumping a dependency and threading a specified option through existing calls, is shallow even with tests in several files. Reading nearby code to find the spot does not alone make it moderate.",
|
|
46
|
+
false: "The solution needs tracing interacting behavior or deriving an approach (moderate), or resolving subtle competing constraints or an elusive cause (deep)."
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "moderate",
|
|
52
|
+
label: "Moderate",
|
|
53
|
+
noul: {
|
|
54
|
+
type: "noul",
|
|
55
|
+
instructions: "Is the task's reasoning depth moderate: its hardest step needs tracing behavior or working out an implementation using familiar patterns? Judge reasoning, not the number of files, request length, stakes, or verification effort.",
|
|
56
|
+
criteria: {
|
|
57
|
+
true: "Trace ordinary synchronous behavior, find a localized ordinary bug, or work out how a feature fits existing behavior. Several related constraints need connecting, with a clear approach once understood.",
|
|
58
|
+
false: "Applying a specified solution or straightforward existing pattern is shallow, even over many files. Novel architecture, subtle invariants or an elusive failure needing competing hypotheses is deep."
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "deep",
|
|
64
|
+
label: "Deep",
|
|
65
|
+
noul: {
|
|
66
|
+
type: "noul",
|
|
67
|
+
instructions: "Is the task's reasoning depth deep: its hardest step requires sustained reasoning about subtle invariants, competing hypotheses, or architectural trade-offs? Size, polished prose, unfamiliar code, high stakes and screenshots alone do not imply deep reasoning.",
|
|
68
|
+
criteria: {
|
|
69
|
+
true: "A concurrency or ordering failure involving asynchronous ownership, teardown, atomicity or persistence; reconciling lifecycle or consistency guarantees; designing a policy that must bound autonomous work and preserve user approval. Even with a suspected cause, proving the fix covers interleavings takes deep reasoning. Architectural or policy trade-offs left unresolved can require deep reasoning. The solution cannot be obtained just by tracing ordinary behavior or following a given plan.",
|
|
70
|
+
false: "A routine feature or ordinary bug whose approach emerges by tracing existing behavior is moderate. A specified change or direct pattern is shallow, even if its request is long or many files change."
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
var BREADTHS = [
|
|
76
|
+
question("spot", "One spot", "Is the code the task must read and change confined to one small spot, even if its message is long? Use any file paths supplied in the state as evidence, not as the only files it may touch."),
|
|
77
|
+
question("module", "One module", "Does the task need reading and changing several related pieces within one module or feature?"),
|
|
78
|
+
question("system", "Across modules", "Does the task need reading and changing several modules or packages? A mechanical rename can have this breadth and still have shallow reasoning depth.")
|
|
79
|
+
];
|
|
80
|
+
var CLARITY_IDS = ["settled", "unresolved"];
|
|
81
|
+
var CLARITIES = [
|
|
82
|
+
question("settled", "Calls settled", "Has the user settled the desired behavior or approach and its consequential choices, leaving implementation calls to the agent? Look for explicit decisions and concrete requirements, not an assertive tone, polished wording or message length. A tentative voice can describe a settled solution. Settled behavior can still require deep reasoning to implement safely."),
|
|
83
|
+
question("unresolved", "Calls unresolved", "Is the user exploring what should happen or asking for help choosing an approach, leaving consequential product or behavior choices open? Confident phrasing alone does not settle these choices. Do not count routine implementation choices or uncertainty about a bug cause when the desired behavior is clear.")
|
|
84
|
+
];
|
|
85
|
+
var STAKES = [
|
|
86
|
+
question("routine", "Routine", "Is the task a reversible code or presentation change without material risk to stored data, security, migrations or releases?"),
|
|
87
|
+
question("sensitive", "Sensitive", "Does the task involve migrations, stored data integrity, security or credentials, publishing or releases, where an incorrect change has material consequences?")
|
|
88
|
+
];
|
|
89
|
+
var VERIFICATIONS = [
|
|
90
|
+
question("automated", "Automated", "Can the requested behavior be checked adequately with tests, types or other automated checks, without visually inspecting UI, layout or screenshots?"),
|
|
91
|
+
question("visual", "Needs eyes", "Does checking the requested result need visual inspection, such as UI, layout, styling, screenshots or video? Use attachment kinds and names as context, never assume their contents are visible.")
|
|
92
|
+
];
|
|
93
|
+
var CONTEXT_CLASSES = {
|
|
94
|
+
breadth: BREADTHS,
|
|
95
|
+
clarity: CLARITIES,
|
|
96
|
+
stakes: STAKES,
|
|
97
|
+
verification: VERIFICATIONS
|
|
98
|
+
};
|
|
99
|
+
function question(id, label, instructions) {
|
|
100
|
+
return { id, label, noul: { type: "noul", instructions } };
|
|
101
|
+
}
|
|
102
|
+
// auto-pick/classify.ts
|
|
103
|
+
import { aborts } from "../../core/abort/index.js";
|
|
104
|
+
import { Duration } from "../../core/time/index.js";
|
|
105
|
+
|
|
106
|
+
// auto-pick/system-one.ts
|
|
107
|
+
import { z } from "zod";
|
|
108
|
+
async function askSystemOne(name, url, token, body, opts) {
|
|
109
|
+
const response = await (opts.fetch ?? fetch)(url, {
|
|
110
|
+
method: "POST",
|
|
111
|
+
headers: {
|
|
112
|
+
authorization: `Bearer ${token}`,
|
|
113
|
+
"content-type": "application/json"
|
|
114
|
+
},
|
|
115
|
+
body: JSON.stringify(body),
|
|
116
|
+
signal: opts.signal
|
|
117
|
+
});
|
|
118
|
+
if (!response.ok) {
|
|
119
|
+
await response.body?.cancel();
|
|
120
|
+
throw new Error(`${name} answered ${response.status}`);
|
|
121
|
+
}
|
|
122
|
+
const json = await response.json().catch(() => {
|
|
123
|
+
return;
|
|
124
|
+
});
|
|
125
|
+
const inner = typeof json === "object" && json !== null && "result" in json ? json.result : json;
|
|
126
|
+
const reply = REPLY.safeParse(inner);
|
|
127
|
+
if (!reply.success) {
|
|
128
|
+
throw new Error(`${name} answered with no answers in it`);
|
|
129
|
+
}
|
|
130
|
+
const { usage } = reply.data;
|
|
131
|
+
return {
|
|
132
|
+
answers: new Map(Object.entries(reply.data.answers).map(([id, probability]) => [
|
|
133
|
+
id,
|
|
134
|
+
Math.min(1, Math.max(0, probability))
|
|
135
|
+
])),
|
|
136
|
+
...usage === undefined ? {} : { usage: { input: usage.input_tokens, output: usage.output_tokens } }
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
var REPLY = z.object({
|
|
140
|
+
answers: z.record(z.string(), z.union([
|
|
141
|
+
z.number(),
|
|
142
|
+
z.object({ noul: z.number() }).transform((answer) => answer.noul)
|
|
143
|
+
])),
|
|
144
|
+
usage: z.object({ input_tokens: z.number(), output_tokens: z.number() }).optional().catch(undefined)
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// auto-pick/clef.ts
|
|
148
|
+
var MODEL = "clef-flash";
|
|
149
|
+
|
|
150
|
+
class Clef {
|
|
151
|
+
account;
|
|
152
|
+
token;
|
|
153
|
+
opts;
|
|
154
|
+
constructor(account, token, opts = {}) {
|
|
155
|
+
this.account = account;
|
|
156
|
+
this.token = token;
|
|
157
|
+
this.opts = opts;
|
|
158
|
+
}
|
|
159
|
+
judge(judgment, opts = {}) {
|
|
160
|
+
return askSystemOne("Clef", `${this.opts.origin ?? "https://api.cloudflare.com"}/client/v4/accounts/${this.account}/ai/run/@cf/cloudflare/${MODEL}`, this.token, judgment, { ...opts, fetch: this.opts.fetch });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// auto-pick/jev.ts
|
|
165
|
+
var MODEL2 = "jev-latest";
|
|
166
|
+
var JEV_INPUT_PRICE = 0.042;
|
|
167
|
+
|
|
168
|
+
class Jev {
|
|
169
|
+
token;
|
|
170
|
+
opts;
|
|
171
|
+
constructor(token, opts = {}) {
|
|
172
|
+
this.token = token;
|
|
173
|
+
this.opts = opts;
|
|
174
|
+
}
|
|
175
|
+
async judge(judgment, opts = {}) {
|
|
176
|
+
const verdict = await askSystemOne("Jev", `${this.opts.origin ?? "https://api.typesafe.ai"}/v1/systemone`, this.token, { model: MODEL2, ...judgment }, { ...opts, fetch: this.opts.fetch });
|
|
177
|
+
if (verdict.usage === undefined) {
|
|
178
|
+
return verdict;
|
|
179
|
+
}
|
|
180
|
+
const dollars = verdict.usage.input * JEV_INPUT_PRICE / 1e6;
|
|
181
|
+
if (this.opts.spend !== undefined) {
|
|
182
|
+
await this.opts.spend.record({
|
|
183
|
+
at: (this.opts.now?.() ?? new Date).toISOString(),
|
|
184
|
+
provider: "typesafe",
|
|
185
|
+
service: this.opts.attribution?.purpose === undefined ? MODEL2 : `${MODEL2} ${this.opts.attribution.purpose}`,
|
|
186
|
+
kind: "billed",
|
|
187
|
+
dollars,
|
|
188
|
+
project: this.opts.attribution?.project ?? null,
|
|
189
|
+
task: this.opts.attribution?.task ?? null,
|
|
190
|
+
conversation: this.opts.attribution?.conversation ?? null
|
|
191
|
+
}).catch(() => {});
|
|
192
|
+
}
|
|
193
|
+
return { ...verdict, dollars };
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// auto-pick/judge.ts
|
|
198
|
+
var JUDGE_CREDS = {
|
|
199
|
+
jev: ["TYPESAFE_API_KEY"],
|
|
200
|
+
clef: ["CLOUDFLARE_ACCOUNT_ID", "CLOUDFLARE_API_TOKEN"]
|
|
201
|
+
};
|
|
202
|
+
async function judgeFrom(credentials, opts = {}) {
|
|
203
|
+
const typesafe = await credentials.get("TYPESAFE_API_KEY");
|
|
204
|
+
if (typesafe) {
|
|
205
|
+
return new Jev(typesafe, opts);
|
|
206
|
+
}
|
|
207
|
+
const id = await credentials.get("CLOUDFLARE_ACCOUNT_ID");
|
|
208
|
+
const token = await credentials.get("CLOUDFLARE_API_TOKEN");
|
|
209
|
+
return id && token ? new Clef(id, token) : null;
|
|
210
|
+
}
|
|
211
|
+
async function projectJudge(project, slug, who = {}) {
|
|
212
|
+
return judgeFrom(project.creds.credentials, {
|
|
213
|
+
spend: new Spend(new FsStorage2(splatesHome2(project.ps), project.fs)),
|
|
214
|
+
attribution: {
|
|
215
|
+
project: await slug(),
|
|
216
|
+
task: who.task ?? null,
|
|
217
|
+
conversation: who.conversation ?? null,
|
|
218
|
+
...who.purpose === undefined ? {} : { purpose: who.purpose }
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// auto-pick/classify.ts
|
|
224
|
+
async function classify(input) {
|
|
225
|
+
if (input.judge === null) {
|
|
226
|
+
return {
|
|
227
|
+
ok: false,
|
|
228
|
+
reason: `no judge: keep ${JUDGE_CREDS.jev.join(", ")} for Jev, or ${JUDGE_CREDS.clef.join(" and ")} for Clef`
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
const timeout = input.timeout ?? DEFAULT_TIMEOUT;
|
|
232
|
+
const signals = [AbortSignal.timeout(timeout.ms)];
|
|
233
|
+
if (input.signal !== undefined) {
|
|
234
|
+
signals.push(input.signal);
|
|
235
|
+
}
|
|
236
|
+
const signal = AbortSignal.any(signals);
|
|
237
|
+
try {
|
|
238
|
+
const verdict = await aborts.race(signal, input.judge.judge({
|
|
239
|
+
state: {
|
|
240
|
+
subject: input.subject,
|
|
241
|
+
detail: input.detail.slice(0, DETAIL_CHARS),
|
|
242
|
+
paths: namedPaths(`${input.subject}
|
|
243
|
+
${input.detail}`),
|
|
244
|
+
attachments: attachmentSummary(input.attachments ?? [])
|
|
245
|
+
},
|
|
246
|
+
questions: {
|
|
247
|
+
...questions("kind", KINDS),
|
|
248
|
+
...questions("depth", DEPTHS),
|
|
249
|
+
...Object.fromEntries(Object.entries(CONTEXT_CLASSES).flatMap(([group, classes]) => Object.entries(questions(group, classes))))
|
|
250
|
+
}
|
|
251
|
+
}, { signal }));
|
|
252
|
+
return {
|
|
253
|
+
ok: true,
|
|
254
|
+
classification: {
|
|
255
|
+
kinds: answers(verdict, "kind", KINDS),
|
|
256
|
+
depth: answers(verdict, "depth", DEPTHS),
|
|
257
|
+
breadth: answers(verdict, "breadth", CONTEXT_CLASSES.breadth),
|
|
258
|
+
clarity: answers(verdict, "clarity", CONTEXT_CLASSES.clarity),
|
|
259
|
+
stakes: answers(verdict, "stakes", CONTEXT_CLASSES.stakes),
|
|
260
|
+
verification: answers(verdict, "verification", CONTEXT_CLASSES.verification)
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
} catch (error) {
|
|
264
|
+
if (input.signal?.aborted) {
|
|
265
|
+
throw input.signal.reason;
|
|
266
|
+
}
|
|
267
|
+
return {
|
|
268
|
+
ok: false,
|
|
269
|
+
reason: signal.aborted ? `the judge took over ${timeout.ms / 1000}s` : `the judge failed (${error instanceof Error ? error.message : String(error)})`
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function questions(group, classes) {
|
|
274
|
+
return Object.fromEntries(classes.map((each) => [`${group}:${each.id}`, each.noul]));
|
|
275
|
+
}
|
|
276
|
+
function answers(verdict, group, classes) {
|
|
277
|
+
return Object.fromEntries(classes.map((each) => [
|
|
278
|
+
each.id,
|
|
279
|
+
verdict.answers.get(`${group}:${each.id}`) ?? 0.5
|
|
280
|
+
]));
|
|
281
|
+
}
|
|
282
|
+
function namedPaths(words) {
|
|
283
|
+
return [
|
|
284
|
+
...new Set(words.match(/(?:[\w@.~+-]+\/)+[\w.*@+-]+(?:\/[\w.*@+-]+)*\/?/g) ?? [])
|
|
285
|
+
];
|
|
286
|
+
}
|
|
287
|
+
function attachmentSummary(files) {
|
|
288
|
+
const groups = new Map;
|
|
289
|
+
for (const file of files) {
|
|
290
|
+
const kind = file.mimeType.startsWith("image/") ? "image" : file.mimeType.startsWith("video/") ? "video" : file.mimeType.startsWith("audio/") ? "audio file" : "file";
|
|
291
|
+
const names = groups.get(kind) ?? [];
|
|
292
|
+
names.push(file.name);
|
|
293
|
+
groups.set(kind, names);
|
|
294
|
+
}
|
|
295
|
+
return [...groups].map(([kind, names]) => `${names.length} ${kind}${names.length === 1 ? "" : "s"} (${names.join(", ")})`).join(", ") || "none";
|
|
296
|
+
}
|
|
297
|
+
var DEFAULT_TIMEOUT = Duration.secs(5);
|
|
298
|
+
var DETAIL_CHARS = 4000;
|
|
299
|
+
// auto-pick/rules.ts
|
|
300
|
+
import { z as z2 } from "zod";
|
|
301
|
+
|
|
302
|
+
// auto-pick/rule-names.ts
|
|
303
|
+
var RULES_FORMAT = 2;
|
|
304
|
+
var ANY = "*";
|
|
305
|
+
var DEFAULT_PACE = { on: true, slack: 0.1, spent: 0.95 };
|
|
306
|
+
function ruleLabel(rule) {
|
|
307
|
+
const kind = rule.kind === ANY ? "any kind" : KINDS.find((each) => each.id === rule.kind)?.label ?? rule.kind;
|
|
308
|
+
const depth = rule.depth === ANY ? "any depth" : DEPTHS.find((each) => each.id === rule.depth)?.label ?? rule.depth;
|
|
309
|
+
const clarity = rule.clarity === undefined || rule.clarity === ANY ? "" : `, ${CLARITIES.find((each) => each.id === rule.clarity)?.label ?? rule.clarity}`;
|
|
310
|
+
return `${kind}, ${depth}${clarity}`;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// auto-pick/rules.ts
|
|
314
|
+
function checkRules(value) {
|
|
315
|
+
const parsed = AUTO_PICK_RULES.safeParse(migrateRules(value));
|
|
316
|
+
if (parsed.success) {
|
|
317
|
+
return { ok: true, rules: parsed.data };
|
|
318
|
+
}
|
|
319
|
+
const issue = parsed.error.issues[0];
|
|
320
|
+
return {
|
|
321
|
+
ok: false,
|
|
322
|
+
problem: `${issue?.path.join(".") || "the rules"}: ${issue?.message}`
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
var PICK = z2.object({
|
|
326
|
+
agent: z2.string().min(1),
|
|
327
|
+
model: z2.string().min(1).optional(),
|
|
328
|
+
effort: z2.string().min(1).optional()
|
|
329
|
+
});
|
|
330
|
+
var RULE = z2.object({
|
|
331
|
+
kind: z2.enum([ANY, ...KIND_IDS]),
|
|
332
|
+
depth: z2.enum([ANY, ...DEPTH_IDS]),
|
|
333
|
+
clarity: z2.enum([ANY, ...CLARITY_IDS]).optional(),
|
|
334
|
+
picks: z2.array(PICK).min(1, "a rule picks at least one agent").superRefine((picks, ctx) => {
|
|
335
|
+
const at = picks.findIndex((pick, index) => picks.findIndex((each) => each.agent === pick.agent && each.model === pick.model) !== index);
|
|
336
|
+
if (at >= 0) {
|
|
337
|
+
ctx.addIssue({
|
|
338
|
+
code: "custom",
|
|
339
|
+
path: [at],
|
|
340
|
+
message: "a rule names the same agent and model once"
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
})
|
|
344
|
+
});
|
|
345
|
+
var AUTO_PICK_RULES = z2.object({
|
|
346
|
+
format: z2.literal(RULES_FORMAT),
|
|
347
|
+
threshold: z2.number().min(0).max(1),
|
|
348
|
+
rules: z2.array(RULE).min(1, "the rules list at least one rule"),
|
|
349
|
+
pace: z2.object({
|
|
350
|
+
on: z2.boolean(),
|
|
351
|
+
slack: z2.number().min(0).max(1),
|
|
352
|
+
spent: z2.number().min(0).max(1)
|
|
353
|
+
}).optional()
|
|
354
|
+
}).superRefine((value, ctx) => {
|
|
355
|
+
const last = value.rules.at(-1);
|
|
356
|
+
if (last !== undefined && (last.kind !== ANY || last.depth !== ANY || last.clarity !== undefined && last.clarity !== ANY)) {
|
|
357
|
+
ctx.addIssue({
|
|
358
|
+
code: "custom",
|
|
359
|
+
path: ["rules", value.rules.length - 1],
|
|
360
|
+
message: "the last rule must be kind * and depth * with any certainty, so every task maps to a pick"
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
function migrateRules(value) {
|
|
365
|
+
if (value === null || typeof value !== "object" || !("format" in value) || value.format !== 1 || !("rules" in value) || !Array.isArray(value.rules)) {
|
|
366
|
+
return value;
|
|
367
|
+
}
|
|
368
|
+
const depths = {
|
|
369
|
+
easy: "shallow",
|
|
370
|
+
medium: "moderate",
|
|
371
|
+
hard: "deep",
|
|
372
|
+
"*": "*"
|
|
373
|
+
};
|
|
374
|
+
return {
|
|
375
|
+
...value,
|
|
376
|
+
format: 2,
|
|
377
|
+
rules: value.rules.map((rule) => {
|
|
378
|
+
if (rule === null || typeof rule !== "object") {
|
|
379
|
+
return rule;
|
|
380
|
+
}
|
|
381
|
+
const { difficulty, ...rest } = rule;
|
|
382
|
+
return {
|
|
383
|
+
...rest,
|
|
384
|
+
kind: rest.kind === "lookup" || rest.kind === "mechanical" ? "*" : rest.kind,
|
|
385
|
+
depth: rest.depth ?? (typeof difficulty === "string" ? difficulty === "*" && rest.kind === "lookup" ? "shallow" : difficulty === "*" && rest.kind === "mechanical" ? "moderate" : depths[difficulty] ?? difficulty : difficulty)
|
|
386
|
+
};
|
|
387
|
+
})
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// auto-pick/decide.ts
|
|
392
|
+
function decide(input) {
|
|
393
|
+
const { threshold } = input.rules;
|
|
394
|
+
const kind = likeliest(KINDS, input.classification.kinds, threshold);
|
|
395
|
+
const depth = likeliest(DEPTHS, input.classification.depth, threshold);
|
|
396
|
+
const answers = input.classification.clarity;
|
|
397
|
+
const clarity = answers === undefined || answers.settled === answers.unresolved || Math.max(answers.settled, answers.unresolved) <= 0.5 ? null : likeliest(CLARITIES, answers, threshold).id;
|
|
398
|
+
const decision = choose(input, kind.id, depth.id, `judged: ${kind.said}, ${depth.said}`, answers === undefined ? undefined : clarity);
|
|
399
|
+
for (const [group, classes] of Object.entries(CONTEXT_CLASSES)) {
|
|
400
|
+
const answers = input.classification[group];
|
|
401
|
+
if (answers !== undefined) {
|
|
402
|
+
decision.reasons.push(`${group}: ${classes.map((each) => `${each.label} ${Math.round((answers[each.id] ?? 0.5) * 100)}%`).join(", ")}`);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return decision;
|
|
406
|
+
}
|
|
407
|
+
function decideWithout(input) {
|
|
408
|
+
return choose(input, null, null, input.reason);
|
|
409
|
+
}
|
|
410
|
+
function decideDeeper(input, set, why) {
|
|
411
|
+
const at = DEPTHS.findIndex((each) => each.id === set.depth);
|
|
412
|
+
const deeper = DEPTHS[Math.max(at, 0) + 1];
|
|
413
|
+
if (deeper === undefined) {
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
const kind = KINDS.find((each) => each.id === set.kind)?.id ?? null;
|
|
417
|
+
return choose(input, kind, deeper.id, `${why}, so ${deeper.label.toLowerCase()}`, set.clarity === undefined ? undefined : CLARITIES.find((each) => each.id === set.clarity)?.id ?? null);
|
|
418
|
+
}
|
|
419
|
+
function choose(input, kind, depth, judged, clarity) {
|
|
420
|
+
const index = input.rules.rules.findIndex((each) => (each.kind === ANY || each.kind === kind) && (each.depth === ANY || each.depth === depth) && (each.clarity === undefined || each.clarity === ANY || each.clarity === clarity));
|
|
421
|
+
const matched = input.rules.rules[index];
|
|
422
|
+
if (matched === undefined) {
|
|
423
|
+
throw new Error("no Auto pick rule matches: the last must be * *");
|
|
424
|
+
}
|
|
425
|
+
const reasons = [judged, `rule ${index + 1}: ${ruleLabel(matched)}`];
|
|
426
|
+
const pace = input.rules.pace ?? DEFAULT_PACE;
|
|
427
|
+
const blind = [];
|
|
428
|
+
const picks = matched.picks.flatMap((pick) => {
|
|
429
|
+
const agent = input.agents.find((each) => each.id === pick.agent);
|
|
430
|
+
if (agent === undefined) {
|
|
431
|
+
reasons.push(`passed over ${pick.agent}: not on the roster`);
|
|
432
|
+
return [];
|
|
433
|
+
}
|
|
434
|
+
if (!input.runnable.includes(agent.id)) {
|
|
435
|
+
reasons.push(`passed over ${agent.name}: can't run here`);
|
|
436
|
+
return [];
|
|
437
|
+
}
|
|
438
|
+
const model = modelOf(agent, pick.model);
|
|
439
|
+
if (model === null) {
|
|
440
|
+
reasons.push(`passed over ${agent.name}: no model '${pick.model}' on the roster`);
|
|
441
|
+
return [];
|
|
442
|
+
}
|
|
443
|
+
const { model: _, ...rest } = pick;
|
|
444
|
+
const limits = (input.limits[agent.id] ?? []).filter((each) => !each.window.startsWith(CAP_PREFIX2) || each.window === `${CAP_PREFIX2}${model ?? ""}`);
|
|
445
|
+
const candidate = {
|
|
446
|
+
pick: model === undefined ? rest : { ...rest, model },
|
|
447
|
+
agent,
|
|
448
|
+
pressure: pressed(limits, input.now),
|
|
449
|
+
fast: pace.on ? fastest(limits, input.now, pace.slack) : undefined
|
|
450
|
+
};
|
|
451
|
+
if (input.images === true) {
|
|
452
|
+
const sees = seesImages(input, agent, model);
|
|
453
|
+
if (sees === false) {
|
|
454
|
+
reasons.push(`passed over ${agent.name}: can't see images`);
|
|
455
|
+
blind.push(candidate);
|
|
456
|
+
return [];
|
|
457
|
+
}
|
|
458
|
+
if (sees === null) {
|
|
459
|
+
reasons.push(`${agent.name} stays a pick: image support unknown`);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return [candidate];
|
|
463
|
+
});
|
|
464
|
+
let usable = picks;
|
|
465
|
+
if (picks.length === 0 && blind[0] !== undefined) {
|
|
466
|
+
reasons.push(`none of rule ${index + 1}'s picks can see images, so the first: ${blind[0].agent.name}`);
|
|
467
|
+
usable = [blind[0]];
|
|
468
|
+
}
|
|
469
|
+
const left = usable.filter((each) => (each.pressure?.used ?? 0) < pace.spent);
|
|
470
|
+
const paced = left.find((each) => each.fast === undefined);
|
|
471
|
+
let chosen = paced ?? left[0];
|
|
472
|
+
for (const each of usable.slice(0, chosen === undefined ? 0 : usable.indexOf(chosen))) {
|
|
473
|
+
reasons.push(`passed over ${each.agent.name}: ${(each.pressure?.used ?? 0) < pace.spent ? ahead(each.fast) : plan(each.pressure)}`);
|
|
474
|
+
}
|
|
475
|
+
if (chosen !== undefined && paced === undefined) {
|
|
476
|
+
reasons.push(`every pick with plan left is ahead of pace, so the first: ${chosen.agent.name}, ${ahead(chosen.fast)}`);
|
|
477
|
+
}
|
|
478
|
+
if (chosen === undefined) {
|
|
479
|
+
chosen = [...usable].sort((left, right) => (left.pressure?.used ?? 0) - (right.pressure?.used ?? 0))[0];
|
|
480
|
+
if (chosen !== undefined) {
|
|
481
|
+
reasons.push(`every pick is past ${Math.round(pace.spent * 100)}% of a plan, so the least used: ${chosen.agent.name}, ${plan(chosen.pressure)}`);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
if (chosen === undefined) {
|
|
485
|
+
const first = input.agents.find((each) => input.runnable.includes(each.id));
|
|
486
|
+
if (first === undefined) {
|
|
487
|
+
throw new Error("the roster lists no agent splates can run here");
|
|
488
|
+
}
|
|
489
|
+
reasons.push(`no pick of rule ${index + 1} can run here, so ${first.name} on its default`);
|
|
490
|
+
chosen = {
|
|
491
|
+
pick: { agent: first.id },
|
|
492
|
+
agent: first,
|
|
493
|
+
pressure: undefined,
|
|
494
|
+
fast: undefined
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
const pick = withEffort(chosen.pick, chosen.agent, input.offered[chosen.agent.id], reasons);
|
|
498
|
+
reasons.unshift(headline(pick, chosen.agent));
|
|
499
|
+
return {
|
|
500
|
+
pick,
|
|
501
|
+
rule: index,
|
|
502
|
+
kind,
|
|
503
|
+
depth,
|
|
504
|
+
...clarity === undefined ? {} : { clarity },
|
|
505
|
+
reasons
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
function seesImages(input, agent, model) {
|
|
509
|
+
const said = input.sights?.[agent.id];
|
|
510
|
+
const name = agent.models.find((each) => each.id === model)?.name ?? null;
|
|
511
|
+
const key = inputKey(agent.id, model ?? null, name);
|
|
512
|
+
const inputs = key === null ? undefined : input.catalog?.[key]?.inputs;
|
|
513
|
+
const listed = inputs?.includes("image");
|
|
514
|
+
if (said === false || listed === false) {
|
|
515
|
+
return false;
|
|
516
|
+
}
|
|
517
|
+
return said === true && listed === true ? true : null;
|
|
518
|
+
}
|
|
519
|
+
function likeliest(classes, answers, threshold) {
|
|
520
|
+
const best = classes.reduce((most, each) => most === undefined || answers[each.id] > answers[most.id] ? each : most, undefined);
|
|
521
|
+
if (best === undefined) {
|
|
522
|
+
return { id: null, said: "none" };
|
|
523
|
+
}
|
|
524
|
+
const said = `${best.label} ${Math.round(answers[best.id] * 100)}%`;
|
|
525
|
+
return answers[best.id] >= threshold ? { id: best.id, said } : { id: null, said: `unsure (${said})` };
|
|
526
|
+
}
|
|
527
|
+
function modelOf(agent, wanted) {
|
|
528
|
+
if (wanted === undefined || agent.models.length === 0) {
|
|
529
|
+
return wanted;
|
|
530
|
+
}
|
|
531
|
+
const lower = wanted.toLowerCase();
|
|
532
|
+
return agent.models.find((each) => each.id === wanted || each.id.toLowerCase() === lower || each.name.toLowerCase() === lower)?.id ?? null;
|
|
533
|
+
}
|
|
534
|
+
function withEffort(pick, agent, offered, reasons) {
|
|
535
|
+
if (pick.effort === undefined || offered === undefined) {
|
|
536
|
+
return pick;
|
|
537
|
+
}
|
|
538
|
+
const { effort, ...rest } = pick;
|
|
539
|
+
const setting = offered.find((each) => each.category === "thought_level");
|
|
540
|
+
if (setting === undefined) {
|
|
541
|
+
reasons.push(`${agent.name} offers no thinking level, so its own`);
|
|
542
|
+
return rest;
|
|
543
|
+
}
|
|
544
|
+
const lower = effort.toLowerCase();
|
|
545
|
+
const level = setting.options.find((each) => each.value.toLowerCase() === lower || each.name.toLowerCase() === lower);
|
|
546
|
+
if (level === undefined) {
|
|
547
|
+
reasons.push(`${agent.name} offers no ${effort} thinking, so its own`);
|
|
548
|
+
return rest;
|
|
549
|
+
}
|
|
550
|
+
return { ...rest, effort: level.value };
|
|
551
|
+
}
|
|
552
|
+
function headline(pick, agent) {
|
|
553
|
+
const model = pick.model === undefined ? `${agent.name} on its default model` : agent.models.find((each) => each.id === pick.model)?.name ?? `${agent.name} ${pick.model}`;
|
|
554
|
+
return pick.effort === undefined ? model : `${model}, ${pick.effort} effort`;
|
|
555
|
+
}
|
|
556
|
+
function pressed(limits, now) {
|
|
557
|
+
return limits.filter((each) => !(Date.parse(each.resets) <= now.getTime())).reduce((most, each) => most === undefined || each.used > most.used ? { used: each.used, window: each.window } : most, undefined);
|
|
558
|
+
}
|
|
559
|
+
function fastest(limits, now, slack) {
|
|
560
|
+
return limits.flatMap((each) => {
|
|
561
|
+
const length = lengthOf(each.window);
|
|
562
|
+
const resets = Date.parse(each.resets);
|
|
563
|
+
if (length === null || !(resets > now.getTime())) {
|
|
564
|
+
return [];
|
|
565
|
+
}
|
|
566
|
+
const read = each.at === null ? now.getTime() : Date.parse(each.at);
|
|
567
|
+
const elapsed = Math.min(1, Math.max(0, 1 - (resets - read) / length));
|
|
568
|
+
return each.used > elapsed + slack ? [{ window: each.window, used: each.used, elapsed }] : [];
|
|
569
|
+
}).reduce((most, each) => most === undefined || each.used - each.elapsed > most.used - most.elapsed ? each : most, undefined);
|
|
570
|
+
}
|
|
571
|
+
var COUNTS = {
|
|
572
|
+
one: 1,
|
|
573
|
+
two: 2,
|
|
574
|
+
three: 3,
|
|
575
|
+
four: 4,
|
|
576
|
+
five: 5,
|
|
577
|
+
six: 6,
|
|
578
|
+
seven: 7,
|
|
579
|
+
eight: 8,
|
|
580
|
+
nine: 9,
|
|
581
|
+
ten: 10,
|
|
582
|
+
twelve: 12,
|
|
583
|
+
thirty: 30
|
|
584
|
+
};
|
|
585
|
+
var UNITS = {
|
|
586
|
+
minute: 60000,
|
|
587
|
+
hour: 3600000,
|
|
588
|
+
day: 86400000,
|
|
589
|
+
week: 604800000
|
|
590
|
+
};
|
|
591
|
+
function lengthOf(window) {
|
|
592
|
+
const [count, unit] = window.toLowerCase().split("_");
|
|
593
|
+
const times = /^\d+$/.test(count ?? "") ? Number(count) : COUNTS[count ?? ""];
|
|
594
|
+
const each = UNITS[unit?.replace(/s$/, "") ?? ""];
|
|
595
|
+
return times === undefined || each === undefined || times === 0 ? null : times * each;
|
|
596
|
+
}
|
|
597
|
+
function ahead(pace) {
|
|
598
|
+
return pace === undefined ? "within its pace" : `${Math.round(pace.used * 100)}% of ${pace.window} used, ${Math.round(pace.elapsed * 100)}% of it gone`;
|
|
599
|
+
}
|
|
600
|
+
function plan(most) {
|
|
601
|
+
return most === undefined ? "no plan limits" : `${Math.round(most.used * 100)}% of ${most.window} used`;
|
|
602
|
+
}
|
|
603
|
+
// auto-pick/defaults.ts
|
|
604
|
+
var DEFAULT_RULES = {
|
|
605
|
+
format: RULES_FORMAT,
|
|
606
|
+
threshold: 0.5,
|
|
607
|
+
rules: [
|
|
608
|
+
shallow(),
|
|
609
|
+
designModerate("design"),
|
|
610
|
+
designModerate("open"),
|
|
611
|
+
moderate(),
|
|
612
|
+
deepBugfix(),
|
|
613
|
+
designDeep("design"),
|
|
614
|
+
designDeep("open"),
|
|
615
|
+
deep(),
|
|
616
|
+
fallback()
|
|
617
|
+
],
|
|
618
|
+
pace: DEFAULT_PACE
|
|
619
|
+
};
|
|
620
|
+
function shallow() {
|
|
621
|
+
return {
|
|
622
|
+
kind: ANY,
|
|
623
|
+
depth: "shallow",
|
|
624
|
+
picks: [
|
|
625
|
+
{ agent: "claude", model: "sonnet", effort: "low" },
|
|
626
|
+
{ agent: "codex", model: "gpt-6.1-sol", effort: "low" },
|
|
627
|
+
{ agent: "claude", model: "haiku", effort: "low" }
|
|
628
|
+
]
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
function designModerate(kind) {
|
|
632
|
+
return {
|
|
633
|
+
kind,
|
|
634
|
+
depth: "moderate",
|
|
635
|
+
picks: [
|
|
636
|
+
{ agent: "claude", model: "sonnet", effort: "high" },
|
|
637
|
+
{ agent: "claude", model: "opus", effort: "medium" },
|
|
638
|
+
{ agent: "codex", model: "gpt-6.1-sol", effort: "medium" }
|
|
639
|
+
]
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
function moderate() {
|
|
643
|
+
return {
|
|
644
|
+
kind: ANY,
|
|
645
|
+
depth: "moderate",
|
|
646
|
+
picks: [
|
|
647
|
+
{ agent: "claude", model: "sonnet", effort: "medium" },
|
|
648
|
+
{ agent: "codex", model: "gpt-6.1-sol", effort: "medium" },
|
|
649
|
+
{ agent: "claude", model: "opus", effort: "medium" }
|
|
650
|
+
]
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
function deepBugfix() {
|
|
654
|
+
return {
|
|
655
|
+
kind: "bugfix",
|
|
656
|
+
depth: "deep",
|
|
657
|
+
picks: [
|
|
658
|
+
{ agent: "claude", model: "opus", effort: "high" },
|
|
659
|
+
{ agent: "kimi", model: "kimi-code/k3.1-pro", effort: "max" },
|
|
660
|
+
{ agent: "codex", model: "gpt-6-astra", effort: "high" }
|
|
661
|
+
]
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
function designDeep(kind) {
|
|
665
|
+
return {
|
|
666
|
+
kind,
|
|
667
|
+
depth: "deep",
|
|
668
|
+
picks: [
|
|
669
|
+
{ agent: "claude", model: "opus", effort: "high" },
|
|
670
|
+
{ agent: "kimi", model: "kimi-code/k3.1-pro", effort: "high" },
|
|
671
|
+
{ agent: "codex", model: "gpt-6-astra", effort: "high" }
|
|
672
|
+
]
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
function deep() {
|
|
676
|
+
return {
|
|
677
|
+
kind: ANY,
|
|
678
|
+
depth: "deep",
|
|
679
|
+
picks: [
|
|
680
|
+
{ agent: "kimi", model: "kimi-code/k3.1-pro", effort: "max" },
|
|
681
|
+
{ agent: "claude", model: "opus", effort: "high" },
|
|
682
|
+
{ agent: "codex", model: "gpt-6-astra", effort: "high" }
|
|
683
|
+
]
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
function fallback() {
|
|
687
|
+
return {
|
|
688
|
+
kind: ANY,
|
|
689
|
+
depth: ANY,
|
|
690
|
+
picks: [
|
|
691
|
+
{ agent: "claude", model: "sonnet", effort: "medium" },
|
|
692
|
+
{ agent: "claude", model: "opus", effort: "medium" },
|
|
693
|
+
{ agent: "codex", model: "gpt-6.1-sol", effort: "medium" }
|
|
694
|
+
]
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
// auto-pick/key.ts
|
|
698
|
+
function classificationKey(subject, detail, attachments = []) {
|
|
699
|
+
return Bun.hash(JSON.stringify([
|
|
700
|
+
3,
|
|
701
|
+
subject,
|
|
702
|
+
detail.slice(0, DETAIL_CHARS),
|
|
703
|
+
namedPaths(`${subject}
|
|
704
|
+
${detail}`),
|
|
705
|
+
attachments
|
|
706
|
+
])).toString(36);
|
|
707
|
+
}
|
|
708
|
+
// auto-pick/follow-up.ts
|
|
709
|
+
function wordsToJudge(messages) {
|
|
710
|
+
const person = messages.filter((each) => each.role === "user" && each.told === undefined).map(textOf2).filter((each) => !each.startsWith("[SPLATES"));
|
|
711
|
+
return person.length < 2 ? null : split(person.join(`
|
|
712
|
+
|
|
713
|
+
`));
|
|
714
|
+
}
|
|
715
|
+
function wordsSoFar(messages) {
|
|
716
|
+
const person = messages.filter((each) => each.role === "user" && each.told === undefined).map(textOf2).filter((each) => !each.startsWith("[SPLATES"));
|
|
717
|
+
const words = person.join(`
|
|
718
|
+
|
|
719
|
+
`).trim();
|
|
720
|
+
return words === "" ? null : split(words);
|
|
721
|
+
}
|
|
722
|
+
function split(words) {
|
|
723
|
+
const [first = "", ...rest] = words.trim().split(`
|
|
724
|
+
`);
|
|
725
|
+
return {
|
|
726
|
+
subject: first.trim(),
|
|
727
|
+
detail: rest.join(`
|
|
728
|
+
`).trim().slice(-DETAIL_CHARS)
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
function askedBack(messages, said) {
|
|
732
|
+
const prompts = messages.flatMap((each, at) => each.role === "user" ? [at] : []);
|
|
733
|
+
const [first, answer] = prompts;
|
|
734
|
+
const reply = answer === undefined ? undefined : messages[answer];
|
|
735
|
+
if (first === undefined || reply === undefined || reply.told !== undefined || !said.includes(reply)) {
|
|
736
|
+
return false;
|
|
737
|
+
}
|
|
738
|
+
return messages.slice(first, answer).filter((each) => each.role === "agent").map(textOf2).join("").trim().endsWith("?");
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// auto-pick/judged.ts
|
|
742
|
+
async function decideFor({
|
|
743
|
+
subject,
|
|
744
|
+
detail,
|
|
745
|
+
attachments,
|
|
746
|
+
cached,
|
|
747
|
+
judge,
|
|
748
|
+
who,
|
|
749
|
+
context
|
|
750
|
+
}) {
|
|
751
|
+
if (cached !== null) {
|
|
752
|
+
return {
|
|
753
|
+
decision: decide({ ...context, classification: cached }),
|
|
754
|
+
classification: cached,
|
|
755
|
+
judged: true
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
const asked = await judge(who ?? {});
|
|
759
|
+
const classified = await classify({
|
|
760
|
+
subject,
|
|
761
|
+
detail,
|
|
762
|
+
attachments,
|
|
763
|
+
judge: asked
|
|
764
|
+
});
|
|
765
|
+
return classified.ok ? {
|
|
766
|
+
decision: decide({
|
|
767
|
+
...context,
|
|
768
|
+
classification: classified.classification
|
|
769
|
+
}),
|
|
770
|
+
classification: classified.classification,
|
|
771
|
+
judged: true
|
|
772
|
+
} : {
|
|
773
|
+
decision: decideWithout({ ...context, reason: classified.reason }),
|
|
774
|
+
classification: null,
|
|
775
|
+
judged: asked !== null
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
function cachedFor(record, key) {
|
|
779
|
+
const kept = record.autoPick?.classified;
|
|
780
|
+
return kept?.key === key ? kept.classification : null;
|
|
781
|
+
}
|
|
782
|
+
function autoPicked({ decision, classification }, key, at) {
|
|
783
|
+
return {
|
|
784
|
+
...decision,
|
|
785
|
+
at: at.toISOString(),
|
|
786
|
+
...classification === null ? {} : { classified: { key, classification } }
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
// auto-pick/rank.ts
|
|
791
|
+
function higher(agents, from, to) {
|
|
792
|
+
if (to.agent !== from.agent) {
|
|
793
|
+
return false;
|
|
794
|
+
}
|
|
795
|
+
if ((to.model ?? null) !== from.model) {
|
|
796
|
+
const was = traitsOf2(agents, pickOf(from))?.tier;
|
|
797
|
+
const now = traitsOf2(agents, to)?.tier;
|
|
798
|
+
return was !== undefined && now !== undefined && now > was;
|
|
799
|
+
}
|
|
800
|
+
return rank(from.effort) < rank(to.effort ?? null);
|
|
801
|
+
}
|
|
802
|
+
var EFFORTS = ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
803
|
+
function rank(effort) {
|
|
804
|
+
return effort === null ? -1 : EFFORTS.indexOf(effort.toLowerCase());
|
|
805
|
+
}
|
|
806
|
+
function pickOf(set) {
|
|
807
|
+
return {
|
|
808
|
+
agent: set.agent,
|
|
809
|
+
...set.model === null ? {} : { model: set.model },
|
|
810
|
+
...set.effort === null ? {} : { effort: set.effort }
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// auto-pick/store.ts
|
|
815
|
+
class AutoPickStore {
|
|
816
|
+
path;
|
|
817
|
+
deps;
|
|
818
|
+
constructor(path, deps) {
|
|
819
|
+
this.path = path;
|
|
820
|
+
this.deps = deps;
|
|
821
|
+
}
|
|
822
|
+
async rules() {
|
|
823
|
+
const raw = await this.deps.fs.read(this.path).catch(() => null);
|
|
824
|
+
if (raw === null) {
|
|
825
|
+
return DEFAULT_RULES;
|
|
826
|
+
}
|
|
827
|
+
let json;
|
|
828
|
+
try {
|
|
829
|
+
json = JSON.parse(raw);
|
|
830
|
+
} catch {
|
|
831
|
+
fail2("usage", `${this.path} is not JSON: fix or delete it`, {
|
|
832
|
+
path: this.path
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
const format = json?.format;
|
|
836
|
+
if (typeof format === "number" && format > RULES_FORMAT) {
|
|
837
|
+
fail2("outdated", [
|
|
838
|
+
`${this.path} is in format ${format}, written by a newer splates; this one understands up to ${RULES_FORMAT}, so it leaves it alone.`,
|
|
839
|
+
"Run `bunx @stringsync/splates@latest` instead."
|
|
840
|
+
].join(`
|
|
841
|
+
`), { path: this.path, format, understood: RULES_FORMAT });
|
|
842
|
+
}
|
|
843
|
+
const checked = checkRules(json);
|
|
844
|
+
if (!checked.ok) {
|
|
845
|
+
fail2("usage", `${this.path} is not Auto pick rules: ${checked.problem}. Fix it, or delete it for the defaults`, { path: this.path });
|
|
846
|
+
}
|
|
847
|
+
return checked.rules;
|
|
848
|
+
}
|
|
849
|
+
async save(rules) {
|
|
850
|
+
const checked = checkRules(rules);
|
|
851
|
+
if (!checked.ok) {
|
|
852
|
+
fail2("usage", `not Auto pick rules: ${checked.problem}`, {
|
|
853
|
+
path: this.path
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
await this.write(checked.rules);
|
|
857
|
+
}
|
|
858
|
+
async reset() {
|
|
859
|
+
await this.write(DEFAULT_RULES);
|
|
860
|
+
return DEFAULT_RULES;
|
|
861
|
+
}
|
|
862
|
+
async remove() {
|
|
863
|
+
await this.deps.fs.rm(this.path, { force: true });
|
|
864
|
+
}
|
|
865
|
+
async write(rules) {
|
|
866
|
+
await this.deps.fs.mkdir(this.path.slice(0, this.path.lastIndexOf("/")), {
|
|
867
|
+
recursive: true
|
|
868
|
+
});
|
|
869
|
+
const tmp = `${this.path}.${crypto.randomUUID()}.tmp`;
|
|
870
|
+
await this.deps.fs.write(tmp, `${JSON.stringify(rules, null, "\t")}
|
|
871
|
+
`);
|
|
872
|
+
await this.deps.fs.rename(tmp, this.path);
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
// auto-pick/start.ts
|
|
877
|
+
var JUDGE_KEY = JUDGE_CREDS.jev[0];
|
|
878
|
+
var PURPOSE = "Auto pick asks TypeSafe's Jev what kind of work a task is and how deeply it needs to reason, to start it on the agent, model and thinking level your Auto pick rules give that; without a key every Auto pick takes the rule for any kind and depth.";
|
|
879
|
+
var INSTRUCTIONS = `1. Open [TypeSafe](https://typesafe.ai) and sign in.
|
|
880
|
+
2. Create an API key.
|
|
881
|
+
3. Paste it here.`;
|
|
882
|
+
async function startAutoPick({
|
|
883
|
+
project,
|
|
884
|
+
conversations,
|
|
885
|
+
target,
|
|
886
|
+
start,
|
|
887
|
+
slug = async () => null,
|
|
888
|
+
judge = (who) => projectJudge(project, slug, who),
|
|
889
|
+
now = () => new Date
|
|
890
|
+
}) {
|
|
891
|
+
const record = "words" in target ? null : await recordOf(project, target);
|
|
892
|
+
const { subject, detail } = record === null ? wordsOfMessage("words" in target ? target.words : "") : await wordsOf(project, record);
|
|
893
|
+
const attachments = "words" in target ? target.attachments ?? [] : (record?.files ?? []).map((name) => ({
|
|
894
|
+
name,
|
|
895
|
+
mimeType: Bun.file(name).type
|
|
896
|
+
}));
|
|
897
|
+
const key = classificationKey(subject, detail, attachments);
|
|
898
|
+
const context = await contextOf(project, conversations, now(), attachments);
|
|
899
|
+
const { offered } = context;
|
|
900
|
+
const cached = record === null ? null : cachedFor(record, key);
|
|
901
|
+
const fallback = cached === null ? decideWithout({ ...context, reason: "the judge has yet to answer" }) : decide({ ...context, classification: cached });
|
|
902
|
+
const deciding = decideFor({
|
|
903
|
+
subject,
|
|
904
|
+
detail,
|
|
905
|
+
attachments,
|
|
906
|
+
cached,
|
|
907
|
+
judge,
|
|
908
|
+
who: "words" in target ? {} : { task: "task" in target ? target.task : `#${target.todo}` },
|
|
909
|
+
context
|
|
910
|
+
});
|
|
911
|
+
const opened = ({ pick }) => ({
|
|
912
|
+
agent: pick.agent,
|
|
913
|
+
...pick.model === undefined ? {} : { model: pick.model },
|
|
914
|
+
settings: pickSettings2(pick.effort, offered[pick.agent] ?? [])
|
|
915
|
+
});
|
|
916
|
+
const starting = opened(fallback);
|
|
917
|
+
const conversation = start(starting.agent, {
|
|
918
|
+
...starting,
|
|
919
|
+
picking: deciding.then(async (judged) => {
|
|
920
|
+
const picked = autoPicked(judged, key, now());
|
|
921
|
+
await (record === null ? announce(project, conversation, picked, judged.judged) : settle(project, record.id, picked, {
|
|
922
|
+
conversation,
|
|
923
|
+
judged: judged.judged
|
|
924
|
+
}));
|
|
925
|
+
return opened(judged.decision);
|
|
926
|
+
}, (error) => {
|
|
927
|
+
project.log.error(`Auto pick could not decide: ${String(error)}`);
|
|
928
|
+
return starting;
|
|
929
|
+
})
|
|
930
|
+
});
|
|
931
|
+
return conversation;
|
|
932
|
+
}
|
|
933
|
+
async function contextOf(project, conversations, now, attachments = []) {
|
|
934
|
+
const home = splatesHome2(project.ps);
|
|
935
|
+
const images = attachments.some((each) => each.mimeType.startsWith("image/"));
|
|
936
|
+
return {
|
|
937
|
+
images,
|
|
938
|
+
catalog: images ? await new Prices(new FsStorage2(home, project.fs)).catalog() : null,
|
|
939
|
+
sights: await conversations.sights(),
|
|
940
|
+
rules: await new AutoPickStore(`${home}/auto-pick.json`, {
|
|
941
|
+
fs: project.fs
|
|
942
|
+
}).rules(),
|
|
943
|
+
agents: await Roster2.in(new FsStorage2(home, project.fs)).agents(),
|
|
944
|
+
runnable: conversations.agents.map((each) => each.id),
|
|
945
|
+
limits: await conversations.limits(),
|
|
946
|
+
offered: await conversations.settings(),
|
|
947
|
+
now
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
async function recordOf(project, target) {
|
|
951
|
+
const { store } = project.tasks;
|
|
952
|
+
const record = "todo" in target ? await store.read(target.todo) : await store.find(target.task);
|
|
953
|
+
if (record === null) {
|
|
954
|
+
const named = "todo" in target ? `#${target.todo}` : `'${target.task}'`;
|
|
955
|
+
fail2("not_found", `no task ${named}: run \`splates task list\` to see what there is`, target);
|
|
956
|
+
}
|
|
957
|
+
return record;
|
|
958
|
+
}
|
|
959
|
+
async function wordsOf(project, record) {
|
|
960
|
+
if (record.text !== "" || record.task === undefined) {
|
|
961
|
+
return { subject: record.subject, detail: record.text };
|
|
962
|
+
}
|
|
963
|
+
const worktree = await project.service.find(record.task);
|
|
964
|
+
const plan = worktree.exists ? await new Plans2(project.fs).read(worktree.path) : null;
|
|
965
|
+
return { subject: record.subject, detail: goalOf2(plan ?? "") };
|
|
966
|
+
}
|
|
967
|
+
function wordsOfMessage(message) {
|
|
968
|
+
const [first = "", ...rest] = message.trim().split(`
|
|
969
|
+
`);
|
|
970
|
+
return { subject: first.trim(), detail: rest.join(`
|
|
971
|
+
`).trim() };
|
|
972
|
+
}
|
|
973
|
+
async function settle(project, id, picked, {
|
|
974
|
+
conversation,
|
|
975
|
+
judged
|
|
976
|
+
}) {
|
|
977
|
+
await keep(project, id, picked).catch((error) => project.log.error(`Auto pick could not keep its decision on task ${id}: ${String(error)}`));
|
|
978
|
+
if (conversation !== null) {
|
|
979
|
+
await announce(project, conversation, picked, judged);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
async function announce(project, conversation, picked, judged) {
|
|
983
|
+
await conversation.then((started) => logPick(project, started, picked, judged ? null : JUDGE_KEY)).catch((error) => project.log.error(String(error)));
|
|
984
|
+
}
|
|
985
|
+
async function keep(project, id, picked) {
|
|
986
|
+
const { store } = project.tasks;
|
|
987
|
+
await store.locked(async () => {
|
|
988
|
+
const record = await store.read(id);
|
|
989
|
+
if (record !== null) {
|
|
990
|
+
await store.write({ ...record, autoPick: picked });
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
async function logPick(project, conversation, picked, asking) {
|
|
995
|
+
conversation.autoPicked(setOf(picked));
|
|
996
|
+
const journal = project.journal.in(conversation.id);
|
|
997
|
+
await journalPick(journal, conversation.state.task, picked);
|
|
998
|
+
if (asking !== null) {
|
|
999
|
+
await offerJudge(project, journal, conversation.state.task, asking);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
function setOf({
|
|
1003
|
+
pick,
|
|
1004
|
+
rule,
|
|
1005
|
+
kind,
|
|
1006
|
+
depth,
|
|
1007
|
+
clarity
|
|
1008
|
+
}) {
|
|
1009
|
+
return {
|
|
1010
|
+
rule,
|
|
1011
|
+
kind,
|
|
1012
|
+
depth,
|
|
1013
|
+
...clarity === undefined ? {} : { clarity },
|
|
1014
|
+
agent: pick.agent,
|
|
1015
|
+
model: pick.model ?? null,
|
|
1016
|
+
effort: pick.effort ?? null
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
async function journalPick(journal, task, picked, lifted) {
|
|
1020
|
+
const classification = picked.classified?.classification;
|
|
1021
|
+
await journal.record("auto", task, async () => {}, {
|
|
1022
|
+
agent: picked.pick.agent,
|
|
1023
|
+
model: picked.pick.model ?? null,
|
|
1024
|
+
effort: picked.pick.effort ?? null,
|
|
1025
|
+
reasons: picked.reasons,
|
|
1026
|
+
signs: classification === undefined ? null : [
|
|
1027
|
+
likeliest2(KINDS, classification.kinds),
|
|
1028
|
+
likeliest2(DEPTHS, classification.depth)
|
|
1029
|
+
],
|
|
1030
|
+
lifted: lifted ?? null
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
function likeliest2(classes, answers) {
|
|
1034
|
+
const best = classes.reduce((most, each) => answers[each.id] > answers[most.id] ? each : most);
|
|
1035
|
+
return `${best.label} ${Math.round(answers[best.id] * 100)}%`;
|
|
1036
|
+
}
|
|
1037
|
+
async function offerJudge(project, journal, task, name) {
|
|
1038
|
+
const asked = (await project.creds.requests()).some((each) => each.name === name);
|
|
1039
|
+
if (asked) {
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
await journal.record("creds request", task, () => project.creds.request(name, {
|
|
1043
|
+
scope: "device",
|
|
1044
|
+
purpose: PURPOSE,
|
|
1045
|
+
instructions: INSTRUCTIONS,
|
|
1046
|
+
task
|
|
1047
|
+
}), (request) => ({ name, asked: request !== null }));
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
// auto-pick/lift.ts
|
|
1051
|
+
function lifting(project, conversations, {
|
|
1052
|
+
slug = async () => null,
|
|
1053
|
+
judge = (who) => projectJudge(project, slug, who),
|
|
1054
|
+
now = () => new Date
|
|
1055
|
+
} = {}) {
|
|
1056
|
+
return async (conversation, said) => {
|
|
1057
|
+
const { state } = conversation;
|
|
1058
|
+
const on = state.autoPick;
|
|
1059
|
+
if (on === null || on.overridden || on.agent !== state.agent) {
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
if (on.rejudge) {
|
|
1063
|
+
await rejudging(conversation, {
|
|
1064
|
+
project,
|
|
1065
|
+
conversations,
|
|
1066
|
+
judge,
|
|
1067
|
+
now: now()
|
|
1068
|
+
});
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
const words = wordsToJudge(state.messages);
|
|
1072
|
+
const asked = askedBack(state.messages, said);
|
|
1073
|
+
if (words === null && !asked) {
|
|
1074
|
+
return;
|
|
1075
|
+
}
|
|
1076
|
+
const context = await contextOf(project, conversations, now());
|
|
1077
|
+
const judged = await rejudged(words, context, judge, {
|
|
1078
|
+
task: state.task,
|
|
1079
|
+
conversation: state.id
|
|
1080
|
+
});
|
|
1081
|
+
const decision = judged !== null && higher(context.agents, on, judged.decision.pick) ? judged.decision : asked ? decideDeeper(context, on, ASKED_BACK) : null;
|
|
1082
|
+
const agent = context.agents.find((each) => each.id === on.agent);
|
|
1083
|
+
if (decision === null || agent === undefined || !higher(context.agents, on, decision.pick)) {
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
const settings = settingsFor(state.settings, decision.pick);
|
|
1087
|
+
if (Object.keys(settings).length === 0) {
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1090
|
+
const undo = Object.fromEntries(Object.keys(settings).flatMap((id) => {
|
|
1091
|
+
const current = state.settings.find((each) => each.id === id)?.current;
|
|
1092
|
+
return current === undefined ? [] : [[id, current]];
|
|
1093
|
+
}));
|
|
1094
|
+
await conversation.lift(settings, setOf(decision));
|
|
1095
|
+
await journalPick(project.journal.in(state.id), state.task, autoPicked({
|
|
1096
|
+
decision,
|
|
1097
|
+
classification: decision === judged?.decision ? judged.classification : null,
|
|
1098
|
+
judged: true
|
|
1099
|
+
}, judged?.key ?? "", now()), { from: headline(pickOf(on), agent), undo }).catch((error) => project.log.error(String(error)));
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
async function rejudging(conversation, {
|
|
1103
|
+
project,
|
|
1104
|
+
conversations,
|
|
1105
|
+
judge,
|
|
1106
|
+
now
|
|
1107
|
+
}) {
|
|
1108
|
+
const { state } = conversation;
|
|
1109
|
+
const words = wordsSoFar(state.messages);
|
|
1110
|
+
const context = await contextOf(project, conversations, now);
|
|
1111
|
+
const judged = await rejudged(words, { ...context, runnable: [state.agent] }, judge, { task: state.task, conversation: state.id });
|
|
1112
|
+
if (judged === null || judged.decision.pick.agent !== state.agent) {
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
const { decision } = judged;
|
|
1116
|
+
const settings = settingsFor(state.settings, decision.pick);
|
|
1117
|
+
const undo = Object.fromEntries(Object.keys(settings).flatMap((id) => {
|
|
1118
|
+
const current = state.settings.find((each) => each.id === id)?.current;
|
|
1119
|
+
return current === undefined ? [] : [[id, current]];
|
|
1120
|
+
}));
|
|
1121
|
+
const from = heldOn(state.settings);
|
|
1122
|
+
await conversation.lift(settings, setOf(decision));
|
|
1123
|
+
await journalPick(project.journal.in(state.id), state.task, autoPicked({ decision, classification: judged.classification, judged: true }, judged.key, now), Object.keys(settings).length === 0 ? undefined : { from, undo, switched: true }).catch((error) => project.log.error(String(error)));
|
|
1124
|
+
}
|
|
1125
|
+
function heldOn(settings) {
|
|
1126
|
+
const named = (setting) => setting?.options.find((each) => each.value === setting.current)?.name ?? setting?.current ?? null;
|
|
1127
|
+
const model = named(settings.find((each) => each.category === "model" || each.id === "model"));
|
|
1128
|
+
const effort = named(settings.find((each) => each.category === "thought_level"));
|
|
1129
|
+
const said = model ?? "its default model";
|
|
1130
|
+
return effort === null ? said : `${said}, ${effort.toLowerCase()} effort`;
|
|
1131
|
+
}
|
|
1132
|
+
var ASKED_BACK = "its first answer asked back";
|
|
1133
|
+
async function rejudged(words, context, judge, who) {
|
|
1134
|
+
if (words === null) {
|
|
1135
|
+
return null;
|
|
1136
|
+
}
|
|
1137
|
+
const classified = await classify({ ...words, judge: await judge(who) });
|
|
1138
|
+
if (!classified.ok) {
|
|
1139
|
+
return null;
|
|
1140
|
+
}
|
|
1141
|
+
return {
|
|
1142
|
+
decision: decide({
|
|
1143
|
+
...context,
|
|
1144
|
+
classification: classified.classification
|
|
1145
|
+
}),
|
|
1146
|
+
classification: classified.classification,
|
|
1147
|
+
key: classificationKey(words.subject, words.detail, [])
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
function settingsFor(settings, pick) {
|
|
1151
|
+
const model = pick.model === undefined ? null : modelOption2(settings, pick.model);
|
|
1152
|
+
const effort = effortSettings2(pick.effort, settings);
|
|
1153
|
+
const levels = thinkingOf2(settings).map((each) => each.value);
|
|
1154
|
+
const wanted = {
|
|
1155
|
+
...model === null ? {} : { [model.setting]: model.value },
|
|
1156
|
+
...Object.fromEntries(Object.entries(effort).filter(([, value]) => levels.includes(value)))
|
|
1157
|
+
};
|
|
1158
|
+
return Object.fromEntries(Object.entries(wanted).filter(([id, value]) => settings.find((each) => each.id === id)?.current !== value));
|
|
1159
|
+
}
|
|
1160
|
+
// auto-pick/queue.ts
|
|
1161
|
+
class QueueAutoPick {
|
|
1162
|
+
#project;
|
|
1163
|
+
#conversations;
|
|
1164
|
+
#judge;
|
|
1165
|
+
#now;
|
|
1166
|
+
#judging = new Map;
|
|
1167
|
+
#tried = new Map;
|
|
1168
|
+
constructor(project, conversations, {
|
|
1169
|
+
slug = async () => null,
|
|
1170
|
+
judge = (who) => projectJudge(project, slug, who),
|
|
1171
|
+
now = () => new Date
|
|
1172
|
+
} = {}) {
|
|
1173
|
+
this.#project = project;
|
|
1174
|
+
this.#conversations = conversations;
|
|
1175
|
+
this.#judge = judge;
|
|
1176
|
+
this.#now = now;
|
|
1177
|
+
}
|
|
1178
|
+
async ahead(queued) {
|
|
1179
|
+
for (const each of queued) {
|
|
1180
|
+
const { subject, detail } = await wordsOf(this.#project, each);
|
|
1181
|
+
const attachments = each.files.map((name) => ({
|
|
1182
|
+
name,
|
|
1183
|
+
mimeType: Bun.file(name).type
|
|
1184
|
+
}));
|
|
1185
|
+
const key = classificationKey(subject, detail, attachments);
|
|
1186
|
+
if (cachedFor(each, key) !== null || this.#tried.get(each.id) === key) {
|
|
1187
|
+
continue;
|
|
1188
|
+
}
|
|
1189
|
+
this.#tried.set(each.id, key);
|
|
1190
|
+
const run = (this.#judging.get(each.id) ?? Promise.resolve()).then(() => this.#judgeAhead(each.id, { subject, detail, attachments, key }));
|
|
1191
|
+
this.#judging.set(each.id, run);
|
|
1192
|
+
run.finally(() => {
|
|
1193
|
+
if (this.#judging.get(each.id) === run) {
|
|
1194
|
+
this.#judging.delete(each.id);
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
judging(id) {
|
|
1200
|
+
return this.#judging.has(id);
|
|
1201
|
+
}
|
|
1202
|
+
async settled() {
|
|
1203
|
+
while (this.#judging.size > 0) {
|
|
1204
|
+
await Promise.all(this.#judging.values());
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
async guess(queued) {
|
|
1208
|
+
const guessed = new Map;
|
|
1209
|
+
for (const each of queued) {
|
|
1210
|
+
const { subject, detail } = await wordsOf(this.#project, each);
|
|
1211
|
+
const attachments = each.files.map((name) => ({
|
|
1212
|
+
name,
|
|
1213
|
+
mimeType: Bun.file(name).type
|
|
1214
|
+
}));
|
|
1215
|
+
const context = await this.#context(attachments);
|
|
1216
|
+
const cached = cachedFor(each, classificationKey(subject, detail, attachments));
|
|
1217
|
+
try {
|
|
1218
|
+
const { pick } = cached === null ? decideWithout({ ...context, reason: "not judged yet" }) : decide({ ...context, classification: cached });
|
|
1219
|
+
guessed.set(each.id, pick);
|
|
1220
|
+
} catch {
|
|
1221
|
+
guessed.set(each.id, firstOf(context));
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
return guessed;
|
|
1225
|
+
}
|
|
1226
|
+
async decide(queued) {
|
|
1227
|
+
const judging = this.#judging.get(queued.id);
|
|
1228
|
+
if (judging !== undefined) {
|
|
1229
|
+
await judging;
|
|
1230
|
+
queued = await this.#project.tasks.store.read(queued.id) ?? queued;
|
|
1231
|
+
}
|
|
1232
|
+
const { subject, detail } = await wordsOf(this.#project, queued);
|
|
1233
|
+
const attachments = queued.files.map((name) => ({
|
|
1234
|
+
name,
|
|
1235
|
+
mimeType: Bun.file(name).type
|
|
1236
|
+
}));
|
|
1237
|
+
const context = await this.#context(attachments);
|
|
1238
|
+
const key = classificationKey(subject, detail, attachments);
|
|
1239
|
+
try {
|
|
1240
|
+
const judged = await decideFor({
|
|
1241
|
+
subject,
|
|
1242
|
+
detail,
|
|
1243
|
+
attachments,
|
|
1244
|
+
cached: cachedFor(queued, key),
|
|
1245
|
+
judge: this.#judge,
|
|
1246
|
+
who: { task: `#${queued.id}` },
|
|
1247
|
+
context
|
|
1248
|
+
});
|
|
1249
|
+
const picked = autoPicked(judged, key, this.#now());
|
|
1250
|
+
await settle(this.#project, queued.id, picked, {
|
|
1251
|
+
conversation: null,
|
|
1252
|
+
judged: judged.judged
|
|
1253
|
+
});
|
|
1254
|
+
return {
|
|
1255
|
+
pick: judged.decision.pick,
|
|
1256
|
+
tell: (id) => announce(this.#project, this.#conversations.find(id), picked, judged.judged)
|
|
1257
|
+
};
|
|
1258
|
+
} catch (error) {
|
|
1259
|
+
this.#project.log.error(`Auto pick could not decide for task ${queued.id}: ${String(error)}`);
|
|
1260
|
+
return { pick: firstOf(context), tell: async () => {} };
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
async#judgeAhead(id, {
|
|
1264
|
+
subject,
|
|
1265
|
+
detail,
|
|
1266
|
+
attachments,
|
|
1267
|
+
key
|
|
1268
|
+
}) {
|
|
1269
|
+
if (this.#tried.get(id) !== key) {
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
try {
|
|
1273
|
+
const judged = await decideFor({
|
|
1274
|
+
subject,
|
|
1275
|
+
detail,
|
|
1276
|
+
attachments,
|
|
1277
|
+
cached: null,
|
|
1278
|
+
judge: this.#judge,
|
|
1279
|
+
who: { task: `#${id}` },
|
|
1280
|
+
context: await this.#context(attachments)
|
|
1281
|
+
});
|
|
1282
|
+
await settle(this.#project, id, autoPicked(judged, key, this.#now()), {
|
|
1283
|
+
conversation: null,
|
|
1284
|
+
judged: judged.judged
|
|
1285
|
+
});
|
|
1286
|
+
} catch (error) {
|
|
1287
|
+
this.#project.log.error(`Auto pick could not judge task ${id} ahead: ${String(error)}`);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
async#context(attachments) {
|
|
1291
|
+
return contextOf(this.#project, this.#conversations, this.#now(), attachments);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
function firstOf(context) {
|
|
1295
|
+
return { agent: context.agents[0]?.id ?? "claude" };
|
|
1296
|
+
}
|
|
1297
|
+
// auto-pick/trial.ts
|
|
1298
|
+
async function tryAutoPick({
|
|
1299
|
+
project,
|
|
1300
|
+
conversations,
|
|
1301
|
+
target,
|
|
1302
|
+
slug = async () => null,
|
|
1303
|
+
judge = (who) => projectJudge(project, slug, who),
|
|
1304
|
+
now = () => new Date
|
|
1305
|
+
}) {
|
|
1306
|
+
const record = await recordOf(project, target);
|
|
1307
|
+
const { subject, detail } = await wordsOf(project, record);
|
|
1308
|
+
const attachments = record.files.map((name) => ({
|
|
1309
|
+
name,
|
|
1310
|
+
mimeType: Bun.file(name).type
|
|
1311
|
+
}));
|
|
1312
|
+
const context = await contextOf(project, conversations, now(), attachments);
|
|
1313
|
+
const kept = record.autoPick?.classified;
|
|
1314
|
+
if (kept?.key === classificationKey(subject, detail, attachments)) {
|
|
1315
|
+
return {
|
|
1316
|
+
subject,
|
|
1317
|
+
decision: decide({ ...context, classification: kept.classification }),
|
|
1318
|
+
classification: kept.classification,
|
|
1319
|
+
cached: true
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
const classified = await classify({
|
|
1323
|
+
subject,
|
|
1324
|
+
detail,
|
|
1325
|
+
attachments,
|
|
1326
|
+
judge: await judge({
|
|
1327
|
+
task: "task" in target ? target.task : `#${target.todo}`
|
|
1328
|
+
})
|
|
1329
|
+
});
|
|
1330
|
+
return classified.ok ? {
|
|
1331
|
+
subject,
|
|
1332
|
+
decision: decide({
|
|
1333
|
+
...context,
|
|
1334
|
+
classification: classified.classification
|
|
1335
|
+
}),
|
|
1336
|
+
classification: classified.classification,
|
|
1337
|
+
cached: false
|
|
1338
|
+
} : {
|
|
1339
|
+
subject,
|
|
1340
|
+
decision: decideWithout({ ...context, reason: classified.reason }),
|
|
1341
|
+
classification: null,
|
|
1342
|
+
cached: false
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
// auto-pick/routes.ts
|
|
1347
|
+
class AutoPickRoutes {
|
|
1348
|
+
#project;
|
|
1349
|
+
#conversations;
|
|
1350
|
+
#watch;
|
|
1351
|
+
#slug;
|
|
1352
|
+
constructor(project, conversations, watch, slug = async () => null) {
|
|
1353
|
+
this.#slug = slug;
|
|
1354
|
+
this.#project = project;
|
|
1355
|
+
this.#conversations = conversations;
|
|
1356
|
+
this.#watch = watch;
|
|
1357
|
+
}
|
|
1358
|
+
startAutoPick = async (request) => {
|
|
1359
|
+
const conversations = this.#conversations;
|
|
1360
|
+
if (conversations === null) {
|
|
1361
|
+
fail2("not_found", "conversations are off", {});
|
|
1362
|
+
}
|
|
1363
|
+
const { id, task, todo, words, attachments, ship } = await body(request);
|
|
1364
|
+
const target = typeof words === "string" ? { words, attachments: attachmentInfos(attachments) } : targetOf(task, todo);
|
|
1365
|
+
const [named, cwd, base, caller] = await treeOf2(this.#project.service, "words" in target ? task : ("task" in target) ? target.task : null);
|
|
1366
|
+
const conversation = await startAutoPick({
|
|
1367
|
+
project: this.#project,
|
|
1368
|
+
slug: this.#slug,
|
|
1369
|
+
conversations,
|
|
1370
|
+
target,
|
|
1371
|
+
start: (agent, { model, settings, picking }) => conversations.start(agent, {
|
|
1372
|
+
id: typeof id === "string" ? id : undefined,
|
|
1373
|
+
task: named,
|
|
1374
|
+
base,
|
|
1375
|
+
caller,
|
|
1376
|
+
cwd,
|
|
1377
|
+
model,
|
|
1378
|
+
settings,
|
|
1379
|
+
assigned: true,
|
|
1380
|
+
...typeof ship === "string" ? { ship } : {},
|
|
1381
|
+
picking: picking.finally(() => this.#watch.changed())
|
|
1382
|
+
})
|
|
1383
|
+
});
|
|
1384
|
+
return Response.json(conversation.state);
|
|
1385
|
+
};
|
|
1386
|
+
tryAutoPick = async (request) => {
|
|
1387
|
+
const conversations = this.#conversations;
|
|
1388
|
+
if (conversations === null) {
|
|
1389
|
+
fail2("not_found", "conversations are off", {});
|
|
1390
|
+
}
|
|
1391
|
+
const { task, todo } = await body(request);
|
|
1392
|
+
return Response.json(await tryAutoPick({
|
|
1393
|
+
project: this.#project,
|
|
1394
|
+
slug: this.#slug,
|
|
1395
|
+
conversations,
|
|
1396
|
+
target: targetOf(task, todo)
|
|
1397
|
+
}));
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
function targetOf(task, todo) {
|
|
1401
|
+
if (typeof task === "string" && task !== "") {
|
|
1402
|
+
return { task };
|
|
1403
|
+
}
|
|
1404
|
+
if (typeof todo === "number" && Number.isInteger(todo) && todo > 0) {
|
|
1405
|
+
return { todo };
|
|
1406
|
+
}
|
|
1407
|
+
fail2("usage", "name a task, by `task` or by `todo` number, to Auto pick", {});
|
|
1408
|
+
}
|
|
1409
|
+
function attachmentInfos(value) {
|
|
1410
|
+
if (value === undefined) {
|
|
1411
|
+
return [];
|
|
1412
|
+
}
|
|
1413
|
+
if (!Array.isArray(value) || value.some((file) => file === null || typeof file !== "object" || typeof file.name !== "string" || typeof file.mimeType !== "string")) {
|
|
1414
|
+
fail2("usage", "attachments must give each file's name and mimeType", {});
|
|
1415
|
+
}
|
|
1416
|
+
return value.map((file) => ({ name: file.name, mimeType: file.mimeType }));
|
|
1417
|
+
}
|
|
1418
|
+
// auto-pick/rules-routes.ts
|
|
1419
|
+
class AutoPickRulesRoutes {
|
|
1420
|
+
#fs;
|
|
1421
|
+
#home;
|
|
1422
|
+
constructor({ fs, home }) {
|
|
1423
|
+
this.#fs = fs;
|
|
1424
|
+
this.#home = home;
|
|
1425
|
+
}
|
|
1426
|
+
read = async () => Response.json(await this.#view());
|
|
1427
|
+
save = async (request) => {
|
|
1428
|
+
const { rules } = await body(request);
|
|
1429
|
+
await this.#store.save(rules);
|
|
1430
|
+
return Response.json(await this.#view());
|
|
1431
|
+
};
|
|
1432
|
+
reset = async () => {
|
|
1433
|
+
await this.#store.reset();
|
|
1434
|
+
return Response.json(await this.#view());
|
|
1435
|
+
};
|
|
1436
|
+
get #store() {
|
|
1437
|
+
return new AutoPickStore(`${this.#home}/auto-pick.json`, { fs: this.#fs });
|
|
1438
|
+
}
|
|
1439
|
+
async#view() {
|
|
1440
|
+
let rules = DEFAULT_RULES;
|
|
1441
|
+
let problem = null;
|
|
1442
|
+
try {
|
|
1443
|
+
rules = await this.#store.rules();
|
|
1444
|
+
} catch (error) {
|
|
1445
|
+
if (!(error instanceof Exit2)) {
|
|
1446
|
+
throw error;
|
|
1447
|
+
}
|
|
1448
|
+
problem = error.message;
|
|
1449
|
+
}
|
|
1450
|
+
return {
|
|
1451
|
+
rules,
|
|
1452
|
+
problem,
|
|
1453
|
+
agents: await pickableAgents(this.#fs, this.#home)
|
|
1454
|
+
};
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
async function pickableAgents(fs, home) {
|
|
1458
|
+
const machine = new FsStorage2(home, fs);
|
|
1459
|
+
const offered = await new Offered2(machine.document("offered.json")).all();
|
|
1460
|
+
const roster = await Roster2.in(machine).agents();
|
|
1461
|
+
return roster.map((agent) => ({
|
|
1462
|
+
id: agent.id,
|
|
1463
|
+
name: agent.name,
|
|
1464
|
+
models: agent.models.map(({ id, name }) => ({ id, name })),
|
|
1465
|
+
efforts: offered[agent.id] === undefined ? null : effortsOf2(offered[agent.id] ?? [])
|
|
1466
|
+
}));
|
|
1467
|
+
}
|
|
1468
|
+
export { JUDGE_CREDS, judgeFrom, AutoPickStore, lifting, QueueAutoPick, AutoPickRoutes, AutoPickRulesRoutes, pickableAgents };
|