doxum 0.1.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/LICENSE +21 -0
- package/README.md +218 -0
- package/dist/chunk-pbuEa-1d.js +13 -0
- package/dist/contract-DwNiKioc.d.ts +480 -0
- package/dist/contract-Otb5W6cQ.d.cts +480 -0
- package/dist/dependency-BdEMyquf.js +735 -0
- package/dist/dependency-BdEMyquf.js.map +1 -0
- package/dist/dependency-DLcCvNKq.cjs +1015 -0
- package/dist/dependency-DLcCvNKq.cjs.map +1 -0
- package/dist/index.cjs +2718 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +89 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +2689 -0
- package/dist/index.js.map +1 -0
- package/dist/integration.cjs +15 -0
- package/dist/integration.cjs.map +1 -0
- package/dist/integration.d.cts +11 -0
- package/dist/integration.d.ts +11 -0
- package/dist/integration.js +14 -0
- package/dist/integration.js.map +1 -0
- package/dist/react.cjs +99 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +16 -0
- package/dist/react.d.ts +16 -0
- package/dist/react.js +96 -0
- package/dist/react.js.map +1 -0
- package/package.json +89 -0
- package/skills/doxum-runtime/SKILL.md +51 -0
- package/skills/doxum-runtime/agents/openai.yaml +4 -0
- package/skills/doxum-runtime/references/guide.en.md +295 -0
- package/skills/doxum-runtime/references/guide.zh-CN.md +240 -0
- package/skills/doxum-runtime/references/invariants.en.md +147 -0
- package/skills/doxum-runtime/references/invariants.zh-CN.md +97 -0
- package/skills/doxum-runtime/references/patterns.en.md +287 -0
- package/skills/doxum-runtime/references/patterns.zh-CN.md +240 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { $ as ListInsertOperation, A as ListWriter, At as TableNode, B as TreeReader, Bt as optional, C as MutationIssue, Ct as ObjectNode, D as DocumentWriter, Dt as RecordNode, E as DictionaryWriter, Et as ReadonlyDocument, F as DocumentReader, Ft as dict, G as DocumentOperation, Gt as tree, H as DictReplaceOperation, Ht as schema, I as EntityReader, It as field, J as EntityEntry, K as DocumentOperationUnion, Kt as variant, L as FieldReader, Lt as list, M as TreeWriter, Mt as ValueSelector, N as WriterOfNode, Nt as VariantNode, O as EntityWriter, Ot as SchemaPath, P as CollectionReader, Pt as VariantShape, Q as FieldSetOperation, R as ListReader, Rt as map, S as DocumentImpact, St as MapNode, T as CollectionWriter, Tt as OptionalNode, U as DictSetOperation, Ut as single, V as DictDeleteOperation, Vt as record, W as DocumentAnchor, Wt as table, X as EntityRemoveOperation, Y as EntityMoveOperation, Z as FieldClearOperation, _ as debugKey, _t as DocumentValueOfNode, a as DocumentProblem, at as TreeRemoveOperation, b as resolveAddress, bt as ImpactTarget, c as DocumentTransaction, ct as VariantReplaceOperation, d as ObserverError, dt as DocumentAddress, et as ListMoveOperation, f as OperationResult, ft as DocumentListConfig, g as contains, gt as DocumentTreeValue, h as AddressRef, ht as DocumentTreeNode, i as DocumentDisposedError, it as TreeMoveOperation, j as MapWriter, jt as TreeNode, k as FieldWriter, kt as SingleNode, l as HistoryState, lt as CollectionSelector, m as Unsubscribe, mt as DocumentSchema, n as DocumentCommit, nt as ListReplaceOperation, o as DocumentReentrancyError, ot as TreeReplaceOperation, p as TransactionResult, pt as DocumentNode, q as EntityCreateOperation, r as DocumentDiagnostic, rt as TreeInsertOperation, s as DocumentRuntime, st as TreeSetOperation, t as CommitSource, tt as ListRemoveOperation, u as LocalHistory, ut as DictNode, v as overlaps, vt as DocumentValueOfShape, w as MutationIssueCode, wt as ObjectShape, x as CollectionImpact, xt as ListNode, y as read, yt as FieldNode, z as ReaderOfNode, zt as object } from "./contract-Otb5W6cQ.cjs";
|
|
2
|
+
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region core/src/runtime.d.ts
|
|
6
|
+
declare const createDocument: <TSchema extends DocumentSchema>(input: {
|
|
7
|
+
readonly schema: TSchema;
|
|
8
|
+
readonly initial: ReadonlyDocument<TSchema>;
|
|
9
|
+
readonly history?: {
|
|
10
|
+
readonly capacity?: number;
|
|
11
|
+
} | false;
|
|
12
|
+
}) => DocumentRuntime<TSchema>;
|
|
13
|
+
declare namespace impact_target_d_exports {
|
|
14
|
+
export { address, belongs, bucket, id, same };
|
|
15
|
+
}
|
|
16
|
+
declare const address: (target: ImpactTarget<unknown>) => DocumentAddress;
|
|
17
|
+
declare const id: (target: ImpactTarget<unknown>) => string | undefined;
|
|
18
|
+
declare const belongs: (target: ImpactTarget<unknown>, schema: DocumentSchema) => boolean;
|
|
19
|
+
declare const same: (left: ImpactTarget<unknown>, right: ImpactTarget<unknown>) => boolean;
|
|
20
|
+
declare const bucket: (target: ImpactTarget<unknown>) => string | undefined;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region core/src/projection/readable.d.ts
|
|
23
|
+
type Readable<TValue> = {
|
|
24
|
+
current(): TValue;
|
|
25
|
+
revision(): number;
|
|
26
|
+
subscribe(listener: () => void): Unsubscribe;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region core/src/projection/select.d.ts
|
|
30
|
+
type DocumentSelector<TSchema extends DocumentSchema, TResult> = (read: DocumentReader<TSchema>) => TResult;
|
|
31
|
+
declare const select: <TSchema extends DocumentSchema, TResult>(runtime: DocumentRuntime<TSchema>, selector: DocumentSelector<TSchema, TResult>) => TResult;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region core/src/projection/collection-view.d.ts
|
|
34
|
+
type CollectionView<TId extends string, TValue> = {
|
|
35
|
+
readonly ids: Readable<readonly TId[]>;
|
|
36
|
+
readonly all: Readable<readonly TValue[]>;
|
|
37
|
+
readonly item: (id: TId) => Readable<TValue | undefined>;
|
|
38
|
+
revision(): number;
|
|
39
|
+
dispose(): void;
|
|
40
|
+
};
|
|
41
|
+
declare const createCollectionView: <TSchema extends DocumentSchema, TId extends string, TEntry, TValue>(input: {
|
|
42
|
+
readonly runtime: DocumentRuntime<TSchema>;
|
|
43
|
+
readonly source: CollectionSelector<TId, TEntry>;
|
|
44
|
+
readonly map: (id: TId, entry: EntityReader<TEntry>) => TValue;
|
|
45
|
+
readonly isEqual?: (previous: TValue, next: TValue) => boolean;
|
|
46
|
+
}) => CollectionView<TId, TValue>;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region core/src/projection/materialized-view.d.ts
|
|
49
|
+
type MaterializedSource<TValue, TChange> = {
|
|
50
|
+
readonly value: TValue;
|
|
51
|
+
readonly change: TChange | undefined;
|
|
52
|
+
};
|
|
53
|
+
type MaterializedSources = Readonly<Record<string, MaterializedView<unknown, unknown>>>;
|
|
54
|
+
type MaterializedSourceValues<TSources extends MaterializedSources> = { readonly [K in keyof TSources]: TSources[K] extends MaterializedView<infer TValue, infer TChange> ? MaterializedSource<TValue, TChange> : never };
|
|
55
|
+
type MaterializedUpdateResult<TValue, TChange> = {
|
|
56
|
+
readonly kind: 'changed';
|
|
57
|
+
readonly value: TValue;
|
|
58
|
+
readonly change: TChange;
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: 'unchanged';
|
|
61
|
+
} | {
|
|
62
|
+
readonly kind: 'rebuild';
|
|
63
|
+
};
|
|
64
|
+
type MaterializedViewUpdate<TSchema extends DocumentSchema, TSources extends MaterializedSources> = {
|
|
65
|
+
readonly read: DocumentReader<TSchema>;
|
|
66
|
+
readonly revision: number;
|
|
67
|
+
readonly source: CommitSource;
|
|
68
|
+
readonly impact: DocumentImpact<TSchema>;
|
|
69
|
+
readonly sources: MaterializedSourceValues<TSources>;
|
|
70
|
+
};
|
|
71
|
+
type MaterializedViewSpec<TSchema extends DocumentSchema, TValue, TChange, TSources extends MaterializedSources> = {
|
|
72
|
+
readonly sources?: TSources;
|
|
73
|
+
readonly build: (input: {
|
|
74
|
+
readonly read: DocumentReader<TSchema>;
|
|
75
|
+
readonly sources: MaterializedSourceValues<TSources>;
|
|
76
|
+
}) => {
|
|
77
|
+
readonly value: TValue;
|
|
78
|
+
readonly update: (update: MaterializedViewUpdate<TSchema, TSources>) => MaterializedUpdateResult<TValue, TChange>;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
type MaterializedView<TValue, TChange = void> = Readable<TValue> & {
|
|
82
|
+
readonly __change?: TChange;
|
|
83
|
+
rebuild(): void;
|
|
84
|
+
dispose(): void;
|
|
85
|
+
};
|
|
86
|
+
declare const createMaterializedView: <TSchema extends DocumentSchema, TValue, TChange = void, TSources extends MaterializedSources = {}>(runtime: DocumentRuntime<TSchema>, spec: MaterializedViewSpec<TSchema, TValue, TChange, TSources>) => MaterializedView<TValue, TChange>;
|
|
87
|
+
//#endregion
|
|
88
|
+
export { type AddressRef, type CollectionImpact, type CollectionReader, type CollectionSelector, type CollectionView, type CollectionWriter, type CommitSource, type DictDeleteOperation, type DictNode, type DictReplaceOperation, type DictSetOperation, type DictionaryWriter, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentNode, type DocumentOperation, type DocumentOperationUnion, type DocumentProblem, type DocumentReader, DocumentReentrancyError, type DocumentRuntime, type DocumentSchema, type DocumentSelector, type DocumentTransaction, type DocumentTreeNode, type DocumentTreeValue, type DocumentValueOfNode, type DocumentValueOfShape, type DocumentWriter, type EntityCreateOperation, type EntityEntry, type EntityMoveOperation, type EntityReader, type EntityRemoveOperation, type EntityWriter, type FieldClearOperation, type FieldNode, type FieldReader, type FieldSetOperation, type FieldWriter, type HistoryState, type ImpactTarget, type ListInsertOperation, type ListMoveOperation, type ListNode, type ListReader, type ListRemoveOperation, type ListReplaceOperation, type ListWriter, type LocalHistory, type MapNode, type MapWriter, type MaterializedSource, type MaterializedSourceValues, type MaterializedSources, type MaterializedUpdateResult, type MaterializedView, type MaterializedViewSpec, type MaterializedViewUpdate, type MutationIssue, type MutationIssueCode, type ObjectNode, type ObjectShape, type ObserverError, type OperationResult, type OptionalNode, type Readable, type ReaderOfNode, type ReadonlyDocument, type RecordNode, type SchemaPath, type SingleNode, type TableNode, type TransactionResult, type TreeInsertOperation, type TreeMoveOperation, type TreeNode, type TreeReader, type TreeRemoveOperation, type TreeReplaceOperation, type TreeSetOperation, type TreeWriter, type Unsubscribe, type ValueSelector, type VariantNode, type VariantReplaceOperation, type VariantShape, type WriterOfNode, contains, createCollectionView, createDocument, createMaterializedView, debugKey, dict, field, list, map, object, optional, overlaps, read as readAddress, record, resolveAddress, schema, select, single, table, impact_target_d_exports as target, tree, variant };
|
|
89
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { $ as ListInsertOperation, A as ListWriter, At as TableNode, B as TreeReader, Bt as optional, C as MutationIssue, Ct as ObjectNode, D as DocumentWriter, Dt as RecordNode, E as DictionaryWriter, Et as ReadonlyDocument, F as DocumentReader, Ft as dict, G as DocumentOperation, Gt as tree, H as DictReplaceOperation, Ht as schema, I as EntityReader, It as field, J as EntityEntry, K as DocumentOperationUnion, Kt as variant, L as FieldReader, Lt as list, M as TreeWriter, Mt as ValueSelector, N as WriterOfNode, Nt as VariantNode, O as EntityWriter, Ot as SchemaPath, P as CollectionReader, Pt as VariantShape, Q as FieldSetOperation, R as ListReader, Rt as map, S as DocumentImpact, St as MapNode, T as CollectionWriter, Tt as OptionalNode, U as DictSetOperation, Ut as single, V as DictDeleteOperation, Vt as record, W as DocumentAnchor, Wt as table, X as EntityRemoveOperation, Y as EntityMoveOperation, Z as FieldClearOperation, _ as debugKey, _t as DocumentValueOfNode, a as DocumentProblem, at as TreeRemoveOperation, b as resolveAddress, bt as ImpactTarget, c as DocumentTransaction, ct as VariantReplaceOperation, d as ObserverError, dt as DocumentAddress, et as ListMoveOperation, f as OperationResult, ft as DocumentListConfig, g as contains, gt as DocumentTreeValue, h as AddressRef, ht as DocumentTreeNode, i as DocumentDisposedError, it as TreeMoveOperation, j as MapWriter, jt as TreeNode, k as FieldWriter, kt as SingleNode, l as HistoryState, lt as CollectionSelector, m as Unsubscribe, mt as DocumentSchema, n as DocumentCommit, nt as ListReplaceOperation, o as DocumentReentrancyError, ot as TreeReplaceOperation, p as TransactionResult, pt as DocumentNode, q as EntityCreateOperation, r as DocumentDiagnostic, rt as TreeInsertOperation, s as DocumentRuntime, st as TreeSetOperation, t as CommitSource, tt as ListRemoveOperation, u as LocalHistory, ut as DictNode, v as overlaps, vt as DocumentValueOfShape, w as MutationIssueCode, wt as ObjectShape, x as CollectionImpact, xt as ListNode, y as read, yt as FieldNode, z as ReaderOfNode, zt as object } from "./contract-DwNiKioc.js";
|
|
2
|
+
|
|
3
|
+
//#region core/src/runtime.d.ts
|
|
4
|
+
declare const createDocument: <TSchema extends DocumentSchema>(input: {
|
|
5
|
+
readonly schema: TSchema;
|
|
6
|
+
readonly initial: ReadonlyDocument<TSchema>;
|
|
7
|
+
readonly history?: {
|
|
8
|
+
readonly capacity?: number;
|
|
9
|
+
} | false;
|
|
10
|
+
}) => DocumentRuntime<TSchema>;
|
|
11
|
+
declare namespace impact_target_d_exports {
|
|
12
|
+
export { address, belongs, bucket, id, same };
|
|
13
|
+
}
|
|
14
|
+
declare const address: (target: ImpactTarget<unknown>) => DocumentAddress;
|
|
15
|
+
declare const id: (target: ImpactTarget<unknown>) => string | undefined;
|
|
16
|
+
declare const belongs: (target: ImpactTarget<unknown>, schema: DocumentSchema) => boolean;
|
|
17
|
+
declare const same: (left: ImpactTarget<unknown>, right: ImpactTarget<unknown>) => boolean;
|
|
18
|
+
declare const bucket: (target: ImpactTarget<unknown>) => string | undefined;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region core/src/projection/readable.d.ts
|
|
21
|
+
type Readable<TValue> = {
|
|
22
|
+
current(): TValue;
|
|
23
|
+
revision(): number;
|
|
24
|
+
subscribe(listener: () => void): Unsubscribe;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region core/src/projection/select.d.ts
|
|
28
|
+
type DocumentSelector<TSchema extends DocumentSchema, TResult> = (read: DocumentReader<TSchema>) => TResult;
|
|
29
|
+
declare const select: <TSchema extends DocumentSchema, TResult>(runtime: DocumentRuntime<TSchema>, selector: DocumentSelector<TSchema, TResult>) => TResult;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region core/src/projection/collection-view.d.ts
|
|
32
|
+
type CollectionView<TId extends string, TValue> = {
|
|
33
|
+
readonly ids: Readable<readonly TId[]>;
|
|
34
|
+
readonly all: Readable<readonly TValue[]>;
|
|
35
|
+
readonly item: (id: TId) => Readable<TValue | undefined>;
|
|
36
|
+
revision(): number;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
};
|
|
39
|
+
declare const createCollectionView: <TSchema extends DocumentSchema, TId extends string, TEntry, TValue>(input: {
|
|
40
|
+
readonly runtime: DocumentRuntime<TSchema>;
|
|
41
|
+
readonly source: CollectionSelector<TId, TEntry>;
|
|
42
|
+
readonly map: (id: TId, entry: EntityReader<TEntry>) => TValue;
|
|
43
|
+
readonly isEqual?: (previous: TValue, next: TValue) => boolean;
|
|
44
|
+
}) => CollectionView<TId, TValue>;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region core/src/projection/materialized-view.d.ts
|
|
47
|
+
type MaterializedSource<TValue, TChange> = {
|
|
48
|
+
readonly value: TValue;
|
|
49
|
+
readonly change: TChange | undefined;
|
|
50
|
+
};
|
|
51
|
+
type MaterializedSources = Readonly<Record<string, MaterializedView<unknown, unknown>>>;
|
|
52
|
+
type MaterializedSourceValues<TSources extends MaterializedSources> = { readonly [K in keyof TSources]: TSources[K] extends MaterializedView<infer TValue, infer TChange> ? MaterializedSource<TValue, TChange> : never };
|
|
53
|
+
type MaterializedUpdateResult<TValue, TChange> = {
|
|
54
|
+
readonly kind: 'changed';
|
|
55
|
+
readonly value: TValue;
|
|
56
|
+
readonly change: TChange;
|
|
57
|
+
} | {
|
|
58
|
+
readonly kind: 'unchanged';
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: 'rebuild';
|
|
61
|
+
};
|
|
62
|
+
type MaterializedViewUpdate<TSchema extends DocumentSchema, TSources extends MaterializedSources> = {
|
|
63
|
+
readonly read: DocumentReader<TSchema>;
|
|
64
|
+
readonly revision: number;
|
|
65
|
+
readonly source: CommitSource;
|
|
66
|
+
readonly impact: DocumentImpact<TSchema>;
|
|
67
|
+
readonly sources: MaterializedSourceValues<TSources>;
|
|
68
|
+
};
|
|
69
|
+
type MaterializedViewSpec<TSchema extends DocumentSchema, TValue, TChange, TSources extends MaterializedSources> = {
|
|
70
|
+
readonly sources?: TSources;
|
|
71
|
+
readonly build: (input: {
|
|
72
|
+
readonly read: DocumentReader<TSchema>;
|
|
73
|
+
readonly sources: MaterializedSourceValues<TSources>;
|
|
74
|
+
}) => {
|
|
75
|
+
readonly value: TValue;
|
|
76
|
+
readonly update: (update: MaterializedViewUpdate<TSchema, TSources>) => MaterializedUpdateResult<TValue, TChange>;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
type MaterializedView<TValue, TChange = void> = Readable<TValue> & {
|
|
80
|
+
readonly __change?: TChange;
|
|
81
|
+
rebuild(): void;
|
|
82
|
+
dispose(): void;
|
|
83
|
+
};
|
|
84
|
+
declare const createMaterializedView: <TSchema extends DocumentSchema, TValue, TChange = void, TSources extends MaterializedSources = {}>(runtime: DocumentRuntime<TSchema>, spec: MaterializedViewSpec<TSchema, TValue, TChange, TSources>) => MaterializedView<TValue, TChange>;
|
|
85
|
+
//#endregion
|
|
86
|
+
export { type AddressRef, type CollectionImpact, type CollectionReader, type CollectionSelector, type CollectionView, type CollectionWriter, type CommitSource, type DictDeleteOperation, type DictNode, type DictReplaceOperation, type DictSetOperation, type DictionaryWriter, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentNode, type DocumentOperation, type DocumentOperationUnion, type DocumentProblem, type DocumentReader, DocumentReentrancyError, type DocumentRuntime, type DocumentSchema, type DocumentSelector, type DocumentTransaction, type DocumentTreeNode, type DocumentTreeValue, type DocumentValueOfNode, type DocumentValueOfShape, type DocumentWriter, type EntityCreateOperation, type EntityEntry, type EntityMoveOperation, type EntityReader, type EntityRemoveOperation, type EntityWriter, type FieldClearOperation, type FieldNode, type FieldReader, type FieldSetOperation, type FieldWriter, type HistoryState, type ImpactTarget, type ListInsertOperation, type ListMoveOperation, type ListNode, type ListReader, type ListRemoveOperation, type ListReplaceOperation, type ListWriter, type LocalHistory, type MapNode, type MapWriter, type MaterializedSource, type MaterializedSourceValues, type MaterializedSources, type MaterializedUpdateResult, type MaterializedView, type MaterializedViewSpec, type MaterializedViewUpdate, type MutationIssue, type MutationIssueCode, type ObjectNode, type ObjectShape, type ObserverError, type OperationResult, type OptionalNode, type Readable, type ReaderOfNode, type ReadonlyDocument, type RecordNode, type SchemaPath, type SingleNode, type TableNode, type TransactionResult, type TreeInsertOperation, type TreeMoveOperation, type TreeNode, type TreeReader, type TreeRemoveOperation, type TreeReplaceOperation, type TreeSetOperation, type TreeWriter, type Unsubscribe, type ValueSelector, type VariantNode, type VariantReplaceOperation, type VariantShape, type WriterOfNode, contains, createCollectionView, createDocument, createMaterializedView, debugKey, dict, field, list, map, object, optional, overlaps, read as readAddress, record, resolveAddress, schema, select, single, table, impact_target_d_exports as target, tree, variant };
|
|
87
|
+
//# sourceMappingURL=index.d.ts.map
|