@soku-ai/cli 0.1.0-alpha.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/README.md +91 -0
- package/dist/auth/device.d.ts +36 -0
- package/dist/auth/device.d.ts.map +1 -0
- package/dist/auth/device.js +66 -0
- package/dist/auth/device.js.map +1 -0
- package/dist/auth/store.d.ts +11 -0
- package/dist/auth/store.d.ts.map +1 -0
- package/dist/auth/store.js +89 -0
- package/dist/auth/store.js.map +1 -0
- package/dist/commands/auth.d.ts +4 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +99 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/brand.d.ts +4 -0
- package/dist/commands/brand.d.ts.map +1 -0
- package/dist/commands/brand.js +53 -0
- package/dist/commands/brand.js.map +1 -0
- package/dist/commands/call.d.ts +4 -0
- package/dist/commands/call.d.ts.map +1 -0
- package/dist/commands/call.js +48 -0
- package/dist/commands/call.js.map +1 -0
- package/dist/commands/egress.d.ts +24 -0
- package/dist/commands/egress.d.ts.map +1 -0
- package/dist/commands/egress.js +197 -0
- package/dist/commands/egress.js.map +1 -0
- package/dist/commands/generated.d.ts +41 -0
- package/dist/commands/generated.d.ts.map +1 -0
- package/dist/commands/generated.js +106 -0
- package/dist/commands/generated.js.map +1 -0
- package/dist/commands/org.d.ts +4 -0
- package/dist/commands/org.d.ts.map +1 -0
- package/dist/commands/org.js +49 -0
- package/dist/commands/org.js.map +1 -0
- package/dist/commands/resources.d.ts +4 -0
- package/dist/commands/resources.d.ts.map +1 -0
- package/dist/commands/resources.js +22 -0
- package/dist/commands/resources.js.map +1 -0
- package/dist/commands/review.d.ts +8 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +74 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/skill.d.ts +19 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +313 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +45 -0
- package/dist/config.js.map +1 -0
- package/dist/generated/capabilities.json +770 -0
- package/dist/http/client.d.ts +12 -0
- package/dist/http/client.d.ts.map +1 -0
- package/dist/http/client.js +91 -0
- package/dist/http/client.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/output/envelope.d.ts +45 -0
- package/dist/output/envelope.d.ts.map +1 -0
- package/dist/output/envelope.js +86 -0
- package/dist/output/envelope.js.map +1 -0
- package/dist/output/unwrap.d.ts +11 -0
- package/dist/output/unwrap.d.ts.map +1 -0
- package/dist/output/unwrap.js +33 -0
- package/dist/output/unwrap.js.map +1 -0
- package/dist/resolve.d.ts +24 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +24 -0
- package/dist/resolve.js.map +1 -0
- package/dist/skills/unzip.d.ts +14 -0
- package/dist/skills/unzip.d.ts.map +1 -0
- package/dist/skills/unzip.js +86 -0
- package/dist/skills/unzip.js.map +1 -0
- package/dist/update-check.d.ts +24 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/update-check.js +204 -0
- package/dist/update-check.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +61 -0
- package/skills/soku/SKILL.md +225 -0
- package/skills/soku/references/capability-flow.md +71 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Thin fetch wrapper that injects the bearer token + active workspace headers,
|
|
2
|
+
* and translates the server's auth errors into the CLI's exit-code contract. */
|
|
3
|
+
interface RequestOptions {
|
|
4
|
+
method?: string;
|
|
5
|
+
body?: unknown;
|
|
6
|
+
/** Require the active org/brand headers (data endpoints). */
|
|
7
|
+
workspace?: boolean;
|
|
8
|
+
apiBase?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function apiRequest<T = unknown>(path: string, opts?: RequestOptions): Promise<T>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/http/client.ts"],"names":[],"mappings":"AAAA;gFACgF;AAMhF,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAsB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC,CA6EjG"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** Thin fetch wrapper that injects the bearer token + active workspace headers,
|
|
2
|
+
* and translates the server's auth errors into the CLI's exit-code contract. */
|
|
3
|
+
import { clearToken, loadToken } from '../auth/store.js';
|
|
4
|
+
import { loadConfig, resolveApiBaseUrl } from '../config.js';
|
|
5
|
+
import { emitError, ExitCode } from '../output/envelope.js';
|
|
6
|
+
export async function apiRequest(path, opts = {}) {
|
|
7
|
+
const token = await loadToken();
|
|
8
|
+
if (!token) {
|
|
9
|
+
emitError('not_authenticated', 'No Soku session found.', ExitCode.AUTH, 'Run `soku auth login` (or set SOKU_TOKEN).');
|
|
10
|
+
}
|
|
11
|
+
const headers = {
|
|
12
|
+
Authorization: `Bearer ${token}`,
|
|
13
|
+
Accept: 'application/json',
|
|
14
|
+
};
|
|
15
|
+
if (opts.body !== undefined)
|
|
16
|
+
headers['Content-Type'] = 'application/json';
|
|
17
|
+
if (opts.workspace) {
|
|
18
|
+
const cfg = loadConfig();
|
|
19
|
+
const orgId = process.env.SOKU_ORG_ID || cfg.activeOrgId;
|
|
20
|
+
const brandId = process.env.SOKU_BRAND_ID || cfg.activeBrandId;
|
|
21
|
+
if (!orgId || !brandId) {
|
|
22
|
+
emitError('no_workspace', 'No active workspace selected.', ExitCode.USAGE, 'Run `soku org use <id>` then `soku brand use <id>`.');
|
|
23
|
+
}
|
|
24
|
+
headers['X-Soku-Org'] = orgId;
|
|
25
|
+
headers['X-Soku-Brand'] = brandId;
|
|
26
|
+
}
|
|
27
|
+
const base = resolveApiBaseUrl(opts.apiBase);
|
|
28
|
+
let res;
|
|
29
|
+
try {
|
|
30
|
+
res = await fetch(`${base}${path}`, {
|
|
31
|
+
method: opts.method ?? 'GET',
|
|
32
|
+
headers,
|
|
33
|
+
body: opts.body !== undefined ? JSON.stringify(opts.body) : undefined,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
return emitError('network_error', `Could not reach ${base}: ${err.message}`, ExitCode.RUNTIME, 'Behind a proxy? Set ALL_PROXY.');
|
|
38
|
+
}
|
|
39
|
+
const text = await res.text();
|
|
40
|
+
const parsed = text ? safeJson(text) : null;
|
|
41
|
+
if (res.status === 401) {
|
|
42
|
+
// Any 401 means this token is no longer usable (expired, revoked, deleted
|
|
43
|
+
// key, or rotated signing key). Drop it so the next run re-authenticates
|
|
44
|
+
// cleanly instead of looping on a dead credential.
|
|
45
|
+
const code = parsed?.error ?? 'unauthorized';
|
|
46
|
+
await clearToken();
|
|
47
|
+
return emitError('unauthorized', `Authentication failed (${code}).`, ExitCode.AUTH, 'Run `soku auth login`.');
|
|
48
|
+
}
|
|
49
|
+
if (res.status === 403) {
|
|
50
|
+
return emitError('forbidden', describeError(parsed) ?? 'Access denied.', ExitCode.AUTH);
|
|
51
|
+
}
|
|
52
|
+
if (res.status === 404) {
|
|
53
|
+
return emitError('not_found', describeError(parsed) ?? 'Not found.', ExitCode.NOT_FOUND);
|
|
54
|
+
}
|
|
55
|
+
if (res.status >= 400) {
|
|
56
|
+
return emitError('request_failed', describeError(parsed) ?? `HTTP ${res.status}`, ExitCode.RUNTIME);
|
|
57
|
+
}
|
|
58
|
+
return parsed;
|
|
59
|
+
}
|
|
60
|
+
function safeJson(text) {
|
|
61
|
+
try {
|
|
62
|
+
return JSON.parse(text);
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return text;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function describeError(parsed) {
|
|
69
|
+
if (parsed && typeof parsed === 'object') {
|
|
70
|
+
const obj = parsed;
|
|
71
|
+
const detail = obj.detail;
|
|
72
|
+
if (detail?.message)
|
|
73
|
+
return String(detail.message);
|
|
74
|
+
// The shared data dispatcher returns { ok: false, error: <string | object> }.
|
|
75
|
+
// Unwrap a nested error object so the user sees the real message, not
|
|
76
|
+
// "[object Object]".
|
|
77
|
+
if (obj.error && typeof obj.error === 'object') {
|
|
78
|
+
const err = obj.error;
|
|
79
|
+
if (err.message)
|
|
80
|
+
return String(err.message);
|
|
81
|
+
if (err.code)
|
|
82
|
+
return String(err.code);
|
|
83
|
+
}
|
|
84
|
+
if (obj.error)
|
|
85
|
+
return String(obj.error);
|
|
86
|
+
if (obj.message)
|
|
87
|
+
return String(obj.message);
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/http/client.ts"],"names":[],"mappings":"AAAA;gFACgF;AAEhF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAU3D,MAAM,CAAC,KAAK,UAAU,UAAU,CAAc,IAAY,EAAE,OAAuB,EAAE;IACnF,MAAM,KAAK,GAAG,MAAM,SAAS,EAAE,CAAA;IAC/B,IAA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AACpB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,MAAe;IACpC,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,MAAiC,CAAA;QAC7C,MAAM,MAAM,GAAG,GAAG,CAAC,MAA6C,CAAA;QAChE,IAAI,MAAM,EAAE,OAAO;YAAE,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAClD,8EAA8E;QAC9E,sEAAsE;QACtE,qBAAqB;QACrB,IAAI,GAAG,CAAC,KAAK,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC/C,MAAM,GAAG,GAAG,GAAG,CAAC,KAAgC,CAAA;YAChD,IAAI,GAAG,CAAC,OAAO;gBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YAC3C,IAAI,GAAG,CAAC,IAAI;gBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACvC,CAAC;QACD,IAAI,GAAG,CAAC,KAAK;YAAE,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACvC,IAAI,GAAG,CAAC,OAAO;YAAE,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAC7C,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,4BAA4B"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/** Soku CLI entry point. */
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
import { registerAuthCommands } from './commands/auth.js';
|
|
5
|
+
import { registerBrandCommands } from './commands/brand.js';
|
|
6
|
+
import { registerCallCommand } from './commands/call.js';
|
|
7
|
+
import { registerEgressCommands } from './commands/egress.js';
|
|
8
|
+
import { registerGeneratedCommands } from './commands/generated.js';
|
|
9
|
+
import { registerOrgCommands } from './commands/org.js';
|
|
10
|
+
import { registerResourceCommands } from './commands/resources.js';
|
|
11
|
+
import { registerReviewCommands } from './commands/review.js';
|
|
12
|
+
import { registerSkillCommand } from './commands/skill.js';
|
|
13
|
+
import { maybeNotifyUpdate, registerUpdateCheckCommand } from './update-check.js';
|
|
14
|
+
import { emitError, ExitCode } from './output/envelope.js';
|
|
15
|
+
import { CLI_VERSION } from './version.js';
|
|
16
|
+
const program = new Command();
|
|
17
|
+
program
|
|
18
|
+
.name('soku')
|
|
19
|
+
.description('Call Soku ads/GA4 data capabilities from any AI agent or shell.')
|
|
20
|
+
.version(CLI_VERSION);
|
|
21
|
+
registerAuthCommands(program);
|
|
22
|
+
registerOrgCommands(program);
|
|
23
|
+
registerBrandCommands(program);
|
|
24
|
+
registerResourceCommands(program);
|
|
25
|
+
registerGeneratedCommands(program);
|
|
26
|
+
registerCallCommand(program);
|
|
27
|
+
registerEgressCommands(program);
|
|
28
|
+
registerReviewCommands(program);
|
|
29
|
+
registerSkillCommand(program);
|
|
30
|
+
registerUpdateCheckCommand(program);
|
|
31
|
+
program.hook('preAction', async (_thisCommand, actionCommand) => {
|
|
32
|
+
if (actionCommand.name() === 'update-check')
|
|
33
|
+
return;
|
|
34
|
+
await maybeNotifyUpdate();
|
|
35
|
+
});
|
|
36
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
37
|
+
emitError('unexpected', err instanceof Error ? err.message : String(err), ExitCode.RUNTIME);
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 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AC,CAAA;AAC/B,sBAAsB,CAAC,OAAO,CAAC,CAAA;AAC/B,oBAAoB,CAAC,OAAO,CAAC,CAAA;AAC7B,0BAA0B,CAAC,OAAO,CAAC,CAAA;AAEnC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,EAAE;IAC9D,IAAI,aAAa,CAAC,IAAI,EAAE,KAAK,cAAc;QAAE,OAAM;IACnD,MAAM,iBAAiB,EAAE,CAAA;AAC3B,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACtD,SAAS,CAAC,YAAY,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;AAC7F,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Output + exit-code conventions shared by every command.
|
|
2
|
+
*
|
|
3
|
+
* Agents/pipes get JSON (`!isTty()`); humans at a terminal get a readable view
|
|
4
|
+
* (tables, friendly lines). Pass a `human` renderer to `emitSuccess` for the
|
|
5
|
+
* TTY view; without one it falls back to pretty JSON. Errors are a structured
|
|
6
|
+
* envelope on stderr (JSON when piped, a colored line at a TTY) with a semantic
|
|
7
|
+
* exit code.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ExitCode: {
|
|
10
|
+
readonly OK: 0;
|
|
11
|
+
readonly USAGE: 1;
|
|
12
|
+
readonly AUTH: 2;
|
|
13
|
+
readonly NOT_FOUND: 4;
|
|
14
|
+
readonly RUNTIME: 5;
|
|
15
|
+
};
|
|
16
|
+
export type ExitCodeValue = (typeof ExitCode)[keyof typeof ExitCode];
|
|
17
|
+
export interface ErrorEnvelope {
|
|
18
|
+
ok: false;
|
|
19
|
+
error: {
|
|
20
|
+
type: string;
|
|
21
|
+
message: string;
|
|
22
|
+
hint?: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function isTty(): boolean;
|
|
26
|
+
export declare const bold: (t: string) => string;
|
|
27
|
+
export declare const dim: (t: string) => string;
|
|
28
|
+
export declare const green: (t: string) => string;
|
|
29
|
+
export declare const red: (t: string) => string;
|
|
30
|
+
export declare const cyan: (t: string) => string;
|
|
31
|
+
export interface Column {
|
|
32
|
+
key: string;
|
|
33
|
+
header: string;
|
|
34
|
+
}
|
|
35
|
+
/** Render an aligned text table from a list of row objects. */
|
|
36
|
+
export declare function table(rows: Array<Record<string, unknown>>, columns: Column[]): string;
|
|
37
|
+
/** Print a success result and exit 0.
|
|
38
|
+
*
|
|
39
|
+
* @param data machine-readable payload (always used for the JSON/agent path)
|
|
40
|
+
* @param human optional renderer for the TTY view; receives `data`
|
|
41
|
+
*/
|
|
42
|
+
export declare function emitSuccess<T>(data: T, human?: (data: T) => string): never;
|
|
43
|
+
/** Print a structured error to stderr and exit with the given code. */
|
|
44
|
+
export declare function emitError(type: string, message: string, code?: ExitCodeValue, hint?: string): never;
|
|
45
|
+
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/output/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,QAAQ;;;;;;CAMX,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAA;AAEpE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,KAAK,CAAA;IACT,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAMD,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,WAAkB,CAAA;AAChD,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,WAAkB,CAAA;AAC/C,eAAO,MAAM,KAAK,GAAI,GAAG,MAAM,WAAmB,CAAA;AAClD,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,WAAmB,CAAA;AAChD,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,WAAmB,CAAA;AAEjD,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;CACf;AAaD,+DAA+D;AAC/D,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAcrF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,KAAK,CAS1E;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,aAAgC,EACtC,IAAI,CAAC,EAAE,MAAM,GACZ,KAAK,CAaP"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Output + exit-code conventions shared by every command.
|
|
2
|
+
*
|
|
3
|
+
* Agents/pipes get JSON (`!isTty()`); humans at a terminal get a readable view
|
|
4
|
+
* (tables, friendly lines). Pass a `human` renderer to `emitSuccess` for the
|
|
5
|
+
* TTY view; without one it falls back to pretty JSON. Errors are a structured
|
|
6
|
+
* envelope on stderr (JSON when piped, a colored line at a TTY) with a semantic
|
|
7
|
+
* exit code.
|
|
8
|
+
*/
|
|
9
|
+
export const ExitCode = {
|
|
10
|
+
OK: 0,
|
|
11
|
+
USAGE: 1,
|
|
12
|
+
AUTH: 2,
|
|
13
|
+
NOT_FOUND: 4,
|
|
14
|
+
RUNTIME: 5,
|
|
15
|
+
};
|
|
16
|
+
export function isTty() {
|
|
17
|
+
return Boolean(process.stdout.isTTY);
|
|
18
|
+
}
|
|
19
|
+
// ── Minimal ANSI styling (no dependency); no-op when not a TTY ──────────────
|
|
20
|
+
function style(code, text) {
|
|
21
|
+
return isTty() ? `\x1b[${code}m${text}\x1b[0m` : text;
|
|
22
|
+
}
|
|
23
|
+
export const bold = (t) => style('1', t);
|
|
24
|
+
export const dim = (t) => style('2', t);
|
|
25
|
+
export const green = (t) => style('32', t);
|
|
26
|
+
export const red = (t) => style('31', t);
|
|
27
|
+
export const cyan = (t) => style('36', t);
|
|
28
|
+
// eslint-disable-next-line no-control-regex
|
|
29
|
+
const ANSI_RE = /\x1b\[[0-9;]*m/g;
|
|
30
|
+
/** Visible length, ignoring ANSI color escapes (so colored cells align). */
|
|
31
|
+
function visibleLen(s) {
|
|
32
|
+
return s.replace(ANSI_RE, '').length;
|
|
33
|
+
}
|
|
34
|
+
/** padEnd that accounts for invisible ANSI escapes in the value. */
|
|
35
|
+
function padVisible(s, width) {
|
|
36
|
+
return s + ' '.repeat(Math.max(0, width - visibleLen(s)));
|
|
37
|
+
}
|
|
38
|
+
/** Render an aligned text table from a list of row objects. */
|
|
39
|
+
export function table(rows, columns) {
|
|
40
|
+
if (rows.length === 0)
|
|
41
|
+
return dim('(none)');
|
|
42
|
+
const cell = (r, k) => {
|
|
43
|
+
const v = r[k];
|
|
44
|
+
return v === null || v === undefined ? '' : String(v);
|
|
45
|
+
};
|
|
46
|
+
const widths = columns.map((c) => Math.max(c.header.length, ...rows.map((r) => visibleLen(cell(r, c.key)))));
|
|
47
|
+
const line = (cells) => cells.map((c, i) => padVisible(c, widths[i])).join(' ');
|
|
48
|
+
const header = bold(line(columns.map((c) => c.header)));
|
|
49
|
+
const body = rows.map((r) => line(columns.map((c) => cell(r, c.key)))).join('\n');
|
|
50
|
+
return `${header}\n${body}`;
|
|
51
|
+
}
|
|
52
|
+
/** Print a success result and exit 0.
|
|
53
|
+
*
|
|
54
|
+
* @param data machine-readable payload (always used for the JSON/agent path)
|
|
55
|
+
* @param human optional renderer for the TTY view; receives `data`
|
|
56
|
+
*/
|
|
57
|
+
export function emitSuccess(data, human) {
|
|
58
|
+
if (!isTty()) {
|
|
59
|
+
process.stdout.write(`${JSON.stringify({ ok: true, data })}\n`);
|
|
60
|
+
}
|
|
61
|
+
else if (human) {
|
|
62
|
+
process.stdout.write(`${human(data)}\n`);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
process.stdout.write(`${JSON.stringify(data, null, 2)}\n`);
|
|
66
|
+
}
|
|
67
|
+
process.exit(ExitCode.OK);
|
|
68
|
+
}
|
|
69
|
+
/** Print a structured error to stderr and exit with the given code. */
|
|
70
|
+
export function emitError(type, message, code = ExitCode.RUNTIME, hint) {
|
|
71
|
+
if (isTty()) {
|
|
72
|
+
let out = `${red('✖')} ${message}`;
|
|
73
|
+
if (hint)
|
|
74
|
+
out += `\n ${dim(hint)}`;
|
|
75
|
+
process.stderr.write(`${out}\n`);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
const envelope = {
|
|
79
|
+
ok: false,
|
|
80
|
+
error: { type, message, ...(hint ? { hint } : {}) },
|
|
81
|
+
};
|
|
82
|
+
process.stderr.write(`${JSON.stringify(envelope)}\n`);
|
|
83
|
+
}
|
|
84
|
+
process.exit(code);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../src/output/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,EAAE,EAAE,CAAC;IACL,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,CAAC;CACF,CA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AG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;SACpD,CAAA;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACvD,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Collapse the data dispatcher's result envelope to a single layer.
|
|
2
|
+
*
|
|
3
|
+
* `/api/cli/call/*` returns the shared dispatcher envelope `{ ok, data, error }`.
|
|
4
|
+
* Without unwrapping, the CLI's own `emitSuccess` would nest it a second time
|
|
5
|
+
* (`{ ok: true, data: { ok: true, data: ... } }`). Callers pass the raw result
|
|
6
|
+
* through this first so success output is a single `{ ok: true, data: ... }`.
|
|
7
|
+
*/
|
|
8
|
+
/** Return the dispatcher's inner `data`, or exit with a structured error when
|
|
9
|
+
* the dispatcher reported `ok: false`. Non-envelope results pass through. */
|
|
10
|
+
export declare function unwrapDispatch(result: unknown): unknown;
|
|
11
|
+
//# sourceMappingURL=unwrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unwrap.d.ts","sourceRoot":"","sources":["../../src/output/unwrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH;6EAC6E;AAC7E,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAavD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Collapse the data dispatcher's result envelope to a single layer.
|
|
2
|
+
*
|
|
3
|
+
* `/api/cli/call/*` returns the shared dispatcher envelope `{ ok, data, error }`.
|
|
4
|
+
* Without unwrapping, the CLI's own `emitSuccess` would nest it a second time
|
|
5
|
+
* (`{ ok: true, data: { ok: true, data: ... } }`). Callers pass the raw result
|
|
6
|
+
* through this first so success output is a single `{ ok: true, data: ... }`.
|
|
7
|
+
*/
|
|
8
|
+
import { emitError, ExitCode } from './envelope.js';
|
|
9
|
+
function isDispatchEnvelope(value) {
|
|
10
|
+
return (typeof value === 'object' &&
|
|
11
|
+
value !== null &&
|
|
12
|
+
'ok' in value &&
|
|
13
|
+
typeof value.ok === 'boolean');
|
|
14
|
+
}
|
|
15
|
+
/** Return the dispatcher's inner `data`, or exit with a structured error when
|
|
16
|
+
* the dispatcher reported `ok: false`. Non-envelope results pass through. */
|
|
17
|
+
export function unwrapDispatch(result) {
|
|
18
|
+
if (!isDispatchEnvelope(result))
|
|
19
|
+
return result;
|
|
20
|
+
if (result.ok)
|
|
21
|
+
return result.data ?? null;
|
|
22
|
+
const err = result.error;
|
|
23
|
+
let message = 'Action failed.';
|
|
24
|
+
if (typeof err === 'string') {
|
|
25
|
+
message = err;
|
|
26
|
+
}
|
|
27
|
+
else if (err && typeof err === 'object') {
|
|
28
|
+
const obj = err;
|
|
29
|
+
message = String(obj.message ?? obj.code ?? JSON.stringify(err));
|
|
30
|
+
}
|
|
31
|
+
return emitError('action_failed', message, ExitCode.RUNTIME);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=unwrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unwrap.js","sourceRoot":"","sources":["../../src/output/unwrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAQnD,SAAS,kBAAkB,CAAC,KAAc;IACxC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,IAAI,IAAI,KAAK;QACb,OAAQ,KAAyB,CAAC,EAAE,KAAK,SAAS,CACnD,CAAA;AACH,CAAC;AAED;6EAC6E;AAC7E,MAAM,UAAU,cAAc,CAAC,MAAe;IAC5C,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAA;IAC9C,IAAI,MAAM,CAAC,EAAE;QAAE,OAAO,MAAM,CAAC,IAAI,IAAI,IAAI,CAAA;IAEzC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAA;IACxB,IAAI,OAAO,GAAG,gBAAgB,CAAA;IAC9B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,GAAG,GAAG,CAAA;IACf,CAAC;SAAM,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC1C,MAAM,GAAG,GAAG,GAA8B,CAAA;QAC1C,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAA;IAClE,CAAC;IACD,OAAO,SAAS,CAAC,eAAe,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;AAC9D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Resolve a user-supplied reference (id, slug, or name) to a list item. */
|
|
2
|
+
interface Named {
|
|
3
|
+
id: string;
|
|
4
|
+
slug?: string | null;
|
|
5
|
+
name?: string | null;
|
|
6
|
+
}
|
|
7
|
+
export type MatchResult<T> = {
|
|
8
|
+
kind: 'match';
|
|
9
|
+
item: T;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'ambiguous';
|
|
12
|
+
matches: T[];
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'none';
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Resolve a reference by exact id, then exact slug (both unique), then
|
|
18
|
+
* case-insensitive name. Names are NOT unique, so a name that matches more than
|
|
19
|
+
* one item returns ``ambiguous`` (the caller should ask for a slug/id) rather
|
|
20
|
+
* than silently picking the first.
|
|
21
|
+
*/
|
|
22
|
+
export declare function matchRef<T extends Named>(items: T[], ref: string): MatchResult<T>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,UAAU,KAAK;IACb,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IACrB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,CAAC,EAAE,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpB;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAajF"}
|
package/dist/resolve.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Resolve a user-supplied reference (id, slug, or name) to a list item. */
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a reference by exact id, then exact slug (both unique), then
|
|
4
|
+
* case-insensitive name. Names are NOT unique, so a name that matches more than
|
|
5
|
+
* one item returns ``ambiguous`` (the caller should ask for a slug/id) rather
|
|
6
|
+
* than silently picking the first.
|
|
7
|
+
*/
|
|
8
|
+
export function matchRef(items, ref) {
|
|
9
|
+
const r = ref.trim();
|
|
10
|
+
const byId = items.find((i) => i.id === r);
|
|
11
|
+
if (byId)
|
|
12
|
+
return { kind: 'match', item: byId };
|
|
13
|
+
const bySlug = items.find((i) => i.slug != null && i.slug === r);
|
|
14
|
+
if (bySlug)
|
|
15
|
+
return { kind: 'match', item: bySlug };
|
|
16
|
+
const lower = r.toLowerCase();
|
|
17
|
+
const byName = items.filter((i) => (i.name ?? '').toLowerCase() === lower);
|
|
18
|
+
if (byName.length === 1)
|
|
19
|
+
return { kind: 'match', item: byName[0] };
|
|
20
|
+
if (byName.length > 1)
|
|
21
|
+
return { kind: 'ambiguous', matches: byName };
|
|
22
|
+
return { kind: 'none' };
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAa5E;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAkB,KAAU,EAAE,GAAW;IAC/D,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IACpB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAA;IAC1C,IAAI,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IAE9C,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAA;IAChE,IAAI,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IAElD,MAAM,KAAK,GAAG,CAAC,CAAC,WAAW,EAAE,CAAA;IAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,CAAA;IAC1E,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;IAClE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;IACpE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Safe in-memory unzip for skill bundles downloaded from the CDN.
|
|
2
|
+
*
|
|
3
|
+
* Mirrors the server's `packages/services/marketplace/zip_safety.py` rules so a
|
|
4
|
+
* bundle the packer produces is one the CLI will accept: strip a single top
|
|
5
|
+
* folder, reject path traversal / absolute / backslash / symlink-ish paths,
|
|
6
|
+
* enforce an extension whitelist + count/size caps, and require SKILL.md at the
|
|
7
|
+
* (stripped) root. Pure — returns a relpath→bytes map without touching disk, so
|
|
8
|
+
* it is unit-testable and the caller decides where to write. */
|
|
9
|
+
export declare class UnzipError extends Error {
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
/** Unzip + validate; returns a stripped relpath → bytes map. Throws UnzipError. */
|
|
13
|
+
export declare function safeUnzip(data: Uint8Array): Map<string, Uint8Array>;
|
|
14
|
+
//# sourceMappingURL=unzip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unzip.d.ts","sourceRoot":"","sources":["../../src/skills/unzip.ts"],"names":[],"mappings":"AAAA;;;;;;;gEAOgE;AAUhE,qBAAa,UAAW,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAI5B;AA+BD,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAoCnE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Safe in-memory unzip for skill bundles downloaded from the CDN.
|
|
2
|
+
*
|
|
3
|
+
* Mirrors the server's `packages/services/marketplace/zip_safety.py` rules so a
|
|
4
|
+
* bundle the packer produces is one the CLI will accept: strip a single top
|
|
5
|
+
* folder, reject path traversal / absolute / backslash / symlink-ish paths,
|
|
6
|
+
* enforce an extension whitelist + count/size caps, and require SKILL.md at the
|
|
7
|
+
* (stripped) root. Pure — returns a relpath→bytes map without touching disk, so
|
|
8
|
+
* it is unit-testable and the caller decides where to write. */
|
|
9
|
+
import { unzipSync } from 'fflate';
|
|
10
|
+
const ALLOWED_EXTENSIONS = new Set(['.md', '.json', '.txt', '.yaml', '.yml', '.csv']);
|
|
11
|
+
const MAX_FILE_COUNT = 100;
|
|
12
|
+
const MAX_SINGLE_FILE_BYTES = 10 * 1024 * 1024;
|
|
13
|
+
const MAX_TOTAL_BYTES = 50 * 1024 * 1024;
|
|
14
|
+
const SKILL_MANIFEST = 'SKILL.md';
|
|
15
|
+
export class UnzipError extends Error {
|
|
16
|
+
constructor(message) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.name = 'UnzipError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function isMacMetadata(name) {
|
|
22
|
+
if (name.startsWith('__MACOSX/') || name.includes('/__MACOSX/'))
|
|
23
|
+
return true;
|
|
24
|
+
const base = name.split('/').pop() ?? '';
|
|
25
|
+
return base === '.DS_Store' || base.startsWith('._');
|
|
26
|
+
}
|
|
27
|
+
/** If every entry sits under the same top-level dir, return that dir; else null. */
|
|
28
|
+
function singleTopFolder(names) {
|
|
29
|
+
const first = names[0].split('/', 1)[0];
|
|
30
|
+
if (!first || first === names[0])
|
|
31
|
+
return null; // already flat
|
|
32
|
+
const ok = names.every((n) => n.startsWith(`${first}/`) && n !== `${first}/`);
|
|
33
|
+
return ok ? first : null;
|
|
34
|
+
}
|
|
35
|
+
function checkPath(rel) {
|
|
36
|
+
if (!rel || rel.startsWith('/') || rel.includes('\\')) {
|
|
37
|
+
throw new UnzipError(`unsafe path: ${rel}`);
|
|
38
|
+
}
|
|
39
|
+
if (rel.split('/').some((seg) => seg === '..' || seg === '.')) {
|
|
40
|
+
throw new UnzipError(`path traversal: ${rel}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function extOf(rel) {
|
|
44
|
+
const base = rel.split('/').pop() ?? '';
|
|
45
|
+
const dot = base.lastIndexOf('.');
|
|
46
|
+
return dot >= 0 ? base.slice(dot).toLowerCase() : '';
|
|
47
|
+
}
|
|
48
|
+
/** Unzip + validate; returns a stripped relpath → bytes map. Throws UnzipError. */
|
|
49
|
+
export function safeUnzip(data) {
|
|
50
|
+
let raw;
|
|
51
|
+
try {
|
|
52
|
+
raw = unzipSync(data);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
throw new UnzipError(`corrupt zip: ${err.message}`);
|
|
56
|
+
}
|
|
57
|
+
const names = Object.keys(raw).filter((n) => !n.endsWith('/') && !isMacMetadata(n));
|
|
58
|
+
if (names.length === 0)
|
|
59
|
+
throw new UnzipError('empty zip');
|
|
60
|
+
if (names.length > MAX_FILE_COUNT) {
|
|
61
|
+
throw new UnzipError(`too many files: ${names.length} > ${MAX_FILE_COUNT}`);
|
|
62
|
+
}
|
|
63
|
+
const top = singleTopFolder(names);
|
|
64
|
+
const out = new Map();
|
|
65
|
+
let total = 0;
|
|
66
|
+
for (const name of names) {
|
|
67
|
+
const rel = top ? name.slice(top.length + 1) : name;
|
|
68
|
+
checkPath(rel);
|
|
69
|
+
if (!ALLOWED_EXTENSIONS.has(extOf(rel))) {
|
|
70
|
+
throw new UnzipError(`disallowed extension: ${rel}`);
|
|
71
|
+
}
|
|
72
|
+
const bytes = raw[name];
|
|
73
|
+
if (bytes.length > MAX_SINGLE_FILE_BYTES) {
|
|
74
|
+
throw new UnzipError(`file too large: ${rel} (${bytes.length}B)`);
|
|
75
|
+
}
|
|
76
|
+
total += bytes.length;
|
|
77
|
+
if (total > MAX_TOTAL_BYTES)
|
|
78
|
+
throw new UnzipError(`bundle too large: ${total}B`);
|
|
79
|
+
out.set(rel, bytes);
|
|
80
|
+
}
|
|
81
|
+
if (!out.has(SKILL_MANIFEST)) {
|
|
82
|
+
throw new UnzipError(`${SKILL_MANIFEST} required at bundle root`);
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=unzip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unzip.js","sourceRoot":"","sources":["../../src/skills/unzip.ts"],"names":[],"mappings":"AAAA;;;;;;;gEAOgE;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AACrF,MAAM,cAAc,GAAG,GAAG,CAAA;AAC1B,MAAM,qBAAqB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AAC9C,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AACxC,MAAM,cAAc,GAAG,UAAU,CAAA;AAEjC,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,YAAY,CAAA;IAC1B,CAAC;CACF;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAA;IAC5E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAA;IACxC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;AACtD,CAAC;AAED,oFAAoF;AACpF,SAAS,eAAe,CAAC,KAAe;IACtC,MA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AAyB,GAAG,EAAE,CAAC,CAAA;QACtD,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAA;QACvB,IAAI,KAAK,CAAC,MAAM,GAAG,qBAAqB,EAAE,CAAC;YACzC,MAAM,IAAI,UAAU,CAAC,mBAAmB,GAAG,KAAK,KAAK,CAAC,MAAM,IAAI,CAAC,CAAA;QACnE,CAAC;QACD,KAAK,IAAI,KAAK,CAAC,MAAM,CAAA;QACrB,IAAI,KAAK,GAAG,eAAe;YAAE,MAAM,IAAI,UAAU,CAAC,qBAAqB,KAAK,GAAG,CAAC,CAAA;QAChF,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACrB,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,UAAU,CAAC,GAAG,cAAc,0BAA0B,CAAC,CAAA;IACnE,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
export interface UpdateCheckResult {
|
|
3
|
+
packageName: string;
|
|
4
|
+
currentVersion: string;
|
|
5
|
+
latestVersion: string | null;
|
|
6
|
+
published: boolean;
|
|
7
|
+
updateAvailable: boolean;
|
|
8
|
+
installCommand: string;
|
|
9
|
+
checkedAt: string;
|
|
10
|
+
registryUrl: string;
|
|
11
|
+
}
|
|
12
|
+
interface CheckOptions {
|
|
13
|
+
currentVersion?: string;
|
|
14
|
+
registryUrl?: string;
|
|
15
|
+
useCache?: boolean;
|
|
16
|
+
fetchImpl?: typeof fetch;
|
|
17
|
+
now?: Date;
|
|
18
|
+
}
|
|
19
|
+
export declare function compareSemverish(a: string, b: string): number;
|
|
20
|
+
export declare function checkForUpdate(opts?: CheckOptions): Promise<UpdateCheckResult>;
|
|
21
|
+
export declare function maybeNotifyUpdate(): Promise<void>;
|
|
22
|
+
export declare function registerUpdateCheckCommand(program: Command): void;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=update-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../src/update-check.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAiBnC,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,SAAS,EAAE,OAAO,CAAA;IAClB,eAAe,EAAE,OAAO,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,YAAY;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB,GAAG,CAAC,EAAE,IAAI,CAAA;CACX;AAgED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAwBD,wBAAsB,cAAc,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAwCxF;AASD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAavD;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+BjE"}
|