runspec-node 0.3.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/bin/runspec.js +4 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +384 -0
- package/dist/cli.js.map +1 -0
- package/dist/errors.d.ts +25 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +146 -0
- package/dist/errors.js.map +1 -0
- package/dist/finder.d.ts +6 -0
- package/dist/finder.d.ts.map +1 -0
- package/dist/finder.js +91 -0
- package/dist/finder.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/inference.d.ts +10 -0
- package/dist/inference.d.ts.map +1 -0
- package/dist/inference.js +69 -0
- package/dist/inference.js.map +1 -0
- package/dist/loader.d.ts +3 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +142 -0
- package/dist/loader.js.map +1 -0
- package/dist/models.d.ts +57 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +3 -0
- package/dist/models.js.map +1 -0
- package/dist/parser.d.ts +10 -0
- package/dist/parser.d.ts.map +1 -0
- package/dist/parser.js +251 -0
- package/dist/parser.js.map +1 -0
- package/dist/serve.d.ts +2 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/serve.js +199 -0
- package/dist/serve.js.map +1 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +121 -0
- package/dist/types.js.map +1 -0
- package/dist/validator.d.ts +5 -0
- package/dist/validator.d.ts.map +1 -0
- package/dist/validator.js +56 -0
- package/dist/validator.js.map +1 -0
- package/jest.config.js +8 -0
- package/package.json +36 -0
- package/src/cli.ts +378 -0
- package/src/errors.ts +126 -0
- package/src/finder.ts +59 -0
- package/src/index.ts +6 -0
- package/src/inference.ts +77 -0
- package/src/loader.ts +120 -0
- package/src/models.ts +61 -0
- package/src/parser.ts +239 -0
- package/src/serve.ts +196 -0
- package/src/types.ts +96 -0
- package/src/validator.ts +64 -0
- package/tests/test_inference.test.ts +153 -0
- package/tests/test_integration.test.ts +197 -0
- package/tests/test_loader.test.ts +169 -0
- package/tests/test_types.test.ts +110 -0
- package/tests/test_validator.test.ts +120 -0
- package/tsconfig.json +18 -0
package/bin/runspec.js
ADDED
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAW,MAAM,UAAU,CAAC;AAIpD,wBAAgB,IAAI,IAAI,IAAI,CA0B3B;AAqJD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBlG"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.main = main;
|
|
37
|
+
exports.buildSchema = buildSchema;
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const finder_1 = require("./finder");
|
|
41
|
+
const loader_1 = require("./loader");
|
|
42
|
+
const inference_1 = require("./inference");
|
|
43
|
+
// ── Entry point ───────────────────────────────────────────────────────────────
|
|
44
|
+
function main() {
|
|
45
|
+
const args = process.argv.slice(2);
|
|
46
|
+
if (!args.length || args[0] === '-h' || args[0] === '--help') {
|
|
47
|
+
printHelp();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const command = args[0];
|
|
51
|
+
const rest = args.slice(1);
|
|
52
|
+
const commands = {
|
|
53
|
+
init: cmdInit,
|
|
54
|
+
discover: cmdDiscover,
|
|
55
|
+
check: cmdCheck,
|
|
56
|
+
emit: cmdEmit,
|
|
57
|
+
serve: cmdServe,
|
|
58
|
+
};
|
|
59
|
+
if (!(command in commands)) {
|
|
60
|
+
console.log(`✗ Unknown command: ${command}`);
|
|
61
|
+
console.log(` Available commands: ${Object.keys(commands).join(', ')}`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
commands[command](rest);
|
|
65
|
+
}
|
|
66
|
+
// ── Commands ──────────────────────────────────────────────────────────────────
|
|
67
|
+
function cmdInit(args) {
|
|
68
|
+
const nameFlag = getFlag(args, '--name');
|
|
69
|
+
const fileFlag = getFlag(args, '--file');
|
|
70
|
+
const cwd = process.cwd();
|
|
71
|
+
const runnableName = nameFlag ?? sanitizeName(path.basename(cwd));
|
|
72
|
+
const pyproject = path.join(cwd, 'pyproject.toml');
|
|
73
|
+
const runspecToml = path.join(cwd, 'runspec.toml');
|
|
74
|
+
if (fileFlag === 'runspec') {
|
|
75
|
+
initRunspecToml(runspecToml, runnableName);
|
|
76
|
+
}
|
|
77
|
+
else if (fileFlag === 'pyproject' || fs.existsSync(pyproject)) {
|
|
78
|
+
initPyproject(pyproject, runnableName);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
initRunspecToml(runspecToml, runnableName);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function cmdDiscover(args) {
|
|
85
|
+
const fmt = getFlag(args, '--format') ?? 'text';
|
|
86
|
+
const discovered = discoverLocal();
|
|
87
|
+
if (!discovered.length) {
|
|
88
|
+
console.log('No runspec-aware runnables found in this environment.');
|
|
89
|
+
console.log('Add a [tool.runspec.yourname] section to pyproject.toml or create runspec.toml');
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (fmt === 'text') {
|
|
93
|
+
printDiscoverText(discovered);
|
|
94
|
+
}
|
|
95
|
+
else if (fmt === 'json') {
|
|
96
|
+
console.log(JSON.stringify(discovered, null, 2));
|
|
97
|
+
}
|
|
98
|
+
else if (['mcp', 'openai', 'anthropic'].includes(fmt)) {
|
|
99
|
+
console.log(JSON.stringify(emitAll(discovered, fmt), null, 2));
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
console.log(`✗ Unknown format: ${fmt}`);
|
|
103
|
+
console.log(' Available formats: text, json, mcp, openai, anthropic');
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function cmdCheck(args) {
|
|
108
|
+
let configPath;
|
|
109
|
+
let format;
|
|
110
|
+
try {
|
|
111
|
+
({ configPath, format } = (0, finder_1.findConfig)(process.cwd()));
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
console.log(e.message);
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
const raw = (0, loader_1.loadRaw)(configPath, format);
|
|
118
|
+
const errors = [];
|
|
119
|
+
const warnings = [];
|
|
120
|
+
const ok = [];
|
|
121
|
+
ok.push(`Config found: ${configPath}`);
|
|
122
|
+
if (format === 'pyproject') {
|
|
123
|
+
const eps = raw.entryPoints;
|
|
124
|
+
if (Object.keys(eps).length > 0) {
|
|
125
|
+
ok.push(`[project.scripts] found — ${Object.keys(eps).length} entry point(s)`);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
warnings.push('No [project.scripts] found — agents may not discover runnables automatically\n Add entry points to pyproject.toml or use runspec.toml');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if ('config' in raw.runnables) {
|
|
132
|
+
errors.push("'config' is a reserved name — rename your runnable to something else");
|
|
133
|
+
}
|
|
134
|
+
for (const [name, runnable] of Object.entries(raw.runnables)) {
|
|
135
|
+
if (!runnable.description) {
|
|
136
|
+
warnings.push(`'${name}' has no description — agents won't know what it does`);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
ok.push(`'${name}' — description present`);
|
|
140
|
+
}
|
|
141
|
+
if (!runnable.autonomy) {
|
|
142
|
+
warnings.push(`'${name}' autonomy not declared — will default to '${raw.config.autonomyDefault}'`);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
ok.push(`'${name}' — autonomy: ${runnable.autonomy}`);
|
|
146
|
+
}
|
|
147
|
+
for (const [argName, arg] of Object.entries(runnable.args ?? {})) {
|
|
148
|
+
if (!arg.description && arg.required) {
|
|
149
|
+
warnings.push(`'${name}.${argName}' is required but has no description`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
for (const msg of ok)
|
|
154
|
+
console.log(` ✓ ${msg}`);
|
|
155
|
+
for (const msg of warnings)
|
|
156
|
+
console.log(` ℹ ${msg}`);
|
|
157
|
+
for (const msg of errors)
|
|
158
|
+
console.log(` ✗ ${msg}`);
|
|
159
|
+
if (errors.length)
|
|
160
|
+
process.exit(1);
|
|
161
|
+
else if (!warnings.length)
|
|
162
|
+
console.log('\n All checks passed.');
|
|
163
|
+
}
|
|
164
|
+
function cmdEmit(args) {
|
|
165
|
+
const scriptName = getFlag(args, '--script');
|
|
166
|
+
const fmt = getFlag(args, '--format') ?? 'mcp';
|
|
167
|
+
let configPath;
|
|
168
|
+
let format;
|
|
169
|
+
try {
|
|
170
|
+
({ configPath, format } = (0, finder_1.findConfig)(process.cwd()));
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
console.log(e.message);
|
|
174
|
+
process.exit(1);
|
|
175
|
+
}
|
|
176
|
+
const raw = (0, loader_1.loadRaw)(configPath, format);
|
|
177
|
+
const config = raw.config;
|
|
178
|
+
let runnables = raw.runnables;
|
|
179
|
+
if (scriptName) {
|
|
180
|
+
if (!(scriptName in runnables)) {
|
|
181
|
+
console.log(`✗ Runnable '${scriptName}' not found`);
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
runnables = { [scriptName]: runnables[scriptName] };
|
|
185
|
+
}
|
|
186
|
+
const schema = {};
|
|
187
|
+
for (const [name, runnable] of Object.entries(runnables)) {
|
|
188
|
+
const inferred = (0, inference_1.inferScript)(runnable, config.autonomyDefault);
|
|
189
|
+
schema[name] = buildSchema(name, inferred, fmt);
|
|
190
|
+
}
|
|
191
|
+
const output = fmt === 'mcp' ? { tools: Object.values(schema) } : schema;
|
|
192
|
+
console.log(JSON.stringify(output, null, 2));
|
|
193
|
+
}
|
|
194
|
+
function cmdServe(_args) {
|
|
195
|
+
const { serve } = require('./serve');
|
|
196
|
+
serve();
|
|
197
|
+
}
|
|
198
|
+
// ── Schema builder ────────────────────────────────────────────────────────────
|
|
199
|
+
function buildSchema(name, script, fmt) {
|
|
200
|
+
const properties = {};
|
|
201
|
+
const requiredArgs = [];
|
|
202
|
+
for (const [argName, arg] of Object.entries(script.args ?? {})) {
|
|
203
|
+
properties[argName] = argToJsonSchema(arg);
|
|
204
|
+
if (arg.required)
|
|
205
|
+
requiredArgs.push(argName);
|
|
206
|
+
}
|
|
207
|
+
const schema = {
|
|
208
|
+
name,
|
|
209
|
+
description: script.description ?? '',
|
|
210
|
+
'x-autonomy': script.autonomy ?? 'confirm',
|
|
211
|
+
'x-output': script.output ?? 'text',
|
|
212
|
+
inputSchema: { type: 'object', properties },
|
|
213
|
+
};
|
|
214
|
+
if (requiredArgs.length)
|
|
215
|
+
schema['inputSchema']['required'] = requiredArgs;
|
|
216
|
+
if (script.autonomyReason)
|
|
217
|
+
schema['x-autonomy-reason'] = script.autonomyReason;
|
|
218
|
+
return schema;
|
|
219
|
+
}
|
|
220
|
+
function argToJsonSchema(arg) {
|
|
221
|
+
const typeMap = {
|
|
222
|
+
str: 'string',
|
|
223
|
+
int: 'integer',
|
|
224
|
+
float: 'number',
|
|
225
|
+
bool: 'boolean',
|
|
226
|
+
flag: 'boolean',
|
|
227
|
+
path: 'string',
|
|
228
|
+
choice: 'string',
|
|
229
|
+
};
|
|
230
|
+
let prop = { type: typeMap[arg.type ?? 'str'] ?? 'string' };
|
|
231
|
+
if (arg.description)
|
|
232
|
+
prop['description'] = arg.description;
|
|
233
|
+
if (arg.default !== undefined && arg.default !== null)
|
|
234
|
+
prop['default'] = arg.default;
|
|
235
|
+
if (arg.options)
|
|
236
|
+
prop['enum'] = arg.options;
|
|
237
|
+
if (arg.range) {
|
|
238
|
+
prop['minimum'] = arg.range[0];
|
|
239
|
+
prop['maximum'] = arg.range[1];
|
|
240
|
+
}
|
|
241
|
+
if (arg.multiple)
|
|
242
|
+
prop = { type: 'array', items: prop };
|
|
243
|
+
return prop;
|
|
244
|
+
}
|
|
245
|
+
// ── Discovery ─────────────────────────────────────────────────────────────────
|
|
246
|
+
function discoverLocal() {
|
|
247
|
+
try {
|
|
248
|
+
const { configPath, format } = (0, finder_1.findConfig)(process.cwd());
|
|
249
|
+
const raw = (0, loader_1.loadRaw)(configPath, format);
|
|
250
|
+
return Object.entries(raw.runnables).map(([name, spec]) => ({ source: configPath, runnable: name, spec }));
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
return [];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function emitAll(discovered, fmt) {
|
|
257
|
+
const tools = discovered.map((item) => buildSchema(item.runnable, item.spec, fmt));
|
|
258
|
+
if (fmt === 'mcp')
|
|
259
|
+
return { tools };
|
|
260
|
+
return Object.fromEntries(tools.map((t) => [t['name'], t]));
|
|
261
|
+
}
|
|
262
|
+
function printDiscoverText(discovered) {
|
|
263
|
+
const bySource = {};
|
|
264
|
+
for (const item of discovered) {
|
|
265
|
+
(bySource[item.source] ??= []).push(item.runnable);
|
|
266
|
+
}
|
|
267
|
+
console.log(`Found ${discovered.length} runspec-aware runnable(s):\n`);
|
|
268
|
+
for (const [source, runnables] of Object.entries(bySource)) {
|
|
269
|
+
console.log(` ${source}`);
|
|
270
|
+
for (const r of runnables)
|
|
271
|
+
console.log(` • ${r}`);
|
|
272
|
+
}
|
|
273
|
+
console.log();
|
|
274
|
+
console.log("Run 'runspec discover --format mcp' to emit MCP tool schemas.");
|
|
275
|
+
}
|
|
276
|
+
// ── Init helpers ──────────────────────────────────────────────────────────────
|
|
277
|
+
function sanitizeName(raw) {
|
|
278
|
+
const s = raw.toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/^_+|_+$/g, '');
|
|
279
|
+
return s || 'myscript';
|
|
280
|
+
}
|
|
281
|
+
function initPyproject(filePath, name) {
|
|
282
|
+
if (fs.existsSync(filePath)) {
|
|
283
|
+
const original = fs.readFileSync(filePath, 'utf-8');
|
|
284
|
+
let data;
|
|
285
|
+
try {
|
|
286
|
+
const { parse } = require('smol-toml');
|
|
287
|
+
data = parse(original);
|
|
288
|
+
}
|
|
289
|
+
catch (e) {
|
|
290
|
+
console.log(`✗ Could not read ${path.basename(filePath)}: ${e.message}`);
|
|
291
|
+
process.exit(1);
|
|
292
|
+
}
|
|
293
|
+
if ('runspec' in (data?.tool ?? {})) {
|
|
294
|
+
const existing = Object.keys(data.tool.runspec).filter((k) => k !== 'config' && typeof data.tool.runspec[k] === 'object');
|
|
295
|
+
console.log(`✗ ${path.basename(filePath)} already has [tool.runspec] — already initialized`);
|
|
296
|
+
if (existing.length)
|
|
297
|
+
console.log(` Existing runnables: ${existing.join(', ')}`);
|
|
298
|
+
process.exit(1);
|
|
299
|
+
}
|
|
300
|
+
const content = original.trimEnd() + '\n\n' + pyprojectBlock(name);
|
|
301
|
+
writeAndVerify(filePath, content, original);
|
|
302
|
+
console.log(` ✓ Updated ${path.basename(filePath)} with [${name}] runnable`);
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
const content = pyprojectBlock(name);
|
|
306
|
+
writeAndVerify(filePath, content, null);
|
|
307
|
+
console.log(` ✓ Created ${path.basename(filePath)} with [${name}] runnable`);
|
|
308
|
+
}
|
|
309
|
+
console.log(" Run 'runspec check' to validate.");
|
|
310
|
+
}
|
|
311
|
+
function initRunspecToml(filePath, name) {
|
|
312
|
+
if (fs.existsSync(filePath)) {
|
|
313
|
+
console.log(`✗ ${path.basename(filePath)} already exists — already initialized`);
|
|
314
|
+
console.log(` Edit ${path.basename(filePath)} directly to add more runnables.`);
|
|
315
|
+
process.exit(1);
|
|
316
|
+
}
|
|
317
|
+
writeAndVerify(filePath, runspecTomlBlock(name), null);
|
|
318
|
+
console.log(` ✓ Created ${path.basename(filePath)} with [${name}] runnable`);
|
|
319
|
+
console.log(" Run 'runspec check' to validate.");
|
|
320
|
+
}
|
|
321
|
+
function pyprojectBlock(name) {
|
|
322
|
+
return `[tool.runspec.${name}]\ndescription = "Describe what ${name} does"\nautonomy = "confirm"\n\n[tool.runspec.${name}.args]\n# example = {type = "str", description = "An example argument"}\n`;
|
|
323
|
+
}
|
|
324
|
+
function runspecTomlBlock(name) {
|
|
325
|
+
return `[${name}]\ndescription = "Describe what ${name} does"\nautonomy = "confirm"\n\n[${name}.args]\n# example = {type = "str", description = "An example argument"}\n`;
|
|
326
|
+
}
|
|
327
|
+
function writeAndVerify(filePath, content, original) {
|
|
328
|
+
fs.writeFileSync(filePath, content, 'utf-8');
|
|
329
|
+
try {
|
|
330
|
+
const { parse } = require('smol-toml');
|
|
331
|
+
parse(content);
|
|
332
|
+
}
|
|
333
|
+
catch (e) {
|
|
334
|
+
if (original !== null)
|
|
335
|
+
fs.writeFileSync(filePath, original, 'utf-8');
|
|
336
|
+
else
|
|
337
|
+
fs.unlinkSync(filePath);
|
|
338
|
+
console.log('✗ Generated invalid TOML — this is a bug, please report it');
|
|
339
|
+
console.log(` ${e.message}`);
|
|
340
|
+
process.exit(1);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
// ── Arg parser helper ─────────────────────────────────────────────────────────
|
|
344
|
+
function getFlag(args, flag) {
|
|
345
|
+
const idx = args.indexOf(flag);
|
|
346
|
+
if (idx !== -1 && idx + 1 < args.length)
|
|
347
|
+
return args[idx + 1];
|
|
348
|
+
return undefined;
|
|
349
|
+
}
|
|
350
|
+
// ── Help ──────────────────────────────────────────────────────────────────────
|
|
351
|
+
function printHelp() {
|
|
352
|
+
console.log(`runspec — interface specification for anything runnable
|
|
353
|
+
|
|
354
|
+
Usage:
|
|
355
|
+
runspec <command> [options]
|
|
356
|
+
|
|
357
|
+
Commands:
|
|
358
|
+
init Create or update pyproject.toml or runspec.toml with a scaffold
|
|
359
|
+
discover Find all runspec-aware runnables in this environment
|
|
360
|
+
check Validate this project's runspec setup
|
|
361
|
+
emit Emit tool schemas for agent frameworks
|
|
362
|
+
serve Start the MCP stdio server for this environment
|
|
363
|
+
|
|
364
|
+
Options for init:
|
|
365
|
+
--name Runnable name (default: current directory name)
|
|
366
|
+
--file Target file: pyproject or runspec (auto-detected if omitted)
|
|
367
|
+
|
|
368
|
+
Options for discover:
|
|
369
|
+
--format Output format: text (default), json, mcp, openai, anthropic
|
|
370
|
+
|
|
371
|
+
Options for emit:
|
|
372
|
+
--script Runnable name to emit (all runnables if omitted)
|
|
373
|
+
--format Output format: mcp (default), openai, anthropic
|
|
374
|
+
|
|
375
|
+
Examples:
|
|
376
|
+
runspec init
|
|
377
|
+
runspec init --name myapp
|
|
378
|
+
runspec discover
|
|
379
|
+
runspec discover --format mcp
|
|
380
|
+
runspec check
|
|
381
|
+
runspec emit --script deploy --format mcp
|
|
382
|
+
runspec emit --format openai`);
|
|
383
|
+
}
|
|
384
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,oBA0BC;AAqJD,kCAqBC;AA7MD,uCAAyB;AACzB,2CAA6B;AAC7B,qCAAsC;AACtC,qCAAmC;AACnC,2CAA0C;AAG1C,iFAAiF;AAEjF,SAAgB,IAAI;IAClB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC7D,SAAS,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK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AC,CAAC;QAC3E,OAAO,CAAC,GAAG,CAAC,MAAO,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,iFAAiF;AAEjF,SAAS,OAAO,CAAC,IAAc,EAAE,IAAY;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,iFAAiF;AAEjF,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA8BiB,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare class RunSpecError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class MissingRequiredArg extends RunSpecError {
|
|
5
|
+
}
|
|
6
|
+
export declare class InvalidChoice extends RunSpecError {
|
|
7
|
+
}
|
|
8
|
+
export declare class OutOfRange extends RunSpecError {
|
|
9
|
+
}
|
|
10
|
+
export declare class UnknownArg extends RunSpecError {
|
|
11
|
+
}
|
|
12
|
+
export declare class GroupViolation extends RunSpecError {
|
|
13
|
+
}
|
|
14
|
+
export declare class AutonomyViolation extends RunSpecError {
|
|
15
|
+
}
|
|
16
|
+
export declare function formatMissingRequired(name: string, spec: Record<string, unknown>): string;
|
|
17
|
+
export declare function formatInvalidChoice(value: string, options: string[], name: string): string;
|
|
18
|
+
export declare function formatOutOfRange(value: number, range: [number, number], name: string): string;
|
|
19
|
+
export declare function formatUnknownArg(name: string, knownArgs: string[]): string;
|
|
20
|
+
export declare function formatGroupExclusive(groupName: string, provided: string[]): string;
|
|
21
|
+
export declare function formatGroupInclusive(groupName: string, missing: string[]): string;
|
|
22
|
+
export declare function formatGroupAtLeastOne(groupName: string, args: string[]): string;
|
|
23
|
+
export declare function formatGroupExactlyOne(groupName: string, args: string[], provided: string[]): string;
|
|
24
|
+
export declare function formatDeprecated(name: string, message: string): string;
|
|
25
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,kBAAmB,SAAQ,YAAY;CAAG;AACvD,qBAAa,aAAc,SAAQ,YAAY;CAAG;AAClD,qBAAa,UAAW,SAAQ,YAAY;CAAG;AAC/C,qBAAa,UAAW,SAAQ,YAAY;CAAG;AAC/C,qBAAa,cAAe,SAAQ,YAAY;CAAG;AACnD,qBAAa,iBAAkB,SAAQ,YAAY;CAAG;AAEtD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAQzF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAS1F;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAM7F;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAQ1E;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAMlF;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAMjF;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAK/E;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAYnG;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtE"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutonomyViolation = exports.GroupViolation = exports.UnknownArg = exports.OutOfRange = exports.InvalidChoice = exports.MissingRequiredArg = exports.RunSpecError = void 0;
|
|
4
|
+
exports.formatMissingRequired = formatMissingRequired;
|
|
5
|
+
exports.formatInvalidChoice = formatInvalidChoice;
|
|
6
|
+
exports.formatOutOfRange = formatOutOfRange;
|
|
7
|
+
exports.formatUnknownArg = formatUnknownArg;
|
|
8
|
+
exports.formatGroupExclusive = formatGroupExclusive;
|
|
9
|
+
exports.formatGroupInclusive = formatGroupInclusive;
|
|
10
|
+
exports.formatGroupAtLeastOne = formatGroupAtLeastOne;
|
|
11
|
+
exports.formatGroupExactlyOne = formatGroupExactlyOne;
|
|
12
|
+
exports.formatDeprecated = formatDeprecated;
|
|
13
|
+
class RunSpecError extends Error {
|
|
14
|
+
constructor(message) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = 'RunSpecError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.RunSpecError = RunSpecError;
|
|
20
|
+
class MissingRequiredArg extends RunSpecError {
|
|
21
|
+
}
|
|
22
|
+
exports.MissingRequiredArg = MissingRequiredArg;
|
|
23
|
+
class InvalidChoice extends RunSpecError {
|
|
24
|
+
}
|
|
25
|
+
exports.InvalidChoice = InvalidChoice;
|
|
26
|
+
class OutOfRange extends RunSpecError {
|
|
27
|
+
}
|
|
28
|
+
exports.OutOfRange = OutOfRange;
|
|
29
|
+
class UnknownArg extends RunSpecError {
|
|
30
|
+
}
|
|
31
|
+
exports.UnknownArg = UnknownArg;
|
|
32
|
+
class GroupViolation extends RunSpecError {
|
|
33
|
+
}
|
|
34
|
+
exports.GroupViolation = GroupViolation;
|
|
35
|
+
class AutonomyViolation extends RunSpecError {
|
|
36
|
+
}
|
|
37
|
+
exports.AutonomyViolation = AutonomyViolation;
|
|
38
|
+
function formatMissingRequired(name, spec) {
|
|
39
|
+
const lines = [
|
|
40
|
+
`✗ Missing required argument: --${name}`,
|
|
41
|
+
` Type: ${spec['type'] ?? 'str'}`,
|
|
42
|
+
];
|
|
43
|
+
if (spec['description'])
|
|
44
|
+
lines.push(` Description: ${spec['description']}`);
|
|
45
|
+
if (spec['env'])
|
|
46
|
+
lines.push(` Tip: set environment variable ${spec['env']} as an alternative`);
|
|
47
|
+
return lines.join('\n');
|
|
48
|
+
}
|
|
49
|
+
function formatInvalidChoice(value, options, name) {
|
|
50
|
+
const lines = [
|
|
51
|
+
`✗ Invalid value for --${name}: ${JSON.stringify(value)}`,
|
|
52
|
+
` Expected one of: ${options.join(', ')}`,
|
|
53
|
+
` Got: ${JSON.stringify(value)}`,
|
|
54
|
+
];
|
|
55
|
+
const s = suggest(value, options);
|
|
56
|
+
if (s)
|
|
57
|
+
lines.push(`\n Did you mean: ${s}?`);
|
|
58
|
+
return lines.join('\n');
|
|
59
|
+
}
|
|
60
|
+
function formatOutOfRange(value, range, name) {
|
|
61
|
+
return [
|
|
62
|
+
`✗ Value out of range for --${name}: ${value}`,
|
|
63
|
+
` Expected: between ${range[0]} and ${range[1]}`,
|
|
64
|
+
` Got: ${value}`,
|
|
65
|
+
].join('\n');
|
|
66
|
+
}
|
|
67
|
+
function formatUnknownArg(name, knownArgs) {
|
|
68
|
+
const lines = [
|
|
69
|
+
`✗ Unknown argument: --${name}`,
|
|
70
|
+
` Known arguments: ${[...knownArgs].sort().map((a) => `--${a}`).join(', ')}`,
|
|
71
|
+
];
|
|
72
|
+
const s = suggest(name, knownArgs);
|
|
73
|
+
if (s)
|
|
74
|
+
lines.push(`\n Did you mean: --${s}?`);
|
|
75
|
+
return lines.join('\n');
|
|
76
|
+
}
|
|
77
|
+
function formatGroupExclusive(groupName, provided) {
|
|
78
|
+
return [
|
|
79
|
+
`✗ Conflicting arguments in group '${groupName}'`,
|
|
80
|
+
` --${provided[0]} and --${provided[1]} cannot be used together`,
|
|
81
|
+
` Choose one or the other`,
|
|
82
|
+
].join('\n');
|
|
83
|
+
}
|
|
84
|
+
function formatGroupInclusive(groupName, missing) {
|
|
85
|
+
return [
|
|
86
|
+
`✗ Incomplete argument group '${groupName}'`,
|
|
87
|
+
` Providing one of these args requires all of them`,
|
|
88
|
+
` Also provide: ${missing.map((m) => `--${m}`).join(' and ')}`,
|
|
89
|
+
].join('\n');
|
|
90
|
+
}
|
|
91
|
+
function formatGroupAtLeastOne(groupName, args) {
|
|
92
|
+
return [
|
|
93
|
+
`✗ Group '${groupName}' requires at least one argument`,
|
|
94
|
+
` Provide at least one of: ${args.map((a) => `--${a}`).join(', ')}`,
|
|
95
|
+
].join('\n');
|
|
96
|
+
}
|
|
97
|
+
function formatGroupExactlyOne(groupName, args, provided) {
|
|
98
|
+
if (!provided.length) {
|
|
99
|
+
return [
|
|
100
|
+
`✗ Group '${groupName}' requires exactly one argument`,
|
|
101
|
+
` Provide exactly one of: ${args.map((a) => `--${a}`).join(', ')}`,
|
|
102
|
+
].join('\n');
|
|
103
|
+
}
|
|
104
|
+
return [
|
|
105
|
+
`✗ Group '${groupName}' requires exactly one argument`,
|
|
106
|
+
` Got ${provided.length}: ${provided.map((a) => `--${a}`).join(', ')}`,
|
|
107
|
+
` Provide exactly one of: ${args.map((a) => `--${a}`).join(', ')}`,
|
|
108
|
+
].join('\n');
|
|
109
|
+
}
|
|
110
|
+
function formatDeprecated(name, message) {
|
|
111
|
+
return `⚠ --${name} is deprecated: ${message}`;
|
|
112
|
+
}
|
|
113
|
+
function suggest(value, candidates) {
|
|
114
|
+
let best;
|
|
115
|
+
let bestScore = 0;
|
|
116
|
+
for (const c of candidates) {
|
|
117
|
+
const score = diceSimilarity(value, c);
|
|
118
|
+
if (score > bestScore && score >= 0.6) {
|
|
119
|
+
bestScore = score;
|
|
120
|
+
best = c;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return best;
|
|
124
|
+
}
|
|
125
|
+
function diceSimilarity(a, b) {
|
|
126
|
+
if (a === b)
|
|
127
|
+
return 1;
|
|
128
|
+
if (a.length < 2 || b.length < 2)
|
|
129
|
+
return 0;
|
|
130
|
+
const bigrams = new Map();
|
|
131
|
+
for (let i = 0; i < a.length - 1; i++) {
|
|
132
|
+
const bg = a.slice(i, i + 2);
|
|
133
|
+
bigrams.set(bg, (bigrams.get(bg) ?? 0) + 1);
|
|
134
|
+
}
|
|
135
|
+
let intersect = 0;
|
|
136
|
+
for (let i = 0; i < b.length - 1; i++) {
|
|
137
|
+
const bg = b.slice(i, i + 2);
|
|
138
|
+
const count = bigrams.get(bg) ?? 0;
|
|
139
|
+
if (count > 0) {
|
|
140
|
+
bigrams.set(bg, count - 1);
|
|
141
|
+
intersect++;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return (2 * intersect) / (a.length + b.length - 2);
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAcA,sDAQC;AAED,kDASC;AAED,4CAMC;AAED,4CAQC;AAED,oDAMC;AAED,oDAMC;AAED,sDAKC;AAED,sDAYC;AAED,4CAEC;AA5FD,MAAa,YAAa,S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