@akai-workflow-builder/cli-sdk 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +15 -3
- package/dist/define-cli.d.ts.map +1 -1
- package/dist/define-cli.js +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/manifest/index.d.ts +1 -1
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/manifest/json-schema.d.ts +79 -0
- package/dist/manifest/json-schema.d.ts.map +1 -1
- package/dist/manifest/json-schema.js +108 -0
- package/dist/manifest/to-schema.d.ts.map +1 -1
- package/dist/manifest/to-schema.js +2 -0
- package/dist/manifest/types.d.ts +137 -0
- package/dist/manifest/types.d.ts.map +1 -1
- package/dist/runtime/executor/index.d.ts +1 -1
- package/dist/runtime/executor/index.d.ts.map +1 -1
- package/dist/runtime/executor/index.js +16 -1
- package/dist/runtime/registry/connection-manifest.d.ts +27 -0
- package/dist/runtime/registry/connection-manifest.d.ts.map +1 -0
- package/dist/runtime/registry/connection-manifest.js +76 -0
- package/dist/runtime/registry/index.d.ts +4 -1
- package/dist/runtime/registry/index.d.ts.map +1 -1
- package/dist/runtime/registry/index.js +3 -0
- package/dist/runtime/registry/loader.d.ts +44 -0
- package/dist/runtime/registry/loader.d.ts.map +1 -1
- package/dist/runtime/registry/loader.js +329 -12
- package/dist/runtime/registry/manifest-wire.d.ts +65 -0
- package/dist/runtime/registry/manifest-wire.d.ts.map +1 -0
- package/dist/runtime/registry/manifest-wire.js +152 -0
- package/dist/runtime/registry/wire.d.ts +35 -1
- package/dist/runtime/registry/wire.d.ts.map +1 -1
- package/dist/runtime/registry/wire.js +5 -5
- package/package.json +1 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { isWireSecretDecl, wireEgress, wireHosts, wireJwtRefresh, } from './wire.js';
|
|
2
|
+
/** Project one manifest's CLI-level metadata to its wire entry. Mirrors `toWireCli`. */
|
|
3
|
+
export function manifestToWireCli(m, source) {
|
|
4
|
+
return {
|
|
5
|
+
id: m.id,
|
|
6
|
+
name: m.name,
|
|
7
|
+
vendor: m.vendor,
|
|
8
|
+
summary: m.summary,
|
|
9
|
+
description: m.description ?? null,
|
|
10
|
+
instructions: [...m.instructions],
|
|
11
|
+
secrets: m.secrets.map((s) => ({
|
|
12
|
+
name: s.name,
|
|
13
|
+
description: s.description,
|
|
14
|
+
required: s.required,
|
|
15
|
+
key: s.key,
|
|
16
|
+
...(s.adminManaged === true ? { adminManaged: true } : {}),
|
|
17
|
+
...(s.injected === true ? { injected: true } : {}),
|
|
18
|
+
...(s.serverOnly === true ? { serverOnly: true } : {}),
|
|
19
|
+
})),
|
|
20
|
+
properties: (m.properties ?? []).map((p) => ({
|
|
21
|
+
name: p.name,
|
|
22
|
+
description: p.description,
|
|
23
|
+
required: p.required,
|
|
24
|
+
key: p.key,
|
|
25
|
+
...(Array.isArray(p.options) && p.options.length ? { options: [...p.options] } : {}),
|
|
26
|
+
...(p.adminManaged === true ? { adminManaged: true } : {}),
|
|
27
|
+
})),
|
|
28
|
+
connectionSlug: typeof m.connectionSlug === 'string' && m.connectionSlug ? m.connectionSlug : null,
|
|
29
|
+
vendorScopes: Array.isArray(m.vendorScopes) ? m.vendorScopes.filter((s) => typeof s === 'string') : [],
|
|
30
|
+
source,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Project one manifest's tools to wire entries. Mirrors `toWireTool`.
|
|
35
|
+
* `manifest.tools` is already sorted by tool key at generation time (to-schema
|
|
36
|
+
* uses the same `Object.keys(tools).sort()` the wire assembly uses), so array
|
|
37
|
+
* order is preserved rather than re-sorted.
|
|
38
|
+
*/
|
|
39
|
+
export function manifestToWireTools(m, source) {
|
|
40
|
+
return m.tools.map((t) => ({
|
|
41
|
+
cli: m.id,
|
|
42
|
+
// wire `name` is the registry key, which the manifest stores as `id`.
|
|
43
|
+
name: t.id,
|
|
44
|
+
description: t.description ?? null,
|
|
45
|
+
isReadonly: t.isReadonly,
|
|
46
|
+
producesFiles: t.producesFiles === true,
|
|
47
|
+
secretKeys: [...t.secretKeys],
|
|
48
|
+
propertyKeys: [...t.propertyKeys],
|
|
49
|
+
// native manifests store `egress: null`; map to `undefined` so `wireEgress`
|
|
50
|
+
// yields `[]` exactly as the branded path does for network-less tools.
|
|
51
|
+
egress: wireEgress(t.egress ?? undefined),
|
|
52
|
+
inputSchema: t.inputSchema ?? null,
|
|
53
|
+
outputSchema: t.outputSchema ?? null,
|
|
54
|
+
source,
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Project a MIXED package's embedded {@link ManifestConnection} to its wire
|
|
59
|
+
* entry (AKAI-2408). Mirrors `toWireConnection` (wire.ts) byte-for-byte — same
|
|
60
|
+
* defensive validation and optional-field elision rules — so a connection
|
|
61
|
+
* registered FROM A MANIFEST is indistinguishable on `/tools/list` from one
|
|
62
|
+
* loaded eagerly from its module. `test/registry/connection-manifest.test.ts`
|
|
63
|
+
* asserts exactly that byte-identity across every connection shape (a
|
|
64
|
+
* dropped/diverging connection is auth-breaking).
|
|
65
|
+
*
|
|
66
|
+
* The elision that matters most: jwtRefresh is dropped whenever an `oauth` block
|
|
67
|
+
* is present OR `authKind === 'oauth2'` (the two are mutually exclusive on the
|
|
68
|
+
* wire), and apiKeyHeader is only emitted for `authKind` `apiKey` — identical to
|
|
69
|
+
* the branded path. Host-map/secret/jwtRefresh validation is delegated to the
|
|
70
|
+
* SAME shared helpers wire.ts uses, so those cases can never drift.
|
|
71
|
+
*/
|
|
72
|
+
export function manifestConnectionToWire(mc, source) {
|
|
73
|
+
const hosts = wireHosts(mc.hosts);
|
|
74
|
+
const jwtRefresh = mc.authKind === 'oauth2' || mc.oauth ? undefined : wireJwtRefresh(mc.jwtRefresh);
|
|
75
|
+
const rawSecrets = Array.isArray(mc.secrets) ? mc.secrets : [];
|
|
76
|
+
const secrets = rawSecrets.filter(isWireSecretDecl).map((s) => ({
|
|
77
|
+
name: s.name,
|
|
78
|
+
description: s.description,
|
|
79
|
+
required: s.required,
|
|
80
|
+
key: s.key,
|
|
81
|
+
...(s.adminManaged === true ? { adminManaged: true } : {}),
|
|
82
|
+
...(s.injected === true ? { injected: true } : {}),
|
|
83
|
+
...(s.serverOnly === true ? { serverOnly: true } : {}),
|
|
84
|
+
}));
|
|
85
|
+
const base = {
|
|
86
|
+
slug: mc.slug,
|
|
87
|
+
name: mc.name,
|
|
88
|
+
vendor: mc.vendor,
|
|
89
|
+
blurb: mc.blurb,
|
|
90
|
+
longDesc: mc.longDesc,
|
|
91
|
+
instructions: [...mc.instructions],
|
|
92
|
+
authKind: mc.authKind,
|
|
93
|
+
...(secrets.length > 0 ? { secrets } : {}),
|
|
94
|
+
...(mc.authKind === 'apiKey' && typeof mc.apiKeyHeader === 'string' && mc.apiKeyHeader.length > 0
|
|
95
|
+
? { apiKeyHeader: mc.apiKeyHeader }
|
|
96
|
+
: {}),
|
|
97
|
+
...(hosts ? { hosts } : {}),
|
|
98
|
+
...(jwtRefresh ? { jwtRefresh } : {}),
|
|
99
|
+
...(mc.nativeBuiltin === true ? { nativeBuiltin: true } : {}),
|
|
100
|
+
source,
|
|
101
|
+
};
|
|
102
|
+
if (!mc.oauth)
|
|
103
|
+
return base;
|
|
104
|
+
return {
|
|
105
|
+
...base,
|
|
106
|
+
oauth: {
|
|
107
|
+
authorizeUrl: mc.oauth.authorizeUrl,
|
|
108
|
+
tokenUrl: mc.oauth.tokenUrl,
|
|
109
|
+
scopes: Array.isArray(mc.oauth.scopes) ? mc.oauth.scopes.filter((s) => typeof s === 'string') : [],
|
|
110
|
+
pkce: mc.oauth.pkce ?? false,
|
|
111
|
+
tokenEndpointAuthMethod: mc.oauth.tokenEndpointAuthMethod ?? 'client_secret_basic',
|
|
112
|
+
extraAuthorizeParams: mc.oauth.extraAuthorizeParams ? { ...mc.oauth.extraAuthorizeParams } : {},
|
|
113
|
+
refreshStrategy: mc.oauth.refreshStrategy ?? 'cron',
|
|
114
|
+
adminFields: mc.oauth.adminFields.map((f) => ({
|
|
115
|
+
key: f.key,
|
|
116
|
+
label: f.label,
|
|
117
|
+
secret: f.secret ?? false,
|
|
118
|
+
})),
|
|
119
|
+
...(mc.oauth.hasCustomConnectFlow !== undefined ? { hasCustomConnectFlow: mc.oauth.hasCustomConnectFlow } : {}),
|
|
120
|
+
...(typeof mc.oauth.tokenResponsePath === 'string' && mc.oauth.tokenResponsePath.length > 0
|
|
121
|
+
? { tokenResponsePath: mc.oauth.tokenResponsePath }
|
|
122
|
+
: {}),
|
|
123
|
+
...(mc.oauth.appToken && typeof mc.oauth.appToken.tokenUrl === 'string' && mc.oauth.appToken.tokenUrl.length > 0
|
|
124
|
+
? {
|
|
125
|
+
appToken: {
|
|
126
|
+
tokenUrl: mc.oauth.appToken.tokenUrl,
|
|
127
|
+
...(mc.oauth.appToken.requestStyle ? { requestStyle: mc.oauth.appToken.requestStyle } : {}),
|
|
128
|
+
...(mc.oauth.appToken.credentialParams ? { credentialParams: { ...mc.oauth.appToken.credentialParams } } : {}),
|
|
129
|
+
...(mc.oauth.appToken.tokenField ? { tokenField: mc.oauth.appToken.tokenField } : {}),
|
|
130
|
+
...(mc.oauth.appToken.expiresField ? { expiresField: mc.oauth.appToken.expiresField } : {}),
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
: {}),
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Assemble the CLI + tool halves of a `/tools/list` payload from a set of
|
|
139
|
+
* manifests, applying the SAME ordering as `toWireListPayload`: CLIs sorted by
|
|
140
|
+
* `id.localeCompare`, tools grouped per CLI in manifest (already key-sorted)
|
|
141
|
+
* order. Connections are NOT sourced from manifests (they carry no CLI
|
|
142
|
+
* manifest) — the caller supplies those from the eagerly-loaded connection
|
|
143
|
+
* packages, exactly as today.
|
|
144
|
+
*/
|
|
145
|
+
export function manifestsToWireCatalog(manifests) {
|
|
146
|
+
const sorted = [...manifests].sort((a, b) => a.manifest.id.localeCompare(b.manifest.id));
|
|
147
|
+
const clis = sorted.map((m) => manifestToWireCli(m.manifest, m.source));
|
|
148
|
+
const tools = [];
|
|
149
|
+
for (const m of sorted)
|
|
150
|
+
tools.push(...manifestToWireTools(m.manifest, m.source));
|
|
151
|
+
return { clis, tools };
|
|
152
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConnectionEntry, RegistryEntry } from './types.js';
|
|
1
|
+
import type { BrandedConnection, BrandedSecretDecl, ConnectionEntry, RegistryEntry } from './types.js';
|
|
2
2
|
export interface WireToolEntry {
|
|
3
3
|
/** CLI id this tool belongs to (e.g. `"jira"`). */
|
|
4
4
|
readonly cli: string;
|
|
@@ -149,4 +149,38 @@ export interface WireListPayload {
|
|
|
149
149
|
readonly tenant: WireTenant | null;
|
|
150
150
|
}
|
|
151
151
|
export declare function toWireListPayload(entries: ReadonlyArray<RegistryEntry>, connectionEntries?: ReadonlyArray<ConnectionEntry>, tenant?: WireTenant | null): WireListPayload;
|
|
152
|
+
export declare function toWireConnection(conn: BrandedConnection, source: 'baseline' | 'customer'): WireConnectionEntry;
|
|
153
|
+
/**
|
|
154
|
+
* Serialize a connection's declarative jwtRefresh config for the wire. Validates the shape (a
|
|
155
|
+
* malformed customer package could hand a non-object, or an env missing keys) and emits
|
|
156
|
+
* declarations only — no secret values. Envs missing a required field are dropped; the whole field
|
|
157
|
+
* is omitted when nothing usable remains, matching the optional-field style used for `oauth`.
|
|
158
|
+
*/
|
|
159
|
+
export declare function wireJwtRefresh(jr: unknown): WireConnectionEntry['jwtRefresh'] | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Serialize a connection's per-environment host map for the wire. Only the
|
|
162
|
+
* three known keys (`production`/`demo`/`dev`) with non-empty string values are
|
|
163
|
+
* carried through; anything else is dropped. Returns `undefined` when no valid
|
|
164
|
+
* host is present so the caller omits the field entirely (matching the
|
|
165
|
+
* optional-field style used for `oauth`). No secret values live here — hosts are
|
|
166
|
+
* non-sensitive API base URLs.
|
|
167
|
+
*/
|
|
168
|
+
export declare function wireHosts(hosts: unknown): {
|
|
169
|
+
production?: string;
|
|
170
|
+
demo?: string;
|
|
171
|
+
dev?: string;
|
|
172
|
+
} | undefined;
|
|
173
|
+
/** Full-shape guard for a secret declaration before it's serialized onto the
|
|
174
|
+
* wire. The loader validates this at load time too (isBrandedSecretDecl), but
|
|
175
|
+
* the serializer stays self-defensive so a partial entry can't emit `undefined`
|
|
176
|
+
* fields onto the wire. */
|
|
177
|
+
export declare function isWireSecretDecl(s: unknown): s is BrandedSecretDecl;
|
|
178
|
+
/**
|
|
179
|
+
* Serialize a tool's egress for the wire. A static allowlist passes through;
|
|
180
|
+
* a dynamic ref `{ from: 'property:<KEY>' }` or `{ from: 'secret:<KEY>' }`
|
|
181
|
+
* becomes `['<prefix>:<KEY>']` so consumers see the per-tenant host source
|
|
182
|
+
* rather than an empty list. Anything else (native tools, malformed) yields
|
|
183
|
+
* `[]`. The accepted prefixes come from the SDK so the contract never drifts.
|
|
184
|
+
*/
|
|
185
|
+
export declare function wireEgress(egress: unknown): string[];
|
|
152
186
|
//# sourceMappingURL=wire.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../../src/runtime/registry/wire.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../../src/runtime/registry/wire.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAEV,iBAAiB,EACjB,iBAAiB,EAEjB,eAAe,EACf,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5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Ae;IAC9B,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC;IACvC,oHAAoH;IACpH,QAAQ,CAAC,WAAW,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACrD,wFAAwF;IACxF,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;CACpC;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,EACrC,iBAAiB,GAAE,aAAa,CAAC,eAAe,CAAM,EACtD,MAAM,GAAE,UAAU,GAAG,IAAW,GAC/B,eAAe,CAyBjB;AAkCD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,UAAU,GAAG,UAAU,GAC9B,mBAAmB,CA6FrB;AA6BD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,mBAAmB,CAAC,YAAY,CAAC,GAAG,SAAS,CA2BzF;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAS1G;AAED;;;2BAG2B;AAC3B,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,iBAAiB,CAUnE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,CASpD"}
|
|
@@ -67,7 +67,7 @@ function toWireCli(cli, source) {
|
|
|
67
67
|
source,
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function toWireConnection(conn, source) {
|
|
70
|
+
export function toWireConnection(conn, source) {
|
|
71
71
|
const hosts = wireHosts(conn.hosts);
|
|
72
72
|
// jwtRefresh is the background-refresh mechanism for NON-OAuth connections; OAuth connections
|
|
73
73
|
// refresh through their own token flow. The two are mutually exclusive — keyed on the declared
|
|
@@ -188,7 +188,7 @@ function toWireTool(cliId, toolKey, tool, source) {
|
|
|
188
188
|
* declarations only — no secret values. Envs missing a required field are dropped; the whole field
|
|
189
189
|
* is omitted when nothing usable remains, matching the optional-field style used for `oauth`.
|
|
190
190
|
*/
|
|
191
|
-
function wireJwtRefresh(jr) {
|
|
191
|
+
export function wireJwtRefresh(jr) {
|
|
192
192
|
if (!jr || typeof jr !== 'object')
|
|
193
193
|
return undefined;
|
|
194
194
|
const o = jr;
|
|
@@ -228,7 +228,7 @@ function wireJwtRefresh(jr) {
|
|
|
228
228
|
* optional-field style used for `oauth`). No secret values live here — hosts are
|
|
229
229
|
* non-sensitive API base URLs.
|
|
230
230
|
*/
|
|
231
|
-
function wireHosts(hosts) {
|
|
231
|
+
export function wireHosts(hosts) {
|
|
232
232
|
if (hosts === null || typeof hosts !== 'object')
|
|
233
233
|
return undefined;
|
|
234
234
|
const o = hosts;
|
|
@@ -244,7 +244,7 @@ function wireHosts(hosts) {
|
|
|
244
244
|
* wire. The loader validates this at load time too (isBrandedSecretDecl), but
|
|
245
245
|
* the serializer stays self-defensive so a partial entry can't emit `undefined`
|
|
246
246
|
* fields onto the wire. */
|
|
247
|
-
function isWireSecretDecl(s) {
|
|
247
|
+
export function isWireSecretDecl(s) {
|
|
248
248
|
if (!s || typeof s !== 'object')
|
|
249
249
|
return false;
|
|
250
250
|
const o = s;
|
|
@@ -261,7 +261,7 @@ function isWireSecretDecl(s) {
|
|
|
261
261
|
* rather than an empty list. Anything else (native tools, malformed) yields
|
|
262
262
|
* `[]`. The accepted prefixes come from the SDK so the contract never drifts.
|
|
263
263
|
*/
|
|
264
|
-
function wireEgress(egress) {
|
|
264
|
+
export function wireEgress(egress) {
|
|
265
265
|
if (Array.isArray(egress))
|
|
266
266
|
return egress.filter((h) => typeof h === 'string');
|
|
267
267
|
if (egress && typeof egress === 'object') {
|