@graphrefly/ts 0.0.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 (210) hide show
  1. package/LICENSE +21 -0
  2. package/dist/adapters/index.cjs +9015 -0
  3. package/dist/adapters/index.cjs.map +1 -0
  4. package/dist/adapters/index.d.cts +678 -0
  5. package/dist/adapters/index.d.ts +678 -0
  6. package/dist/adapters/index.js +2894 -0
  7. package/dist/adapters/index.js.map +1 -0
  8. package/dist/adapters/observe-storage.cjs +260 -0
  9. package/dist/adapters/observe-storage.cjs.map +1 -0
  10. package/dist/adapters/observe-storage.d.cts +77 -0
  11. package/dist/adapters/observe-storage.d.ts +77 -0
  12. package/dist/adapters/observe-storage.js +161 -0
  13. package/dist/adapters/observe-storage.js.map +1 -0
  14. package/dist/append-log-DisvEReb.d.cts +189 -0
  15. package/dist/append-log-DzKMmjxx.d.ts +189 -0
  16. package/dist/chunk-2ILL7HQI.js +1189 -0
  17. package/dist/chunk-2ILL7HQI.js.map +1 -0
  18. package/dist/chunk-4VLAQHZI.js +330 -0
  19. package/dist/chunk-4VLAQHZI.js.map +1 -0
  20. package/dist/chunk-6PHB5CJS.js +229 -0
  21. package/dist/chunk-6PHB5CJS.js.map +1 -0
  22. package/dist/chunk-COHO25CZ.js +2449 -0
  23. package/dist/chunk-COHO25CZ.js.map +1 -0
  24. package/dist/chunk-D6BG7U6A.js +161 -0
  25. package/dist/chunk-D6BG7U6A.js.map +1 -0
  26. package/dist/chunk-DJC4CHLQ.js +818 -0
  27. package/dist/chunk-DJC4CHLQ.js.map +1 -0
  28. package/dist/chunk-DK554R7P.js +67 -0
  29. package/dist/chunk-DK554R7P.js.map +1 -0
  30. package/dist/chunk-DKP56CSW.js +322 -0
  31. package/dist/chunk-DKP56CSW.js.map +1 -0
  32. package/dist/chunk-G4M3NHRJ.js +688 -0
  33. package/dist/chunk-G4M3NHRJ.js.map +1 -0
  34. package/dist/chunk-GAJW5I5P.js +1 -0
  35. package/dist/chunk-GAJW5I5P.js.map +1 -0
  36. package/dist/chunk-GDL26N2T.js +282 -0
  37. package/dist/chunk-GDL26N2T.js.map +1 -0
  38. package/dist/chunk-GTPCOEOZ.js +741 -0
  39. package/dist/chunk-GTPCOEOZ.js.map +1 -0
  40. package/dist/chunk-H2HTHFVN.js +1 -0
  41. package/dist/chunk-H2HTHFVN.js.map +1 -0
  42. package/dist/chunk-HDRL4VQQ.js +218 -0
  43. package/dist/chunk-HDRL4VQQ.js.map +1 -0
  44. package/dist/chunk-I3IHOHCJ.js +2267 -0
  45. package/dist/chunk-I3IHOHCJ.js.map +1 -0
  46. package/dist/chunk-JIMUDQN3.js +965 -0
  47. package/dist/chunk-JIMUDQN3.js.map +1 -0
  48. package/dist/chunk-JR4IKCR2.js +462 -0
  49. package/dist/chunk-JR4IKCR2.js.map +1 -0
  50. package/dist/chunk-K3FXTC3I.js +165 -0
  51. package/dist/chunk-K3FXTC3I.js.map +1 -0
  52. package/dist/chunk-OOEN33FB.js +65 -0
  53. package/dist/chunk-OOEN33FB.js.map +1 -0
  54. package/dist/chunk-PKVBHGBM.js +554 -0
  55. package/dist/chunk-PKVBHGBM.js.map +1 -0
  56. package/dist/chunk-RIIOUTGM.js +1857 -0
  57. package/dist/chunk-RIIOUTGM.js.map +1 -0
  58. package/dist/chunk-SCRFRCGR.js +33 -0
  59. package/dist/chunk-SCRFRCGR.js.map +1 -0
  60. package/dist/chunk-SWTLEQL6.js +53 -0
  61. package/dist/chunk-SWTLEQL6.js.map +1 -0
  62. package/dist/chunk-SZAETNNA.js +1 -0
  63. package/dist/chunk-SZAETNNA.js.map +1 -0
  64. package/dist/chunk-TEW47IVR.js +49 -0
  65. package/dist/chunk-TEW47IVR.js.map +1 -0
  66. package/dist/chunk-Y3ZLRGHC.js +1482 -0
  67. package/dist/chunk-Y3ZLRGHC.js.map +1 -0
  68. package/dist/chunk-Z2ANQ6JW.js +149 -0
  69. package/dist/chunk-Z2ANQ6JW.js.map +1 -0
  70. package/dist/codec-BB7p8fJc.d.cts +38 -0
  71. package/dist/codec-BB7p8fJc.d.ts +38 -0
  72. package/dist/composition/index.cjs +2505 -0
  73. package/dist/composition/index.cjs.map +1 -0
  74. package/dist/composition/index.d.cts +95 -0
  75. package/dist/composition/index.d.ts +95 -0
  76. package/dist/composition/index.js +19 -0
  77. package/dist/composition/index.js.map +1 -0
  78. package/dist/core/index.cjs +2475 -0
  79. package/dist/core/index.cjs.map +1 -0
  80. package/dist/core/index.d.cts +25 -0
  81. package/dist/core/index.d.ts +25 -0
  82. package/dist/core/index.js +74 -0
  83. package/dist/core/index.js.map +1 -0
  84. package/dist/cqrs/index.cjs +595 -0
  85. package/dist/cqrs/index.cjs.map +1 -0
  86. package/dist/cqrs/index.d.cts +200 -0
  87. package/dist/cqrs/index.d.ts +200 -0
  88. package/dist/cqrs/index.js +557 -0
  89. package/dist/cqrs/index.js.map +1 -0
  90. package/dist/data-structures/index.cjs +4277 -0
  91. package/dist/data-structures/index.cjs.map +1 -0
  92. package/dist/data-structures/index.d.cts +22 -0
  93. package/dist/data-structures/index.d.ts +22 -0
  94. package/dist/data-structures/index.js +31 -0
  95. package/dist/data-structures/index.js.map +1 -0
  96. package/dist/describe-BZb7AS2y.d.ts +57 -0
  97. package/dist/describe-Ciu8SUnN.d.cts +57 -0
  98. package/dist/graph/index.cjs +7832 -0
  99. package/dist/graph/index.cjs.map +1 -0
  100. package/dist/graph/index.d.cts +251 -0
  101. package/dist/graph/index.d.ts +251 -0
  102. package/dist/graph/index.js +131 -0
  103. package/dist/graph/index.js.map +1 -0
  104. package/dist/graph-DfdF9zy4.d.ts +666 -0
  105. package/dist/graph-s23RbbFO.d.cts +666 -0
  106. package/dist/index-CAEmLCYF.d.cts +166 -0
  107. package/dist/index-SnzZu3x7.d.ts +166 -0
  108. package/dist/index.cjs +15409 -0
  109. package/dist/index.cjs.map +1 -0
  110. package/dist/index.d.cts +23 -0
  111. package/dist/index.d.ts +23 -0
  112. package/dist/index.js +582 -0
  113. package/dist/index.js.map +1 -0
  114. package/dist/messages-BZqrGGm1.d.cts +55 -0
  115. package/dist/messages-BZqrGGm1.d.ts +55 -0
  116. package/dist/messaging/index.cjs +818 -0
  117. package/dist/messaging/index.cjs.map +1 -0
  118. package/dist/messaging/index.d.cts +235 -0
  119. package/dist/messaging/index.d.ts +235 -0
  120. package/dist/messaging/index.js +767 -0
  121. package/dist/messaging/index.js.map +1 -0
  122. package/dist/observe-event-log-0SVsx7JG.d.cts +88 -0
  123. package/dist/observe-event-log-Dnm76owp.d.ts +88 -0
  124. package/dist/operators/index.cjs +3774 -0
  125. package/dist/operators/index.cjs.map +1 -0
  126. package/dist/operators/index.d.cts +308 -0
  127. package/dist/operators/index.d.ts +308 -0
  128. package/dist/operators/index.js +112 -0
  129. package/dist/operators/index.js.map +1 -0
  130. package/dist/orchestration/index.cjs +3541 -0
  131. package/dist/orchestration/index.cjs.map +1 -0
  132. package/dist/orchestration/index.d.cts +302 -0
  133. package/dist/orchestration/index.d.ts +302 -0
  134. package/dist/orchestration/index.js +1004 -0
  135. package/dist/orchestration/index.js.map +1 -0
  136. package/dist/patterns/index.cjs +1045 -0
  137. package/dist/patterns/index.cjs.map +1 -0
  138. package/dist/patterns/index.d.cts +39 -0
  139. package/dist/patterns/index.d.ts +39 -0
  140. package/dist/patterns/index.js +33 -0
  141. package/dist/patterns/index.js.map +1 -0
  142. package/dist/reactive-collection-BxBqtIOE.d.cts +344 -0
  143. package/dist/reactive-collection-Cb1II1Fi.d.ts +344 -0
  144. package/dist/reactive-collection-storage-BNiEc-Gd.d.ts +217 -0
  145. package/dist/reactive-collection-storage-D-KmjE0J.d.cts +217 -0
  146. package/dist/reactive-map-BcB4KsQR.d.ts +256 -0
  147. package/dist/reactive-map-D-g3dv8I.d.cts +256 -0
  148. package/dist/read-through-B1CYPfq_.d.cts +82 -0
  149. package/dist/read-through-DwyJhGs1.d.ts +82 -0
  150. package/dist/render/index.cjs +250 -0
  151. package/dist/render/index.cjs.map +1 -0
  152. package/dist/render/index.d.cts +58 -0
  153. package/dist/render/index.d.ts +58 -0
  154. package/dist/render/index.js +20 -0
  155. package/dist/render/index.js.map +1 -0
  156. package/dist/resilience-Dig3Q7n0.d.cts +45 -0
  157. package/dist/resilience-Dig3Q7n0.d.ts +45 -0
  158. package/dist/semantic-memory-graph-BYoIlP35.d.cts +356 -0
  159. package/dist/semantic-memory-graph-CxyXLms3.d.ts +356 -0
  160. package/dist/solutions/index.cjs +3249 -0
  161. package/dist/solutions/index.cjs.map +1 -0
  162. package/dist/solutions/index.d.cts +520 -0
  163. package/dist/solutions/index.d.ts +520 -0
  164. package/dist/solutions/index.js +31 -0
  165. package/dist/solutions/index.js.map +1 -0
  166. package/dist/sources/browser.cjs +3095 -0
  167. package/dist/sources/browser.cjs.map +1 -0
  168. package/dist/sources/browser.d.cts +39 -0
  169. package/dist/sources/browser.d.ts +39 -0
  170. package/dist/sources/browser.js +137 -0
  171. package/dist/sources/browser.js.map +1 -0
  172. package/dist/sources/index.cjs +3021 -0
  173. package/dist/sources/index.cjs.map +1 -0
  174. package/dist/sources/index.d.cts +7 -0
  175. package/dist/sources/index.d.ts +7 -0
  176. package/dist/sources/index.js +63 -0
  177. package/dist/sources/index.js.map +1 -0
  178. package/dist/sources/node.cjs +675 -0
  179. package/dist/sources/node.cjs.map +1 -0
  180. package/dist/sources/node.d.cts +109 -0
  181. package/dist/sources/node.d.ts +109 -0
  182. package/dist/sources/node.js +639 -0
  183. package/dist/sources/node.js.map +1 -0
  184. package/dist/storage/browser.cjs +777 -0
  185. package/dist/storage/browser.cjs.map +1 -0
  186. package/dist/storage/browser.d.cts +40 -0
  187. package/dist/storage/browser.d.ts +40 -0
  188. package/dist/storage/browser.js +275 -0
  189. package/dist/storage/browser.js.map +1 -0
  190. package/dist/storage/index.cjs +1989 -0
  191. package/dist/storage/index.cjs.map +1 -0
  192. package/dist/storage/index.d.cts +92 -0
  193. package/dist/storage/index.d.ts +92 -0
  194. package/dist/storage/index.js +161 -0
  195. package/dist/storage/index.js.map +1 -0
  196. package/dist/storage/node.cjs +898 -0
  197. package/dist/storage/node.cjs.map +1 -0
  198. package/dist/storage/node.d.cts +66 -0
  199. package/dist/storage/node.d.ts +66 -0
  200. package/dist/storage/node.js +402 -0
  201. package/dist/storage/node.js.map +1 -0
  202. package/dist/testing/index.cjs +95 -0
  203. package/dist/testing/index.cjs.map +1 -0
  204. package/dist/testing/index.d.cts +20 -0
  205. package/dist/testing/index.d.ts +20 -0
  206. package/dist/testing/index.js +8 -0
  207. package/dist/testing/index.js.map +1 -0
  208. package/dist/types-bNMSWKqF.d.cts +732 -0
  209. package/dist/types-h12mNYbq.d.ts +732 -0
  210. package/package.json +250 -0
