@octonodes/sdk 0.0.3 → 0.1.5

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 (129) hide show
  1. package/PLUGINS.md +265 -0
  2. package/README.md +107 -9
  3. package/dist/constants.d.ts +1 -0
  4. package/dist/constants.d.ts.map +1 -1
  5. package/dist/constants.js +2 -1
  6. package/dist/constants.js.map +1 -1
  7. package/dist/gen/index.d.ts +2 -2
  8. package/dist/gen/index.d.ts.map +1 -1
  9. package/dist/gen/index.js +4 -3
  10. package/dist/gen/index.js.map +1 -1
  11. package/dist/gen/sdk.gen.d.ts +9 -1
  12. package/dist/gen/sdk.gen.d.ts.map +1 -1
  13. package/dist/gen/sdk.gen.js +21 -3
  14. package/dist/gen/sdk.gen.js.map +1 -1
  15. package/dist/gen/types.gen.d.ts +379 -1
  16. package/dist/gen/types.gen.d.ts.map +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/plugins/index.d.ts +2 -0
  22. package/dist/plugins/index.d.ts.map +1 -0
  23. package/dist/plugins/index.js +19 -0
  24. package/dist/plugins/index.js.map +1 -0
  25. package/dist/plugins/schema/constants.d.ts +33 -0
  26. package/dist/plugins/schema/constants.d.ts.map +1 -0
  27. package/dist/plugins/schema/constants.js +207 -0
  28. package/dist/plugins/schema/constants.js.map +1 -0
  29. package/dist/plugins/schema/icons.d.ts +5 -0
  30. package/dist/plugins/schema/icons.d.ts.map +1 -0
  31. package/dist/plugins/schema/icons.js +62 -0
  32. package/dist/plugins/schema/icons.js.map +1 -0
  33. package/dist/plugins/schema/ipc-envelope.d.ts +923 -0
  34. package/dist/plugins/schema/ipc-envelope.d.ts.map +1 -0
  35. package/dist/plugins/schema/ipc-envelope.js +210 -0
  36. package/dist/plugins/schema/ipc-envelope.js.map +1 -0
  37. package/dist/plugins/schema/plugin-sdk/index.d.ts +5 -0
  38. package/dist/plugins/schema/plugin-sdk/index.d.ts.map +1 -0
  39. package/dist/plugins/schema/plugin-sdk/index.js +25 -0
  40. package/dist/plugins/schema/plugin-sdk/index.js.map +1 -0
  41. package/dist/plugins/schema/plugin.d.ts +808 -0
  42. package/dist/plugins/schema/plugin.d.ts.map +1 -0
  43. package/dist/plugins/schema/plugin.js +196 -0
  44. package/dist/plugins/schema/plugin.js.map +1 -0
  45. package/dist/plugins/sdk/define-node.d.ts +103 -0
  46. package/dist/plugins/sdk/define-node.d.ts.map +1 -0
  47. package/dist/plugins/sdk/define-node.js +58 -0
  48. package/dist/plugins/sdk/define-node.js.map +1 -0
  49. package/dist/plugins/sdk/definitions/compiler/catalog.d.ts +3 -0
  50. package/dist/plugins/sdk/definitions/compiler/catalog.d.ts.map +1 -0
  51. package/dist/plugins/sdk/definitions/compiler/catalog.js +133 -0
  52. package/dist/plugins/sdk/definitions/compiler/catalog.js.map +1 -0
  53. package/dist/plugins/sdk/definitions/compiler/constants.d.ts +6 -0
  54. package/dist/plugins/sdk/definitions/compiler/constants.d.ts.map +1 -0
  55. package/dist/plugins/sdk/definitions/compiler/constants.js +10 -0
  56. package/dist/plugins/sdk/definitions/compiler/constants.js.map +1 -0
  57. package/dist/plugins/sdk/definitions/compiler/index.d.ts +7 -0
  58. package/dist/plugins/sdk/definitions/compiler/index.d.ts.map +1 -0
  59. package/dist/plugins/sdk/definitions/compiler/index.js +411 -0
  60. package/dist/plugins/sdk/definitions/compiler/index.js.map +1 -0
  61. package/dist/plugins/sdk/definitions/compiler/literals.d.ts +5 -0
  62. package/dist/plugins/sdk/definitions/compiler/literals.d.ts.map +1 -0
  63. package/dist/plugins/sdk/definitions/compiler/literals.js +78 -0
  64. package/dist/plugins/sdk/definitions/compiler/literals.js.map +1 -0
  65. package/dist/plugins/sdk/definitions/compiler/schemas.d.ts +4 -0
  66. package/dist/plugins/sdk/definitions/compiler/schemas.d.ts.map +1 -0
  67. package/dist/plugins/sdk/definitions/compiler/schemas.js +95 -0
  68. package/dist/plugins/sdk/definitions/compiler/schemas.js.map +1 -0
  69. package/dist/plugins/sdk/definitions/compiler/types.d.ts +20 -0
  70. package/dist/plugins/sdk/definitions/compiler/types.d.ts.map +1 -0
  71. package/dist/plugins/sdk/definitions/compiler/types.js +3 -0
  72. package/dist/plugins/sdk/definitions/compiler/types.js.map +1 -0
  73. package/dist/plugins/sdk/definitions/index.d.ts +7 -0
  74. package/dist/plugins/sdk/definitions/index.d.ts.map +1 -0
  75. package/dist/plugins/sdk/definitions/index.js +16 -0
  76. package/dist/plugins/sdk/definitions/index.js.map +1 -0
  77. package/dist/plugins/sdk/definitions/npm/emit/js.d.ts +4 -0
  78. package/dist/plugins/sdk/definitions/npm/emit/js.d.ts.map +1 -0
  79. package/dist/plugins/sdk/definitions/npm/emit/js.js +190 -0
  80. package/dist/plugins/sdk/definitions/npm/emit/js.js.map +1 -0
  81. package/dist/plugins/sdk/definitions/npm/types.d.ts +63 -0
  82. package/dist/plugins/sdk/definitions/npm/types.d.ts.map +1 -0
  83. package/dist/plugins/sdk/definitions/npm/types.js +3 -0
  84. package/dist/plugins/sdk/definitions/npm/types.js.map +1 -0
  85. package/dist/plugins/sdk/definitions/types.d.ts +43 -0
  86. package/dist/plugins/sdk/definitions/types.d.ts.map +1 -0
  87. package/dist/plugins/sdk/definitions/types.js +3 -0
  88. package/dist/plugins/sdk/definitions/types.js.map +1 -0
  89. package/dist/plugins/sdk/json-schema.d.ts +17 -0
  90. package/dist/plugins/sdk/json-schema.d.ts.map +1 -0
  91. package/dist/plugins/sdk/json-schema.js +79 -0
  92. package/dist/plugins/sdk/json-schema.js.map +1 -0
  93. package/dist/plugins/sdk/nodes/index.d.ts +5 -0
  94. package/dist/plugins/sdk/nodes/index.d.ts.map +1 -0
  95. package/dist/plugins/sdk/nodes/index.js +12 -0
  96. package/dist/plugins/sdk/nodes/index.js.map +1 -0
  97. package/dist/plugins/sdk/plugin/index.d.ts +3 -0
  98. package/dist/plugins/sdk/plugin/index.d.ts.map +1 -0
  99. package/dist/plugins/sdk/plugin/index.js +8 -0
  100. package/dist/plugins/sdk/plugin/index.js.map +1 -0
  101. package/dist/plugins/sdk/plugin.d.ts +7 -0
  102. package/dist/plugins/sdk/plugin.d.ts.map +1 -0
  103. package/dist/plugins/sdk/plugin.js +74 -0
  104. package/dist/plugins/sdk/plugin.js.map +1 -0
  105. package/dist/plugins/sdk/plugin.types.d.ts +15 -0
  106. package/dist/plugins/sdk/plugin.types.d.ts.map +1 -0
  107. package/dist/plugins/sdk/plugin.types.js +3 -0
  108. package/dist/plugins/sdk/plugin.types.js.map +1 -0
  109. package/dist/plugins/sdk/plugins/define-node.d.ts +29 -0
  110. package/dist/plugins/sdk/plugins/define-node.d.ts.map +1 -0
  111. package/dist/plugins/sdk/plugins/define-node.js +16 -0
  112. package/dist/plugins/sdk/plugins/define-node.js.map +1 -0
  113. package/dist/plugins/sdk/plugins/index.d.ts +10 -0
  114. package/dist/plugins/sdk/plugins/index.d.ts.map +1 -0
  115. package/dist/plugins/sdk/plugins/index.js +23 -0
  116. package/dist/plugins/sdk/plugins/index.js.map +1 -0
  117. package/dist/plugins/sdk/plugins/types.d.ts +34 -0
  118. package/dist/plugins/sdk/plugins/types.d.ts.map +1 -0
  119. package/dist/plugins/sdk/plugins/types.js +3 -0
  120. package/dist/plugins/sdk/plugins/types.js.map +1 -0
  121. package/dist/plugins/sdk/project/index.d.ts +5 -0
  122. package/dist/plugins/sdk/project/index.d.ts.map +1 -0
  123. package/dist/plugins/sdk/project/index.js +10 -0
  124. package/dist/plugins/sdk/project/index.js.map +1 -0
  125. package/dist/plugins/sdk/runner.d.ts +36 -0
  126. package/dist/plugins/sdk/runner.d.ts.map +1 -0
  127. package/dist/plugins/sdk/runner.js +324 -0
  128. package/dist/plugins/sdk/runner.js.map +1 -0
  129. package/package.json +65 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/schema/plugin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AC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PluginManifest = exports.PluginConnection = exports.PluginIntegration = exports.PluginPermission = exports.PluginNode = exports.NpmClientBinding = exports.PluginNodeUi = exports.PLUGIN_UI_BUNDLE_MAX_BYTES = exports.PluginUiTarget = exports.PluginScope = void 0;
