@wrongstack/core 0.313.1 → 0.316.1
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 +31 -31
- package/dist/chronicle/legacy-journal-import.d.ts +0 -6
- package/dist/chronicle/metrics-ingest.d.ts +14 -0
- package/dist/chronicle/metrics-schema.d.ts +10 -1
- package/dist/chronicle/metrics-store.d.ts +20 -2
- package/dist/chronicle/project-server.js +39 -31
- package/dist/chronicle/sink.d.ts +13 -0
- package/dist/chronicle/sqlite-journal.d.ts +20 -2
- package/dist/{chunk-WOEZV3Q4.js → chunk-25LSLC3G.js} +2 -1
- package/dist/{chunk-AI4LLQ2U.js → chunk-27QIURLN.js} +229 -12
- package/dist/{chunk-I45KAW2N.js → chunk-3AGWVSS7.js} +38 -450
- package/dist/chunk-3BDV7RL3.js +211 -0
- package/dist/{chunk-NFAYHPRH.js → chunk-3ECENVHL.js} +10 -8
- package/dist/{chunk-FW5LDDMJ.js → chunk-45WI72ZB.js} +1576 -1156
- package/dist/{chunk-AT4V4XGI.js → chunk-4BMVPOHO.js} +539 -313
- package/dist/{chunk-YBUJCZ57.js → chunk-4I7HGVVA.js} +17 -5
- package/dist/{chunk-JVGPR3TS.js → chunk-4LCZVJVF.js} +7 -55
- package/dist/{chunk-4ZHTKJHM.js → chunk-4SJNS7OB.js} +36 -2
- package/dist/{chunk-AD7ZFZCS.js → chunk-5BMIE7QG.js} +3 -3
- package/dist/{chunk-IQ35HMQL.js → chunk-5YPSXQXM.js} +71 -24
- package/dist/chunk-6FHWXLPT.js +10 -0
- package/dist/{chunk-FIV4IJL7.js → chunk-6H5GEOET.js} +163 -20
- package/dist/{chunk-VB3H5WWB.js → chunk-6NWEVFEL.js} +2 -2
- package/dist/{chunk-E6I5RXVK.js → chunk-AYW5YINX.js} +2 -2
- package/dist/{chunk-DEIQMBD2.js → chunk-B7F4WVP4.js} +2 -2
- package/dist/{chunk-XQ2XGIBF.js → chunk-BPBKKBUK.js} +6 -7
- package/dist/{chunk-K4YUNKU7.js → chunk-BYD345OX.js} +2 -2
- package/dist/{chunk-LZDDLNCZ.js → chunk-C27KDLOX.js} +4 -4
- package/dist/{chunk-6AKOTGLM.js → chunk-CU546ESW.js} +7 -7
- package/dist/{chunk-ZZ4V3WIZ.js → chunk-DLHHXUAM.js} +10 -1
- package/dist/{chunk-BAKVJLEV.js → chunk-DOTHQSJ2.js} +28 -16
- package/dist/{chunk-KBZGE6LN.js → chunk-DYLPMV4Q.js} +4 -3
- package/dist/{chunk-52RTVH4M.js → chunk-F3JWNST7.js} +2 -2
- package/dist/{chunk-WEBMSQP2.js → chunk-FC2ZGRF3.js} +21 -4
- package/dist/{chunk-FHAMQS7Q.js → chunk-FCBTO76Z.js} +76 -146
- package/dist/{chunk-4LJJYBAU.js → chunk-FHZVFYSL.js} +9 -1
- package/dist/{chunk-W4A6QA3D.js → chunk-FWNLEZYG.js} +4 -3
- package/dist/{chunk-OJZEX73F.js → chunk-GDQ7CZRQ.js} +5 -1
- package/dist/{chunk-QVOVMXJR.js → chunk-GJJGJB2R.js} +32 -9
- package/dist/{chunk-4XV6IR37.js → chunk-HI3JGZR2.js} +7 -6
- package/dist/{chunk-FSWCWSTS.js → chunk-HMLIGAU7.js} +26 -26
- package/dist/{chunk-PFXFQQRT.js → chunk-HXKZ7OBQ.js} +7 -43
- package/dist/{chunk-2FQL4PDC.js → chunk-I7DALG7J.js} +5 -5
- package/dist/{chunk-GM54GJBU.js → chunk-IRUTEHCE.js} +3 -3
- package/dist/{chunk-TYW2GI5I.js → chunk-J2WRWR37.js} +40 -13
- package/dist/{chunk-ZEHUCJHY.js → chunk-JFPJ6LLQ.js} +2 -2
- package/dist/chunk-JMULFFLN.js +9 -0
- package/dist/{chunk-RD6DEE36.js → chunk-JO4MGB6Z.js} +94 -8
- package/dist/{chunk-5DSMEVA4.js → chunk-K6BXGITA.js} +7 -7
- package/dist/{chunk-O74MJHXU.js → chunk-KZMSZV32.js} +2 -2
- package/dist/{chunk-GFJOMSHG.js → chunk-LA7CLDRW.js} +6 -2
- package/dist/{chunk-M2WF6AXG.js → chunk-LSMMOS2Z.js} +7 -3
- package/dist/{chunk-ASX6AW36.js → chunk-LXWCMQNJ.js} +3 -3
- package/dist/{chunk-WZO23AWO.js → chunk-M27LIEKV.js} +72 -22
- package/dist/{chunk-JTHKOYWU.js → chunk-MJPHJRAL.js} +15 -15
- package/dist/{chunk-G5AAKEEZ.js → chunk-MTL4O5YR.js} +5 -5
- package/dist/chunk-NHJ75HXY.js +1 -0
- package/dist/{chunk-ZYU2YOJ6.js → chunk-NIOAGFPB.js} +29 -15
- package/dist/{chunk-Y2GE5TSI.js → chunk-NS52ISWS.js} +2 -2
- package/dist/{chunk-UIWONWVG.js → chunk-NSOFPKGT.js} +541 -148
- package/dist/{chunk-RCQYT2I4.js → chunk-NVIZG63R.js} +2 -2
- package/dist/{chunk-EPC3GZD4.js → chunk-OOYZPOXM.js} +2 -2
- package/dist/{chunk-7ZHZE5EO.js → chunk-OSGLYW5J.js} +2 -2
- package/dist/{chunk-CE4ZOCOI.js → chunk-PFCMSSUF.js} +9 -9
- package/dist/{chunk-GFXZTHNI.js → chunk-PGRVXIMY.js} +5 -5
- package/dist/{chunk-JJPMWPB6.js → chunk-PISBFBJN.js} +6 -6
- package/dist/chunk-POOOIWE5.js +9 -0
- package/dist/{chunk-5RP3QTRL.js → chunk-PQNS3U7Z.js} +20 -3
- package/dist/{chunk-3E244UDA.js → chunk-QSTSJOCK.js} +52 -6
- package/dist/{chunk-YUPMXOGP.js → chunk-RFQMOKWK.js} +3 -3
- package/dist/chunk-RTOTNK3P.js +484 -0
- package/dist/{chunk-SN2DQRL6.js → chunk-RXKSDUAU.js} +7 -7
- package/dist/{chunk-T3KGZBU5.js → chunk-S45JPKQN.js} +189 -43
- package/dist/{chunk-YNCVSFGF.js → chunk-SAFHACFA.js} +4 -1
- package/dist/{chunk-KI4L2DUL.js → chunk-TCCHINEF.js} +114 -19
- package/dist/{chunk-AWNQ6ED6.js → chunk-THEGTRAG.js} +7 -2
- package/dist/{chunk-2KKODIQU.js → chunk-TR4LQE7L.js} +15 -15
- package/dist/{chunk-GPQ3NJPR.js → chunk-TWJMGXCI.js} +3 -3
- package/dist/{chunk-H72H4XDU.js → chunk-U45AXT5D.js} +9 -9
- package/dist/{chunk-62V2AFVG.js → chunk-U4FWBSO3.js} +160 -73
- package/dist/{chunk-A455ATZB.js → chunk-UBGDX6FI.js} +8 -1
- package/dist/chunk-UJILKYES.js +75 -0
- package/dist/{chunk-KSJ5UTP7.js → chunk-ULMAQV3T.js} +84 -4
- package/dist/{chunk-CB2HFKTP.js → chunk-VVBP6KGT.js} +1 -1
- package/dist/{chunk-RPOA7IAE.js → chunk-W5VITDM2.js} +43 -25
- package/dist/{chunk-QRTG4XTI.js → chunk-WAHQVNWT.js} +7 -1
- package/dist/{chunk-SQP64RCS.js → chunk-WGGYRBXH.js} +3019 -2976
- package/dist/{chunk-K3G6JBUC.js → chunk-WLYKU45P.js} +679 -141
- package/dist/chunk-WP7BVANJ.js +53 -0
- package/dist/{chunk-GAZEWQEZ.js → chunk-XF4VUMKW.js} +2 -2
- package/dist/{chunk-PAAWLLZX.js → chunk-Y5YXDM7D.js} +2 -2
- package/dist/{chunk-65RDIOR2.js → chunk-YOPAUVU4.js} +162 -44
- package/dist/{chunk-FFSX2QDQ.js → chunk-YPT4A46F.js} +3 -3
- package/dist/chunk-YWXT3JNM.js +425 -0
- package/dist/{chunk-EFEHDQGY.js → chunk-ZHZ2Y2DH.js} +64 -10
- package/dist/{chunk-CQQL4ZOQ.js → chunk-ZT7JNIGX.js} +4 -3
- package/dist/coordination/agent-monitor.d.ts +9 -1
- package/dist/coordination/agent-subagent-runner.d.ts +1 -1
- package/dist/coordination/agents/agent-prompts.d.ts +8 -0
- package/dist/coordination/agents/index.d.ts +33 -1
- package/dist/coordination/agents/index.js +52 -22
- package/dist/coordination/agents/phase3-wave1-platform.d.ts +1 -3
- package/dist/coordination/agents/phase3-wave2-meta.d.ts +1 -3
- package/dist/coordination/agents/phase8-wave3-products.d.ts +1 -3
- package/dist/coordination/agents/phase9-wave4-platform-meta.d.ts +1 -3
- package/dist/coordination/agents/project-agent-identity.d.ts +11 -11
- package/dist/coordination/agents/types.d.ts +13 -2
- package/dist/coordination/brain-monitor.d.ts +30 -7
- package/dist/coordination/collab-debug.d.ts +1 -1
- package/dist/coordination/collab-pause.d.ts +1 -1
- package/dist/coordination/delegate-tool.d.ts +7 -5
- package/dist/coordination/director-kanban-queue-helpers.d.ts +1 -0
- package/dist/coordination/director-options.d.ts +7 -0
- package/dist/coordination/director-spawn-model.d.ts +17 -0
- package/dist/coordination/director-tools.d.ts +2 -2
- package/dist/coordination/director.d.ts +12 -0
- package/dist/coordination/dispatcher.d.ts +8 -0
- package/dist/coordination/fleet-bus.d.ts +35 -4
- package/dist/coordination/fleet-supervisor.d.ts +10 -2
- package/dist/coordination/fleet.d.ts +16 -7
- package/dist/coordination/index.d.ts +4 -0
- package/dist/coordination/index.js +86 -49
- package/dist/coordination/kanban-dispatch-port.d.ts +2 -2
- package/dist/coordination/mailbox-http-router.d.ts +4 -3
- package/dist/coordination/mailbox-http-validation.d.ts +1 -1
- package/dist/coordination/mailbox-project-server.js +15 -15
- package/dist/coordination/mailbox-types.d.ts +24 -6
- package/dist/coordination/model-tier-leader.d.ts +122 -0
- package/dist/coordination/model-tier.d.ts +122 -0
- package/dist/coordination/multi-agent-coordinator.d.ts +24 -0
- package/dist/coordination/origin-session.d.ts +16 -0
- package/dist/coordination/provider-status-tracker.d.ts +37 -5
- package/dist/coordination/session-note-hub.d.ts +44 -0
- package/dist/coordination/session-note-tool.d.ts +10 -0
- package/dist/core/agent.d.ts +1 -1
- package/dist/core/context.d.ts +22 -3
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +130 -38
- package/dist/core/request-conversation-binding.d.ts +37 -0
- package/dist/core/session-notes.d.ts +25 -0
- package/dist/core/system-prompt-builder.d.ts +11 -2
- package/dist/core/system-prompt-variants.d.ts +78 -0
- package/dist/design/index.js +3 -3
- package/dist/execution/auto-compaction-middleware.d.ts +11 -0
- package/dist/execution/autonomy-brain.d.ts +2 -1
- package/dist/execution/autonomy-prompt-contributor.d.ts +7 -2
- package/dist/execution/compaction-core.d.ts +4 -4
- package/dist/execution/eternal-autonomy.d.ts +1 -1
- package/dist/execution/index.js +138 -129
- package/dist/execution/model-runtime.d.ts +0 -7
- package/dist/execution/parallel-eternal-engine.d.ts +7 -7
- package/dist/extension/index.js +3 -3
- package/dist/goal/index.js +6 -6
- package/dist/hooks/index.js +3 -3
- package/dist/hq/index.js +14 -12
- package/dist/hq/persistence/event-log.d.ts +0 -1
- package/dist/hq/persistence.d.ts +4 -4
- package/dist/hq/publisher.d.ts +2 -0
- package/dist/index.d.ts +14 -11
- package/dist/index.js +728 -635
- package/dist/infrastructure/index.d.ts +4 -4
- package/dist/infrastructure/index.js +281 -260
- package/dist/infrastructure/token-counter.d.ts +9 -0
- package/dist/kernel/events/agent-events.d.ts +77 -3
- package/dist/kernel/events/brain-events.d.ts +12 -0
- package/dist/kernel/events/provider-events.d.ts +7 -1
- package/dist/kernel/events/session-events.d.ts +14 -0
- package/dist/kernel/events/tool-events.d.ts +13 -0
- package/dist/kernel/index.js +4 -4
- package/dist/mailbox-attach.d.ts +1 -1
- package/dist/models/index.js +10 -9
- package/dist/observability/event-bridge.d.ts +25 -5
- package/dist/observability/index.d.ts +9 -8
- package/dist/observability/index.js +459 -351
- package/dist/observability/tool-usage-source.d.ts +65 -0
- package/dist/plugin/index.d.ts +5 -0
- package/dist/plugin/index.js +66 -50
- package/dist/plugins/auto-review-plugin.d.ts +3 -2
- package/dist/plugins/review-finding-commands.d.ts +0 -8
- package/dist/{review-finding-store-DKAV3AS6.js → plugins/review-finding-store.js} +7 -6
- package/dist/plugins/review-finding-types.js +19 -0
- package/dist/plugins/review-report-integration.js +21 -0
- package/dist/{review-report-store-OWY3EC3N.js → plugins/review-report-store.js} +7 -6
- package/dist/plugins/review-report-types.js +13 -0
- package/dist/prompts/index.js +5 -5
- package/dist/registry/index.js +3 -3
- package/dist/registry/tool-registry.d.ts +59 -9
- package/dist/{registry-R23UBE7H.js → registry-7N4O3E7W.js} +5 -5
- package/dist/security/capabilities.d.ts +6 -0
- package/dist/security/file-permissions.d.ts +1 -1
- package/dist/security/index.js +47 -33
- package/dist/security/permission-policy.d.ts +12 -1
- package/dist/security/secret-scrubber.d.ts +15 -0
- package/dist/session-catalog/index.d.ts +1 -0
- package/dist/session-catalog/index.js +19 -14
- package/dist/session-catalog/project-server.js +30 -13
- package/dist/session-catalog/protocol.d.ts +32 -1
- package/dist/session-catalog/registry.d.ts +17 -1
- package/dist/session-catalog/session-agents.d.ts +56 -0
- package/dist/session-catalog/store-rebuild.d.ts +14 -0
- package/dist/session-catalog/store-schema.d.ts +26 -0
- package/dist/session-catalog/store.d.ts +27 -1
- package/dist/session-note-attach.d.ts +9 -0
- package/dist/skills/index.js +5 -5
- package/dist/statusline/index.d.ts +43 -0
- package/dist/statusline/index.js +102 -0
- package/dist/storage/board-store-port.d.ts +2 -2
- package/dist/storage/config-loader/in-project-policy.d.ts +29 -0
- package/dist/storage/config-loader.d.ts +3 -2
- package/dist/storage/file-session-writer.d.ts +4 -2
- package/dist/storage/goal-coordination.d.ts +6 -1
- package/dist/storage/goal-kanban.d.ts +4 -1
- package/dist/storage/index.d.ts +12 -4
- package/dist/storage/index.js +76 -61
- package/dist/storage/input-history-store.d.ts +2 -4
- package/dist/storage/memory-curator.d.ts +133 -0
- package/dist/storage/session-agent-attribution.d.ts +39 -0
- package/dist/storage/session-doctor.d.ts +109 -0
- package/dist/storage/session-event-bridge.d.ts +5 -7
- package/dist/storage/session-outcome.d.ts +42 -0
- package/dist/storage/session-recovery.d.ts +55 -0
- package/dist/storage/session-store/load-session-data.d.ts +11 -0
- package/dist/storage/session-store/prune-helpers.d.ts +1 -1
- package/dist/storage/session-store/resume-session.d.ts +0 -2
- package/dist/storage/session-store/types.d.ts +8 -0
- package/dist/storage/session-store.d.ts +3 -3
- package/dist/storage/session-summary-tracker.d.ts +8 -1
- package/dist/storage/session-write-buffer.d.ts +18 -0
- package/dist/storage/session-writer-truncate.d.ts +2 -0
- package/dist/tasking/index.js +2 -2
- package/dist/tools/fallback-manage-tools.d.ts +6 -4
- package/dist/tools/index.js +21 -21
- package/dist/tools/model-tier-set-tool.d.ts +66 -0
- package/dist/types/agent-bridge.d.ts +2 -1
- package/dist/types/config/mcp-features.d.ts +7 -0
- package/dist/types/config/model-tiers.d.ts +148 -0
- package/dist/types/config/root.d.ts +9 -0
- package/dist/types/config/tools.d.ts +73 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/context.d.ts +2 -0
- package/dist/types/default-config.d.ts +6 -0
- package/dist/types/errors.d.ts +2 -1
- package/dist/types/index.d.ts +11 -9
- package/dist/types/index.js +25 -15
- package/dist/types/multi-agent.d.ts +43 -0
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/provider.d.ts +15 -0
- package/dist/types/runtime-capability-manifest.d.ts +1 -1
- package/dist/types/secret-scrubber.d.ts +15 -0
- package/dist/types/session-markers.d.ts +37 -10
- package/dist/types/session-markers.js +1 -1
- package/dist/types/session-timeline.d.ts +197 -0
- package/dist/types/session-timeline.js +12 -0
- package/dist/types/session.d.ts +172 -11
- package/dist/types/system-prompt.d.ts +27 -0
- package/dist/utils/config-backup.d.ts +9 -1
- package/dist/utils/heap-watchdog.js +2 -2
- package/dist/utils/index.js +50 -48
- package/dist/utils/message-invariants.d.ts +4 -1
- package/dist/utils/regex-guard.d.ts +1 -1
- package/dist/utils/socket-path.d.ts +1 -1
- package/dist/utils/token-estimate.d.ts +6 -2
- package/dist/utils/wstack-paths.d.ts +2 -0
- package/dist/wiring/proxy-rewrite.d.ts +28 -0
- package/dist/wiring/proxy-rewrite.js +7 -1
- package/dist/worktree/index.js +2 -2
- package/instructions/agents/explore-companion.md +45 -18
- package/instructions/agents/memory-curator.md +34 -22
- package/instructions/coordination/director-preamble.md +12 -7
- package/instructions/coordination/subagent-baseline.md +26 -5
- package/instructions/leader-after-task.md +4 -1
- package/instructions/llm/chimera-review.md +30 -9
- package/instructions/llm/memory-curator.md +31 -0
- package/instructions/sections/tool/delegation-compact.md +2 -0
- package/instructions/sections/tool/delegation-full.md +5 -1
- package/instructions/sections/tool/mailbox-compact.md +5 -1
- package/instructions/sections/tool/mailbox-full.md +3 -0
- package/instructions/sections/tool/session-note-compact.md +3 -0
- package/instructions/sections/tool/session-note-full.md +15 -0
- package/instructions/system-lite.md +9 -4
- package/instructions/system-pro.md +66 -143
- package/instructions/system.md +73 -175
- package/package.json +32 -4
- package/dist/chunk-2BUUIMQB.js +0 -225
- package/dist/chunk-FAYRX2AD.js +0 -13
- package/dist/chunk-H5E77KUJ.js +0 -15
- package/dist/chunk-M7BS2K6U.js +0 -1
- package/dist/coordination/agents.d.ts +0 -8
- package/dist/coordination/transport.d.ts +0 -2
- package/dist/storage/session-writer/session-writer-summary-tracker.d.ts +0 -28
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FINDING_DEFAULT_PAGE_SIZE,
|
|
3
|
-
JsonlFindingStore,
|
|
4
|
-
computeFindingFingerprint
|
|
5
|
-
} from "./chunk-JVGPR3TS.js";
|
|
6
1
|
import {
|
|
7
2
|
SkillInstaller,
|
|
8
3
|
bodyLineAdvisory,
|
|
@@ -13,13 +8,13 @@ import {
|
|
|
13
8
|
openInEditor,
|
|
14
9
|
validateSkillNameAvailable,
|
|
15
10
|
writeSkeletonSkill
|
|
16
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RXKSDUAU.js";
|
|
17
12
|
import {
|
|
18
13
|
ALL_SYNC_CATEGORIES,
|
|
19
14
|
CloudConfigSync,
|
|
20
15
|
CloudSync,
|
|
21
16
|
PromptUsageStore
|
|
22
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GJJGJB2R.js";
|
|
23
18
|
import {
|
|
24
19
|
decryptConfigSecrets,
|
|
25
20
|
encryptConfigSecrets
|
|
@@ -30,11 +25,18 @@ import {
|
|
|
30
25
|
} from "./chunk-3XPVB7BA.js";
|
|
31
26
|
import {
|
|
32
27
|
createChronicleProjectAccess
|
|
33
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-LXWCMQNJ.js";
|
|
29
|
+
import {
|
|
30
|
+
syncReportCompletion,
|
|
31
|
+
syncReportReopen
|
|
32
|
+
} from "./chunk-YWXT3JNM.js";
|
|
33
|
+
import {
|
|
34
|
+
FINDING_DEFAULT_PAGE_SIZE
|
|
35
|
+
} from "./chunk-4LCZVJVF.js";
|
|
34
36
|
import {
|
|
35
37
|
DefaultPromptLoader,
|
|
36
38
|
renderPrompt
|
|
37
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-XF4VUMKW.js";
|
|
38
40
|
import {
|
|
39
41
|
FOREIGN_SKILL_TOOLS,
|
|
40
42
|
securityScoreToTier
|
|
@@ -42,30 +44,24 @@ import {
|
|
|
42
44
|
import {
|
|
43
45
|
DefaultPromptStore,
|
|
44
46
|
migratePromptEntry
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import {
|
|
47
|
-
JsonlReportStore
|
|
48
|
-
} from "./chunk-PFXFQQRT.js";
|
|
49
|
-
import {
|
|
50
|
-
ExtensionRegistry
|
|
51
|
-
} from "./chunk-G5AAKEEZ.js";
|
|
52
|
-
import {
|
|
53
|
-
FallbackProfileManager
|
|
54
|
-
} from "./chunk-WQQON3SV.js";
|
|
55
|
-
import {
|
|
56
|
-
parseModelRef
|
|
57
|
-
} from "./chunk-RJIZEJ42.js";
|
|
47
|
+
} from "./chunk-PGRVXIMY.js";
|
|
58
48
|
import {
|
|
59
49
|
readJsonObjectFile,
|
|
60
50
|
validateAgainstSchema
|
|
61
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-YPT4A46F.js";
|
|
62
52
|
import {
|
|
63
53
|
readBundledInstructionText,
|
|
64
54
|
renderInstructionTemplate
|
|
65
55
|
} from "./chunk-5S437PRC.js";
|
|
56
|
+
import {
|
|
57
|
+
ExtensionRegistry
|
|
58
|
+
} from "./chunk-MTL4O5YR.js";
|
|
59
|
+
import {
|
|
60
|
+
FallbackProfileManager
|
|
61
|
+
} from "./chunk-WQQON3SV.js";
|
|
66
62
|
import {
|
|
67
63
|
capSkillBody
|
|
68
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-M27LIEKV.js";
|
|
69
65
|
import {
|
|
70
66
|
color
|
|
71
67
|
} from "./chunk-4VWO3ZXL.js";
|
|
@@ -74,24 +70,27 @@ import {
|
|
|
74
70
|
} from "./chunk-TRT2HRWZ.js";
|
|
75
71
|
import {
|
|
76
72
|
atomicWrite
|
|
77
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-OSGLYW5J.js";
|
|
78
74
|
import {
|
|
79
75
|
stripFrontmatter
|
|
80
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-FC2ZGRF3.js";
|
|
81
77
|
import {
|
|
82
78
|
projectSlug,
|
|
83
79
|
resolveWstackPaths
|
|
84
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-SAFHACFA.js";
|
|
81
|
+
import {
|
|
82
|
+
parseModelRef
|
|
83
|
+
} from "./chunk-RJIZEJ42.js";
|
|
84
|
+
import {
|
|
85
|
+
expectDefined
|
|
86
|
+
} from "./chunk-PFZO3C6H.js";
|
|
85
87
|
import {
|
|
86
88
|
ERROR_CODES,
|
|
87
89
|
PluginError
|
|
88
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-25LSLC3G.js";
|
|
89
91
|
import {
|
|
90
92
|
toErrorMessage
|
|
91
93
|
} from "./chunk-TBRL2RCC.js";
|
|
92
|
-
import {
|
|
93
|
-
expectDefined
|
|
94
|
-
} from "./chunk-PFZO3C6H.js";
|
|
95
94
|
|
|
96
95
|
// src/plugin/loader.ts
|
|
97
96
|
var legacyRegistrations = /* @__PURE__ */ new WeakMap();
|
|
@@ -2373,411 +2372,6 @@ function createAutoReviewPlugin() {
|
|
|
2373
2372
|
};
|
|
2374
2373
|
}
|
|
2375
2374
|
|
|
2376
|
-
// src/plugins/review-finding-parser.ts
|
|
2377
|
-
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
2378
|
-
var SEVERITIES = /* @__PURE__ */ new Set(["critical", "high", "medium", "low"]);
|
|
2379
|
-
var CATEGORIES = /* @__PURE__ */ new Set([
|
|
2380
|
-
"bug",
|
|
2381
|
-
"security",
|
|
2382
|
-
"performance",
|
|
2383
|
-
"type",
|
|
2384
|
-
"contract",
|
|
2385
|
-
"test",
|
|
2386
|
-
"other"
|
|
2387
|
-
]);
|
|
2388
|
-
var CONFIDENCES = /* @__PURE__ */ new Set(["high", "medium", "low"]);
|
|
2389
|
-
var FENCED_BLOCK = /```json[ \t]*\r?\n([\s\S]*?)\r?\n```/gi;
|
|
2390
|
-
function extractStructuredFindingsBlock(reportText) {
|
|
2391
|
-
if (!reportText) return null;
|
|
2392
|
-
let best = null;
|
|
2393
|
-
for (const match of reportText.matchAll(FENCED_BLOCK)) {
|
|
2394
|
-
const body = match[1];
|
|
2395
|
-
if (!body?.trim()) continue;
|
|
2396
|
-
let parsed;
|
|
2397
|
-
try {
|
|
2398
|
-
parsed = JSON.parse(body);
|
|
2399
|
-
} catch {
|
|
2400
|
-
continue;
|
|
2401
|
-
}
|
|
2402
|
-
if (typeof parsed !== "object" || parsed === null) continue;
|
|
2403
|
-
const findings = parsed.findings;
|
|
2404
|
-
if (!Array.isArray(findings)) continue;
|
|
2405
|
-
const items = [];
|
|
2406
|
-
for (const raw of findings) {
|
|
2407
|
-
const item = normalizeStructuredItem(raw);
|
|
2408
|
-
if (item) items.push(item);
|
|
2409
|
-
}
|
|
2410
|
-
if (findings.length > 0 && items.length === 0) continue;
|
|
2411
|
-
const durationRaw = parsed.durationSeconds;
|
|
2412
|
-
const durationSeconds = typeof durationRaw === "number" && Number.isFinite(durationRaw) && durationRaw > 0 ? Math.floor(durationRaw) : void 0;
|
|
2413
|
-
best = { findings: items, ...durationSeconds !== void 0 ? { durationSeconds } : {} };
|
|
2414
|
-
}
|
|
2415
|
-
return best;
|
|
2416
|
-
}
|
|
2417
|
-
function normalizeStructuredItem(raw) {
|
|
2418
|
-
if (typeof raw !== "object" || raw === null) return null;
|
|
2419
|
-
const item = raw;
|
|
2420
|
-
const severity = typeof item.severity === "string" ? item.severity.toLowerCase() : "";
|
|
2421
|
-
if (!SEVERITIES.has(severity)) return null;
|
|
2422
|
-
const title = typeof item.title === "string" ? item.title.trim() : "";
|
|
2423
|
-
if (title.length === 0) return null;
|
|
2424
|
-
const file = typeof item.file === "string" && item.file.trim().length > 0 ? item.file.trim() : void 0;
|
|
2425
|
-
const line = typeof item.line === "number" && Number.isInteger(item.line) && item.line >= 1 ? item.line : void 0;
|
|
2426
|
-
const categoryRaw = typeof item.category === "string" ? item.category.toLowerCase() : "";
|
|
2427
|
-
const category = CATEGORIES.has(categoryRaw) ? categoryRaw : void 0;
|
|
2428
|
-
const confidenceRaw = typeof item.confidence === "string" ? item.confidence.toLowerCase() : "";
|
|
2429
|
-
const confidence = CONFIDENCES.has(confidenceRaw) ? confidenceRaw : void 0;
|
|
2430
|
-
return {
|
|
2431
|
-
severity,
|
|
2432
|
-
...file ? { file } : {},
|
|
2433
|
-
...line !== void 0 ? { line } : {},
|
|
2434
|
-
...category ? { category } : {},
|
|
2435
|
-
...confidence ? { confidence } : {},
|
|
2436
|
-
title,
|
|
2437
|
-
...typeof item.description === "string" && item.description.trim().length > 0 ? { description: item.description.trim() } : {},
|
|
2438
|
-
...typeof item.suggestedFix === "string" && item.suggestedFix.trim().length > 0 ? { suggestedFix: item.suggestedFix.trim() } : {}
|
|
2439
|
-
};
|
|
2440
|
-
}
|
|
2441
|
-
var SUGGEST_LINE = /^\s*(?:→|->|=>)\s*(.+)$/;
|
|
2442
|
-
var DURATION_LINE = /^Duration:\s*(\d+)s\s*$/im;
|
|
2443
|
-
function parseChimeraReviewReport(reportText, context = {}) {
|
|
2444
|
-
if (!reportText || reportText.trim().length === 0) {
|
|
2445
|
-
return { findings: [], unparseableCount: 0 };
|
|
2446
|
-
}
|
|
2447
|
-
const structured = extractStructuredFindingsBlock(reportText);
|
|
2448
|
-
if (structured) {
|
|
2449
|
-
const reportId2 = context.reportId ?? randomUUID2();
|
|
2450
|
-
const findings2 = structured.findings.map(
|
|
2451
|
-
(item) => buildFindingFromStructuredItem(item, { ...context, reportId: reportId2 })
|
|
2452
|
-
);
|
|
2453
|
-
return {
|
|
2454
|
-
findings: findings2,
|
|
2455
|
-
unparseableCount: 0,
|
|
2456
|
-
...structured.durationSeconds !== void 0 ? { durationSeconds: structured.durationSeconds } : {},
|
|
2457
|
-
structured: true
|
|
2458
|
-
};
|
|
2459
|
-
}
|
|
2460
|
-
const findings = [];
|
|
2461
|
-
const reportId = context.reportId ?? randomUUID2();
|
|
2462
|
-
let unparseableCount = 0;
|
|
2463
|
-
let durationSeconds;
|
|
2464
|
-
let currentSeverity = null;
|
|
2465
|
-
let currentLines = [];
|
|
2466
|
-
const lines = reportText.split("\n");
|
|
2467
|
-
for (let i = 0; i < lines.length; i++) {
|
|
2468
|
-
const line = lines[i];
|
|
2469
|
-
const headingMatch = line.trim().match(/^###\s+(critical|high|medium|low)\b/i);
|
|
2470
|
-
if (headingMatch) {
|
|
2471
|
-
flushSection();
|
|
2472
|
-
currentSeverity = headingMatch[1].toLowerCase();
|
|
2473
|
-
continue;
|
|
2474
|
-
}
|
|
2475
|
-
const durMatch = line.match(DURATION_LINE);
|
|
2476
|
-
if (durMatch) {
|
|
2477
|
-
durationSeconds = Number.parseInt(durMatch[1], 10);
|
|
2478
|
-
continue;
|
|
2479
|
-
}
|
|
2480
|
-
if (currentSeverity !== null) {
|
|
2481
|
-
currentLines.push(line);
|
|
2482
|
-
}
|
|
2483
|
-
}
|
|
2484
|
-
flushSection();
|
|
2485
|
-
return { findings, unparseableCount, durationSeconds };
|
|
2486
|
-
function flushSection() {
|
|
2487
|
-
if (currentSeverity === null || currentLines.length === 0) {
|
|
2488
|
-
currentSeverity = null;
|
|
2489
|
-
currentLines = [];
|
|
2490
|
-
return;
|
|
2491
|
-
}
|
|
2492
|
-
const combined = currentLines.join("\n");
|
|
2493
|
-
const segments = combined.split(/\n\s*(?=\d+\.\s)/).filter((s) => s.trim().length > 0);
|
|
2494
|
-
for (const segment of segments) {
|
|
2495
|
-
const finding = parseFindingSegment(segment, currentSeverity, { ...context, reportId });
|
|
2496
|
-
if (finding) {
|
|
2497
|
-
findings.push(finding);
|
|
2498
|
-
} else {
|
|
2499
|
-
unparseableCount++;
|
|
2500
|
-
}
|
|
2501
|
-
}
|
|
2502
|
-
currentSeverity = null;
|
|
2503
|
-
currentLines = [];
|
|
2504
|
-
}
|
|
2505
|
-
}
|
|
2506
|
-
function parseFindingSegment(segment, severity, context) {
|
|
2507
|
-
const lines = segment.split("\n").map((l) => l.trim()).filter((l) => l.length > 0);
|
|
2508
|
-
if (lines.length === 0) return null;
|
|
2509
|
-
const first = lines[0];
|
|
2510
|
-
const match = first.match(/^\d+\.\s+(.*)$/);
|
|
2511
|
-
if (!match) return null;
|
|
2512
|
-
const content = match[1].trim();
|
|
2513
|
-
let remaining = content;
|
|
2514
|
-
const tagMatch = content.match(/^\[(\w+)\]\s*/);
|
|
2515
|
-
if (tagMatch) {
|
|
2516
|
-
remaining = content.slice(tagMatch[0].length).trim();
|
|
2517
|
-
}
|
|
2518
|
-
const citationMatch = remaining.match(
|
|
2519
|
-
/^(`+)([a-zA-Z_./\\:][^`]*[a-zA-Z0-9_./\\:])\1(?=\s*[—–-]|\s*$)/
|
|
2520
|
-
);
|
|
2521
|
-
if (citationMatch) {
|
|
2522
|
-
const inner = citationMatch[2];
|
|
2523
|
-
const afterCitation = remaining.slice(citationMatch[0].length);
|
|
2524
|
-
remaining = `${inner}${afterCitation}`;
|
|
2525
|
-
}
|
|
2526
|
-
let file;
|
|
2527
|
-
let line;
|
|
2528
|
-
let desc = remaining;
|
|
2529
|
-
const refMatch = remaining.match(
|
|
2530
|
-
/^([a-zA-Z_./\\][a-zA-Z0-9_./\\-]*\.\w+)(?::(\d+))?\s+(?:[—–]|-)\s+(.+)$/
|
|
2531
|
-
);
|
|
2532
|
-
if (refMatch) {
|
|
2533
|
-
file = refMatch[1].trim();
|
|
2534
|
-
if (refMatch[2] !== void 0) {
|
|
2535
|
-
line = Number.parseInt(refMatch[2], 10);
|
|
2536
|
-
}
|
|
2537
|
-
desc = refMatch[3].trim();
|
|
2538
|
-
}
|
|
2539
|
-
if (!file) {
|
|
2540
|
-
const pathMatch = remaining.match(/^([a-zA-Z_./\\][a-zA-Z0-9_./\\-]*\.\w+)(?::(\d+))?/);
|
|
2541
|
-
if (pathMatch) {
|
|
2542
|
-
file = pathMatch[1].trim();
|
|
2543
|
-
if (pathMatch[2] !== void 0) {
|
|
2544
|
-
line = Number.parseInt(pathMatch[2], 10);
|
|
2545
|
-
}
|
|
2546
|
-
const afterFile = remaining.slice(pathMatch[0].length).trim();
|
|
2547
|
-
desc = afterFile.replace(/^[—–-]\s*/, "").trim() || desc;
|
|
2548
|
-
}
|
|
2549
|
-
}
|
|
2550
|
-
const cleanDesc = desc.replace(/^[—–-]\s*/, "").trim();
|
|
2551
|
-
const suggestions = [];
|
|
2552
|
-
for (let i = 1; i < lines.length; i++) {
|
|
2553
|
-
const suggest = lines[i].match(SUGGEST_LINE);
|
|
2554
|
-
if (suggest) {
|
|
2555
|
-
suggestions.push(suggest[1].trim());
|
|
2556
|
-
}
|
|
2557
|
-
}
|
|
2558
|
-
const title = cleanDesc.split(/\.\s/)[0].trim() || content;
|
|
2559
|
-
const fullDesc = suggestions.length > 0 ? cleanDesc + "\n" + suggestions.map((s) => " \u2192 " + s).join("\n") : cleanDesc;
|
|
2560
|
-
const suggestedFix = suggestions.length > 0 ? suggestions.join("\n") : void 0;
|
|
2561
|
-
return {
|
|
2562
|
-
id: randomUUID2(),
|
|
2563
|
-
fingerprint: computeFindingFingerprint(file ?? "", line ?? null, title),
|
|
2564
|
-
severity,
|
|
2565
|
-
source: normalizeFindingSource(context.reviewType),
|
|
2566
|
-
...file ? { location: { file, ...line !== void 0 ? { line } : {} } } : {},
|
|
2567
|
-
title,
|
|
2568
|
-
description: fullDesc,
|
|
2569
|
-
...suggestedFix ? { suggestedFix } : {},
|
|
2570
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2571
|
-
status: "active",
|
|
2572
|
-
originReport: {
|
|
2573
|
-
reportId: context.reportId ?? randomUUID2(),
|
|
2574
|
-
sessionId: context.sessionId ?? "",
|
|
2575
|
-
agentId: context.agentId ?? "",
|
|
2576
|
-
reviewerModel: context.reviewerModel ?? ""
|
|
2577
|
-
}
|
|
2578
|
-
};
|
|
2579
|
-
}
|
|
2580
|
-
function normalizeFindingSource(reviewType) {
|
|
2581
|
-
switch (reviewType) {
|
|
2582
|
-
case "auto":
|
|
2583
|
-
case "chimera":
|
|
2584
|
-
case "cascade":
|
|
2585
|
-
case "security-scanner":
|
|
2586
|
-
return reviewType;
|
|
2587
|
-
default:
|
|
2588
|
-
return "chimera";
|
|
2589
|
-
}
|
|
2590
|
-
}
|
|
2591
|
-
function buildFindingFromStructuredItem(item, context) {
|
|
2592
|
-
const file = item.file;
|
|
2593
|
-
const line = item.line;
|
|
2594
|
-
const title = item.title;
|
|
2595
|
-
const description = item.description ?? title;
|
|
2596
|
-
return {
|
|
2597
|
-
id: randomUUID2(),
|
|
2598
|
-
fingerprint: computeFindingFingerprint(file ?? "", line ?? null, title),
|
|
2599
|
-
severity: item.severity,
|
|
2600
|
-
source: normalizeFindingSource(context.reviewType),
|
|
2601
|
-
...file ? { location: { file, ...line !== void 0 ? { line } : {} } } : {},
|
|
2602
|
-
...item.category ? { category: item.category } : {},
|
|
2603
|
-
...item.confidence ? { confidence: item.confidence } : {},
|
|
2604
|
-
title,
|
|
2605
|
-
description,
|
|
2606
|
-
...item.suggestedFix ? { suggestedFix: item.suggestedFix } : {},
|
|
2607
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2608
|
-
status: "active",
|
|
2609
|
-
originReport: {
|
|
2610
|
-
reportId: context.reportId ?? randomUUID2(),
|
|
2611
|
-
sessionId: context.sessionId ?? "",
|
|
2612
|
-
agentId: context.agentId ?? "",
|
|
2613
|
-
reviewerModel: context.reviewerModel ?? ""
|
|
2614
|
-
}
|
|
2615
|
-
};
|
|
2616
|
-
}
|
|
2617
|
-
|
|
2618
|
-
// src/plugins/review-finding-integration.ts
|
|
2619
|
-
function classifyChimeraReviewSource(bundle) {
|
|
2620
|
-
const cascadeDepth = bundle.cascadeDepth ?? 0;
|
|
2621
|
-
if (cascadeDepth > 0) return "cascade";
|
|
2622
|
-
const cascadeOn = bundle.cascadeOn;
|
|
2623
|
-
if (cascadeOn !== void 0 && cascadeOn !== "off") return "auto";
|
|
2624
|
-
return "chimera";
|
|
2625
|
-
}
|
|
2626
|
-
async function integrateFindings(payload, projectDir, reportId) {
|
|
2627
|
-
if ((!payload.reviewText || payload.reviewText.trim().length === 0) && !payload.parsedReport) {
|
|
2628
|
-
return { created: 0, relinked: 0, reopened: 0, totalFindings: 0, unparseableCount: 0 };
|
|
2629
|
-
}
|
|
2630
|
-
const store = new JsonlFindingStore(projectDir);
|
|
2631
|
-
const source = classifyChimeraReviewSource(payload.bundle);
|
|
2632
|
-
const agentId = payload.bundle.fileProvenance?.find((entry) => entry.agentId)?.agentId ?? "chimera-review";
|
|
2633
|
-
const sessionId = payload.sessionId ?? payload.cwd;
|
|
2634
|
-
const model = payload.bundle.config.model;
|
|
2635
|
-
const parsed = payload.parsedReport ?? parseChimeraReviewReport(payload.reviewText, {
|
|
2636
|
-
sessionId,
|
|
2637
|
-
agentId,
|
|
2638
|
-
reviewerModel: model,
|
|
2639
|
-
reviewType: source,
|
|
2640
|
-
reportId
|
|
2641
|
-
});
|
|
2642
|
-
if (parsed.findings.length === 0) {
|
|
2643
|
-
return {
|
|
2644
|
-
created: 0,
|
|
2645
|
-
relinked: 0,
|
|
2646
|
-
reopened: 0,
|
|
2647
|
-
totalFindings: 0,
|
|
2648
|
-
unparseableCount: parsed.unparseableCount
|
|
2649
|
-
};
|
|
2650
|
-
}
|
|
2651
|
-
const result = await store.upsert(parsed.findings, {
|
|
2652
|
-
sessionId,
|
|
2653
|
-
reportId,
|
|
2654
|
-
agentId,
|
|
2655
|
-
model
|
|
2656
|
-
});
|
|
2657
|
-
return {
|
|
2658
|
-
created: result.created,
|
|
2659
|
-
relinked: result.relinked,
|
|
2660
|
-
reopened: result.reopened,
|
|
2661
|
-
reportId,
|
|
2662
|
-
totalFindings: parsed.findings.length,
|
|
2663
|
-
unparseableCount: parsed.unparseableCount
|
|
2664
|
-
};
|
|
2665
|
-
}
|
|
2666
|
-
|
|
2667
|
-
// src/plugins/review-report-integration.ts
|
|
2668
|
-
async function updateReviewReportEvidence(reportId, projectDir, evidenceStatus, evidenceChecks) {
|
|
2669
|
-
await new JsonlReportStore(projectDir).updateEvidence(
|
|
2670
|
-
reportId,
|
|
2671
|
-
evidenceStatus,
|
|
2672
|
-
evidenceChecks
|
|
2673
|
-
);
|
|
2674
|
-
}
|
|
2675
|
-
async function persistReviewReport(payload, reportId, projectDir) {
|
|
2676
|
-
const store = new JsonlReportStore(projectDir);
|
|
2677
|
-
const existed = await store.get(reportId);
|
|
2678
|
-
const source = classifyChimeraReviewSource(payload.bundle);
|
|
2679
|
-
const agentId = payload.bundle.fileProvenance?.find((entry) => entry.agentId)?.agentId ?? "chimera-review";
|
|
2680
|
-
const sessionId = payload.sessionId ?? payload.cwd;
|
|
2681
|
-
const model = payload.bundle.config.model;
|
|
2682
|
-
const cascadeDepth = payload.bundle.cascadeDepth;
|
|
2683
|
-
const files = payload.bundle.files.map((f) => ({
|
|
2684
|
-
path: f.path,
|
|
2685
|
-
status: f.status
|
|
2686
|
-
}));
|
|
2687
|
-
const reviewStatus = payload.status === "success" ? "success" : "failed";
|
|
2688
|
-
const parsed = reviewStatus === "success" ? payload.parsedReport ?? parseChimeraReviewReport(payload.reviewText, {
|
|
2689
|
-
sessionId,
|
|
2690
|
-
agentId,
|
|
2691
|
-
reviewerModel: model,
|
|
2692
|
-
reviewType: source,
|
|
2693
|
-
reportId
|
|
2694
|
-
}) : { findings: [], unparseableCount: 0, durationSeconds: void 0 };
|
|
2695
|
-
const counts = { critical: 0, high: 0, medium: 0, low: 0 };
|
|
2696
|
-
for (const finding of parsed.findings) {
|
|
2697
|
-
counts[finding.severity]++;
|
|
2698
|
-
}
|
|
2699
|
-
const input = {
|
|
2700
|
-
id: reportId,
|
|
2701
|
-
sessionId,
|
|
2702
|
-
agentId,
|
|
2703
|
-
reviewerModel: model,
|
|
2704
|
-
source,
|
|
2705
|
-
reviewStatus,
|
|
2706
|
-
files,
|
|
2707
|
-
counts,
|
|
2708
|
-
totalFindings: parsed.findings.length,
|
|
2709
|
-
unparseableCount: parsed.unparseableCount,
|
|
2710
|
-
durationSeconds: parsed.durationSeconds,
|
|
2711
|
-
rawText: payload.reviewText,
|
|
2712
|
-
...cascadeDepth !== void 0 ? { cascadeDepth } : {},
|
|
2713
|
-
// P0-3: carry the cascade evidence verification (status + per-check
|
|
2714
|
-
// comparisons) so the persisted report is auditable. Absent on initial
|
|
2715
|
-
// reviews — no cascade step produced evidence yet.
|
|
2716
|
-
...payload.bundle.evidenceStatus !== void 0 ? { evidenceStatus: payload.bundle.evidenceStatus } : {},
|
|
2717
|
-
...payload.bundle.evidenceChecks !== void 0 ? { evidenceChecks: payload.bundle.evidenceChecks } : {}
|
|
2718
|
-
};
|
|
2719
|
-
await store.persist(input);
|
|
2720
|
-
if (reviewStatus === "success" && parsed.findings.length === 0 && parsed.unparseableCount === 0 && isExplicitAllClearReview(payload.reviewText)) {
|
|
2721
|
-
await store.transition(
|
|
2722
|
-
reportId,
|
|
2723
|
-
"completed",
|
|
2724
|
-
{ id: "chimera", kind: "system" },
|
|
2725
|
-
{
|
|
2726
|
-
reason: "Successful Chimera review produced no actionable findings"
|
|
2727
|
-
}
|
|
2728
|
-
);
|
|
2729
|
-
}
|
|
2730
|
-
return {
|
|
2731
|
-
reportId,
|
|
2732
|
-
created: !existed,
|
|
2733
|
-
totalFindings: parsed.findings.length
|
|
2734
|
-
};
|
|
2735
|
-
}
|
|
2736
|
-
function isExplicitAllClearReview(text) {
|
|
2737
|
-
const normalized = text.trim().toLowerCase();
|
|
2738
|
-
return normalized.startsWith("## \u{1F982} chimera review \u2014 all clear") || normalized.includes("chimera review: all clear");
|
|
2739
|
-
}
|
|
2740
|
-
async function syncReportCompletion(reportId, projectDir, actor) {
|
|
2741
|
-
const reportStore = new JsonlReportStore(projectDir);
|
|
2742
|
-
const findingStore = new JsonlFindingStore(projectDir);
|
|
2743
|
-
const report = await reportStore.get(reportId);
|
|
2744
|
-
if (!report) {
|
|
2745
|
-
return { reportId, completed: false, totalFindings: 0, remaining: 0 };
|
|
2746
|
-
}
|
|
2747
|
-
if (report.lifecycle === "completed" || report.lifecycle === "skipped") {
|
|
2748
|
-
return { reportId, completed: false, totalFindings: 0, remaining: 0 };
|
|
2749
|
-
}
|
|
2750
|
-
const findings = await findingStore.list({ reportId, limit: 9999 });
|
|
2751
|
-
const total = findings.length;
|
|
2752
|
-
if (total === 0) {
|
|
2753
|
-
return { reportId, completed: false, totalFindings: 0, remaining: 0 };
|
|
2754
|
-
}
|
|
2755
|
-
const remaining = findings.filter(
|
|
2756
|
-
(f) => f.status !== "resolved" && f.status !== "ignored"
|
|
2757
|
-
).length;
|
|
2758
|
-
if (remaining > 0) {
|
|
2759
|
-
return { reportId, completed: false, totalFindings: total, remaining };
|
|
2760
|
-
}
|
|
2761
|
-
await reportStore.transition(reportId, "completed", actor, {
|
|
2762
|
-
reason: `All ${total} finding(s) resolved or ignored`
|
|
2763
|
-
});
|
|
2764
|
-
return { reportId, completed: true, totalFindings: total, remaining: 0 };
|
|
2765
|
-
}
|
|
2766
|
-
async function syncReportReopen(reportId, projectDir, actor, reason) {
|
|
2767
|
-
const reportStore = new JsonlReportStore(projectDir);
|
|
2768
|
-
const report = await reportStore.get(reportId);
|
|
2769
|
-
if (!report) {
|
|
2770
|
-
return { reportId, reopened: false, previousLifecycle: "not_found" };
|
|
2771
|
-
}
|
|
2772
|
-
if (report.lifecycle !== "completed" && report.lifecycle !== "skipped") {
|
|
2773
|
-
return { reportId, reopened: false, previousLifecycle: report.lifecycle };
|
|
2774
|
-
}
|
|
2775
|
-
await reportStore.transition(reportId, "open", actor, {
|
|
2776
|
-
reason: reason ?? `Finding reopened \u2014 report was ${report.lifecycle}`
|
|
2777
|
-
});
|
|
2778
|
-
return { reportId, reopened: true, previousLifecycle: report.lifecycle };
|
|
2779
|
-
}
|
|
2780
|
-
|
|
2781
2375
|
// src/plugins/review-finding-commands.ts
|
|
2782
2376
|
async function executeFindingCommand(args, ctx) {
|
|
2783
2377
|
if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
|
|
@@ -2846,8 +2440,8 @@ function helpText() {
|
|
|
2846
2440
|
].join("\n");
|
|
2847
2441
|
}
|
|
2848
2442
|
async function loadStore(ctx) {
|
|
2849
|
-
const { JsonlFindingStore
|
|
2850
|
-
const store = new
|
|
2443
|
+
const { JsonlFindingStore } = await import("./plugins/review-finding-store.js");
|
|
2444
|
+
const store = new JsonlFindingStore(ctx.projectDir);
|
|
2851
2445
|
return store;
|
|
2852
2446
|
}
|
|
2853
2447
|
async function listFindings(args, ctx) {
|
|
@@ -3034,8 +2628,8 @@ async function transitionFinding(id, action, extraArgs, ctx) {
|
|
|
3034
2628
|
return lines.join("\n");
|
|
3035
2629
|
}
|
|
3036
2630
|
async function loadReportStore(ctx) {
|
|
3037
|
-
const { JsonlReportStore
|
|
3038
|
-
return new
|
|
2631
|
+
const { JsonlReportStore } = await import("./plugins/review-report-store.js");
|
|
2632
|
+
return new JsonlReportStore(ctx.projectDir);
|
|
3039
2633
|
}
|
|
3040
2634
|
var LIFECYCLE_EMOJI = {
|
|
3041
2635
|
open: "\u{1F535}",
|
|
@@ -4155,8 +3749,9 @@ function parseTitleContent(args) {
|
|
|
4155
3749
|
const doubleMatch = /^"([^"]+)"\s+"([^"]+)"$/.exec(trimmed) || /^'([^']+)'\s+'([^']+)'$/.exec(trimmed);
|
|
4156
3750
|
if (doubleMatch)
|
|
4157
3751
|
return { title: expectDefined(doubleMatch[1]), content: expectDefined(doubleMatch[2]) };
|
|
4158
|
-
const
|
|
4159
|
-
if (
|
|
3752
|
+
const quotedTitleMatch = /^"([^"]+)"\s+(.+)$/.exec(trimmed) || /^'([^']+)'\s+(.+)$/.exec(trimmed);
|
|
3753
|
+
if (quotedTitleMatch)
|
|
3754
|
+
return { title: expectDefined(quotedTitleMatch[1]), content: expectDefined(quotedTitleMatch[2]) };
|
|
4160
3755
|
const firstSpace = trimmed.indexOf(" ");
|
|
4161
3756
|
if (firstSpace === -1) return { title: trimmed, content: "" };
|
|
4162
3757
|
return { title: trimmed.slice(0, firstSpace), content: trimmed.slice(firstSpace + 1) };
|
|
@@ -5000,13 +4595,6 @@ export {
|
|
|
5000
4595
|
recordCompletedReview,
|
|
5001
4596
|
emitReviewIfChanged,
|
|
5002
4597
|
createAutoReviewPlugin,
|
|
5003
|
-
parseChimeraReviewReport,
|
|
5004
|
-
classifyChimeraReviewSource,
|
|
5005
|
-
integrateFindings,
|
|
5006
|
-
updateReviewReportEvidence,
|
|
5007
|
-
persistReviewReport,
|
|
5008
|
-
syncReportCompletion,
|
|
5009
|
-
syncReportReopen,
|
|
5010
4598
|
executeFindingCommand,
|
|
5011
4599
|
transitionReport,
|
|
5012
4600
|
resolveChimeraConfig,
|
|
@@ -5017,4 +4605,4 @@ export {
|
|
|
5017
4605
|
createSkillsPlugin,
|
|
5018
4606
|
createSyncPlugin
|
|
5019
4607
|
};
|
|
5020
|
-
//# sourceMappingURL=chunk-
|
|
4608
|
+
//# sourceMappingURL=chunk-3AGWVSS7.js.map
|