@visa/cli 5.0.0-rc.415 → 5.0.0-rc.417
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 +287 -62
- package/bin/active-package.cjs +15 -0
- package/bin/update.cjs +122 -0
- package/bin/visa-cli.js +12 -1
- package/bin/visa-tool.js +15 -1
- package/dist/cli.js +140 -98
- package/dist/managed-runtime/resolve-and-update.mjs +12 -2
- package/dist/mcp-server/index.js +395 -346
- package/dist/mcp-server/tool-answers.js +21059 -0
- package/dist/tool-call.js +81 -41
- package/install.sh +3 -7
- package/package.json +4 -2
- package/server.json +4 -4
- package/dist/enrollment-finisher.js +0 -70
package/bin/visa-tool.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
// Compiled code is cached on disk (Node's own cache), so a repeat start skips
|
|
3
|
+
// recompiling the bundles (L7-4). Older Nodes without it start as before.
|
|
4
|
+
try {
|
|
5
|
+
require('node:module').enableCompileCache?.()
|
|
6
|
+
} catch {}
|
|
7
|
+
const path = require('node:path')
|
|
8
|
+
const active = require('./active-package.cjs')(path.dirname(__dirname))
|
|
9
|
+
// After the answer, background work (its failure report) gets a short grace, then the call ends.
|
|
10
|
+
const EXIT_GRACE_MS = 3_000
|
|
11
|
+
require(path.join(active, 'dist', 'tool-call.js'))
|
|
3
12
|
.main(process.argv.slice(2))
|
|
4
13
|
.then((code) => {
|
|
5
14
|
process.exitCode = code
|
|
15
|
+
// The grace starts once the answer has left: a slow pipe never gets a
|
|
16
|
+
// truncated answer (Sentinel #12136).
|
|
17
|
+
const end = () => setTimeout(() => process.exit(code), EXIT_GRACE_MS).unref()
|
|
18
|
+
if (process.stdout.writableNeedDrain) process.stdout.once('drain', end)
|
|
19
|
+
else end()
|
|
6
20
|
})
|