iterate-plugin 3.5.7 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -22
- package/README.zh-CN.md +79 -19
- package/dist/approval-gate.js +143 -23
- package/dist/atomic-fs.js +148 -17
- package/dist/config-loader.js +516 -35
- package/dist/config-write.js +83 -22
- package/dist/evidence.js +141 -87
- package/dist/file-lock.js +193 -0
- package/dist/index.js +61 -28
- package/dist/jobs.js +56 -11
- package/dist/live.js +54 -14
- package/dist/meta-review.js +132 -28
- package/dist/method-scope.js +31 -8
- package/dist/review-scope.js +32 -9
- package/dist/review.js +96 -17
- package/dist/session-hooks.js +61 -14
- package/dist/skill-prompt.js +396 -66
- package/dist/tools/checkpoint.js +85 -19
- package/dist/tools/config.js +44 -2
- package/dist/tools/context.js +22 -5
- package/dist/tools/decision-log.js +106 -28
- package/dist/tools/defense-events.js +90 -31
- package/dist/tools/defense-store.js +28 -3
- package/dist/tools/experience-bank.js +108 -43
- package/dist/tools/experience-store.js +54 -4
- package/dist/tools/fix.js +347 -119
- package/dist/tools/history.js +68 -14
- package/dist/tools/present.js +80 -0
- package/dist/tools/prune.js +150 -53
- package/dist/tools/quality-gate.js +52 -2
- package/dist/tools/quality-store.js +17 -1
- package/dist/tools/review.js +158 -7
- package/dist/tools/transcript.js +173 -36
- package/dist/tools/triage.js +67 -12
- package/dist/tools/validate.js +115 -24
- package/dist/transcript.js +267 -4
- package/dist/working-directory.js +114 -0
- package/lib/client.js +1912 -512
- package/lib/parse.js +1001 -103
- package/package.json +16 -9
- package/src/approval-gate.ts +160 -23
- package/src/atomic-fs.ts +152 -17
- package/src/client/i18n.ts +517 -0
- package/src/client/index.ts +1031 -369
- package/src/client/session-cache.ts +54 -0
- package/src/config-loader.ts +549 -36
- package/src/config-write.ts +108 -26
- package/src/evidence.ts +194 -92
- package/src/file-lock.ts +211 -0
- package/src/index.ts +60 -29
- package/src/jobs.ts +63 -12
- package/src/live.ts +50 -12
- package/src/meta-review.ts +151 -34
- package/src/method-scope.ts +31 -8
- package/src/review-scope.ts +33 -10
- package/src/review.ts +96 -17
- package/src/session-hooks.ts +60 -13
- package/src/skill-prompt.ts +396 -66
- package/src/tools/checkpoint.ts +81 -19
- package/src/tools/config.ts +44 -2
- package/src/tools/context.ts +25 -5
- package/src/tools/decision-log.ts +114 -23
- package/src/tools/defense-events.ts +87 -31
- package/src/tools/defense-store.ts +30 -3
- package/src/tools/experience-bank.ts +112 -44
- package/src/tools/experience-store.ts +54 -5
- package/src/tools/fix.ts +258 -20
- package/src/tools/history.ts +74 -15
- package/src/tools/present.ts +89 -0
- package/src/tools/prune.ts +154 -51
- package/src/tools/quality-gate.ts +57 -2
- package/src/tools/quality-store.ts +18 -1
- package/src/tools/review.ts +155 -6
- package/src/tools/transcript.ts +178 -36
- package/src/tools/triage.ts +70 -13
- package/src/tools/validate.ts +138 -32
- package/src/transcript.ts +279 -4
- package/src/types.ts +29 -1
- package/src/working-directory.ts +126 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* src/client/session-cache.ts — the newest session the session-scoped slots saw.
|
|
3
|
+
*
|
|
4
|
+
* Slot scopes in dsh are not uniform: `conversation.input.dock` (dashboard,
|
|
5
|
+
* observatory) renders inside a session and receives `props.session`, while
|
|
6
|
+
* `settings.section` renders at ROOT scope on the settings page and gets no
|
|
7
|
+
* session at all. The settings card nevertheless needs session-derived state —
|
|
8
|
+
* specifically the config the model echoed back through `iterate_config`, which
|
|
9
|
+
* is what closes the config write → read-back loop.
|
|
10
|
+
*
|
|
11
|
+
* Rather than fake a session for the root slot, the session-scoped slots
|
|
12
|
+
* publish what the host handed them and root-scoped panels subscribe:
|
|
13
|
+
*
|
|
14
|
+
* session slot renders → noteSession(props.session)
|
|
15
|
+
* settings panel → useSessionSnapshot() (via subscribeSession)
|
|
16
|
+
*
|
|
17
|
+
* Design constraints (mirrors `i18n.ts`):
|
|
18
|
+
* - **Pure**: no React, no DOM — the store is unit-testable on its own, and
|
|
19
|
+
* the React binding lives next to `useLang()` in index.ts.
|
|
20
|
+
* - **Identity-compared**: the same session object never notifies twice, so
|
|
21
|
+
* a slot that re-renders every frame cannot spin its subscribers.
|
|
22
|
+
* - **Never fabricated**: it only ever holds what the host really passed; an
|
|
23
|
+
* empty cache reads as "nothing echoed yet", which is the honest state.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/** Anything host-shaped; the plugins only ever pass it through opaque. */
|
|
27
|
+
export type CachedSession = unknown
|
|
28
|
+
|
|
29
|
+
let current: CachedSession = null
|
|
30
|
+
|
|
31
|
+
const listeners = new Set<() => void>()
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Publish the session a session-scoped slot was rendered with.
|
|
35
|
+
* Notifies subscribers only when the identity actually changes.
|
|
36
|
+
*/
|
|
37
|
+
export function noteSession(session: CachedSession): void {
|
|
38
|
+
if (Object.is(session, current)) return
|
|
39
|
+
current = session
|
|
40
|
+
for (const listener of [...listeners]) listener()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Last published session (or `null` before any session slot has rendered). */
|
|
44
|
+
export function readSession(): CachedSession {
|
|
45
|
+
return current
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Subscribe to session changes; returns the unsubscribe function. */
|
|
49
|
+
export function subscribeSession(listener: () => void): () => void {
|
|
50
|
+
listeners.add(listener)
|
|
51
|
+
return () => {
|
|
52
|
+
listeners.delete(listener)
|
|
53
|
+
}
|
|
54
|
+
}
|