dsh-charter 0.2.1 → 0.3.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +62 -1
  2. package/CHANGELOG.zh.md +53 -1
  3. package/README.md +64 -33
  4. package/README.zh.md +49 -27
  5. package/docs/README.md +7 -3
  6. package/docs/README.zh.md +7 -3
  7. package/docs/assets/charter-graph-0.3.0.zh.png +0 -0
  8. package/docs/assets/charter-pane-0.3.0.png +0 -0
  9. package/docs/assets/charter-pane-0.3.0.zh.png +0 -0
  10. package/docs/assets/charter-pane.zh.png +0 -0
  11. package/docs/design/charter-dependency-graph-v1.zh.md +1101 -0
  12. package/docs/design/charter-design-v1.md +2 -2
  13. package/docs/design/charter-design-v1.zh.md +2 -2
  14. package/docs/design/charter-gui-v1.zh.md +868 -0
  15. package/docs/design/charter-workspace-v2.zh.md +29 -1
  16. package/docs/design/compatibility.md +22 -6
  17. package/docs/design/compatibility.zh.md +21 -6
  18. package/docs/design/mockups/README.md +29 -0
  19. package/docs/design/mockups/mockup-graph.html +152 -0
  20. package/docs/design/mockups/mockup-home-clean.html +146 -0
  21. package/docs/design/mockups/mockup-home-dirty.html +191 -0
  22. package/docs/design/mockups/mockup.css +425 -0
  23. package/docs/design/mockups/style-tile.html +146 -0
  24. package/docs/design/mockups/tokens.css +670 -0
  25. package/docs/design/version-roadmap.md +28 -11
  26. package/docs/design/version-roadmap.zh.md +38 -8
  27. package/docs/release-notes/0.2.1.md +8 -6
  28. package/docs/release-notes/0.2.2.md +60 -0
  29. package/docs/release-notes/0.3.0.md +66 -0
  30. package/docs/release-notes/README.md +1 -2
  31. package/docs/releasing.md +7 -8
  32. package/docs/releasing.zh.md +7 -8
  33. package/docs/user-guide.md +36 -16
  34. package/docs/user-guide.zh.md +33 -14
  35. package/docs/verification.md +105 -32
  36. package/docs/verification.zh.md +90 -28
  37. package/lib/client/ChangeSetPanel.d.ts +24 -0
  38. package/lib/client/DependencyGraph.d.ts +19 -0
  39. package/lib/client/DiagnosticsPage.d.ts +5 -0
  40. package/lib/client/ReviewCenterPage.d.ts +5 -0
  41. package/lib/client/SectionNav.d.ts +14 -0
  42. package/lib/client/WorkspacePage.d.ts +5 -0
  43. package/lib/client/change-set-model.d.ts +55 -0
  44. package/lib/client/draft-store.d.ts +1 -1
  45. package/lib/client/locales.d.ts +94 -7
  46. package/lib/client/page-order.d.ts +26 -0
  47. package/lib/client/pane-format.d.ts +48 -0
  48. package/lib/client/pane-scope.d.ts +382 -0
  49. package/lib/client/pane-ui.d.ts +39 -0
  50. package/lib/client/relation-graph.d.ts +135 -0
  51. package/lib/client/section-routing.d.ts +12 -0
  52. package/lib/client/use-change-set-sheet.d.ts +13 -0
  53. package/lib/client.js +4589 -2413
  54. package/lib/core/change-set.d.ts +7 -0
  55. package/lib/core/dependencies.d.ts +29 -0
  56. package/lib/core.js +1 -1
  57. package/lib/{fork-D5HVDV1i.js → fork-KSL6sovw.js} +70 -1
  58. package/lib/host/types.d.ts +8 -1
  59. package/lib/index.js +2 -2
  60. package/lib/remote/wire.d.ts +37 -3
  61. package/lib/remote.js +23 -3
  62. package/lib/{service-CNjnvioR.js → service-DO3Q9uB2.js} +10 -5
  63. package/lib/version.d.ts +1 -1
  64. package/package.json +23 -18
@@ -2,13 +2,14 @@ import type { LocaleDictOf } from '@deepseek-ai/dsh-client-ui-slots';
2
2
  export declare const CHARTER_LOCALE_NS = "dsh-charter";
