@octonodes/sdk 0.1.5 → 0.1.8

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 CHANGED
@@ -1,5 +1,63 @@
1
1
  # Typed Octonode authoring files
2
2
 
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
+
3
61
  > **Status:** implemented in the source SDK and devtools. Publishing updated npm packages is a separate release step.
4
62
 
5
63
  Octonode keeps three concerns separate: discovered code, project presentation,
@@ -129,9 +187,11 @@ or execution source fails the build. Omitting `source` remains compatible with
129
187
  older definitions: compilation infers it from the selected handles.
130
188
 
131
189
  Npm authority does not fork or republish the dependency. Consumer code imports
132
- the original package using the module forms it supports. Automatic decoration
133
- of those imported calls is still planned; see
134
- [the community plugin plan](plans/community-plugin-source-authority.md).
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.
135
195
 
136
196
  Local function contracts support JSON primitives, literal enums, arrays, finite
137
197
  object shapes, optional parameters, and async returns. Unsupported contracts such
@@ -249,9 +309,10 @@ Older `plugins/**/*.plugin.ts` authoring entries need migration to the root
249
309
  plugin definition. Existing YAML/JSON artifacts and the `/plugins` runtime API
250
310
  remain compatible; the new builder does not discover arbitrary TypeScript entries.
251
311
 
252
- One plugin package contains local functions, one npm package adapter, or one
253
- saved-workflow export. Mixing these execution sources in one package is rejected.
254
- Use separate plugin packages when they have different runtime dependencies.
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.
255
316
  Workflow exports verify the hashes of their generated runtime files before
256
317
  building. Keep dependencies declared by the workflow exporter installed.
257
318
 
@@ -1732,6 +1732,7 @@ export type GetApiProjectsByProjectIdSourceIndexResponses = {
1732
1732
  serializable: boolean;
1733
1733
  value?: unknown;
1734
1734
  declarationKind?: 'const';
1735
+ mutable?: boolean;
1735
1736
  expression?: string;
1736
1737
  };
1737
1738
  variable?: {
@@ -4104,6 +4105,19 @@ export type GetApiMarketplaceResponses = {
4104
4105
  tags: Array<string>;
4105
4106
  nodes?: Array<{
4106
4107
  id: string;
4108
+ source?: {
4109
+ kind: 'plugin';
4110
+ } | {
4111
+ kind: 'npm';
4112
+ package: string;
4113
+ version: string;
4114
+ };
4115
+ libraryExport?: string;
4116
+ implementation?: {
4117
+ module: string;
4118
+ export: string;
4119
+ parameters: Array<string>;
4120
+ };
4107
4121
  icon?: string;
4108
4122
  label?: string;
4109
4123
  symbol?: string;
@@ -4188,6 +4202,19 @@ export type GetApiMarketplacePluginsByIdResponses = {
4188
4202
  tags: Array<string>;
4189
4203
  nodes: Array<{
4190
4204
  id: string;
4205
+ source?: {
4206
+ kind: 'plugin';
4207
+ } | {
4208
+ kind: 'npm';
4209
+ package: string;
4210
+ version: string;
4211
+ };
4212
+ libraryExport?: string;
4213
+ implementation?: {
4214
+ module: string;
4215
+ export: string;
4216
+ parameters: Array<string>;
4217
+ };
4191
4218
  icon?: string;
4192
4219
  label?: string;
4193
4220
  symbol?: string;
@@ -4214,6 +4241,12 @@ export type GetApiMarketplacePluginsByIdResponses = {
4214
4241
  };
4215
4242
  };
4216
4243
  }>;
4244
+ library?: {
4245
+ format: 1;
4246
+ entry: 'library/index.js';
4247
+ types: 'library/index.d.ts';
4248
+ exports: Array<string>;
4249
+ };
4217
4250
  official?: boolean;
4218
4251
  installCount?: number;
4219
4252
  ratingCount?: number;
@@ -4290,6 +4323,19 @@ export type GetApiPluginsResponses = {
4290
4323
  tags: Array<string>;
4291
4324
  nodes?: Array<{
4292
4325
  id: string;
4326
+ source?: {
4327
+ kind: 'plugin';
4328
+ } | {
4329
+ kind: 'npm';
4330
+ package: string;
4331
+ version: string;
4332
+ };
4333
+ libraryExport?: string;
4334
+ implementation?: {
4335
+ module: string;
4336
+ export: string;
4337
+ parameters: Array<string>;
4338
+ };
4293
4339
  icon?: string;
4294
4340
  label?: string;
4295
4341
  symbol?: string;
@@ -4351,6 +4397,19 @@ export type GetApiPluginsSearchResponses = {
4351
4397
  tags: Array<string>;
4352
4398
  nodes?: Array<{
4353
4399
  id: string;
4400
+ source?: {
4401
+ kind: 'plugin';
4402
+ } | {
4403
+ kind: 'npm';
4404
+ package: string;
4405
+ version: string;
4406
+ };
4407
+ libraryExport?: string;
4408
+ implementation?: {
4409
+ module: string;
4410
+ export: string;
4411
+ parameters: Array<string>;
4412
+ };
4354
4413
  icon?: string;
4355
4414
  label?: string;
4356
4415
  symbol?: string;
@@ -4411,6 +4470,19 @@ export type GetApiPluginsNodesResponses = {
4411
4470
  200: {
4412
4471
  items: Array<{
4413
4472
  id: string;
4473
+ source?: {
4474
+ kind: 'plugin';
4475
+ } | {
4476
+ kind: 'npm';
4477
+ package: string;
4478
+ version: string;
4479
+ };
4480
+ libraryExport?: string;
4481
+ implementation?: {
4482
+ module: string;
4483
+ export: string;
4484
+ parameters: Array<string>;
4485
+ };
4414
4486
  icon?: string;
4415
4487
  label?: string;
4416
4488
  symbol?: string;
@@ -4487,6 +4559,19 @@ export type GetApiPluginsByPluginIdResponses = {
4487
4559
  tags: Array<string>;
4488
4560
  nodes: Array<{
4489
4561
  id: string;
4562
+ source?: {
4563
+ kind: 'plugin';
4564
+ } | {
4565
+ kind: 'npm';
4566
+ package: string;
4567
+ version: string;
4568
+ };
4569
+ libraryExport?: string;
4570
+ implementation?: {
4571
+ module: string;
4572
+ export: string;
4573
+ parameters: Array<string>;
4574
+ };
4490
4575
  icon?: string;
4491
4576
  label?: string;
4492
4577
  symbol?: string;
@@ -4517,6 +4602,12 @@ export type GetApiPluginsByPluginIdResponses = {
4517
4602
  trigger?: boolean;
4518
4603
  env?: Array<string>;
4519
4604
  }>;
4605
+ library?: {
4606
+ format: 1;
4607
+ entry: 'library/index.js';
4608
+ types: 'library/index.d.ts';
4609
+ exports: Array<string>;
4610
+ };
4520
4611
  installed: true;
4521
4612
  connections?: {
4522
4613
  [key: string]: {