@inquir/compute-cli 0.4.1 → 0.4.3
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 +51 -21
- package/dist/commands/admin.d.ts.map +1 -1
- package/dist/commands/admin.js +5 -3
- package/dist/commands/admin.js.map +1 -1
- package/dist/commands/apps.d.ts +13 -3
- package/dist/commands/apps.d.ts.map +1 -1
- package/dist/commands/apps.js +114 -21
- package/dist/commands/apps.js.map +1 -1
- package/dist/commands/deploy.d.ts +10 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +76 -14
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/functions.d.ts +7 -0
- package/dist/commands/functions.d.ts.map +1 -0
- package/dist/commands/functions.js +80 -0
- package/dist/commands/functions.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +6 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/api.d.ts +12 -6
- package/dist/utils/api.d.ts.map +1 -1
- package/dist/utils/api.js +19 -2
- package/dist/utils/api.js.map +1 -1
- package/dist/utils/deploy-follow.d.ts +1 -5
- package/dist/utils/deploy-follow.d.ts.map +1 -1
- package/dist/utils/deploy-follow.js +21 -1
- package/dist/utils/deploy-follow.js.map +1 -1
- package/dist/utils/detect.d.ts.map +1 -1
- package/dist/utils/detect.js +35 -9
- package/dist/utils/detect.js.map +1 -1
- package/dist/utils/go-handler.d.ts +59 -0
- package/dist/utils/go-handler.d.ts.map +1 -0
- package/dist/utils/go-handler.js +417 -0
- package/dist/utils/go-handler.js.map +1 -0
- package/dist/utils/package-metadata.d.ts +6 -0
- package/dist/utils/package-metadata.d.ts.map +1 -1
- package/dist/utils/package-metadata.js +9 -1
- package/dist/utils/package-metadata.js.map +1 -1
- package/dist/utils/system-config.d.ts +9 -0
- package/dist/utils/system-config.d.ts.map +1 -0
- package/dist/utils/system-config.js +48 -0
- package/dist/utils/system-config.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Go handler detection for zero-config deploys.
|
|
3
|
+
*
|
|
4
|
+
* The Go runtime builds the app as a plugin (`go build -buildmode=plugin`) and
|
|
5
|
+
* looks the handler up with plugin.Lookup(<name>), which only finds the exact,
|
|
6
|
+
* exported (capitalised) identifier. Deriving `main.handler` from a source that
|
|
7
|
+
* declares `func Handler(...)` therefore fails every invoke with
|
|
8
|
+
* `symbol "handler" not found`. This module reads the package-main sources and
|
|
9
|
+
* returns the real identifier — or refuses with a hint when there is none or
|
|
10
|
+
* more than one candidate.
|
|
11
|
+
*
|
|
12
|
+
* It is a scanner, not a Go parser: comments and string/rune literals are
|
|
13
|
+
* blanked first, then top-level `func Name(...)` declarations are matched.
|
|
14
|
+
* Methods (`func (r T) Name(`) and generic funcs (`func Name[T any](`) are not
|
|
15
|
+
* candidates — neither can be loaded as a plugin symbol of the handler type.
|
|
16
|
+
*/
|
|
17
|
+
import fs from 'node:fs';
|
|
18
|
+
import path from 'node:path';
|
|
19
|
+
export class GoHandlerError extends Error {
|
|
20
|
+
hints;
|
|
21
|
+
constructor(message, hints = []) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.hints = hints;
|
|
24
|
+
this.name = 'GoHandlerError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export const GO_HANDLER_SIGNATURE = 'func Handler(event map[string]any, ctx obs.Context) (any, error)';
|
|
28
|
+
/** Go spec: an identifier is exported when its first character is an upper-case letter. */
|
|
29
|
+
export function isExportedGoIdentifier(name) {
|
|
30
|
+
return /^\p{Lu}/u.test(name);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A symbol a handler spec can name: exported, and in the platform's ASCII
|
|
34
|
+
* handler alphabet (isSafeHandlerSpec on the server).
|
|
35
|
+
*/
|
|
36
|
+
export function isLoadableGoSymbol(name) {
|
|
37
|
+
return /^[A-Z][A-Za-z0-9_]*$/.test(name);
|
|
38
|
+
}
|
|
39
|
+
/** `handler` → `Handler` (the name the user most likely meant). */
|
|
40
|
+
export function exportedGoName(name) {
|
|
41
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Replace comments and string/rune literals with spaces (newlines kept), so
|
|
45
|
+
* text inside them can never look like a declaration.
|
|
46
|
+
*/
|
|
47
|
+
export function blankGoCommentsAndStrings(src) {
|
|
48
|
+
const blank = (text) => text.replace(/[^\n]/g, ' ');
|
|
49
|
+
let out = '';
|
|
50
|
+
let i = 0;
|
|
51
|
+
const n = src.length;
|
|
52
|
+
while (i < n) {
|
|
53
|
+
const c = src[i];
|
|
54
|
+
const next = src[i + 1];
|
|
55
|
+
let end = -1;
|
|
56
|
+
if (c === '/' && next === '/') {
|
|
57
|
+
end = src.indexOf('\n', i);
|
|
58
|
+
if (end === -1)
|
|
59
|
+
end = n;
|
|
60
|
+
}
|
|
61
|
+
else if (c === '/' && next === '*') {
|
|
62
|
+
end = src.indexOf('*/', i + 2);
|
|
63
|
+
end = end === -1 ? n : end + 2;
|
|
64
|
+
}
|
|
65
|
+
else if (c === '`') {
|
|
66
|
+
end = src.indexOf('`', i + 1);
|
|
67
|
+
end = end === -1 ? n : end + 1;
|
|
68
|
+
}
|
|
69
|
+
else if (c === '"' || c === "'") {
|
|
70
|
+
let j = i + 1;
|
|
71
|
+
while (j < n && src[j] !== c && src[j] !== '\n')
|
|
72
|
+
j += src[j] === '\\' ? 2 : 1;
|
|
73
|
+
end = Math.min(j + 1, n);
|
|
74
|
+
}
|
|
75
|
+
if (end === -1) {
|
|
76
|
+
out += c;
|
|
77
|
+
i += 1;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
out += blank(src.slice(i, end));
|
|
81
|
+
i = end;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The plugin is built for linux with Go 1.22 (runtime/go122/Dockerfile) on
|
|
88
|
+
* amd64 (prod) or arm64. A file counts as excluded only when it is excluded
|
|
89
|
+
* for every one of those targets. Tags that are true for a target besides
|
|
90
|
+
* its GOARCH; anything else is false.
|
|
91
|
+
*/
|
|
92
|
+
const TARGET_ARCHES = ['amd64', 'arm64'];
|
|
93
|
+
const TARGET_TAGS = new Set(['linux', 'unix', 'gc', 'cgo']);
|
|
94
|
+
const TARGET_GO_MINOR = 22;
|
|
95
|
+
const KNOWN_OS = new Set([
|
|
96
|
+
'aix', 'android', 'darwin', 'dragonfly', 'freebsd', 'hurd', 'illumos', 'ios', 'js', 'linux', 'nacl',
|
|
97
|
+
'netbsd', 'openbsd', 'plan9', 'solaris', 'wasip1', 'windows', 'zos',
|
|
98
|
+
]);
|
|
99
|
+
const KNOWN_ARCH = new Set([
|
|
100
|
+
'386', 'amd64', 'amd64p32', 'arm', 'arm64', 'arm64be', 'armbe', 'loong64', 'mips', 'mips64', 'mips64le',
|
|
101
|
+
'mips64p32', 'mips64p32le', 'mipsle', 'ppc', 'ppc64', 'ppc64le', 'riscv', 'riscv64', 's390', 's390x',
|
|
102
|
+
'sparc', 'sparc64', 'wasm',
|
|
103
|
+
]);
|
|
104
|
+
function tagSatisfied(tag, arch) {
|
|
105
|
+
if (tag === arch || TARGET_TAGS.has(tag))
|
|
106
|
+
return true;
|
|
107
|
+
const release = /^go1\.(\d+)$/.exec(tag);
|
|
108
|
+
return release !== null && Number(release[1]) <= TARGET_GO_MINOR;
|
|
109
|
+
}
|
|
110
|
+
/** Evaluate a `//go:build` expression for the target; null when it does not parse. */
|
|
111
|
+
function evalBuildExpression(expr, arch) {
|
|
112
|
+
const tokens = expr.match(/&&|\|\||[!()]|[\w.]+|\S/g) ?? [];
|
|
113
|
+
let pos = 0;
|
|
114
|
+
const fail = () => { throw new Error('bad build expression'); };
|
|
115
|
+
const parseOr = () => {
|
|
116
|
+
let value = parseAnd();
|
|
117
|
+
while (tokens[pos] === '||') {
|
|
118
|
+
pos += 1;
|
|
119
|
+
value = parseAnd() || value;
|
|
120
|
+
}
|
|
121
|
+
return value;
|
|
122
|
+
};
|
|
123
|
+
const parseAnd = () => {
|
|
124
|
+
let value = parseNot();
|
|
125
|
+
while (tokens[pos] === '&&') {
|
|
126
|
+
pos += 1;
|
|
127
|
+
value = parseNot() && value;
|
|
128
|
+
}
|
|
129
|
+
return value;
|
|
130
|
+
};
|
|
131
|
+
const parseNot = () => {
|
|
132
|
+
const token = tokens[pos++];
|
|
133
|
+
if (token === '!')
|
|
134
|
+
return !parseNot();
|
|
135
|
+
if (token === '(') {
|
|
136
|
+
const value = parseOr();
|
|
137
|
+
if (tokens[pos++] !== ')')
|
|
138
|
+
fail();
|
|
139
|
+
return value;
|
|
140
|
+
}
|
|
141
|
+
if (!token || !/^[\w.]+$/.test(token))
|
|
142
|
+
fail();
|
|
143
|
+
return tagSatisfied(token, arch);
|
|
144
|
+
};
|
|
145
|
+
try {
|
|
146
|
+
const value = parseOr();
|
|
147
|
+
return pos === tokens.length ? value : null;
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/** Legacy `// +build a,b !c` lines: space = OR, comma = AND, lines AND-ed. */
|
|
154
|
+
function evalLegacyBuildLine(line, arch) {
|
|
155
|
+
return line.trim().split(/\s+/).some((option) => option.split(',').every((term) => (term.startsWith('!') ? !tagSatisfied(term.slice(1), arch) : tagSatisfied(term, arch))));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Whether `go build` for the target leaves the file out because of its build
|
|
159
|
+
* constraint (`//go:build`, else legacy `// +build`, in the header before the
|
|
160
|
+
* package clause). A constraint that does not parse keeps the file.
|
|
161
|
+
*/
|
|
162
|
+
function excludedByBuildConstraint(raw) {
|
|
163
|
+
let goBuild = null;
|
|
164
|
+
const legacy = [];
|
|
165
|
+
let inBlockComment = false;
|
|
166
|
+
for (const line of raw.split(/\r?\n/)) {
|
|
167
|
+
let trimmed = line.trim();
|
|
168
|
+
if (inBlockComment) {
|
|
169
|
+
const close = trimmed.indexOf('*/');
|
|
170
|
+
if (close === -1)
|
|
171
|
+
continue;
|
|
172
|
+
inBlockComment = false;
|
|
173
|
+
trimmed = trimmed.slice(close + 2).trim();
|
|
174
|
+
}
|
|
175
|
+
// A /* ... */ header (a copyright block) does not end the header.
|
|
176
|
+
while (trimmed.startsWith('/*')) {
|
|
177
|
+
const close = trimmed.indexOf('*/', 2);
|
|
178
|
+
if (close === -1) {
|
|
179
|
+
inBlockComment = true;
|
|
180
|
+
trimmed = '';
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
trimmed = trimmed.slice(close + 2).trim();
|
|
184
|
+
}
|
|
185
|
+
if (trimmed === '')
|
|
186
|
+
continue;
|
|
187
|
+
if (!trimmed.startsWith('//'))
|
|
188
|
+
break; // package clause or code: the header is over
|
|
189
|
+
const modern = /^\/\/go:build\s+(.*)$/.exec(trimmed);
|
|
190
|
+
if (modern)
|
|
191
|
+
goBuild ??= modern[1];
|
|
192
|
+
const old = /^\/\/\s*\+build\s+(.*)$/.exec(trimmed);
|
|
193
|
+
if (old)
|
|
194
|
+
legacy.push(old[1]);
|
|
195
|
+
}
|
|
196
|
+
if (goBuild !== null) {
|
|
197
|
+
const expr = goBuild;
|
|
198
|
+
return TARGET_ARCHES.every((arch) => evalBuildExpression(expr, arch) === false);
|
|
199
|
+
}
|
|
200
|
+
return legacy.length > 0 && TARGET_ARCHES.every((arch) => !legacy.every((line) => evalLegacyBuildLine(line, arch)));
|
|
201
|
+
}
|
|
202
|
+
/** `_windows.go`, `_darwin_arm64.go`, `_386.go`: implicit GOOS/GOARCH constraints. */
|
|
203
|
+
function excludedByFileName(file) {
|
|
204
|
+
const base = file.replace(/\.go$/, '');
|
|
205
|
+
const underscore = base.indexOf('_');
|
|
206
|
+
if (underscore < 0)
|
|
207
|
+
return false;
|
|
208
|
+
const parts = base.slice(underscore).split('_');
|
|
209
|
+
const n = parts.length;
|
|
210
|
+
const osOk = (os) => os === 'linux';
|
|
211
|
+
const archOk = (arch) => TARGET_ARCHES.includes(arch);
|
|
212
|
+
if (n >= 2 && KNOWN_OS.has(parts[n - 2]) && KNOWN_ARCH.has(parts[n - 1])) {
|
|
213
|
+
return !(osOk(parts[n - 2]) && archOk(parts[n - 1]));
|
|
214
|
+
}
|
|
215
|
+
if (KNOWN_OS.has(parts[n - 1]))
|
|
216
|
+
return !osOk(parts[n - 1]);
|
|
217
|
+
if (KNOWN_ARCH.has(parts[n - 1]))
|
|
218
|
+
return !archOk(parts[n - 1]);
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
/** Index just past the bracket that closes the one at `open`, or -1. */
|
|
222
|
+
function matchBracket(text, open) {
|
|
223
|
+
const pairs = { '(': ')', '[': ']', '{': '}' };
|
|
224
|
+
const stack = [];
|
|
225
|
+
for (let i = open; i < text.length; i += 1) {
|
|
226
|
+
const c = text[i];
|
|
227
|
+
if (pairs[c])
|
|
228
|
+
stack.push(pairs[c]);
|
|
229
|
+
else if (c === ')' || c === ']' || c === '}') {
|
|
230
|
+
if (stack.pop() !== c)
|
|
231
|
+
return -1;
|
|
232
|
+
if (stack.length === 0)
|
|
233
|
+
return i + 1;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return -1;
|
|
237
|
+
}
|
|
238
|
+
/** Split on commas outside any bracket; empty parts (trailing comma) dropped. */
|
|
239
|
+
function splitTopLevel(list) {
|
|
240
|
+
const parts = [];
|
|
241
|
+
let depth = 0;
|
|
242
|
+
let current = '';
|
|
243
|
+
for (const c of list) {
|
|
244
|
+
if (c === '(' || c === '[' || c === '{')
|
|
245
|
+
depth += 1;
|
|
246
|
+
else if (c === ')' || c === ']' || c === '}')
|
|
247
|
+
depth -= 1;
|
|
248
|
+
if (c === ',' && depth === 0) {
|
|
249
|
+
parts.push(current);
|
|
250
|
+
current = '';
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
current += c;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
parts.push(current);
|
|
257
|
+
return parts.map((p) => p.trim()).filter((p) => p.length > 0);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Two parameters (`event, ctx map[string]any` counts as two) and a `(X, error)`
|
|
261
|
+
* result list — the shapes runtime/go122 accepts.
|
|
262
|
+
*/
|
|
263
|
+
function isHandlerShaped(text, paramsOpen) {
|
|
264
|
+
const paramsEnd = matchBracket(text, paramsOpen);
|
|
265
|
+
if (paramsEnd === -1)
|
|
266
|
+
return false;
|
|
267
|
+
const params = splitTopLevel(text.slice(paramsOpen + 1, paramsEnd - 1));
|
|
268
|
+
if (params.length !== 2)
|
|
269
|
+
return false;
|
|
270
|
+
const rest = text.slice(paramsEnd);
|
|
271
|
+
const resultsOpen = /^\s*\(/.exec(rest);
|
|
272
|
+
if (!resultsOpen)
|
|
273
|
+
return false;
|
|
274
|
+
const start = paramsEnd + resultsOpen[0].length - 1;
|
|
275
|
+
const resultsEnd = matchBracket(text, start);
|
|
276
|
+
if (resultsEnd === -1)
|
|
277
|
+
return false;
|
|
278
|
+
const results = splitTopLevel(text.slice(start + 1, resultsEnd - 1));
|
|
279
|
+
return results.length === 2 && /(?:^|\s)error$/.test(results[1]);
|
|
280
|
+
}
|
|
281
|
+
const FUNC_DECL = /^[ \t]*func[ \t]+([\p{L}_][\p{L}\p{Nd}_]*)[ \t]*([[(])/gmu;
|
|
282
|
+
function scanFile(file, source) {
|
|
283
|
+
// gc ignores a leading byte-order mark (Windows editors write one).
|
|
284
|
+
const raw = source.replace(/^\uFEFF/, '');
|
|
285
|
+
if (excludedByFileName(file) || excludedByBuildConstraint(raw))
|
|
286
|
+
return null;
|
|
287
|
+
const text = blankGoCommentsAndStrings(raw);
|
|
288
|
+
const pkg = /^[ \t]*package[ \t]+([\p{L}_][\p{L}\p{Nd}_]*)/mu.exec(text);
|
|
289
|
+
if (!pkg || pkg[1] !== 'main')
|
|
290
|
+
return null;
|
|
291
|
+
const funcs = [];
|
|
292
|
+
for (const match of text.matchAll(FUNC_DECL)) {
|
|
293
|
+
const name = match[1];
|
|
294
|
+
const generic = match[2] === '[';
|
|
295
|
+
const bracket = (match.index ?? 0) + match[0].length - 1;
|
|
296
|
+
funcs.push({
|
|
297
|
+
name,
|
|
298
|
+
file,
|
|
299
|
+
exported: isExportedGoIdentifier(name),
|
|
300
|
+
generic,
|
|
301
|
+
handlerShaped: !generic && isHandlerShaped(text, bracket),
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
return funcs;
|
|
305
|
+
}
|
|
306
|
+
/** Top-level .go files that are part of the plugin build (no _test.go). */
|
|
307
|
+
function listGoSources(dir) {
|
|
308
|
+
let entries;
|
|
309
|
+
try {
|
|
310
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
311
|
+
}
|
|
312
|
+
catch {
|
|
313
|
+
return [];
|
|
314
|
+
}
|
|
315
|
+
return entries
|
|
316
|
+
// go build ignores _test.go files and names starting with `_` or `.`.
|
|
317
|
+
.filter((e) => e.isFile() && e.name.endsWith('.go') && !e.name.endsWith('_test.go') && !/^[_.]/.test(e.name))
|
|
318
|
+
.map((e) => e.name)
|
|
319
|
+
.sort();
|
|
320
|
+
}
|
|
321
|
+
function overrideHint(name) {
|
|
322
|
+
return `Or pass the exact exported name: --handler main.${name}`;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Find the Go handler in `dir`: `Handler` when declared, otherwise the single
|
|
326
|
+
* exported handler-shaped func. Throws GoHandlerError when there is none or
|
|
327
|
+
* the choice is ambiguous.
|
|
328
|
+
*/
|
|
329
|
+
export function detectGoHandler(dir) {
|
|
330
|
+
const funcs = [];
|
|
331
|
+
let mainFiles = 0;
|
|
332
|
+
for (const file of listGoSources(dir)) {
|
|
333
|
+
let raw;
|
|
334
|
+
try {
|
|
335
|
+
raw = fs.readFileSync(path.join(dir, file), 'utf8');
|
|
336
|
+
}
|
|
337
|
+
catch {
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
const found = scanFile(file, raw);
|
|
341
|
+
if (found === null)
|
|
342
|
+
continue;
|
|
343
|
+
mainFiles += 1;
|
|
344
|
+
funcs.push(...found);
|
|
345
|
+
}
|
|
346
|
+
if (mainFiles === 0) {
|
|
347
|
+
throw new GoHandlerError(`No Go source of package main found in ${dir}`, [
|
|
348
|
+
'The Go runtime builds the top-level package main as a plugin.',
|
|
349
|
+
`Export a handler there: ${GO_HANDLER_SIGNATURE}.`,
|
|
350
|
+
]);
|
|
351
|
+
}
|
|
352
|
+
const handler = funcs.find((f) => f.name === 'Handler' && !f.generic);
|
|
353
|
+
if (handler) {
|
|
354
|
+
// Picked even when not handler-shaped (the runtime then names the
|
|
355
|
+
// signature it expects), but the plan says so.
|
|
356
|
+
const reason = handler.handlerShaped
|
|
357
|
+
? 'func Handler found'
|
|
358
|
+
: 'func Handler found, but its signature does not look like (event, ctx) (any, error) — verify';
|
|
359
|
+
return { name: 'Handler', spec: 'main.Handler', file: handler.file, reason };
|
|
360
|
+
}
|
|
361
|
+
// Distinct names: a func declared in two build-tagged files counts once.
|
|
362
|
+
const byName = new Map();
|
|
363
|
+
for (const f of funcs) {
|
|
364
|
+
// Non-ASCII exported names cannot be written as a handler spec (the
|
|
365
|
+
// platform's handler alphabet is ASCII), so they are not candidates.
|
|
366
|
+
if (isLoadableGoSymbol(f.name) && f.handlerShaped && !byName.has(f.name))
|
|
367
|
+
byName.set(f.name, f);
|
|
368
|
+
}
|
|
369
|
+
const candidates = [...byName.values()];
|
|
370
|
+
if (candidates.length === 1) {
|
|
371
|
+
const [only] = candidates;
|
|
372
|
+
return {
|
|
373
|
+
name: only.name,
|
|
374
|
+
spec: `main.${only.name}`,
|
|
375
|
+
file: only.file,
|
|
376
|
+
reason: `func ${only.name} is the only exported handler-shaped func`,
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
if (candidates.length > 1) {
|
|
380
|
+
const names = candidates.map((f) => f.name);
|
|
381
|
+
throw new GoHandlerError(`Several exported Go funcs could be the handler: ${names.join(', ')} — and none is named Handler`, [
|
|
382
|
+
'Name the entry point Handler, or choose one explicitly:',
|
|
383
|
+
...names.map((name) => ` --handler main.${name}`),
|
|
384
|
+
]);
|
|
385
|
+
}
|
|
386
|
+
const unexported = funcs.find((f) => !f.exported && f.handlerShaped);
|
|
387
|
+
if (unexported) {
|
|
388
|
+
const exported = exportedGoName(unexported.name);
|
|
389
|
+
throw new GoHandlerError(`Go func ${unexported.name} in ${unexported.file} is not exported, so the runtime cannot load it` +
|
|
390
|
+
` (Go plugins only expose capitalised names)`, [
|
|
391
|
+
`Rename it to ${exported === unexported.name ? 'Handler' : exported}: ${GO_HANDLER_SIGNATURE}.`,
|
|
392
|
+
overrideHint(exported === unexported.name ? 'Handler' : exported),
|
|
393
|
+
]);
|
|
394
|
+
}
|
|
395
|
+
throw new GoHandlerError('No exported Go handler found', [
|
|
396
|
+
`Go apps must export: ${GO_HANDLER_SIGNATURE}.`,
|
|
397
|
+
overrideHint('<ExportedName>'),
|
|
398
|
+
]);
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Validate a `--handler` override for Go. The runtime looks up everything
|
|
402
|
+
* after the FIRST dot (runtime/go122/main.go, lookupHandlerInPlugin), so that
|
|
403
|
+
* must be one exported ASCII identifier: `main.x.Handler` looks up
|
|
404
|
+
* `x.Handler` and never loads.
|
|
405
|
+
*/
|
|
406
|
+
export function assertGoHandlerOverride(spec) {
|
|
407
|
+
const dot = spec.indexOf('.');
|
|
408
|
+
const symbol = dot === -1 ? spec : spec.slice(dot + 1);
|
|
409
|
+
if (isLoadableGoSymbol(symbol))
|
|
410
|
+
return;
|
|
411
|
+
const suggestion = /^[a-z][A-Za-z0-9_]*$/.test(symbol) ? exportedGoName(symbol) : 'Handler';
|
|
412
|
+
throw new GoHandlerError(`Go handler "${spec}" names "${symbol}", which is not an exported Go identifier — the runtime can never load it`, [
|
|
413
|
+
'Go plugins only expose capitalised names: export the func (e.g. func Handler) and use its exact name.',
|
|
414
|
+
`--handler main.${suggestion}`,
|
|
415
|
+
]);
|
|
416
|
+
}
|
|
417
|
+
//# sourceMappingURL=go-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"go-handler.js","sourceRoot":"","sources":["../../src/utils/go-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAa7B,MAAM,OAAO,cAAe,SAAQ,KAAK;IACD;IAAtC,YAAY,OAAe,EAAW,QAAkB,EAAE;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QADqB,UAAK,GAAL,KAAK,CAAe;QAExD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAWD,MAAM,CAAC,MAAM,oBAAoB,GAAG,kEAAkE,CAAC;AAEvG,2FAA2F;AAC3F,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,GAAW;IACnD,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,C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IACvD,IAAI,kBAAkB,CAAC,MAAM,CAAC;QAAE,OAAO;IACvC,MAAM,UAAU,GAAG,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5F,MAAM,IAAI,cAAc,CACtB,eAAe,IAAI,YAAY,MAAM,2EAA2E,EAChH;QACE,uGAAuG;QACvG,kBAAkB,UAAU,EAAE;KAC/B,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export declare function getCliVersion(): string;
|
|
2
2
|
export declare function getSdkDependencyRange(): string;
|
|
3
|
+
/**
|
|
4
|
+
* The tsx a new project gets as a devDependency: local Run/Debug (CLI and
|
|
5
|
+
* VS Code) import TypeScript through it, and @inquir/compute only declares it
|
|
6
|
+
* as an optional peer so production installs (npm --omit=dev) never ship it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getTsxDependencyRange(): string;
|
|
3
9
|
//# sourceMappingURL=package-metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-metadata.d.ts","sourceRoot":"","sources":["../../src/utils/package-metadata.ts"],"names":[],"mappings":"AAyBA,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C"}
|
|
1
|
+
{"version":3,"file":"package-metadata.d.ts","sourceRoot":"","sources":["../../src/utils/package-metadata.ts"],"names":[],"mappings":"AAyBA,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C"}
|
|
@@ -17,6 +17,14 @@ export function getCliVersion() {
|
|
|
17
17
|
return readCliPackageJson().version ?? '0.1.0';
|
|
18
18
|
}
|
|
19
19
|
export function getSdkDependencyRange() {
|
|
20
|
-
return readCliPackageJson().dependencies?.['@inquir/compute'] ?? '^0.4.
|
|
20
|
+
return readCliPackageJson().dependencies?.['@inquir/compute'] ?? '^0.4.4';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The tsx a new project gets as a devDependency: local Run/Debug (CLI and
|
|
24
|
+
* VS Code) import TypeScript through it, and @inquir/compute only declares it
|
|
25
|
+
* as an optional peer so production installs (npm --omit=dev) never ship it.
|
|
26
|
+
*/
|
|
27
|
+
export function getTsxDependencyRange() {
|
|
28
|
+
return readCliPackageJson().dependencies?.tsx ?? '^4.19.2';
|
|
21
29
|
}
|
|
22
30
|
//# sourceMappingURL=package-metadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-metadata.js","sourceRoot":"","sources":["../../src/utils/package-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAO5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,IAAI,iBAA6C,CAAC;AAElD,SAAS,kBAAkB;IACzB,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC;QACH,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAmB,CAAC;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,iBAAiB,GAAG,EAAE,CAAC;IACzB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,kBAAkB,EAAE,CAAC,OAAO,IAAI,OAAO,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,kBAAkB,EAAE,CAAC,YAAY,EAAE,CAAC,iBAAiB,CAAC,IAAI,QAAQ,CAAC;AAC5E,CAAC"}
|
|
1
|
+
{"version":3,"file":"package-metadata.js","sourceRoot":"","sources":["../../src/utils/package-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAO5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,IAAI,iBAA6C,CAAC;AAElD,SAAS,kBAAkB;IACzB,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC;QACH,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAmB,CAAC;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,iBAAiB,GAAG,EAAE,CAAC;IACzB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,kBAAkB,EAAE,CAAC,OAAO,IAAI,OAAO,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,kBAAkB,EAAE,CAAC,YAAY,EAAE,CAAC,iBAAiB,CAAC,IAAI,QAAQ,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,kBAAkB,EAAE,CAAC,YAAY,EAAE,GAAG,IAAI,SAAS,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FunctionSystemImageStatus } from '../sdk.js';
|
|
2
|
+
/**
|
|
3
|
+
* The project-root inquir.yaml text to send with a deploy of `functionDir`,
|
|
4
|
+
* or undefined when there is none or the archive already carries it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function projectManifestFor(rootDir: string, functionDir: string): string | undefined;
|
|
7
|
+
/** One line for a function's declared system packages. */
|
|
8
|
+
export declare function describeSystem(system: FunctionSystemImageStatus['system'] | null | undefined): string;
|
|
9
|
+
//# sourceMappingURL=system-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-config.d.ts","sourceRoot":"","sources":["../../src/utils/system-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAwB3D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAW3F;AAED,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,MAAM,EAAE,yBAAyB,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAKrG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { printWarning } from './output.js';
|
|
4
|
+
/**
|
|
5
|
+
* System packages are declared in inquir.yaml (`build.system`, and
|
|
6
|
+
* `functions.<name>.build.system` per function) and resolved by the platform
|
|
7
|
+
* at deploy time (docs/roadmap/FUNCTION_SYSTEM_PACKAGES.md §4). The CLI only
|
|
8
|
+
* ships the files: a function's own inquir.yaml travels in its archive, and
|
|
9
|
+
* the project-root one goes alongside when the function directory is not the
|
|
10
|
+
* project root (its archive does not contain it).
|
|
11
|
+
*/
|
|
12
|
+
const MANIFEST_FILENAMES = ['inquir.yaml', 'inquir.yml'];
|
|
13
|
+
/** As the platform caps a manifest. */
|
|
14
|
+
const MAX_MANIFEST_BYTES = 64 * 1024;
|
|
15
|
+
function manifestIn(dir) {
|
|
16
|
+
for (const name of MANIFEST_FILENAMES) {
|
|
17
|
+
const file = path.join(dir, name);
|
|
18
|
+
if (fs.existsSync(file) && fs.statSync(file).isFile())
|
|
19
|
+
return file;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The project-root inquir.yaml text to send with a deploy of `functionDir`,
|
|
25
|
+
* or undefined when there is none or the archive already carries it.
|
|
26
|
+
*/
|
|
27
|
+
export function projectManifestFor(rootDir, functionDir) {
|
|
28
|
+
if (path.resolve(rootDir) === path.resolve(functionDir))
|
|
29
|
+
return undefined;
|
|
30
|
+
const file = manifestIn(rootDir);
|
|
31
|
+
if (!file)
|
|
32
|
+
return undefined;
|
|
33
|
+
const text = fs.readFileSync(file, 'utf8');
|
|
34
|
+
if (Buffer.byteLength(text, 'utf8') > MAX_MANIFEST_BYTES) {
|
|
35
|
+
// Not fatal here: a platform without system packages never reads it.
|
|
36
|
+
printWarning(`${file} is larger than ${MAX_MANIFEST_BYTES} bytes; it is not sent with the deploy`);
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
return text;
|
|
40
|
+
}
|
|
41
|
+
/** One line for a function's declared system packages. */
|
|
42
|
+
export function describeSystem(system) {
|
|
43
|
+
if (!system)
|
|
44
|
+
return 'none';
|
|
45
|
+
const presets = (system.presets ?? []).map((ref) => typeof ref === 'string' ? ref : `${ref.name}${ref.langs?.length ? ` (${ref.langs.join(', ')})` : ''}`);
|
|
46
|
+
return `presets [${presets.join(', ')}] + packages [${(system.packages ?? []).join(', ')}] (bookworm)`;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=system-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-config.js","sourceRoot":"","sources":["../../src/utils/system-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;GAOG;AAEH,MAAM,kBAAkB,GAAG,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;AACzD,uCAAuC;AACvC,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,CAAC;AAErC,SAAS,UAAU,CAAC,GAAW;IAC7B,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAClC,IAAI,EAAE,CAAC,UAAU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,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;AACzG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquir/compute-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Workspace-first CLI for Inquir Compute.",
|
|
6
6
|
"bin": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"node": ">=22"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@inquir/compute": "^0.4.
|
|
27
|
+
"@inquir/compute": "^0.4.4",
|
|
28
28
|
"tsx": "^4.19.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|