@nanonets/graft 0.24.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -21
- package/dist/blast/render.js +1 -1
- package/dist/blast/render.js.map +1 -1
- package/dist/brand.js +1 -1
- package/dist/brand.js.map +1 -1
- package/dist/check/learning-edits.d.ts +18 -3
- package/dist/check/learning-edits.d.ts.map +1 -1
- package/dist/check/learning-edits.js +54 -10
- package/dist/check/learning-edits.js.map +1 -1
- package/dist/check/local-check.d.ts +7 -3
- package/dist/check/local-check.d.ts.map +1 -1
- package/dist/check/local-check.js +55 -11
- package/dist/check/local-check.js.map +1 -1
- package/dist/check/types.d.ts +11 -2
- package/dist/check/types.d.ts.map +1 -1
- package/dist/claude/format.d.ts +11 -7
- package/dist/claude/format.d.ts.map +1 -1
- package/dist/claude/format.js +50 -28
- package/dist/claude/format.js.map +1 -1
- package/dist/claude/hook-io.js +1 -1
- package/dist/claude/hook-io.js.map +1 -1
- package/dist/claude/hook-layers.d.ts +4 -2
- package/dist/claude/hook-layers.d.ts.map +1 -1
- package/dist/claude/hook-layers.js +21 -4
- package/dist/claude/hook-layers.js.map +1 -1
- package/dist/claude/hooks.d.ts +9 -32
- package/dist/claude/hooks.d.ts.map +1 -1
- package/dist/claude/hooks.js +154 -350
- package/dist/claude/hooks.js.map +1 -1
- package/dist/claude/init.d.ts.map +1 -1
- package/dist/claude/init.js +56 -18
- package/dist/claude/init.js.map +1 -1
- package/dist/claude/note-signals.d.ts +6 -0
- package/dist/claude/note-signals.d.ts.map +1 -1
- package/dist/claude/note-signals.js +14 -3
- package/dist/claude/note-signals.js.map +1 -1
- package/dist/claude/post-bash.d.ts +26 -0
- package/dist/claude/post-bash.d.ts.map +1 -0
- package/dist/claude/post-bash.js +191 -0
- package/dist/claude/post-bash.js.map +1 -0
- package/dist/claude/pre-bash-skills.d.ts +21 -0
- package/dist/claude/pre-bash-skills.d.ts.map +1 -0
- package/dist/claude/pre-bash-skills.js +253 -0
- package/dist/claude/pre-bash-skills.js.map +1 -0
- package/dist/claude/pre-bash.d.ts +50 -0
- package/dist/claude/pre-bash.d.ts.map +1 -0
- package/dist/claude/pre-bash.js +245 -0
- package/dist/claude/pre-bash.js.map +1 -0
- package/dist/claude/prompt-consent.d.ts +19 -0
- package/dist/claude/prompt-consent.d.ts.map +1 -0
- package/dist/claude/prompt-consent.js +14 -0
- package/dist/claude/prompt-consent.js.map +1 -0
- package/dist/claude/prompt-hook.d.ts +76 -0
- package/dist/claude/prompt-hook.d.ts.map +1 -0
- package/dist/claude/prompt-hook.js +303 -0
- package/dist/claude/prompt-hook.js.map +1 -0
- package/dist/claude/prompt-skills.d.ts +19 -0
- package/dist/claude/prompt-skills.d.ts.map +1 -0
- package/dist/claude/prompt-skills.js +305 -0
- package/dist/claude/prompt-skills.js.map +1 -0
- package/dist/claude/session-metrics.js +4 -4
- package/dist/claude/session-metrics.js.map +1 -1
- package/dist/claude/settings-merge.d.ts +10 -0
- package/dist/claude/settings-merge.d.ts.map +1 -1
- package/dist/claude/settings-merge.js +46 -17
- package/dist/claude/settings-merge.js.map +1 -1
- package/dist/claude/shim-template.d.ts.map +1 -1
- package/dist/claude/shim-template.js +86 -28
- package/dist/claude/shim-template.js.map +1 -1
- package/dist/claude/skill-template.d.ts +2 -0
- package/dist/claude/skill-template.d.ts.map +1 -1
- package/dist/claude/skill-template.js +53 -34
- package/dist/claude/skill-template.js.map +1 -1
- package/dist/claude/skill-use.d.ts +16 -0
- package/dist/claude/skill-use.d.ts.map +1 -0
- package/dist/claude/skill-use.js +78 -0
- package/dist/claude/skill-use.js.map +1 -0
- package/dist/claude/skills-wiring.d.ts +26 -0
- package/dist/claude/skills-wiring.d.ts.map +1 -0
- package/dist/claude/skills-wiring.js +110 -0
- package/dist/claude/skills-wiring.js.map +1 -0
- package/dist/claude/start-init.d.ts +13 -0
- package/dist/claude/start-init.d.ts.map +1 -0
- package/dist/claude/start-init.js +75 -0
- package/dist/claude/start-init.js.map +1 -0
- package/dist/claude/start-skills.d.ts +31 -0
- package/dist/claude/start-skills.d.ts.map +1 -0
- package/dist/claude/start-skills.js +274 -0
- package/dist/claude/start-skills.js.map +1 -0
- package/dist/claude/state.d.ts +19 -7
- package/dist/claude/state.d.ts.map +1 -1
- package/dist/claude/state.js +59 -4
- package/dist/claude/state.js.map +1 -1
- package/dist/claude/stop-skills.d.ts +23 -0
- package/dist/claude/stop-skills.d.ts.map +1 -0
- package/dist/claude/stop-skills.js +233 -0
- package/dist/claude/stop-skills.js.map +1 -0
- package/dist/claude/stop.d.ts +23 -0
- package/dist/claude/stop.d.ts.map +1 -0
- package/dist/claude/stop.js +219 -0
- package/dist/claude/stop.js.map +1 -0
- package/dist/claude/tally.d.ts +29 -41
- package/dist/claude/tally.d.ts.map +1 -1
- package/dist/claude/tally.js +111 -165
- package/dist/claude/tally.js.map +1 -1
- package/dist/claude/walls-hook.d.ts +52 -0
- package/dist/claude/walls-hook.d.ts.map +1 -0
- package/dist/claude/walls-hook.js +279 -0
- package/dist/claude/walls-hook.js.map +1 -0
- package/dist/cli-epilogue.d.ts.map +1 -1
- package/dist/cli-epilogue.js +24 -14
- package/dist/cli-epilogue.js.map +1 -1
- package/dist/cli-meta.js +3 -3
- package/dist/cli-meta.js.map +1 -1
- package/dist/cli-picker.d.ts.map +1 -1
- package/dist/cli-picker.js +8 -6
- package/dist/cli-picker.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +238 -402
- package/dist/cli.js.map +1 -1
- package/dist/cloud/head-learnings.d.ts +13 -0
- package/dist/cloud/head-learnings.d.ts.map +1 -0
- package/dist/cloud/head-learnings.js +84 -0
- package/dist/cloud/head-learnings.js.map +1 -0
- package/dist/cloud/lookup-activity.d.ts +5 -3
- package/dist/cloud/lookup-activity.d.ts.map +1 -1
- package/dist/cloud/lookup-activity.js +8 -8
- package/dist/cloud/lookup-activity.js.map +1 -1
- package/dist/cloud/nudge.d.ts +15 -7
- package/dist/cloud/nudge.d.ts.map +1 -1
- package/dist/cloud/nudge.js +42 -33
- package/dist/cloud/nudge.js.map +1 -1
- package/dist/cloud/onboarding.d.ts +37 -1
- package/dist/cloud/onboarding.d.ts.map +1 -1
- package/dist/cloud/onboarding.js +77 -1
- package/dist/cloud/onboarding.js.map +1 -1
- package/dist/cloud/other-repos.d.ts +39 -0
- package/dist/cloud/other-repos.d.ts.map +1 -0
- package/dist/cloud/other-repos.js +137 -0
- package/dist/cloud/other-repos.js.map +1 -0
- package/dist/cloud/pair.d.ts +17 -7
- package/dist/cloud/pair.d.ts.map +1 -1
- package/dist/cloud/pair.js +81 -60
- package/dist/cloud/pair.js.map +1 -1
- package/dist/cloud/workspace-sync.d.ts +67 -11
- package/dist/cloud/workspace-sync.d.ts.map +1 -1
- package/dist/cloud/workspace-sync.js +299 -55
- package/dist/cloud/workspace-sync.js.map +1 -1
- package/dist/cloud/workspace.d.ts +74 -10
- package/dist/cloud/workspace.d.ts.map +1 -1
- package/dist/cloud/workspace.js +96 -8
- package/dist/cloud/workspace.js.map +1 -1
- package/dist/hosts/claude-global.js +1 -1
- package/dist/hosts/claude-global.js.map +1 -1
- package/dist/hosts/codex-hooks.d.ts +6 -0
- package/dist/hosts/codex-hooks.d.ts.map +1 -1
- package/dist/hosts/codex-hooks.js +89 -16
- package/dist/hosts/codex-hooks.js.map +1 -1
- package/dist/hosts/codex-trust.d.ts +28 -0
- package/dist/hosts/codex-trust.d.ts.map +1 -0
- package/dist/hosts/codex-trust.js +280 -0
- package/dist/hosts/codex-trust.js.map +1 -0
- package/dist/hosts/cursor-hooks.d.ts.map +1 -1
- package/dist/hosts/cursor-hooks.js +3 -1
- package/dist/hosts/cursor-hooks.js.map +1 -1
- package/dist/init/candidates.d.ts +60 -0
- package/dist/init/candidates.d.ts.map +1 -0
- package/dist/init/candidates.js +202 -0
- package/dist/init/candidates.js.map +1 -0
- package/dist/init/claude-call.d.ts +51 -0
- package/dist/init/claude-call.d.ts.map +1 -0
- package/dist/init/claude-call.js +199 -0
- package/dist/init/claude-call.js.map +1 -0
- package/dist/init/discover-worker.d.ts +18 -0
- package/dist/init/discover-worker.d.ts.map +1 -0
- package/dist/init/discover-worker.js +111 -0
- package/dist/init/discover-worker.js.map +1 -0
- package/dist/init/handover.d.ts +16 -0
- package/dist/init/handover.d.ts.map +1 -0
- package/dist/init/handover.js +92 -0
- package/dist/init/handover.js.map +1 -0
- package/dist/init/howtos.d.ts +20 -0
- package/dist/init/howtos.d.ts.map +1 -0
- package/dist/init/howtos.js +90 -0
- package/dist/init/howtos.js.map +1 -0
- package/dist/init/init-record.d.ts +134 -0
- package/dist/init/init-record.d.ts.map +1 -0
- package/dist/init/init-record.js +339 -0
- package/dist/init/init-record.js.map +1 -0
- package/dist/init/install-paths.d.ts +6 -0
- package/dist/init/install-paths.d.ts.map +1 -0
- package/dist/init/install-paths.js +87 -0
- package/dist/init/install-paths.js.map +1 -0
- package/dist/init/keep-answer.d.ts +43 -0
- package/dist/init/keep-answer.d.ts.map +1 -0
- package/dist/init/keep-answer.js +118 -0
- package/dist/init/keep-answer.js.map +1 -0
- package/dist/init/keep-gate.d.ts +30 -0
- package/dist/init/keep-gate.d.ts.map +1 -0
- package/dist/init/keep-gate.js +178 -0
- package/dist/init/keep-gate.js.map +1 -0
- package/dist/init/keep-list.d.ts +67 -0
- package/dist/init/keep-list.d.ts.map +1 -0
- package/dist/init/keep-list.js +232 -0
- package/dist/init/keep-list.js.map +1 -0
- package/dist/init/keep.d.ts +52 -0
- package/dist/init/keep.d.ts.map +1 -0
- package/dist/init/keep.js +393 -0
- package/dist/init/keep.js.map +1 -0
- package/dist/init/look-back-mine.d.ts +37 -0
- package/dist/init/look-back-mine.d.ts.map +1 -0
- package/dist/init/look-back-mine.js +215 -0
- package/dist/init/look-back-mine.js.map +1 -0
- package/dist/init/look-back.d.ts +81 -0
- package/dist/init/look-back.d.ts.map +1 -0
- package/dist/init/look-back.js +170 -0
- package/dist/init/look-back.js.map +1 -0
- package/dist/init/miners.d.ts +46 -0
- package/dist/init/miners.d.ts.map +1 -0
- package/dist/init/miners.js +141 -0
- package/dist/init/miners.js.map +1 -0
- package/dist/init/name-call.d.ts +37 -0
- package/dist/init/name-call.d.ts.map +1 -0
- package/dist/init/name-call.js +151 -0
- package/dist/init/name-call.js.map +1 -0
- package/dist/init/plain-file.d.ts.map +1 -1
- package/dist/init/plain-file.js +3 -0
- package/dist/init/plain-file.js.map +1 -1
- package/dist/init/prefs.d.ts +70 -0
- package/dist/init/prefs.d.ts.map +1 -0
- package/dist/init/prefs.js +282 -0
- package/dist/init/prefs.js.map +1 -0
- package/dist/init/relay.d.ts +15 -0
- package/dist/init/relay.d.ts.map +1 -0
- package/dist/init/relay.js +15 -0
- package/dist/init/relay.js.map +1 -0
- package/dist/init/replay-runs.d.ts +121 -0
- package/dist/init/replay-runs.d.ts.map +1 -0
- package/dist/init/replay-runs.js +457 -0
- package/dist/init/replay-runs.js.map +1 -0
- package/dist/init/replay-tamper.d.ts +18 -0
- package/dist/init/replay-tamper.d.ts.map +1 -0
- package/dist/init/replay-tamper.js +87 -0
- package/dist/init/replay-tamper.js.map +1 -0
- package/dist/init/review-screen.d.ts +74 -0
- package/dist/init/review-screen.d.ts.map +1 -0
- package/dist/init/review-screen.js +258 -0
- package/dist/init/review-screen.js.map +1 -0
- package/dist/init/review-tty.d.ts +29 -0
- package/dist/init/review-tty.d.ts.map +1 -0
- package/dist/init/review-tty.js +218 -0
- package/dist/init/review-tty.js.map +1 -0
- package/dist/init/review.d.ts +12 -0
- package/dist/init/review.d.ts.map +1 -0
- package/dist/init/review.js +12 -0
- package/dist/init/review.js.map +1 -0
- package/dist/init/run.d.ts +87 -0
- package/dist/init/run.d.ts.map +1 -0
- package/dist/init/run.js +347 -0
- package/dist/init/run.js.map +1 -0
- package/dist/init/sessions.d.ts +63 -0
- package/dist/init/sessions.d.ts.map +1 -0
- package/dist/init/sessions.js +377 -0
- package/dist/init/sessions.js.map +1 -0
- package/dist/init/transcript.d.ts +81 -0
- package/dist/init/transcript.d.ts.map +1 -0
- package/dist/init/transcript.js +216 -0
- package/dist/init/transcript.js.map +1 -0
- package/dist/init/types.d.ts +139 -0
- package/dist/init/types.d.ts.map +1 -0
- package/dist/init/types.js +2 -0
- package/dist/init/types.js.map +1 -0
- package/dist/notes/cold-start.d.ts +5 -213
- package/dist/notes/cold-start.d.ts.map +1 -1
- package/dist/notes/cold-start.js +5 -654
- package/dist/notes/cold-start.js.map +1 -1
- package/dist/notes/edit-overlap.d.ts.map +1 -1
- package/dist/notes/edit-overlap.js +4 -1
- package/dist/notes/edit-overlap.js.map +1 -1
- package/dist/notes/notes.d.ts +8 -4
- package/dist/notes/notes.d.ts.map +1 -1
- package/dist/notes/notes.js +9 -7
- package/dist/notes/notes.js.map +1 -1
- package/dist/notes/pr-reviews.d.ts +4 -0
- package/dist/notes/pr-reviews.d.ts.map +1 -1
- package/dist/notes/pr-reviews.js +6 -5
- package/dist/notes/pr-reviews.js.map +1 -1
- package/dist/notes/repo-trail.d.ts +1 -1
- package/dist/notes/repo-trail.d.ts.map +1 -1
- package/dist/notes/repo-trail.js +24 -4
- package/dist/notes/repo-trail.js.map +1 -1
- package/dist/search/grep.d.ts.map +1 -1
- package/dist/search/grep.js +4 -2
- package/dist/search/grep.js.map +1 -1
- package/dist/search/user-regexp.d.ts +26 -0
- package/dist/search/user-regexp.d.ts.map +1 -0
- package/dist/search/user-regexp.js +150 -0
- package/dist/search/user-regexp.js.map +1 -0
- package/dist/skills/anchors-cli.d.ts +5 -0
- package/dist/skills/anchors-cli.d.ts.map +1 -1
- package/dist/skills/anchors-cli.js +7 -2
- package/dist/skills/anchors-cli.js.map +1 -1
- package/dist/skills/anchors-wide.js +2 -2
- package/dist/skills/anchors-wide.js.map +1 -1
- package/dist/skills/cli-skills-1b.d.ts +17 -0
- package/dist/skills/cli-skills-1b.d.ts.map +1 -0
- package/dist/skills/cli-skills-1b.js +166 -0
- package/dist/skills/cli-skills-1b.js.map +1 -0
- package/dist/skills/cli-skills-2.d.ts +35 -0
- package/dist/skills/cli-skills-2.d.ts.map +1 -0
- package/dist/skills/cli-skills-2.js +129 -0
- package/dist/skills/cli-skills-2.js.map +1 -0
- package/dist/skills/cli-skills-report-1b.d.ts +49 -0
- package/dist/skills/cli-skills-report-1b.d.ts.map +1 -0
- package/dist/skills/cli-skills-report-1b.js +191 -0
- package/dist/skills/cli-skills-report-1b.js.map +1 -0
- package/dist/skills/cli-skills-report.d.ts +86 -0
- package/dist/skills/cli-skills-report.d.ts.map +1 -0
- package/dist/skills/cli-skills-report.js +121 -0
- package/dist/skills/cli-skills-report.js.map +1 -0
- package/dist/skills/cli-skills.d.ts +30 -0
- package/dist/skills/cli-skills.d.ts.map +1 -0
- package/dist/skills/cli-skills.js +379 -0
- package/dist/skills/cli-skills.js.map +1 -0
- package/dist/skills/compile-split.d.ts.map +1 -1
- package/dist/skills/compile-split.js +18 -0
- package/dist/skills/compile-split.js.map +1 -1
- package/dist/skills/compile-words.d.ts +4 -1
- package/dist/skills/compile-words.d.ts.map +1 -1
- package/dist/skills/compile-words.js +68 -8
- package/dist/skills/compile-words.js.map +1 -1
- package/dist/skills/compile.d.ts +7 -0
- package/dist/skills/compile.d.ts.map +1 -1
- package/dist/skills/compile.js +17 -0
- package/dist/skills/compile.js.map +1 -1
- package/dist/skills/credit.d.ts +86 -0
- package/dist/skills/credit.d.ts.map +1 -0
- package/dist/skills/credit.js +259 -0
- package/dist/skills/credit.js.map +1 -0
- package/dist/skills/fold-gated.d.ts +3 -0
- package/dist/skills/fold-gated.d.ts.map +1 -0
- package/dist/skills/fold-gated.js +78 -0
- package/dist/skills/fold-gated.js.map +1 -0
- package/dist/skills/fold.d.ts +87 -0
- package/dist/skills/fold.d.ts.map +1 -0
- package/dist/skills/fold.js +348 -0
- package/dist/skills/fold.js.map +1 -0
- package/dist/skills/follow-learnings.d.ts +128 -0
- package/dist/skills/follow-learnings.d.ts.map +1 -0
- package/dist/skills/follow-learnings.js +278 -0
- package/dist/skills/follow-learnings.js.map +1 -0
- package/dist/skills/learning-steps.d.ts +43 -0
- package/dist/skills/learning-steps.d.ts.map +1 -0
- package/dist/skills/learning-steps.js +294 -0
- package/dist/skills/learning-steps.js.map +1 -0
- package/dist/skills/lesson-gate.d.ts +25 -0
- package/dist/skills/lesson-gate.d.ts.map +1 -0
- package/dist/skills/lesson-gate.js +316 -0
- package/dist/skills/lesson-gate.js.map +1 -0
- package/dist/skills/offer-drift.d.ts +35 -0
- package/dist/skills/offer-drift.d.ts.map +1 -0
- package/dist/skills/offer-drift.js +98 -0
- package/dist/skills/offer-drift.js.map +1 -0
- package/dist/skills/offer-lesson.d.ts +31 -0
- package/dist/skills/offer-lesson.d.ts.map +1 -0
- package/dist/skills/offer-lesson.js +123 -0
- package/dist/skills/offer-lesson.js.map +1 -0
- package/dist/skills/offer-lines.d.ts +40 -0
- package/dist/skills/offer-lines.d.ts.map +1 -0
- package/dist/skills/offer-lines.js +80 -0
- package/dist/skills/offer-lines.js.map +1 -0
- package/dist/skills/offer-moment.d.ts +102 -0
- package/dist/skills/offer-moment.d.ts.map +1 -0
- package/dist/skills/offer-moment.js +260 -0
- package/dist/skills/offer-moment.js.map +1 -0
- package/dist/skills/offer-repair.d.ts +36 -0
- package/dist/skills/offer-repair.d.ts.map +1 -0
- package/dist/skills/offer-repair.js +212 -0
- package/dist/skills/offer-repair.js.map +1 -0
- package/dist/skills/offer-retire.d.ts +53 -0
- package/dist/skills/offer-retire.d.ts.map +1 -0
- package/dist/skills/offer-retire.js +149 -0
- package/dist/skills/offer-retire.js.map +1 -0
- package/dist/skills/offer-update.d.ts +54 -0
- package/dist/skills/offer-update.d.ts.map +1 -0
- package/dist/skills/offer-update.js +115 -0
- package/dist/skills/offer-update.js.map +1 -0
- package/dist/skills/offer-words-1b.d.ts +32 -0
- package/dist/skills/offer-words-1b.d.ts.map +1 -0
- package/dist/skills/offer-words-1b.js +80 -0
- package/dist/skills/offer-words-1b.js.map +1 -0
- package/dist/skills/offer-words-2.d.ts +123 -0
- package/dist/skills/offer-words-2.d.ts.map +1 -0
- package/dist/skills/offer-words-2.js +194 -0
- package/dist/skills/offer-words-2.js.map +1 -0
- package/dist/skills/offer-words.d.ts +65 -0
- package/dist/skills/offer-words.d.ts.map +1 -0
- package/dist/skills/offer-words.js +205 -0
- package/dist/skills/offer-words.js.map +1 -0
- package/dist/skills/offers.d.ts +66 -0
- package/dist/skills/offers.d.ts.map +1 -0
- package/dist/skills/offers.js +284 -0
- package/dist/skills/offers.js.map +1 -0
- package/dist/skills/runblock.d.ts +2 -0
- package/dist/skills/runblock.d.ts.map +1 -1
- package/dist/skills/runblock.js +11 -6
- package/dist/skills/runblock.js.map +1 -1
- package/dist/skills/save-gate.d.ts +64 -0
- package/dist/skills/save-gate.d.ts.map +1 -0
- package/dist/skills/save-gate.js +354 -0
- package/dist/skills/save-gate.js.map +1 -0
- package/dist/skills/save-verify.d.ts +59 -0
- package/dist/skills/save-verify.d.ts.map +1 -0
- package/dist/skills/save-verify.js +390 -0
- package/dist/skills/save-verify.js.map +1 -0
- package/dist/skills/settings.d.ts +12 -2
- package/dist/skills/settings.d.ts.map +1 -1
- package/dist/skills/settings.js +24 -2
- package/dist/skills/settings.js.map +1 -1
- package/dist/skills/skills.d.ts +26 -8
- package/dist/skills/skills.d.ts.map +1 -1
- package/dist/skills/skills.js +105 -52
- package/dist/skills/skills.js.map +1 -1
- package/dist/skills/types.d.ts +8 -0
- package/dist/skills/types.d.ts.map +1 -1
- package/dist/skills/update-gate.d.ts +36 -0
- package/dist/skills/update-gate.d.ts.map +1 -0
- package/dist/skills/update-gate.js +357 -0
- package/dist/skills/update-gate.js.map +1 -0
- package/dist/skills/update-plan.d.ts +40 -0
- package/dist/skills/update-plan.d.ts.map +1 -0
- package/dist/skills/update-plan.js +196 -0
- package/dist/skills/update-plan.js.map +1 -0
- package/dist/skills/value-line.d.ts +94 -0
- package/dist/skills/value-line.d.ts.map +1 -0
- package/dist/skills/value-line.js +355 -0
- package/dist/skills/value-line.js.map +1 -0
- package/dist/telemetry/contract.d.ts +15 -1
- package/dist/telemetry/contract.d.ts.map +1 -1
- package/dist/telemetry/contract.js +80 -11
- package/dist/telemetry/contract.js.map +1 -1
- package/dist/telemetry/gate.js +4 -4
- package/dist/telemetry/gate.js.map +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/notice.js +5 -5
- package/dist/telemetry/notice.js.map +1 -1
- package/dist/telemetry/queue.d.ts.map +1 -1
- package/dist/telemetry/queue.js +7 -7
- package/dist/telemetry/queue.js.map +1 -1
- package/dist/telemetry/track.d.ts.map +1 -1
- package/dist/telemetry/track.js +4 -3
- package/dist/telemetry/track.js.map +1 -1
- package/dist/trace/checks.d.ts.map +1 -1
- package/dist/trace/checks.js +10 -2
- package/dist/trace/checks.js.map +1 -1
- package/dist/trace/gate-file.d.ts +1 -1
- package/dist/trace/gate-file.d.ts.map +1 -1
- package/dist/trace/gate-file.js +3 -3
- package/dist/trace/gate-file.js.map +1 -1
- package/dist/upkeep-run.d.ts.map +1 -1
- package/dist/upkeep-run.js +2 -23
- package/dist/upkeep-run.js.map +1 -1
- package/dist/upkeep.d.ts.map +1 -1
- package/dist/upkeep.js +2 -3
- package/dist/upkeep.js.map +1 -1
- package/dist/util/private-fs.d.ts +6 -0
- package/dist/util/private-fs.d.ts.map +1 -1
- package/dist/util/private-fs.js +9 -1
- package/dist/util/private-fs.js.map +1 -1
- package/dist/util/state.d.ts.map +1 -1
- package/dist/util/state.js +17 -3
- package/dist/util/state.js.map +1 -1
- package/package.json +1 -1
- package/dist/skills/found-skill.d.ts +0 -35
- package/dist/skills/found-skill.d.ts.map +0 -1
- package/dist/skills/found-skill.js +0 -66
- package/dist/skills/found-skill.js.map +0 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading one past Claude Code transcript for `trail init`'s look-back: what
|
|
3
|
+
* the person typed (g4's shared filter decides, so IDE tags and reminders are
|
|
4
|
+
* stripped and the prompt kept, pastes become a marker), each with its own
|
|
5
|
+
* time and the end of Claude's reply before it, plus the tool calls, so a
|
|
6
|
+
* session started in a folder above the repo can be judged by how much of its
|
|
7
|
+
* work was in the repo.
|
|
8
|
+
*
|
|
9
|
+
* Files are read in chunks, line by line, never whole: one real transcript
|
|
10
|
+
* passed 233 MB. Tool results are never parsed (they are most of the bytes
|
|
11
|
+
* and hold nothing the person typed), and neither is any line over 2 MB.
|
|
12
|
+
*/
|
|
13
|
+
import { closeSync, readSync } from "node:fs";
|
|
14
|
+
import { basename } from "node:path";
|
|
15
|
+
import { openPlain } from "./plain-file.js";
|
|
16
|
+
import { ownText, textOf, typedText } from "../trace/claude.js";
|
|
17
|
+
import { labInteractive } from "../skills/host-facts.js";
|
|
18
|
+
const PROMPT_CHARS = 1200;
|
|
19
|
+
const BEFORE_CHARS = 240;
|
|
20
|
+
/** How much of a file's start is read to find where its session began. */
|
|
21
|
+
const HEAD_BYTES = 256 * 1024;
|
|
22
|
+
const CHUNK_BYTES = 4 * 1024 * 1024;
|
|
23
|
+
/** No typed message or tool call worth reading is this long: a line over it is skipped unparsed. */
|
|
24
|
+
const MAX_LINE = 2 * 1024 * 1024;
|
|
25
|
+
const NEWLINE = 0x0a;
|
|
26
|
+
/**
|
|
27
|
+
* The date an ISO time fell on where the person lives (this machine's time
|
|
28
|
+
* zone), `2026-10-09`; "" for anything else. Not the UTC date: UTC midnight
|
|
29
|
+
* is mid-afternoon in California, so a restart at 4:55 and 5:05 pm would
|
|
30
|
+
* count as two days.
|
|
31
|
+
*/
|
|
32
|
+
export function dayOf(iso) {
|
|
33
|
+
if (!iso || !/^\d{4}-\d{2}-\d{2}/.test(iso))
|
|
34
|
+
return "";
|
|
35
|
+
if (!/T\d{2}:\d{2}/.test(iso))
|
|
36
|
+
return iso.slice(0, 10);
|
|
37
|
+
const d = new Date(iso);
|
|
38
|
+
if (Number.isNaN(d.getTime()))
|
|
39
|
+
return "";
|
|
40
|
+
const two = (n) => String(n).padStart(2, "0");
|
|
41
|
+
return `${d.getFullYear()}-${two(d.getMonth() + 1)}-${two(d.getDate())}`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Each complete line of `path`, in order, read in chunks, with the byte offset it starts at. `range` reads only
|
|
45
|
+
* the lines that start at or after `from` and before `to` (`from` must be a line start). Lines over 2 MB are
|
|
46
|
+
* skipped unread. Throws when the file can't be opened or isn't a plain file (a FIFO would hang the read).
|
|
47
|
+
*/
|
|
48
|
+
export function eachLine(path, onLine, range) {
|
|
49
|
+
// Never a FIFO or a device, even one swapped in after discovery's stat (b5 review).
|
|
50
|
+
const fd = openPlain(path, { follow: true });
|
|
51
|
+
try {
|
|
52
|
+
const buf = Buffer.allocUnsafe(CHUNK_BYTES);
|
|
53
|
+
const end = range ? Math.max(0, range.to) : Infinity;
|
|
54
|
+
let pos = range ? Math.max(0, range.from) : 0;
|
|
55
|
+
let carry = Buffer.alloc(0);
|
|
56
|
+
// A line longer than MAX_LINE is dropped as it streams by, never held whole.
|
|
57
|
+
let skipping = false;
|
|
58
|
+
// Past `to`, read on only to finish a line that started before it.
|
|
59
|
+
while (pos < end || (!skipping && carry.length > 0 && pos - carry.length < end)) {
|
|
60
|
+
const got = readSync(fd, buf, 0, CHUNK_BYTES, pos);
|
|
61
|
+
if (got <= 0)
|
|
62
|
+
break;
|
|
63
|
+
const dataStart = pos - carry.length;
|
|
64
|
+
pos += got;
|
|
65
|
+
const data = carry.length ? Buffer.concat([carry, buf.subarray(0, got)]) : buf.subarray(0, got);
|
|
66
|
+
let from = 0;
|
|
67
|
+
for (let nl = data.indexOf(NEWLINE, from); nl !== -1; nl = data.indexOf(NEWLINE, from)) {
|
|
68
|
+
const at = dataStart + from;
|
|
69
|
+
if (at >= end)
|
|
70
|
+
return;
|
|
71
|
+
if (!skipping && nl > from && nl - from <= MAX_LINE)
|
|
72
|
+
onLine(data.toString("utf8", from, nl), at);
|
|
73
|
+
skipping = false;
|
|
74
|
+
from = nl + 1;
|
|
75
|
+
}
|
|
76
|
+
if (data.length - from > MAX_LINE) {
|
|
77
|
+
skipping = true;
|
|
78
|
+
carry = Buffer.alloc(0);
|
|
79
|
+
}
|
|
80
|
+
else
|
|
81
|
+
carry = Buffer.from(data.subarray(from));
|
|
82
|
+
}
|
|
83
|
+
const at = pos - carry.length;
|
|
84
|
+
if (!skipping && carry.length && carry.length <= MAX_LINE && at < end)
|
|
85
|
+
onLine(carry.toString("utf8"), at);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
closeSync(fd);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** The first `cwd` in the first 256 KB of a transcript: the folder its session started in. Null when there's none or the file can't be read. */
|
|
92
|
+
export function firstCwd(path) {
|
|
93
|
+
let text;
|
|
94
|
+
try {
|
|
95
|
+
const fd = openPlain(path, { follow: true });
|
|
96
|
+
try {
|
|
97
|
+
const buf = Buffer.allocUnsafe(HEAD_BYTES);
|
|
98
|
+
text = buf.toString("utf8", 0, readSync(fd, buf, 0, HEAD_BYTES, 0));
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
closeSync(fd);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
const m = /"cwd":"((?:[^"\\]|\\.)*)"/.exec(text);
|
|
108
|
+
if (!m)
|
|
109
|
+
return null;
|
|
110
|
+
try {
|
|
111
|
+
return JSON.parse(`"${m[1]}"`);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/** One message's words, cut at PROMPT_CHARS; null when there are none. */
|
|
118
|
+
function capped(t) {
|
|
119
|
+
if (!t)
|
|
120
|
+
return null;
|
|
121
|
+
return t.length > PROMPT_CHARS ? `${t.slice(0, PROMPT_CHARS)}…` : t;
|
|
122
|
+
}
|
|
123
|
+
/** The person's message with what isn't theirs taken out (trace/claude.ts decides), or null when nothing of theirs is left. */
|
|
124
|
+
export function ownWords(raw) {
|
|
125
|
+
return capped(ownText(raw));
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* One transcript's typed messages and tool calls. `touches(cwd, name, input)`
|
|
129
|
+
* says whether a tool call worked in the repo; without it every call counts
|
|
130
|
+
* as out of the repo. `env` decides only whether an sdk run is read (a lab home with the switch, D99). Never throws:
|
|
131
|
+
* an unreadable file scans as empty.
|
|
132
|
+
*/
|
|
133
|
+
export function scanTranscript(path, touches, env = process.env) {
|
|
134
|
+
const scan = { headless: false, prompts: [], calls: [] };
|
|
135
|
+
let i = 0;
|
|
136
|
+
let lastReply = "";
|
|
137
|
+
try {
|
|
138
|
+
eachLine(path, (line, o) => {
|
|
139
|
+
// Tool output is most of a transcript and never the person's words.
|
|
140
|
+
if (scan.headless || line.includes('"type":"tool_result"'))
|
|
141
|
+
return;
|
|
142
|
+
let e;
|
|
143
|
+
try {
|
|
144
|
+
e = JSON.parse(line);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (!e || typeof e !== "object")
|
|
150
|
+
return;
|
|
151
|
+
// A script's run, unless a lab home has the switch (D99, D136 (2)), as the hooks read it.
|
|
152
|
+
if (typeof e.entrypoint === "string" && e.entrypoint.startsWith("sdk") && !labInteractive(env)) {
|
|
153
|
+
scan.headless = true;
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (e.isSidechain)
|
|
157
|
+
return;
|
|
158
|
+
if (e.type === "assistant") {
|
|
159
|
+
const content = e.message?.content;
|
|
160
|
+
const said = textOf(content).trim();
|
|
161
|
+
if (said)
|
|
162
|
+
lastReply = said;
|
|
163
|
+
if (!Array.isArray(content))
|
|
164
|
+
return;
|
|
165
|
+
for (const part of content) {
|
|
166
|
+
if (!part || typeof part !== "object" || part.type !== "tool_use")
|
|
167
|
+
continue;
|
|
168
|
+
let inRepo = false;
|
|
169
|
+
try {
|
|
170
|
+
inRepo = touches ? touches(typeof e.cwd === "string" ? e.cwd : "", String(part.name ?? ""), part.input) : false;
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
/* a call that can't be judged isn't in the repo */
|
|
174
|
+
}
|
|
175
|
+
scan.calls.push({ i: i++, o, inRepo });
|
|
176
|
+
}
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
// The one typed-words filter every learning path shares.
|
|
180
|
+
const words = capped(typedText(e, env));
|
|
181
|
+
if (!words)
|
|
182
|
+
return;
|
|
183
|
+
scan.branch ||= e.gitBranch;
|
|
184
|
+
const before = lastReply ? lastReply.slice(-BEFORE_CHARS).replace(/\s+/g, " ").trim() : undefined;
|
|
185
|
+
const at = typeof e.timestamp === "string" ? e.timestamp : undefined;
|
|
186
|
+
scan.prompts.push({ text: words, ...(before ? { before } : {}), ...(at ? { at } : {}), i: i++, o });
|
|
187
|
+
lastReply = "";
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
/* unreadable: nothing in it */
|
|
192
|
+
}
|
|
193
|
+
return scan;
|
|
194
|
+
}
|
|
195
|
+
/** A session from scanned prompts, or null when none is left. */
|
|
196
|
+
export function sessionOf(path, scan, prompts = scan.prompts, source) {
|
|
197
|
+
if (scan.headless || !prompts.length)
|
|
198
|
+
return null;
|
|
199
|
+
return {
|
|
200
|
+
id: basename(path, ".jsonl"),
|
|
201
|
+
path,
|
|
202
|
+
at: prompts.find((p) => p.at)?.at ?? "",
|
|
203
|
+
branch: scan.branch,
|
|
204
|
+
prompts: prompts.map(({ i: _i, o: _o, ...p }) => p),
|
|
205
|
+
...(source ? { source } : {}),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* One transcript's messages from the person, oldest first. Headless runs
|
|
210
|
+
* (`claude -p`, scripts) are skipped whole: their prompts were written once
|
|
211
|
+
* and replayed, so a repeat there isn't the person repeating themselves.
|
|
212
|
+
*/
|
|
213
|
+
export function readSession(path) {
|
|
214
|
+
return sessionOf(path, scanTranscript(path));
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=transcript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.js","sourceRoot":"","sources":["../../src/init/transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AA2BzD,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,0EAA0E;AAC1E,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,CAAC;AAC9B,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACpC,oGAAoG;AACpG,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACjC,MAAM,OAAO,GAAG,IAAI,CAAC;AAErB;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,GAAuB;IAC3C,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACvD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvD,MAAM,CAAC,GAAG,IAAI,IAAI,CAA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,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE;QACvC,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACnD,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shapes `trail init` shares between its look-back (b5) and its screen,
|
|
3
|
+
* relay and keep (b6): candidates, the items a person sees, what the
|
|
4
|
+
* look-back read, and where an init skill came from.
|
|
5
|
+
*
|
|
6
|
+
* Types only. No typed text is ever stored in these on disk: a typed line is
|
|
7
|
+
* a pointer to it (transcript, offset, sha), and an init skill is a byte
|
|
8
|
+
* range in a host transcript plus the sha of what it compiled to.
|
|
9
|
+
*/
|
|
10
|
+
import type { CompiledSkill } from '../skills/types.js';
|
|
11
|
+
import type { WallClass } from '../trace/types.js';
|
|
12
|
+
export type InitKind = 'skill' | 'guardrail' | 'preference' | 'review' | 'claude';
|
|
13
|
+
/** A pointer to a typed line. The line itself is never stored (0 rule 6). */
|
|
14
|
+
export interface TypedRef {
|
|
15
|
+
/** The transcript path. */
|
|
16
|
+
t: string;
|
|
17
|
+
/** The line's byte offset. */
|
|
18
|
+
o: number;
|
|
19
|
+
/** sha256 of the line. */
|
|
20
|
+
s: string;
|
|
21
|
+
}
|
|
22
|
+
export interface InitCandidate {
|
|
23
|
+
/** 'i-' + sha256(kind + key) first 10 hex; stable across inits. */
|
|
24
|
+
id: string;
|
|
25
|
+
kind: InitKind;
|
|
26
|
+
/** skill: '<repoKey>|job:<class>'; guardrail: 'wall:<cls>'; preference: 'pref:<cluster sha>'. */
|
|
27
|
+
key: string;
|
|
28
|
+
/** NAME_RE for skills; a fixed title for guardrails; '' for preferences (the line is the title). */
|
|
29
|
+
plainName: string;
|
|
30
|
+
/** Lead words for the relay check (4.9 step 3): the plain name, or the first 4 content words of the person's line. */
|
|
31
|
+
nameWords: string[];
|
|
32
|
+
count: {
|
|
33
|
+
days: number;
|
|
34
|
+
from: string;
|
|
35
|
+
to: string;
|
|
36
|
+
costly?: number;
|
|
37
|
+
repos?: number;
|
|
38
|
+
};
|
|
39
|
+
scope: 'personal' | 'repo';
|
|
40
|
+
/** A repo key or 'every repo'. */
|
|
41
|
+
applies: string;
|
|
42
|
+
/** The person's own words (preferences only). */
|
|
43
|
+
typed: boolean;
|
|
44
|
+
/** Only typed preferences start ticked (D23). */
|
|
45
|
+
ticked: boolean;
|
|
46
|
+
/** The compiled skill (in memory) and where to compile it again. */
|
|
47
|
+
skill?: {
|
|
48
|
+
compiled: CompiledSkill;
|
|
49
|
+
src: SkillSource;
|
|
50
|
+
};
|
|
51
|
+
/** The template. */
|
|
52
|
+
guardrail?: {
|
|
53
|
+
cls: WallClass;
|
|
54
|
+
check?: 'no-timeout';
|
|
55
|
+
};
|
|
56
|
+
/** Up to 3, newest first. */
|
|
57
|
+
pref?: {
|
|
58
|
+
refs: TypedRef[];
|
|
59
|
+
};
|
|
60
|
+
/** D24 items, unchanged from phase 0. */
|
|
61
|
+
review?: {
|
|
62
|
+
prs: number[];
|
|
63
|
+
};
|
|
64
|
+
/** #662: the Claude Code memory note a team row came from. */
|
|
65
|
+
memory?: {
|
|
66
|
+
path: string;
|
|
67
|
+
};
|
|
68
|
+
/** Counted words for the screen, e.g. 'your how-to release-notes.md describes it'. */
|
|
69
|
+
evidence: string[];
|
|
70
|
+
rank: number;
|
|
71
|
+
}
|
|
72
|
+
export interface InitItem extends InitCandidate {
|
|
73
|
+
/** 1-based number on the screen or in the relay. */
|
|
74
|
+
n: number;
|
|
75
|
+
/** In memory only: the model's name, the plain name, or the person's line. */
|
|
76
|
+
title: string;
|
|
77
|
+
/** In memory only. */
|
|
78
|
+
description: string;
|
|
79
|
+
}
|
|
80
|
+
export interface LookBack {
|
|
81
|
+
sessions: Array<{
|
|
82
|
+
sh: string;
|
|
83
|
+
how: 'own' | 'worktree' | 'clone' | 'ancestor';
|
|
84
|
+
days: number;
|
|
85
|
+
}>;
|
|
86
|
+
skipped: Array<{
|
|
87
|
+
sh: string;
|
|
88
|
+
why: 'headless' | 'ancestor-under-30' | 'unreadable' | 'too-old' | 'scratch';
|
|
89
|
+
}>;
|
|
90
|
+
days: number;
|
|
91
|
+
from: string | null;
|
|
92
|
+
to: string | null;
|
|
93
|
+
parent: number;
|
|
94
|
+
candidates: InitCandidate[];
|
|
95
|
+
alreadyKept: {
|
|
96
|
+
here: number;
|
|
97
|
+
elsewhere: Array<{
|
|
98
|
+
repo: string;
|
|
99
|
+
n: number;
|
|
100
|
+
}>;
|
|
101
|
+
};
|
|
102
|
+
/** How-to file names read (never their text). */
|
|
103
|
+
howtos: string[];
|
|
104
|
+
ms: number;
|
|
105
|
+
/** "couldn't read {what} this time ({reason})". */
|
|
106
|
+
errors: string[];
|
|
107
|
+
}
|
|
108
|
+
export type KeepAnswer = {
|
|
109
|
+
numbers: number[];
|
|
110
|
+
} | {
|
|
111
|
+
all: true;
|
|
112
|
+
} | {
|
|
113
|
+
none: true;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Where an init skill came from, enough to compile it again at keep (R24). No command text: the run's own byte
|
|
117
|
+
* range in a host transcript, and the sha of the skill as compiled at init.
|
|
118
|
+
*/
|
|
119
|
+
export interface SkillSource {
|
|
120
|
+
/** The transcript path, realpath under ~/.claude/projects or $CLAUDE_CONFIG_DIR/projects. */
|
|
121
|
+
t: string;
|
|
122
|
+
/** When init read it. */
|
|
123
|
+
size: number;
|
|
124
|
+
mtimeMs: number;
|
|
125
|
+
/** Byte offsets: the run's first typed line to its last call. */
|
|
126
|
+
run: {
|
|
127
|
+
from: number;
|
|
128
|
+
to: number;
|
|
129
|
+
};
|
|
130
|
+
/** The prior checked run of the same job, for params. */
|
|
131
|
+
prior: {
|
|
132
|
+
t: string;
|
|
133
|
+
from: number;
|
|
134
|
+
to: number;
|
|
135
|
+
} | null;
|
|
136
|
+
/** 1a skillSha(compiled). */
|
|
137
|
+
skillSha: string;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/init/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElF,6EAA6E;AAC7E,MAAM,WAAW,QAAQ;IACvB,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,8BAA8B;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,0BAA0B;IAC1B,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,iGAAiG;IACjG,GAAG,EAAE,MAAM,CAAC;IACZ,oGAAoG;IACpG,SAAS,EAAE,MAAM,CAAC;IAClB,sHAAsH;IACtH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;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6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/init/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,216 +1,8 @@
|
|
|
1
|
-
import { type FoundSkill, type SavedSkill } from "../skills/found-skill.js";
|
|
2
|
-
import { type Note } from "./notes.js";
|
|
3
|
-
/** One message the person wrote, with the end of what Claude said just before it. */
|
|
4
|
-
export interface PastPrompt {
|
|
5
|
-
text: string;
|
|
6
|
-
/** The tail of Claude's last reply before this message, so "no, use a worktree" reads on its own. */
|
|
7
|
-
before?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface PastSession {
|
|
10
|
-
id: string;
|
|
11
|
-
/** ISO time of the first message. */
|
|
12
|
-
at: string;
|
|
13
|
-
branch?: string;
|
|
14
|
-
prompts: PastPrompt[];
|
|
15
|
-
}
|
|
16
|
-
export interface Finding {
|
|
17
|
-
title: string;
|
|
18
|
-
/** `team`: about the code or how the team works here. `you`: this person's own habits or machine. */
|
|
19
|
-
for: "team" | "you";
|
|
20
|
-
/** Markdown under `## Decided` and maybe `## Watch out`, secrets scrubbed. */
|
|
21
|
-
body: string;
|
|
22
|
-
/** Sessions the cited quotes were found in, newest first. */
|
|
23
|
-
sessions: string[];
|
|
24
|
-
/** YYYY-MM-DD of the newest of them. */
|
|
25
|
-
last: string;
|
|
26
|
-
quotes: string[];
|
|
27
|
-
}
|
|
28
|
-
export interface FindResult {
|
|
29
|
-
/** Past sessions with at least one message of the person's. */
|
|
30
|
-
sessions: number;
|
|
31
|
-
/** How many of them, newest first, Claude read. */
|
|
32
|
-
read: number;
|
|
33
|
-
findings: Finding[];
|
|
34
|
-
/** Procedures the person walked Claude through in 2+ sessions, at most {@link MAX_SKILLS}. */
|
|
35
|
-
skills: FoundSkill[];
|
|
36
|
-
model: string;
|
|
37
|
-
durationMs: number;
|
|
38
|
-
costUsd?: number;
|
|
39
|
-
/** Why nothing came back, when nothing did. */
|
|
40
|
-
reason?: "no_sessions" | "no_claude" | "failed" | "none_found";
|
|
41
|
-
}
|
|
42
|
-
/** Sonnet: on assign's history it merged related corrections into fewer, stronger findings than Haiku. */
|
|
43
|
-
export declare const COLD_START_MODEL = "claude-sonnet-5-5";
|
|
44
1
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* Worktrees git has forgotten were usually under the main checkout
|
|
48
|
-
* (`.claude/worktrees/…`), so their sessions are still found under it.
|
|
2
|
+
* Learnings from a repo's past Claude sessions, for `trail init`. The code
|
|
3
|
+
* lives in `src/init/`; this file keeps the old import path working.
|
|
49
4
|
*/
|
|
50
|
-
export
|
|
51
|
-
|
|
52
|
-
*
|
|
53
|
-
* the same repo: a fresh clone at `~/trail-demo/me` of github.com/acme/api
|
|
54
|
-
* finds the sessions and Claude memory of `~/src/api`. Claude Code keeps each
|
|
55
|
-
* project's folder under ~/.claude/projects; each folder's first transcript
|
|
56
|
-
* says where it ran, and that folder's git config names its remote.
|
|
57
|
-
*/
|
|
58
|
-
export declare function sameRepoRoots(repo: string, home?: string): string[];
|
|
59
|
-
/**
|
|
60
|
-
* Transcript files for sessions run inside `roots`. Claude Code names a
|
|
61
|
-
* project's folder after its path with every other character as `-`, so a
|
|
62
|
-
* folder under a root starts with the root's name; but so does a sibling like
|
|
63
|
-
* `assign-old`, so each file's own `cwd` decides.
|
|
64
|
-
*/
|
|
65
|
-
export declare function sessionFiles(roots: string[], home?: string): string[];
|
|
66
|
-
/** The person's message with what isn't theirs taken out, or null when nothing of theirs is left. */
|
|
67
|
-
export declare function ownWords(raw: string): string | null;
|
|
68
|
-
/**
|
|
69
|
-
* One transcript's messages from the person, oldest first. Headless runs
|
|
70
|
-
* (`claude -p`, scripts) are skipped whole: their prompts were written once
|
|
71
|
-
* and replayed, so a repeat there isn't the person repeating themselves.
|
|
72
|
-
*/
|
|
73
|
-
export declare function readSession(path: string): PastSession | null;
|
|
74
|
-
/** Every past session of the repo with something the person wrote, newest first. */
|
|
75
|
-
export declare function pastSessions(repo: string, home?: string): PastSession[];
|
|
76
|
-
/**
|
|
77
|
-
* The sessions as one text for Claude, newest first, cut at `maxChars`. Each
|
|
78
|
-
* session is headed by a short id that the findings cite back.
|
|
79
|
-
*/
|
|
80
|
-
export declare function digest(sessions: PastSession[], maxChars?: number): {
|
|
81
|
-
text: string;
|
|
82
|
-
ids: Map<string, string>;
|
|
83
|
-
};
|
|
84
|
-
interface RawFinding {
|
|
85
|
-
title?: string;
|
|
86
|
-
for?: string;
|
|
87
|
-
body?: string;
|
|
88
|
-
evidence?: {
|
|
89
|
-
session?: string;
|
|
90
|
-
quote?: string;
|
|
91
|
-
}[];
|
|
92
|
-
}
|
|
93
|
-
interface RawSkill {
|
|
94
|
-
name?: string;
|
|
95
|
-
title?: string;
|
|
96
|
-
for?: string;
|
|
97
|
-
steps?: string[];
|
|
98
|
-
evidence?: {
|
|
99
|
-
session?: string;
|
|
100
|
-
quote?: string;
|
|
101
|
-
}[];
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* The Claude Code to run: `claude` on PATH, else a standalone install's copy,
|
|
105
|
-
* else the newest copy the VS Code, Cursor, VS Code Insiders or Windsurf
|
|
106
|
-
* extension keeps. Someone who only uses the extension has no `claude` on
|
|
107
|
-
* PATH, and without this their past sessions are never read. Null when
|
|
108
|
-
* there's none.
|
|
109
|
-
*/
|
|
110
|
-
export declare function claudeBin(home?: string, onPath?: () => boolean): string | null;
|
|
111
|
-
/** Whether there's a Claude Code to run, on PATH or not. */
|
|
112
|
-
export declare function hasClaude(home?: string): boolean;
|
|
113
|
-
/**
|
|
114
|
-
* One headless Claude Code call with the person's own login: no tools, no MCP
|
|
115
|
-
* servers, no slash commands, nothing saved as a session (so this run never
|
|
116
|
-
* shows up as a past session), from a scratch folder so no repo's CLAUDE.md or
|
|
117
|
-
* hooks load. `TRAIL_NO_HOOKS` keeps trail's own user-level hooks quiet too.
|
|
118
|
-
* Past sessions by default; the PR review read brings its own system prompt
|
|
119
|
-
* and schema, with `findings` at the top. `skills` comes back when the schema
|
|
120
|
-
* has them.
|
|
121
|
-
*/
|
|
122
|
-
export declare function askClaude<T = RawFinding>(bin: string, prompt: string, model: string, timeoutMs: number, ask?: {
|
|
123
|
-
system: string;
|
|
124
|
-
schema: object;
|
|
125
|
-
}): Promise<{
|
|
126
|
-
findings: T[];
|
|
127
|
-
skills: RawSkill[];
|
|
128
|
-
costUsd?: number;
|
|
129
|
-
} | null>;
|
|
130
|
-
export declare function norm(s: string): string;
|
|
131
|
-
/** Where a finding's quotes can be: one past session's messages, or one PR's review comments. */
|
|
132
|
-
export interface QuoteSource {
|
|
133
|
-
id: string;
|
|
134
|
-
/** ISO time, for newest first. */
|
|
135
|
-
at: string;
|
|
136
|
-
/** What was said there, each through norm(). */
|
|
137
|
-
said: string[];
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* The sources a finding's quotes really are in, newest first, and the quotes
|
|
141
|
-
* that were found. A quote filed under the wrong source still counts for the
|
|
142
|
-
* one it's in; a quote under three words proves nothing.
|
|
143
|
-
*/
|
|
144
|
-
export declare function placeQuotes(evidence: {
|
|
145
|
-
cited?: QuoteSource;
|
|
146
|
-
quote?: string;
|
|
147
|
-
}[], sources: QuoteSource[]): {
|
|
148
|
-
places: QuoteSource[];
|
|
149
|
-
quotes: string[];
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* The findings whose quotes are really in the person's messages, in two or
|
|
153
|
-
* more sessions, best first. A quote filed under the wrong session still
|
|
154
|
-
* counts for the session it's in.
|
|
155
|
-
*/
|
|
156
|
-
export declare function verify(raw: RawFinding[], sessions: PastSession[], ids: Map<string, string>): Finding[];
|
|
157
|
-
/**
|
|
158
|
-
* The skills whose quotes are really in the person's messages, in two or more
|
|
159
|
-
* sessions, at most {@link MAX_SKILLS}, the ones said in the most sessions
|
|
160
|
-
* first. A skill needs a name, 2 to 8 steps and a place that's its own (not
|
|
161
|
-
* trail's or graft's skill); its title and steps are scrubbed.
|
|
162
|
-
*/
|
|
163
|
-
export declare function verifySkills(raw: RawSkill[], sessions: PastSession[], ids: Map<string, string>): FoundSkill[];
|
|
164
|
-
/** Anything that looks like a credential, a key or an email address, replaced. Learnings get committed. */
|
|
165
|
-
export declare function scrub(text: string): string;
|
|
166
|
-
/**
|
|
167
|
-
* What the person kept telling Claude in this repo, checked against their
|
|
168
|
-
* messages. Never throws: no sessions, no Claude Code, or a failed call come
|
|
169
|
-
* back as an empty list with the reason.
|
|
170
|
-
*/
|
|
171
|
-
export declare function findLearnings(repo: string, opts?: {
|
|
172
|
-
model?: string;
|
|
173
|
-
timeoutMs?: number;
|
|
174
|
-
home?: string;
|
|
175
|
-
limit?: number;
|
|
176
|
-
sessions?: PastSession[];
|
|
177
|
-
}): Promise<FindResult>;
|
|
178
|
-
export interface PastRead {
|
|
179
|
-
sessions: number;
|
|
180
|
-
started: number;
|
|
181
|
-
result: Promise<FindResult>;
|
|
182
|
-
done: boolean;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Start reading the repo's past Claude sessions, once per repo per machine,
|
|
186
|
-
* for `trail init` to collect at its end; null when there's nothing to read,
|
|
187
|
-
* it was read before, or TRAIL_NO_FETCH is set.
|
|
188
|
-
*/
|
|
189
|
-
export declare function beginPastRead(repo: string, env?: NodeJS.ProcessEnv): PastRead | null;
|
|
190
|
-
/**
|
|
191
|
-
* Each finding as a standing learning of the person's own, in ~/.trail: what
|
|
192
|
-
* someone kept telling their Claude is how they work, and their own Claude
|
|
193
|
-
* follows it. The team's learnings come from what is tied to the code: PR
|
|
194
|
-
* reviews and Claude's notes about the repo. The body says where it came from.
|
|
195
|
-
*/
|
|
196
|
-
export declare function saveFindings(repo: string, findings: Finding[], author?: string, date?: string): Note[];
|
|
197
|
-
/**
|
|
198
|
-
* Each found skill as a SKILL.md: the team's in the repo, the person's own in
|
|
199
|
-
* ~/.trail. Only the ones this call wrote come back: a skill of that name that
|
|
200
|
-
* was already there is left alone, and one that can't be written is skipped.
|
|
201
|
-
*/
|
|
202
|
-
export declare function saveSkills(repo: string, skills: FoundSkill[]): SavedSkill[];
|
|
203
|
-
/**
|
|
204
|
-
* Wait for the read, save the findings the person keeps, and remember the repo
|
|
205
|
-
* was read. Every finding is kept unless `keep` picks; `keep` resolving null
|
|
206
|
-
* means they cancelled, so nothing is saved and the next init asks again.
|
|
207
|
-
*/
|
|
208
|
-
export declare function finishPastRead(repo: string, read: PastRead, keep?: (findings: Finding[]) => Promise<Finding[] | null>): Promise<{
|
|
209
|
-
result: FindResult;
|
|
210
|
-
saved: Note[];
|
|
211
|
-
kept: Finding[];
|
|
212
|
-
skills: SavedSkill[];
|
|
213
|
-
cancelled: boolean;
|
|
214
|
-
}>;
|
|
215
|
-
export {};
|
|
5
|
+
export * from "../init/sessions.js";
|
|
6
|
+
export * from "../init/claude-call.js";
|
|
7
|
+
export * from "../init/look-back.js";
|
|
216
8
|
//# sourceMappingURL=cold-start.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cold-start.d.ts","sourceRoot":"","sources":["../../src/notes/cold-start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cold-start.d.ts","sourceRoot":"","sources":["../../src/notes/cold-start.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
|