4
+ // Generated from packages/schema/src/plugin.ts. Do not edit; run the Octonode SDK sync.
5
+ const zod_1 = require("zod");
6
+ const ipc_envelope_1 = require("./ipc-envelope");
7
+ const icons_1 = require("./icons");
8
+ const constants_1 = require("./constants");
9
+ /**
10
+ * A plugin's distribution scope — who may discover and install it. `user` is
11
+ * private to its publisher in the hosted marketplace; group/org/public widen
12
+ * visibility. Local folder installs do not publish and remain local.
13
+ */
14
+ exports.PluginScope = zod_1.z.enum(["user", "group", "org", "public"]);
15
+ exports.PluginUiTarget = zod_1.z.enum(["node.inspector.inputs"]);
16
+ exports.PLUGIN_UI_BUNDLE_MAX_BYTES = 512 * 1024;
17
+ const pluginUiEntry = zod_1.z
18
+ .string()
19
+ .min(1)
20
+ .max(1_024)
21
+ .refine((value) => !value.startsWith("/") &&
22
+ !value.includes("\\") &&
23
+ !value.split("/").includes("..") &&
24
+ /\.[cm]?[jt]sx?$/.test(value), "UI entries must be relative JavaScript/TypeScript module paths");
25
+ exports.PluginNodeUi = zod_1.z
26
+ .object({
27
+ apiVersion: zod_1.z.literal("1"),
28
+ renderers: zod_1.z
29
+ .record(zod_1.z.string().regex(/^[a-z0-9][a-z0-9_-]*$/i, "renderer id must be alphanumeric/dash/underscore"), zod_1.z
30
+ .object({
31
+ label: zod_1.z.string().min(1).max(240),
32
+ targets: zod_1.z.record(exports.PluginUiTarget, pluginUiEntry),
33
+ })
34
+ .strict())
35
+ .refine((renderers) => Object.keys(renderers).length > 0, "UI needs at least one renderer"),
36
+ })
37
+ .strict();
38
+ /** Build an upstream SDK client from connection fields, never from public node inputs. */
39
+ exports.NpmClientBinding = zod_1.z
40
+ .object({
41
+ module: zod_1.z
42
+ .string()
43
+ .regex(/^(@[a-z0-9~._-]+\/)?[a-z0-9~._-]+(?:\/[a-zA-Z0-9~._-]+)*$/)
44
+ .refine((value) => !value.split("/").some((part) => part === "." || part === ".."), "Unsafe npm module path"),
45
+ export: zod_1.z.string().regex(/^[$A-Z_a-z][$\w]*$/),
46
+ options: zod_1.z.record(zod_1.z.unknown()).optional(),
47
+ env: zod_1.z
48
+ .record(zod_1.z
49
+ .string()
50
+ .regex(/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/)
51
+ .refine((path) => !path.split(".").some((key) => ["__proto__", "prototype", "constructor"].includes(key)), "Unsafe option path"), zod_1.z.string().regex(/^[A-Z_][A-Z0-9_]*$/))
52
+ .optional(),
53
+ })
54
+ .strict();
55
+ /**
56
+ * One node contributed by a plugin. Unlike a project node (whose signature is
57
+ * discovered by `octonode scan`), a plugin node declares its contract directly
58
+ * in the manifest — the plugin author owns it. `command` is resolved relative
59
+ * to the plugin folder, so a plugin is a self-contained, relocatable bundle.
60
+ */
61
+ exports.PluginNode = zod_1.z.object({
62
+ id: zod_1.z.string().regex(/^[a-z0-9][a-z0-9_-]*$/i, "node id must be alphanumeric/dash/underscore"),
63
+ /** The command the engine spawns, relative to the plugin folder. */
64
+ command: zod_1.z.string(),
65
+ language: zod_1.z.string().optional(),
66
+ label: zod_1.z.string().min(1).max(240).optional(),
67
+ symbol: zod_1.z.string().min(1).max(16).optional(),
68
+ description: zod_1.z.string().optional(),
69
+ icon: icons_1.IconName.optional(),
70
+ trigger: zod_1.z.boolean().optional(),
71
+ inputs: ipc_envelope_1.JsonSchema.optional(),
72
+ outputs: ipc_envelope_1.JsonSchema.optional(),
73
+ /** Names of environment variables / secrets this node expects to be injected. */
74
+ env: zod_1.z.array(zod_1.z.string()).optional(),
75
+ connections: zod_1.z.array(zod_1.z.string().min(1)).optional(),
76
+ defaults: zod_1.z.record(zod_1.z.unknown()).optional(),
77
+ bindings: zod_1.z.record(zod_1.z.string().regex(/^[A-Za-z_$][\w$]*$/), exports.NpmClientBinding).optional(),
78
+ ui: exports.PluginNodeUi.optional(),
79
+ });
80
+ /**
81
+ * A coarse capability the plugin needs at runtime. Shown on the install
82
+ * consent screen and enforced before a node is handed the resource.
83
+ */
84
+ exports.PluginPermission = zod_1.z.object({
85
+ resource: zod_1.z.enum(["project_data", "secrets", "network"]),
86
+ access: zod_1.z.enum(["read", "write", "outbound"]),
87
+ });
88
+ /** Discovery/marketplace metadata (used by the Studio Marketplace in Phase 14). */
89
+ exports.PluginIntegration = zod_1.z.object({
90
+ category: zod_1.z.string().optional(),
91
+ tags: zod_1.z.array(zod_1.z.string()).default([]),
92
+ /** Secrets/env the integration needs to authenticate (e.g. ["JIRA_TOKEN"]). */
93
+ auth: zod_1.z.array(zod_1.z.string()).optional(),
94
+ /** Original npm dependency used by generated npm nodes. */
95
+ npm: zod_1.z
96
+ .object({
97
+ package: zod_1.z.string(),
98
+ version: zod_1.z.string(),
99
+ spec: zod_1.z.string(),
100
+ })
101
+ .optional(),
102
+ });
103
+ /** Credential metadata only. Values are supplied by the installing user at runtime. */
104
+ exports.PluginConnection = zod_1.z
105
+ .object({
106
+ label: zod_1.z.string().min(1).max(240),
107
+ description: zod_1.z.string().max(4_000).optional(),
108
+ fields: zod_1.z.record(zod_1.z.string().regex(/^[A-Z_][A-Z0-9_]*$/, "credential fields must be environment variable names"), zod_1.z
109
+ .object({
110
+ label: zod_1.z.string().min(1).max(240),
111
+ description: zod_1.z.string().max(4_000).optional(),
112
+ secret: zod_1.z.boolean().default(true),
113
+ required: zod_1.z.boolean().default(true),
114
+ })
115
+ .strict()),
116
+ })
117
+ .strict();
118
+ /** The shared plugin contract used by the SDK, generators, and marketplace. */
119
+ exports.PluginManifest = zod_1.z
120
+ .object({
121
+ schemaVersion: zod_1.z.string().default(constants_1.PLUGIN_SCHEMA_VERSION),
122
+ /** Stable plugin id; namespaces its nodes as `<id>/<nodeId>`. */
123
+ id: zod_1.z.string().regex(/^[a-z0-9][a-z0-9-]*$/, "plugin id must be lowercase alphanumeric/dash"),
124
+ name: zod_1.z.string(),
125
+ version: zod_1.z.string(),
126
+ description: zod_1.z.string().optional(),
127
+ /** Implementation authority; absent on legacy artifacts. */
128
+ source: zod_1.z
129
+ .discriminatedUnion("kind", [
130
+ zod_1.z.object({ kind: zod_1.z.literal("plugin") }).strict(),
131
+ zod_1.z
132
+ .object({
133
+ kind: zod_1.z.literal("npm"),
134
+ package: zod_1.z.string().regex(/^(@[a-z0-9~._-]+\/)?[a-z0-9~._-]+$/),
135
+ version: zod_1.z.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/),
136
+ })
137
+ .strict(),
138
+ ])
139
+ .optional(),
140
+ icon: icons_1.IconName.optional(),
141
+ author: zod_1.z.string().optional(),
142
+ homepage: zod_1.z.string().optional(),
143
+ license: zod_1.z.string().optional(),
144
+ /** Distribution tiers this plugin may be discovered/installed from. Private by default. */
145
+ scope: zod_1.z.array(exports.PluginScope).default(["user"]),
146
+ /** Coarse runtime capabilities the plugin requests; consented to at install. */
147
+ permissions: zod_1.z.array(exports.PluginPermission).default([]),
148
+ integration: exports.PluginIntegration.optional(),
149
+ connections: zod_1.z.record(zod_1.z.string().regex(/^[a-z0-9][a-z0-9-]*$/), exports.PluginConnection).optional(),
150
+ nodes: zod_1.z.array(exports.PluginNode).default([]),
151
+ })
152
+ .superRefine((manifest, ctx) => {
153
+ const npm = manifest.integration?.npm;
154
+ if ((manifest.source?.kind === "plugin" && npm) ||
155
+ (manifest.source?.kind === "npm" &&
156
+ (npm?.package !== manifest.source.package || npm?.version !== manifest.source.version)))
157
+ ctx.addIssue({ code: "custom", path: ["source"], message: "source authority must match integration.npm" });
158
+ const ids = new Set();
159
+ manifest.nodes.forEach((node, index) => {
160
+ if (ids.has(node.id))
161
+ ctx.addIssue({ code: "custom", path: ["nodes", index, "id"], message: "node IDs must be unique" });
162
+ ids.add(node.id);
163
+ for (const binding of Object.values(node.bindings ?? {})) {
164
+ if (!npm || (binding.module !== npm.package && !binding.module.startsWith(`${npm.package}/`)))
165
+ ctx.addIssue({
166
+ code: "custom",
167
+ path: ["nodes", index, "bindings"],
168
+ message: "SDK factories must belong to the original npm package",
169
+ });
170
+ const credentialFields = new Set((node.connections ?? []).flatMap((name) => Object.keys(manifest.connections?.[name]?.fields ?? {})));
171
+ for (const name of Object.values(binding.env ?? {}))
172
+ if (!credentialFields.has(name))
173
+ ctx.addIssue({
174
+ code: "custom",
175
+ path: ["nodes", index, "bindings"],
176
+ message: `SDK binding requires connection field "${name}"`,
177
+ });
178
+ }
179
+ for (const connection of node.connections ?? []) {
180
+ if (!Object.hasOwn(manifest.connections ?? {}, connection))
181
+ ctx.addIssue({
182
+ code: "custom",
183
+ path: ["nodes", index, "connections"],
184
+ message: `unknown connection "${connection}"`,
185
+ });
186
+ }
187
+ });
188
+ if (Object.keys(manifest.connections ?? {}).length &&
189
+ !manifest.permissions.some((permission) => permission.resource === "secrets" && permission.access === "read"))
190
+ ctx.addIssue({
191
+ code: "custom",
192
+ path: ["permissions"],
193
+ message: "credential connections require secrets:read permission",
194
+ });
195
+ });
196
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/plugins/schema/plugin.ts"],"names":[],"mappings":";;;AAAA,wFAAwF;AACxF,6BAAwB;AACxB,iDAA4C;AAC5C,mCAAmC;AACnC,2CAAoD;AAEpD;;;;GAIG;AACU,QAAA,WAAW,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGzD,QAAA,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC;AAEnD,QAAA,0B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MAAM,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,EAAE,UAAU,CAAC;gBACxD,GAAG,CAAC,QAAQ,CAAC;oBACX,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC;oBACrC,OAAO,EAAE,uBAAuB,UAAU,GAAG;iBAC9C,CAAC,CAAC;QACP,CAAC;IACH,CAAC,CAAC,CAAC;IACH,IACE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,MAAM;QAC9C,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,KAAK,SAAS,IAAI,UAAU,CAAC,MAAM,KAAK,MAAM,CAAC;QAE7G,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,aAAa,CAAC;YACrB,OAAO,EAAE,wDAAwD;SAClE,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,103 @@
1
+ import type { InvocationContext } from "../schema/plugin-sdk";
2
+ import type { JsonSchema } from "./json-schema";
3
+ /**
4
+ * What a node IS. `function` (default) is a data-flow node with inputs/outputs.
5
+ * `class`/`service`/`const` are setup-time entities with no runtime I/O ports —
6
+ * they're depended on by function nodes rather than feeding data into them.
7
+ */
8
+ export type NodeKind = "function" | "class" | "service" | "const";
9
+ /**
10
+ * The signature a node author writes: a plain (optionally async) function from
11
+ * a JSON `inputs` payload to a JSON `outputs` payload. The second argument is
12
+ * the invocation context (config, env, attempt, …). Nodes never touch stdin,
13
+ * stdout, or the envelope — the runner harness owns the wire.
14
+ */
15
+ export type NodeHandler<I = any, O = any> = (inputs: I, context: InvocationContext) => O | Promise<O>;
16
+ export interface NodeDefinition<I = any, O = any> {
17
+ /** Stable node id — the discovery key used by `octonode scan`. */
18
+ id: string;
19
+ workflowId?: string;
20
+ label?: string;
21
+ description?: string;
22
+ symbol?: string;
23
+ defaults?: Record<string, unknown>;
24
+ run: NodeHandler<I, O>;
25
+ /** JSON Schema for the inputs payload. Validated by the runner before `run`. */
26
+ inputs?: JsonSchema;
27
+ /** JSON Schema for the outputs payload. Validated by the runner after `run`. */
28
+ outputs?: JsonSchema;
29
+ /** What this node is. Omitted → `function`. */
30
+ kind?: NodeKind;
31
+ /** Setup params (constructor/config shape) for non-`function` kinds. */
32
+ setup?: JsonSchema;
33
+ /** Advisory default icon (a one-time seed; `.octonode` owns it thereafter). */
34
+ icon?: any;
35
+ /** Advisory default config (a one-time seed; `.octonode` owns it thereafter). */
36
+ config?: Record<string, unknown>;
37
+ }
38
+ export interface DefineNodeArgs<I, O> {
39
+ id?: string;
40
+ workflowId?: string;
41
+ label?: string;
42
+ description?: string;
43
+ symbol?: string;
44
+ defaults?: Record<string, unknown>;
45
+ run: NodeHandler<I, O>;
46
+ inputs?: JsonSchema;
47
+ outputs?: JsonSchema;
48
+ kind?: NodeKind;
49
+ setup?: JsonSchema;
50
+ icon?: any;
51
+ config?: Record<string, unknown>;
52
+ }
53
+ /**
54
+ * Declare a node: package its handler, id, and the JSON Schema for its I/O. The
55
+ * schemas are both enforced at runtime (the runner validates) and reported via
56
+ * `describe` so the engine can populate `.octonode` and type-check edges.
57
+ */
58
+ export declare function defineNode<I = any, O = any>(args: DefineNodeArgs<I, O>): NodeDefinition<I, O>;
59
+ /** Args for the setup-time helpers. These entities have setup params, not I/O ports. */
60
+ export interface DefineSetupArgs<I = any, O = any> {
61
+ id: string;
62
+ /** JSON Schema for the setup/constructor params — rendered as a form in the editor. */
63
+ setup?: JsonSchema;
64
+ /**
65
+ * How the entity materializes at runtime (instantiate a client, read config…).
66
+ * Optional: setup-time entities aren't part of the data DAG, so a missing run
67
+ * defaults to a no-op that echoes the resolved setup config.
68
+ */
69
+ run?: NodeHandler<I, O>;
70
+ icon?: any;
71
+ config?: Record<string, unknown>;
72
+ }
73
+ export interface ServiceMethodSpec {
74
+ /** Object input keys mapped to positional class-method arguments. */
75
+ params?: string[];
76
+ inputs?: JsonSchema;
77
+ outputs?: JsonSchema;
78
+ }
79
+ export interface DefineExplicitServiceArgs<T extends object> {
80
+ id: string;
81
+ create: (context: InvocationContext) => T | Promise<T>;
82
+ expose: readonly (keyof T & string)[] | Record<string, ServiceMethodSpec>;
83
+ lifecycle?: "invocation" | "workflow-run" | "worker";
84
+ icon?: any;
85
+ setup?: JsonSchema;
86
+ config?: Record<string, unknown>;
87
+ }
88
+ export interface ServiceDefinition<T extends object = object> extends NodeDefinition {
89
+ kind: "service";
90
+ service: {
91
+ create: (context: InvocationContext) => T | Promise<T>;
92
+ lifecycle: "invocation" | "workflow-run" | "worker";
93
+ methods: Record<string, ServiceMethodSpec>;
94
+ };
95
+ }
96
+ /** Declare a service. Only the explicit create/expose form turns class methods into callable nodes. */
97
+ export declare function defineService<T extends object>(args: DefineExplicitServiceArgs<T>): ServiceDefinition<T>;
98
+ export declare function defineService<I = any, O = any>(args: DefineSetupArgs<I, O>): NodeDefinition<I, O>;
99
+ /** Declare a class: a class definition (constructor/config params, methods). */
100
+ export declare function defineClass<I = any, O = any>(args: DefineSetupArgs<I, O>): NodeDefinition<I, O>;
101
+ /** Declare a const: a configuration constant referenced by other nodes. */
102
+ export declare function defineConst<I = any, O = any>(args: DefineSetupArgs<I, O>): NodeDefinition<I, O>;
103
+ //# sourceMappingURL=define-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-node.d.ts","sourceRoot":"","sources":["../../../src/plugins/sdk/define-node.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAElE;;;;;GAKG;AACH,MAAM,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cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAE/F"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineNode = defineNode;
4
+ exports.defineService = defineService;
5
+ exports.defineClass = defineClass;
6
+ exports.defineConst = defineConst;
7
+ /**
8
+ * Declare a node: package its handler, id, and the JSON Schema for its I/O. The
9
+ * schemas are both enforced at runtime (the runner validates) and reported via
10
+ * `describe` so the engine can populate `.octonode` and type-check edges.
11
+ */
12
+ function defineNode(args) {
13
+ return {
14
+ id: args.id ?? "node",
15
+ ...(args.workflowId ? { workflowId: args.workflowId } : {}),
16
+ run: args.run,
17
+ label: args.label,
18
+ description: args.description,
19
+ symbol: args.symbol,
20
+ defaults: args.defaults,
21
+ inputs: args.inputs,
22
+ outputs: args.outputs,
23
+ kind: args.kind,
24
+ setup: args.setup,
25
+ icon: args.icon,
26
+ config: args.config,
27
+ };
28
+ }
29
+ const setupPassthrough = (_inputs, context) => (context?.config ?? {});
30
+ function defineService(args) {
31
+ if ("create" in args && "expose" in args) {
32
+ const methods = Array.isArray(args.expose)
33
+ ? Object.fromEntries(args.expose.map((name) => [String(name), {}]))
34
+ : args.expose;
35
+ return {
36
+ ...defineNode({
37
+ id: args.id,
38
+ run: setupPassthrough,
39
+ kind: "service",
40
+ setup: args.setup,
41
+ icon: args.icon,
42
+ config: args.config,
43
+ }),
44
+ kind: "service",
45
+ service: { create: args.create, lifecycle: args.lifecycle ?? "invocation", methods },
46
+ };
47
+ }
48
+ return defineNode({ ...args, run: args.run ?? setupPassthrough, kind: "service" });
49
+ }
50
+ /** Declare a class: a class definition (constructor/config params, methods). */
51
+ function defineClass(args) {
52
+ return defineNode({ ...args, run: args.run ?? setupPassthrough, kind: "class" });
53
+ }
54
+ /** Declare a const: a configuration constant referenced by other nodes. */
55
+ function defineConst(args) {
56
+ return defineNode({ ...args, run: args.run ?? setupPassthrough, kind: "const" });
57
+ }
58
+ //# sourceMappingURL=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AAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YACnE,CAAC,CAAE,IAAI,CAAC,MAA4C,CAAC;QACvD,OAAO;YACL,GAAG,UAAU,CAAC;gBACZ,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,GAAG,EAAE,gBAAgB;gBACrB,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC;YACF,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,YAAY,EAAE,OAAO,EAAE;SAC7D,CAAC;IAC5B,CAAC;IACD,OAAO,UAAU,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;AACrF,CAAC;AAED,gFAAgF;AAChF,SAAgB,WAAW,CAAmB,IAA2B;IACvE,OAAO,UAAU,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,gBAAgB,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AACnF,CAAC;AAED,2EAA2E;AAC3E,SAAgB,WAAW,CAAmB,IAA2B;IACvE,OAAO,UAAU,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,gBAAgB,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AACnF,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Discovery is static: importing application modules would execute user code. */
2
+ export declare function generateNodeCatalog(root: string, files?: readonly string[], check?: boolean): string;
3
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/sdk/definitions/compiler/catalog.ts"],"names":[],"mappings":"AAOA,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,UAAQ,GAAG,MAAM,CAyFlG"}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.generateNodeCatalog = generateNodeCatalog;
37
+ // Generated from packages/plugin-runtime/src/definitions/compiler/catalog.ts. Do not edit; run the Octonode SDK sync.
38
+ const ts = __importStar(require("typescript"));
39
+ const node_fs_1 = require("node:fs");
40
+ const node_path_1 = require("node:path");
41
+ const node_crypto_1 = require("node:crypto");
42
+ const constants_1 = require("./constants");
43
+ /** Discovery is static: importing application modules would execute user code. */
44
+ function generateNodeCatalog(root, files, check = false) {
45
+ root = (0, node_fs_1.realpathSync)(root);
46
+ const inventory = (0, node_path_1.resolve)(root, constants_1.NODES_FILENAME);
47
+ if ((0, node_fs_1.existsSync)(inventory)) {
48
+ if ((0, node_fs_1.realpathSync)(inventory) !== inventory)
49
+ throw new Error(`${constants_1.NODES_FILENAME} must not be a symlink`);
50
+ const current = (0, node_fs_1.readFileSync)(inventory, "utf8");
51
+ const prefix = ["// Generated npm inventory: ", "// Generated workflow inventory: "].find((prefix) => current.startsWith(prefix));
52
+ if (prefix) {
53
+ const newline = current.indexOf("\n");
54
+ const body = current.slice(newline + 1);
55
+ if (current.slice(prefix.length, newline) !== (0, node_crypto_1.createHash)("sha256").update(body).digest("hex"))
56
+ throw new Error(`${constants_1.NODES_FILENAME} was edited; regenerate from the original package or workflow`);
57
+ return current;
58
+ }
59
+ }
60
+ const configPath = (0, node_fs_1.existsSync)((0, node_path_1.resolve)(root, "tsconfig.json")) ? (0, node_path_1.resolve)(root, "tsconfig.json") : undefined;
61
+ const config = configPath ? ts.readConfigFile(configPath, ts.sys.readFile) : { config: {} };
62
+ if (config.error)
63
+ throw new Error(ts.flattenDiagnosticMessageText(config.error.messageText, "\n"));
64
+ const parsed = ts.parseJsonConfigFileContent(config.config, ts.sys, root);
65
+ const error = parsed.errors.find((error) => error.code !== 18003);
66
+ if (error)
67
+ throw new Error(ts.flattenDiagnosticMessageText(error.messageText, "\n"));
68
+ const paths = (files ?? parsed.fileNames)
69
+ .map((file) => (0, node_path_1.resolve)(root, file))
70
+ .filter((file) => {
71
+ const path = (0, node_path_1.relative)(root, file).replaceAll("\\", "/");
72
+ return (!path.startsWith("../") &&
73
+ !path.split("/").some((part) => part === "node_modules" || part === "dist" || part.startsWith(".")) &&
74
+ !constants_1.DEFINITION_FILES.includes(path) &&
75
+ !/\.d\.[cm]?ts$/.test(path) &&
76
+ /\.[cm]?ts$/.test(path));
77
+ })
78
+ .sort();
79
+ // Inventory needs callable export identities only; definition compilation checks full types.
80
+ const program = ts.createProgram(paths, {
81
+ ...parsed.options,
82
+ noEmit: true,
83
+ noLib: true,
84
+ noResolve: true,
85
+ types: [],
86
+ skipLibCheck: true,
87
+ });
88
+ const checker = program.getTypeChecker();
89
+ const entries = [];
90
+ for (const path of paths) {
91
+ const source = program.getSourceFile(path);
92
+ const module = source && checker.getSymbolAtLocation(source);
93
+ if (!module)
94
+ continue;
95
+ for (const exported of checker.getExportsOfModule(module).sort((a, b) => a.name.localeCompare(b.name))) {
96
+ const symbol = exported.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(exported) : exported;
97
+ const declaration = symbol.valueDeclaration;
98
+ if (!declaration || (0, node_path_1.resolve)(declaration.getSourceFile().fileName) !== path)
99
+ continue;
100
+ if (!checker.getTypeOfSymbolAtLocation(symbol, declaration).getCallSignatures().length)
101
+ continue;
102
+ entries.push({ path: (0, node_path_1.relative)(root, path).replaceAll("\\", "/"), name: exported.name });
103
+ }
104
+ }
105
+ const counts = new Map();
106
+ for (const entry of entries)
107
+ counts.set(entry.name, (counts.get(entry.name) ?? 0) + 1);
108
+ const key = (entry) => counts.get(entry.name) === 1
109
+ ? entry.name
110
+ : `${entry.name}_${(0, node_crypto_1.createHash)("sha256").update(entry.path).digest("hex").slice(0, 8)}`;
111
+ const text = "// Generated by Octonode. Do not edit.\n" +
112
+ entries
113
+ .map((entry, index) => `import { ${entry.name} as node${index} } from ${JSON.stringify("./" +
114
+ entry.path
115
+ .replace(/\.ts$/, ".js")
116
+ .replace(/\.mts$/, ".mjs")
117
+ .replace(/\.cts$/, ".cjs"))};`)
118
+ .join("\n") +
119
+ "\nexport const nodes = {\n" +
120
+ entries.map((entry, index) => ` ${JSON.stringify(key(entry))}: node${index},`).join("\n") +
121
+ "\n} as const;\n";
122
+ const output = (0, node_path_1.resolve)(root, constants_1.NODES_FILENAME);
123
+ if ((0, node_fs_1.existsSync)(output) && (0, node_fs_1.realpathSync)(output) !== output)
124
+ throw new Error(`${constants_1.NODES_FILENAME} must not be a symlink`);
125
+ if (check) {
126
+ if (!(0, node_fs_1.existsSync)(output) || (0, node_fs_1.readFileSync)(output, "utf8") !== text)
127
+ throw new Error(`${constants_1.NODES_FILENAME} is stale; regenerate the node inventory`);
128
+ }
129
+ else if (!(0, node_fs_1.existsSync)(output) || (0, node_fs_1.readFileSync)(output, "utf8") !== text)
130
+ (0, node_fs_1.writeFileSync)(output, text);
131
+ return text;
132
+ }
133
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../../../src/plugins/sdk/definitions/compiler/catalog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,kDAyFC;AAjGD,sHAAsH;AACtH,+CAAiC;AACjC,qCAAgF;AAChF,yCAA8C;AAC9C,6CAAyC;AACzC,2CAA+D;AAE/D,kFAAkF;AAClF,SAAgB,mBAAmB,CAAC,IAAY,EAAE,KAAyB,EAAE,KAAK,GAAG,KAAK;IACxF,IAAI,GAAG,IAAA,sBAAY,EAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,SAAS,GAAG,IAAA,mBAAO,EAAC,IAAI,EAAE,0BAAc,CAAC,CAAC;IAChD,IAAI,IAAA,oBAAU,EAAC,SAAS,CAAC,EAAE,CAAC;QAC1B,IAAI,IAAA,sBAAY,EAAC,SAAS,CAAC,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,0BAAc,wBAAwB,CAAC,CAAC;QACtG,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,CAAC,8BAA8B,EAAE,mCAAmC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,E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A,sBAAY,EAAC,MAAM,CAAC,KAAK,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,0BAAc,wBAAwB,CAAC,CAAC;IACtH,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,CAAC,IAAA,oBAAU,EAAC,MAAM,CAAC,IAAI,IAAA,sBAAY,EAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI;YAC9D,MAAM,IAAI,KAAK,CAAC,GAAG,0BAAc,0CAA0C,CAAC,CAAC;IACjF,CAAC;SAAM,IAAI,CAAC,IAAA,oBAAU,EAAC,MAAM,CAAC,IAAI,IAAA,sBAAY,EAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI;QAAE,IAAA,uBAAa,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACrG,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const DEFINITION_FILENAME = "octonode.config.ts";
2
+ export declare const PLUGIN_FILENAME = "octonode.plugin.ts";
3
+ export declare const NODES_FILENAME = "octonode.nodes.ts";
4
+ export declare const DEFINITION_FILES: string[];
5
+ export declare const DEFINITION_MODULES: string[];
6
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/sdk/definitions/compiler/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB,uBAAuB,CAAC;AACxD,eAAO,MAAM,eAAe,uBAAuB,CAAC;AACpD,eAAO,MAAM,cAAc,sBAAsB,CAAC;AAClD,eAAO,MAAM,gBAAgB,UAAyD,CAAC;AACvF,eAAO,MAAM,kBAAkB,UAE9B,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFINITION_MODULES = exports.DEFINITION_FILES = exports.NODES_FILENAME = exports.PLUGIN_FILENAME = exports.DEFINITION_FILENAME = void 0;
4
+ // Generated from packages/plugin-runtime/src/definitions/compiler/constants.ts. Do not edit; run the Octonode SDK sync.
5
+ exports.DEFINITION_FILENAME = "octonode.config.ts";
6
+ exports.PLUGIN_FILENAME = "octonode.plugin.ts";
7
+ exports.NODES_FILENAME = "octonode.nodes.ts";
8
+ exports.DEFINITION_FILES = [exports.DEFINITION_FILENAME, exports.PLUGIN_FILENAME, exports.NODES_FILENAME];
9
+ exports.DEFINITION_MODULES = ["@octonodes/sdk", "@octonode/plugin-runtime", "@octonode/sdk"].flatMap((scope) => ["definitions", "project", "plugin", "nodes"].map((entry) => `${scope}/${entry}`));
10
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/plugins/sdk/definitions/compiler/constants.ts"],"names":[],"mappings":";;;AAAA,wHAAwH;AAC3G,QAAA,mBAAmB,GAAG,oBAAoB,CAAC;AAC3C,QAAA,eAAe,GAAG,oBAAoB,CAAC;AACvC,QAAA,cAAc,GAAG,mBAAmB,CAAC;AACrC,QAAA,gBAAgB,GAAG,CAAC,2BAAmB,EAAE,uBAAe,EAAE,sBAAc,CAAC,CAAC;AAC1E,QAAA,kBAAkB,GAAG,CAAC,gBAAgB,EAAE,0BAA0B,EAAE,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAClH,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,KAAK,EAAE,CAAC,CAClF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { CompiledDefinition } from "./types";
2
+ export { DEFINITION_FILENAME, PLUGIN_FILENAME, NODES_FILENAME, DEFINITION_FILES } from "./constants";
3
+ export { generateNodeCatalog } from "./catalog";
4
+ export type { CompiledDefinition, CompiledNode } from "./types";
5
+ /** Build-time TypeScript config checking only; workflow lowering remains in the Rust parser. */
6
+ export declare function compileDefinition(root: string, extraFiles?: readonly string[], kind?: "project" | "plugin"): CompiledDefinition | undefined;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/sdk/definitions/compiler/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,SAAS,CAAC;AAIhE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEhE,gGAAgG;AAChG,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,UAAU,GAAE,SAAS,MAAM,EAAO,EAClC,IAAI,GAAE,SAAS,GAAG,QAAoB,GACrC,kBAAkB,GAAG,SAAS,CA4XhC"}