burgee 0.8.0 → 0.9.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.
- package/README.md +47 -3
- package/dist/check.d.ts +22 -0
- package/dist/check.js +35 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +12 -1
- package/dist/commander/command.js +5 -2
- package/dist/config.d.ts +10 -0
- package/dist/config.js +2 -0
- package/dist/definition.d.ts +13 -4
- package/dist/definition.js +9 -3
- package/dist/execute.d.ts +1 -0
- package/dist/execute.js +40 -26
- package/dist/exit-code.d.ts +17 -1
- package/dist/exit-code.js +1 -0
- package/dist/help-entry.d.ts +2 -0
- package/dist/help-entry.js +1 -0
- package/dist/help.d.ts +12 -0
- package/dist/help.js +6 -0
- package/dist/index.d.ts +32 -7
- package/dist/index.js +1 -7
- package/dist/mcp-entry.d.ts +2 -0
- package/dist/mcp-entry.js +1 -0
- package/dist/meow/parse.d.ts +21 -0
- package/dist/meow/parse.js +43 -0
- package/dist/meow/present.d.ts +35 -0
- package/dist/meow/present.js +58 -0
- package/dist/meow/types.d.ts +47 -0
- package/dist/meow/types.js +3 -0
- package/dist/meow/validate.d.ts +35 -0
- package/dist/meow/validate.js +144 -0
- package/dist/meow.d.ts +6 -0
- package/dist/meow.js +146 -0
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +1 -1
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +3 -0
- package/dist/schema-entry.d.ts +3 -0
- package/dist/schema-entry.js +2 -0
- package/dist/schema.json +1 -1
- package/dist/testing-helpers.js +3 -1
- package/dist/validate.d.ts +15 -0
- package/dist/validate.js +10 -0
- package/dist/yargs/factory.js +7 -2
- package/package.json +50 -9
package/dist/testing-helpers.js
CHANGED
|
@@ -133,7 +133,9 @@ export async function runBurgee(program, opts) {
|
|
|
133
133
|
await execute(program, {
|
|
134
134
|
argv: rt.argv,
|
|
135
135
|
env: rt.env,
|
|
136
|
-
|
|
136
|
+
cwd: rt.cwd,
|
|
137
|
+
stdin: rt.stdin,
|
|
138
|
+
stdout: { write: rt.stdout.write, isTTY: rt.isTTY.stdout },
|
|
137
139
|
stderr: rt.stderr,
|
|
138
140
|
exit: (c) => rt.exit(c),
|
|
139
141
|
root: program.rootPath,
|
package/dist/validate.d.ts
CHANGED
|
@@ -11,6 +11,21 @@ export declare class UsageError extends Error {
|
|
|
11
11
|
readonly hint?: string | undefined;
|
|
12
12
|
constructor(message: string, hint?: string | undefined);
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* E6 — the far side said no. Throw this and the run leaves with `ExitCode.AUTH`.
|
|
16
|
+
*
|
|
17
|
+
* The one error class whose *response* is unambiguous: not "read the message and decide" but
|
|
18
|
+
* "get a credential and run it again". A handler that throws a bare `Error` for a 401 gets
|
|
19
|
+
* `RUNTIME`, which is the code for everything, and a caller retrying on it retries forever.
|
|
20
|
+
*
|
|
21
|
+
* `fix` is the exact command that gets the credential, where the program knows it — `hint` is
|
|
22
|
+
* prose a person reads and `fix` is a line a caller runs, which is the turn the field saves.
|
|
23
|
+
*/
|
|
24
|
+
export declare class AuthError extends Error {
|
|
25
|
+
readonly hint?: string | undefined;
|
|
26
|
+
readonly fix?: string | undefined;
|
|
27
|
+
constructor(message: string, hint?: string | undefined, fix?: string | undefined);
|
|
28
|
+
}
|
|
14
29
|
type Sources = Record<string, {
|
|
15
30
|
source: string;
|
|
16
31
|
}>;
|
package/dist/validate.js
CHANGED
|
@@ -6,6 +6,16 @@ export class UsageError extends Error {
|
|
|
6
6
|
this.hint = hint;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
export class AuthError extends Error {
|
|
10
|
+
hint;
|
|
11
|
+
fix;
|
|
12
|
+
constructor(message, hint, fix) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.hint = hint;
|
|
15
|
+
this.fix = fix;
|
|
16
|
+
this.name = 'AuthError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
9
19
|
const isSet = (values, key, sources) => values[key] !== undefined && sources[key]?.source !== 'default';
|
|
10
20
|
const flagList = (keys) => flagsOf(keys).join(', ');
|
|
11
21
|
function exactlyOne(keys, on) {
|
package/dist/yargs/factory.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { ExitCode } from '../exit-code.js';
|
|
3
3
|
import { Manifest } from '../manifest.js';
|
|
4
|
-
import { serveMcp } from '../mcp.js';
|
|
5
4
|
import { machineJson, schemaOf } from '../schema.js';
|
|
6
5
|
import { tokenizeArgString } from '../yargs-parser.js';
|
|
7
6
|
import { projectManifest, render } from './burgee.js';
|
|
@@ -1288,7 +1287,9 @@ export class YargsInstance {
|
|
|
1288
1287
|
return { stdout: out.join(''), stderr: err.join(''), code };
|
|
1289
1288
|
};
|
|
1290
1289
|
const write = this.#burgee?.stdout ?? this.#shim.process.stdout();
|
|
1291
|
-
return
|
|
1290
|
+
return import('../mcp.js')
|
|
1291
|
+
.then(async ({ serveMcp }) => serveMcp(this.manifest, { input: this.#shim.process.stdin(), output: { write: (s) => void write.write(s) }, invoke }))
|
|
1292
|
+
.then(() => {
|
|
1292
1293
|
this.exit(0);
|
|
1293
1294
|
return true;
|
|
1294
1295
|
});
|
|
@@ -1315,6 +1316,10 @@ export class YargsInstance {
|
|
|
1315
1316
|
.then(async (value) => {
|
|
1316
1317
|
await manifest.fire('postRun', name, options);
|
|
1317
1318
|
return settle(value);
|
|
1319
|
+
})
|
|
1320
|
+
.catch(async (cause) => {
|
|
1321
|
+
await manifest.fire('onError', name, options);
|
|
1322
|
+
throw cause;
|
|
1318
1323
|
});
|
|
1319
1324
|
}
|
|
1320
1325
|
#settle(value, argv) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "burgee",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "An agent-native CLI framework, drop-in compatible with commander and yargs. One declaration; help, --json, --schema, --mcp and completions all projected from it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,6 +22,26 @@
|
|
|
22
22
|
"import": "./dist/plugin.js",
|
|
23
23
|
"default": "./dist/plugin.js"
|
|
24
24
|
},
|
|
25
|
+
"./help": {
|
|
26
|
+
"types": "./dist/help-entry.d.ts",
|
|
27
|
+
"import": "./dist/help-entry.js",
|
|
28
|
+
"default": "./dist/help-entry.js"
|
|
29
|
+
},
|
|
30
|
+
"./mcp": {
|
|
31
|
+
"types": "./dist/mcp-entry.d.ts",
|
|
32
|
+
"import": "./dist/mcp-entry.js",
|
|
33
|
+
"default": "./dist/mcp-entry.js"
|
|
34
|
+
},
|
|
35
|
+
"./schema": {
|
|
36
|
+
"types": "./dist/schema-entry.d.ts",
|
|
37
|
+
"import": "./dist/schema-entry.js",
|
|
38
|
+
"default": "./dist/schema-entry.js"
|
|
39
|
+
},
|
|
40
|
+
"./config": {
|
|
41
|
+
"types": "./dist/config.d.ts",
|
|
42
|
+
"import": "./dist/config.js",
|
|
43
|
+
"default": "./dist/config.js"
|
|
44
|
+
},
|
|
25
45
|
"./brand": {
|
|
26
46
|
"types": "./dist/brand.d.ts",
|
|
27
47
|
"import": "./dist/brand.js",
|
|
@@ -47,6 +67,11 @@
|
|
|
47
67
|
"import": "./dist/commander.js",
|
|
48
68
|
"default": "./dist/commander.js"
|
|
49
69
|
},
|
|
70
|
+
"./meow": {
|
|
71
|
+
"types": "./dist/meow.d.ts",
|
|
72
|
+
"import": "./dist/meow.js",
|
|
73
|
+
"default": "./dist/meow.js"
|
|
74
|
+
},
|
|
50
75
|
"./completions": {
|
|
51
76
|
"types": "./dist/completions.d.ts",
|
|
52
77
|
"import": "./dist/completions.js",
|
|
@@ -86,7 +111,7 @@
|
|
|
86
111
|
"url": "git+https://github.com/ofri-peretz/burgee.git",
|
|
87
112
|
"directory": "packages/burgee"
|
|
88
113
|
},
|
|
89
|
-
"homepage": "https://
|
|
114
|
+
"homepage": "https://burgee.interlace.tools/docs/packages/burgee",
|
|
90
115
|
"bugs": {
|
|
91
116
|
"url": "https://github.com/ofri-peretz/burgee/issues"
|
|
92
117
|
},
|
|
@@ -98,21 +123,37 @@
|
|
|
98
123
|
"yargs",
|
|
99
124
|
"mcp",
|
|
100
125
|
"agent",
|
|
101
|
-
"framework"
|
|
126
|
+
"framework",
|
|
127
|
+
"plugin",
|
|
128
|
+
"plugins",
|
|
129
|
+
"extensible",
|
|
130
|
+
"cli-framework",
|
|
131
|
+
"argument-parser",
|
|
132
|
+
"subcommands",
|
|
133
|
+
"json-schema",
|
|
134
|
+
"mcp-server",
|
|
135
|
+
"model-context-protocol",
|
|
136
|
+
"ai-agent",
|
|
137
|
+
"llm",
|
|
138
|
+
"shell-completion",
|
|
139
|
+
"typescript",
|
|
140
|
+
"zero-dependency",
|
|
141
|
+
"commander-alternative",
|
|
142
|
+
"yargs-alternative"
|
|
102
143
|
],
|
|
103
144
|
"publishConfig": {
|
|
104
145
|
"access": "public",
|
|
105
146
|
"provenance": true
|
|
106
147
|
},
|
|
107
148
|
"dependencies": {
|
|
108
|
-
"bellpull": "^0.
|
|
109
|
-
"closeout": "^0.
|
|
110
|
-
"linegauge": "^0.
|
|
111
|
-
"roundel": "^0.
|
|
112
|
-
"seniority": "^0.
|
|
149
|
+
"bellpull": "^0.2.1",
|
|
150
|
+
"closeout": "^0.3.1",
|
|
151
|
+
"linegauge": "^0.4.1",
|
|
152
|
+
"roundel": "^0.4.1",
|
|
153
|
+
"seniority": "^0.4.1"
|
|
113
154
|
},
|
|
114
155
|
"devDependencies": {
|
|
115
|
-
"vitest": "^5.0.
|
|
156
|
+
"vitest": "^5.0.1"
|
|
116
157
|
},
|
|
117
158
|
"bin": {
|
|
118
159
|
"burgee": "./dist/cli.js"
|