@memnexus-ai/mx-agent-cli 0.1.294-next.0 → 0.1.295-next.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/dist/__tests__/agents-md-canonicalization.test.js +31 -1
- package/dist/__tests__/agents-md-canonicalization.test.js.map +1 -1
- package/dist/__tests__/behavioral-extraction.test.js +50 -0
- package/dist/__tests__/behavioral-extraction.test.js.map +1 -1
- package/dist/__tests__/bootstrap-behavioral-contract.test.js +6 -3
- package/dist/__tests__/bootstrap-behavioral-contract.test.js.map +1 -1
- package/dist/__tests__/bundle-config.test.js +28 -2
- package/dist/__tests__/bundle-config.test.js.map +1 -1
- package/dist/__tests__/catalog-interaction.test.d.ts +25 -0
- package/dist/__tests__/catalog-interaction.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-interaction.test.js +269 -0
- package/dist/__tests__/catalog-interaction.test.js.map +1 -0
- package/dist/__tests__/catalog-named-memories.test.d.ts +2 -0
- package/dist/__tests__/catalog-named-memories.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-named-memories.test.js +204 -0
- package/dist/__tests__/catalog-named-memories.test.js.map +1 -0
- package/dist/__tests__/catalog-origin-main.test.d.ts +15 -0
- package/dist/__tests__/catalog-origin-main.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-origin-main.test.js +296 -0
- package/dist/__tests__/catalog-origin-main.test.js.map +1 -0
- package/dist/__tests__/catalog.test.d.ts +2 -0
- package/dist/__tests__/catalog.test.d.ts.map +1 -0
- package/dist/__tests__/catalog.test.js +131 -0
- package/dist/__tests__/catalog.test.js.map +1 -0
- package/dist/__tests__/cli-build-integration.test.d.ts +2 -0
- package/dist/__tests__/cli-build-integration.test.d.ts.map +1 -0
- package/dist/__tests__/cli-build-integration.test.js +64 -0
- package/dist/__tests__/cli-build-integration.test.js.map +1 -0
- package/dist/__tests__/cli-build.test.d.ts +2 -0
- package/dist/__tests__/cli-build.test.d.ts.map +1 -0
- package/dist/__tests__/cli-build.test.js +640 -0
- package/dist/__tests__/cli-build.test.js.map +1 -0
- package/dist/__tests__/codex-deploy-config.test.js +60 -0
- package/dist/__tests__/codex-deploy-config.test.js.map +1 -1
- package/dist/__tests__/completion-rows-discriminate.test.d.ts +20 -0
- package/dist/__tests__/completion-rows-discriminate.test.d.ts.map +1 -0
- package/dist/__tests__/completion-rows-discriminate.test.js +481 -0
- package/dist/__tests__/completion-rows-discriminate.test.js.map +1 -0
- package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts +2 -0
- package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts.map +1 -0
- package/dist/__tests__/config-fidelity-archived-symlinks.test.js +127 -0
- package/dist/__tests__/config-fidelity-archived-symlinks.test.js.map +1 -0
- package/dist/__tests__/config-fidelity-display.test.d.ts +2 -0
- package/dist/__tests__/config-fidelity-display.test.d.ts.map +1 -0
- package/dist/__tests__/config-fidelity-display.test.js +77 -0
- package/dist/__tests__/config-fidelity-display.test.js.map +1 -0
- package/dist/__tests__/config-fidelity.test.js +166 -33
- package/dist/__tests__/config-fidelity.test.js.map +1 -1
- package/dist/__tests__/config-generation-gate.test.js +78 -0
- package/dist/__tests__/config-generation-gate.test.js.map +1 -1
- package/dist/__tests__/config-sync.test.js +35 -0
- package/dist/__tests__/config-sync.test.js.map +1 -1
- package/dist/__tests__/coordination-401-production-wiring.test.js +12 -7
- package/dist/__tests__/coordination-401-production-wiring.test.js.map +1 -1
- package/dist/__tests__/coordination-401-recovery.test.js +39 -32
- package/dist/__tests__/coordination-401-recovery.test.js.map +1 -1
- package/dist/__tests__/coordination-brief-pin.test.js +21 -8
- package/dist/__tests__/coordination-brief-pin.test.js.map +1 -1
- package/dist/__tests__/coordination-client.test.js +227 -3
- package/dist/__tests__/coordination-client.test.js.map +1 -1
- package/dist/__tests__/coordination-credential-endpoint.test.d.ts +24 -0
- package/dist/__tests__/coordination-credential-endpoint.test.d.ts.map +1 -0
- package/dist/__tests__/coordination-credential-endpoint.test.js +1230 -0
- package/dist/__tests__/coordination-credential-endpoint.test.js.map +1 -0
- package/dist/__tests__/coordination-memory.test.js +20 -4
- package/dist/__tests__/coordination-memory.test.js.map +1 -1
- package/dist/__tests__/coordination-provision.test.js +22 -14
- package/dist/__tests__/coordination-provision.test.js.map +1 -1
- package/dist/__tests__/coordination-status-registration.test.d.ts +16 -0
- package/dist/__tests__/coordination-status-registration.test.d.ts.map +1 -0
- package/dist/__tests__/coordination-status-registration.test.js +480 -0
- package/dist/__tests__/coordination-status-registration.test.js.map +1 -0
- package/dist/__tests__/coordination-token-multitenant.test.js +11 -11
- package/dist/__tests__/coordination-token-multitenant.test.js.map +1 -1
- package/dist/__tests__/coordination-token.test.js +35 -28
- package/dist/__tests__/coordination-token.test.js.map +1 -1
- package/dist/__tests__/creation-pr-class-check.test.d.ts +17 -0
- package/dist/__tests__/creation-pr-class-check.test.d.ts.map +1 -0
- package/dist/__tests__/creation-pr-class-check.test.js +346 -0
- package/dist/__tests__/creation-pr-class-check.test.js.map +1 -0
- package/dist/__tests__/digest-team-omission.test.d.ts +15 -0
- package/dist/__tests__/digest-team-omission.test.d.ts.map +1 -0
- package/dist/__tests__/digest-team-omission.test.js +247 -0
- package/dist/__tests__/digest-team-omission.test.js.map +1 -0
- package/dist/__tests__/doctor-worktree-path.test.d.ts +17 -0
- package/dist/__tests__/doctor-worktree-path.test.d.ts.map +1 -0
- package/dist/__tests__/doctor-worktree-path.test.js +158 -0
- package/dist/__tests__/doctor-worktree-path.test.js.map +1 -0
- package/dist/__tests__/fleet-data.test.js +40 -7
- package/dist/__tests__/fleet-data.test.js.map +1 -1
- package/dist/__tests__/fleet-tmux.test.js +2 -2
- package/dist/__tests__/fleet-tmux.test.js.map +1 -1
- package/dist/__tests__/generate-claude.test.js +137 -3
- package/dist/__tests__/generate-claude.test.js.map +1 -1
- package/dist/__tests__/git-env.test.d.ts +14 -0
- package/dist/__tests__/git-env.test.d.ts.map +1 -0
- package/dist/__tests__/git-env.test.js +131 -0
- package/dist/__tests__/git-env.test.js.map +1 -0
- package/dist/__tests__/git-identity-isolation.test.d.ts +33 -0
- package/dist/__tests__/git-identity-isolation.test.d.ts.map +1 -0
- package/dist/__tests__/git-identity-isolation.test.js +626 -0
- package/dist/__tests__/git-identity-isolation.test.js.map +1 -0
- package/dist/__tests__/hook-heal.test.js +17 -0
- package/dist/__tests__/hook-heal.test.js.map +1 -1
- package/dist/__tests__/init-coordination-url.test.d.ts +11 -0
- package/dist/__tests__/init-coordination-url.test.d.ts.map +1 -0
- package/dist/__tests__/init-coordination-url.test.js +114 -0
- package/dist/__tests__/init-coordination-url.test.js.map +1 -0
- package/dist/__tests__/memory-autocreate.test.js +574 -8
- package/dist/__tests__/memory-autocreate.test.js.map +1 -1
- package/dist/__tests__/memory-log-result.test.d.ts +13 -0
- package/dist/__tests__/memory-log-result.test.d.ts.map +1 -0
- package/dist/__tests__/memory-log-result.test.js +113 -0
- package/dist/__tests__/memory-log-result.test.js.map +1 -0
- package/dist/__tests__/memory-named-exists.test.d.ts +16 -0
- package/dist/__tests__/memory-named-exists.test.d.ts.map +1 -0
- package/dist/__tests__/memory-named-exists.test.js +288 -0
- package/dist/__tests__/memory-named-exists.test.js.map +1 -0
- package/dist/__tests__/mx-agent-cli-pin-validation.test.js +23 -47
- package/dist/__tests__/mx-agent-cli-pin-validation.test.js.map +1 -1
- package/dist/__tests__/mx-agent-cli-version-pin.test.js +34 -88
- package/dist/__tests__/mx-agent-cli-version-pin.test.js.map +1 -1
- package/dist/__tests__/new-project-first-team.test.d.ts +15 -0
- package/dist/__tests__/new-project-first-team.test.d.ts.map +1 -0
- package/dist/__tests__/new-project-first-team.test.js +263 -0
- package/dist/__tests__/new-project-first-team.test.js.map +1 -0
- package/dist/__tests__/otel-env.test.d.ts +2 -0
- package/dist/__tests__/otel-env.test.d.ts.map +1 -0
- package/dist/__tests__/otel-env.test.js +127 -0
- package/dist/__tests__/otel-env.test.js.map +1 -0
- package/dist/__tests__/project-config.test.js +283 -1
- package/dist/__tests__/project-config.test.js.map +1 -1
- package/dist/__tests__/provision-behavioral-contract.test.js +96 -4
- package/dist/__tests__/provision-behavioral-contract.test.js.map +1 -1
- package/dist/__tests__/provision-catalog-precondition.test.d.ts +26 -0
- package/dist/__tests__/provision-catalog-precondition.test.d.ts.map +1 -0
- package/dist/__tests__/provision-catalog-precondition.test.js +620 -0
- package/dist/__tests__/provision-catalog-precondition.test.js.map +1 -0
- package/dist/__tests__/provision-completion-rows.test.d.ts +17 -0
- package/dist/__tests__/provision-completion-rows.test.d.ts.map +1 -0
- package/dist/__tests__/provision-completion-rows.test.js +3095 -0
- package/dist/__tests__/provision-completion-rows.test.js.map +1 -0
- package/dist/__tests__/provision-identity-gate.test.d.ts +20 -0
- package/dist/__tests__/provision-identity-gate.test.d.ts.map +1 -0
- package/dist/__tests__/provision-identity-gate.test.js +600 -0
- package/dist/__tests__/provision-identity-gate.test.js.map +1 -0
- package/dist/__tests__/provision-resume.test.d.ts +26 -0
- package/dist/__tests__/provision-resume.test.d.ts.map +1 -0
- package/dist/__tests__/provision-resume.test.js +1164 -0
- package/dist/__tests__/provision-resume.test.js.map +1 -0
- package/dist/__tests__/provision-roleguide-anchors.test.d.ts +27 -0
- package/dist/__tests__/provision-roleguide-anchors.test.d.ts.map +1 -0
- package/dist/__tests__/provision-roleguide-anchors.test.js +747 -0
- package/dist/__tests__/provision-roleguide-anchors.test.js.map +1 -0
- package/dist/__tests__/provision-skeleton-fill.test.d.ts +16 -0
- package/dist/__tests__/provision-skeleton-fill.test.d.ts.map +1 -0
- package/dist/__tests__/provision-skeleton-fill.test.js +488 -0
- package/dist/__tests__/provision-skeleton-fill.test.js.map +1 -0
- package/dist/__tests__/provision-teambuilder-flow.test.js +93 -7
- package/dist/__tests__/provision-teambuilder-flow.test.js.map +1 -1
- package/dist/__tests__/repo-guard-wiring.test.d.ts +21 -0
- package/dist/__tests__/repo-guard-wiring.test.d.ts.map +1 -0
- package/dist/__tests__/repo-guard-wiring.test.js +638 -0
- package/dist/__tests__/repo-guard-wiring.test.js.map +1 -0
- package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts +2 -0
- package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts.map +1 -0
- package/dist/__tests__/runtime-codex-gateway-pilot.test.js +309 -0
- package/dist/__tests__/runtime-codex-gateway-pilot.test.js.map +1 -0
- package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts +2 -0
- package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts.map +1 -0
- package/dist/__tests__/runtime-codex-gateway-provider.test.js +163 -0
- package/dist/__tests__/runtime-codex-gateway-provider.test.js.map +1 -0
- package/dist/__tests__/runtime-identity.test.d.ts +2 -0
- package/dist/__tests__/runtime-identity.test.d.ts.map +1 -0
- package/dist/__tests__/runtime-identity.test.js +117 -0
- package/dist/__tests__/runtime-identity.test.js.map +1 -0
- package/dist/__tests__/session-pause-provisioning.test.js +6 -1
- package/dist/__tests__/session-pause-provisioning.test.js.map +1 -1
- package/dist/__tests__/session-record-disclosure.test.d.ts +24 -0
- package/dist/__tests__/session-record-disclosure.test.d.ts.map +1 -0
- package/dist/__tests__/session-record-disclosure.test.js +494 -0
- package/dist/__tests__/session-record-disclosure.test.js.map +1 -0
- package/dist/__tests__/session.test.js +35 -0
- package/dist/__tests__/session.test.js.map +1 -1
- package/dist/__tests__/slug-validation.test.js +27 -21
- package/dist/__tests__/slug-validation.test.js.map +1 -1
- package/dist/__tests__/standards-injection.test.js +23 -1
- package/dist/__tests__/standards-injection.test.js.map +1 -1
- package/dist/__tests__/start-interactive-role.test.d.ts +22 -0
- package/dist/__tests__/start-interactive-role.test.d.ts.map +1 -0
- package/dist/__tests__/start-interactive-role.test.js +204 -0
- package/dist/__tests__/start-interactive-role.test.js.map +1 -0
- package/dist/__tests__/start-team-identity.test.d.ts +25 -0
- package/dist/__tests__/start-team-identity.test.d.ts.map +1 -0
- package/dist/__tests__/start-team-identity.test.js +307 -0
- package/dist/__tests__/start-team-identity.test.js.map +1 -0
- package/dist/__tests__/team-memory-commands.test.js +142 -19
- package/dist/__tests__/team-memory-commands.test.js.map +1 -1
- package/dist/__tests__/template-sync.test.d.ts +19 -0
- package/dist/__tests__/template-sync.test.d.ts.map +1 -0
- package/dist/__tests__/template-sync.test.js +270 -0
- package/dist/__tests__/template-sync.test.js.map +1 -0
- package/dist/__tests__/test-project.test.d.ts +18 -0
- package/dist/__tests__/test-project.test.d.ts.map +1 -0
- package/dist/__tests__/test-project.test.js +465 -0
- package/dist/__tests__/test-project.test.js.map +1 -0
- package/dist/__tests__/usage-per-call-grouping.test.d.ts +25 -0
- package/dist/__tests__/usage-per-call-grouping.test.d.ts.map +1 -0
- package/dist/__tests__/usage-per-call-grouping.test.js +952 -0
- package/dist/__tests__/usage-per-call-grouping.test.js.map +1 -0
- package/dist/__tests__/verify-hooks-check-all.test.d.ts +32 -0
- package/dist/__tests__/verify-hooks-check-all.test.d.ts.map +1 -0
- package/dist/__tests__/verify-hooks-check-all.test.js +553 -0
- package/dist/__tests__/verify-hooks-check-all.test.js.map +1 -0
- package/dist/__tests__/worktree-sync-fixture.test.d.ts +17 -0
- package/dist/__tests__/worktree-sync-fixture.test.d.ts.map +1 -0
- package/dist/__tests__/worktree-sync-fixture.test.js +519 -0
- package/dist/__tests__/worktree-sync-fixture.test.js.map +1 -0
- package/dist/__tests__/worktree-sync-hardening.test.d.ts +13 -0
- package/dist/__tests__/worktree-sync-hardening.test.d.ts.map +1 -0
- package/dist/__tests__/worktree-sync-hardening.test.js +919 -0
- package/dist/__tests__/worktree-sync-hardening.test.js.map +1 -0
- package/dist/__tests__/worktree-sync-shell-free.test.d.ts +25 -0
- package/dist/__tests__/worktree-sync-shell-free.test.d.ts.map +1 -0
- package/dist/__tests__/worktree-sync-shell-free.test.js +185 -0
- package/dist/__tests__/worktree-sync-shell-free.test.js.map +1 -0
- package/dist/__tests__/worktree.test.js +75 -1
- package/dist/__tests__/worktree.test.js.map +1 -1
- package/dist/agent-config/.mx-config-generation.json +2 -2
- package/dist/agent-config/AGENTS.md.template +2 -2
- package/dist/agent-config/agents/bar-raiser.md +34 -1
- package/dist/agent-config/agents/red-team.md +34 -1
- package/dist/agent-config/agents/security-reviewer.md +22 -1
- package/dist/agent-config/claude-md/CLAUDE.core.md +6 -1
- package/dist/agent-config/claude-md/CLAUDE.overlay.memnexus.md +1 -3
- package/dist/agent-config/coordination-rosters.generated.json +10 -0
- package/dist/agent-config/hooks/HOOK-TIMEOUTS.md +27 -1
- package/dist/agent-config/hooks/OR-TRUE-AUDIT.md +8 -8
- package/dist/agent-config/hooks/auto-capture-precompact.sh +279 -0
- package/dist/agent-config/hooks/auto-capture-session-end.sh +277 -0
- package/dist/agent-config/hooks/coordination-brief.sh +290 -245
- package/dist/agent-config/hooks/deploy-verification-reminder.sh +359 -22
- package/dist/agent-config/hooks/git-mutation-guard.sh +85 -13
- package/dist/agent-config/hooks/session-idle-gate.sh +177 -12
- package/dist/agent-config/hooks/subagent-write-guard.sh +670 -0
- package/dist/agent-config/hooks/worktree-guard.sh +36 -7
- package/dist/agent-config/settings.json +15 -2
- package/dist/agent-config/shared/creation-pr-review-checklist.md +317 -0
- package/dist/commands/bootstrap.d.ts.map +1 -1
- package/dist/commands/bootstrap.js +22 -10
- package/dist/commands/bootstrap.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +28 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/coordination.d.ts +150 -8
- package/dist/commands/coordination.d.ts.map +1 -1
- package/dist/commands/coordination.js +519 -25
- package/dist/commands/coordination.js.map +1 -1
- package/dist/commands/create.d.ts +913 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +4879 -345
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/digest.d.ts.map +1 -1
- package/dist/commands/digest.js +91 -7
- package/dist/commands/digest.js.map +1 -1
- package/dist/commands/fleet-tmux.js +1 -1
- package/dist/commands/fleet-tmux.js.map +1 -1
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +26 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.d.ts +32 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +98 -5
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new.d.ts +2 -0
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +114 -21
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/session.js +1 -1
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/start.d.ts +38 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +171 -8
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/sync.d.ts +57 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +117 -3
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/usage.d.ts +64 -0
- package/dist/commands/usage.d.ts.map +1 -1
- package/dist/commands/usage.js +96 -3
- package/dist/commands/usage.js.map +1 -1
- package/dist/commands/verify-hooks.d.ts +37 -1
- package/dist/commands/verify-hooks.d.ts.map +1 -1
- package/dist/commands/verify-hooks.js +114 -2
- package/dist/commands/verify-hooks.js.map +1 -1
- package/dist/commands/window.d.ts +10 -0
- package/dist/commands/window.d.ts.map +1 -0
- package/dist/commands/window.js +265 -0
- package/dist/commands/window.js.map +1 -0
- package/dist/commands/worktree-sync.d.ts +54 -0
- package/dist/commands/worktree-sync.d.ts.map +1 -0
- package/dist/commands/worktree-sync.js +135 -0
- package/dist/commands/worktree-sync.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -11
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-session.d.ts.map +1 -1
- package/dist/lib/agent-session.js +6 -1
- package/dist/lib/agent-session.js.map +1 -1
- package/dist/lib/catalog.d.ts +321 -2
- package/dist/lib/catalog.d.ts.map +1 -1
- package/dist/lib/catalog.js +490 -11
- package/dist/lib/catalog.js.map +1 -1
- package/dist/lib/claude.d.ts +53 -23
- package/dist/lib/claude.d.ts.map +1 -1
- package/dist/lib/claude.js +306 -17
- package/dist/lib/claude.js.map +1 -1
- package/dist/lib/cli-build.d.ts +172 -0
- package/dist/lib/cli-build.d.ts.map +1 -0
- package/dist/lib/cli-build.js +654 -0
- package/dist/lib/cli-build.js.map +1 -0
- package/dist/lib/code-context-file.d.ts +109 -0
- package/dist/lib/code-context-file.d.ts.map +1 -0
- package/dist/lib/code-context-file.js +219 -0
- package/dist/lib/code-context-file.js.map +1 -0
- package/dist/lib/code-context-file.test.d.ts +19 -0
- package/dist/lib/code-context-file.test.d.ts.map +1 -0
- package/dist/lib/code-context-file.test.js +202 -0
- package/dist/lib/code-context-file.test.js.map +1 -0
- package/dist/lib/config-fidelity.d.ts +40 -20
- package/dist/lib/config-fidelity.d.ts.map +1 -1
- package/dist/lib/config-fidelity.js +144 -56
- package/dist/lib/config-fidelity.js.map +1 -1
- package/dist/lib/coordination-client.d.ts +73 -0
- package/dist/lib/coordination-client.d.ts.map +1 -1
- package/dist/lib/coordination-client.js +180 -8
- package/dist/lib/coordination-client.js.map +1 -1
- package/dist/lib/coordination-token.d.ts +304 -6
- package/dist/lib/coordination-token.d.ts.map +1 -1
- package/dist/lib/coordination-token.js +851 -52
- package/dist/lib/coordination-token.js.map +1 -1
- package/dist/lib/fleet-data.d.ts +34 -0
- package/dist/lib/fleet-data.d.ts.map +1 -1
- package/dist/lib/fleet-data.js +37 -9
- package/dist/lib/fleet-data.js.map +1 -1
- package/dist/lib/fleet-render.js +1 -1
- package/dist/lib/fleet-render.js.map +1 -1
- package/dist/lib/git-identity.d.ts +302 -0
- package/dist/lib/git-identity.d.ts.map +1 -0
- package/dist/lib/git-identity.js +546 -0
- package/dist/lib/git-identity.js.map +1 -0
- package/dist/lib/hook-staleness.d.ts +95 -0
- package/dist/lib/hook-staleness.d.ts.map +1 -0
- package/dist/lib/hook-staleness.js +304 -0
- package/dist/lib/hook-staleness.js.map +1 -0
- package/dist/lib/jsonl.d.ts +270 -2
- package/dist/lib/jsonl.d.ts.map +1 -1
- package/dist/lib/jsonl.js +472 -76
- package/dist/lib/jsonl.js.map +1 -1
- package/dist/lib/memory.d.ts +350 -23
- package/dist/lib/memory.d.ts.map +1 -1
- package/dist/lib/memory.js +751 -38
- package/dist/lib/memory.js.map +1 -1
- package/dist/lib/otel-env.d.ts +90 -0
- package/dist/lib/otel-env.d.ts.map +1 -0
- package/dist/lib/otel-env.js +98 -0
- package/dist/lib/otel-env.js.map +1 -0
- package/dist/lib/project-config.d.ts +167 -0
- package/dist/lib/project-config.d.ts.map +1 -1
- package/dist/lib/project-config.js +321 -5
- package/dist/lib/project-config.js.map +1 -1
- package/dist/lib/projects-registry.d.ts +82 -0
- package/dist/lib/projects-registry.d.ts.map +1 -0
- package/dist/lib/projects-registry.js +145 -0
- package/dist/lib/projects-registry.js.map +1 -0
- package/dist/lib/projects-registry.test.d.ts +2 -0
- package/dist/lib/projects-registry.test.d.ts.map +1 -0
- package/dist/lib/projects-registry.test.js +176 -0
- package/dist/lib/projects-registry.test.js.map +1 -0
- package/dist/lib/repo-guard-scope.d.ts +126 -0
- package/dist/lib/repo-guard-scope.d.ts.map +1 -0
- package/dist/lib/repo-guard-scope.js +249 -0
- package/dist/lib/repo-guard-scope.js.map +1 -0
- package/dist/lib/roster.d.ts +87 -0
- package/dist/lib/roster.d.ts.map +1 -0
- package/dist/lib/roster.js +332 -0
- package/dist/lib/roster.js.map +1 -0
- package/dist/lib/roster.test.d.ts +15 -0
- package/dist/lib/roster.test.d.ts.map +1 -0
- package/dist/lib/roster.test.js +299 -0
- package/dist/lib/roster.test.js.map +1 -0
- package/dist/lib/runtime/codex-adapter.d.ts.map +1 -1
- package/dist/lib/runtime/codex-adapter.js +5 -0
- package/dist/lib/runtime/codex-adapter.js.map +1 -1
- package/dist/lib/runtime/codex-config.d.ts +129 -0
- package/dist/lib/runtime/codex-config.d.ts.map +1 -1
- package/dist/lib/runtime/codex-config.js +225 -0
- package/dist/lib/runtime/codex-config.js.map +1 -1
- package/dist/lib/runtime/identity.d.ts +72 -0
- package/dist/lib/runtime/identity.d.ts.map +1 -0
- package/dist/lib/runtime/identity.js +128 -0
- package/dist/lib/runtime/identity.js.map +1 -0
- package/dist/lib/standards.d.ts +10 -1
- package/dist/lib/standards.d.ts.map +1 -1
- package/dist/lib/standards.js +8 -1
- package/dist/lib/standards.js.map +1 -1
- package/dist/lib/team-identity.d.ts +134 -0
- package/dist/lib/team-identity.d.ts.map +1 -0
- package/dist/lib/team-identity.js +193 -0
- package/dist/lib/team-identity.js.map +1 -0
- package/dist/lib/templates.d.ts +29 -2
- package/dist/lib/templates.d.ts.map +1 -1
- package/dist/lib/templates.js +1042 -82
- package/dist/lib/templates.js.map +1 -1
- package/dist/lib/test-project.d.ts +95 -0
- package/dist/lib/test-project.d.ts.map +1 -0
- package/dist/lib/test-project.js +103 -0
- package/dist/lib/test-project.js.map +1 -0
- package/dist/lib/vault.d.ts +60 -0
- package/dist/lib/vault.d.ts.map +1 -0
- package/dist/lib/vault.js +102 -0
- package/dist/lib/vault.js.map +1 -0
- package/dist/lib/vault.test.d.ts +17 -0
- package/dist/lib/vault.test.d.ts.map +1 -0
- package/dist/lib/vault.test.js +169 -0
- package/dist/lib/vault.test.js.map +1 -0
- package/dist/lib/window-view.d.ts +63 -0
- package/dist/lib/window-view.d.ts.map +1 -0
- package/dist/lib/window-view.js +217 -0
- package/dist/lib/window-view.js.map +1 -0
- package/dist/lib/window-view.test.d.ts +2 -0
- package/dist/lib/window-view.test.d.ts.map +1 -0
- package/dist/lib/window-view.test.js +168 -0
- package/dist/lib/window-view.test.js.map +1 -0
- package/dist/lib/worktree-sync.d.ts +439 -0
- package/dist/lib/worktree-sync.d.ts.map +1 -0
- package/dist/lib/worktree-sync.js +1167 -0
- package/dist/lib/worktree-sync.js.map +1 -0
- package/dist/lib/worktree.d.ts +58 -1
- package/dist/lib/worktree.d.ts.map +1 -1
- package/dist/lib/worktree.js +91 -4
- package/dist/lib/worktree.js.map +1 -1
- package/dist/standards/decision-request.md +8 -0
- package/dist/standards/po-communication-standard.md +126 -0
- package/dist/standards/report-format.md +8 -0
- package/dist/standards/writing-standard.md +146 -4
- package/package.json +1 -1
- package/scripts/generate-claude.mjs +119 -46
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-staleness.d.ts","sourceRoot":"","sources":["../../src/lib/hook-staleness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAgDH,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,mBAAmB,CAAC;AAE3E,MAAM,WAAW,SAAS;IACxB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB;;;OAGG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAwCD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,EACpB,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAO,GACxD,mBAAmB,CAsLrB"}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hook-staleness.ts — is a MATERIALISED hook behind its source? (#306)
|
|
3
|
+
*
|
|
4
|
+
* PROBLEM. `hook-completeness.ts` answers "is a registered hook PRESENT". A hook
|
|
5
|
+
* that is present but STALE passes that check and is never reported. The
|
|
6
|
+
* measured harm (v23 runtime probe, 2026-08-30): the pre-#298
|
|
7
|
+
* `coordination-brief.sh` prints nothing on any stream and exits 0 when `az` is
|
|
8
|
+
* unavailable, so a session starts believing it has no coordination. The
|
|
9
|
+
* registration strings in `agent-config/settings.json` run a present hook
|
|
10
|
+
* directly (`[ -f "$H" ] && [ ! -L "$H" ] && exec bash "$H"`) and reach
|
|
11
|
+
* `hook-launcher.sh` only when the file is MISSING, so the launcher's auto-heal
|
|
12
|
+
* never sees this state. Before this module the only detector was
|
|
13
|
+
* `mx-agent doctor`, run by hand.
|
|
14
|
+
*
|
|
15
|
+
* WHAT IT COMPARES. The bytes of each materialised `.claude/hooks/<name>`
|
|
16
|
+
* against the bytes of `origin/<baseBranch>:<configSource>/hooks/<name>` — the
|
|
17
|
+
* same reference `verifyAndHealHooks` materialises from (claude.ts:1236-1287)
|
|
18
|
+
* and the same one `reportConfigFidelity` reads (config-fidelity.ts). One
|
|
19
|
+
* reference point, not two: #247's false-DRIFT mechanism needs a base layer at
|
|
20
|
+
* `origin/main` AND an overlay at the worktree's own base, and this check has
|
|
21
|
+
* only the first, so it is immune to #247 by construction.
|
|
22
|
+
*
|
|
23
|
+
* NO FETCH. A checker must not perform network I/O as a side effect
|
|
24
|
+
* (config-fidelity.ts:862-866). When `origin/<baseBranch>` is not present
|
|
25
|
+
* locally the verdict is COULD_NOT_COMPARE with a reason that names the fetch —
|
|
26
|
+
* never FRESH. Passed, failed and could-not-run are three outcomes.
|
|
27
|
+
*
|
|
28
|
+
* WHICH FILES. The candidate names are the intersection of (a) the entries of
|
|
29
|
+
* the worktree's `.claude/hooks/` and (b) the hook basenames the worktree's
|
|
30
|
+
* `.claude/settings.json` REGISTERS. Nothing else is read. The registered set is
|
|
31
|
+
* what bounds the printed file name to a reviewed value: anyone who can write
|
|
32
|
+
* into `.claude/hooks/` can otherwise choose the text this check prints into a
|
|
33
|
+
* session (#306 criterion 4).
|
|
34
|
+
*
|
|
35
|
+
* WHERE THE TWO SETTINGS COME FROM. `baseBranch` and `configSource` are read
|
|
36
|
+
* from `mx-agent.config.json` at the worktree path. That file is absent in most
|
|
37
|
+
* worktrees, and the defaults it falls back to (`main` and
|
|
38
|
+
* `mx-agent-system/agent-config`) are the intended answer for that case, not a
|
|
39
|
+
* degraded one: they are the same pair every other caller defaults to, and a
|
|
40
|
+
* worktree that has no project config is a worktree tracking the repository's
|
|
41
|
+
* own layout. `baseBranch` is checked against BASE_BRANCH_RE before use,
|
|
42
|
+
* because it is a worktree-writable value that would otherwise be printed
|
|
43
|
+
* verbatim into a session.
|
|
44
|
+
*
|
|
45
|
+
* SPAWN BUDGET. One `git cat-file --batch` for the whole set in the common
|
|
46
|
+
* (fresh) case, plus one `git hash-object` only when something is stale. The
|
|
47
|
+
* SessionStart budget is 300 ms for the whole command (#306 criterion 1d); a
|
|
48
|
+
* per-file `git show` would be 44 processes and would not meet it.
|
|
49
|
+
*/
|
|
50
|
+
import { spawnSync } from 'child_process';
|
|
51
|
+
import { existsSync, lstatSync, readdirSync, readFileSync } from 'fs';
|
|
52
|
+
import { join } from 'path';
|
|
53
|
+
import { collectHookReferences } from './hook-completeness.js';
|
|
54
|
+
import { loadProjectConfig, resolveProjectConfig } from './project-config.js';
|
|
55
|
+
/**
|
|
56
|
+
* Wall-clock cap on each subprocess this module spawns.
|
|
57
|
+
*
|
|
58
|
+
* 3 s, not 5. This module spawns at most three git processes (the ref probe,
|
|
59
|
+
* the batch read, the hash-object pass), and the SessionStart registration
|
|
60
|
+
* wraps the whole command in `timeout 10`. At 5 s the worst case is 15 s, which
|
|
61
|
+
* the outer limit cuts short: the wrapper then reports exit 124 rather than the
|
|
62
|
+
* reason, so the operator learns the check was killed and not what it found. At
|
|
63
|
+
* 3 s the worst case is 9 s and every path finishes inside the budget with its
|
|
64
|
+
* own message. The measured median for the whole command against 44 hooks is
|
|
65
|
+
* 9.5 ms in process and 231 ms as a real subprocess, so 3 s is over 4000x the
|
|
66
|
+
* median for a single spawn.
|
|
67
|
+
*/
|
|
68
|
+
const GIT_TIMEOUT_MS = 3_000;
|
|
69
|
+
/** Cap on the batched blob read. 44 hooks, ~20KB each; 32MB is ample. */
|
|
70
|
+
const GIT_MAX_BUFFER_BYTES = 32 * 1024 * 1024;
|
|
71
|
+
/**
|
|
72
|
+
* The only hook basenames this module will name in output. Anchored, no path
|
|
73
|
+
* separator, no `..`. A name that fails this is not compared and is reported as
|
|
74
|
+
* undetermined under a fixed label, so it is neither printed nor silently
|
|
75
|
+
* treated as fresh.
|
|
76
|
+
*/
|
|
77
|
+
const HOOK_NAME_RE = /^[A-Za-z0-9._-]+\.sh$/;
|
|
78
|
+
/**
|
|
79
|
+
* The only `baseBranch` values this module will use or name in output.
|
|
80
|
+
* `mx-agent.config.json` is writable by anyone with shell in the worktree, and
|
|
81
|
+
* every line this command prints embeds the branch name (`origin/<baseBranch>`)
|
|
82
|
+
* and reaches the model at session start. Measured: a value carrying a whole
|
|
83
|
+
* sentence reached stdout. A value that fails this is not compared, and the
|
|
84
|
+
* bail reason names the file rather than the value. The 100-character cap is
|
|
85
|
+
* well above any real ref name and bounds the line length.
|
|
86
|
+
*/
|
|
87
|
+
const BASE_BRANCH_RE = /^[A-Za-z0-9._\-/]{1,100}$/;
|
|
88
|
+
/** What the result reports as the branch when the configured value is unusable. */
|
|
89
|
+
const UNUSABLE_BASE_BRANCH = '<unusable>';
|
|
90
|
+
/**
|
|
91
|
+
* Parse `git cat-file --batch` output. Each found object is
|
|
92
|
+
* `<oid> SP <type> SP <size> LF <content> LF`; each absent one is
|
|
93
|
+
* `<input> SP missing LF`. Records are returned in input order, with `null` for
|
|
94
|
+
* a missing or non-blob entry. Returns null for the whole batch when the stream
|
|
95
|
+
* does not parse, which the caller reports as undetermined.
|
|
96
|
+
*/
|
|
97
|
+
function parseBatch(buf, expected) {
|
|
98
|
+
const out = [];
|
|
99
|
+
let off = 0;
|
|
100
|
+
while (out.length < expected) {
|
|
101
|
+
const nl = buf.indexOf(0x0a, off);
|
|
102
|
+
if (nl === -1)
|
|
103
|
+
return null;
|
|
104
|
+
const header = buf.toString('utf-8', off, nl);
|
|
105
|
+
off = nl + 1;
|
|
106
|
+
const parts = header.split(' ');
|
|
107
|
+
if (parts[parts.length - 1] === 'missing') {
|
|
108
|
+
out.push(null);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (parts.length !== 3)
|
|
112
|
+
return null;
|
|
113
|
+
const [oid, type, sizeStr] = parts;
|
|
114
|
+
const size = Number(sizeStr);
|
|
115
|
+
if (!/^[0-9a-f]{7,64}$/.test(oid) || !Number.isInteger(size) || size < 0)
|
|
116
|
+
return null;
|
|
117
|
+
if (off + size > buf.length)
|
|
118
|
+
return null;
|
|
119
|
+
const content = buf.subarray(off, off + size);
|
|
120
|
+
off += size + 1; // trailing LF git appends after the content
|
|
121
|
+
out.push(type === 'blob' ? { oid, content } : null);
|
|
122
|
+
}
|
|
123
|
+
return out;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Byte-compare every registered, materialised hook against
|
|
127
|
+
* `origin/<baseBranch>`. Never throws: every failure becomes an `undetermined`
|
|
128
|
+
* reason and the COULD_NOT_COMPARE verdict.
|
|
129
|
+
*
|
|
130
|
+
* `opts.path` is the worktree, and the project config is read from THAT
|
|
131
|
+
* directory rather than through `findProjectRoot()`, which ascends to the main
|
|
132
|
+
* worktree. The check reports on the worktree it runs in, and it must not read
|
|
133
|
+
* a directory outside it.
|
|
134
|
+
*/
|
|
135
|
+
export function checkHookStaleness(worktreePath, opts = {}) {
|
|
136
|
+
let cfg = {};
|
|
137
|
+
try {
|
|
138
|
+
cfg = resolveProjectConfig(loadProjectConfig(worktreePath));
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// A malformed mx-agent.config.json is not this check's business; the
|
|
142
|
+
// defaults below are the same ones every other caller falls back to.
|
|
143
|
+
}
|
|
144
|
+
const configuredBase = opts.baseBranch ?? cfg.baseBranch ?? 'main';
|
|
145
|
+
const configSource = opts.configSource ?? cfg.configSource ?? 'mx-agent-system/agent-config';
|
|
146
|
+
const baseUsable = BASE_BRANCH_RE.test(configuredBase);
|
|
147
|
+
const baseBranch = baseUsable ? configuredBase : UNUSABLE_BASE_BRANCH;
|
|
148
|
+
const undetermined = [];
|
|
149
|
+
const stale = [];
|
|
150
|
+
let anchor;
|
|
151
|
+
const bail = (reason) => ({
|
|
152
|
+
verdict: 'COULD_NOT_COMPARE', baseBranch, anchor, compared: 0, stale: [], undetermined: [reason],
|
|
153
|
+
});
|
|
154
|
+
// The branch name is embedded in every line this command prints, so it is
|
|
155
|
+
// checked before any of them can be built. The reason names the file, never
|
|
156
|
+
// the value: printing it is the harm being prevented.
|
|
157
|
+
if (!baseUsable) {
|
|
158
|
+
return bail('mx-agent.config.json baseBranch is not a usable ref name, so no comparison was made');
|
|
159
|
+
}
|
|
160
|
+
// ── 1. the registered set ────────────────────────────────────────────────
|
|
161
|
+
const settingsPath = join(worktreePath, '.claude', 'settings.json');
|
|
162
|
+
if (!existsSync(settingsPath)) {
|
|
163
|
+
return bail('.claude/settings.json is absent, so the registered hook set is unknown');
|
|
164
|
+
}
|
|
165
|
+
let registered;
|
|
166
|
+
try {
|
|
167
|
+
const parsed = JSON.parse(readFileSync(settingsPath, 'utf-8'));
|
|
168
|
+
const refs = collectHookReferences(parsed);
|
|
169
|
+
registered = new Set(refs.paths.map((p) => p.slice(p.lastIndexOf('/') + 1)));
|
|
170
|
+
// A registration that names `.claude/hooks/` without a resolvable canonical
|
|
171
|
+
// path (an interpolated name, say) registers a hook this module cannot
|
|
172
|
+
// identify, so that hook is never compared. Silence there would read as
|
|
173
|
+
// fresh. Reported by COUNT and never by text: `unresolved` holds command
|
|
174
|
+
// snippets from settings.json, and printing one would put worktree-writable
|
|
175
|
+
// text into the session under this check's name (#306 criterion 4).
|
|
176
|
+
if (refs.unresolved.length > 0) {
|
|
177
|
+
undetermined.push(`${refs.unresolved.length} registration(s) name .claude/hooks/ non-canonically, ` +
|
|
178
|
+
'so those hooks were not compared');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
return bail('.claude/settings.json is not readable JSON, so the registered hook set is unknown');
|
|
183
|
+
}
|
|
184
|
+
if (registered.size === 0) {
|
|
185
|
+
return bail('.claude/settings.json registers no hooks, so there is nothing to compare');
|
|
186
|
+
}
|
|
187
|
+
// ── 2. the materialised set ──────────────────────────────────────────────
|
|
188
|
+
const hooksDir = join(worktreePath, '.claude', 'hooks');
|
|
189
|
+
let entries;
|
|
190
|
+
try {
|
|
191
|
+
entries = readdirSync(hooksDir);
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
return bail('.claude/hooks/ is absent or unreadable, so no deployed hook could be read');
|
|
195
|
+
}
|
|
196
|
+
const names = [];
|
|
197
|
+
for (const name of entries.sort()) {
|
|
198
|
+
if (!registered.has(name))
|
|
199
|
+
continue; // not a hook any session runs
|
|
200
|
+
if (!HOOK_NAME_RE.test(name)) {
|
|
201
|
+
// Registered under a name this module will not print. Named by count, not
|
|
202
|
+
// by value, so nothing attacker-chosen reaches the session.
|
|
203
|
+
undetermined.push('a registered hook file has a name outside [A-Za-z0-9._-]+.sh and was not compared');
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
let st;
|
|
207
|
+
try {
|
|
208
|
+
st = lstatSync(join(hooksDir, name));
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
undetermined.push(`${name} could not be stat'd under .claude/hooks/`);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
if (!st.isFile()) {
|
|
215
|
+
undetermined.push(`${name} under .claude/hooks/ is not a regular file`);
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
names.push(name);
|
|
219
|
+
}
|
|
220
|
+
if (names.length === 0) {
|
|
221
|
+
undetermined.push('no registered hook file was readable under .claude/hooks/');
|
|
222
|
+
return { verdict: 'COULD_NOT_COMPARE', baseBranch, anchor, compared: 0, stale, undetermined };
|
|
223
|
+
}
|
|
224
|
+
// ── 3. the source bytes, from git, without fetching ──────────────────────
|
|
225
|
+
// The ref check is separate from the batch read on purpose: `git cat-file
|
|
226
|
+
// --batch` reports an unresolvable ref as `missing` per path, which is
|
|
227
|
+
// indistinguishable from "this hook is not in the source tree" and would be
|
|
228
|
+
// read as nothing to compare.
|
|
229
|
+
const refProbe = spawnSync('git', ['rev-parse', '--verify', '--quiet', '--end-of-options', `origin/${baseBranch}^{commit}`], { cwd: worktreePath, stdio: 'pipe', timeout: GIT_TIMEOUT_MS });
|
|
230
|
+
if (refProbe.error) {
|
|
231
|
+
return bail(`git could not be run in this worktree (${refProbe.error.message})`);
|
|
232
|
+
}
|
|
233
|
+
if (refProbe.status !== 0) {
|
|
234
|
+
return bail(`origin/${baseBranch} does not resolve in this worktree; ` +
|
|
235
|
+
`this check never fetches, so run: git -C '${worktreePath}' fetch origin`);
|
|
236
|
+
}
|
|
237
|
+
// The commit the whole verdict is measured against. Reported so a reader can
|
|
238
|
+
// check the anchor before running a remedy: this ref is local, no fetch
|
|
239
|
+
// refreshed it, and anything that can write to the worktree can move it.
|
|
240
|
+
const resolved = String(refProbe.stdout ?? '').trim();
|
|
241
|
+
if (/^[0-9a-f]{40}$/.test(resolved))
|
|
242
|
+
anchor = resolved;
|
|
243
|
+
const paths = names.map((n) => `origin/${baseBranch}:${configSource}/hooks/${n}`);
|
|
244
|
+
const batch = spawnSync('git', ['cat-file', '--batch'], {
|
|
245
|
+
cwd: worktreePath,
|
|
246
|
+
// A Buffer, not a string: `encoding: 'buffer'` also decides how spawnSync
|
|
247
|
+
// encodes `input`, and "buffer" is not an input encoding Node accepts.
|
|
248
|
+
input: Buffer.from(paths.join('\n') + '\n', 'utf-8'),
|
|
249
|
+
encoding: 'buffer',
|
|
250
|
+
maxBuffer: GIT_MAX_BUFFER_BYTES,
|
|
251
|
+
timeout: GIT_TIMEOUT_MS,
|
|
252
|
+
});
|
|
253
|
+
if (batch.error) {
|
|
254
|
+
return bail(`git cat-file could not be run in this worktree (${batch.error.message})`);
|
|
255
|
+
}
|
|
256
|
+
if (batch.status !== 0 || !batch.stdout) {
|
|
257
|
+
return bail(`git cat-file failed against origin/${baseBranch}`);
|
|
258
|
+
}
|
|
259
|
+
const records = parseBatch(batch.stdout, names.length);
|
|
260
|
+
if (records === null) {
|
|
261
|
+
return bail(`git cat-file output could not be parsed for origin/${baseBranch}`);
|
|
262
|
+
}
|
|
263
|
+
// ── 4. compare ───────────────────────────────────────────────────────────
|
|
264
|
+
let compared = 0;
|
|
265
|
+
const differing = [];
|
|
266
|
+
for (let i = 0; i < names.length; i++) {
|
|
267
|
+
const rec = records[i];
|
|
268
|
+
// Absent at the source is not staleness: the file is deployed from a tree
|
|
269
|
+
// that no longer carries it, which config-fidelity's reverse pass owns.
|
|
270
|
+
if (rec === null)
|
|
271
|
+
continue;
|
|
272
|
+
let deployed;
|
|
273
|
+
try {
|
|
274
|
+
deployed = readFileSync(join(hooksDir, names[i]));
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
undetermined.push(`${names[i]} could not be read under .claude/hooks/`);
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
compared++;
|
|
281
|
+
if (!deployed.equals(rec.content))
|
|
282
|
+
differing.push({ name: names[i], sourceOid: rec.oid });
|
|
283
|
+
}
|
|
284
|
+
// ── 5. the deployed object ids, only for what differs ────────────────────
|
|
285
|
+
if (differing.length > 0) {
|
|
286
|
+
const hash = spawnSync('git', ['hash-object', '--no-filters', '--', ...differing.map((d) => join(hooksDir, d.name))], { cwd: worktreePath, encoding: 'utf-8', timeout: GIT_TIMEOUT_MS });
|
|
287
|
+
const oids = hash.status === 0 && hash.stdout ? hash.stdout.trim().split('\n') : [];
|
|
288
|
+
for (let i = 0; i < differing.length; i++) {
|
|
289
|
+
const oid = oids[i];
|
|
290
|
+
if (!oid || !/^[0-9a-f]{7,64}$/.test(oid)) {
|
|
291
|
+
// The difference is established; only the label for it is missing.
|
|
292
|
+
undetermined.push(`${differing[i].name} differs from the source but its object id could not be computed`);
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
stale.push({ name: differing[i].name, deployedOid: oid, sourceOid: differing[i].sourceOid });
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// STALE outranks COULD_NOT_COMPARE: both are non-zero and both print their
|
|
299
|
+
// lines, and a named stale hook is the more specific, more actionable answer.
|
|
300
|
+
// FRESH is reachable only when nothing is undetermined.
|
|
301
|
+
const verdict = stale.length > 0 ? 'STALE' : undetermined.length > 0 ? 'COULD_NOT_COMPARE' : 'FRESH';
|
|
302
|
+
return { verdict, baseBranch, anchor, compared, stale, undetermined };
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=hook-staleness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-staleness.js","sourceRoot":"","sources":["../../src/lib/hook-staleness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,yEAAyE;AACzE,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,YAAY,GAAG,uBAAuB,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AAE,GAAG,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC;IAED,2EAA2E;IAC3E,8EAA8E;IAC9E,wDAAwD;IACxD,MAAM,OAAO,GACX,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC;IACvF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AACxE,CAAC"}
|
package/dist/lib/jsonl.d.ts
CHANGED
|
@@ -67,6 +67,25 @@ export interface Totals {
|
|
|
67
67
|
models: Set<string>;
|
|
68
68
|
mxCalls: number;
|
|
69
69
|
mxEstTokens: number;
|
|
70
|
+
/** Billed calls reconstructed from a requestId or message.id group (#307). */
|
|
71
|
+
usageGrouped: number;
|
|
72
|
+
/** Usage lines with neither key, counted once each and never merged (#307). */
|
|
73
|
+
usageUngrouped: number;
|
|
74
|
+
/** Groups where a field that must be constant varied across lines (#307). */
|
|
75
|
+
usageInconsistent: number;
|
|
76
|
+
/**
|
|
77
|
+
* Rows no line of which carried a timestamp this code can read (#307). These
|
|
78
|
+
* are counted in the recent window as well as the all-time total, so this is
|
|
79
|
+
* the count of rows the window holds on that rule rather than on their date.
|
|
80
|
+
*/
|
|
81
|
+
usageUndated: number;
|
|
82
|
+
/**
|
|
83
|
+
* MemNexus tool calls whose line carried no timestamp this code can read
|
|
84
|
+
* (#307). The same rule applies to them as to usage rows, so this is the
|
|
85
|
+
* count of mxCalls the recent column holds on that rule rather than on a date.
|
|
86
|
+
* Their estimated tokens ride the same call, so no separate count is kept.
|
|
87
|
+
*/
|
|
88
|
+
mxUndated: number;
|
|
70
89
|
}
|
|
71
90
|
export declare function newTotals(): Totals;
|
|
72
91
|
/**
|
|
@@ -125,8 +144,123 @@ export declare function scanProjectDir(projectDir: string): ProjectScan;
|
|
|
125
144
|
* the whole of subagent spend.
|
|
126
145
|
*/
|
|
127
146
|
export declare function collectJsonlFiles(projectDir: string): string[];
|
|
147
|
+
/** One billed API call, rebuilt from the transcript lines that report it. */
|
|
148
|
+
export interface UsageGroup {
|
|
149
|
+
/** requestId, or message.id, or '' when the line carried neither. */
|
|
150
|
+
key: string;
|
|
151
|
+
/** True when a key grouped this row. False rows are single unkeyed lines. */
|
|
152
|
+
keyed: boolean;
|
|
153
|
+
input: number;
|
|
154
|
+
output: number;
|
|
155
|
+
cacheRead: number;
|
|
156
|
+
cacheWrite: number;
|
|
157
|
+
model: string;
|
|
158
|
+
session: string;
|
|
159
|
+
/** Latest DATED line timestamp in the group (ms epoch), 0 when no line is dated. */
|
|
160
|
+
ts: number;
|
|
161
|
+
/** True when at least one line in the group carried a readable timestamp. */
|
|
162
|
+
dated: boolean;
|
|
163
|
+
/** Transcript lines merged into this row. */
|
|
164
|
+
lines: number;
|
|
165
|
+
/**
|
|
166
|
+
* A field that must be constant within the group varied across its lines:
|
|
167
|
+
* input, cache read, cache write, or the model that prices the row.
|
|
168
|
+
*/
|
|
169
|
+
inconsistent: boolean;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The three outcomes for a project dir's usage-bearing lines (#307 criterion 4).
|
|
173
|
+
*
|
|
174
|
+
* `grouped` and `ungrouped` count ROWS, not lines. Three lines of one streamed
|
|
175
|
+
* call give `grouped: 1`. An unkeyed line is always its own row, so `ungrouped`
|
|
176
|
+
* is both a row count and a line count. Every usage-bearing line ends up in
|
|
177
|
+
* exactly one row, and no line is dropped. `inconsistent` counts grouped rows
|
|
178
|
+
* again, so it is a subset of `grouped` rather than a fourth outcome.
|
|
179
|
+
*/
|
|
180
|
+
export interface UsageGroupStats {
|
|
181
|
+
/** Rows built from a requestId or message.id. */
|
|
182
|
+
grouped: number;
|
|
183
|
+
/** Rows from lines with neither key, counted once each. */
|
|
184
|
+
ungrouped: number;
|
|
185
|
+
/** Grouped rows whose constant fields disagreed across lines. */
|
|
186
|
+
inconsistent: number;
|
|
187
|
+
/** Rows, keyed or not, no line of which carried a readable timestamp. */
|
|
188
|
+
undated: number;
|
|
189
|
+
}
|
|
190
|
+
/** Accumulator for one transcript file's usage lines. */
|
|
191
|
+
export interface UsageGrouper {
|
|
192
|
+
byKey: Map<string, UsageGroup>;
|
|
193
|
+
unkeyed: UsageGroup[];
|
|
194
|
+
}
|
|
195
|
+
export declare function newUsageGrouper(): UsageGrouper;
|
|
196
|
+
/**
|
|
197
|
+
* The grouping key for a transcript entry: `requestId`, else `message.id`, else
|
|
198
|
+
* '' when the entry carries neither.
|
|
199
|
+
*/
|
|
200
|
+
export declare function usageGroupKey(entry: Record<string, unknown> | undefined): string;
|
|
201
|
+
/**
|
|
202
|
+
* One usage field as a token count. The transcript reports these as JSON
|
|
203
|
+
* numbers; every other shape is one we cannot price.
|
|
204
|
+
*
|
|
205
|
+
* A cast plus `|| 0` kept a non-number and then added to it. Measured on the
|
|
206
|
+
* pre-change code, a single line with `input_tokens: '100'` reported
|
|
207
|
+
* `inputTokens` as the STRING '0100', because `0 + '100'` concatenates. That
|
|
208
|
+
* figure printed as a token count and was summed into cost, with no signal to
|
|
209
|
+
* the operator. Read the type, and count an unreadable value as 0.
|
|
210
|
+
*
|
|
211
|
+
* A negative count is as unreadable as a string: no API call bills a negative
|
|
212
|
+
* number of tokens, and a negative SUBTRACTS. Measured on the code that accepted
|
|
213
|
+
* one, a single line carrying `input_tokens: -6000000000` cancelled the whole
|
|
214
|
+
* corrected fleet input total of 6,649,443,346 (issue #307), printed nothing,
|
|
215
|
+
* warned nothing, and still counted as one healthy grouped call. An in-fleet
|
|
216
|
+
* agent writes these transcript lines, and this tool attributes spend to those
|
|
217
|
+
* same agents, so a line that makes one agent's spend read low is inside what
|
|
218
|
+
* this function defends against. `> 0` rather than `>= 0` so that both 0 and -0
|
|
219
|
+
* return the literal 0: -0 is a valid count but it is not what a reader expects
|
|
220
|
+
* a token total to hold.
|
|
221
|
+
*/
|
|
222
|
+
export declare function usageTokenCount(value: unknown): number;
|
|
223
|
+
/**
|
|
224
|
+
* The entry's timestamp as epoch ms, or undefined when it carries none this code
|
|
225
|
+
* can read. Only a string or a number is read; an object, an array or a boolean
|
|
226
|
+
* is not a timestamp.
|
|
227
|
+
*
|
|
228
|
+
* `new Date(x).getTime()` is NaN for an object or an unparseable string, and
|
|
229
|
+
* every comparison against NaN is false. Measured on the pre-change code, one
|
|
230
|
+
* line whose timestamp was an object reported `in=10` with `recentIn=0`: the row
|
|
231
|
+
* counted in the all-time total and never in the recent window. NaN also poisoned
|
|
232
|
+
* the group, because `ts > existing.ts` is false against NaN, so one unreadable
|
|
233
|
+
* first line kept a whole call out of the window even when later lines were
|
|
234
|
+
* dated.
|
|
235
|
+
*/
|
|
236
|
+
export declare function usageEntryTs(entry: Record<string, unknown> | undefined): number | undefined;
|
|
237
|
+
/**
|
|
238
|
+
* Merge one transcript entry into the grouper. Returns false when the entry has
|
|
239
|
+
* no usage object, so callers can keep their own per-line work separate.
|
|
240
|
+
*
|
|
241
|
+
* NINE transcript fields are read here, and no content field is among them:
|
|
242
|
+
* `message.usage.input_tokens`, `message.usage.output_tokens`,
|
|
243
|
+
* `message.usage.cache_read_input_tokens`,
|
|
244
|
+
* `message.usage.cache_creation_input_tokens`, `message.model`, `message.id`
|
|
245
|
+
* (through usageGroupKey), `requestId` (through usageGroupKey), `sessionId`, and
|
|
246
|
+
* `timestamp` (through usageEntryTs). `message.content` is never read by this
|
|
247
|
+
* function. The gateway team's security review of PR #325 reported seven; the
|
|
248
|
+
* bootstrap team's security-reviewer corrected it to nine (INFO-4 on that pull
|
|
249
|
+
* request). The list above is re-derived from this function, not copied from
|
|
250
|
+
* either report.
|
|
251
|
+
*/
|
|
252
|
+
export declare function addUsageLine(g: UsageGrouper, entry: Record<string, unknown> | undefined): boolean;
|
|
253
|
+
/** Every row the grouper holds, plus the three outcome counts. */
|
|
254
|
+
export declare function drainUsageGroups(g: UsageGrouper): {
|
|
255
|
+
rows: UsageGroup[];
|
|
256
|
+
stats: UsageGroupStats;
|
|
257
|
+
};
|
|
128
258
|
/**
|
|
129
259
|
* Read a project dir's JSONL logs and return all-time and recent token totals.
|
|
260
|
+
*
|
|
261
|
+
* Usage is counted once per billed API call, not once per transcript line: lines
|
|
262
|
+
* are grouped by requestId, falling back to message.id (#307). See the per-call
|
|
263
|
+
* usage grouping section above for the mechanism and the measured overcount.
|
|
130
264
|
*/
|
|
131
265
|
export declare function readProjectUsage(projectDir: string, recentCutoffMs: number): {
|
|
132
266
|
allTime: Totals;
|
|
@@ -184,10 +318,133 @@ export interface SessionRecord {
|
|
|
184
318
|
deployVerified: boolean;
|
|
185
319
|
}
|
|
186
320
|
/**
|
|
187
|
-
*
|
|
321
|
+
* The `subagentTypes` object that goes on the wire, with every UNSAFE_WIRE_KEYS
|
|
322
|
+
* key dropped. Exported for tests.
|
|
323
|
+
*
|
|
324
|
+
* Dropping loses a spawn count. `agentSpawns` still counts those spawns, and
|
|
325
|
+
* SessionRecordStats.droppedSubagentTypeKeys counts the keys dropped here, so no
|
|
326
|
+
* count disappears without a number an operator can read.
|
|
327
|
+
*/
|
|
328
|
+
export declare function toWireSubagentTypes(counts: Map<string, number>): Record<string, number>;
|
|
329
|
+
/** How many of a session's subagent_type keys toWireSubagentTypes will drop. */
|
|
330
|
+
export declare function unsafeWireKeyCount(counts: Map<string, number>): number;
|
|
331
|
+
/**
|
|
332
|
+
* What one parseSessionRecords walk discarded, so the rows `mx-agent sync` POSTs
|
|
333
|
+
* can be reconciled against what `mx-agent usage` reports for the same dir.
|
|
334
|
+
*
|
|
335
|
+
* These are the counterpart of Totals.usageGrouped, usageUngrouped,
|
|
336
|
+
* usageInconsistent and mxUndated on the usage path: printed at zero as well, so
|
|
337
|
+
* a residual is never hidden.
|
|
338
|
+
*/
|
|
339
|
+
export interface SessionRecordStats {
|
|
340
|
+
/**
|
|
341
|
+
* Transcript lines dropped before any counting because `sessionId` was not a
|
|
342
|
+
* readable string, missing included.
|
|
343
|
+
*
|
|
344
|
+
* Measured across this machine's 764 transcript files and 192,555 lines on
|
|
345
|
+
* 2026-09-02: 995 lines carry no `sessionId` at all and 0 carry a non-string
|
|
346
|
+
* one. None of the 995 carries a usage object, which is why the subset below
|
|
347
|
+
* exists: this broad count is dominated by lines that cost no tokens, and on
|
|
348
|
+
* its own it cannot tell an operator whether the two totals disagree.
|
|
349
|
+
*/
|
|
350
|
+
skippedLines: number;
|
|
351
|
+
/**
|
|
352
|
+
* The subset of skippedLines whose line carried a usage object with
|
|
353
|
+
* `input_tokens`. This is exactly the set that makes the two totals disagree:
|
|
354
|
+
* readProjectUsage keeps such a line and counts its tokens, this walk drops it.
|
|
355
|
+
*
|
|
356
|
+
* Measured on the pre-change code with one line carrying
|
|
357
|
+
* `sessionId: {id:'x'}` and 1000 input tokens beside one good line carrying 7:
|
|
358
|
+
* `syncInput=7 usageInput=1007` with every counter on the usage path reading 0.
|
|
359
|
+
* Reported by the bootstrap team's security-reviewer on PR #325 (SF-3), and
|
|
360
|
+
* disclosed by this team on the same pull request.
|
|
361
|
+
*/
|
|
362
|
+
skippedUsageLines: number;
|
|
363
|
+
/**
|
|
364
|
+
* Tokens on the skipped usage lines, counted ONE ROW PER BILLED CALL by the
|
|
365
|
+
* same grouper readProjectUsage uses, never summed per line.
|
|
366
|
+
*
|
|
367
|
+
* All four classes are reported because a skipped line drops all four from the
|
|
368
|
+
* payload. Disclosing one of them repeats the defect this counter exists to
|
|
369
|
+
* close, one field over: measured, a skipped line carrying 1,000 input and
|
|
370
|
+
* 4,000,000 cache-read tokens disclosed the 1,000 and hid the 4,000,000. Cache
|
|
371
|
+
* read is the larger number in this corpus (grouping header above: input and
|
|
372
|
+
* cache read overstated 2.057x of a 6,649,443,346-token total).
|
|
373
|
+
*
|
|
374
|
+
* `usageInput - syncInput === skippedUsageInputTokens` is a RECONCILIATION AID,
|
|
375
|
+
* NOT A GUARANTEE, and the same holds for the other three classes. It closes
|
|
376
|
+
* when every billed call is wholly skipped or wholly kept AND no requestId is
|
|
377
|
+
* split across sessions. Measured where it closes: the SF-3 fixture, 1,000
|
|
378
|
+
* against a 1,000-token gap; a two-line streamed call whose lines are both
|
|
379
|
+
* dropped, 1,000 against a 1,000-token gap, where a per-line sum would have
|
|
380
|
+
* said 2,000.
|
|
381
|
+
*
|
|
382
|
+
* Two shapes break it, and BOTH ARE SILENT. Neither raises a counter on either
|
|
383
|
+
* path.
|
|
384
|
+
*
|
|
385
|
+
* One billed call with a skipped line and a kept line under the same
|
|
386
|
+
* requestId. readProjectUsage merges them into one row and counts it once, so
|
|
387
|
+
* the gap is smaller than the tokens counted here. An earlier version of this
|
|
388
|
+
* comment claimed the case sets Totals.usageInconsistent and is therefore
|
|
389
|
+
* visible. That was wrong, and it was wrong because the fixture proving it
|
|
390
|
+
* carried inputs of 1,000 and 7: usageInconsistent fired on the constancy
|
|
391
|
+
* check at the two values differing, not on the skip. Two lines of one call
|
|
392
|
+
* repeat the same input (grouping header above, 26,940 groups, zero
|
|
393
|
+
* exceptions), so the realistic instance carries EQUAL inputs and raises
|
|
394
|
+
* nothing. Measured on the equal-input shape: gap 0 against 1,000 counted,
|
|
395
|
+
* usageInconsistent 0. Measured on the unequal shape, which the corpus says
|
|
396
|
+
* does not occur: gap 993 against 1,000 counted, usageInconsistent 1.
|
|
397
|
+
*
|
|
398
|
+
* One requestId whose lines carry two different valid string sessionIds in one
|
|
399
|
+
* file. Nothing is skipped, so this counter reads 0 and the condition above is
|
|
400
|
+
* met, yet the identity still fails: fileGroupers keys by sessionId and builds
|
|
401
|
+
* two rows, while readProjectUsage uses one grouper per file with no session
|
|
402
|
+
* key and builds one. Measured: sync 2,000, usage 1,000, disclosed 0,
|
|
403
|
+
* usageInconsistent 0. Pre-existing from #325 and not changed here; named
|
|
404
|
+
* because this comment makes an arithmetic claim, which is owed whatever the
|
|
405
|
+
* frequency turns out to be.
|
|
406
|
+
*/
|
|
407
|
+
skippedUsageInputTokens: number;
|
|
408
|
+
/** Output tokens on the skipped usage lines, one row per billed call. */
|
|
409
|
+
skippedUsageOutputTokens: number;
|
|
410
|
+
/** Cache-read tokens on the skipped usage lines, one row per billed call. */
|
|
411
|
+
skippedUsageCacheReadTokens: number;
|
|
412
|
+
/** Cache-write tokens on the skipped usage lines, one row per billed call. */
|
|
413
|
+
skippedUsageCacheWriteTokens: number;
|
|
414
|
+
/** subagent_type keys toWireSubagentTypes dropped, summed over sessions (SF-2). */
|
|
415
|
+
droppedSubagentTypeKeys: number;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Parse all JSONL files in a project dir and return one SessionRecord per
|
|
419
|
+
* session, with the counts of what the walk discarded.
|
|
188
420
|
*
|
|
189
421
|
* Only returns sessions that have at least one assistant record with usage data.
|
|
190
422
|
* Sessions without token data (e.g. failed starts) are excluded.
|
|
423
|
+
*
|
|
424
|
+
* Token counts are one row per billed API call, not one per transcript line:
|
|
425
|
+
* lines are grouped by requestId, falling back to message.id (#307). These
|
|
426
|
+
* records are what `mx-agent sync` POSTs to /v1/sessions/sync, so a per-line sum
|
|
427
|
+
* here writes the same overcount into the observability store, where correcting
|
|
428
|
+
* it needs a backfill. `model` is now the model of the most billed CALLS in the
|
|
429
|
+
* session rather than of the most lines.
|
|
430
|
+
*
|
|
431
|
+
* `sessionId`, `timestamp` and every usage field are read by type here, not by
|
|
432
|
+
* cast. Commit b6b8e23 is titled "read every transcript timestamp and sessionId
|
|
433
|
+
* by type"; its sessionId change covered readProjectUsage only, and this walk's
|
|
434
|
+
* own sessionId read was fixed afterwards. Both are covered now, and the title
|
|
435
|
+
* is what made the gap easy to miss.
|
|
436
|
+
*/
|
|
437
|
+
export declare function parseSessionRecordsWithStats(projectDir: string): {
|
|
438
|
+
records: SessionRecord[];
|
|
439
|
+
stats: SessionRecordStats;
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* The records alone, for the callers that read no counter.
|
|
443
|
+
*
|
|
444
|
+
* `commands/pager.ts` and `commands/pr-sync.ts` read toolCalls, memorySaves,
|
|
445
|
+
* agentSpawns and PR numbers, never a token field, so a dropped line changes
|
|
446
|
+
* nothing they publish. `commands/sync.ts` POSTs the token fields and calls
|
|
447
|
+
* parseSessionRecordsWithStats instead.
|
|
191
448
|
*/
|
|
192
449
|
export declare function parseSessionRecords(projectDir: string): SessionRecord[];
|
|
193
450
|
/** Per-subagent-definition usage rollup. */
|
|
@@ -234,12 +491,23 @@ export interface AgentAttributionResult {
|
|
|
234
491
|
oldestTs: number;
|
|
235
492
|
/** Newest child-line timestamp (ms epoch), 0 if none. */
|
|
236
493
|
newestTs: number;
|
|
494
|
+
/** Billed calls reconstructed from a requestId or message.id group (#307). */
|
|
495
|
+
usageGrouped: number;
|
|
496
|
+
/** Usage lines with neither key, counted once each and never merged (#307). */
|
|
497
|
+
usageUngrouped: number;
|
|
498
|
+
/** Groups where a field that must be constant varied across lines (#307). */
|
|
499
|
+
usageInconsistent: number;
|
|
500
|
+
/** Rows counted in the window on the undated rule rather than on a date (#307). */
|
|
501
|
+
usageUndated: number;
|
|
237
502
|
}
|
|
238
503
|
/**
|
|
239
504
|
* Build per-subagent-definition token/cost attribution for a project dir.
|
|
240
505
|
*
|
|
241
506
|
* Additive: does not touch Totals, SessionRecord, or readProjectUsage. Prices
|
|
242
|
-
* child transcripts
|
|
507
|
+
* child transcripts once per billed API call with the existing
|
|
508
|
+
* calcLineCost/getRates. Lines are grouped by requestId, falling back to
|
|
509
|
+
* message.id (#307); before that they were priced one row per transcript line,
|
|
510
|
+
* which counted each streamed call two or three times.
|
|
243
511
|
*/
|
|
244
512
|
export declare function parseAgentAttribution(projectDir: string): AgentAttributionResult;
|
|
245
513
|
//# sourceMappingURL=jsonl.d.ts.map
|
package/dist/lib/jsonl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../src/lib/jsonl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA2BpD,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,aAAa,EAAE,UAA6C,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../src/lib/jsonl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA2BpD,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,aAAa,EAAE,UAA6C,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAYlD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EAAE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