dsh-charter 0.2.0 → 0.2.2
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/CHANGELOG.md +61 -1
- package/CHANGELOG.zh.md +51 -1
- package/CONTRIBUTING.md +12 -2
- package/CONTRIBUTING.zh.md +9 -2
- package/README.md +50 -20
- package/README.zh.md +39 -17
- package/docs/README.md +7 -3
- package/docs/README.zh.md +5 -3
- package/docs/assets/charter-pane.zh.png +0 -0
- package/docs/design/charter-dependency-graph-v1.zh.md +1101 -0
- package/docs/design/charter-design-v1.md +7 -3
- package/docs/design/charter-design-v1.zh.md +14 -1
- package/docs/design/charter-workspace-v2.zh.md +20 -3
- package/docs/design/version-roadmap.md +9 -9
- package/docs/design/version-roadmap.zh.md +18 -14
- package/docs/release-notes/0.2.0.md +7 -7
- package/docs/release-notes/0.2.1.md +58 -0
- package/docs/release-notes/0.2.2.md +60 -0
- package/docs/release-notes/README.md +1 -2
- package/docs/releasing.md +12 -7
- package/docs/releasing.zh.md +10 -7
- package/docs/user-guide.md +48 -22
- package/docs/user-guide.zh.md +43 -18
- package/docs/verification.md +40 -28
- package/docs/verification.zh.md +31 -24
- package/lib/client/DependencyGraph.d.ts +19 -0
- package/lib/client/locales.d.ts +97 -19
- package/lib/client/relation-graph.d.ts +135 -0
- package/lib/client/store.d.ts +5 -0
- package/lib/client.js +2552 -496
- package/lib/core/change-set.d.ts +7 -0
- package/lib/core/dependencies.d.ts +29 -0
- package/lib/core.js +1 -1
- package/lib/{fork-D5HVDV1i.js → fork-KSL6sovw.js} +70 -1
- package/lib/host/domain.d.ts +50 -0
- package/lib/host/service.d.ts +18 -1
- package/lib/host/types.d.ts +37 -1
- package/lib/index.js +2 -2
- package/lib/remote/service.d.ts +8 -1
- package/lib/remote/wire.d.ts +161 -3
- package/lib/remote.js +155 -4
- package/lib/{service-C3A59BG5.js → service-MsIACddZ.js} +186 -5
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/core/change-set.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { applyOps, type ApplyOpsInput } from './commands.js';
|
|
2
|
+
import { type DependencyConflictDiff } from './dependencies.js';
|
|
2
3
|
import type { CharterEditRequest, CharterOp } from './schemas.js';
|
|
3
4
|
export interface ChangeSetSide {
|
|
4
5
|
readonly revision: number;
|
|
@@ -15,6 +16,12 @@ export interface PlannedChangeSet {
|
|
|
15
16
|
readonly summaryDigest: `sha256:${string}`;
|
|
16
17
|
readonly promptChanged: boolean;
|
|
17
18
|
readonly metadataOnly: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Design §6.5: readiness conflicts this Change Set introduces or worsens.
|
|
21
|
+
* Deliberately NOT part of `summaryDigest` (which binds revisions, prompt
|
|
22
|
+
* digests and changes) so adding it cannot invalidate an existing preview.
|
|
23
|
+
*/
|
|
24
|
+
readonly dependencyConflicts: DependencyConflictDiff;
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
27
|
* Canonical client-side Change Set projection. The Host remains the authority;
|
|
@@ -21,3 +21,32 @@ export declare function validateDependencyGraph(items: readonly CharterItem[]):
|
|
|
21
21
|
export declare function prerequisiteStatus(item: DeliverableItem, items: readonly CharterItem[]): PrerequisiteStatus;
|
|
22
22
|
export declare function executionDisplay(item: DeliverableItem, items: readonly CharterItem[]): ExecutionDisplay;
|
|
23
23
|
export declare function dependencyProjection(items: readonly CharterItem[]): readonly DependencyProjection[];
|
|
24
|
+
/**
|
|
25
|
+
* Prerequisite ids that make `item` conflict right now: a cancelled prerequisite,
|
|
26
|
+
* or a prerequisite that is not `done` while the dependent already started.
|
|
27
|
+
* Mirrors `prerequisiteStatus` rules 1–2, but returns the causes so a Change Set
|
|
28
|
+
* can tell "new conflict" from "worsened conflict".
|
|
29
|
+
*/
|
|
30
|
+
export declare function conflictingPrerequisites(item: DeliverableItem, items: readonly CharterItem[]): readonly string[];
|
|
31
|
+
export interface DependencyConflictRef {
|
|
32
|
+
readonly itemId: string;
|
|
33
|
+
/** `absent` when the item was not an active deliverable before this Change Set. */
|
|
34
|
+
readonly before: PrerequisiteStatus | 'absent';
|
|
35
|
+
readonly after: PrerequisiteStatus;
|
|
36
|
+
readonly beforeConflicts: number;
|
|
37
|
+
readonly afterConflicts: number;
|
|
38
|
+
}
|
|
39
|
+
export interface DependencyConflictDiff {
|
|
40
|
+
readonly added: readonly DependencyConflictRef[];
|
|
41
|
+
readonly worsened: readonly DependencyConflictRef[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Design §6.5: a Change Set must prominently mark newly introduced or worsened
|
|
45
|
+
* readiness conflicts and require explicit user confirmation. This is the shared
|
|
46
|
+
* before/after comparison used by the planner (Host authority) and the Pane
|
|
47
|
+
* (immediate feedback), so both sides cannot drift.
|
|
48
|
+
*
|
|
49
|
+
* Structural illegality (cycles, dangling or inactive endpoints) is *not* part of
|
|
50
|
+
* this diff: `validateDependencyGraph` rejects those outright.
|
|
51
|
+
*/
|
|
52
|
+
export declare function dependencyConflictDiff(before: readonly CharterItem[], after: readonly CharterItem[]): DependencyConflictDiff;
|
package/lib/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as charterItemSchema, $t as recordMaintenanceAvailable, At as proposalSourceSchema, Bt as sha256Json, C as buildRecordArchive, Ct as mutationIdSchema, D as validateArchiveEnvelope, Dt as proposalBatchSchema, E as recordDigestOf, Et as objectiveProposalSchema, F as buildSnapshotUnchecked, Ft as compareCodeUnits, G as CHARTER_RECORD_SCHEMA_VERSION, Gt as DEFAULT_CHARTER_LIMITS, H as inspectUserText, I as emptySnapshot, It as compareOrderedItems, J as charterChangeSchema, Jt as MIN_RECORD_BYTES, K as charterActorSchema, Kt as MIN_HISTORY_BYTES, L as assertStateQuota, Lt as isDeliverable, Mt as encodePromptText, N as applyOps, Nt as renderCharterPrompt, O as withPayloadDigest, Ot as proposalCandidateRefSchema, P as buildSnapshot, Pt as canonicalItems, Q as charterInitializeRequestSchema, Qt as jsonBytes, R as validateState, Rt as isInvariant, S as assertRestorableArchive, St as maintenanceKindSchema, T as payloadDigestOf, Tt as newItemInputSchema, U as normalizeEditRequest, Ut as bootstrapFromEvents, V as clientRefsOf, Vt as sha256Text, W as normalizeUserText, Wt as bootstrapFromSummary, X as charterEvidenceSchema, Xt as RECOVERY_HEADROOM, Y as charterEditRequestSchema, Yt as RECOVERY_HARD_CEILING, Z as charterIdentitySchema, Zt as clampCharterLimits, _ as migrateRecordV1ToV2, _t as deliverableProgressSchema, a as appendMaintenanceReceipt, at as charterRecordArchiveSchema, b as assertArchiveAdmission, bt as invariantInputSchema, c as assertRecoveryRecordAdmission, ct as charterRecordV1Schema, d as createEmptyRecord, dt as charterSnapshotSchema, en as recoveryWithinBudget, et as charterLifecycleSchema, f as emptyStateDigest, ft as charterValiditySchema, g as maintenanceRequestDigestOf, gt as deliverableItemSchema, h as legacyValidityFor, ht as deliverableInputSchema, i as RevisionConflict, it as charterReceiptSchema, jt as CHARTER_PROMPT_PREFIX, kt as proposalSourceKindSchema, l as assertSnapshotAdmission, lt as charterRestoreRequestSchema, m as isRecordOverBudget, mt as clientRefSchema, n as MAX_PROPOSAL_BATCHES, nn as CharterError, nt as charterObjectiveSchema, o as assertRecordAdmission, ot as charterRecordArchiveSourceSchema, p as isExpectedControlError, pt as charterVerificationSchema, q as charterBootstrapApplyRequestSchema, qt as MIN_PROMPT_BYTES, r as MutationReplay, rn as charterError, rt as charterOpSchema, s as assertRecordConsistency, st as charterRecordSchema, t as forkRecord, tn as utf8Bytes, tt as charterMaintenanceReceiptSchema, u as commitRecord, ut as charterReviewSchema, v as requestDigestOf, vt as digestSchema, w as maintenanceSemanticCheck, wt as mutationReceiptSchema, x as assertRecoveryRequestAdmission, xt as invariantItemSchema, y as restoredRecord, yt as identifierSchema, zt as isStandingItem } from "./fork-KSL6sovw.js";
|
|
2
2
|
export { CHARTER_PROMPT_PREFIX, CHARTER_RECORD_SCHEMA_VERSION, CharterError, DEFAULT_CHARTER_LIMITS, MAX_PROPOSAL_BATCHES, MIN_HISTORY_BYTES, MIN_PROMPT_BYTES, MIN_RECORD_BYTES, MutationReplay, RECOVERY_HARD_CEILING, RECOVERY_HEADROOM, RevisionConflict, appendMaintenanceReceipt, applyOps, assertArchiveAdmission, assertRecordAdmission, assertRecordConsistency, assertRecoveryRecordAdmission, assertRecoveryRequestAdmission, assertRestorableArchive, assertSnapshotAdmission, assertStateQuota, bootstrapFromEvents, bootstrapFromSummary, buildRecordArchive, buildSnapshot, buildSnapshotUnchecked, canonicalItems, charterActorSchema, charterBootstrapApplyRequestSchema, charterChangeSchema, charterEditRequestSchema, charterError, charterEvidenceSchema, charterIdentitySchema, charterInitializeRequestSchema, charterItemSchema, charterLifecycleSchema, charterMaintenanceReceiptSchema, charterObjectiveSchema, charterOpSchema, charterReceiptSchema, charterRecordArchiveSchema, charterRecordArchiveSourceSchema, charterRecordSchema, charterRecordV1Schema, charterRestoreRequestSchema, charterReviewSchema, charterSnapshotSchema, charterValiditySchema, charterVerificationSchema, clampCharterLimits, clientRefSchema, clientRefsOf, commitRecord, compareCodeUnits, compareOrderedItems as compareItems, createEmptyRecord, deliverableInputSchema, deliverableItemSchema, deliverableProgressSchema, digestSchema, emptySnapshot, emptyStateDigest, encodePromptText, forkRecord, identifierSchema, inspectUserText, invariantInputSchema, invariantItemSchema, isDeliverable, isExpectedControlError, isInvariant, isRecordOverBudget, isStandingItem, jsonBytes, legacyValidityFor, maintenanceKindSchema, maintenanceRequestDigestOf, maintenanceSemanticCheck, migrateRecordV1ToV2, mutationIdSchema, mutationReceiptSchema, newItemInputSchema, normalizeEditRequest, normalizeUserText, objectiveProposalSchema, payloadDigestOf, proposalBatchSchema, proposalCandidateRefSchema, proposalSourceKindSchema, proposalSourceSchema, recordDigestOf, recordMaintenanceAvailable, recoveryWithinBudget, renderCharterPrompt, renderCharterPrompt as renderPrompt, requestDigestOf, restoredRecord, sha256Json, sha256Text, utf8Bytes, validateArchiveEnvelope, validateState, withPayloadDigest };
|
|
@@ -1241,6 +1241,75 @@ function dependencyProjection(items) {
|
|
|
1241
1241
|
executionDisplay: executionDisplay(item, items)
|
|
1242
1242
|
}));
|
|
1243
1243
|
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Prerequisite ids that make `item` conflict right now: a cancelled prerequisite,
|
|
1246
|
+
* or a prerequisite that is not `done` while the dependent already started.
|
|
1247
|
+
* Mirrors `prerequisiteStatus` rules 1–2, but returns the causes so a Change Set
|
|
1248
|
+
* can tell "new conflict" from "worsened conflict".
|
|
1249
|
+
*/
|
|
1250
|
+
function conflictingPrerequisites(item, items) {
|
|
1251
|
+
const byId = new Map(items.map((candidate) => [candidate.id, candidate]));
|
|
1252
|
+
const causes = [];
|
|
1253
|
+
for (const id of item.requires ?? []) {
|
|
1254
|
+
const prerequisite = byId.get(id);
|
|
1255
|
+
if (prerequisite === void 0 || prerequisite.kind !== "deliverable") continue;
|
|
1256
|
+
if (prerequisite.progress === "cancelled") {
|
|
1257
|
+
causes.push(id);
|
|
1258
|
+
continue;
|
|
1259
|
+
}
|
|
1260
|
+
if (prerequisite.progress !== "done" && (item.progress === "in-progress" || item.progress === "done")) causes.push(id);
|
|
1261
|
+
}
|
|
1262
|
+
return causes;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Design §6.5: a Change Set must prominently mark newly introduced or worsened
|
|
1266
|
+
* readiness conflicts and require explicit user confirmation. This is the shared
|
|
1267
|
+
* before/after comparison used by the planner (Host authority) and the Pane
|
|
1268
|
+
* (immediate feedback), so both sides cannot drift.
|
|
1269
|
+
*
|
|
1270
|
+
* Structural illegality (cycles, dangling or inactive endpoints) is *not* part of
|
|
1271
|
+
* this diff: `validateDependencyGraph` rejects those outright.
|
|
1272
|
+
*/
|
|
1273
|
+
function dependencyConflictDiff(before, after) {
|
|
1274
|
+
const snapshot = (items) => {
|
|
1275
|
+
const out = /* @__PURE__ */ new Map();
|
|
1276
|
+
for (const item of standingDeliverables(items)) out.set(item.id, {
|
|
1277
|
+
status: prerequisiteStatus(item, items),
|
|
1278
|
+
conflicts: conflictingPrerequisites(item, items).length
|
|
1279
|
+
});
|
|
1280
|
+
return out;
|
|
1281
|
+
};
|
|
1282
|
+
const beforeState = snapshot(before);
|
|
1283
|
+
const afterState = snapshot(after);
|
|
1284
|
+
const added = [];
|
|
1285
|
+
const worsened = [];
|
|
1286
|
+
for (const [itemId, next] of afterState) {
|
|
1287
|
+
if (next.status !== "dependency-conflict") continue;
|
|
1288
|
+
const previous = beforeState.get(itemId);
|
|
1289
|
+
if (previous === void 0 || previous.status !== "dependency-conflict") {
|
|
1290
|
+
added.push({
|
|
1291
|
+
itemId,
|
|
1292
|
+
before: previous?.status ?? "absent",
|
|
1293
|
+
after: next.status,
|
|
1294
|
+
beforeConflicts: previous?.conflicts ?? 0,
|
|
1295
|
+
afterConflicts: next.conflicts
|
|
1296
|
+
});
|
|
1297
|
+
continue;
|
|
1298
|
+
}
|
|
1299
|
+
if (next.conflicts > previous.conflicts) worsened.push({
|
|
1300
|
+
itemId,
|
|
1301
|
+
before: previous.status,
|
|
1302
|
+
after: next.status,
|
|
1303
|
+
beforeConflicts: previous.conflicts,
|
|
1304
|
+
afterConflicts: next.conflicts
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
const byItemId = (left, right) => left.itemId < right.itemId ? -1 : left.itemId > right.itemId ? 1 : 0;
|
|
1308
|
+
return {
|
|
1309
|
+
added: added.sort(byItemId),
|
|
1310
|
+
worsened: worsened.sort(byItemId)
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1244
1313
|
//#endregion
|
|
1245
1314
|
//#region .build-ts/core/state.js
|
|
1246
1315
|
function assertCanonicalText(value, field) {
|
|
@@ -2665,4 +2734,4 @@ function forkRecord(input) {
|
|
|
2665
2734
|
return child;
|
|
2666
2735
|
}
|
|
2667
2736
|
//#endregion
|
|
2668
|
-
export {
|
|
2737
|
+
export { charterItemSchema as $, recordMaintenanceAvailable as $t, compactionProjectionDigest as A, proposalSourceSchema as At, dependencyProjection as B, sha256Json as Bt, buildRecordArchive as C, mutationIdSchema as Ct, validateArchiveEnvelope as D, proposalBatchSchema as Dt, recordDigestOf as E, objectiveProposalSchema as Et, buildSnapshotUnchecked as F, compareCodeUnits as Ft, CHARTER_RECORD_SCHEMA_VERSION as G, DEFAULT_CHARTER_LIMITS as Gt, inspectUserText as H, assertEditAuthorized as Ht, emptySnapshot as I, compareOrderedItems as It, charterChangeSchema as J, MIN_RECORD_BYTES as Jt, charterActorSchema as K, MIN_HISTORY_BYTES as Kt, assertStateQuota as L, isDeliverable$1 as Lt, verifySourceProjection as M, encodePromptText as Mt, applyOps as N, renderCharterPrompt as Nt, withPayloadDigest as O, proposalCandidateRefSchema as Ot, buildSnapshot as P, canonicalItems as Pt, charterInitializeRequestSchema as Q, jsonBytes as Qt, validateState as R, isInvariant$1 as Rt, assertRestorableArchive as S, maintenanceKindSchema as St, payloadDigestOf as T, newItemInputSchema as Tt, normalizeEditRequest as U, bootstrapFromEvents as Ut, clientRefsOf as V, sha256Text as Vt, normalizeUserText as W, bootstrapFromSummary as Wt, charterEvidenceSchema as X, RECOVERY_HEADROOM as Xt, charterEditRequestSchema as Y, RECOVERY_HARD_CEILING as Yt, charterIdentitySchema as Z, clampCharterLimits as Zt, migrateRecordV1ToV2 as _, deliverableProgressSchema as _t, appendMaintenanceReceipt as a, charterRecordArchiveSchema as at, assertArchiveAdmission as b, invariantInputSchema as bt, assertRecoveryRecordAdmission as c, charterRecordV1Schema as ct, createEmptyRecord as d, charterSnapshotSchema as dt, recoveryWithinBudget as en, charterLifecycleSchema as et, emptyStateDigest as f, charterValiditySchema as ft, maintenanceRequestDigestOf as g, deliverableItemSchema as gt, legacyValidityFor as h, deliverableInputSchema as ht, RevisionConflict as i, charterReceiptSchema as it, messageProjectionDigest as j, CHARTER_PROMPT_PREFIX as jt, agentProjectionDigest as k, proposalSourceKindSchema as kt, assertSnapshotAdmission as l, charterRestoreRequestSchema as lt, isRecordOverBudget as m, clientRefSchema as mt, MAX_PROPOSAL_BATCHES as n, CharterError as nn, charterObjectiveSchema as nt, assertRecordAdmission as o, charterRecordArchiveSourceSchema as ot, isExpectedControlError as p, charterVerificationSchema as pt, charterBootstrapApplyRequestSchema as q, MIN_PROMPT_BYTES as qt, MutationReplay as r, charterError as rn, charterOpSchema as rt, assertRecordConsistency as s, charterRecordSchema as st, forkRecord as t, utf8Bytes as tn, charterMaintenanceReceiptSchema as tt, commitRecord as u, charterReviewSchema as ut, requestDigestOf as v, digestSchema as vt, maintenanceSemanticCheck as w, mutationReceiptSchema as wt, assertRecoveryRequestAdmission as x, invariantItemSchema as xt, restoredRecord as y, identifierSchema as yt, dependencyConflictDiff as z, isStandingItem as zt };
|
package/lib/host/domain.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type CharterRecordArchive } from '../core/schemas.js';
|
|
2
4
|
export declare const CHARTER_DOMAIN_NAME = "dsh_charter_v1";
|
|
3
5
|
export declare const CHARTER_DOMAIN_VERSION = 1;
|
|
4
6
|
export declare const CHARTER_SESSIONS_TABLE = "sessions";
|
|
@@ -11,3 +13,51 @@ export declare const charterDomainSpec: {
|
|
|
11
13
|
};
|
|
12
14
|
};
|
|
13
15
|
export type CharterDomainSpec = typeof charterDomainSpec;
|
|
16
|
+
export declare const CHARTER_ARCHIVES_DOMAIN_NAME = "dsh_charter_archives_v1";
|
|
17
|
+
export declare const CHARTER_ARCHIVES_DOMAIN_VERSION = 1;
|
|
18
|
+
export declare const CHARTER_ARCHIVES_TABLE = "archives";
|
|
19
|
+
export declare const CHARTER_ARCHIVE_CACHE_LIMIT = 5;
|
|
20
|
+
export declare const CHARTER_ARCHIVE_TOTAL_LIMIT = 25;
|
|
21
|
+
export interface CharterArchiveCacheEntry {
|
|
22
|
+
readonly key: string;
|
|
23
|
+
readonly sessionId: string;
|
|
24
|
+
readonly revision: number;
|
|
25
|
+
readonly archivedAt: number;
|
|
26
|
+
readonly archive: CharterRecordArchive;
|
|
27
|
+
}
|
|
28
|
+
export declare const charterArchiveCacheEntrySchema: z.ZodObject<{
|
|
29
|
+
key: z.ZodString;
|
|
30
|
+
sessionId: z.ZodString;
|
|
31
|
+
revision: z.ZodNumber;
|
|
32
|
+
archivedAt: z.ZodNumber;
|
|
33
|
+
archive: z.ZodObject<{
|
|
34
|
+
format: z.ZodLiteral<"dsh-charter-record">;
|
|
35
|
+
formatVersion: z.ZodLiteral<1>;
|
|
36
|
+
exportedAt: z.ZodNumber;
|
|
37
|
+
source: z.ZodObject<{
|
|
38
|
+
domain: z.ZodLiteral<"dsh_charter_v1">;
|
|
39
|
+
domainVersion: z.ZodLiteral<1>;
|
|
40
|
+
sessionId: z.ZodString;
|
|
41
|
+
lifecycle: z.ZodNullable<z.ZodString>;
|
|
42
|
+
health: z.ZodEnum<{
|
|
43
|
+
healthy: "healthy";
|
|
44
|
+
"schema-invalid": "schema-invalid";
|
|
45
|
+
"consistency-invalid": "consistency-invalid";
|
|
46
|
+
"lifecycle-mismatch": "lifecycle-mismatch";
|
|
47
|
+
}>;
|
|
48
|
+
revision: z.ZodNullable<z.ZodNumber>;
|
|
49
|
+
recordDigest: z.ZodString;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
record: z.ZodUnknown;
|
|
52
|
+
payloadDigest: z.ZodString;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
export declare const charterArchivesDomainSpec: {
|
|
56
|
+
name: string;
|
|
57
|
+
version: number;
|
|
58
|
+
layout: "per-record";
|
|
59
|
+
tables: {
|
|
60
|
+
archives: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<string, CharterArchiveCacheEntry>;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare function archiveCacheKey(sessionId: string, revision: number): string;
|
package/lib/host/service.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type SessionId as SessionIdType } from '@deepseek-ai/dsh-session/types'
|
|
|
5
5
|
import { type CharterLimits } from '../core/limits.js';
|
|
6
6
|
import { type ItemQueryRequest } from '../core/query.js';
|
|
7
7
|
import { type CharterActor } from '../core/schemas.js';
|
|
8
|
-
import type { CharterEditResult, CharterListener, CharterToolView, CharterBootstrapResult, CharterRecordExport, CharterRecordOperationResult, CharterView, CharterSummary, CharterItemQueryResult, CharterProposalQueryResult, CharterChangeQueryResult } from './types.js';
|
|
8
|
+
import type { CharterEditResult, CharterListener, CharterToolView, CharterBootstrapResult, CharterRecordExport, CharterRecordOperationResult, CharterView, CharterSummary, CharterItemQueryResult, CharterProposalQueryResult, CharterChangeQueryResult, CharterArchiveListResult, CharterArchiveReadResult } from './types.js';
|
|
9
9
|
import type { SessionStartSource as StartSource } from '@deepseek-ai/dsh-agent';
|
|
10
10
|
export interface CharterConfig extends CharterLimits {
|
|
11
11
|
readonly contextOrder: number;
|
|
@@ -18,6 +18,10 @@ export declare class CharterService extends Service {
|
|
|
18
18
|
static Config: Schema<CharterConfig>;
|
|
19
19
|
private readonly config;
|
|
20
20
|
private sessionsTable;
|
|
21
|
+
private archivesTable;
|
|
22
|
+
private archivesDomain;
|
|
23
|
+
/** Captures awaiting their durable put; visible to list/read immediately. */
|
|
24
|
+
private readonly pendingArchives;
|
|
21
25
|
private globalFailure?;
|
|
22
26
|
private admissionOpen;
|
|
23
27
|
private readonly unavailable;
|
|
@@ -137,6 +141,19 @@ export declare class CharterService extends Service {
|
|
|
137
141
|
/** Re-confirm the queued operation still targets the live Session object. */
|
|
138
142
|
private queuedMaintenanceFailure;
|
|
139
143
|
/** Export the complete raw record for one Session (owner-only). */
|
|
144
|
+
/**
|
|
145
|
+
* Bounded cache policy: at most five snapshots per Session and at most
|
|
146
|
+
* `CHARTER_ARCHIVE_TOTAL_LIMIT` across all Sessions. Oldest snapshots are
|
|
147
|
+
* evicted first; this is a derivative cache, never the authoritative record.
|
|
148
|
+
*/
|
|
149
|
+
private pruneArchiveCache;
|
|
150
|
+
/**
|
|
151
|
+
* Best-effort bounded archive cache. It stores the exact record envelope at
|
|
152
|
+
* each successful revision so recovery does not depend on a downloaded file.
|
|
153
|
+
*/
|
|
154
|
+
private captureArchive;
|
|
155
|
+
listArchives(sessionId: SessionIdType, actor: CharterActor): CharterArchiveListResult;
|
|
156
|
+
readArchive(sessionId: SessionIdType, key: string, actor: CharterActor): CharterArchiveReadResult;
|
|
140
157
|
exportRecord(sessionId: SessionIdType, actor?: CharterActor): CharterRecordExport;
|
|
141
158
|
/**
|
|
142
159
|
* Explicit empty initialization: only for an absent key (an outer unreadable
|
package/lib/host/types.d.ts
CHANGED
|
@@ -154,7 +154,10 @@ export interface CharterView {
|
|
|
154
154
|
/** Structured record health (defaults to unknown/legacy-host on old frames). */
|
|
155
155
|
readonly recordState?: CharterRecordState | undefined;
|
|
156
156
|
readonly capabilities?: CharterViewCapabilities | undefined;
|
|
157
|
-
readonly proposalBatches?: ProposalBatch
|
|
157
|
+
readonly proposalBatches?: Array<ProposalBatch & {
|
|
158
|
+
/** View-level copy supplied by the client query plane; absent on raw Host frames. */
|
|
159
|
+
readonly sourceIntegrity?: import('../core/source-registry.js').SourceIntegrity;
|
|
160
|
+
}> | undefined;
|
|
158
161
|
readonly objectiveProposals?: import('../core/schemas.js').ObjectiveProposal[] | undefined;
|
|
159
162
|
}
|
|
160
163
|
/** Export/initialize/restore are maintenance operations, never model tools. */
|
|
@@ -297,8 +300,37 @@ export interface CharterMessageCandidate {
|
|
|
297
300
|
readonly seq: number;
|
|
298
301
|
readonly role: 'user';
|
|
299
302
|
readonly excerpt: string;
|
|
303
|
+
/** Full message text when available; bounded by the Host projection cap. */
|
|
304
|
+
readonly text?: string;
|
|
305
|
+
/** True when the Host cap clipped the text field. */
|
|
306
|
+
readonly truncated?: boolean;
|
|
300
307
|
readonly length: number;
|
|
301
308
|
}
|
|
309
|
+
export interface CharterArchiveEntry {
|
|
310
|
+
readonly key: string;
|
|
311
|
+
readonly revision: number;
|
|
312
|
+
readonly archivedAt: number;
|
|
313
|
+
readonly payloadDigest: string;
|
|
314
|
+
readonly recordDigest: string;
|
|
315
|
+
readonly lifecycle: string | null;
|
|
316
|
+
}
|
|
317
|
+
export type CharterArchiveListResult = {
|
|
318
|
+
readonly ok: true;
|
|
319
|
+
readonly archives: readonly CharterArchiveEntry[];
|
|
320
|
+
readonly limit: number;
|
|
321
|
+
} | {
|
|
322
|
+
readonly ok: false;
|
|
323
|
+
readonly code: CharterErrorCode;
|
|
324
|
+
readonly message: string;
|
|
325
|
+
};
|
|
326
|
+
export type CharterArchiveReadResult = {
|
|
327
|
+
readonly ok: true;
|
|
328
|
+
readonly archive: import('../core/schemas.js').CharterRecordArchive;
|
|
329
|
+
} | {
|
|
330
|
+
readonly ok: false;
|
|
331
|
+
readonly code: CharterErrorCode;
|
|
332
|
+
readonly message: string;
|
|
333
|
+
};
|
|
302
334
|
export type CharterMessageListResult = {
|
|
303
335
|
readonly ok: true;
|
|
304
336
|
readonly messages: readonly CharterMessageCandidate[];
|
|
@@ -310,6 +342,8 @@ export type CharterMessageListResult = {
|
|
|
310
342
|
export interface CharterMessageProposalOptions {
|
|
311
343
|
readonly seq?: number;
|
|
312
344
|
readonly kind?: 'invariant' | 'deliverable';
|
|
345
|
+
/** Optional edited proposal text; overrides the selected message slice. */
|
|
346
|
+
readonly text?: string;
|
|
313
347
|
readonly start?: number;
|
|
314
348
|
readonly end?: number;
|
|
315
349
|
}
|
|
@@ -366,6 +400,8 @@ export type CharterChangeSetPreviewResult = {
|
|
|
366
400
|
readonly changes: readonly import('../core/schemas.js').CharterChange[];
|
|
367
401
|
readonly promptChanged: boolean;
|
|
368
402
|
readonly metadataOnly: boolean;
|
|
403
|
+
/** Optional so a Host predating §6.5 still decodes; absent means "not reported". */
|
|
404
|
+
readonly dependencyConflicts?: import('../core/dependencies.js').DependencyConflictDiff;
|
|
369
405
|
} | {
|
|
370
406
|
readonly ok: false;
|
|
371
407
|
readonly code: CharterErrorCode;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { a as CHARTER_DOMAIN_NAME, n as Config, o as CHARTER_DOMAIN_VERSION, r as DEFAULT_CHARTER_CONFIG, s as charterDomainSpec, t as CharterService } from "./service-
|
|
1
|
+
import { $ as charterItemSchema, $t as recordMaintenanceAvailable, At as proposalSourceSchema, Bt as sha256Json, C as buildRecordArchive, Ct as mutationIdSchema, D as validateArchiveEnvelope, Dt as proposalBatchSchema, E as recordDigestOf, Et as objectiveProposalSchema, F as buildSnapshotUnchecked, Ft as compareCodeUnits, G as CHARTER_RECORD_SCHEMA_VERSION, Gt as DEFAULT_CHARTER_LIMITS, H as inspectUserText, I as emptySnapshot, It as compareOrderedItems, J as charterChangeSchema, Jt as MIN_RECORD_BYTES, K as charterActorSchema, Kt as MIN_HISTORY_BYTES, L as assertStateQuota, Lt as isDeliverable, Mt as encodePromptText, N as applyOps, Nt as renderCharterPrompt, O as withPayloadDigest, Ot as proposalCandidateRefSchema, P as buildSnapshot, Pt as canonicalItems, Q as charterInitializeRequestSchema, Qt as jsonBytes, R as validateState, Rt as isInvariant, S as assertRestorableArchive, St as maintenanceKindSchema, T as payloadDigestOf, Tt as newItemInputSchema, U as normalizeEditRequest, Ut as bootstrapFromEvents, V as clientRefsOf, Vt as sha256Text, W as normalizeUserText, Wt as bootstrapFromSummary, X as charterEvidenceSchema, Xt as RECOVERY_HEADROOM, Y as charterEditRequestSchema, Yt as RECOVERY_HARD_CEILING, Z as charterIdentitySchema, Zt as clampCharterLimits, _ as migrateRecordV1ToV2, _t as deliverableProgressSchema, a as appendMaintenanceReceipt, at as charterRecordArchiveSchema, b as assertArchiveAdmission, bt as invariantInputSchema, c as assertRecoveryRecordAdmission, ct as charterRecordV1Schema, d as createEmptyRecord, dt as charterSnapshotSchema, en as recoveryWithinBudget, et as charterLifecycleSchema, f as emptyStateDigest, ft as charterValiditySchema, g as maintenanceRequestDigestOf, gt as deliverableItemSchema, h as legacyValidityFor, ht as deliverableInputSchema, i as RevisionConflict, it as charterReceiptSchema, jt as CHARTER_PROMPT_PREFIX, kt as proposalSourceKindSchema, l as assertSnapshotAdmission, lt as charterRestoreRequestSchema, m as isRecordOverBudget, mt as clientRefSchema, n as MAX_PROPOSAL_BATCHES, nn as CharterError, nt as charterObjectiveSchema, o as assertRecordAdmission, ot as charterRecordArchiveSourceSchema, p as isExpectedControlError, pt as charterVerificationSchema, q as charterBootstrapApplyRequestSchema, qt as MIN_PROMPT_BYTES, r as MutationReplay, rn as charterError, rt as charterOpSchema, s as assertRecordConsistency, st as charterRecordSchema, t as forkRecord, tn as utf8Bytes, tt as charterMaintenanceReceiptSchema, u as commitRecord, ut as charterReviewSchema, v as requestDigestOf, vt as digestSchema, w as maintenanceSemanticCheck, wt as mutationReceiptSchema, x as assertRecoveryRequestAdmission, xt as invariantItemSchema, y as restoredRecord, yt as identifierSchema, zt as isStandingItem } from "./fork-KSL6sovw.js";
|
|
2
|
+
import { a as CHARTER_DOMAIN_NAME, n as Config, o as CHARTER_DOMAIN_VERSION, r as DEFAULT_CHARTER_CONFIG, s as charterDomainSpec, t as CharterService } from "./service-MsIACddZ.js";
|
|
3
3
|
import "./core.js";
|
|
4
4
|
export { CHARTER_DOMAIN_NAME, CHARTER_DOMAIN_VERSION, CHARTER_PROMPT_PREFIX, CHARTER_RECORD_SCHEMA_VERSION, CharterError, CharterService, CharterService as default, Config, DEFAULT_CHARTER_CONFIG, DEFAULT_CHARTER_LIMITS, MAX_PROPOSAL_BATCHES, MIN_HISTORY_BYTES, MIN_PROMPT_BYTES, MIN_RECORD_BYTES, MutationReplay, RECOVERY_HARD_CEILING, RECOVERY_HEADROOM, RevisionConflict, appendMaintenanceReceipt, applyOps, assertArchiveAdmission, assertRecordAdmission, assertRecordConsistency, assertRecoveryRecordAdmission, assertRecoveryRequestAdmission, assertRestorableArchive, assertSnapshotAdmission, assertStateQuota, bootstrapFromEvents, bootstrapFromSummary, buildRecordArchive, buildSnapshot, buildSnapshotUnchecked, canonicalItems, charterActorSchema, charterBootstrapApplyRequestSchema, charterChangeSchema, charterDomainSpec, charterEditRequestSchema, charterError, charterEvidenceSchema, charterIdentitySchema, charterInitializeRequestSchema, charterItemSchema, charterLifecycleSchema, charterMaintenanceReceiptSchema, charterObjectiveSchema, charterOpSchema, charterReceiptSchema, charterRecordArchiveSchema, charterRecordArchiveSourceSchema, charterRecordSchema, charterRecordV1Schema, charterRestoreRequestSchema, charterReviewSchema, charterSnapshotSchema, charterValiditySchema, charterVerificationSchema, clampCharterLimits, clientRefSchema, clientRefsOf, commitRecord, compareCodeUnits, compareOrderedItems as compareItems, createEmptyRecord, deliverableInputSchema, deliverableItemSchema, deliverableProgressSchema, digestSchema, emptySnapshot, emptyStateDigest, encodePromptText, forkRecord, identifierSchema, inspectUserText, invariantInputSchema, invariantItemSchema, isDeliverable, isExpectedControlError, isInvariant, isRecordOverBudget, isStandingItem, jsonBytes, legacyValidityFor, maintenanceKindSchema, maintenanceRequestDigestOf, maintenanceSemanticCheck, migrateRecordV1ToV2, mutationIdSchema, mutationReceiptSchema, newItemInputSchema, normalizeEditRequest, normalizeUserText, objectiveProposalSchema, payloadDigestOf, proposalBatchSchema, proposalCandidateRefSchema, proposalSourceKindSchema, proposalSourceSchema, recordDigestOf, recordMaintenanceAvailable, recoveryWithinBudget, renderCharterPrompt, renderCharterPrompt as renderPrompt, requestDigestOf, restoredRecord, sha256Json, sha256Text, utf8Bytes, validateArchiveEnvelope, validateState, withPayloadDigest };
|
package/lib/remote/service.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Context } from '@deepseek-ai/cordis';
|
|
|
2
2
|
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
3
3
|
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
4
4
|
import type { CharterEditRequest, CharterInitializeRequest, CharterRestoreRequest } from '../core/schemas.js';
|
|
5
|
-
import type { CharterBootstrapResult, CharterEditResult, CharterRecordExport, CharterRecordOperationResult, CharterView, CharterSummary, CharterItemQueryResult, CharterProposalQueryResult, CharterChangeQueryResult, CharterChangeSetPreviewResult, CharterValidatorRequest, CharterValidatorRunResult, CharterSourceIntegrityResult, CharterMessageListResult } from '../host/types.js';
|
|
5
|
+
import type { CharterBootstrapResult, CharterEditResult, CharterRecordExport, CharterRecordOperationResult, CharterView, CharterSummary, CharterItemQueryResult, CharterProposalQueryResult, CharterChangeQueryResult, CharterChangeSetPreviewResult, CharterValidatorRequest, CharterValidatorRunResult, CharterSourceIntegrityResult, CharterMessageListResult, CharterArchiveListResult, CharterArchiveReadResult } from '../host/types.js';
|
|
6
6
|
import type { CharterFrame } from './wire.js';
|
|
7
7
|
export declare class CharterRemoteService extends TypertRemoteService {
|
|
8
8
|
static inject: string[];
|
|
@@ -13,6 +13,13 @@ export declare class CharterRemoteService extends TypertRemoteService {
|
|
|
13
13
|
readonly requests: readonly CharterValidatorRequest[];
|
|
14
14
|
}): Promise<CharterValidatorRunResult>;
|
|
15
15
|
queryMessages(sessionId: SessionId): Promise<CharterMessageListResult>;
|
|
16
|
+
listArchives(request: {
|
|
17
|
+
readonly sessionId: SessionId;
|
|
18
|
+
}): Promise<CharterArchiveListResult>;
|
|
19
|
+
readArchive(request: {
|
|
20
|
+
readonly sessionId: SessionId;
|
|
21
|
+
readonly key: string;
|
|
22
|
+
}): Promise<CharterArchiveReadResult>;
|
|
16
23
|
proposeMessage(request: {
|
|
17
24
|
readonly sessionId: SessionId;
|
|
18
25
|
readonly seq?: number;
|
package/lib/remote/wire.d.ts
CHANGED
|
@@ -489,8 +489,8 @@ export declare const charterSummarySchema: z.ZodObject<{
|
|
|
489
489
|
unknown: "unknown";
|
|
490
490
|
invalid: "invalid";
|
|
491
491
|
healthy: "healthy";
|
|
492
|
-
"write-uncertain": "write-uncertain";
|
|
493
492
|
absent: "absent";
|
|
493
|
+
"write-uncertain": "write-uncertain";
|
|
494
494
|
}>;
|
|
495
495
|
capabilities: z.ZodObject<{
|
|
496
496
|
recordMaintenance: z.ZodBoolean;
|
|
@@ -592,8 +592,8 @@ export declare const charterSummaryFrameSchema: z.ZodUnion<readonly [z.ZodObject
|
|
|
592
592
|
unknown: "unknown";
|
|
593
593
|
invalid: "invalid";
|
|
594
594
|
healthy: "healthy";
|
|
595
|
-
"write-uncertain": "write-uncertain";
|
|
596
595
|
absent: "absent";
|
|
596
|
+
"write-uncertain": "write-uncertain";
|
|
597
597
|
}>;
|
|
598
598
|
capabilities: z.ZodObject<{
|
|
599
599
|
recordMaintenance: z.ZodBoolean;
|
|
@@ -695,8 +695,8 @@ export declare const charterSummaryFrameSchema: z.ZodUnion<readonly [z.ZodObject
|
|
|
695
695
|
unknown: "unknown";
|
|
696
696
|
invalid: "invalid";
|
|
697
697
|
healthy: "healthy";
|
|
698
|
-
"write-uncertain": "write-uncertain";
|
|
699
698
|
absent: "absent";
|
|
699
|
+
"write-uncertain": "write-uncertain";
|
|
700
700
|
}>;
|
|
701
701
|
capabilities: z.ZodObject<{
|
|
702
702
|
recordMaintenance: z.ZodBoolean;
|
|
@@ -1196,6 +1196,8 @@ export declare const charterMessageListSchema: z.ZodDiscriminatedUnion<[z.ZodObj
|
|
|
1196
1196
|
seq: z.ZodNumber;
|
|
1197
1197
|
role: z.ZodLiteral<"user">;
|
|
1198
1198
|
excerpt: z.ZodString;
|
|
1199
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1200
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
1199
1201
|
length: z.ZodNumber;
|
|
1200
1202
|
}, z.core.$strict>>;
|
|
1201
1203
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -1234,9 +1236,117 @@ export declare const charterMessageProposeRequestSchema: z.ZodObject<{
|
|
|
1234
1236
|
invariant: "invariant";
|
|
1235
1237
|
deliverable: "deliverable";
|
|
1236
1238
|
}>>;
|
|
1239
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1237
1240
|
start: z.ZodOptional<z.ZodNumber>;
|
|
1238
1241
|
end: z.ZodOptional<z.ZodNumber>;
|
|
1239
1242
|
}, z.core.$strict>;
|
|
1243
|
+
export declare const charterArchiveEntrySchema: z.ZodObject<{
|
|
1244
|
+
key: z.ZodString;
|
|
1245
|
+
revision: z.ZodNumber;
|
|
1246
|
+
archivedAt: z.ZodNumber;
|
|
1247
|
+
payloadDigest: z.ZodString;
|
|
1248
|
+
recordDigest: z.ZodString;
|
|
1249
|
+
lifecycle: z.ZodNullable<z.ZodString>;
|
|
1250
|
+
}, z.core.$strict>;
|
|
1251
|
+
export declare const charterArchiveListRequestSchema: z.ZodObject<{
|
|
1252
|
+
sessionId: z.ZodString;
|
|
1253
|
+
}, z.core.$strict>;
|
|
1254
|
+
export declare const charterArchiveReadRequestSchema: z.ZodObject<{
|
|
1255
|
+
sessionId: z.ZodString;
|
|
1256
|
+
key: z.ZodString;
|
|
1257
|
+
}, z.core.$strict>;
|
|
1258
|
+
export declare const charterArchiveListResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1259
|
+
ok: z.ZodLiteral<true>;
|
|
1260
|
+
archives: z.ZodArray<z.ZodObject<{
|
|
1261
|
+
key: z.ZodString;
|
|
1262
|
+
revision: z.ZodNumber;
|
|
1263
|
+
archivedAt: z.ZodNumber;
|
|
1264
|
+
payloadDigest: z.ZodString;
|
|
1265
|
+
recordDigest: z.ZodString;
|
|
1266
|
+
lifecycle: z.ZodNullable<z.ZodString>;
|
|
1267
|
+
}, z.core.$strict>>;
|
|
1268
|
+
limit: z.ZodNumber;
|
|
1269
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1270
|
+
ok: z.ZodLiteral<false>;
|
|
1271
|
+
code: z.ZodEnum<{
|
|
1272
|
+
INVALID_ARGUMENT: "INVALID_ARGUMENT";
|
|
1273
|
+
FORBIDDEN: "FORBIDDEN";
|
|
1274
|
+
NOT_FOUND: "NOT_FOUND";
|
|
1275
|
+
LIFECYCLE_MISMATCH: "LIFECYCLE_MISMATCH";
|
|
1276
|
+
REVISION_CONFLICT: "REVISION_CONFLICT";
|
|
1277
|
+
MUTATION_ID_REUSED: "MUTATION_ID_REUSED";
|
|
1278
|
+
INVALID_REFERENCE: "INVALID_REFERENCE";
|
|
1279
|
+
INVALID_TRANSITION: "INVALID_TRANSITION";
|
|
1280
|
+
INVALID_CHANGE_SET: "INVALID_CHANGE_SET";
|
|
1281
|
+
STALE_REVISION: "STALE_REVISION";
|
|
1282
|
+
PREVIEW_MISMATCH: "PREVIEW_MISMATCH";
|
|
1283
|
+
LIMIT_EXCEEDED: "LIMIT_EXCEEDED";
|
|
1284
|
+
INVALID_CURSOR: "INVALID_CURSOR";
|
|
1285
|
+
OUTCOME_UNKNOWN: "OUTCOME_UNKNOWN";
|
|
1286
|
+
IMMUTABLE_FIELD: "IMMUTABLE_FIELD";
|
|
1287
|
+
QUOTA_EXCEEDED: "QUOTA_EXCEEDED";
|
|
1288
|
+
CORRUPT_STATE: "CORRUPT_STATE";
|
|
1289
|
+
UNAVAILABLE: "UNAVAILABLE";
|
|
1290
|
+
INITIALIZATION_REQUIRED: "INITIALIZATION_REQUIRED";
|
|
1291
|
+
INVALID_ARCHIVE: "INVALID_ARCHIVE";
|
|
1292
|
+
RECORD_CONFLICT: "RECORD_CONFLICT";
|
|
1293
|
+
OPERATION_ID_REUSED: "OPERATION_ID_REUSED";
|
|
1294
|
+
RECOVERY_UNSUPPORTED: "RECOVERY_UNSUPPORTED";
|
|
1295
|
+
}>;
|
|
1296
|
+
message: z.ZodString;
|
|
1297
|
+
}, z.core.$strict>], "ok">;
|
|
1298
|
+
export declare const charterArchiveReadResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1299
|
+
ok: z.ZodLiteral<true>;
|
|
1300
|
+
archive: z.ZodObject<{
|
|
1301
|
+
format: z.ZodLiteral<"dsh-charter-record">;
|
|
1302
|
+
formatVersion: z.ZodLiteral<1>;
|
|
1303
|
+
exportedAt: z.ZodNumber;
|
|
1304
|
+
source: z.ZodObject<{
|
|
1305
|
+
domain: z.ZodLiteral<"dsh_charter_v1">;
|
|
1306
|
+
domainVersion: z.ZodLiteral<1>;
|
|
1307
|
+
sessionId: z.ZodString;
|
|
1308
|
+
lifecycle: z.ZodNullable<z.ZodString>;
|
|
1309
|
+
health: z.ZodEnum<{
|
|
1310
|
+
healthy: "healthy";
|
|
1311
|
+
"schema-invalid": "schema-invalid";
|
|
1312
|
+
"consistency-invalid": "consistency-invalid";
|
|
1313
|
+
"lifecycle-mismatch": "lifecycle-mismatch";
|
|
1314
|
+
}>;
|
|
1315
|
+
revision: z.ZodNullable<z.ZodNumber>;
|
|
1316
|
+
recordDigest: z.ZodString;
|
|
1317
|
+
}, z.core.$strict>;
|
|
1318
|
+
record: z.ZodUnknown;
|
|
1319
|
+
payloadDigest: z.ZodString;
|
|
1320
|
+
}, z.core.$strict>;
|
|
1321
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1322
|
+
ok: z.ZodLiteral<false>;
|
|
1323
|
+
code: z.ZodEnum<{
|
|
1324
|
+
INVALID_ARGUMENT: "INVALID_ARGUMENT";
|
|
1325
|
+
FORBIDDEN: "FORBIDDEN";
|
|
1326
|
+
NOT_FOUND: "NOT_FOUND";
|
|
1327
|
+
LIFECYCLE_MISMATCH: "LIFECYCLE_MISMATCH";
|
|
1328
|
+
REVISION_CONFLICT: "REVISION_CONFLICT";
|
|
1329
|
+
MUTATION_ID_REUSED: "MUTATION_ID_REUSED";
|
|
1330
|
+
INVALID_REFERENCE: "INVALID_REFERENCE";
|
|
1331
|
+
INVALID_TRANSITION: "INVALID_TRANSITION";
|
|
1332
|
+
INVALID_CHANGE_SET: "INVALID_CHANGE_SET";
|
|
1333
|
+
STALE_REVISION: "STALE_REVISION";
|
|
1334
|
+
PREVIEW_MISMATCH: "PREVIEW_MISMATCH";
|
|
1335
|
+
LIMIT_EXCEEDED: "LIMIT_EXCEEDED";
|
|
1336
|
+
INVALID_CURSOR: "INVALID_CURSOR";
|
|
1337
|
+
OUTCOME_UNKNOWN: "OUTCOME_UNKNOWN";
|
|
1338
|
+
IMMUTABLE_FIELD: "IMMUTABLE_FIELD";
|
|
1339
|
+
QUOTA_EXCEEDED: "QUOTA_EXCEEDED";
|
|
1340
|
+
CORRUPT_STATE: "CORRUPT_STATE";
|
|
1341
|
+
UNAVAILABLE: "UNAVAILABLE";
|
|
1342
|
+
INITIALIZATION_REQUIRED: "INITIALIZATION_REQUIRED";
|
|
1343
|
+
INVALID_ARCHIVE: "INVALID_ARCHIVE";
|
|
1344
|
+
RECORD_CONFLICT: "RECORD_CONFLICT";
|
|
1345
|
+
OPERATION_ID_REUSED: "OPERATION_ID_REUSED";
|
|
1346
|
+
RECOVERY_UNSUPPORTED: "RECOVERY_UNSUPPORTED";
|
|
1347
|
+
}>;
|
|
1348
|
+
message: z.ZodString;
|
|
1349
|
+
}, z.core.$strict>], "ok">;
|
|
1240
1350
|
export declare const charterSourceIntegrityResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1241
1351
|
ok: z.ZodLiteral<true>;
|
|
1242
1352
|
revision: z.ZodNumber;
|
|
@@ -1441,6 +1551,40 @@ export declare const charterChangeSetPreviewResultSchema: z.ZodDiscriminatedUnio
|
|
|
1441
1551
|
}, z.core.$strict>], "type">>;
|
|
1442
1552
|
promptChanged: z.ZodBoolean;
|
|
1443
1553
|
metadataOnly: z.ZodBoolean;
|
|
1554
|
+
dependencyConflicts: z.ZodOptional<z.ZodObject<{
|
|
1555
|
+
added: z.ZodArray<z.ZodObject<{
|
|
1556
|
+
itemId: z.ZodString;
|
|
1557
|
+
before: z.ZodEnum<{
|
|
1558
|
+
satisfied: "satisfied";
|
|
1559
|
+
waiting: "waiting";
|
|
1560
|
+
"dependency-conflict": "dependency-conflict";
|
|
1561
|
+
absent: "absent";
|
|
1562
|
+
}>;
|
|
1563
|
+
after: z.ZodEnum<{
|
|
1564
|
+
satisfied: "satisfied";
|
|
1565
|
+
waiting: "waiting";
|
|
1566
|
+
"dependency-conflict": "dependency-conflict";
|
|
1567
|
+
}>;
|
|
1568
|
+
beforeConflicts: z.ZodNumber;
|
|
1569
|
+
afterConflicts: z.ZodNumber;
|
|
1570
|
+
}, z.core.$strict>>;
|
|
1571
|
+
worsened: z.ZodArray<z.ZodObject<{
|
|
1572
|
+
itemId: z.ZodString;
|
|
1573
|
+
before: z.ZodEnum<{
|
|
1574
|
+
satisfied: "satisfied";
|
|
1575
|
+
waiting: "waiting";
|
|
1576
|
+
"dependency-conflict": "dependency-conflict";
|
|
1577
|
+
absent: "absent";
|
|
1578
|
+
}>;
|
|
1579
|
+
after: z.ZodEnum<{
|
|
1580
|
+
satisfied: "satisfied";
|
|
1581
|
+
waiting: "waiting";
|
|
1582
|
+
"dependency-conflict": "dependency-conflict";
|
|
1583
|
+
}>;
|
|
1584
|
+
beforeConflicts: z.ZodNumber;
|
|
1585
|
+
afterConflicts: z.ZodNumber;
|
|
1586
|
+
}, z.core.$strict>>;
|
|
1587
|
+
}, z.core.$strict>>;
|
|
1444
1588
|
}, z.core.$strict>, z.ZodObject<{
|
|
1445
1589
|
ok: z.ZodLiteral<false>;
|
|
1446
1590
|
code: z.ZodEnum<{
|
|
@@ -3630,6 +3774,13 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
3630
3774
|
readonly requests: readonly CharterValidatorRequest[];
|
|
3631
3775
|
}) => Promise<RemoteResult<CharterValidatorRunResult>>;
|
|
3632
3776
|
'charter/queryMessages': (sessionId: SessionId) => Promise<RemoteResult<CharterMessageListResult>>;
|
|
3777
|
+
'charter/listArchives': (request: {
|
|
3778
|
+
readonly sessionId: SessionId;
|
|
3779
|
+
}) => Promise<RemoteResult<import('../host/types.js').CharterArchiveListResult>>;
|
|
3780
|
+
'charter/readArchive': (request: {
|
|
3781
|
+
readonly sessionId: SessionId;
|
|
3782
|
+
readonly key: string;
|
|
3783
|
+
}) => Promise<RemoteResult<import('../host/types.js').CharterArchiveReadResult>>;
|
|
3633
3784
|
'charter/proposeMessage': (request: import('../host/types.js').CharterMessageProposalOptions & {
|
|
3634
3785
|
readonly sessionId: SessionId;
|
|
3635
3786
|
}) => Promise<RemoteResult<CharterEditResult>>;
|
|
@@ -3661,6 +3812,13 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
3661
3812
|
proposeMessage: (request: import('../host/types.js').CharterMessageProposalOptions & {
|
|
3662
3813
|
readonly sessionId: SessionId;
|
|
3663
3814
|
}) => Promise<RemoteResult<CharterEditResult>>;
|
|
3815
|
+
listArchives: (request: {
|
|
3816
|
+
readonly sessionId: SessionId;
|
|
3817
|
+
}) => Promise<RemoteResult<import('../host/types.js').CharterArchiveListResult>>;
|
|
3818
|
+
readArchive: (request: {
|
|
3819
|
+
readonly sessionId: SessionId;
|
|
3820
|
+
readonly key: string;
|
|
3821
|
+
}) => Promise<RemoteResult<import('../host/types.js').CharterArchiveReadResult>>;
|
|
3664
3822
|
previewChangeSet: (request: CharterEditRequest) => Promise<RemoteResult<CharterChangeSetPreviewResult>>;
|
|
3665
3823
|
edit: (request: CharterEditRequest) => Promise<RemoteResult<CharterEditResult>>;
|
|
3666
3824
|
applyBootstrap: (request: CharterBootstrapApplyRequest) => Promise<RemoteResult<CharterEditResult>>;
|