@@ -0,0 +1,235 @@
1
+ import { d as Graph } from '../graph-DfdF9zy4.js';
2
+ import { N as Node } from '../types-h12mNYbq.js';
3
+ import '../core/index.js';
4
+ import '../messages-BZqrGGm1.js';
5
+ import '../codec-BB7p8fJc.js';
6
+ import '../describe-BZb7AS2y.js';
7
+
8
+ /**
9
+ * Reusable application-infrastructure messaging namespace.
10
+ *
11
+ * Retained root messaging utilities land here only after B63 re-derives them
12
+ * onto the D125 package DAG.
13
+ */
14
+
15
+ interface MessageEnvelope<T = unknown> {
16
+ readonly topic: string;
17
+ readonly seq: number;
18
+ readonly payload: T;
19
+ readonly key?: string;
20
+ readonly timestampMs: number;
21
+ }
22
+ /**
23
+ * Minimal JSON Schema vocabulary for cross-graph/topic payload descriptions.
24
+ *
25
+ * D125/D132 keep this as passive messaging vocabulary: GraphReFly does not ship
26
+ * a validator here and does not make schemas protocol messages.
27
+ */
28
+ interface JsonSchema {
29
+ readonly type?: "string" | "number" | "integer" | "boolean" | "object" | "array" | "null" | readonly ("string" | "number" | "integer" | "boolean" | "object" | "array" | "null")[];
30
+ readonly properties?: Readonly<Record<string, JsonSchema>>;
31
+ readonly required?: readonly string[];
32
+ readonly additionalProperties?: boolean | JsonSchema;
33
+ readonly items?: JsonSchema | readonly JsonSchema[];
34
+ readonly enum?: readonly unknown[];
35
+ readonly const?: unknown;
36
+ readonly $ref?: string;
37
+ readonly definitions?: Readonly<Record<string, JsonSchema>>;
38
+ readonly description?: string;
39
+ readonly title?: string;
40
+ }
41
+ /**
42
+ * Recommended passive envelope for payloads that cross topic, agent, or graph
43
+ * boundaries. It is an application fact shape, not a required protocol type.
44
+ */
45
+ interface TopicMessage<T = unknown> {
46
+ readonly id: string;
47
+ readonly schema?: JsonSchema;
48
+ readonly expiresAt?: string;
49
+ readonly correlationId?: string;
50
+ readonly payload: T;
51
+ }
52
+ declare const PROMPTS_TOPIC = "prompts";
53
+ declare const RESPONSES_TOPIC = "responses";
54
+ declare const INJECTIONS_TOPIC = "injections";
55
+ declare const DEFERRED_TOPIC = "deferred";
56
+ declare const SPAWNS_TOPIC = "spawns";
57
+ declare const CONTEXT_TOPIC = "context";
58
+ declare const TODOS_TOPIC = "todos";
59
+ declare const STANDARD_TOPICS: readonly ["prompts", "responses", "injections", "deferred", "spawns", "context", "todos"];
60
+ type StandardTopic = (typeof STANDARD_TOPICS)[number];
61
+ interface MessageBusEvent<T = unknown> {
62
+ readonly kind: "publish" | "complete" | "error";
63
+ readonly topic: string;
64
+ readonly seq?: number;
65
+ readonly payload?: T;
66
+ readonly error?: unknown;
67
+ }
68
+ interface MessageBusOptions<TTopic extends string = string> {
69
+ readonly topics: readonly TTopic[];
70
+ readonly name?: string;
71
+ readonly now?: () => number;
72
+ }
73
+ interface MessageBus<TTopic extends string = string> {
74
+ readonly topics: readonly TTopic[];
75
+ topic<T = unknown>(name: TTopic): Node<MessageEnvelope<T>>;
76
+ publish<T = unknown>(name: TTopic, payload: T, opts?: {
77
+ key?: string;
78
+ }): MessageEnvelope<T>;
79
+ has(name: string): name is TTopic;
80
+ }
81
+ interface ToTopicOptions {
82
+ readonly name?: string;
83
+ readonly keyOf?: (value: unknown) => string | undefined;
84
+ }
85
+ interface ToTopicBundle<T> {
86
+ readonly events: Node<MessageBusEvent<T>>;
87
+ }
88
+ type DynamicHubUnknownTopicPolicy = "drop" | "error" | "dead-letter" | "create-as-fact";
89
+ interface DynamicHubOptions {
90
+ readonly name?: string;
91
+ readonly topics?: readonly string[];
92
+ readonly unknownTopic?: DynamicHubUnknownTopicPolicy;
93
+ readonly deadLetter?: boolean;
94
+ readonly maxTopics?: number;
95
+ readonly maxTopicLength?: number;
96
+ readonly now?: () => number;
97
+ }
98
+ interface DynamicHubMetadata {
99
+ readonly seq: number;
100
+ readonly cursor: number;
101
+ readonly timestampMs: number;
102
+ }
103
+ type DynamicHubEventKind = "create" | "delete" | "message" | "subscribe" | "close" | "error" | "dead-letter";
104
+ type DynamicHubCommand<T = unknown> = {
105
+ readonly kind: "create";
106
+ readonly topic: string;
107
+ readonly key?: string;
108
+ readonly payload?: T;
109
+ } | {
110
+ readonly kind: "delete";
111
+ readonly topic: string;
112
+ readonly key?: string;
113
+ readonly payload?: T;
114
+ } | {
115
+ readonly kind: "publish";
116
+ readonly topic: string;
117
+ readonly payload: T;
118
+ readonly key?: string;
119
+ } | {
120
+ readonly kind: "subscribe";
121
+ readonly topic: string;
122
+ readonly key?: string;
123
+ readonly payload?: T;
124
+ } | {
125
+ readonly kind: "close";
126
+ readonly key?: string;
127
+ readonly payload?: T;
128
+ };
129
+ interface DynamicHubStatus {
130
+ readonly open: boolean;
131
+ readonly topics: readonly string[];
132
+ readonly seq: number;
133
+ readonly cursor: number;
134
+ readonly lastEventKind?: DynamicHubEventKind;
135
+ }
136
+ interface DynamicHubEventFrame {
137
+ readonly meta: DynamicHubMetadata;
138
+ readonly status: DynamicHubStatus;
139
+ }
140
+ type DynamicHubEvent<T = unknown> = DynamicHubEventFrame & ({
141
+ readonly kind: "create";
142
+ readonly topic: string;
143
+ readonly key?: string;
144
+ readonly payload?: T;
145
+ } | {
146
+ readonly kind: "delete";
147
+ readonly topic: string;
148
+ readonly key?: string;
149
+ readonly payload?: T;
150
+ } | {
151
+ readonly kind: "message";
152
+ readonly topic: string;
153
+ readonly payload: T;
154
+ readonly key?: string;
155
+ } | {
156
+ readonly kind: "subscribe";
157
+ readonly topic: string;
158
+ readonly key?: string;
159
+ readonly payload?: T;
160
+ } | {
161
+ readonly kind: "close";
162
+ readonly key?: string;
163
+ readonly payload?: T;
164
+ } | {
165
+ readonly kind: "error";
166
+ readonly topic?: string;
167
+ readonly error: string;
168
+ readonly command: unknown;
169
+ } | {
170
+ readonly kind: "dead-letter";
171
+ readonly topic?: string;
172
+ readonly reason: string;
173
+ readonly command: unknown;
174
+ });
175
+ interface DynamicHubError {
176
+ readonly topic?: string;
177
+ readonly error: string;
178
+ readonly command: unknown;
179
+ readonly meta: DynamicHubMetadata;
180
+ }
181
+ interface DynamicHubDeadLetter {
182
+ readonly topic?: string;
183
+ readonly reason: string;
184
+ readonly command: unknown;
185
+ readonly meta: DynamicHubMetadata;
186
+ }
187
+ interface DynamicHub<T = unknown> {
188
+ readonly command: Node<DynamicHubCommand<T>>;
189
+ readonly events: Node<DynamicHubEvent<T>>;
190
+ readonly status: Node<DynamicHubStatus>;
191
+ readonly errors: Node<DynamicHubError>;
192
+ readonly deadLetter?: Node<DynamicHubDeadLetter>;
193
+ create(topic: string, opts?: {
194
+ key?: string;
195
+ payload?: T;
196
+ }): DynamicHubCommand<T>;
197
+ delete(topic: string, opts?: {
198
+ key?: string;
199
+ payload?: T;
200
+ }): DynamicHubCommand<T>;
201
+ publish(topic: string, payload: T, opts?: {
202
+ key?: string;
203
+ }): DynamicHubCommand<T>;
204
+ subscribeTopic(topic: string, opts?: {
205
+ key?: string;
206
+ payload?: T;
207
+ }): DynamicHubCommand<T>;
208
+ close(opts?: {
209
+ key?: string;
210
+ payload?: T;
211
+ }): DynamicHubCommand<T>;
212
+ }
213
+ interface ToHubTopicOptions<T> {
214
+ readonly name?: string;
215
+ readonly keyOf?: (value: T) => string | undefined;
216
+ }
217
+ interface ToHubTopicBundle<T> {
218
+ readonly commands: Node<DynamicHubCommand<T>>;
219
+ }
220
+ declare function messageBus<TTopic extends string>(graph: Graph, opts: MessageBusOptions<TTopic>): MessageBus<TTopic>;
221
+ /**
222
+ * D135 dynamic messaging hub: topic lifecycle is DATA facts over fixed graph-visible
223
+ * command/event/status/error nodes. Topic keys never create or delete graph nodes.
224
+ */
225
+ declare function dynamicHub<T = unknown>(graph: Graph, opts?: DynamicHubOptions): DynamicHub<T>;
226
+ /** Static D135 projection over hub event facts for one topic key; no topic node is created. */
227
+ declare function fromHubTopic<T = unknown>(hub: DynamicHub<unknown>, topic: string, opts?: {
228
+ name?: string;
229
+ }): Node<MessageEnvelope<T>>;
230
+ /** Static D135 command helper: source DATA becomes publish command facts for one topic key. */
231
+ declare function toHubTopic<T>(graph: Graph, source: Node<T>, hub: DynamicHub<unknown>, topic: string, opts?: ToHubTopicOptions<T>): ToHubTopicBundle<T>;
232
+ declare function fromTopic<T = unknown, TTopic extends string = string>(bus: MessageBus<TTopic>, topic: TTopic): Node<MessageEnvelope<T>>;
233
+ declare function toTopic<T, TTopic extends string>(graph: Graph, source: Node<T>, bus: MessageBus<TTopic>, topic: TTopic, opts?: ToTopicOptions): ToTopicBundle<T>;
234
+
235
+ export { CONTEXT_TOPIC, DEFERRED_TOPIC, type DynamicHub, type DynamicHubCommand, type DynamicHubDeadLetter, type DynamicHubError, type DynamicHubEvent, type DynamicHubEventKind, type DynamicHubMetadata, type DynamicHubOptions, type DynamicHubStatus, type DynamicHubUnknownTopicPolicy, INJECTIONS_TOPIC, type JsonSchema, type MessageBus, type MessageBusEvent, type MessageBusOptions, type MessageEnvelope, PROMPTS_TOPIC, RESPONSES_TOPIC, SPAWNS_TOPIC, STANDARD_TOPICS, type StandardTopic, TODOS_TOPIC, type ToHubTopicBundle, type ToHubTopicOptions, type ToTopicBundle, type ToTopicOptions, type TopicMessage, dynamicHub, fromHubTopic, fromTopic, messageBus, toHubTopic, toTopic };