@agnt-sdk/simon-server 0.0.0-stage → 0.1.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 (78) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +12 -0
  3. package/README.md +317 -2
  4. package/dist/account.d.ts +59 -0
  5. package/dist/account.js +244 -0
  6. package/dist/auth.d.ts +42 -0
  7. package/dist/auth.js +96 -0
  8. package/dist/config.d.ts +219 -0
  9. package/dist/config.js +300 -0
  10. package/dist/context.d.ts +57 -0
  11. package/dist/context.js +2 -0
  12. package/dist/continuity.d.ts +35 -0
  13. package/dist/continuity.js +74 -0
  14. package/dist/deliver.d.ts +22 -0
  15. package/dist/deliver.js +208 -0
  16. package/dist/errors.d.ts +11 -0
  17. package/dist/errors.js +11 -0
  18. package/dist/extensions.d.ts +216 -0
  19. package/dist/extensions.js +75 -0
  20. package/dist/fanout.d.ts +32 -0
  21. package/dist/fanout.js +79 -0
  22. package/dist/http.d.ts +69 -0
  23. package/dist/http.js +112 -0
  24. package/dist/index.d.ts +15 -0
  25. package/dist/index.js +12 -0
  26. package/dist/main.d.ts +2 -0
  27. package/dist/main.js +41 -0
  28. package/dist/net/dns.d.ts +31 -0
  29. package/dist/net/dns.js +100 -0
  30. package/dist/net/fetch.d.ts +48 -0
  31. package/dist/net/fetch.js +173 -0
  32. package/dist/net/ip.d.ts +38 -0
  33. package/dist/net/ip.js +159 -0
  34. package/dist/net/psl.d.ts +22 -0
  35. package/dist/net/psl.js +91 -0
  36. package/dist/net/public-suffixes.d.ts +10 -0
  37. package/dist/net/public-suffixes.js +6885 -0
  38. package/dist/notice.d.ts +5 -0
  39. package/dist/notice.js +61 -0
  40. package/dist/outbox.d.ts +14 -0
  41. package/dist/outbox.js +356 -0
  42. package/dist/parts.d.ts +29 -0
  43. package/dist/parts.js +443 -0
  44. package/dist/public.d.ts +43 -0
  45. package/dist/public.js +134 -0
  46. package/dist/published.d.ts +3 -0
  47. package/dist/published.js +140 -0
  48. package/dist/rate.d.ts +28 -0
  49. package/dist/rate.js +77 -0
  50. package/dist/readers.d.ts +31 -0
  51. package/dist/readers.js +48 -0
  52. package/dist/register.d.ts +4 -0
  53. package/dist/register.js +401 -0
  54. package/dist/resolver.d.ts +140 -0
  55. package/dist/resolver.js +386 -0
  56. package/dist/send.d.ts +30 -0
  57. package/dist/send.js +216 -0
  58. package/dist/server.d.ts +52 -0
  59. package/dist/server.js +234 -0
  60. package/dist/signal.d.ts +5 -0
  61. package/dist/signal.js +137 -0
  62. package/dist/store/contract.d.ts +4 -0
  63. package/dist/store/contract.js +1177 -0
  64. package/dist/store/sqlite-migration.d.ts +82 -0
  65. package/dist/store/sqlite-migration.js +1019 -0
  66. package/dist/store/sqlite.d.ts +108 -0
  67. package/dist/store/sqlite.js +992 -0
  68. package/dist/store/store.d.ts +400 -0
  69. package/dist/store/store.js +23 -0
  70. package/dist/sync.d.ts +19 -0
  71. package/dist/sync.js +199 -0
  72. package/dist/testing.d.ts +38 -0
  73. package/dist/testing.js +87 -0
  74. package/dist/webhooks.d.ts +10 -0
  75. package/dist/webhooks.js +162 -0
  76. package/dist/worker.d.ts +15 -0
  77. package/dist/worker.js +33 -0
  78. package/package.json +57 -4
@@ -0,0 +1,82 @@
1
+ import { DatabaseSync } from 'node:sqlite';
2
+ import { type RetractionCapacity } from './store.ts';
3
+ type Stage = 'SNAPSHOTTED' | 'PREFLIGHT_OK' | 'COPIED' | 'VERIFIED';
4
+ export declare class SqliteMigrationRefusal extends Error {
5
+ readonly code: string;
6
+ constructor(code: string);
7
+ }
8
+ /**
9
+ * The bundle's `004-VERIFIED.json` is durable, but releasing the source handles/writer exclusions failed
10
+ * afterwards. Not a refusal: the bundle keeps its single VERIFIED meaning and carries no REFUSED marker.
11
+ */
12
+ export declare class SqliteV2CleanupFailure extends Error {
13
+ readonly code = "cleanup_failed";
14
+ readonly candidate: SqliteV2Candidate;
15
+ constructor(candidate: SqliteV2Candidate);
16
+ }
17
+ declare function ledger(db: DatabaseSync, tables: readonly string[]): {
18
+ [k: string]: {
19
+ count: number;
20
+ orderedRowHashes: string[];
21
+ digest: string;
22
+ };
23
+ };
24
+ export interface SqliteV2CandidateOptions {
25
+ /** Existing actual schema2 file; its app-arrivals.sqlite cohort is required beside it. */
26
+ source: string;
27
+ /** Fresh private bundle directory; no existing unrelated directory or target is overwritten. */
28
+ directory: string;
29
+ /** Private external maintenance/drain attestation, including the still-held host fence. */
30
+ maintenanceFile: string;
31
+ retractions?: Partial<RetractionCapacity>;
32
+ /** Synthetic fault injection only; never a CLI argument or a promotion hook. */
33
+ afterStage?: (stage: Stage) => void;
34
+ /** Synthetic failure points inside conversion (`cleanup`: releasing the source handles), absent from the CLI. */
35
+ faultAt?: 'copy-row' | 'bootstrap' | 'verify' | 'cleanup';
36
+ }
37
+ export interface SqliteV2Candidate {
38
+ status: 'VERIFIED_COPY_HELD';
39
+ activationBlocked: true;
40
+ holds: string[];
41
+ bundleId: string;
42
+ maintenanceDigest: string;
43
+ origin: string;
44
+ serverKeyFingerprint: string;
45
+ configDigest: string;
46
+ toolCommit: string;
47
+ retractionLimits: RetractionCapacity;
48
+ observation: {
49
+ at: string;
50
+ provenance: string;
51
+ previous?: string;
52
+ };
53
+ sourcePaths: {
54
+ core: string;
55
+ outbox: string;
56
+ };
57
+ source: {
58
+ core: ReturnType<typeof ledger>;
59
+ outbox: ReturnType<typeof ledger>;
60
+ };
61
+ snapshots: {
62
+ core: string;
63
+ outbox: string;
64
+ };
65
+ candidate: {
66
+ core: string;
67
+ outbox: string;
68
+ };
69
+ hashes: Record<string, string>;
70
+ highWatermark: number;
71
+ usableHeadroom: number;
72
+ archivedTombstones: string[];
73
+ generations: Record<string, string>;
74
+ noOperationalPromotion: true;
75
+ }
76
+ /**
77
+ * The maintenance attestation is an operator prerequisite, not proof that arbitrary external processes
78
+ * stopped. Both actual SQLite writer locks are acquired before either snapshot; the host fence must
79
+ * remain owned/respected outside this command. Output never selects an operational database path.
80
+ */
81
+ export declare function createSqliteV2Candidate(options: SqliteV2CandidateOptions): Promise<SqliteV2Candidate>;
82
+ export {};