@octonodes/sdk 0.1.0 → 0.1.7
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/PLUGINS.md +289 -91
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/gen/types.gen.d.ts +240 -1
- package/dist/gen/types.gen.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/plugins/schema/plugin.d.ts +475 -16
- package/dist/plugins/schema/plugin.d.ts.map +1 -1
- package/dist/plugins/schema/plugin.js +105 -8
- package/dist/plugins/schema/plugin.js.map +1 -1
- package/dist/plugins/sdk/definitions/compiler/catalog.d.ts +3 -0
- package/dist/plugins/sdk/definitions/compiler/catalog.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/catalog.js +166 -0
- package/dist/plugins/sdk/definitions/compiler/catalog.js.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/constants.d.ts +6 -0
- package/dist/plugins/sdk/definitions/compiler/constants.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/constants.js +10 -0
- package/dist/plugins/sdk/definitions/compiler/constants.js.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/index.d.ts +7 -0
- package/dist/plugins/sdk/definitions/compiler/index.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/index.js +490 -0
- package/dist/plugins/sdk/definitions/compiler/index.js.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/literals.d.ts +5 -0
- package/dist/plugins/sdk/definitions/compiler/literals.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/literals.js +78 -0
- package/dist/plugins/sdk/definitions/compiler/literals.js.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/schemas.d.ts +4 -0
- package/dist/plugins/sdk/definitions/compiler/schemas.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/schemas.js +95 -0
- package/dist/plugins/sdk/definitions/compiler/schemas.js.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/types.d.ts +23 -0
- package/dist/plugins/sdk/definitions/compiler/types.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/types.js +3 -0
- package/dist/plugins/sdk/definitions/compiler/types.js.map +1 -0
- package/dist/plugins/sdk/definitions/index.d.ts +7 -0
- package/dist/plugins/sdk/definitions/index.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/index.js +16 -0
- package/dist/plugins/sdk/definitions/index.js.map +1 -0
- package/dist/plugins/sdk/definitions/npm/emit/js.d.ts +4 -0
- package/dist/plugins/sdk/definitions/npm/emit/js.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/npm/emit/js.js +190 -0
- package/dist/plugins/sdk/definitions/npm/emit/js.js.map +1 -0
- package/dist/plugins/sdk/definitions/npm/types.d.ts +63 -0
- package/dist/plugins/sdk/definitions/npm/types.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/npm/types.js +3 -0
- package/dist/plugins/sdk/definitions/npm/types.js.map +1 -0
- package/dist/plugins/sdk/definitions/types.d.ts +46 -0
- package/dist/plugins/sdk/definitions/types.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/types.js +3 -0
- package/dist/plugins/sdk/definitions/types.js.map +1 -0
- package/dist/plugins/sdk/nodes/index.d.ts +5 -0
- package/dist/plugins/sdk/nodes/index.d.ts.map +1 -0
- package/dist/plugins/sdk/nodes/index.js +12 -0
- package/dist/plugins/sdk/nodes/index.js.map +1 -0
- package/dist/plugins/sdk/plugin/index.d.ts +3 -0
- package/dist/plugins/sdk/plugin/index.d.ts.map +1 -0
- package/dist/plugins/sdk/plugin/index.js +8 -0
- package/dist/plugins/sdk/plugin/index.js.map +1 -0
- package/dist/plugins/sdk/plugin.js +1 -1
- package/dist/plugins/sdk/plugin.js.map +1 -1
- package/dist/plugins/sdk/plugins/define-node.js +1 -1
- package/dist/plugins/sdk/plugins/define-node.js.map +1 -1
- package/dist/plugins/sdk/plugins/index.js +1 -1
- package/dist/plugins/sdk/plugins/index.js.map +1 -1
- package/dist/plugins/sdk/project/index.d.ts +5 -0
- package/dist/plugins/sdk/project/index.d.ts.map +1 -0
- package/dist/plugins/sdk/project/index.js +10 -0
- package/dist/plugins/sdk/project/index.js.map +1 -0
- package/dist/plugins/sdk/runner.js +1 -1
- package/dist/plugins/sdk/runner.js.map +1 -1
- package/package.json +45 -1
package/PLUGINS.md
CHANGED
|
@@ -1,128 +1,326 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Typed Octonode authoring files
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
## Marketplace library imports
|
|
4
|
+
|
|
5
|
+
Custom integrations are marketplace artifacts, not one npm package per integration.
|
|
6
|
+
In `definePlugin`, set `library: { entry: "src/index.ts" }` to expose named public
|
|
7
|
+
exports. Link a workflow node to its real library function with
|
|
8
|
+
`defineNode(nodes.createIssueNode, { id: "create-issue", libraryExport: "createIssue" })`.
|
|
9
|
+
The workflow adapter may accept flattened inputs and host credentials; the library
|
|
10
|
+
function keeps its original parameters and explicit connection object.
|
|
11
|
+
|
|
12
|
+
A node can override the plugin-level source default with
|
|
13
|
+
`source: { kind: "npm", package: "jira.js", version: "6.2.0" }`, but only on a
|
|
14
|
+
generated npm handle for that exact implementation. Local functions use
|
|
15
|
+
`source: { kind: "plugin" }`. The compiler verifies these declarations and derives
|
|
16
|
+
all native npm dependencies. Presentation settings cannot redirect executable code.
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
octonodes plugin install jira --version <release> --alias jira
|
|
20
|
+
octonodes plugin install jira-sdk --version <release>
|
|
21
|
+
octonodes plugin update jira --version <release> --dry-run
|
|
22
|
+
octonodes plugin update jira --version <release>
|
|
23
|
+
octonodes plugin remove jira
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { createIssue } from "@octonodes/plugin/jira";
|
|
28
|
+
import { getIssue } from "jira.js/cloud";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Only selected custom libraries enter the private generated local package.
|
|
32
|
+
Real npm packages are installed by the consuming project's package manager.
|
|
33
|
+
Commit `octonode.lock`, `package.json`, and its native lockfile. The disposable
|
|
34
|
+
`.octonode-generated/` directory ignores its generated contents automatically;
|
|
35
|
+
the existing `.octonode` file is unchanged.
|
|
36
|
+
|
|
37
|
+
For clean CI, use a separately available **compatible pinned CLI** before installing
|
|
38
|
+
the application's dependencies:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
octonodes install --frozen --artifacts-only
|
|
42
|
+
npm ci
|
|
43
|
+
npm run build
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Use the equivalent native frozen install for Yarn, pnpm, or Bun. Public cached
|
|
47
|
+
artifacts can restore with `--offline --artifacts-only`; private artifacts require
|
|
48
|
+
online authorization. `plugin recover` repairs an interrupted native transaction,
|
|
49
|
+
preserving post-crash file copies in the reported recovery directory.
|
|
50
|
+
|
|
51
|
+
The first format supports portable bundled JavaScript with self-contained public
|
|
52
|
+
declarations and license notices. Unsupported dynamic imports, external public types,
|
|
53
|
+
native addons, and default library exports fail the build. Node 24 on macOS/Linux
|
|
54
|
+
is supported; use WSL on Windows. Library imports run with application privileges,
|
|
55
|
+
not the workflow permission sandbox. Importing an artifact never starts its IPC runner.
|
|
56
|
+
|
|
57
|
+
Existing public `@octonodes/plugin` consumers must explicitly opt into migration
|
|
58
|
+
with `--migrate`. The source changes here require a new compatible release; existing
|
|
59
|
+
published version numbers alone do not imply support.
|
|
60
|
+
|
|
61
|
+
> **Status:** implemented in the source SDK and devtools. Publishing updated npm packages is a separate release step.
|
|
62
|
+
|
|
63
|
+
Octonode keeps three concerns separate: discovered code, project presentation,
|
|
64
|
+
and a distributable plugin. The generated YAML/JSON remains the runtime and
|
|
65
|
+
installation format; users author TypeScript instead of editing that large file.
|
|
66
|
+
|
|
67
|
+
| File | Owner | Purpose | Required |
|
|
68
|
+
| -------------------- | ----------------------------- | ------------------------------------------------------------------- | ------------------------------ |
|
|
69
|
+
| `octonode.nodes.ts` | Octonode generator | Typed inventory of discovered functions or npm exports | Generated when code is scanned |
|
|
70
|
+
| `octonode.config.ts` | Project author | Optional presentation defaults for nodes inside the current project | No |
|
|
71
|
+
| `octonode.plugin.ts` | Plugin author or npm importer | Select and present public nodes in one distributable plugin | Only when building a plugin |
|
|
72
|
+
|
|
73
|
+
These filenames are reserved. Octonode excludes all three from workflow source
|
|
74
|
+
discovery, so definition code can never become an executable workflow node.
|
|
75
|
+
|
|
76
|
+
Typical file combinations are:
|
|
77
|
+
|
|
78
|
+
- An existing Octonode project has generated `octonode.nodes.ts` and may add
|
|
79
|
+
`octonode.config.ts` for local appearance.
|
|
80
|
+
- Exporting selected project functions or saved workflows adds
|
|
81
|
+
`octonode.plugin.ts`; the plugin reads the generated inventory directly. Saved
|
|
82
|
+
DAG workflows use the existing `octonode plugin from-workflow` export first;
|
|
83
|
+
its package includes a typed inventory and plugin definition.
|
|
84
|
+
- Adapting an npm package generates `octonode.nodes.ts` and
|
|
85
|
+
`octonode.plugin.ts`. It does not need `octonode.config.ts` unless the same
|
|
86
|
+
workspace is also used as an interactive Octonode project.
|
|
87
|
+
|
|
88
|
+
## `octonode.nodes.ts`: generated inventory
|
|
89
|
+
|
|
90
|
+
This file is the typed bridge between application code and the two authored
|
|
91
|
+
files. Octonode generates one stable handle for each discovered local function,
|
|
92
|
+
selected npm export, or workflow in a `from-workflow` export package. Handles carry the source identity and
|
|
93
|
+
inferred input/output types used by autocomplete and compile-time validation.
|
|
94
|
+
|
|
95
|
+
A local source inventory contains actual function references:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
// Generated by Octonode. Do not edit.
|
|
99
|
+
import { uppercase as node0 } from "./src/text.js";
|
|
100
|
+
export const nodes = { uppercase: node0 } as const;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Npm and workflow inventories carry the inferred contracts and adapter identities
|
|
104
|
+
instead. Their generated content is checked before building.
|
|
105
|
+
|
|
106
|
+
The exact generated representation is an SDK implementation detail. Authors
|
|
107
|
+
only import `nodes`. The file is normally committed so editors and CI have the
|
|
108
|
+
same types. `octonodes plugin nodes --check` fails when it is stale or edited.
|
|
109
|
+
`octonodes plugin nodes` and local plugin builds regenerate source inventories.
|
|
110
|
+
Npm and workflow inventories are regenerated only by their original import/export commands; builds verify their generated content.
|
|
111
|
+
|
|
112
|
+
For npm packages, the stable identity is the exact module specifier plus export name. This
|
|
113
|
+
lets Octonode regenerate inferred types without losing authored presentation.
|
|
114
|
+
|
|
115
|
+
## `octonode.config.ts`: current-project presentation
|
|
116
|
+
|
|
117
|
+
This optional file customizes how discovered nodes appear inside the current
|
|
118
|
+
project. An empty project definition is valid. A node needs only its generated
|
|
119
|
+
handle and the fields the author wants to change:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
import { defineNode, defineProject } from "@octonodes/sdk/project";
|
|
123
|
+
import { nodes } from "./octonode.nodes.js";
|
|
124
|
+
|
|
125
|
+
export default defineProject({
|
|
126
|
+
nodes: [
|
|
127
|
+
defineNode(nodes.uppercase, {
|
|
128
|
+
label: "Make uppercase",
|
|
129
|
+
symbol: "Aa",
|
|
130
|
+
icon: "text-cursor-input",
|
|
131
|
+
}),
|
|
132
|
+
],
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The discovered definition supplies the ID, contract, and execution target.
|
|
137
|
+
Unlisted nodes keep Octonode's built-in presentation. This file cannot select a
|
|
138
|
+
publishable plugin, change execution code, or redefine inferred input/output
|
|
139
|
+
contracts.
|
|
140
|
+
|
|
141
|
+
Presentation precedence is:
|
|
142
|
+
|
|
143
|
+
1. Octonode's inferred or built-in defaults.
|
|
144
|
+
2. Defaults in `octonode.config.ts`.
|
|
145
|
+
3. Shared project settings.
|
|
146
|
+
4. Explicit personal or UI overrides.
|
|
147
|
+
|
|
148
|
+
Removing a code default therefore does not erase a user's explicit override.
|
|
149
|
+
|
|
150
|
+
## `octonode.plugin.ts`: distribution boundary
|
|
151
|
+
|
|
152
|
+
This file defines one independently versioned plugin. It selects nodes from the
|
|
153
|
+
generated inventory and gives the external API stable names and presentation:
|
|
5
154
|
|
|
6
155
|
```ts
|
|
7
|
-
import {
|
|
156
|
+
import { defineNode, definePlugin } from "@octonodes/sdk/plugin";
|
|
157
|
+
import { nodes } from "./octonode.nodes.js";
|
|
8
158
|
|
|
9
159
|
export default definePlugin({
|
|
10
160
|
id: "text-tools",
|
|
11
161
|
name: "Text tools",
|
|
12
162
|
version: "1.0.0",
|
|
13
|
-
license: "MIT",
|
|
14
|
-
scope: ["public"],
|
|
15
163
|
nodes: [
|
|
16
|
-
defineNode({
|
|
164
|
+
defineNode(nodes.uppercase, {
|
|
17
165
|
id: "uppercase",
|
|
18
|
-
label: "
|
|
19
|
-
|
|
20
|
-
type: "object",
|
|
21
|
-
properties: { text: { type: "string" } },
|
|
22
|
-
required: ["text"],
|
|
23
|
-
},
|
|
24
|
-
outputs: {
|
|
25
|
-
type: "object",
|
|
26
|
-
properties: { text: { type: "string" } },
|
|
27
|
-
required: ["text"],
|
|
28
|
-
},
|
|
29
|
-
run: ({ text }) => ({ text: text.toUpperCase() }),
|
|
166
|
+
label: "Make uppercase",
|
|
167
|
+
icon: "text-cursor-input",
|
|
30
168
|
}),
|
|
31
169
|
],
|
|
32
170
|
});
|
|
33
171
|
```
|
|
34
172
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
`octonode.yml`, CommonJS runner, package metadata, port documentation, and file hashes.
|
|
40
|
-
No extra runtime installation is needed for these bundled artifacts.
|
|
173
|
+
The plugin file owns public node selection, stable public IDs, plugin metadata,
|
|
174
|
+
permissions, connections, assets, and optional inspector UI. Project-only
|
|
175
|
+
presentation does not leak into a published plugin. A package root defines one
|
|
176
|
+
plugin; independently versioned plugins use separate package roots.
|
|
41
177
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
178
|
+
For workflow nodes, the plugin's `icon` is the default. An `icon` supplied to
|
|
179
|
+
`defineNode` overrides it for that node; explicit user presentation overrides
|
|
180
|
+
remain highest priority. Without either icon, the renderer uses its normal fallback.
|
|
181
|
+
|
|
182
|
+
Declare `source: { kind: "plugin" }` when the plugin owns its implementation.
|
|
183
|
+
For upstream adapters, declare `source: { kind: "npm", package: "lodash",
|
|
184
|
+
version: "<exact inspected version>" }`. The compiler checks this against the
|
|
185
|
+
generated inventory and derives `integration.npm`; a mismatched package, version,
|
|
186
|
+
or execution source fails the build. Omitting `source` remains compatible with
|
|
187
|
+
older definitions: compilation infers it from the selected handles.
|
|
188
|
+
|
|
189
|
+
Npm authority does not fork or republish the dependency. Consumer code imports
|
|
190
|
+
the original package using the module forms it supports. Source indexing recognizes
|
|
191
|
+
named imports, including aliases and exact subpaths, against the selected plugin
|
|
192
|
+
manifest. Calls remain source-backed: library connection arguments are explicit,
|
|
193
|
+
and workflow credential injection is not silently applied to ordinary code.
|
|
194
|
+
Namespace/default imports remain ordinary source calls without plugin decoration.
|
|
195
|
+
|
|
196
|
+
Local function contracts support JSON primitives, literal enums, arrays, finite
|
|
197
|
+
object shapes, optional parameters, and async returns. Unsupported contracts such
|
|
198
|
+
as `any`, recursive types, classes, and generic or overloaded functions require a
|
|
199
|
+
concrete typed wrapper. Project presentation does not impose these plugin contract
|
|
200
|
+
limits. Npm adapters retain the existing npm compiler's schemas and warnings.
|
|
201
|
+
|
|
202
|
+
The build emits the existing artifact:
|
|
203
|
+
|
|
204
|
+
```text
|
|
205
|
+
dist/plugins/text-tools/
|
|
206
|
+
octonode.yml
|
|
207
|
+
runner files
|
|
208
|
+
assets
|
|
209
|
+
integrity metadata
|
|
48
210
|
```
|
|
49
211
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
`
|
|
53
|
-
|
|
54
|
-
typechecking; the CLI build bundles code but does not run the TypeScript checker.
|
|
212
|
+
The generated manifest remains compatible with the existing loader,
|
|
213
|
+
marketplace, and installations. `octonode.yml`, `octonode.yaml`,
|
|
214
|
+
`octonode.json`, and legacy `octonode.plugin.json` remain readable inputs for
|
|
215
|
+
existing plugins. There is no new hand-authored `octonode.plugin.yml` format.
|
|
55
216
|
|
|
56
|
-
|
|
57
|
-
in code. `definePlugin` generates commands and language metadata. Keep metadata
|
|
58
|
-
independent of environment variables, timestamps, and random values; the runner
|
|
59
|
-
rejects a definition that differs from the built manifest. Build imports and
|
|
60
|
-
executes your definition locally. Only build trusted source.
|
|
217
|
+
## Npm package flow
|
|
61
218
|
|
|
62
|
-
Use `
|
|
219
|
+
Use `--module jira.js/cloud` with `from-npm jira.js@6.2.0` to inspect an
|
|
220
|
+
exported subpath. The generated handle retains that module specifier; installation
|
|
221
|
+
still targets the original `jira.js` package and exact version.
|
|
222
|
+
|
|
223
|
+
An upstream function that takes a non-JSON SDK client can bind that parameter
|
|
224
|
+
to the package's own factory in `octonode.plugin.ts`:
|
|
63
225
|
|
|
64
226
|
```ts
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
227
|
+
defineNode(nodes.getIssue, {
|
|
228
|
+
connections: ["jira"],
|
|
229
|
+
bindings: {
|
|
230
|
+
client: {
|
|
231
|
+
module: "jira.js/core",
|
|
232
|
+
export: "createClient",
|
|
233
|
+
options: { auth: { type: "bearer" }, retry: { maxAttempts: 1 }, onSchemaMismatch: "throw" },
|
|
234
|
+
env: { host: "JIRA_HOST", "auth.token": "JIRA_ACCESS_TOKEN" },
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
});
|
|
72
238
|
```
|
|
73
239
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
240
|
+
Declare both environment names as fields of the `jira` connection, including
|
|
241
|
+
`secrets:read` permission for secret fields. Factories must belong to the original
|
|
242
|
+
npm package. At runtime the adapter passes one options object to the factory,
|
|
243
|
+
awaits its result, and injects it into the original function's argument position.
|
|
244
|
+
Bound parameters are excluded from public inputs and defaults; input attempts to
|
|
245
|
+
override them fail. Credentials are read only at runtime, never during compilation.
|
|
246
|
+
Upstream errors from bound calls are sanitized before crossing IPC.
|
|
78
247
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
rejected. Native addons and unbundleable dynamic dependencies are not supported.
|
|
83
|
-
Code that reads additional files dynamically must declare those assets explicitly.
|
|
84
|
-
Do not hardcode credentials: file exclusions cannot detect secrets in source.
|
|
248
|
+
This supports exported factory functions, not class constructors or arbitrary
|
|
249
|
+
initialization scripts. Consumer source still uses `getIssue(client, parameters)`
|
|
250
|
+
from `jira.js/cloud`; no Octonode replacement import is introduced.
|
|
85
251
|
|
|
86
|
-
|
|
252
|
+
`octonode plugin from-npm <package>` currently inspects exported functions and
|
|
253
|
+
writes the final manifest and adapter. The importer now also creates an editable typed layer:
|
|
87
254
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
255
|
+
1. Inspect package declarations and infer callable exports and schemas.
|
|
256
|
+
2. Generate `octonode.nodes.ts` from package/export identities.
|
|
257
|
+
3. Create `octonode.plugin.ts` with all selected exports and inferred defaults.
|
|
258
|
+
4. Let the author rename, hide, reorder, or decorate nodes in that file.
|
|
259
|
+
5. Run `npm install`, then `npm run build` in the generated package to produce
|
|
260
|
+
`dist/plugins/<id>/octonode.yml` from the typed definition.
|
|
93
261
|
|
|
94
|
-
|
|
262
|
+
The root `octonode.json` remains the immediate default artifact for existing
|
|
263
|
+
`from-npm` consumers. Customized distributions use the `dist/plugins/<id>`
|
|
264
|
+
artifact. After regenerating the inventory with `--force`, rebuild to apply
|
|
265
|
+
customizations to the new package version.
|
|
95
266
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
octonodes plugin publish dist/plugins/text-tools
|
|
100
|
-
```
|
|
267
|
+
On regeneration, Octonode updates the generated inventory and preserves plugin
|
|
268
|
+
overrides by package/export identity. Removed exports produce a clear compile
|
|
269
|
+
error until the author removes or replaces the corresponding plugin entry.
|
|
101
270
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
271
|
+
```mermaid
|
|
272
|
+
flowchart LR
|
|
273
|
+
S[Local source, workflows, or npm package] --> G[Octonode discovery]
|
|
274
|
+
G --> N[octonode.nodes.ts]
|
|
275
|
+
N --> C[octonode.config.ts]
|
|
276
|
+
N --> P[octonode.plugin.ts]
|
|
277
|
+
C --> A[Current project appearance]
|
|
278
|
+
P --> B[Plugin build]
|
|
279
|
+
B --> Y[Generated octonode.yml artifact]
|
|
280
|
+
```
|
|
108
281
|
|
|
109
|
-
|
|
110
|
-
each plugin independently and increment its version before another release.
|
|
111
|
-
Publishing checks file hashes and refuses changed or extra files. A normal rebuild
|
|
112
|
-
replaces a previous intact generated artifact; modified output is preserved and
|
|
113
|
-
must be moved aside before rebuilding. Edit the TypeScript source, not generated YAML.
|
|
282
|
+
## Compiler rules
|
|
114
283
|
|
|
115
|
-
|
|
284
|
+
- TypeScript performs autocomplete and type checking; Octonode statically reads
|
|
285
|
+
definitions without executing them.
|
|
286
|
+
- Only generated handles from `octonode.nodes.ts` may be passed to `defineNode`.
|
|
287
|
+
- Definition SDK imports outside the three reserved files fail compilation.
|
|
288
|
+
- Unknown keys, duplicate public IDs, missing handles, and invalid metadata fail
|
|
289
|
+
with source locations.
|
|
290
|
+
- Implementation code may be split across normal `.ts` files. Definition values
|
|
291
|
+
remain static literals so builds are deterministic.
|
|
116
292
|
|
|
117
|
-
|
|
118
|
-
Do not edit it manually. From the main Octonode checkout, run:
|
|
293
|
+
## Build and migration
|
|
119
294
|
|
|
120
295
|
```sh
|
|
121
|
-
|
|
122
|
-
|
|
296
|
+
octonodes plugin nodes # Generate local function handles
|
|
297
|
+
octonodes plugin nodes --check # Check committed inventory drift
|
|
298
|
+
octonodes plugin build # Type-check and build octonode.plugin.ts
|
|
299
|
+
octonodes plugin validate dist/plugins/text-tools
|
|
300
|
+
octonodes plugin test dist/plugins/text-tools uppercase --input '{"text":"hello"}'
|
|
123
301
|
```
|
|
124
302
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
303
|
+
Move the prototype's `definePlugin` definition from `octonode.config.ts` to
|
|
304
|
+
`octonode.plugin.ts`. Use `@octonodes/sdk/plugin` for plugins and
|
|
305
|
+
`@octonodes/sdk/project` for project defaults. Replace direct function references
|
|
306
|
+
with generated `nodes` handles. `defineProject({})` remains valid.
|
|
307
|
+
|
|
308
|
+
Older `plugins/**/*.plugin.ts` authoring entries need migration to the root
|
|
309
|
+
plugin definition. Existing YAML/JSON artifacts and the `/plugins` runtime API
|
|
310
|
+
remain compatible; the new builder does not discover arbitrary TypeScript entries.
|
|
311
|
+
|
|
312
|
+
One plugin artifact can combine local functions and verified npm handles. Each node
|
|
313
|
+
records its own implementation authority; exact upstream dependencies are derived
|
|
314
|
+
from the selected handles. Conflicting versions of the same npm package are rejected.
|
|
315
|
+
Saved-workflow exports remain separate artifacts and cannot mix with function handles.
|
|
316
|
+
Workflow exports verify the hashes of their generated runtime files before
|
|
317
|
+
building. Keep dependencies declared by the workflow exporter installed.
|
|
318
|
+
|
|
319
|
+
TypeScript checks values and types; filename restrictions are enforced by the
|
|
320
|
+
Octonode compiler. Plain `tsc` alone cannot enforce filename ownership.
|
|
321
|
+
|
|
322
|
+
Validation covers static compilation without execution, wrong filenames, stale
|
|
323
|
+
inventories, project override precedence, npm argument/default behavior,
|
|
324
|
+
workflow runtime integrity, artifact relocation, and existing installation flows.
|
|
325
|
+
Decorators, executable configuration, multiple plugins in one package, custom
|
|
326
|
+
canvas renderers, and another manifest format remain outside this contract.
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,6BAA6B,CAAC;AACxD,eAAO,MAAM,OAAO,iCAAiC,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CLOUD_API_URL = void 0;
|
|
3
|
+
exports.MCP_URL = exports.CLOUD_API_URL = void 0;
|
|
4
4
|
exports.CLOUD_API_URL = "https://api.octonode.dev";
|
|
5
|
+
exports.MCP_URL = "https://mcp.octonode.dev/mcp";
|
|
5
6
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,0BAA0B,CAAC;AAC3C,QAAA,OAAO,GAAG,8BAA8B,CAAC"}
|