@pipobscure/bundle 0.0.1

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 (98) hide show
  1. package/HISTORY.md +1924 -0
  2. package/README.md +623 -0
  3. package/bundle.run +0 -0
  4. package/dist/api.d.ts +147 -0
  5. package/dist/api.d.ts.map +1 -0
  6. package/dist/api.js +174 -0
  7. package/dist/api.js.map +1 -0
  8. package/dist/archive.d.ts +115 -0
  9. package/dist/archive.d.ts.map +1 -0
  10. package/dist/archive.js +188 -0
  11. package/dist/archive.js.map +1 -0
  12. package/dist/audit.d.ts +78 -0
  13. package/dist/audit.d.ts.map +1 -0
  14. package/dist/audit.js +119 -0
  15. package/dist/audit.js.map +1 -0
  16. package/dist/cli.d.ts +23 -0
  17. package/dist/cli.d.ts.map +1 -0
  18. package/dist/cli.js +555 -0
  19. package/dist/cli.js.map +1 -0
  20. package/dist/files.d.ts +53 -0
  21. package/dist/files.d.ts.map +1 -0
  22. package/dist/files.js +118 -0
  23. package/dist/files.js.map +1 -0
  24. package/dist/index.d.ts +10 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +35 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/launch.d.ts +97 -0
  29. package/dist/launch.d.ts.map +1 -0
  30. package/dist/launch.js +267 -0
  31. package/dist/launch.js.map +1 -0
  32. package/dist/main.d.ts +3 -0
  33. package/dist/main.d.ts.map +1 -0
  34. package/dist/main.js +19 -0
  35. package/dist/main.js.map +1 -0
  36. package/dist/manifest.d.ts +139 -0
  37. package/dist/manifest.d.ts.map +1 -0
  38. package/dist/manifest.js +504 -0
  39. package/dist/manifest.js.map +1 -0
  40. package/dist/oidc.d.ts +40 -0
  41. package/dist/oidc.d.ts.map +1 -0
  42. package/dist/oidc.js +320 -0
  43. package/dist/oidc.js.map +1 -0
  44. package/dist/preload.d.ts +14 -0
  45. package/dist/preload.d.ts.map +1 -0
  46. package/dist/preload.js +38 -0
  47. package/dist/preload.js.map +1 -0
  48. package/dist/provider.d.ts +83 -0
  49. package/dist/provider.d.ts.map +1 -0
  50. package/dist/provider.js +206 -0
  51. package/dist/provider.js.map +1 -0
  52. package/dist/record.d.ts +2 -0
  53. package/dist/record.d.ts.map +1 -0
  54. package/dist/record.js +23 -0
  55. package/dist/record.js.map +1 -0
  56. package/dist/recorder.d.ts +64 -0
  57. package/dist/recorder.d.ts.map +1 -0
  58. package/dist/recorder.js +111 -0
  59. package/dist/recorder.js.map +1 -0
  60. package/dist/register.d.ts +2 -0
  61. package/dist/register.d.ts.map +1 -0
  62. package/dist/register.js +28 -0
  63. package/dist/register.js.map +1 -0
  64. package/dist/sea.d.ts +97 -0
  65. package/dist/sea.d.ts.map +1 -0
  66. package/dist/sea.js +220 -0
  67. package/dist/sea.js.map +1 -0
  68. package/dist/sigstore.d.ts +112 -0
  69. package/dist/sigstore.d.ts.map +1 -0
  70. package/dist/sigstore.js +385 -0
  71. package/dist/sigstore.js.map +1 -0
  72. package/dist/skill.d.ts +36 -0
  73. package/dist/skill.d.ts.map +1 -0
  74. package/dist/skill.js +108 -0
  75. package/dist/skill.js.map +1 -0
  76. package/package.json +84 -0
  77. package/shell-base +2 -0
  78. package/skills/audit-bundle/SKILL.md +271 -0
  79. package/src/api.ts +293 -0
  80. package/src/archive.ts +312 -0
  81. package/src/audit.ts +206 -0
  82. package/src/cli.ts +575 -0
  83. package/src/files.ts +156 -0
  84. package/src/index.ts +114 -0
  85. package/src/launch.ts +336 -0
  86. package/src/main.ts +20 -0
  87. package/src/manifest.ts +615 -0
  88. package/src/oidc.ts +372 -0
  89. package/src/preload.ts +40 -0
  90. package/src/provider.ts +270 -0
  91. package/src/record.ts +25 -0
  92. package/src/recorder.ts +166 -0
  93. package/src/register.ts +30 -0
  94. package/src/sea.ts +341 -0
  95. package/src/sigstore.ts +492 -0
  96. package/src/skill.ts +132 -0
  97. package/src/types/node-vfs.d.ts +90 -0
  98. package/src/types/node-zip.d.ts +85 -0
