@octonodes/sdk 0.2.16 → 0.2.26

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 (134) hide show
  1. package/README.md +36 -0
  2. package/dist/data-tables/table.d.ts +90 -0
  3. package/dist/data-tables/table.d.ts.map +1 -0
  4. package/dist/data-tables/table.js +44 -0
  5. package/dist/data-tables/table.js.map +1 -0
  6. package/dist/data-tables/types.d.ts +24 -0
  7. package/dist/data-tables/types.d.ts.map +1 -0
  8. package/dist/data-tables/types.js +3 -0
  9. package/dist/data-tables/types.js.map +1 -0
  10. package/dist/gen/types.gen.d.ts +120 -0
  11. package/dist/gen/types.gen.d.ts.map +1 -1
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/octonode-client.d.ts +87 -0
  15. package/dist/octonode-client.d.ts.map +1 -1
  16. package/dist/octonode-client.js +4 -0
  17. package/dist/octonode-client.js.map +1 -1
  18. package/dist/plugins/schema/app/contributions.d.ts +355 -0
  19. package/dist/plugins/schema/app/contributions.d.ts.map +1 -0
  20. package/dist/plugins/schema/app/contributions.js +179 -0
  21. package/dist/plugins/schema/app/contributions.js.map +1 -0
  22. package/dist/plugins/schema/app-contributions.d.ts +355 -0
  23. package/dist/plugins/schema/app-contributions.d.ts.map +1 -0
  24. package/dist/plugins/schema/app-contributions.js +179 -0
  25. package/dist/plugins/schema/app-contributions.js.map +1 -0
  26. package/dist/plugins/schema/app.d.ts +506 -1
  27. package/dist/plugins/schema/app.d.ts.map +1 -1
  28. package/dist/plugins/schema/app.js +59 -5
  29. package/dist/plugins/schema/app.js.map +1 -1
  30. package/dist/plugins/schema/constants.d.ts +2 -1
  31. package/dist/plugins/schema/constants.d.ts.map +1 -1
  32. package/dist/plugins/schema/constants.js +3 -1
  33. package/dist/plugins/schema/constants.js.map +1 -1
  34. package/dist/plugins/schema/icons.d.ts +4 -0
  35. package/dist/plugins/schema/icons.d.ts.map +1 -1
  36. package/dist/plugins/schema/icons.js +20 -1
  37. package/dist/plugins/schema/icons.js.map +1 -1
  38. package/dist/plugins/schema/ipc/envelope.d.ts +923 -0
  39. package/dist/plugins/schema/ipc/envelope.d.ts.map +1 -0
  40. package/dist/plugins/schema/ipc/envelope.js +210 -0
  41. package/dist/plugins/schema/ipc/envelope.js.map +1 -0
  42. package/dist/plugins/schema/ipc-envelope.d.ts +55 -55
  43. package/dist/plugins/schema/ipc-envelope.js +1 -1
  44. package/dist/plugins/schema/ipc-envelope.js.map +1 -1
  45. package/dist/plugins/schema/personal/layout.d.ts +52 -0
  46. package/dist/plugins/schema/personal/layout.d.ts.map +1 -0
  47. package/dist/plugins/schema/personal/layout.js +26 -0
  48. package/dist/plugins/schema/personal/layout.js.map +1 -0
  49. package/dist/plugins/schema/personal-layout.d.ts +52 -0
  50. package/dist/plugins/schema/personal-layout.d.ts.map +1 -0
  51. package/dist/plugins/schema/personal-layout.js +26 -0
  52. package/dist/plugins/schema/personal-layout.js.map +1 -0
  53. package/dist/plugins/schema/plugin/execution.d.ts +843 -44
  54. package/dist/plugins/schema/plugin/execution.d.ts.map +1 -1
  55. package/dist/plugins/schema/plugin/execution.js +2 -2
  56. package/dist/plugins/schema/plugin/execution.js.map +1 -1
  57. package/dist/plugins/schema/plugin/plugin.d.ts +802 -39
  58. package/dist/plugins/schema/plugin/plugin.d.ts.map +1 -1
  59. package/dist/plugins/schema/plugin/plugin.js +82 -6
  60. package/dist/plugins/schema/plugin/plugin.js.map +1 -1
  61. package/dist/plugins/schema/plugin/publishing.d.ts +121 -68
  62. package/dist/plugins/schema/plugin/publishing.d.ts.map +1 -1
  63. package/dist/plugins/schema/plugin/publishing.js +2 -0
  64. package/dist/plugins/schema/plugin/publishing.js.map +1 -1
  65. package/dist/plugins/schema/plugin-publishing.d.ts +68 -68
  66. package/dist/plugins/schema/plugin-sdk/index.d.ts +2 -1
  67. package/dist/plugins/schema/plugin-sdk/index.d.ts.map +1 -1
  68. package/dist/plugins/schema/plugin-sdk/index.js +2 -1
  69. package/dist/plugins/schema/plugin-sdk/index.js.map +1 -1
  70. package/dist/plugins/schema/plugin.d.ts +36 -36
  71. package/dist/plugins/sdk/constants.d.ts +2 -0
  72. package/dist/plugins/sdk/constants.d.ts.map +1 -0
  73. package/dist/plugins/sdk/constants.js +6 -0
  74. package/dist/plugins/sdk/constants.js.map +1 -0
  75. package/dist/plugins/sdk/define/node.d.ts +15 -0
  76. package/dist/plugins/sdk/define/node.d.ts.map +1 -0
  77. package/dist/plugins/sdk/define/node.js +58 -0
  78. package/dist/plugins/sdk/define/node.js.map +1 -0
  79. package/dist/plugins/sdk/define-node.d.ts +5 -0
  80. package/dist/plugins/sdk/define-node.d.ts.map +1 -1
  81. package/dist/plugins/sdk/define-node.js +1 -1
  82. package/dist/plugins/sdk/define-node.js.map +1 -1
  83. package/dist/plugins/sdk/definitions/clients/output.d.ts +3 -0
  84. package/dist/plugins/sdk/definitions/clients/output.d.ts.map +1 -0
  85. package/dist/plugins/sdk/definitions/clients/output.js +47 -0
  86. package/dist/plugins/sdk/definitions/clients/output.js.map +1 -0
  87. package/dist/plugins/sdk/definitions/compiler/catalog.d.ts.map +1 -1
  88. package/dist/plugins/sdk/definitions/compiler/catalog.js +9 -0
  89. package/dist/plugins/sdk/definitions/compiler/catalog.js.map +1 -1
  90. package/dist/plugins/sdk/definitions/compiler/index.d.ts.map +1 -1
  91. package/dist/plugins/sdk/definitions/compiler/index.js +59 -2
  92. package/dist/plugins/sdk/definitions/compiler/index.js.map +1 -1
  93. package/dist/plugins/sdk/definitions/npm/emit/js.d.ts.map +1 -1
  94. package/dist/plugins/sdk/definitions/npm/emit/js.js +7 -3
  95. package/dist/plugins/sdk/definitions/npm/emit/js.js.map +1 -1
  96. package/dist/plugins/sdk/definitions/npm/types.d.ts +35 -2
  97. package/dist/plugins/sdk/definitions/npm/types.d.ts.map +1 -1
  98. package/dist/plugins/sdk/definitions/types.d.ts +10 -3
  99. package/dist/plugins/sdk/definitions/types.d.ts.map +1 -1
  100. package/dist/plugins/sdk/json/schema.d.ts +13 -0
  101. package/dist/plugins/sdk/json/schema.d.ts.map +1 -0
  102. package/dist/plugins/sdk/json/schema.js +102 -0
  103. package/dist/plugins/sdk/json/schema.js.map +1 -0
  104. package/dist/plugins/sdk/json-schema.js +13 -0
  105. package/dist/plugins/sdk/json-schema.js.map +1 -1
  106. package/dist/plugins/sdk/nodes/index.d.ts +3 -1
  107. package/dist/plugins/sdk/nodes/index.d.ts.map +1 -1
  108. package/dist/plugins/sdk/nodes/index.js +5 -0
  109. package/dist/plugins/sdk/nodes/index.js.map +1 -1
  110. package/dist/plugins/sdk/plugin/index.d.ts +1 -0
  111. package/dist/plugins/sdk/plugin/index.d.ts.map +1 -1
  112. package/dist/plugins/sdk/plugin.d.ts +1 -1
  113. package/dist/plugins/sdk/plugin.d.ts.map +1 -1
  114. package/dist/plugins/sdk/plugin.js +2 -2
  115. package/dist/plugins/sdk/plugin.js.map +1 -1
  116. package/dist/plugins/sdk/plugins/define/node.d.ts +29 -0
  117. package/dist/plugins/sdk/plugins/define/node.d.ts.map +1 -0
  118. package/dist/plugins/sdk/plugins/define/node.js +16 -0
  119. package/dist/plugins/sdk/plugins/define/node.js.map +1 -0
  120. package/dist/plugins/sdk/plugins/index.d.ts +5 -4
  121. package/dist/plugins/sdk/plugins/index.d.ts.map +1 -1
  122. package/dist/plugins/sdk/plugins/index.js +21 -15
  123. package/dist/plugins/sdk/plugins/index.js.map +1 -1
  124. package/dist/plugins/sdk/plugins/types.d.ts +1 -1
  125. package/dist/plugins/sdk/plugins/types.d.ts.map +1 -1
  126. package/dist/plugins/sdk/runner.d.ts +3 -7
  127. package/dist/plugins/sdk/runner.d.ts.map +1 -1
  128. package/dist/plugins/sdk/runner.js +61 -18
  129. package/dist/plugins/sdk/runner.js.map +1 -1
  130. package/dist/plugins/sdk/types.d.ts +115 -0
  131. package/dist/plugins/sdk/types.d.ts.map +1 -0
  132. package/dist/plugins/sdk/types.js +3 -0
  133. package/dist/plugins/sdk/types.js.map +1 -0
  134. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../../src/plugins/schema/ipc/envelope.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAG,GAAY,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,UAAU,wCAAwB,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,SAAS,8EAKpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,0EAA0E;AAC1E,eAAO,MAAM,aAAa;;;;IAIxB,0EAA0E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI1E,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAK1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,iCAAiC;AACjC,eAAO,MAAM,eAAe;;;;IArB1B,0EAA0E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqBiB,CAAC;AAC9F,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC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AAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAQ7E;AAED,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,WAAW,CAQnF;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,cAAc,CAQ/F;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,aAAa,CAQvF"}
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ManifestEnvelope = exports.NodeManifest = exports.ResultEnvelope = exports.NodeError = exports.RequestEnvelope = exports.DescribeRequest = exports.InvokeRequest = exports.InvocationContext = exports.ErrorCode = exports.JsonSchema = exports.PROTOCOL_VERSION = void 0;
4
+ exports.makeInvokeRequest = makeInvokeRequest;
5
+ exports.makeDescribeRequest = makeDescribeRequest;
6
+ exports.makeOkResult = makeOkResult;
7
+ exports.makeErrorResult = makeErrorResult;
8
+ exports.makeManifestResult = makeManifestResult;
9
+ exports.makeManifestError = makeManifestError;
10
+ // Generated from packages/schema/src/ipc/envelope.ts. Do not edit; run the Octonode SDK sync.
11
+ const zod_1 = require("zod");
12
+ const icons_1 = require("../icons");
13
+ /**
14
+ * The IPC protocol version. Every envelope carries this in its `octonode`
15
+ * field so the wire format can evolve without ambiguity. Bump only on a
16
+ * breaking change to the envelope shape.
17
+ */
18
+ exports.PROTOCOL_VERSION = "1";
19
+ /**
20
+ * A JSON Schema object, kept deliberately loose. It is the lowest common
21
+ * denominator every language can emit and validate against, which is what
22
+ * makes "a node in any language" tractable: contracts travel as plain JSON
23
+ * Schema, not as language-specific type objects.
24
+ */
25
+ exports.JsonSchema = zod_1.z.record(zod_1.z.unknown());
26
+ /**
27
+ * Structured error codes a node (or the engine) can report. `retryable` on the
28
+ * error object — not the code alone — is what the DAG executor consults in
29
+ * later phases, but the code gives callers a stable taxonomy.
30
+ */
31
+ exports.ErrorCode = zod_1.z.enum([
32
+ "VALIDATION_ERROR", // inputs/outputs failed schema validation
33
+ "RUNTIME_ERROR", // the node threw, crashed, or emitted garbage
34
+ "TIMEOUT", // the node exceeded its deadline
35
+ "NON_RETRYABLE", // a deliberate, terminal failure the node raised
36
+ ]);
37
+ /**
38
+ * Per-invocation context handed to the node. In Phase 1/2 only `config`/`attempt`
39
+ * are meaningful; `runId`/`env`/`deadlineMs` are populated once the config and
40
+ * DAG layers land, but they are part of the contract from day one.
41
+ */
42
+ exports.InvocationContext = zod_1.z.object({
43
+ runId: zod_1.z.string().optional(),
44
+ env: zod_1.z.string().optional(),
45
+ config: zod_1.z.record(zod_1.z.unknown()).default({}),
46
+ attempt: zod_1.z.number().int().positive().default(1),
47
+ deadlineMs: zod_1.z.number().int().positive().optional(),
48
+ });
49
+ /** Engine → node: a request to execute the node with the given inputs. */
50
+ exports.InvokeRequest = zod_1.z.object({
51
+ octonode: zod_1.z.literal(exports.PROTOCOL_VERSION),
52
+ type: zod_1.z.literal("invoke"),
53
+ invocationId: zod_1.z.string(),
54
+ /** Optional node id — useful once one process can host multiple nodes. */
55
+ node: zod_1.z.string().optional(),
56
+ inputs: zod_1.z.unknown(),
57
+ context: exports.InvocationContext.default({}),
58
+ });
59
+ /**
60
+ * Engine → node: a request for the node to self-report its manifest instead of
61
+ * executing. This is the universal discovery mechanism — every language that
62
+ * can answer `describe` can be scanned into `.octonode`, no AST tooling needed.
63
+ */
64
+ exports.DescribeRequest = zod_1.z.object({
65
+ octonode: zod_1.z.literal(exports.PROTOCOL_VERSION),
66
+ type: zod_1.z.literal("describe"),
67
+ invocationId: zod_1.z.string(),
68
+ node: zod_1.z.string().optional(),
69
+ });
70
+ /** Any engine → node request. */
71
+ exports.RequestEnvelope = zod_1.z.discriminatedUnion("type", [exports.InvokeRequest, exports.DescribeRequest]);
72
+ /** Errors are data, not just exceptions — they cross the process boundary as JSON. */
73
+ exports.NodeError = zod_1.z.object({
74
+ code: exports.ErrorCode,
75
+ message: zod_1.z.string(),
76
+ retryable: zod_1.z.boolean().default(false),
77
+ details: zod_1.z.unknown().optional(),
78
+ stack: zod_1.z.string().optional(),
79
+ });
80
+ // ---- Invoke results ----
81
+ const ResultOk = zod_1.z.object({
82
+ octonode: zod_1.z.literal(exports.PROTOCOL_VERSION),
83
+ type: zod_1.z.literal("result"),
84
+ invocationId: zod_1.z.string(),
85
+ status: zod_1.z.literal("ok"),
86
+ outputs: zod_1.z.unknown(),
87
+ });
88
+ const ResultErr = zod_1.z.object({
89
+ octonode: zod_1.z.literal(exports.PROTOCOL_VERSION),
90
+ type: zod_1.z.literal("result"),
91
+ invocationId: zod_1.z.string(),
92
+ status: zod_1.z.literal("error"),
93
+ error: exports.NodeError,
94
+ });
95
+ /** Node → engine: the outcome of an invocation. */
96
+ exports.ResultEnvelope = zod_1.z.discriminatedUnion("status", [ResultOk, ResultErr]);
97
+ // ---- Manifests (describe results) ----
98
+ /**
99
+ * What a node declares about itself: a stable id, its language, the JSON Schema
100
+ * for its inputs and outputs, and optional presentation/runtime seeds. This is
101
+ * the payload `octonode scan` collects (Phase 3) to populate `.octonode`.
102
+ */
103
+ exports.NodeManifest = zod_1.z.object({
104
+ id: zod_1.z.string(),
105
+ label: zod_1.z.string().optional(),
106
+ description: zod_1.z.string().optional(),
107
+ symbol: zod_1.z.string().max(16).optional(),
108
+ defaults: zod_1.z.record(zod_1.z.unknown()).optional(),
109
+ /** A workflow wrapper receives the current execution config through its invocation context. */
110
+ workflowId: zod_1.z.string().min(1).optional(),
111
+ language: zod_1.z.string(),
112
+ inputs: exports.JsonSchema.optional(),
113
+ outputs: exports.JsonSchema.optional(),
114
+ /**
115
+ * What this node is: `function` (default), `class`, `service`, or `const`.
116
+ * Set by the setup-time SDK helpers (defineService/defineClass/defineConst)
117
+ * so `scan` writes it to `.octonode`.
118
+ */
119
+ kind: zod_1.z.enum(["function", "class", "service", "const"]).optional(),
120
+ /** Setup params for non-function kinds (constructor/config shape). */
121
+ setup: exports.JsonSchema.optional(),
122
+ /** Advisory default icon — a one-time seed; config owns it thereafter. */
123
+ icon: icons_1.IconValue.optional(),
124
+ /** Advisory default config — a one-time seed; config owns it thereafter. */
125
+ config: zod_1.z.record(zod_1.z.unknown()).optional(),
126
+ /** Explicit service exposure. Plain classes never populate this field. */
127
+ service: zod_1.z
128
+ .object({
129
+ lifecycle: zod_1.z.enum(["invocation", "workflow-run", "worker"]),
130
+ methods: zod_1.z.array(zod_1.z.object({
131
+ name: zod_1.z.string(),
132
+ params: zod_1.z.array(zod_1.z.string()).default([]),
133
+ inputs: exports.JsonSchema.optional(),
134
+ outputs: exports.JsonSchema.optional(),
135
+ })),
136
+ })
137
+ .optional(),
138
+ });
139
+ const ManifestOk = zod_1.z.object({
140
+ octonode: zod_1.z.literal(exports.PROTOCOL_VERSION),
141
+ type: zod_1.z.literal("manifest"),
142
+ invocationId: zod_1.z.string(),
143
+ status: zod_1.z.literal("ok"),
144
+ manifest: exports.NodeManifest,
145
+ });
146
+ const ManifestErr = zod_1.z.object({
147
+ octonode: zod_1.z.literal(exports.PROTOCOL_VERSION),
148
+ type: zod_1.z.literal("manifest"),
149
+ invocationId: zod_1.z.string(),
150
+ status: zod_1.z.literal("error"),
151
+ error: exports.NodeError,
152
+ });
153
+ /** Node → engine: the response to a `describe` request. */
154
+ exports.ManifestEnvelope = zod_1.z.discriminatedUnion("status", [ManifestOk, ManifestErr]);
155
+ // ---- Constructors: the one blessed way to build envelopes, used by SDK + engine ----
156
+ function makeInvokeRequest(args) {
157
+ return exports.InvokeRequest.parse({
158
+ octonode: exports.PROTOCOL_VERSION,
159
+ type: "invoke",
160
+ invocationId: args.invocationId,
161
+ node: args.node,
162
+ inputs: args.inputs,
163
+ context: args.context ?? {},
164
+ });
165
+ }
166
+ function makeDescribeRequest(args) {
167
+ return exports.DescribeRequest.parse({
168
+ octonode: exports.PROTOCOL_VERSION,
169
+ type: "describe",
170
+ invocationId: args.invocationId,
171
+ node: args.node,
172
+ });
173
+ }
174
+ function makeOkResult(invocationId, outputs) {
175
+ return {
176
+ octonode: exports.PROTOCOL_VERSION,
177
+ type: "result",
178
+ invocationId,
179
+ status: "ok",
180
+ outputs,
181
+ };
182
+ }
183
+ function makeErrorResult(invocationId, error) {
184
+ return {
185
+ octonode: exports.PROTOCOL_VERSION,
186
+ type: "result",
187
+ invocationId,
188
+ status: "error",
189
+ error: exports.NodeError.parse(error),
190
+ };
191
+ }
192
+ function makeManifestResult(invocationId, manifest) {
193
+ return {
194
+ octonode: exports.PROTOCOL_VERSION,
195
+ type: "manifest",
196
+ invocationId,
197
+ status: "ok",
198
+ manifest: exports.NodeManifest.parse(manifest),
199
+ };
200
+ }
201
+ function makeManifestError(invocationId, error) {
202
+ return {
203
+ octonode: exports.PROTOCOL_VERSION,
204
+ type: "manifest",
205
+ invocationId,
206
+ status: "error",
207
+ error: exports.NodeError.parse(error),
208
+ };
209
+ }
210
+ //# sourceMappingURL=envelope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../../../src/plugins/schema/ipc/envelope.ts"],"names":[],"mappings":";;;AAuLA,8CAcC;AAED,kDAOC;AAED,oCAQC;AAED,0CAQC;AAED,gDAQC;AAED,8CAQC;AAtPD,8FAA8F;AAC9F,6BAAwB;AACxB,oCAAqC;AAErC;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,GAAY,CAAC;AAE7C;;;;;GAKG;AACU,QAAA,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAGhD;;;;GAIG;AACU,QAAA,SAAS,GAAG,OAAC,CAAC,IAAI,CAAC;IAC9B,kBAAkB,EAAE,0CAA0C;IAC9D,eAAe,EAAE,8CAA8C;IAC/D,SAAS,EAAE,iCAAiC;IAC5C,eAAe,EAAE,iDAAiD;CACnE,CAAC,CAAC;AAGH;;;;GAIG;AACU,QAAA,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