@wrongstack/core 0.296.4 → 0.298.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/chronicle/index.js +126 -22
- package/dist/chronicle/project-server-client.d.ts +12 -0
- package/dist/chronicle/project-server-protocol.d.ts +22 -0
- package/dist/chronicle/project-server.js +1076 -283
- package/dist/coordination/agents/index.js +136 -1
- package/dist/coordination/agents/role-skills.d.ts +3 -2
- package/dist/coordination/brain-cache.d.ts +14 -0
- package/dist/coordination/brain-trace.d.ts +2 -1
- package/dist/coordination/director/director-task-registry.d.ts +12 -0
- package/dist/coordination/fleet-supervisor.d.ts +21 -0
- package/dist/coordination/index.d.ts +23 -21
- package/dist/coordination/index.js +16514 -15945
- package/dist/coordination/mail-tools.d.ts +3 -3
- package/dist/coordination/mailbox-credential-store.d.ts +22 -2
- package/dist/coordination/mailbox-credential-throttle.d.ts +63 -0
- package/dist/coordination/mailbox-http-router.d.ts +6 -0
- package/dist/coordination/mailbox-project-server-client.d.ts +16 -0
- package/dist/coordination/mailbox-project-server-protocol.d.ts +43 -5
- package/dist/coordination/mailbox-project-server.js +1270 -289
- package/dist/coordination/provider-status-tracker.d.ts +2 -0
- package/dist/coordination/remote-mailbox-credential-store.d.ts +5 -5
- package/dist/coordination/remote-mailbox.d.ts +30 -4
- package/dist/coordination/sqlite-mailbox-credentials.d.ts +11 -0
- package/dist/core/context.d.ts +5 -5
- package/dist/core/fallback-profile-manager.d.ts +14 -0
- package/dist/core/index.js +624 -168
- package/dist/core/instruction-bundle.d.ts +12 -0
- package/dist/core/system-prompt-builder.d.ts +14 -0
- package/dist/core/system-prompt-skill-bodies.d.ts +1 -1
- package/dist/core/system-prompt-skill-text.d.ts +1 -2
- package/dist/defaults/index.js +2393 -1302
- package/dist/design/index.js +47 -8
- package/dist/execution/design-materialize.d.ts +22 -0
- package/dist/execution/index.js +582 -285
- package/dist/execution/skill-loader.d.ts +10 -1
- package/dist/execution/tool-error-taxonomy.d.ts +31 -0
- package/dist/execution/tool-executor.d.ts +1 -0
- package/dist/goal/index.js +71 -17
- package/dist/goal/phase-store.d.ts +7 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hq/auth-audit.d.ts +6 -0
- package/dist/hq/auth-store.d.ts +59 -3
- package/dist/hq/index.js +680 -163
- package/dist/hq/kanban-store.d.ts +3 -0
- package/dist/hq/persistence/event-log.d.ts +25 -0
- package/dist/hq/persistence.d.ts +1 -1
- package/dist/hq/protocol/browser.d.ts +2 -1
- package/dist/hq/protocol/client.d.ts +18 -1
- package/dist/hq/protocol/core.d.ts +5 -16
- package/dist/hq/protocol/envelope.d.ts +29 -0
- package/dist/hq/protocol/governance.d.ts +34 -0
- package/dist/hq/protocol/peer.d.ts +55 -0
- package/dist/hq/protocol/project.d.ts +3 -0
- package/dist/hq/protocol/resume.d.ts +56 -0
- package/dist/hq/protocol.d.ts +11 -8
- package/dist/hq/protocol.js +675 -0
- package/dist/hq/publisher.d.ts +31 -2
- package/dist/hq/session-bridge.d.ts +8 -0
- package/dist/index.js +7197 -4006
- package/dist/infrastructure/index.js +198 -101
- package/dist/kernel/events/session-events.d.ts +3 -0
- package/dist/kernel/events/tool-events.d.ts +3 -1
- package/dist/models/index.js +1 -1
- package/dist/observability/index.d.ts +1 -1
- package/dist/observability/index.js +103 -5
- package/dist/observability/metrics.d.ts +37 -0
- package/dist/observability/prometheus.d.ts +11 -0
- package/dist/plugin/index.d.ts +5 -1
- package/dist/plugin/index.js +965 -511
- package/dist/plugins/auto-review-plugin.d.ts +6 -0
- package/dist/plugins/review-store-maintenance.d.ts +26 -0
- package/dist/plugins/review-types.d.ts +6 -0
- package/dist/security/capabilities.d.ts +45 -1
- package/dist/security/error-sanitize.d.ts +49 -0
- package/dist/security/file-permissions.d.ts +41 -0
- package/dist/security/index.d.ts +9 -6
- package/dist/security/index.js +3007 -2032
- package/dist/security/permission-policy.d.ts +55 -3
- package/dist/security/secret-vault.d.ts +17 -0
- package/dist/security/totp.d.ts +86 -0
- package/dist/skills/frontmatter.d.ts +12 -1
- package/dist/skills/github-fetcher.d.ts +48 -0
- package/dist/skills/index.js +137 -26
- package/dist/skills/limits.d.ts +19 -0
- package/dist/skills/skill-installer.d.ts +13 -0
- package/dist/storage/file-session-writer.d.ts +23 -0
- package/dist/storage/index.js +1140 -905
- package/dist/storage/provider-config-watcher.d.ts +1 -0
- package/dist/storage/session-helpers.d.ts +1 -0
- package/dist/storage/session-reader.d.ts +0 -7
- package/dist/storage/session-store/types.d.ts +12 -1
- package/dist/storage/session-store.d.ts +11 -2
- package/dist/storage/session-workspace-checkpoints.d.ts +5 -0
- package/dist/tools/fallback-manage-tools.d.ts +6 -0
- package/dist/tools/index.js +305 -133
- package/dist/tools/mcp-use.d.ts +1 -1
- package/dist/types/blocks.d.ts +7 -0
- package/dist/types/config/autonomy.d.ts +12 -3
- package/dist/types/config/mcp-features.d.ts +15 -1
- package/dist/types/config/root.d.ts +10 -4
- package/dist/types/context-window.d.ts +15 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/observability.d.ts +13 -0
- package/dist/types/secret-vault.d.ts +8 -0
- package/dist/types/session.d.ts +42 -0
- package/dist/types/skill.d.ts +56 -0
- package/dist/types/tool-executor.d.ts +2 -0
- package/dist/utils/continuous-memory-profiler.d.ts +35 -0
- package/dist/utils/env-typed.d.ts +64 -0
- package/dist/utils/glob-match.d.ts +21 -1
- package/dist/utils/heap-watchdog-types.d.ts +62 -0
- package/dist/utils/heap-watchdog.d.ts +15 -34
- package/dist/utils/heap-watchdog.js +592 -18
- package/dist/utils/incoming-images.d.ts +19 -0
- package/dist/utils/index.d.ts +15 -11
- package/dist/utils/index.js +1425 -545
- package/dist/utils/memory-flight-recorder.d.ts +47 -0
- package/dist/utils/path-segment.d.ts +29 -0
- package/dist/utils/tool-name.d.ts +34 -0
- package/dist/utils/win32-cmd.d.ts +25 -0
- package/dist/worktree/index.js +5 -0
- package/package.json +11 -3
- package/skills/chimera/SKILL.md +16 -4
- package/skills/data-governance/SKILL.md +92 -0
- package/skills/wrongstack-kanban/SKILL.md +129 -0
- package/skills/wrongstack-kanban/agents/openai.yaml +4 -0
- package/skills/wrongstack-mailbox-mcp/SKILL.md +72 -0
- package/skills/wrongstack-mailbox-mcp/agents/openai.yaml +4 -0
- package/dist/agent-status-helpers.d.ts.map +0 -1
- package/dist/agent-status-tracker.d.ts.map +0 -1
- package/dist/boot.d.ts.map +0 -1
- package/dist/chronicle/context.d.ts.map +0 -1
- package/dist/chronicle/decision-adapter.d.ts.map +0 -1
- package/dist/chronicle/domain-adapter.d.ts.map +0 -1
- package/dist/chronicle/event-hash.d.ts.map +0 -1
- package/dist/chronicle/file-observer.d.ts.map +0 -1
- package/dist/chronicle/health-monitor.d.ts.map +0 -1
- package/dist/chronicle/identity.d.ts.map +0 -1
- package/dist/chronicle/index.d.ts.map +0 -1
- package/dist/chronicle/index.js.map +0 -7
- package/dist/chronicle/journal.d.ts.map +0 -1
- package/dist/chronicle/legacy-journal-import.d.ts.map +0 -1
- package/dist/chronicle/metrics-store.d.ts.map +0 -1
- package/dist/chronicle/partition-filename.d.ts.map +0 -1
- package/dist/chronicle/partition-range-cache.d.ts.map +0 -1
- package/dist/chronicle/process-adapter.d.ts.map +0 -1
- package/dist/chronicle/project-access.d.ts.map +0 -1
- package/dist/chronicle/project-server-client.d.ts.map +0 -1
- package/dist/chronicle/project-server-endpoint.d.ts.map +0 -1
- package/dist/chronicle/project-server-protocol.d.ts.map +0 -1
- package/dist/chronicle/project-server.d.ts.map +0 -1
- package/dist/chronicle/project-server.js.map +0 -7
- package/dist/chronicle/prompt-manifest.d.ts.map +0 -1
- package/dist/chronicle/provider-adapter.d.ts.map +0 -1
- package/dist/chronicle/query.d.ts.map +0 -1
- package/dist/chronicle/review-adapter.d.ts.map +0 -1
- package/dist/chronicle/rollup-adapter.d.ts.map +0 -1
- package/dist/chronicle/sink.d.ts.map +0 -1
- package/dist/chronicle/sqlite-journal.d.ts.map +0 -1
- package/dist/chronicle/sqlite-query.d.ts.map +0 -1
- package/dist/chronicle/stream-adapter.d.ts.map +0 -1
- package/dist/chronicle/tool-adapter.d.ts.map +0 -1
- package/dist/chronicle/types.d.ts.map +0 -1
- package/dist/coordination/adaptive-concurrency.d.ts.map +0 -1
- package/dist/coordination/agent-bridge.d.ts.map +0 -1
- package/dist/coordination/agent-monitor.d.ts.map +0 -1
- package/dist/coordination/agent-subagent-runner.d.ts.map +0 -1
- package/dist/coordination/agents/agent-prompts.d.ts.map +0 -1
- package/dist/coordination/agents/index.d.ts.map +0 -1
- package/dist/coordination/agents/index.js.map +0 -7
- package/dist/coordination/agents/phase1-discovery.d.ts.map +0 -1
- package/dist/coordination/agents/phase2-planning.d.ts.map +0 -1
- package/dist/coordination/agents/phase3-build.d.ts.map +0 -1
- package/dist/coordination/agents/phase3-techstack.d.ts.map +0 -1
- package/dist/coordination/agents/phase3-wave1-platform.d.ts.map +0 -1
- package/dist/coordination/agents/phase3-wave2-meta.d.ts.map +0 -1
- package/dist/coordination/agents/phase4-verify.d.ts.map +0 -1
- package/dist/coordination/agents/phase5-review.d.ts.map +0 -1
- package/dist/coordination/agents/phase6-domain.d.ts.map +0 -1
- package/dist/coordination/agents/phase7-knowledge.d.ts.map +0 -1
- package/dist/coordination/agents/phase8-delivery.d.ts.map +0 -1
- package/dist/coordination/agents/phase8-wave3-products.d.ts.map +0 -1
- package/dist/coordination/agents/phase9-meta.d.ts.map +0 -1
- package/dist/coordination/agents/phase9-wave4-platform-meta.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-config-validation.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-consolidation.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-files.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-identity-types.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-identity.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-knowledge-manifests.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-learning-entries.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-learning-normalize.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-learning-policy.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-learning-structured.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-paths.d.ts.map +0 -1
- package/dist/coordination/agents/project-agent-profile.d.ts.map +0 -1
- package/dist/coordination/agents/role-skills.d.ts.map +0 -1
- package/dist/coordination/agents/types.d.ts.map +0 -1
- package/dist/coordination/agents.d.ts.map +0 -1
- package/dist/coordination/auto-extend.d.ts.map +0 -1
- package/dist/coordination/autonomous-brain.d.ts.map +0 -1
- package/dist/coordination/autonomous-coordinator.d.ts.map +0 -1
- package/dist/coordination/brain-cache.d.ts.map +0 -1
- package/dist/coordination/brain-heuristics.d.ts.map +0 -1
- package/dist/coordination/brain-ledger.d.ts.map +0 -1
- package/dist/coordination/brain-monitor.d.ts.map +0 -1
- package/dist/coordination/brain-rules.d.ts.map +0 -1
- package/dist/coordination/brain-telemetry.d.ts.map +0 -1
- package/dist/coordination/brain-trace.d.ts.map +0 -1
- package/dist/coordination/brain.d.ts.map +0 -1
- package/dist/coordination/change-manager.d.ts.map +0 -1
- package/dist/coordination/checkpoint-wiring.d.ts.map +0 -1
- package/dist/coordination/collab-bus.d.ts.map +0 -1
- package/dist/coordination/collab-debug-types.d.ts.map +0 -1
- package/dist/coordination/collab-debug.d.ts.map +0 -1
- package/dist/coordination/collab-director-host.d.ts.map +0 -1
- package/dist/coordination/commit-safety.d.ts.map +0 -1
- package/dist/coordination/consensus-protocol.d.ts.map +0 -1
- package/dist/coordination/coordinator/error-classifier.d.ts.map +0 -1
- package/dist/coordination/delegate-tool.d.ts.map +0 -1
- package/dist/coordination/dep-watcher-bridge.d.ts.map +0 -1
- package/dist/coordination/dep-watcher.d.ts.map +0 -1
- package/dist/coordination/director/director-btw-notes.d.ts.map +0 -1
- package/dist/coordination/director/director-budget-policy.d.ts.map +0 -1
- package/dist/coordination/director/director-collab.d.ts.map +0 -1
- package/dist/coordination/director/director-errors.d.ts.map +0 -1
- package/dist/coordination/director/director-task-registry.d.ts.map +0 -1
- package/dist/coordination/director/director-toolset.d.ts.map +0 -1
- package/dist/coordination/director-basic-tools.d.ts.map +0 -1
- package/dist/coordination/director-collab-tools.d.ts.map +0 -1
- package/dist/coordination/director-host-contracts.d.ts.map +0 -1
- package/dist/coordination/director-input-helpers.d.ts.map +0 -1
- package/dist/coordination/director-kanban-queue-helpers.d.ts.map +0 -1
- package/dist/coordination/director-options.d.ts.map +0 -1
- package/dist/coordination/director-prompts.d.ts.map +0 -1
- package/dist/coordination/director-quality-gate-tool.d.ts.map +0 -1
- package/dist/coordination/director-session.d.ts.map +0 -1
- package/dist/coordination/director-spawn-model.d.ts.map +0 -1
- package/dist/coordination/director-tools.d.ts.map +0 -1
- package/dist/coordination/director.d.ts.map +0 -1
- package/dist/coordination/dispatcher.d.ts.map +0 -1
- package/dist/coordination/file-author-tracker.d.ts.map +0 -1
- package/dist/coordination/fleet-bus.d.ts.map +0 -1
- package/dist/coordination/fleet-event-validation.d.ts.map +0 -1
- package/dist/coordination/fleet-manager.d.ts.map +0 -1
- package/dist/coordination/fleet-spawn.d.ts.map +0 -1
- package/dist/coordination/fleet-status-tool.d.ts.map +0 -1
- package/dist/coordination/fleet-supervisor.d.ts.map +0 -1
- package/dist/coordination/fleet.d.ts.map +0 -1
- package/dist/coordination/global-mailbox-completion.d.ts.map +0 -1
- package/dist/coordination/global-mailbox-paths.d.ts.map +0 -1
- package/dist/coordination/icoordinator.d.ts.map +0 -1
- package/dist/coordination/ifleet-manager.d.ts.map +0 -1
- package/dist/coordination/in-memory-transport.d.ts.map +0 -1
- package/dist/coordination/index.d.ts.map +0 -1
- package/dist/coordination/index.js.map +0 -7
- package/dist/coordination/knowledge-graph.d.ts.map +0 -1
- package/dist/coordination/large-answer-store.d.ts.map +0 -1
- package/dist/coordination/mail-tools.d.ts.map +0 -1
- package/dist/coordination/mailbox-actions.d.ts.map +0 -1
- package/dist/coordination/mailbox-auth-types.d.ts.map +0 -1
- package/dist/coordination/mailbox-codecs.d.ts.map +0 -1
- package/dist/coordination/mailbox-constants.d.ts.map +0 -1
- package/dist/coordination/mailbox-credential-store.d.ts.map +0 -1
- package/dist/coordination/mailbox-events.d.ts.map +0 -1
- package/dist/coordination/mailbox-health.d.ts.map +0 -1
- package/dist/coordination/mailbox-hooks.d.ts.map +0 -1
- package/dist/coordination/mailbox-http-auth.d.ts.map +0 -1
- package/dist/coordination/mailbox-http-rate-limit.d.ts.map +0 -1
- package/dist/coordination/mailbox-http-router.d.ts.map +0 -1
- package/dist/coordination/mailbox-http-validation.d.ts.map +0 -1
- package/dist/coordination/mailbox-message-codec.d.ts.map +0 -1
- package/dist/coordination/mailbox-parse-state.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server-client.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server-endpoint.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server-protocol.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server.d.ts.map +0 -1
- package/dist/coordination/mailbox-project-server.js.map +0 -7
- package/dist/coordination/mailbox-receipt-folding.d.ts.map +0 -1
- package/dist/coordination/mailbox-registry-codec.d.ts.map +0 -1
- package/dist/coordination/mailbox-retention-state.d.ts.map +0 -1
- package/dist/coordination/mailbox-status-mappers.d.ts.map +0 -1
- package/dist/coordination/mailbox-tool.d.ts.map +0 -1
- package/dist/coordination/mailbox-type-properties.d.ts.map +0 -1
- package/dist/coordination/mailbox-types.d.ts.map +0 -1
- package/dist/coordination/model-matrix.d.ts.map +0 -1
- package/dist/coordination/multi-agent-coordinator.d.ts.map +0 -1
- package/dist/coordination/multi-agent-timeout.d.ts.map +0 -1
- package/dist/coordination/null-fleet-bus.d.ts.map +0 -1
- package/dist/coordination/package-author-tracker.d.ts.map +0 -1
- package/dist/coordination/package-outdated-watcher.d.ts.map +0 -1
- package/dist/coordination/provider-status-tracker.d.ts.map +0 -1
- package/dist/coordination/remote-mailbox-credential-store.d.ts.map +0 -1
- package/dist/coordination/remote-mailbox.d.ts.map +0 -1
- package/dist/coordination/single-instance-mailbox.d.ts.map +0 -1
- package/dist/coordination/spawn-budget.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox-compaction.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox-credentials.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox-rows.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox-schema.d.ts.map +0 -1
- package/dist/coordination/sqlite-mailbox.d.ts.map +0 -1
- package/dist/coordination/subagent-budget.d.ts.map +0 -1
- package/dist/coordination/subagent-nicknames.d.ts.map +0 -1
- package/dist/coordination/subagent-result-tool.d.ts.map +0 -1
- package/dist/coordination/task-auctioneer.d.ts.map +0 -1
- package/dist/coordination/task-dag.d.ts.map +0 -1
- package/dist/coordination/techstack-mailbox-consumer.d.ts.map +0 -1
- package/dist/coordination/transport.d.ts.map +0 -1
- package/dist/coordination/worktree-task-runner.d.ts.map +0 -1
- package/dist/core/agent-internals.d.ts.map +0 -1
- package/dist/core/agent-loop.d.ts.map +0 -1
- package/dist/core/agent-response.d.ts.map +0 -1
- package/dist/core/agent-tools.d.ts.map +0 -1
- package/dist/core/agent-types.d.ts.map +0 -1
- package/dist/core/agent.d.ts.map +0 -1
- package/dist/core/btw.d.ts.map +0 -1
- package/dist/core/context.d.ts.map +0 -1
- package/dist/core/continue-intent.d.ts.map +0 -1
- package/dist/core/continue-to-next-iteration.d.ts.map +0 -1
- package/dist/core/conversation-state.d.ts.map +0 -1
- package/dist/core/fallback-model.d.ts.map +0 -1
- package/dist/core/fallback-profile-manager.d.ts.map +0 -1
- package/dist/core/fleet-pulse.d.ts.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -7
- package/dist/core/input-builder.d.ts.map +0 -1
- package/dist/core/instruction-bundle.d.ts.map +0 -1
- package/dist/core/iteration-limit.d.ts.map +0 -1
- package/dist/core/mailbox-loop.d.ts.map +0 -1
- package/dist/core/model-availability-calendar.d.ts.map +0 -1
- package/dist/core/model-ref.d.ts.map +0 -1
- package/dist/core/model-ref.js.map +0 -7
- package/dist/core/modes/brief.d.ts.map +0 -1
- package/dist/core/modes/default.d.ts.map +0 -1
- package/dist/core/modes/teach.d.ts.map +0 -1
- package/dist/core/provider-runner.d.ts.map +0 -1
- package/dist/core/queued-messages.d.ts.map +0 -1
- package/dist/core/request-provider-binding.d.ts.map +0 -1
- package/dist/core/run-env.d.ts.map +0 -1
- package/dist/core/streaming-response-builder.d.ts.map +0 -1
- package/dist/core/system-prompt-blocks.d.ts.map +0 -1
- package/dist/core/system-prompt-builder.d.ts.map +0 -1
- package/dist/core/system-prompt-environment-probes.d.ts.map +0 -1
- package/dist/core/system-prompt-environment.d.ts.map +0 -1
- package/dist/core/system-prompt-memory-skills.d.ts.map +0 -1
- package/dist/core/system-prompt-plan.d.ts.map +0 -1
- package/dist/core/system-prompt-shell.d.ts.map +0 -1
- package/dist/core/system-prompt-skill-bodies.d.ts.map +0 -1
- package/dist/core/system-prompt-skill-text.d.ts.map +0 -1
- package/dist/defaults/index.d.ts.map +0 -1
- package/dist/defaults/index.js.map +0 -7
- package/dist/design/index.d.ts.map +0 -1
- package/dist/design/index.js.map +0 -7
- package/dist/execution/auto-compaction-middleware.d.ts.map +0 -1
- package/dist/execution/autonomous-runner.d.ts.map +0 -1
- package/dist/execution/autonomy-brain.d.ts.map +0 -1
- package/dist/execution/autonomy-prompt-contributor.d.ts.map +0 -1
- package/dist/execution/brain-chain.d.ts.map +0 -1
- package/dist/execution/brain-circuit.d.ts.map +0 -1
- package/dist/execution/brain-evaluation.d.ts.map +0 -1
- package/dist/execution/brain-runtime-constants.d.ts.map +0 -1
- package/dist/execution/brain-runtime.d.ts.map +0 -1
- package/dist/execution/compaction-core.d.ts.map +0 -1
- package/dist/execution/compaction-scoring.d.ts.map +0 -1
- package/dist/execution/compaction-summary-cache.d.ts.map +0 -1
- package/dist/execution/compactor.d.ts.map +0 -1
- package/dist/execution/council-brain.d.ts.map +0 -1
- package/dist/execution/council-orchestrator.d.ts.map +0 -1
- package/dist/execution/council-personas.d.ts.map +0 -1
- package/dist/execution/council-profiles.d.ts.map +0 -1
- package/dist/execution/council-prompts.d.ts.map +0 -1
- package/dist/execution/council-resolution.d.ts.map +0 -1
- package/dist/execution/design-color.d.ts.map +0 -1
- package/dist/execution/design-detect.d.ts.map +0 -1
- package/dist/execution/design-kit-loader.d.ts.map +0 -1
- package/dist/execution/design-materialize.d.ts.map +0 -1
- package/dist/execution/design-project-store.d.ts.map +0 -1
- package/dist/execution/design-tune.d.ts.map +0 -1
- package/dist/execution/design-verify.d.ts.map +0 -1
- package/dist/execution/enhance-recovery.d.ts.map +0 -1
- package/dist/execution/error-handler.d.ts.map +0 -1
- package/dist/execution/eternal-autonomy-types.d.ts.map +0 -1
- package/dist/execution/eternal-autonomy.d.ts.map +0 -1
- package/dist/execution/goal-preamble.d.ts.map +0 -1
- package/dist/execution/index.d.ts.map +0 -1
- package/dist/execution/index.js.map +0 -7
- package/dist/execution/intelligent-compactor.d.ts.map +0 -1
- package/dist/execution/model-runtime.d.ts.map +0 -1
- package/dist/execution/one-shot-llm.d.ts.map +0 -1
- package/dist/execution/parallel-eternal-engine.d.ts.map +0 -1
- package/dist/execution/prompt-enhancer.d.ts.map +0 -1
- package/dist/execution/prompt-enhancer.js.map +0 -7
- package/dist/execution/prompt-loader.d.ts.map +0 -1
- package/dist/execution/provider-runner-impl.d.ts.map +0 -1
- package/dist/execution/regex-patterns.d.ts.map +0 -1
- package/dist/execution/retry-policy.d.ts.map +0 -1
- package/dist/execution/selective-compactor.d.ts.map +0 -1
- package/dist/execution/skill-loader.d.ts.map +0 -1
- package/dist/execution/strategy-compactor.d.ts.map +0 -1
- package/dist/execution/subagent-compaction.d.ts.map +0 -1
- package/dist/execution/tool-executor-logging.d.ts.map +0 -1
- package/dist/execution/tool-executor-results.d.ts.map +0 -1
- package/dist/execution/tool-executor-stream.d.ts.map +0 -1
- package/dist/execution/tool-executor-support.d.ts.map +0 -1
- package/dist/execution/tool-executor.d.ts.map +0 -1
- package/dist/extension/extension-points.d.ts.map +0 -1
- package/dist/extension/index.d.ts.map +0 -1
- package/dist/extension/index.js.map +0 -7
- package/dist/extension/registry.d.ts.map +0 -1
- package/dist/fleet-notifier.d.ts.map +0 -1
- package/dist/goal/checkpoint.d.ts.map +0 -1
- package/dist/goal/goal-assessor.d.ts.map +0 -1
- package/dist/goal/goal-planner.d.ts.map +0 -1
- package/dist/goal/goal-runner.d.ts.map +0 -1
- package/dist/goal/index.d.ts.map +0 -1
- package/dist/goal/index.js.map +0 -7
- package/dist/goal/phase-board-mutations.d.ts.map +0 -1
- package/dist/goal/phase-graph-builder.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator-integration.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator-queries.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator-runtime.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator-types.d.ts.map +0 -1
- package/dist/goal/phase-orchestrator.d.ts.map +0 -1
- package/dist/goal/phase-store.d.ts.map +0 -1
- package/dist/goal/types.d.ts.map +0 -1
- package/dist/hooks/http-executor.d.ts.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -7
- package/dist/hooks/registry.d.ts.map +0 -1
- package/dist/hooks/runner.d.ts.map +0 -1
- package/dist/hooks/shell-executor.d.ts.map +0 -1
- package/dist/hooks/shell-hooks-equal.d.ts.map +0 -1
- package/dist/hq/alerts.d.ts.map +0 -1
- package/dist/hq/auth-audit.d.ts.map +0 -1
- package/dist/hq/auth-store.d.ts.map +0 -1
- package/dist/hq/bootstrap-store.d.ts.map +0 -1
- package/dist/hq/brain-bridge.d.ts.map +0 -1
- package/dist/hq/bridge-context.d.ts.map +0 -1
- package/dist/hq/commands.d.ts.map +0 -1
- package/dist/hq/cost-bridge.d.ts.map +0 -1
- package/dist/hq/exposure.d.ts.map +0 -1
- package/dist/hq/factory.d.ts.map +0 -1
- package/dist/hq/fleet-bridge.d.ts.map +0 -1
- package/dist/hq/index.d.ts.map +0 -1
- package/dist/hq/index.js.map +0 -7
- package/dist/hq/kanban-store.d.ts.map +0 -1
- package/dist/hq/mailbox-mapper.d.ts.map +0 -1
- package/dist/hq/persistence/event-log.d.ts.map +0 -1
- package/dist/hq/persistence/jsonl-io.d.ts.map +0 -1
- package/dist/hq/persistence/simple-log.d.ts.map +0 -1
- package/dist/hq/persistence/snapshot-store.d.ts.map +0 -1
- package/dist/hq/persistence/timeseries-store.d.ts.map +0 -1
- package/dist/hq/persistence.d.ts.map +0 -1
- package/dist/hq/protocol/brain.d.ts.map +0 -1
- package/dist/hq/protocol/browser.d.ts.map +0 -1
- package/dist/hq/protocol/client.d.ts.map +0 -1
- package/dist/hq/protocol/core.d.ts.map +0 -1
- package/dist/hq/protocol/fleet.d.ts.map +0 -1
- package/dist/hq/protocol/kanban.d.ts.map +0 -1
- package/dist/hq/protocol/mailbox.d.ts.map +0 -1
- package/dist/hq/protocol/mcp.d.ts.map +0 -1
- package/dist/hq/protocol/project.d.ts.map +0 -1
- package/dist/hq/protocol/session.d.ts.map +0 -1
- package/dist/hq/protocol/tool.d.ts.map +0 -1
- package/dist/hq/protocol.d.ts.map +0 -1
- package/dist/hq/publisher.d.ts.map +0 -1
- package/dist/hq/redaction.d.ts.map +0 -1
- package/dist/hq/session-bridge.d.ts.map +0 -1
- package/dist/hq/tool-bridge.d.ts.map +0 -1
- package/dist/hq/transcript-mapper.d.ts.map +0 -1
- package/dist/hq/worktree-bridge.d.ts.map +0 -1
- package/dist/hq/write-queues.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/infrastructure/context-manager.d.ts.map +0 -1
- package/dist/infrastructure/index.d.ts.map +0 -1
- package/dist/infrastructure/index.js.map +0 -7
- package/dist/infrastructure/logger.d.ts.map +0 -1
- package/dist/infrastructure/mcp-servers.d.ts.map +0 -1
- package/dist/infrastructure/path-resolver.d.ts.map +0 -1
- package/dist/infrastructure/provider-cache-ledger.d.ts.map +0 -1
- package/dist/infrastructure/token-counter.d.ts.map +0 -1
- package/dist/kernel/container.d.ts.map +0 -1
- package/dist/kernel/events/agent-events.d.ts.map +0 -1
- package/dist/kernel/events/brain-events.d.ts.map +0 -1
- package/dist/kernel/events/file-events.d.ts.map +0 -1
- package/dist/kernel/events/fleet-events.d.ts.map +0 -1
- package/dist/kernel/events/memory-events.d.ts.map +0 -1
- package/dist/kernel/events/network-events.d.ts.map +0 -1
- package/dist/kernel/events/process-events.d.ts.map +0 -1
- package/dist/kernel/events/provider-events.d.ts.map +0 -1
- package/dist/kernel/events/sdd-events.d.ts.map +0 -1
- package/dist/kernel/events/session-events.d.ts.map +0 -1
- package/dist/kernel/events/tool-events.d.ts.map +0 -1
- package/dist/kernel/events/worktree-events.d.ts.map +0 -1
- package/dist/kernel/events.d.ts.map +0 -1
- package/dist/kernel/index.d.ts.map +0 -1
- package/dist/kernel/index.js.map +0 -7
- package/dist/kernel/pipeline.d.ts.map +0 -1
- package/dist/kernel/run-controller.d.ts.map +0 -1
- package/dist/kernel/tokens.d.ts.map +0 -1
- package/dist/mailbox-attach.d.ts.map +0 -1
- package/dist/middleware/collab-pause.d.ts.map +0 -1
- package/dist/models/alibaba-token-plan-catalog.d.ts.map +0 -1
- package/dist/models/codex-catalog.d.ts.map +0 -1
- package/dist/models/index.d.ts.map +0 -1
- package/dist/models/index.js.map +0 -7
- package/dist/models/llm-selector.d.ts.map +0 -1
- package/dist/models/mode-store.d.ts.map +0 -1
- package/dist/models/model-intelligence.d.ts.map +0 -1
- package/dist/models/model-router.d.ts.map +0 -1
- package/dist/models/models-registry.d.ts.map +0 -1
- package/dist/models/provider-model-resolve.d.ts.map +0 -1
- package/dist/notifications/index.d.ts.map +0 -1
- package/dist/notifications/index.js.map +0 -7
- package/dist/notifications/notifier-impl.d.ts.map +0 -1
- package/dist/notifications/notifier.d.ts.map +0 -1
- package/dist/notifications/types.d.ts.map +0 -1
- package/dist/observability/event-bridge.d.ts.map +0 -1
- package/dist/observability/health.d.ts.map +0 -1
- package/dist/observability/index.d.ts.map +0 -1
- package/dist/observability/index.js.map +0 -7
- package/dist/observability/metrics.d.ts.map +0 -1
- package/dist/observability/network-telemetry.d.ts.map +0 -1
- package/dist/observability/otel-tracer.d.ts.map +0 -1
- package/dist/observability/otlp-metrics.d.ts.map +0 -1
- package/dist/observability/otlp-traces.d.ts.map +0 -1
- package/dist/observability/process-telemetry.d.ts.map +0 -1
- package/dist/observability/prometheus.d.ts.map +0 -1
- package/dist/observability/redact-command.d.ts.map +0 -1
- package/dist/observability/tracer.d.ts.map +0 -1
- package/dist/plugin/api.d.ts.map +0 -1
- package/dist/plugin/config.d.ts.map +0 -1
- package/dist/plugin/index.d.ts.map +0 -1
- package/dist/plugin/index.js.map +0 -7
- package/dist/plugin/loader.d.ts.map +0 -1
- package/dist/plugins/auto-review-plugin.d.ts.map +0 -1
- package/dist/plugins/chimera-plugin.d.ts.map +0 -1
- package/dist/plugins/prompts-plugin.d.ts.map +0 -1
- package/dist/plugins/review-claim-registry.d.ts.map +0 -1
- package/dist/plugins/review-context-builder.d.ts.map +0 -1
- package/dist/plugins/review-finding-commands.d.ts.map +0 -1
- package/dist/plugins/review-finding-integration.d.ts.map +0 -1
- package/dist/plugins/review-finding-parser.d.ts.map +0 -1
- package/dist/plugins/review-finding-store.d.ts.map +0 -1
- package/dist/plugins/review-finding-types.d.ts.map +0 -1
- package/dist/plugins/review-report-integration.d.ts.map +0 -1
- package/dist/plugins/review-report-store.d.ts.map +0 -1
- package/dist/plugins/review-report-types.d.ts.map +0 -1
- package/dist/plugins/review-types.d.ts.map +0 -1
- package/dist/plugins/skills-plugin.d.ts.map +0 -1
- package/dist/plugins/sync-plugin.d.ts.map +0 -1
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/prompt-installer.d.ts.map +0 -1
- package/dist/prompts/prompt-manifest-store.d.ts.map +0 -1
- package/dist/registry/index.d.ts.map +0 -1
- package/dist/registry/index.js.map +0 -7
- package/dist/registry/provider-registry.d.ts.map +0 -1
- package/dist/registry/slash-command-registry.d.ts.map +0 -1
- package/dist/registry/tool-registry.d.ts.map +0 -1
- package/dist/replay/hash.d.ts.map +0 -1
- package/dist/replay/index.d.ts.map +0 -1
- package/dist/replay/index.js.map +0 -7
- package/dist/replay/replay-provider-runner.d.ts.map +0 -1
- package/dist/security/capabilities.d.ts.map +0 -1
- package/dist/security/config-secrets.d.ts.map +0 -1
- package/dist/security/directory-permission-policy.d.ts.map +0 -1
- package/dist/security/directory-policy-schema.d.ts.map +0 -1
- package/dist/security/index.d.ts.map +0 -1
- package/dist/security/index.js.map +0 -7
- package/dist/security/kanban-boundary.d.ts.map +0 -1
- package/dist/security/permission-policy-schema.d.ts.map +0 -1
- package/dist/security/permission-policy.d.ts.map +0 -1
- package/dist/security/readonly-permission-policy.d.ts.map +0 -1
- package/dist/security/secret-scrubber.d.ts.map +0 -1
- package/dist/security/secret-vault.d.ts.map +0 -1
- package/dist/security/trust-boundary.d.ts.map +0 -1
- package/dist/security/yolo-risk.d.ts.map +0 -1
- package/dist/session-registry-atomic-file.d.ts.map +0 -1
- package/dist/session-registry-types.d.ts.map +0 -1
- package/dist/session-registry.d.ts.map +0 -1
- package/dist/skills/foreign-sources.d.ts.map +0 -1
- package/dist/skills/frontmatter.d.ts.map +0 -1
- package/dist/skills/github-fetcher.d.ts.map +0 -1
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js.map +0 -7
- package/dist/skills/limits.d.ts.map +0 -1
- package/dist/skills/manifest-store.d.ts.map +0 -1
- package/dist/skills/registry/github-direct-adapter.d.ts.map +0 -1
- package/dist/skills/registry/registry-adapter.d.ts.map +0 -1
- package/dist/skills/registry/skills-sh-adapter.d.ts.map +0 -1
- package/dist/skills/skill-generator.d.ts.map +0 -1
- package/dist/skills/skill-installer.d.ts.map +0 -1
- package/dist/storage/annotations-store.d.ts.map +0 -1
- package/dist/storage/attachment-store.d.ts.map +0 -1
- package/dist/storage/cloud-sync.d.ts.map +0 -1
- package/dist/storage/completed-work-checkpoint.d.ts.map +0 -1
- package/dist/storage/config-loader/bootstrap.d.ts.map +0 -1
- package/dist/storage/config-loader/default-repair.d.ts.map +0 -1
- package/dist/storage/config-loader/defaults.d.ts.map +0 -1
- package/dist/storage/config-loader/diagnostics.d.ts.map +0 -1
- package/dist/storage/config-loader/env-overrides.d.ts.map +0 -1
- package/dist/storage/config-loader/in-project-policy.d.ts.map +0 -1
- package/dist/storage/config-loader/inline-provider-models.d.ts.map +0 -1
- package/dist/storage/config-loader/legacy-sage-migration.d.ts.map +0 -1
- package/dist/storage/config-loader/path-identity.d.ts.map +0 -1
- package/dist/storage/config-loader/types.d.ts.map +0 -1
- package/dist/storage/config-loader/validation.d.ts.map +0 -1
- package/dist/storage/config-loader.d.ts.map +0 -1
- package/dist/storage/config-migration.d.ts.map +0 -1
- package/dist/storage/config-store.d.ts.map +0 -1
- package/dist/storage/director-state.d.ts.map +0 -1
- package/dist/storage/file-session-writer.d.ts.map +0 -1
- package/dist/storage/goal-coordination.d.ts.map +0 -1
- package/dist/storage/goal-kanban.d.ts.map +0 -1
- package/dist/storage/goal-store.d.ts.map +0 -1
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js.map +0 -7
- package/dist/storage/input-history-store.d.ts.map +0 -1
- package/dist/storage/memory-backend.d.ts.map +0 -1
- package/dist/storage/memory-consolidator.d.ts.map +0 -1
- package/dist/storage/memory-graph-backend.d.ts.map +0 -1
- package/dist/storage/plan-store.d.ts.map +0 -1
- package/dist/storage/plan-templates.d.ts.map +0 -1
- package/dist/storage/prompt-store.d.ts.map +0 -1
- package/dist/storage/prompt-usage-store.d.ts.map +0 -1
- package/dist/storage/provider-config-watcher.d.ts.map +0 -1
- package/dist/storage/queue-store.d.ts.map +0 -1
- package/dist/storage/recovery-lock.d.ts.map +0 -1
- package/dist/storage/replay-log-store.d.ts.map +0 -1
- package/dist/storage/session-analyzer.d.ts.map +0 -1
- package/dist/storage/session-checkpoint-cas.d.ts.map +0 -1
- package/dist/storage/session-event-bridge.d.ts.map +0 -1
- package/dist/storage/session-helpers.d.ts.map +0 -1
- package/dist/storage/session-id-resolver.d.ts.map +0 -1
- package/dist/storage/session-id.d.ts.map +0 -1
- package/dist/storage/session-read-scrubber.d.ts.map +0 -1
- package/dist/storage/session-reader.d.ts.map +0 -1
- package/dist/storage/session-recovery.d.ts.map +0 -1
- package/dist/storage/session-resume-validation.d.ts.map +0 -1
- package/dist/storage/session-rewind-apply.d.ts.map +0 -1
- package/dist/storage/session-rewinder.d.ts.map +0 -1
- package/dist/storage/session-store/delete-session-artifacts.d.ts.map +0 -1
- package/dist/storage/session-store/delete-session-guards.d.ts.map +0 -1
- package/dist/storage/session-store/directory-scan.d.ts.map +0 -1
- package/dist/storage/session-store/directory-session-files.d.ts.map +0 -1
- package/dist/storage/session-store/events.d.ts.map +0 -1
- package/dist/storage/session-store/fork-session.d.ts.map +0 -1
- package/dist/storage/session-store/index-reader.d.ts.map +0 -1
- package/dist/storage/session-store/load-cache.d.ts.map +0 -1
- package/dist/storage/session-store/load-session-data.d.ts.map +0 -1
- package/dist/storage/session-store/paths.d.ts.map +0 -1
- package/dist/storage/session-store/prune-helpers.d.ts.map +0 -1
- package/dist/storage/session-store/replay.d.ts.map +0 -1
- package/dist/storage/session-store/search-events.d.ts.map +0 -1
- package/dist/storage/session-store/shard-manifest.d.ts.map +0 -1
- package/dist/storage/session-store/summary-builder.d.ts.map +0 -1
- package/dist/storage/session-store/summary-header.d.ts.map +0 -1
- package/dist/storage/session-store/types.d.ts.map +0 -1
- package/dist/storage/session-store.d.ts.map +0 -1
- package/dist/storage/session-summary.d.ts.map +0 -1
- package/dist/storage/session-tool-call-ends.d.ts.map +0 -1
- package/dist/storage/session-writer-scrubber.d.ts.map +0 -1
- package/dist/storage/session-writer-truncate.d.ts.map +0 -1
- package/dist/storage/storage-concurrency.d.ts.map +0 -1
- package/dist/storage/task-store.d.ts.map +0 -1
- package/dist/storage/todos-checkpoint.d.ts.map +0 -1
- package/dist/storage/tool-audit-log.d.ts.map +0 -1
- package/dist/tasking/index.d.ts.map +0 -1
- package/dist/tasking/index.js.map +0 -7
- package/dist/tasking/task-store.d.ts.map +0 -1
- package/dist/tasking/task-tracker.d.ts.map +0 -1
- package/dist/tools/council-tool.d.ts.map +0 -1
- package/dist/tools/fallback-chain-manage-tool.d.ts.map +0 -1
- package/dist/tools/fallback-favorite-manage-tool.d.ts.map +0 -1
- package/dist/tools/fallback-manage-helpers.d.ts.map +0 -1
- package/dist/tools/fallback-manage-tool-options.d.ts.map +0 -1
- package/dist/tools/fallback-manage-tools.d.ts.map +0 -1
- package/dist/tools/fallback-model-ref-parse.d.ts.map +0 -1
- package/dist/tools/fallback-provider-key-store.d.ts.map +0 -1
- package/dist/tools/fallback-system-config-view-tool.d.ts.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js.map +0 -7
- package/dist/tools/mcp-control.d.ts.map +0 -1
- package/dist/tools/mcp-use.d.ts.map +0 -1
- package/dist/tools/one-shot-llm-tool.d.ts.map +0 -1
- package/dist/tools/plugin-manager.d.ts.map +0 -1
- package/dist/types/agent-bridge.d.ts.map +0 -1
- package/dist/types/attachment.d.ts.map +0 -1
- package/dist/types/autonomy.d.ts.map +0 -1
- package/dist/types/blocks.d.ts.map +0 -1
- package/dist/types/compactor.d.ts.map +0 -1
- package/dist/types/config/autonomy.d.ts.map +0 -1
- package/dist/types/config/context.d.ts.map +0 -1
- package/dist/types/config/fleet-chat.d.ts.map +0 -1
- package/dist/types/config/mcp-features.d.ts.map +0 -1
- package/dist/types/config/providers.d.ts.map +0 -1
- package/dist/types/config/root.d.ts.map +0 -1
- package/dist/types/config/runtime.d.ts.map +0 -1
- package/dist/types/config/skills-fleet-brain.d.ts.map +0 -1
- package/dist/types/config/tools.d.ts.map +0 -1
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/context-evidence.d.ts.map +0 -1
- package/dist/types/context-window.d.ts.map +0 -1
- package/dist/types/council.d.ts.map +0 -1
- package/dist/types/default-config.d.ts.map +0 -1
- package/dist/types/design-kit.d.ts.map +0 -1
- package/dist/types/error-handler.d.ts.map +0 -1
- package/dist/types/errors.d.ts.map +0 -1
- package/dist/types/file-event-record.d.ts.map +0 -1
- package/dist/types/hooks.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -7
- package/dist/types/input-reader.d.ts.map +0 -1
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/memory.d.ts.map +0 -1
- package/dist/types/messages.d.ts.map +0 -1
- package/dist/types/mode-prompts.d.ts.map +0 -1
- package/dist/types/mode.d.ts.map +0 -1
- package/dist/types/models-registry.d.ts.map +0 -1
- package/dist/types/multi-agent.d.ts.map +0 -1
- package/dist/types/observability.d.ts.map +0 -1
- package/dist/types/one-shot-llm.d.ts.map +0 -1
- package/dist/types/path-resolver.d.ts.map +0 -1
- package/dist/types/permission.d.ts.map +0 -1
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/prompt-registry.d.ts.map +0 -1
- package/dist/types/prompt.d.ts.map +0 -1
- package/dist/types/provider-runner.d.ts.map +0 -1
- package/dist/types/provider.d.ts.map +0 -1
- package/dist/types/quota-regex.d.ts.map +0 -1
- package/dist/types/renderer.d.ts.map +0 -1
- package/dist/types/retry-policy.d.ts.map +0 -1
- package/dist/types/secret-scrubber.d.ts.map +0 -1
- package/dist/types/secret-vault.d.ts.map +0 -1
- package/dist/types/selector.d.ts.map +0 -1
- package/dist/types/session-markers.d.ts.map +0 -1
- package/dist/types/session-markers.js.map +0 -7
- package/dist/types/session-reader.d.ts.map +0 -1
- package/dist/types/session-rewinder.d.ts.map +0 -1
- package/dist/types/session.d.ts.map +0 -1
- package/dist/types/side-effect.d.ts.map +0 -1
- package/dist/types/skill.d.ts.map +0 -1
- package/dist/types/slash-command.d.ts.map +0 -1
- package/dist/types/spec.d.ts.map +0 -1
- package/dist/types/system-prompt-contributor.d.ts.map +0 -1
- package/dist/types/system-prompt.d.ts.map +0 -1
- package/dist/types/task-graph.d.ts.map +0 -1
- package/dist/types/token-counter.d.ts.map +0 -1
- package/dist/types/tool-executor.d.ts.map +0 -1
- package/dist/types/tool-markers.d.ts.map +0 -1
- package/dist/types/tool.d.ts.map +0 -1
- package/dist/types/utility-types.d.ts.map +0 -1
- package/dist/utils/assert-never.d.ts.map +0 -1
- package/dist/utils/atomic-write.d.ts.map +0 -1
- package/dist/utils/cache-key.d.ts.map +0 -1
- package/dist/utils/child-env.d.ts.map +0 -1
- package/dist/utils/color.d.ts.map +0 -1
- package/dist/utils/compaction-preview.d.ts.map +0 -1
- package/dist/utils/config-backup.d.ts.map +0 -1
- package/dist/utils/config-json.d.ts.map +0 -1
- package/dist/utils/connectivity.d.ts.map +0 -1
- package/dist/utils/context-breakdown.d.ts.map +0 -1
- package/dist/utils/context-evidence.d.ts.map +0 -1
- package/dist/utils/crash-shield.d.ts.map +0 -1
- package/dist/utils/deep-merge.d.ts.map +0 -1
- package/dist/utils/diff.d.ts.map +0 -1
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/error.js.map +0 -7
- package/dist/utils/expect-defined.d.ts.map +0 -1
- package/dist/utils/expect-defined.js.map +0 -7
- package/dist/utils/glob-expand.d.ts.map +0 -1
- package/dist/utils/glob-match.d.ts.map +0 -1
- package/dist/utils/heap-watchdog.d.ts.map +0 -1
- package/dist/utils/heap-watchdog.js.map +0 -7
- package/dist/utils/incoming-images.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -7
- package/dist/utils/instruction-file.d.ts.map +0 -1
- package/dist/utils/ip-guard.d.ts.map +0 -1
- package/dist/utils/json-repair.d.ts.map +0 -1
- package/dist/utils/json-schema-validate.d.ts.map +0 -1
- package/dist/utils/lru-cache.d.ts.map +0 -1
- package/dist/utils/merge-custom-models.d.ts.map +0 -1
- package/dist/utils/merge-models-payload.d.ts.map +0 -1
- package/dist/utils/message-invariants.d.ts.map +0 -1
- package/dist/utils/newline-normalize.d.ts.map +0 -1
- package/dist/utils/perf-profile.d.ts.map +0 -1
- package/dist/utils/pid.d.ts.map +0 -1
- package/dist/utils/project-identity.d.ts.map +0 -1
- package/dist/utils/project-watch.d.ts.map +0 -1
- package/dist/utils/regex-guard.d.ts.map +0 -1
- package/dist/utils/safe-json.d.ts.map +0 -1
- package/dist/utils/sage-output-block.d.ts.map +0 -1
- package/dist/utils/session-scoped-path.d.ts.map +0 -1
- package/dist/utils/sleep.d.ts.map +0 -1
- package/dist/utils/slug.d.ts.map +0 -1
- package/dist/utils/socket-path.d.ts.map +0 -1
- package/dist/utils/sqlite-warning.d.ts.map +0 -1
- package/dist/utils/string.d.ts.map +0 -1
- package/dist/utils/task-format.d.ts.map +0 -1
- package/dist/utils/term.d.ts.map +0 -1
- package/dist/utils/todos-format.d.ts.map +0 -1
- package/dist/utils/token-estimate.d.ts.map +0 -1
- package/dist/utils/tool-description-mode.d.ts.map +0 -1
- package/dist/utils/tool-output-serializer.d.ts.map +0 -1
- package/dist/utils/tool-result-render-mode.d.ts.map +0 -1
- package/dist/utils/tool-subject.d.ts.map +0 -1
- package/dist/utils/tool-wire-compact.d.ts.map +0 -1
- package/dist/utils/tree-kill.d.ts.map +0 -1
- package/dist/utils/tree-kill.js.map +0 -7
- package/dist/utils/ulid.d.ts.map +0 -1
- package/dist/utils/walk-ignore.d.ts.map +0 -1
- package/dist/utils/wstack-paths.d.ts.map +0 -1
- package/dist/worktree/index.d.ts.map +0 -1
- package/dist/worktree/index.js.map +0 -7
- package/dist/worktree/worktree-git.d.ts.map +0 -1
- package/dist/worktree/worktree-managed-ops.d.ts.map +0 -1
- package/dist/worktree/worktree-manager.d.ts.map +0 -1
- package/dist/worktree/worktree-types.d.ts.map +0 -1
|
@@ -1,7 +1,148 @@
|
|
|
1
1
|
// src/utils/heap-watchdog.ts
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as fsp2 from "node:fs/promises";
|
|
4
|
+
import * as path3 from "node:path";
|
|
5
|
+
import { PerformanceObserver, constants as performanceConstants } from "node:perf_hooks";
|
|
6
|
+
import * as v8 from "node:v8";
|
|
7
|
+
|
|
8
|
+
// src/utils/memory-flight-recorder.ts
|
|
2
9
|
import * as fsp from "node:fs/promises";
|
|
3
10
|
import * as path2 from "node:path";
|
|
4
|
-
|
|
11
|
+
|
|
12
|
+
// src/utils/continuous-memory-profiler.ts
|
|
13
|
+
import { Session } from "node:inspector/promises";
|
|
14
|
+
var DEFAULT_SAMPLE_INTERVAL_BYTES = 512 * 1024;
|
|
15
|
+
var DEFAULT_STACK_DEPTH = 64;
|
|
16
|
+
var MAX_SUMMARY_STACKS = 20;
|
|
17
|
+
var MAX_FRAMES_PER_STACK = 12;
|
|
18
|
+
function errorMessage(error) {
|
|
19
|
+
return error instanceof Error ? error.message : String(error);
|
|
20
|
+
}
|
|
21
|
+
function numeric(value) {
|
|
22
|
+
if (typeof value === "bigint") return Number(value);
|
|
23
|
+
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
24
|
+
}
|
|
25
|
+
function summarizePprof(profile) {
|
|
26
|
+
const strings = profile.stringTable.strings;
|
|
27
|
+
const functions = new Map(profile.function.map((entry) => [numeric(entry.id), entry]));
|
|
28
|
+
const locations = new Map(profile.location.map((entry) => [numeric(entry.id), entry]));
|
|
29
|
+
const stacks = /* @__PURE__ */ new Map();
|
|
30
|
+
let sampledBytes = 0;
|
|
31
|
+
let sampledObjects = 0;
|
|
32
|
+
for (const sample of profile.sample) {
|
|
33
|
+
const objects = numeric(sample.value[0]);
|
|
34
|
+
const bytes = numeric(sample.value[1]);
|
|
35
|
+
sampledObjects += objects;
|
|
36
|
+
sampledBytes += bytes;
|
|
37
|
+
const frames = sample.locationId.slice(0, MAX_FRAMES_PER_STACK).flatMap((locationId) => {
|
|
38
|
+
const location = locations.get(numeric(locationId));
|
|
39
|
+
const line = location?.line[0];
|
|
40
|
+
const fn = line ? functions.get(numeric(line.functionId)) : void 0;
|
|
41
|
+
if (!fn) return [];
|
|
42
|
+
const name = strings[numeric(fn.name)] || "(anonymous)";
|
|
43
|
+
const filename = strings[numeric(fn.filename)] || "";
|
|
44
|
+
const lineNumber = numeric(line?.line);
|
|
45
|
+
return [filename ? `${name} (${filename}${lineNumber > 0 ? `:${lineNumber}` : ""})` : name];
|
|
46
|
+
});
|
|
47
|
+
if (frames.length === 0) frames.push("(unknown)");
|
|
48
|
+
const key = frames.join("\n");
|
|
49
|
+
const existing = stacks.get(key);
|
|
50
|
+
if (existing) {
|
|
51
|
+
existing.bytes += bytes;
|
|
52
|
+
existing.objects += objects;
|
|
53
|
+
} else {
|
|
54
|
+
stacks.set(key, { bytes, objects, frames });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
sampledBytes,
|
|
59
|
+
sampledObjects,
|
|
60
|
+
sampleCount: profile.sample.length,
|
|
61
|
+
topStacks: [...stacks.values()].sort((left, right) => right.bytes - left.bytes).slice(0, MAX_SUMMARY_STACKS)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async function startDatadogProfiler() {
|
|
65
|
+
const pprof = await import("@datadog/pprof");
|
|
66
|
+
pprof.heap.start(DEFAULT_SAMPLE_INTERVAL_BYTES, DEFAULT_STACK_DEPTH);
|
|
67
|
+
let stopped = false;
|
|
68
|
+
return {
|
|
69
|
+
backend: "datadog-pprof",
|
|
70
|
+
capture: async () => {
|
|
71
|
+
if (stopped) throw new Error("Continuous memory profiler is stopped");
|
|
72
|
+
const profile = pprof.heap.profile();
|
|
73
|
+
return {
|
|
74
|
+
backend: "datadog-pprof",
|
|
75
|
+
data: await pprof.encode(profile),
|
|
76
|
+
extension: ".pb.gz",
|
|
77
|
+
summary: summarizePprof(profile)
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
stop: async () => {
|
|
81
|
+
if (stopped) return;
|
|
82
|
+
stopped = true;
|
|
83
|
+
pprof.heap.stop();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
async function startInspectorProfiler() {
|
|
88
|
+
const session = new Session();
|
|
89
|
+
session.connect();
|
|
90
|
+
try {
|
|
91
|
+
await session.post("HeapProfiler.enable");
|
|
92
|
+
await session.post("HeapProfiler.startSampling", {
|
|
93
|
+
samplingInterval: DEFAULT_SAMPLE_INTERVAL_BYTES,
|
|
94
|
+
includeObjectsCollectedByMajorGC: false,
|
|
95
|
+
includeObjectsCollectedByMinorGC: false
|
|
96
|
+
});
|
|
97
|
+
} catch (error) {
|
|
98
|
+
try {
|
|
99
|
+
session.disconnect();
|
|
100
|
+
} catch {
|
|
101
|
+
}
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
let stopped = false;
|
|
105
|
+
return {
|
|
106
|
+
backend: "node-inspector",
|
|
107
|
+
capture: async () => {
|
|
108
|
+
if (stopped) throw new Error("Continuous memory profiler is stopped");
|
|
109
|
+
const result = await session.post("HeapProfiler.stopSampling");
|
|
110
|
+
await session.post("HeapProfiler.startSampling", {
|
|
111
|
+
samplingInterval: DEFAULT_SAMPLE_INTERVAL_BYTES,
|
|
112
|
+
includeObjectsCollectedByMajorGC: false,
|
|
113
|
+
includeObjectsCollectedByMinorGC: false
|
|
114
|
+
});
|
|
115
|
+
return {
|
|
116
|
+
backend: "node-inspector",
|
|
117
|
+
data: JSON.stringify(result.profile),
|
|
118
|
+
extension: ".heapprofile"
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
stop: async () => {
|
|
122
|
+
if (stopped) return;
|
|
123
|
+
stopped = true;
|
|
124
|
+
try {
|
|
125
|
+
await session.post("HeapProfiler.disable");
|
|
126
|
+
} catch {
|
|
127
|
+
}
|
|
128
|
+
try {
|
|
129
|
+
session.disconnect();
|
|
130
|
+
} catch {
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
async function startContinuousMemoryProfiler() {
|
|
136
|
+
try {
|
|
137
|
+
return { profiler: await startDatadogProfiler() };
|
|
138
|
+
} catch (error) {
|
|
139
|
+
const fallbackReason = errorMessage(error);
|
|
140
|
+
return {
|
|
141
|
+
profiler: await startInspectorProfiler(),
|
|
142
|
+
fallbackReason
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
5
146
|
|
|
6
147
|
// src/utils/wstack-paths.ts
|
|
7
148
|
import * as os from "node:os";
|
|
@@ -12,27 +153,310 @@ function wstackGlobalRoot() {
|
|
|
12
153
|
return path.join(os.homedir(), ".wrongstack");
|
|
13
154
|
}
|
|
14
155
|
|
|
15
|
-
// src/utils/
|
|
156
|
+
// src/utils/memory-flight-recorder.ts
|
|
16
157
|
var MB = 1024 * 1024;
|
|
158
|
+
var HOUR_MS = 60 * 60 * 1e3;
|
|
159
|
+
var DEFAULT_WINDOW_MS = 5 * 60 * 1e3;
|
|
160
|
+
var DEFAULT_MINIMUM_WINDOW_MS = 2 * 60 * 1e3;
|
|
161
|
+
var DEFAULT_COOLDOWN_MS = 15 * 60 * 1e3;
|
|
162
|
+
var DEFAULT_CONTINUOUS_CAPTURE_MS = 5 * 60 * 1e3;
|
|
163
|
+
var MAX_OBSERVATIONS = 24;
|
|
164
|
+
var MAX_CAPTURE_SESSIONS = 12;
|
|
165
|
+
var MAX_CAPTURES_PER_SESSION = 6;
|
|
166
|
+
var SESSION_MAX_AGE_MS = 7 * 24 * HOUR_MS;
|
|
167
|
+
function timestampSlug(date = /* @__PURE__ */ new Date()) {
|
|
168
|
+
return date.toISOString().replaceAll(":", "").replaceAll(".", "-");
|
|
169
|
+
}
|
|
170
|
+
async function pruneCaptureFiles(artifactDir) {
|
|
171
|
+
const entries = await fsp.readdir(artifactDir, { withFileTypes: true });
|
|
172
|
+
const captures = entries.filter(
|
|
173
|
+
(entry) => entry.isFile() && entry.name.startsWith("event-") && entry.name.endsWith(".json")
|
|
174
|
+
).map((entry) => entry.name).sort();
|
|
175
|
+
const remove = captures.slice(0, Math.max(0, captures.length - MAX_CAPTURES_PER_SESSION));
|
|
176
|
+
await Promise.all(
|
|
177
|
+
remove.flatMap((eventName) => {
|
|
178
|
+
const stem = eventName.slice("event-".length, -".json".length);
|
|
179
|
+
return [
|
|
180
|
+
fsp.rm(path2.join(artifactDir, eventName), { force: true }),
|
|
181
|
+
fsp.rm(path2.join(artifactDir, `allocations-${stem}.heapprofile`), { force: true }),
|
|
182
|
+
fsp.rm(path2.join(artifactDir, `allocations-${stem}.pb.gz`), { force: true })
|
|
183
|
+
];
|
|
184
|
+
})
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
async function pruneOldSessions(root, currentDir) {
|
|
188
|
+
const entries = await fsp.readdir(root, { withFileTypes: true });
|
|
189
|
+
const sessions = await Promise.all(
|
|
190
|
+
entries.filter((entry) => entry.isDirectory() && entry.name !== path2.basename(currentDir)).map(async (entry) => {
|
|
191
|
+
const fullPath = path2.join(root, entry.name);
|
|
192
|
+
const stat2 = await fsp.stat(fullPath);
|
|
193
|
+
return { fullPath, mtimeMs: stat2.mtimeMs };
|
|
194
|
+
})
|
|
195
|
+
);
|
|
196
|
+
sessions.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
197
|
+
const now = Date.now();
|
|
198
|
+
await Promise.all(
|
|
199
|
+
sessions.filter(
|
|
200
|
+
(session, index) => now - session.mtimeMs > SESSION_MAX_AGE_MS || index >= MAX_CAPTURE_SESSIONS && now - session.mtimeMs > 24 * HOUR_MS
|
|
201
|
+
).map((session) => fsp.rm(session.fullPath, { recursive: true, force: true }))
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
var ContinuousMemoryCaptureWriter = class {
|
|
205
|
+
artifactDir;
|
|
206
|
+
root;
|
|
207
|
+
ready;
|
|
208
|
+
profiler;
|
|
209
|
+
profilerBackend = "initializing";
|
|
210
|
+
fallbackReason;
|
|
211
|
+
startError;
|
|
212
|
+
lastSummary;
|
|
213
|
+
stopped = false;
|
|
214
|
+
constructor(root) {
|
|
215
|
+
this.root = root;
|
|
216
|
+
this.artifactDir = path2.join(root, `${timestampSlug()}-pid-${process.pid}`);
|
|
217
|
+
this.ready = this.start().catch((error) => {
|
|
218
|
+
this.startError = error instanceof Error ? error.message : String(error);
|
|
219
|
+
this.profilerBackend = "unavailable";
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
async start() {
|
|
223
|
+
const started = await startContinuousMemoryProfiler();
|
|
224
|
+
this.profiler = started.profiler;
|
|
225
|
+
this.profilerBackend = started.profiler.backend;
|
|
226
|
+
this.fallbackReason = started.fallbackReason;
|
|
227
|
+
}
|
|
228
|
+
diagnostics() {
|
|
229
|
+
return {
|
|
230
|
+
memoryProfilerBackend: this.profilerBackend,
|
|
231
|
+
...this.fallbackReason ? { memoryProfilerFallbackReason: this.fallbackReason } : {},
|
|
232
|
+
...this.startError ? { memoryProfilerStartError: this.startError } : {},
|
|
233
|
+
...this.lastSummary ? {
|
|
234
|
+
memoryProfileSampledBytes: this.lastSummary.sampledBytes,
|
|
235
|
+
memoryProfileSampledObjects: this.lastSummary.sampledObjects,
|
|
236
|
+
memoryProfileSampleCount: this.lastSummary.sampleCount,
|
|
237
|
+
memoryProfileTopStack: this.lastSummary.topStack,
|
|
238
|
+
memoryProfileTopStackBytes: this.lastSummary.topStackBytes
|
|
239
|
+
} : {}
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
async capture(event) {
|
|
243
|
+
await this.ready;
|
|
244
|
+
if (this.stopped) return;
|
|
245
|
+
let profile;
|
|
246
|
+
let captureError = this.startError;
|
|
247
|
+
if (!captureError && this.profiler) {
|
|
248
|
+
try {
|
|
249
|
+
profile = await this.profiler.capture();
|
|
250
|
+
const top = profile.summary?.topStacks[0];
|
|
251
|
+
if (profile.summary) {
|
|
252
|
+
this.lastSummary = {
|
|
253
|
+
sampledBytes: profile.summary.sampledBytes,
|
|
254
|
+
sampledObjects: profile.summary.sampledObjects,
|
|
255
|
+
sampleCount: profile.summary.sampleCount,
|
|
256
|
+
topStack: top?.frames.join(" <- "),
|
|
257
|
+
topStackBytes: top?.bytes
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
} catch (error) {
|
|
261
|
+
captureError = error instanceof Error ? error.message : String(error);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
await fsp.mkdir(this.artifactDir, { recursive: true });
|
|
265
|
+
const stem = `${timestampSlug(new Date(event.capturedAt))}-${event.reason}`;
|
|
266
|
+
await fsp.writeFile(
|
|
267
|
+
path2.join(this.artifactDir, `event-${stem}.json`),
|
|
268
|
+
`${JSON.stringify(
|
|
269
|
+
{
|
|
270
|
+
...event,
|
|
271
|
+
profilerBackend: profile?.backend ?? this.profilerBackend,
|
|
272
|
+
...profile?.summary ? { allocationSummary: profile.summary } : {},
|
|
273
|
+
...this.fallbackReason ? { profilerFallbackReason: this.fallbackReason } : {},
|
|
274
|
+
...captureError ? { captureError } : {}
|
|
275
|
+
},
|
|
276
|
+
null,
|
|
277
|
+
2
|
|
278
|
+
)}
|
|
279
|
+
`,
|
|
280
|
+
"utf8"
|
|
281
|
+
);
|
|
282
|
+
if (profile) {
|
|
283
|
+
await fsp.writeFile(
|
|
284
|
+
path2.join(this.artifactDir, `allocations-${stem}${profile.extension}`),
|
|
285
|
+
profile.data
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
await Promise.all([
|
|
289
|
+
pruneCaptureFiles(this.artifactDir),
|
|
290
|
+
fsp.mkdir(this.root, { recursive: true }).then(() => pruneOldSessions(this.root, this.artifactDir))
|
|
291
|
+
]);
|
|
292
|
+
}
|
|
293
|
+
async stop() {
|
|
294
|
+
if (this.stopped) return;
|
|
295
|
+
this.stopped = true;
|
|
296
|
+
await this.ready;
|
|
297
|
+
await this.profiler?.stop();
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
function disabledWriter(artifactDir) {
|
|
301
|
+
return {
|
|
302
|
+
artifactDir,
|
|
303
|
+
capture: async () => void 0,
|
|
304
|
+
stop: async () => void 0
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function createMemoryFlightRecorder(options = {}) {
|
|
308
|
+
const now = options.now ?? Date.now;
|
|
309
|
+
const startedAt = now();
|
|
310
|
+
const root = options.diagnosticsRoot ?? path2.join(wstackGlobalRoot(), "diagnostics", "memory");
|
|
311
|
+
const enabled = options.enabled ?? (process.env["WRONGSTACK_MEMORY_FLIGHT_RECORDER"] !== "0" && process.env["NODE_ENV"] !== "test");
|
|
312
|
+
const writer = options.captureWriter ?? (enabled ? new ContinuousMemoryCaptureWriter(root) : disabledWriter(path2.join(root, `${timestampSlug()}-pid-${process.pid}`)));
|
|
313
|
+
const observations = [];
|
|
314
|
+
const windowMs = options.windowMs ?? DEFAULT_WINDOW_MS;
|
|
315
|
+
const minimumWindowMs = options.minimumWindowMs ?? DEFAULT_MINIMUM_WINDOW_MS;
|
|
316
|
+
const cooldownMs = options.cooldownMs ?? DEFAULT_COOLDOWN_MS;
|
|
317
|
+
const continuousCaptureMs = options.continuousCaptureMs ?? DEFAULT_CONTINUOUS_CAPTURE_MS;
|
|
318
|
+
const warmupMs = options.warmupMs ?? 6e4;
|
|
319
|
+
let lastSignalCaptureAt = Number.NEGATIVE_INFINITY;
|
|
320
|
+
let lastContinuousCaptureAt = startedAt;
|
|
321
|
+
let captureInFlight = false;
|
|
322
|
+
let capturePromise;
|
|
323
|
+
const observe = (sample, stats) => {
|
|
324
|
+
const at = now();
|
|
325
|
+
const postGcHeapUsed = typeof stats["postGcHeapUsed"] === "number" ? stats["postGcHeapUsed"] : 0;
|
|
326
|
+
const postMajorGcHeapUsed = typeof stats["postMajorGcHeapUsed"] === "number" ? stats["postMajorGcHeapUsed"] : 0;
|
|
327
|
+
const lastGcAgoMs = typeof stats["lastGcAgoMs"] === "number" ? stats["lastGcAgoMs"] : -1;
|
|
328
|
+
const lastMajorGcAgoMs = typeof stats["lastMajorGcAgoMs"] === "number" ? stats["lastMajorGcAgoMs"] : -1;
|
|
329
|
+
const retainedHeapUsed = postMajorGcHeapUsed > 0 && lastMajorGcAgoMs >= 0 && lastMajorGcAgoMs <= windowMs ? postMajorGcHeapUsed : postGcHeapUsed > 0 && lastGcAgoMs >= 0 && lastGcAgoMs <= minimumWindowMs ? postGcHeapUsed : sample.heapUsed;
|
|
330
|
+
observations.push({
|
|
331
|
+
at,
|
|
332
|
+
heapUsed: retainedHeapUsed,
|
|
333
|
+
rss: sample.rss,
|
|
334
|
+
nativeResidual: sample.nativeResidual ?? 0
|
|
335
|
+
});
|
|
336
|
+
while (observations.length > MAX_OBSERVATIONS || observations.length > 1 && at - (observations[0]?.at ?? at) > windowMs) {
|
|
337
|
+
observations.shift();
|
|
338
|
+
}
|
|
339
|
+
const first = observations[0] ?? observations.at(-1);
|
|
340
|
+
const elapsedMs = first ? Math.max(0, at - first.at) : 0;
|
|
341
|
+
const heapGrowthBytes = first ? retainedHeapUsed - first.heapUsed : 0;
|
|
342
|
+
const rssGrowthBytes = first ? sample.rss - first.rss : 0;
|
|
343
|
+
const nativeGrowthBytes = first ? (sample.nativeResidual ?? 0) - first.nativeResidual : 0;
|
|
344
|
+
const heapGrowthBytesPerHour = elapsedMs > 0 ? Math.round(heapGrowthBytes / elapsedMs * HOUR_MS) : 0;
|
|
345
|
+
const rssGrowthBytesPerHour = elapsedMs > 0 ? Math.round(rssGrowthBytes / elapsedMs * HOUR_MS) : 0;
|
|
346
|
+
const nativeGrowthBytesPerHour = elapsedMs > 0 ? Math.round(nativeGrowthBytes / elapsedMs * HOUR_MS) : 0;
|
|
347
|
+
let signal = "stable";
|
|
348
|
+
if ((sample.detachedContexts ?? 0) > 0) signal = "detached-contexts";
|
|
349
|
+
else if (heapGrowthBytes >= 32 * MB && heapGrowthBytesPerHour > 0) signal = "js-retention";
|
|
350
|
+
else if (nativeGrowthBytes >= 64 * MB && nativeGrowthBytesPerHour > 0) signal = "native-rss";
|
|
351
|
+
const diagnosis = {
|
|
352
|
+
memorySignal: signal,
|
|
353
|
+
memoryWindowMs: elapsedMs,
|
|
354
|
+
retainedHeapUsed,
|
|
355
|
+
transientHeapBytes: Math.max(0, sample.heapUsed - retainedHeapUsed),
|
|
356
|
+
heapGrowthBytes,
|
|
357
|
+
rssGrowthBytes,
|
|
358
|
+
nativeGrowthBytes,
|
|
359
|
+
heapGrowthBytesPerHour,
|
|
360
|
+
rssGrowthBytesPerHour,
|
|
361
|
+
nativeGrowthBytesPerHour,
|
|
362
|
+
memoryArtifactDir: writer.artifactDir,
|
|
363
|
+
...writer.diagnostics?.() ?? {}
|
|
364
|
+
};
|
|
365
|
+
let reason;
|
|
366
|
+
if (at - startedAt >= warmupMs) {
|
|
367
|
+
if ((sample.detachedContexts ?? 0) > 0) reason = "detached-contexts";
|
|
368
|
+
else if (sample.load >= 0.45) reason = "heap-load";
|
|
369
|
+
else if (sample.heapUsed >= (options.absoluteHeapBytes ?? 768 * MB)) {
|
|
370
|
+
reason = "absolute-heap";
|
|
371
|
+
} else if (elapsedMs >= minimumWindowMs && heapGrowthBytes >= (options.heapGrowthBytes ?? 32 * MB) && heapGrowthBytesPerHour >= (options.heapGrowthBytesPerHour ?? 192 * MB)) {
|
|
372
|
+
reason = "heap-growth";
|
|
373
|
+
} else if (elapsedMs >= minimumWindowMs && nativeGrowthBytes >= (options.nativeGrowthBytes ?? 128 * MB) && nativeGrowthBytesPerHour >= (options.nativeGrowthBytesPerHour ?? 256 * MB)) {
|
|
374
|
+
reason = "native-rss-growth";
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const signalCaptureDue = reason !== void 0 && at - lastSignalCaptureAt >= cooldownMs;
|
|
378
|
+
const intervalCaptureDue = at - lastContinuousCaptureAt >= continuousCaptureMs;
|
|
379
|
+
const captureReason = signalCaptureDue ? reason : intervalCaptureDue ? "interval" : void 0;
|
|
380
|
+
if (enabled && captureReason && !captureInFlight) {
|
|
381
|
+
if (captureReason !== "interval") lastSignalCaptureAt = at;
|
|
382
|
+
lastContinuousCaptureAt = at;
|
|
383
|
+
captureInFlight = true;
|
|
384
|
+
diagnosis["memoryCaptureReason"] = captureReason;
|
|
385
|
+
capturePromise = writer.capture({
|
|
386
|
+
reason: captureReason,
|
|
387
|
+
capturedAt: new Date(at).toISOString(),
|
|
388
|
+
pid: process.pid,
|
|
389
|
+
sample,
|
|
390
|
+
stats,
|
|
391
|
+
diagnosis: { ...diagnosis },
|
|
392
|
+
observations: observations.map((observation) => ({ ...observation }))
|
|
393
|
+
}).catch(() => {
|
|
394
|
+
}).finally(() => {
|
|
395
|
+
captureInFlight = false;
|
|
396
|
+
capturePromise = void 0;
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
return diagnosis;
|
|
400
|
+
};
|
|
401
|
+
return {
|
|
402
|
+
artifactDir: writer.artifactDir,
|
|
403
|
+
observe,
|
|
404
|
+
stop: async () => {
|
|
405
|
+
await capturePromise;
|
|
406
|
+
await writer.stop();
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// src/utils/heap-watchdog.ts
|
|
412
|
+
var MB2 = 1024 * 1024;
|
|
17
413
|
function defaultHeapLogPath() {
|
|
18
|
-
|
|
414
|
+
const override = process.env["WRONGSTACK_HEAP_LOG_PATH"]?.trim();
|
|
415
|
+
if (override) return path3.resolve(override);
|
|
416
|
+
return path3.join(wstackGlobalRoot(), "logs", "heap.jsonl");
|
|
19
417
|
}
|
|
20
418
|
function takeHeapSample() {
|
|
21
419
|
const m = process.memoryUsage();
|
|
22
|
-
const
|
|
420
|
+
const heap = v8.getHeapStatistics();
|
|
421
|
+
const spaces = v8.getHeapSpaceStatistics();
|
|
422
|
+
const spaceUsed = (name) => spaces.find((space) => space.space_name === name)?.space_used_size ?? 0;
|
|
423
|
+
const limit = heap.heap_size_limit || 0;
|
|
424
|
+
let activeResources = 0;
|
|
425
|
+
let activeResourceTypes = "";
|
|
426
|
+
try {
|
|
427
|
+
const resources = process.getActiveResourcesInfo?.() ?? [];
|
|
428
|
+
activeResources = resources.length;
|
|
429
|
+
const counts = /* @__PURE__ */ new Map();
|
|
430
|
+
for (const resource of resources) counts.set(resource, (counts.get(resource) ?? 0) + 1);
|
|
431
|
+
activeResourceTypes = [...counts].sort(([left], [right]) => left.localeCompare(right)).map(([resource, count]) => `${resource}=${count}`).join(",");
|
|
432
|
+
} catch {
|
|
433
|
+
}
|
|
23
434
|
return {
|
|
24
435
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
25
436
|
rss: m.rss,
|
|
26
437
|
heapUsed: m.heapUsed,
|
|
27
438
|
heapTotal: m.heapTotal,
|
|
28
439
|
external: m.external,
|
|
440
|
+
arrayBuffers: m.arrayBuffers,
|
|
441
|
+
nativeResidual: Math.max(0, m.rss - m.heapTotal - m.external),
|
|
442
|
+
oldSpaceUsed: spaceUsed("old_space"),
|
|
443
|
+
newSpaceUsed: spaceUsed("new_space"),
|
|
444
|
+
largeObjectSpaceUsed: spaceUsed("large_object_space"),
|
|
445
|
+
codeSpaceUsed: spaceUsed("code_space"),
|
|
446
|
+
mallocedMemory: heap.malloced_memory,
|
|
447
|
+
peakMallocedMemory: heap.peak_malloced_memory,
|
|
448
|
+
nativeContexts: heap.number_of_native_contexts,
|
|
449
|
+
detachedContexts: heap.number_of_detached_contexts,
|
|
450
|
+
activeResources,
|
|
451
|
+
activeResourceTypes,
|
|
29
452
|
heapLimit: limit,
|
|
30
453
|
load: limit > 0 ? m.heapUsed / limit : 0
|
|
31
454
|
};
|
|
32
455
|
}
|
|
33
456
|
function startHeapWatchdog(opts = {}) {
|
|
34
|
-
const
|
|
35
|
-
const
|
|
457
|
+
const profileMode = process.env["WRONGSTACK_MEMORY_PROFILE"] === "1";
|
|
458
|
+
const sampleEveryMs = opts.sampleEveryMs ?? (profileMode ? 5e3 : 3e4);
|
|
459
|
+
const logEveryMs = opts.logEveryMs ?? (profileMode ? 5e3 : 6e4);
|
|
36
460
|
const logPath = opts.logPath ?? defaultHeapLogPath();
|
|
37
461
|
const warnAt = opts.warnAt ?? 0.6;
|
|
38
462
|
const criticalAt = opts.criticalAt ?? 0.85;
|
|
@@ -45,13 +469,56 @@ function startHeapWatchdog(opts = {}) {
|
|
|
45
469
|
let drainPromise;
|
|
46
470
|
let stopped = false;
|
|
47
471
|
let dirReady = false;
|
|
472
|
+
const flightRecorder = createMemoryFlightRecorder();
|
|
473
|
+
let gcMajorCount = 0;
|
|
474
|
+
let gcMinorCount = 0;
|
|
475
|
+
let gcIncrementalCount = 0;
|
|
476
|
+
let gcWeakCallbackCount = 0;
|
|
477
|
+
let gcDurationMs = 0;
|
|
478
|
+
let postGcHeapUsed = 0;
|
|
479
|
+
let postMajorGcHeapUsed = 0;
|
|
480
|
+
let lastGcAt = 0;
|
|
481
|
+
let lastMajorGcAt = 0;
|
|
482
|
+
const gcObserver = new PerformanceObserver((list) => {
|
|
483
|
+
for (const entry of list.getEntries()) {
|
|
484
|
+
const kind = entry.detail?.kind ?? 0;
|
|
485
|
+
if ((kind & performanceConstants.NODE_PERFORMANCE_GC_MAJOR) !== 0) gcMajorCount++;
|
|
486
|
+
if ((kind & performanceConstants.NODE_PERFORMANCE_GC_MINOR) !== 0) gcMinorCount++;
|
|
487
|
+
if ((kind & performanceConstants.NODE_PERFORMANCE_GC_INCREMENTAL) !== 0) {
|
|
488
|
+
gcIncrementalCount++;
|
|
489
|
+
}
|
|
490
|
+
if ((kind & performanceConstants.NODE_PERFORMANCE_GC_WEAKCB) !== 0) gcWeakCallbackCount++;
|
|
491
|
+
gcDurationMs += entry.duration;
|
|
492
|
+
postGcHeapUsed = process.memoryUsage().heapUsed;
|
|
493
|
+
if ((kind & performanceConstants.NODE_PERFORMANCE_GC_MAJOR) !== 0) {
|
|
494
|
+
postMajorGcHeapUsed = postGcHeapUsed;
|
|
495
|
+
lastMajorGcAt = Date.now();
|
|
496
|
+
}
|
|
497
|
+
lastGcAt = Date.now();
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
try {
|
|
501
|
+
gcObserver.observe({ entryTypes: ["gc"] });
|
|
502
|
+
} catch {
|
|
503
|
+
}
|
|
504
|
+
const collectRuntimeStats = () => ({
|
|
505
|
+
gcMajorCount,
|
|
506
|
+
gcMinorCount,
|
|
507
|
+
gcIncrementalCount,
|
|
508
|
+
gcWeakCallbackCount,
|
|
509
|
+
gcDurationMs: Math.round(gcDurationMs),
|
|
510
|
+
postGcHeapUsed,
|
|
511
|
+
postMajorGcHeapUsed,
|
|
512
|
+
lastGcAgoMs: lastGcAt > 0 ? Date.now() - lastGcAt : -1,
|
|
513
|
+
lastMajorGcAgoMs: lastMajorGcAt > 0 ? Date.now() - lastMajorGcAt : -1
|
|
514
|
+
});
|
|
48
515
|
const writeDiagnosticLine = opts.writeDiagnosticLine ?? (async (targetPath, line) => {
|
|
49
516
|
if (!dirReady) {
|
|
50
|
-
await
|
|
517
|
+
await fsp2.mkdir(path3.dirname(targetPath), { recursive: true });
|
|
51
518
|
dirReady = true;
|
|
52
519
|
}
|
|
53
|
-
await
|
|
54
|
-
`, "utf8");
|
|
520
|
+
await fsp2.appendFile(targetPath, `${line}
|
|
521
|
+
`, { encoding: "utf8", mode: 384 });
|
|
55
522
|
});
|
|
56
523
|
const drainWrites = async (firstLine) => {
|
|
57
524
|
let line = firstLine;
|
|
@@ -74,6 +541,43 @@ function startHeapWatchdog(opts = {}) {
|
|
|
74
541
|
writeInFlight = true;
|
|
75
542
|
drainPromise = drainWrites(line);
|
|
76
543
|
};
|
|
544
|
+
const appendTerminalSample = (event, error, origin) => {
|
|
545
|
+
if (stopped) return;
|
|
546
|
+
let extras = {};
|
|
547
|
+
try {
|
|
548
|
+
extras = opts.collectStats?.() ?? {};
|
|
549
|
+
} catch {
|
|
550
|
+
}
|
|
551
|
+
try {
|
|
552
|
+
const sample = takeHeapSample();
|
|
553
|
+
const runtimeStats = collectRuntimeStats();
|
|
554
|
+
fs.mkdirSync(path3.dirname(logPath), { recursive: true });
|
|
555
|
+
fs.appendFileSync(
|
|
556
|
+
logPath,
|
|
557
|
+
`${JSON.stringify({
|
|
558
|
+
...extras,
|
|
559
|
+
...runtimeStats,
|
|
560
|
+
event,
|
|
561
|
+
...origin ? { crashOrigin: origin } : {},
|
|
562
|
+
...error instanceof Error ? { errorName: error.name, errorMessage: error.message.slice(0, 1e3) } : {},
|
|
563
|
+
pid: process.pid,
|
|
564
|
+
...sample,
|
|
565
|
+
exitCode: process.exitCode
|
|
566
|
+
})}
|
|
567
|
+
`,
|
|
568
|
+
"utf8"
|
|
569
|
+
);
|
|
570
|
+
} catch {
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
const onUncaughtException = (error, origin) => {
|
|
574
|
+
appendTerminalSample("memory.flight_recorder.crash", error, origin);
|
|
575
|
+
};
|
|
576
|
+
const onProcessExit = () => {
|
|
577
|
+
appendTerminalSample("memory.flight_recorder.exit");
|
|
578
|
+
};
|
|
579
|
+
process.on("uncaughtExceptionMonitor", onUncaughtException);
|
|
580
|
+
process.on("exit", onProcessExit);
|
|
77
581
|
const tick = () => {
|
|
78
582
|
let userTimings = 0;
|
|
79
583
|
try {
|
|
@@ -85,19 +589,27 @@ function startHeapWatchdog(opts = {}) {
|
|
|
85
589
|
} catch {
|
|
86
590
|
}
|
|
87
591
|
const s = takeHeapSample();
|
|
592
|
+
let extras = {};
|
|
593
|
+
try {
|
|
594
|
+
extras = opts.collectStats?.() ?? {};
|
|
595
|
+
} catch {
|
|
596
|
+
}
|
|
597
|
+
const runtimeStats = collectRuntimeStats();
|
|
598
|
+
const diagnosticStats = { ...extras, ...runtimeStats };
|
|
599
|
+
const memoryDiagnosis = flightRecorder.observe(s, diagnosticStats);
|
|
88
600
|
if (s.load >= criticalAt && criticalArmed) {
|
|
89
601
|
criticalArmed = false;
|
|
90
602
|
warnArmed = false;
|
|
91
603
|
opts.onWarn?.(
|
|
92
604
|
"critical",
|
|
93
|
-
`Heap critical: ${Math.round(s.heapUsed /
|
|
605
|
+
`Heap critical: ${Math.round(s.heapUsed / MB2)} MB of ~${Math.round(s.heapLimit / MB2)} MB V8 limit (${Math.round(s.load * 100)}%). An out-of-memory crash is likely soon \u2014 finish/checkpoint work and restart the session. Diagnostics: ${logPath}`,
|
|
94
606
|
s
|
|
95
607
|
);
|
|
96
608
|
} else if (s.load >= warnAt && warnArmed) {
|
|
97
609
|
warnArmed = false;
|
|
98
610
|
opts.onWarn?.(
|
|
99
611
|
"warn",
|
|
100
|
-
`Heap high: ${Math.round(s.heapUsed /
|
|
612
|
+
`Heap high: ${Math.round(s.heapUsed / MB2)} MB of ~${Math.round(s.heapLimit / MB2)} MB V8 limit (${Math.round(s.load * 100)}%). Memory diagnostics are being recorded to ${logPath}`,
|
|
101
613
|
s
|
|
102
614
|
);
|
|
103
615
|
}
|
|
@@ -105,14 +617,19 @@ function startHeapWatchdog(opts = {}) {
|
|
|
105
617
|
if (!criticalArmed && s.load < criticalAt - REARM_MARGIN) criticalArmed = true;
|
|
106
618
|
const due = Date.now() - lastLogAt >= logEveryMs;
|
|
107
619
|
const crossed = s.load >= warnAt;
|
|
108
|
-
|
|
620
|
+
const captured = typeof memoryDiagnosis["memoryCaptureReason"] === "string";
|
|
621
|
+
if (due || crossed || captured) {
|
|
109
622
|
lastLogAt = Date.now();
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
623
|
+
append(
|
|
624
|
+
JSON.stringify({
|
|
625
|
+
...extras,
|
|
626
|
+
...runtimeStats,
|
|
627
|
+
...memoryDiagnosis,
|
|
628
|
+
pid: process.pid,
|
|
629
|
+
...s,
|
|
630
|
+
userTimings
|
|
631
|
+
})
|
|
632
|
+
);
|
|
116
633
|
}
|
|
117
634
|
};
|
|
118
635
|
const timer = setInterval(tick, sampleEveryMs);
|
|
@@ -121,12 +638,69 @@ function startHeapWatchdog(opts = {}) {
|
|
|
121
638
|
return async () => {
|
|
122
639
|
stopped = true;
|
|
123
640
|
clearInterval(timer);
|
|
641
|
+
gcObserver.disconnect();
|
|
642
|
+
process.removeListener("uncaughtExceptionMonitor", onUncaughtException);
|
|
643
|
+
process.removeListener("exit", onProcessExit);
|
|
124
644
|
await drainPromise;
|
|
645
|
+
await flightRecorder.stop();
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
var sharedContributors = /* @__PURE__ */ new Map();
|
|
649
|
+
var nextSharedContributorId = 1;
|
|
650
|
+
var sharedSamplerActive = false;
|
|
651
|
+
var stopSharedSampler;
|
|
652
|
+
function collectSharedStats() {
|
|
653
|
+
const merged = {};
|
|
654
|
+
for (const contributor of sharedContributors.values()) {
|
|
655
|
+
try {
|
|
656
|
+
Object.assign(merged, contributor.collectStats?.() ?? {});
|
|
657
|
+
} catch {
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
return merged;
|
|
661
|
+
}
|
|
662
|
+
function warnSharedContributors(level, message, sample) {
|
|
663
|
+
for (const contributor of sharedContributors.values()) {
|
|
664
|
+
try {
|
|
665
|
+
contributor.onWarn?.(level, message, sample);
|
|
666
|
+
} catch {
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
function startSharedHeapWatchdog(opts = {}) {
|
|
671
|
+
if (process.env["NODE_ENV"] === "test" && !sharedSamplerActive && opts.logPath === void 0 && opts.writeDiagnosticLine === void 0) {
|
|
672
|
+
return async () => void 0;
|
|
673
|
+
}
|
|
674
|
+
const id = nextSharedContributorId++;
|
|
675
|
+
sharedContributors.set(id, {
|
|
676
|
+
collectStats: opts.collectStats,
|
|
677
|
+
onWarn: opts.onWarn
|
|
678
|
+
});
|
|
679
|
+
if (!sharedSamplerActive) {
|
|
680
|
+
sharedSamplerActive = true;
|
|
681
|
+
stopSharedSampler = startHeapWatchdog({
|
|
682
|
+
...opts,
|
|
683
|
+
collectStats: collectSharedStats,
|
|
684
|
+
onWarn: warnSharedContributors
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
let stopped = false;
|
|
688
|
+
return async () => {
|
|
689
|
+
if (stopped) return;
|
|
690
|
+
stopped = true;
|
|
691
|
+
sharedContributors.delete(id);
|
|
692
|
+
if (sharedContributors.size > 0 || !sharedSamplerActive) return;
|
|
693
|
+
const stop = stopSharedSampler;
|
|
694
|
+
if (!stop) return;
|
|
695
|
+
sharedSamplerActive = false;
|
|
696
|
+
stopSharedSampler = void 0;
|
|
697
|
+
await stop();
|
|
125
698
|
};
|
|
126
699
|
}
|
|
127
700
|
export {
|
|
128
701
|
defaultHeapLogPath,
|
|
129
702
|
startHeapWatchdog,
|
|
703
|
+
startSharedHeapWatchdog,
|
|
130
704
|
takeHeapSample
|
|
131
705
|
};
|
|
132
706
|
//# sourceMappingURL=heap-watchdog.js.map
|