@@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OAAO,EAAE,MAAM,CAAC;aACxC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;aACxD,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACP,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,QAA+B;IAClD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,QAAQ;QAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,KAAK,CAAC,GAAa,EAAE,MAAc;IACxC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,78 @@
1
+ /** What an audit concluded, as the gate reads it. */
2
+ export interface Verdict {
3
+ /** The archive reviewed, as the auditor referred to it. */
4
+ bundle?: string | undefined;
5
+ /** sha256 of the archive file — what pins the verdict to the bytes. */
6
+ sha256?: string | undefined;
7
+ /** The archive it was reviewed against, when the review was a diff. */
8
+ baseline?: string | undefined;
9
+ baselineSha256?: string | undefined;
10
+ /** Which question was answered: whether to sign it, or whether to run it. */
11
+ mode?: 'sign' | 'run' | undefined;
12
+ state?: string | undefined;
13
+ members?: number | undefined;
14
+ /** How many members were actually read — the changed set, in diff mode. */
15
+ reviewed?: number | undefined;
16
+ verdict?: 'pass' | 'fail' | undefined;
17
+ summary?: string | undefined;
18
+ findings?: Finding[] | undefined;
19
+ /** 'human' when a person recorded it rather than the skill. */
20
+ by?: string | undefined;
21
+ at?: string | undefined;
22
+ }
23
+ export interface Finding {
24
+ severity: string;
25
+ file: string;
26
+ line?: number | undefined;
27
+ what: string;
28
+ why?: string | undefined;
29
+ }
30
+ export interface AuditOptions {
31
+ /** The archive under review. */
32
+ bundle: string;
33
+ /** Where the verdict is written and read (default: `<bundle>.audit.json`). */
34
+ verdict?: string | undefined;
35
+ /** A previously approved archive to review against, when there is one. */
36
+ baseline?: string | undefined;
37
+ }
38
+ /** What `prepare()` found, for a caller that wants to report it itself. */
39
+ export interface Preparation {
40
+ bundle: string;
41
+ sha256: string;
42
+ state: string;
43
+ members: string[];
44
+ verdict: string;
45
+ /** Present when a baseline was supplied and exists. */
46
+ baseline?: {
47
+ path: string;
48
+ sha256: string;
49
+ added: string[];
50
+ removed: string[];
51
+ carried: number;
52
+ } | undefined;
53
+ }
54
+ /** Where the verdict for `bundle` lives, unless the caller says otherwise. */
55
+ export declare function verdictPath(bundle: string, override?: string | undefined): string;
56
+ /**
57
+ * Describe what is about to be audited: its hash, its members, and — when a
58
+ * baseline is given — what changed since. Throws when the archive does not hold
59
+ * together, because reviewing an archive whose contents are not what it says
60
+ * they are is worse than not reviewing it.
61
+ */
62
+ export declare function prepare({ bundle, verdict, baseline }: AuditOptions): Preparation;
63
+ /**
64
+ * The gate. Returns the verdict when it passes; throws with the reason when it
65
+ * does not — no verdict, a verdict over different bytes, a verdict against a
66
+ * different baseline, or a verdict that failed.
67
+ */
68
+ export declare function check({ bundle, verdict, baseline }: AuditOptions): Verdict;
69
+ /**
70
+ * Record a clean verdict reached by reading the archive yourself. It writes the
71
+ * same file the skill would, marked `by: 'human'`, so the gate treats both
72
+ * identically while the record still says which happened.
73
+ */
74
+ export declare function approve({ bundle, verdict, baseline, note }: AuditOptions & {
75
+ /** What you checked — it becomes the verdict's summary. */
76
+ note?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,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED,2EAA2E;AAC3E,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,QAAQ,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACnB,GAAG,SAAS,CAAC;CACjB;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEjF;AAMD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,YAAY,GAAG,WAAW,CAgChF;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,YAAY,GAAG,OAAO,CAwC1E;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,YAAY,GAAG;IACxE,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,GAAG,OAAO,CAmBV"}
package/dist/audit.js ADDED
@@ -0,0 +1,119 @@
1
+ import * as FS from 'node:fs';
2
+ import * as PATH from 'node:path';
3
+ import * as CRYPTO from 'node:crypto';
4
+ import { verifyBundleSync, inspectBundle } from './api.js';
5
+ import { STATES, message } from './manifest.js';
6
+ /** Where the verdict for `bundle` lives, unless the caller says otherwise. */
7
+ export function verdictPath(bundle, override) {
8
+ return override ? PATH.resolve(override) : `${PATH.resolve(bundle)}.audit.json`;
9
+ }
10
+ function sha256Of(path) {
11
+ return CRYPTO.createHash('sha256').update(FS.readFileSync(path)).digest('hex');
12
+ }
13
+ /**
14
+ * Describe what is about to be audited: its hash, its members, and — when a
15
+ * baseline is given — what changed since. Throws when the archive does not hold
16
+ * together, because reviewing an archive whose contents are not what it says
17
+ * they are is worse than not reviewing it.
18
+ */
19
+ export function prepare({ bundle, verdict, baseline }) {
20
+ if (!FS.existsSync(bundle))
21
+ throw new Error(`there is no archive at ${bundle}`);
22
+ // Damaged badly enough not to parse as a ZIP throws from inside the reader
23
+ // rather than answering; that is still a refusal and should read as one.
24
+ let state, members;
25
+ try {
26
+ state = verifyBundleSync(bundle).state;
27
+ ({ members } = inspectBundle(bundle));
28
+ }
29
+ catch (err) {
30
+ throw new Error(`${bundle} could not be read as an archive: ${message(err)}`);
31
+ }
32
+ if (state === 'invalid') {
33
+ throw new Error(`${bundle} is ${STATES.invalid.label} — rebuild it rather than reviewing it; ` +
34
+ 'what you would review is not what it holds');
35
+ }
36
+ const found = {
37
+ bundle, sha256: sha256Of(bundle), state, members,
38
+ verdict: verdictPath(bundle, verdict),
39
+ };
40
+ if (baseline && FS.existsSync(baseline)) {
41
+ const previous = inspectBundle(baseline).members;
42
+ const added = members.filter((name) => !previous.includes(name));
43
+ const removed = previous.filter((name) => !members.includes(name));
44
+ found.baseline = {
45
+ path: baseline, sha256: sha256Of(baseline),
46
+ added, removed, carried: members.length - added.length,
47
+ };
48
+ }
49
+ return found;
50
+ }
51
+ /**
52
+ * The gate. Returns the verdict when it passes; throws with the reason when it
53
+ * does not — no verdict, a verdict over different bytes, a verdict against a
54
+ * different baseline, or a verdict that failed.
55
+ */
56
+ export function check({ bundle, verdict, baseline }) {
57
+ const path = verdictPath(bundle, verdict);
58
+ if (!FS.existsSync(path)) {
59
+ throw new Error(`${bundle} has not been audited — there is no verdict at ${path}`);
60
+ }
61
+ let found;
62
+ try {
63
+ found = JSON.parse(FS.readFileSync(path, 'utf-8'));
64
+ }
65
+ catch (err) {
66
+ throw new Error(`${path} is not readable JSON: ${message(err)}`);
67
+ }
68
+ const sha256 = sha256Of(bundle);
69
+ if (found.sha256?.toLowerCase() !== sha256) {
70
+ throw new Error(`${path} approves different bytes — it is stale.\n` +
71
+ ` approved: ${found.sha256 ?? '(none)'}\n` +
72
+ ` on disk: ${sha256}\n` +
73
+ ' re-audit the archive this build actually produced');
74
+ }
75
+ // A baseline that was available but reviewed against something else is the
76
+ // one way this gate can be fooled honestly: a verdict claiming a diff it did
77
+ // not do. A verdict recording *no* baseline is a full review, which is fine.
78
+ if (baseline && FS.existsSync(baseline) && found.baselineSha256) {
79
+ const expected = sha256Of(baseline);
80
+ if (found.baselineSha256.toLowerCase() !== expected) {
81
+ throw new Error(`${path} was reached against a different baseline.\n` +
82
+ ` audited against: ${found.baselineSha256}\n` +
83
+ ` on disk: ${expected}\n` +
84
+ ' re-audit against the baseline this build is comparing to');
85
+ }
86
+ }
87
+ if (found.verdict !== 'pass') {
88
+ const serious = (found.findings ?? []).filter((f) => f.severity !== 'note');
89
+ throw new Error(`the audit of ${bundle} did not pass: ${found.summary ?? '(no summary)'}` +
90
+ serious.map((f) => `\n [${f.severity}] ${f.file}${f.line ? `:${f.line}` : ''} — ${f.what}`).join(''));
91
+ }
92
+ return found;
93
+ }
94
+ /**
95
+ * Record a clean verdict reached by reading the archive yourself. It writes the
96
+ * same file the skill would, marked `by: 'human'`, so the gate treats both
97
+ * identically while the record still says which happened.
98
+ */
99
+ export function approve({ bundle, verdict, baseline, note }) {
100
+ const found = prepare({ bundle, verdict, baseline });
101
+ const recorded = {
102
+ bundle,
103
+ sha256: found.sha256,
104
+ ...(found.baseline ? { baseline: found.baseline.path, baselineSha256: found.baseline.sha256 } : {}),
105
+ mode: 'sign',
106
+ state: found.state,
107
+ members: found.members.length,
108
+ reviewed: found.members.length,
109
+ verdict: 'pass',
110
+ summary: note ?? 'approved by hand; no note given',
111
+ findings: [],
112
+ by: 'human',
113
+ at: new Date().toISOString(),
114
+ };
115
+ FS.mkdirSync(PATH.dirname(found.verdict), { recursive: true });
116
+ FS.writeFileSync(found.verdict, `${JSON.stringify(recorded, null, 2)}\n`);
117
+ return recorded;
118
+ }
119
+ //# sourceMappingURL=audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AA8EhD,8EAA8E;AAC9E,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,QAA6B;IACrE,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC;AACpF,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC1B,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAgB;IAC/D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,0B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E,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnG,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;QAC7B,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;QAC9B,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,IAAI,IAAI,iCAAiC;QAClD,QAAQ,EAAE,EAAE;QACZ,EAAE,EAAE,OAAO;QACX,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KAC/B,CAAC;IACF,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1E,OAAO,QAAQ,CAAC;AACpB,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { STATES, type VerificationResult } from './manifest.ts';
2
+ export { STATES };
3
+ export declare const USAGE = "usage: bundle <command> [options]\n\ncommands:\n create build an archive from a list of files\n sign sign an archive into a new file, optionally behind a prefix\n audit report what is about to be reviewed, and gate signing on the verdict\n verify verify an archive and report its trust state\n run mount a signed archive and run it\n sea build a node runtime that verifies an archive before running it\n trust refresh the sigstore trust root used to check sigstore signatures\n skill install this package's bundle-auditing skill into a project\n\ncreate options:\n -b, --base <dir> base directory the file list is relative to (default: .)\n -p, --prefix <file> prefix prepended before the archive (launcher or binary);\n omit it for a plain archive meant to be run from a mount\n -f, --files <file> read the newline-separated file list from here (default: stdin)\n -o, --output <file> write the archive here (default: stdout)\n -k, --key <file> leaf private key (PEM); signs at build time with --chain\n -c, --chain <file> full certificate chain (PEM, leaf first)\n --hash <alg> digest for the whole-file hash and member digests (default: sha256)\n --sign <alg> digest the signature over that hash uses (default: sha256)\n\nsign options: usage: sign [options] <archive>\n -o, --output <file> write the signed archive here (default: stdout)\n -l, --launcher prepend this package's shell launcher, so the result runs\n by name \u2014 the usual way to make a self-executing archive\n -p, --prefix <file> prepend some other prefix: a launcher of your own, or a\n node binary; omit both for a plain mountable archive\n -x, --executable make the output executable (implied by --launcher/--prefix)\n --hash <alg> digest for the whole-file hash and member digests (default: sha256)\n --sign <alg> digest the signature over that hash uses (default: sha256)\n\n by default this signs through sigstore, taking the identity from CI when\n there is one and otherwise opening a GitHub sign-in:\n --flow <how> auto | ci | browser | device (default: auto)\n --token <jwt> use this OIDC token instead of signing in\n --oidc-issuer <url> OIDC issuer (default: sigstore's dex)\n --connector <name> identity provider to jump to (default: github)\n --fulcio <url> certificate authority (default: fulcio.sigstore.dev)\n --rekor <url> transparency log; empty string to skip it\n --tsa <url> timestamp authority; empty string to skip it\n\n or, to sign against a certificate authority of your own:\n -k, --key <file> leaf private key (PEM)\n -c, --chain <file> full certificate chain (PEM, leaf first)\n\naudit options: usage: audit [options] <archive>\n -b, --baseline <file> a previously approved archive to review against, so the\n review is of what changed rather than of everything\n -v, --verdict <file> where the verdict is (default: <archive>.audit.json)\n --check exit non-zero unless a clean verdict pins these bytes\n --approve record a clean verdict you reached by reading it yourself\n -n, --note <text> what you checked, recorded with --approve\n\n with none of those it reports what is about to be reviewed and how. The review\n itself needs judgement, so no command performs it: install the skill with\n 'bundle skill' and run /audit-bundle, or read the archive yourself and\n --approve. Signing is not gated unless you run --check before it.\n\nverify options: usage: verify [options] <archive>\n -a, --archive <file> archive to verify (or pass it as a positional argument)\n -r, --root <file> extra trusted root certificate (PEM); repeatable\n --identity <san> require this sigstore signing identity\n --issuer <url> require this sigstore OIDC issuer\n --sigstore-root <file> sigstore trust root (default: the cache 'trust' fills)\n --json print the result as JSON\n\nrun options: usage: run [options] <archive> [-- <app args>]\n -r, --root <file> extra trusted root certificate (PEM); repeatable\n --identity <san> require this sigstore signing identity\n --issuer <url> require this sigstore OIDC issuer\n --untrusted run an archive whose signature is good but untrusted\n\nsea options: usage: sea [options] [archive]\n -o, --output <file> write the executable here (required)\n --node <file> node binary to embed (default: the running one)\n --base <file> reuse a SEA base built earlier instead of building one\n --no-sigstore leave the sigstore libraries out of the embedded verifier\n --untrusted let the finished executable run an archive whose\n signature is good but unanchored\n -r, --root <file> trusted root the executable checks against; repeatable\n --identity <san> identity the executable requires of a signature\n --issuer <url> issuer the executable requires of a signature\n\n with an archive, the result is that application: one file that verifies\n itself and runs what is inside it. without one, the result is a verifying\n node \u2014 a runtime that takes an archive on its own command line:\n\n bundle sea -o node-verifying\n ./node-verifying ./my-app.zip --args --for --the --app\n\n a runtime built with a policy (-r, --identity, --issuer) is sealed: it\n accepts no policy from its command line, because a binary that demands a\n signing identity is not one whose user can ask it to stop.\n\n the signing options are the same as 'sign': sigstore by default, or --key\n with --chain against a certificate authority of your own\n\ntrust options:\n --mirror <url> TUF repository to refresh from (default: sigstore's)\n\nskill options: usage: skill [options] [name]\n -d, --dir <dir> where to install (default: .claude/skills)\n -f, --force overwrite files that are already there\n -l, --list list the skills this package carries and stop\n\n -h, --help show this help";
4
+ /** Where a command's output goes. Swappable so tests need no subprocess. */
5
+ export interface Console {
6
+ out(line: string): void;
7
+ err(line: string): void;
8
+ }
9
+ /**
10
+ * The commands, in the order the usage text lists them. Keeping the dispatch
11
+ * table and the help in one place is what stops the two drifting apart.
12
+ */
13
+ export declare const COMMANDS: Record<string, (args: string[], io: Console) => number | Promise<number>>;
14
+ /**
15
+ * Run one CLI invocation. `argv` is the user's arguments — everything after the
16
+ * runtime and the entry point — and the return value is the process exit code,
17
+ * so a caller decides what to do with it rather than being exited out from
18
+ * under.
19
+ */
20
+ export declare function main(argv: string[], io?: Console): Promise<number>;
21
+ /** Print a verification result, as text or as the JSON `--json` produces. */
22
+ export declare function report(res: VerificationResult, json: boolean, io: Console): void;
23
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAOA,OAAO,EAAW,MAAM,EAAE,KAAK,kBAAkB,EAA0B,MAAM,eAAe,CAAC;AAKjG,OAAO,EAAE,MAAM,EAAE,CAAC;AAQlB,eAAO,MAAM,KAAK,+vMA2GqB,CAAC;AAExC,4EAA4E;AAC5E,MAAM,WAAW,OAAO;IACpB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAOD;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9F,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,OAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBjF;AA2GD,6EAA6E;AAC7E,wBAAgB,MAAM,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CAqBhF"}