3
3
  declare const en: {
4
4
  readonly tab: "Charter";
5
- readonly 'header.title': "Charter";
5
+ readonly 'header.title': "Session charter";
6
6
  readonly 'header.subtitle': "Compaction rewrites history. Your commitments don't.";
7
7
  readonly 'stats.revision': "rev {revision}";
8
8
  readonly 'overview.afterApply': "After Apply";
9
9
  readonly 'stats.afterApply': "{active} active / {stored} stored after Apply";
10
10
  readonly 'stats.context': "{bytes} B context";
11
11
  readonly 'stats.budget': "{used} / {limit} charter context";
12
+ readonly 'stats.budgetDelta': "{before} → {after} / {limit}";
12
13
  readonly 'status.loading': "Loading charter...";
13
14
  readonly 'status.unavailable': "Charter is unavailable.";
14
15
  readonly 'status.notReady': "Charter is not ready.";
@@ -44,7 +45,7 @@ declare const en: {
44
45
  readonly 'nav.recovery': "Storage & recovery";
45
46
  readonly 'nav.open': "Open";
46
47
  readonly 'nav.workspaceHelp': "See the current objective, global invariants, execution plan, and unresolved blockers.";
47
- readonly 'nav.reviewHelp': "Review pending proposals, history drafts, inactive items, and recent changes.";
48
+ readonly 'nav.reviewHelp': "Review message proposals, compaction-history drafts, pending proposals, and recent changes.";
48
49
  readonly 'nav.diagnosticsHelp': "Inspect prompt, budgets, record health, recovery, and capability diagnostics.";
49
50
  readonly 'nav.overviewHelp': "See active commitments, counts, budget, and any pending review at a glance.";
50
51
  readonly 'nav.objectiveHelp': "Read or redirect the current objective while the original objective stays immutable.";
@@ -55,11 +56,36 @@ declare const en: {
55
56
  readonly 'nav.recoveryHelp': "Export, restore, or explicitly initialize this Session's stored Charter record.";
56
57
  readonly 'changeset.kicker': "Change Set";
57
58
  readonly 'changeset.title': "Pending changes";
59
+ readonly 'changeset.open': "Review pending changes";
60
+ readonly 'changeset.close': "Close change set";
58
61
  readonly 'changeset.ops': "{count} staged operations";
62
+ readonly 'changeset.promptShort': "Prompt bytes";
63
+ readonly 'changeset.itemsShort': "Items";
59
64
  readonly 'changeset.prompt': "Model prompt after Apply: {used} / {limit}";
60
65
  readonly 'changeset.promptDelta': "Prompt bytes: {before} → {after}";
61
66
  readonly 'changeset.itemsDelta': "Items: {before} → {after}";
62
67
  readonly 'changeset.editorOpen': "An inline editor is open";
68
+ readonly 'changeset.conflicts': "This Change Set introduces or worsens {count} dependency conflict(s)";
69
+ readonly 'changeset.unstage': "Unstage";
70
+ readonly 'changeset.op.unknown': "Change";
71
+ readonly 'changeset.state.accepted': "accepted";
72
+ readonly 'changeset.state.rejected': "rejected";
73
+ readonly 'changeset.state.archived': "archived";
74
+ readonly 'changeset.state.restored': "restored";
75
+ readonly 'changeset.state.purged': "purged";
76
+ readonly 'changeset.state.verified': "verified";
77
+ readonly 'changeset.state.unchecked': "unverified";
78
+ readonly 'changeset.state.attested': "attested";
79
+ readonly 'changeset.prerequisites': "{count} prerequisite(s)";
80
+ readonly 'changeset.op.objective': "Objective";
81
+ readonly 'changeset.op.item': "Item";
82
+ readonly 'changeset.op.lifecycle': "Lifecycle";
83
+ readonly 'changeset.op.proposal': "Proposal";
84
+ readonly 'changeset.op.verification': "Verification";
85
+ readonly 'changeset.conflictAdded': "new conflict ({before} → {after} blocking prerequisites)";
86
+ readonly 'changeset.conflictWorsened': "worsened ({before} → {after} blocking prerequisites)";
87
+ readonly 'changeset.conflictHint': "{count} dependency conflict(s) — Apply needs your confirmation";
88
+ readonly 'changeset.conflictConfirmHint': "Confirm to apply with {count} known dependency conflict(s)";
63
89
  readonly 'review.itemProposals': "Item proposals";
64
90
  readonly 'review.messageProposal': "Message proposal";
65
91
  readonly 'review.messageProposalHint': "Turn one recent user message into a pending proposal. Nothing changes until you review and apply it.";
@@ -88,7 +114,8 @@ declare const en: {
88
114
  readonly 'review.objectiveReason': "Reason for replacing the current objective";
89
115
  readonly 'review.acceptObjective': "Accept objective";
90
116
  readonly 'review.rejectObjective': "Reject objective";
91
- readonly 'review.kicker': "Review Center";
117
+ readonly 'review.heading': "Review Center";
118
+ readonly 'review.headingHint': "Review message proposals, compaction-history drafts, pending proposals, and recent changes. Nothing changes until you apply it.";
92
119
  readonly 'review.title': "Proposal batches";
93
120
  readonly 'review.captured': "Captured at revision {revision}";
94
121
  readonly 'review.sourceIntegrity': "Source: {integrity}";
@@ -99,10 +126,8 @@ declare const en: {
99
126
  readonly 'review.source.agent-tool': "Agent tool proposal";
100
127
  readonly 'review.source.fork': "Fork proposal";
101
128
  readonly 'review.source.legacy-unknown': "Legacy unknown source";
102
- readonly 'deps.kicker': "Execution plan";
103
129
  readonly 'deps.title': "Dependencies and readiness";
104
- readonly 'deps.requires': "Requires {keys}";
105
- readonly 'deps.editAria': "Prerequisites for {key}";
130
+ readonly 'deps.executionPath': "Execution path";
106
131
  readonly 'deps.status.ready': "ready";
107
132
  readonly 'deps.status.waiting': "waiting";
108
133
  readonly 'deps.status.dependency-conflict': "dependency conflict";
@@ -111,12 +136,72 @@ declare const en: {
111
136
  readonly 'deps.status.terminal': "terminal";
112
137
  readonly 'deps.prerequisiteConflict': "prerequisite conflict";
113
138
  readonly 'deps.conflict': "The staged dependency plan contains a cycle or invalid reference. Remove or change a prerequisite before Apply.";
139
+ readonly 'deps.graphTitle': "Dependency map";
140
+ readonly 'deps.expandGraph': "Expand dependency map";
141
+ readonly 'deps.collapseGraph': "Collapse dependency map";
142
+ readonly 'deps.graphFocus': "Focus";
143
+ readonly 'deps.graphDepth': "Depth";
144
+ readonly 'deps.depth1': "1 hop";
145
+ readonly 'deps.depth2': "2 hops";
146
+ readonly 'deps.showSupersedes': "Show replacements";
147
+ readonly 'deps.historyToggle': "History";
148
+ readonly 'deps.zoomIn': "Zoom in";
149
+ readonly 'deps.zoomOut': "Zoom out";
150
+ readonly 'deps.resetLayout': "Reset zoom";
151
+ readonly 'deps.hideGraph': "Hide graph";
152
+ readonly 'deps.showGraph': "Show graph";
153
+ readonly 'deps.graphAria': "Dependency graph";
154
+ readonly 'deps.graphKeys': "Tab enters the graph once. Arrow keys move along dependencies; [ and ] visit every node and edge; Enter opens details; Esc closes details, then returns to the list.";
155
+ readonly 'deps.historyKicker': "Replaced";
156
+ readonly 'deps.historyStatus': "Not in the execution order";
157
+ readonly 'deps.candidateKicker': "Candidate";
158
+ readonly 'deps.candidateStatus': "Not in the execution order";
159
+ readonly 'deps.historyAria': "Replaced item {text}; not in the execution order";
160
+ readonly 'deps.candidateAria': "Candidate {text}; not in the execution order";
161
+ readonly 'deps.edgeAria': "{to} depends on {from}";
162
+ readonly 'deps.edgeAriaAdded': "{to} depends on {from} (added in this draft)";
163
+ readonly 'deps.edgeAriaRemoved': "{to} depends on {from} (removed in this draft)";
164
+ readonly 'deps.proposedEdgeAria': "Candidate prerequisite {from} for {to}; Enter opens the proposal";
165
+ readonly 'deps.supersedesEdgeAria': "{from} is replaced by {to}";
166
+ readonly 'deps.graphDegradedSupersedes': "The replacement history is hidden because this view is too dense.";
167
+ readonly 'deps.graphDegradedDepth': "Depth was reduced to one hop because this view is too dense.";
168
+ readonly 'deps.graphTooDense': "This dependency view has {count} navigable items; use the list instead.";
169
+ readonly 'deps.inspectorTitle': "Dependency details · {key}";
170
+ readonly 'deps.closeInspector': "Close details";
171
+ readonly 'deps.inspectorStatus': "Status";
172
+ readonly 'deps.inspectorRequires': "Requires";
173
+ readonly 'deps.addRequires': "Add a prerequisite";
174
+ readonly 'deps.removeRequires': "Remove {key}";
175
+ readonly 'deps.removeEdge': "Remove this dependency";
176
+ readonly 'deps.openProposal': "Open proposal";
177
+ readonly 'deps.skipToList': "Skip to the dependency list";
178
+ readonly 'deps.showMore': "Show {count} more dependency rows";
179
+ readonly 'deps.rowPosition': "Dependency {index} of {total}";
180
+ readonly 'deps.locateInList': "Locate in the list";
181
+ readonly 'deps.locateInGraph': "Locate in graph";
182
+ readonly 'deps.graphHint': "The graph never changes state by itself; edits are staged into the Change Set and Apply remains the only commit.";
183
+ readonly 'deps.help': "Keys and notes";
184
+ readonly 'deps.legendCommitted': "Solid = active dependency";
185
+ readonly 'deps.legendStaged': "Dashed = staged new dependency";
186
+ readonly 'deps.legendProposed': "Dotted = proposed dependency";
187
+ readonly 'deps.graphNote': "The graph is an enhancement; the semantic list stays authoritative. Nodes use fixed px geometry and two-line truncation.";
188
+ readonly 'deps.graphEmpty': "No dependencies yet. Drag one node onto another, or open a list row to add a prerequisite.";
189
+ readonly 'deps.graphIsolatedTooMany': "No dependencies yet. The isolated-node preview is hidden for this many rows; use the list.";
190
+ readonly 'deps.requiresSummary': "Prerequisites: {keys}";
191
+ readonly 'deps.noRequires': "No prerequisites";
192
+ readonly 'deps.editRequires': "Edit prerequisites";
193
+ readonly 'deps.stagedChanged': "Staged edit";
194
+ readonly 'deps.stagedAdded': "staged addition";
195
+ readonly 'deps.dropInvalidSelf': "A deliverable cannot depend on itself.";
196
+ readonly 'deps.dropInvalidDuplicate': "This prerequisite is already present.";
197
+ readonly 'deps.stagedRemoved': "staged removal";
198
+ readonly 'deps.candidateCycle': "candidate dependencies form a cycle; acceptance will be rejected";
114
199
  readonly 'overview.budget': "Budget";
115
200
  readonly 'overview.budgetDetail': "Prompt, objective, and item limits";
116
201
  readonly 'overview.nothing': "Nothing configured yet.";
117
202
  readonly 'overview.objectiveHint': "The original objective is immutable; a redirect keeps it for review.";
118
203
  readonly 'bootstrap.kicker': "History draft";
119
- readonly 'bootstrap.title': "Charter draft from compaction history";
204
+ readonly 'bootstrap.title': "Compaction history draft";
120
205
  readonly 'bootstrap.body': string;
121
206
  readonly 'bootstrap.source': "Source: compaction summary ({tokens} tokens shadowed)";
122
207
  readonly 'bootstrap.sourcePlain': "Source: compaction summary";
@@ -140,6 +225,7 @@ declare const en: {
140
225
  readonly 'bootstrap.unavailable': "Charter storage is unavailable, so the history draft cannot be read.";
141
226
  readonly 'notice.conflict': string;
142
227
  readonly 'objective.kicker': "Objective";
228
+ readonly 'objective.originalLabel': "Initial objective";
143
229
  readonly 'objective.empty': "No objective has been set.";
144
230
  readonly 'objective.set': "Set objective";
145
231
  readonly 'objective.redirect': "Redirect";
@@ -251,6 +337,7 @@ declare const en: {
251
337
  readonly 'footer.abandon': "Abandon unknown request";
252
338
  readonly 'footer.abandonConfirm': "Confirm abandon — this discards the retained request and local draft text";
253
339
  readonly 'footer.applying': "Applying...";
340
+ readonly 'footer.applyConfirmConflicts': "Apply with {count} conflict(s)";
254
341
  readonly 'budget.editorOver': "This text exceeds the {limit} limit.";
255
342
  readonly 'budget.shrinking': "Over the limit, but shortening is allowed and will be admitted.";
256
343
  readonly 'budget.notGrowing': "Over the limit, but this edit does not increase the prompt; it will be admitted.";
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Explicit page reading order used by the flex stack. Extracted from the Pane so
3
+ * the Workspace/Review/Diagnostics order contract is unit-tested instead of
4
+ * living as inline numbers.
5
+ */
6
+ export declare const PAGE_ORDER: {
7
+ readonly workspace: {
8
+ readonly objective: 10;
9
+ readonly invariants: 20;
10
+ readonly deliverables: 30;
11
+ readonly execution: 40;
12
+ };
13
+ readonly review: {
14
+ readonly batches: 10;
15
+ readonly itemProposals: 20;
16
+ readonly objectiveProposals: 30;
17
+ readonly messageProposal: 40;
18
+ readonly bootstrap: 50;
19
+ readonly objectiveHistory: 60;
20
+ readonly inactive: 70;
21
+ };
22
+ readonly diagnostics: {
23
+ readonly contextPreview: -1;
24
+ };
25
+ };
26
+ export type PageOrder = typeof PAGE_ORDER;
@@ -0,0 +1,48 @@
1
+ import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { CharterErrorCode } from '../core/errors.js';
3
+ import type { CharterRecordArchive, DeliverableProgress } from '../core/schemas.js';
4
+ import type { CharterView } from '../host/types.js';
5
+ import type { BootstrapProblem, DraftFeedback } from './draft-store.js';
6
+ import type { DependencyConflictDiff } from '../core/dependencies.js';
7
+ import type { ProjectedItem } from './preview.js';
8
+ import { CHARTER_LOCALE_NS, type CharterLocaleKey } from './locales.js';
9
+ export type CharterText = TranslateNS<typeof CHARTER_LOCALE_NS>;
10
+ export interface ArchivePreview {
11
+ readonly fileName: string;
12
+ readonly archive?: CharterRecordArchive;
13
+ readonly errorKey?: string;
14
+ readonly errorParams?: Readonly<Record<string, string>>;
15
+ readonly health?: 'healthy' | 'schema-invalid' | 'consistency-invalid' | 'lifecycle-mismatch';
16
+ readonly revision?: number | null;
17
+ readonly lifecycle?: string | null;
18
+ readonly digest?: string;
19
+ readonly exportedAt?: number;
20
+ readonly sourceSession?: string;
21
+ readonly payloadDigestOk?: boolean;
22
+ readonly recordDigestOk?: boolean;
23
+ }
24
+ export declare function formatBytes(t: CharterText, bytes: number): string;
25
+ /** Pretty-print the JSON body of the rendered prompt for reading; exact bytes remain available. */
26
+ export declare function formatCharterPreview(preview: string): string | null;
27
+ export declare function progressLabel(progress: DeliverableProgress | undefined, t: CharterText): string;
28
+ export declare function errorLabel(code: CharterErrorCode | string, t: CharterText): string;
29
+ export declare function textIssueMessage(issue: 'empty' | 'control' | 'surrogate', t: CharterText): string;
30
+ export declare function countLabel(t: CharterText, count: number, one: CharterLocaleKey, other: CharterLocaleKey): string;
31
+ /** Resolve a stable feedback descriptor against the current locale. */
32
+ export declare function feedbackText(feedback: DraftFeedback | null, t: CharterText): string | null;
33
+ export declare function feedbackDetail(feedback: DraftFeedback | null): string | undefined;
34
+ export declare function bootstrapProblemText(problem: BootstrapProblem | null, t: CharterText): string | null;
35
+ /** One exhaustive switch over the Host-derived record state. */
36
+ export declare function statusMessage(view: CharterView, t: CharterText): string | null;
37
+ export declare function itemState(item: ProjectedItem): 'done' | 'warning' | 'ongoing' | 'idle';
38
+ export declare const EMPTY_CONFLICT_DIFF: DependencyConflictDiff;
39
+ export declare function shortText(text: string, length?: number): string;
40
+ /** Render the lifecycle fingerprint as a compact, stable date label for the UI. */
41
+ export declare function lifecycleLabel(value: string | null | undefined): string;
42
+ /** Render an archive timestamp without ever throwing on hostile values. */
43
+ export declare function formatTimestamp(value: number | undefined): string;
44
+ /** Localized health label for an archive preview. */
45
+ export declare function archiveHealthLabel(health: 'healthy' | 'schema-invalid' | 'consistency-invalid' | 'lifecycle-mismatch', t: CharterText): string;
46
+ /** Byte budget of the value the Host will store (normalized, not raw input). */
47
+ export declare function normalizedBytes(value: string): number;
48
+ export declare function normalizedNonEmpty(value: string): boolean;
@@ -0,0 +1,382 @@
1
+ export interface PaneScope {
2
+ readonly activeDeliverables: import("./preview.js").ProjectedItem[];
3
+ readonly activeInvariants: import("./preview.js").ProjectedItem[];
4
+ readonly area: "review" | "diagnostics" | "workspace";
5
+ readonly bootstrapPhase: import("./draft-store.js").BootstrapPhase;
6
+ readonly bootstrapProblem: import("./draft-store.js").BootstrapProblem | null;
7
+ readonly counts: {
8
+ readonly active: number;
9
+ readonly pending: number;
10
+ readonly history: number;
11
+ };
12
+ readonly currentDeliverables: import("./preview.js").ProjectedItem[];
13
+ readonly currentInvariants: import("./preview.js").ProjectedItem[];
14
+ readonly deliverables: (import("./preview.js").ProjectedItem & {
15
+ kind: "deliverable";
16
+ })[];
17
+ readonly dependencyByItemId: Map<string, import("../core/dependencies.js").DependencyProjection>;
18
+ readonly dependencyEditorId: string | null;
19
+ readonly dependencyGraphActiveKey: string | undefined;
20
+ readonly dependencyGraphDepth: 1 | 2;
21
+ readonly dependencyGraphHidden: boolean;
22
+ readonly dependencyGraphProblem: string | null;
23
+ readonly dependencyGraphSupersedes: boolean;
24
+ readonly dependencyPlan: never[] | readonly import("../core/dependencies.js").DependencyProjection[];
25
+ readonly dependencyVisibleCount: number;
26
+ readonly draft: import("./draft-store.js").CharterDraft;
27
+ readonly editable: boolean;
28
+ readonly editor: import("./draft-store.js").DraftEditor | null;
29
+ readonly editorNeedsReason: boolean;
30
+ readonly editorReason: string;
31
+ readonly editorText: string;
32
+ readonly focusStatus: () => void;
33
+ readonly goSection: (next: import("./draft-store.js").CharterSection) => void;
34
+ readonly historyDeliverables: (import("./preview.js").ProjectedItem & {
35
+ kind: "deliverable";
36
+ })[];
37
+ readonly historyInvariants: import("./preview.js").ProjectedItem[];
38
+ readonly invariants: import("./preview.js").ProjectedItem[];
39
+ readonly locateGraphNodeInList: (id: string) => void;
40
+ readonly newDeliverable: string;
41
+ readonly newInvariant: string;
42
+ readonly objectiveStaged: boolean;
43
+ readonly openEditor: (target: import("./draft-store.js").DraftEditor) => void;
44
+ readonly openHistory: () => void;
45
+ readonly pendingDeliverables: import("./preview.js").ProjectedItem[];
46
+ readonly pendingInvariants: import("./preview.js").ProjectedItem[];
47
+ readonly planInvalid: boolean;
48
+ readonly projectedItems: readonly import("./preview.js").ProjectedItem[];
49
+ readonly projectedObjective: {
50
+ original: {
51
+ text: string;
52
+ setAtRevision: number;
53
+ };
54
+ current: {
55
+ text: string;
56
+ setAtRevision: number;
57
+ reason?: string | undefined;
58
+ };
59
+ } | null;
60
+ readonly relationFocusId: string | undefined;
61
+ readonly relationGraph: import("./relation-graph.js").RelationGraphModel | null;
62
+ readonly relationGraphAvailable: boolean;
63
+ readonly relationLayout: import("./relation-graph.js").GraphLayout | null;
64
+ readonly release: () => void;
65
+ readonly renderItems: (items: readonly import("./preview.js").ProjectedItem[], history: readonly import("./preview.js").ProjectedItem[], emptyKey: "invariants.empty" | "deliverables.empty", windowKey: "invariants" | "deliverables") => import("react").ReactNode;
66
+ readonly saving: boolean;
67
+ readonly section: import("./draft-store.js").CharterSection;
68
+ readonly setDependencyEditorId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
69
+ readonly setDependencyGraphActiveKey: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
70
+ readonly setDependencyGraphDepth: import("react").Dispatch<import("react").SetStateAction<1 | 2>>;
71
+ readonly setDependencyGraphFocusId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
72
+ readonly setDependencyGraphHidden: import("react").Dispatch<import("react").SetStateAction<boolean>>;
73
+ readonly setDependencyGraphSupersedes: import("react").Dispatch<import("react").SetStateAction<boolean>>;
74
+ readonly setDependencyVisibleCount: import("react").Dispatch<import("react").SetStateAction<number>>;
75
+ readonly setPendingProposalFocusId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
76
+ readonly showEmpty: boolean;
77
+ readonly source: import("./store.js").CharterSource;
78
+ readonly stageGraphRequires: (targetId: string, nextRequires: readonly string[]) => void;
79
+ readonly t: import("@deepseek-ai/dsh-client-ui-slots").TranslateNS<"dsh-charter">;
80
+ readonly unknownBlocked: boolean;
81
+ readonly view: import("../host/types.js").CharterView;
82
+ readonly abandonUnknown: () => void;
83
+ readonly applyBootstrapDraft: () => void;
84
+ readonly applyHintId: string;
85
+ readonly batchByItem: Map<string, {
86
+ readonly batchId: string;
87
+ readonly sourceKind: string;
88
+ }>;
89
+ readonly bootstrap: import("../host/types.js").CharterBootstrapProposal | null;
90
+ readonly bootstrapBudgetOver: boolean;
91
+ readonly bootstrapId: string;
92
+ readonly bootstrapItems: readonly import("./bootstrap-plan.js").BootstrapDraftItem[];
93
+ readonly bootstrapObjective: string;
94
+ readonly bootstrapObjectiveOver: boolean;
95
+ readonly bootstrapPlan: import("./bootstrap-plan.js").BootstrapPlan;
96
+ readonly bootstrapPromptBytes: number;
97
+ readonly bootstrapReplay: boolean;
98
+ readonly bootstrapSaving: boolean;
99
+ readonly bootstrapStorageOver: boolean;
100
+ readonly bootstrapTextIssue: import("./bootstrap-plan.js").DraftTextIssue | undefined;
101
+ readonly bootstrapVisibleCount: number;
102
+ readonly canApplyBootstrap: boolean;
103
+ readonly closedObjectiveProposals: {
104
+ id: string;
105
+ text: string;
106
+ origin: "user" | "agent" | "fork";
107
+ review: "pending" | "accepted" | "rejected" | "purged";
108
+ createdRevision: number;
109
+ reviewedAtRevision?: number | undefined;
110
+ appliedRevision?: number | undefined;
111
+ textDigest?: string | undefined;
112
+ }[];
113
+ readonly confirmAbandon: boolean;
114
+ readonly inactiveItems: import("./preview.js").ProjectedItem[];
115
+ readonly messageBytes: number;
116
+ readonly messageCanSave: boolean;
117
+ readonly messageCandidates: readonly import("../host/types.js").CharterMessageCandidate[];
118
+ readonly messageDraft: string;
119
+ readonly messageKind: "invariant" | "deliverable";
120
+ readonly messageMenuOpen: boolean;
121
+ readonly messageMenuRef: import("react").MutableRefObject<HTMLDivElement | null>;
122
+ readonly messageOverBudget: boolean;
123
+ readonly messageSeq: number | undefined;
124
+ readonly messageTextAvailable: boolean;
125
+ readonly ops: readonly ({
126
+ type: "objective.initialize";
127
+ text: string;
128
+ } | {
129
+ type: "objective.redirect";
130
+ text: string;
131
+ reason?: string | undefined;
132
+ } | {
133
+ type: "objective.propose";
134
+ clientRef: string;
135
+ text: string;
136
+ } | {
137
+ type: "objective.accept";
138
+ proposalId: string;
139
+ reason?: string | undefined;
140
+ } | {
141
+ type: "objective.reject";
142
+ proposalId: string;
143
+ } | {
144
+ type: "objective.purge";
145
+ proposalId: string;
146
+ } | {
147
+ type: "item.add";
148
+ item: {
149
+ clientRef: string;
150
+ kind: "invariant";
151
+ text: string;
152
+ order: number;
153
+ origin?: "user" | "agent" | "fork" | undefined;
154
+ contentModified?: boolean | undefined;
155
+ } | {
156
+ clientRef: string;
157
+ kind: "deliverable";
158
+ text: string;
159
+ order: number;
160
+ progress: "not-started" | "in-progress" | "blocked" | "done" | "cancelled";
161
+ requires?: string[] | undefined;
162
+ proposedRequires?: string[] | undefined;
163
+ origin?: "user" | "agent" | "fork" | undefined;
164
+ contentModified?: boolean | undefined;
165
+ };
166
+ } | {
167
+ type: "item.propose";
168
+ item: {
169
+ clientRef: string;
170
+ kind: "invariant";
171
+ text: string;
172
+ order: number;
173
+ origin?: "user" | "agent" | "fork" | undefined;
174
+ contentModified?: boolean | undefined;
175
+ } | {
176
+ clientRef: string;
177
+ kind: "deliverable";
178
+ text: string;
179
+ order: number;
180
+ progress: "not-started" | "in-progress" | "blocked" | "done" | "cancelled";
181
+ requires?: string[] | undefined;
182
+ proposedRequires?: string[] | undefined;
183
+ origin?: "user" | "agent" | "fork" | undefined;
184
+ contentModified?: boolean | undefined;
185
+ };
186
+ } | {
187
+ type: "item.edit";
188
+ itemId: string;
189
+ text?: string | undefined;
190
+ order?: number | undefined;
191
+ } | {
192
+ type: "item.accept";
193
+ itemId: string;
194
+ } | {
195
+ type: "item.reject";
196
+ itemId: string;
197
+ } | {
198
+ type: "item.archive";
199
+ itemId: string;
200
+ } | {
201
+ type: "item.restore";
202
+ itemId: string;
203
+ } | {
204
+ type: "item.supersede";
205
+ itemId: string;
206
+ replacement: {
207
+ clientRef: string;
208
+ kind: "invariant";
209
+ text: string;
210
+ order: number;
211
+ origin?: "user" | "agent" | "fork" | undefined;
212
+ contentModified?: boolean | undefined;
213
+ } | {
214
+ clientRef: string;
215
+ kind: "deliverable";
216
+ text: string;
217
+ order: number;
218
+ progress: "not-started" | "in-progress" | "blocked" | "done" | "cancelled";
219
+ requires?: string[] | undefined;
220
+ proposedRequires?: string[] | undefined;
221
+ origin?: "user" | "agent" | "fork" | undefined;
222
+ contentModified?: boolean | undefined;
223
+ };
224
+ } | {
225
+ type: "item.purge";
226
+ itemId: string;
227
+ confirmed: true;
228
+ } | {
229
+ type: "deliverable.progress";
230
+ itemId: string;
231
+ progress: "not-started" | "in-progress" | "blocked" | "done" | "cancelled";
232
+ } | {
233
+ type: "deliverable.requires";
234
+ itemId: string;
235
+ requires: string[];
236
+ } | {
237
+ type: "item.verification.set";
238
+ itemId: string;
239
+ verification: "unchecked" | "verified";
240
+ } | {
241
+ type: "item.validity.set";
242
+ itemId: string;
243
+ validity: {
244
+ state: "unassessed";
245
+ } | {
246
+ state: "attested";
247
+ atRevision: number;
248
+ } | {
249
+ state: "valid";
250
+ validator: string;
251
+ inputDigest: string;
252
+ checkedAtRevision: number;
253
+ resultDigest?: string | undefined;
254
+ } | {
255
+ state: "invalid";
256
+ validator: string;
257
+ inputDigest: string;
258
+ checkedAtRevision: number;
259
+ reason?: string | undefined;
260
+ } | {
261
+ state: "unknown";
262
+ validator: string;
263
+ inputDigest: string;
264
+ checkedAtRevision: number;
265
+ reason?: string | undefined;
266
+ } | {
267
+ state: "stale";
268
+ previous: "unknown" | "attested" | "valid" | "invalid";
269
+ atRevision: number;
270
+ };
271
+ evidence?: {
272
+ kind: "message" | "compaction-summary" | "workspace-file";
273
+ projectionVersion: number;
274
+ digest: string;
275
+ sessionId?: string | undefined;
276
+ seq?: number | undefined;
277
+ path?: string | undefined;
278
+ excerpt?: string | undefined;
279
+ }[] | undefined;
280
+ } | {
281
+ type: "item.attest";
282
+ itemId: string;
283
+ })[];
284
+ readonly pendingItemProposals: import("./preview.js").ProjectedItem[];
285
+ readonly pendingObjectiveProposals: {
286
+ id: string;
287
+ text: string;
288
+ origin: "user" | "agent" | "fork";
289
+ review: "pending" | "accepted" | "rejected" | "purged";
290
+ createdRevision: number;
291
+ reviewedAtRevision?: number | undefined;
292
+ appliedRevision?: number | undefined;
293
+ textDigest?: string | undefined;
294
+ }[];
295
+ readonly proposalReasons: Record<string, string>;
296
+ readonly reviewLimit: number;
297
+ readonly selectedMessage: import("../host/types.js").CharterMessageCandidate | undefined;
298
+ readonly setMessageDraft: import("react").Dispatch<import("react").SetStateAction<string>>;
299
+ readonly setMessageKind: import("react").Dispatch<import("react").SetStateAction<"invariant" | "deliverable">>;
300
+ readonly setMessageMenuOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
301
+ readonly setMessageSeq: import("react").Dispatch<import("react").SetStateAction<number | undefined>>;
302
+ readonly setProposalReasons: import("react").Dispatch<import("react").SetStateAction<Record<string, string>>>;
303
+ readonly setReviewLimit: import("react").Dispatch<import("react").SetStateAction<number>>;
304
+ readonly unknownReplay: boolean;
305
+ readonly activeArchiveKey: string | null;
306
+ readonly archiveCacheProblem: string | null;
307
+ readonly archiveEntries: readonly import("../host/types.js").CharterArchiveEntry[];
308
+ readonly archiveInputRef: import("react").MutableRefObject<HTMLInputElement | null>;
309
+ readonly archivePreview: import("./pane-format.js").ArchivePreview | null;
310
+ readonly archiveSource: "file" | "cache" | null;
311
+ readonly canExport: boolean;
312
+ readonly capabilities: import("../host/types.js").CharterViewCapabilities | undefined;
313
+ readonly chooseArchive: (file: File) => void;
314
+ readonly chooseCachedArchive: (entry: import("../host/types.js").CharterArchiveEntry) => void;
315
+ readonly confirmRecovery: "initialize" | "restore" | null;
316
+ readonly draftOpen: boolean;
317
+ readonly draftState: import("./draft-store.js").CharterDraftState;
318
+ readonly errorText: (code: string | undefined) => string;
319
+ readonly exportArchive: () => void;
320
+ readonly exportProblem: string | null;
321
+ readonly exportableState: boolean;
322
+ readonly exporting: boolean;
323
+ readonly formattedPreview: string | null;
324
+ readonly initAdmission: {
325
+ readonly ok: true;
326
+ } | {
327
+ readonly ok: false;
328
+ readonly reason: string;
329
+ };
330
+ readonly initializeEmpty: () => void;
331
+ readonly integrityFeedback: string | null;
332
+ readonly maintenanceEnabled: boolean;
333
+ readonly maintenanceProblem: import("./draft-store.js").MaintenanceProblem | null;
334
+ readonly maintenanceReplay: boolean;
335
+ readonly overBudget: boolean;
336
+ readonly preview: string;
337
+ readonly previewBytes: number;
338
+ readonly previewMode: "formatted" | "exact";
339
+ readonly recordDigest: `sha256:${string}` | undefined;
340
+ readonly recordState: import("../host/types.js").CharterRecordState | undefined;
341
+ readonly recoveryBusy: boolean;
342
+ readonly restoreAdmission: {
343
+ readonly ok: true;
344
+ } | {
345
+ readonly ok: false;
346
+ readonly reason: string;
347
+ };
348
+ readonly restoreArchive: () => void;
349
+ readonly restoreArchiveReady: boolean;
350
+ readonly restoreTarget: boolean;
351
+ readonly retainedArchive: {
352
+ format: "dsh-charter-record";
353
+ formatVersion: 1;
354
+ exportedAt: number;
355
+ source: {
356
+ domain: "dsh_charter_v1";
357
+ domainVersion: 1;
358
+ sessionId: string;
359
+ lifecycle: string | null;
360
+ health: "healthy" | "lifecycle-mismatch" | "schema-invalid" | "consistency-invalid";
361
+ revision: number | null;
362
+ recordDigest: string;
363
+ };
364
+ record: unknown;
365
+ payloadDigest: string;
366
+ } | null | undefined;
367
+ readonly setConfirmRecovery: import("react").Dispatch<import("react").SetStateAction<"initialize" | "restore" | null>>;
368
+ readonly setIntegrityFeedback: import("react").Dispatch<import("react").SetStateAction<string | null>>;
369
+ readonly setPreviewMode: import("react").Dispatch<import("react").SetStateAction<"formatted" | "exact">>;
370
+ readonly setValidatorExpectation: import("react").Dispatch<import("react").SetStateAction<string>>;
371
+ readonly setValidatorFeedback: import("react").Dispatch<import("react").SetStateAction<string | null>>;
372
+ readonly setValidatorItemId: import("react").Dispatch<import("react").SetStateAction<string>>;
373
+ readonly setValidatorKind: import("react").Dispatch<import("react").SetStateAction<"workspace.path-exists" | "workspace.file-digest" | "workspace.file-contains">>;
374
+ readonly setValidatorPath: import("react").Dispatch<import("react").SetStateAction<string>>;
375
+ readonly setValidatorRunning: import("react").Dispatch<import("react").SetStateAction<boolean>>;
376
+ readonly validatorExpectation: string;
377
+ readonly validatorFeedback: string | null;
378
+ readonly validatorItemId: string;
379
+ readonly validatorKind: "workspace.path-exists" | "workspace.file-digest" | "workspace.file-contains";
380
+ readonly validatorPath: string;
381
+ readonly validatorRunning: boolean;
382
+ }