clicodemode 0.7.0 → 0.7.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 +1 -1
- package/dist/codemode.wasm +0 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -180,7 +180,7 @@ generators, `delete`, getters/setters, regex lookaround and backreferences,
|
|
|
180
180
|
The engine is the Go library [clicodemode](https://github.com/muthuishere/clicodemode)
|
|
181
181
|
compiled to WebAssembly; this package loads it and passes your handlers in.
|
|
182
182
|
Go is the primary implementation; the Node package is **experimental** and
|
|
183
|
-
follows the same version (0.7.
|
|
183
|
+
follows the same version (0.7.1). The `.wasm` is about 2.1 MB gzipped; a cold
|
|
184
184
|
start (load plus one run) takes about 55 ms on Apple Silicon with Node 24.
|
|
185
185
|
Node 20 or newer.
|
|
186
186
|
|
package/dist/codemode.wasm
CHANGED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { loadWasm } from "./wasm.js";
|
|
|
4
4
|
/** Default wall-clock bound for one run/eval call, in milliseconds. */
|
|
5
5
|
export const DEFAULT_TIMEOUT_MS = 30_000;
|
|
6
6
|
let callSeq = 0;
|
|
7
|
-
const NAME_RE = /^[
|
|
7
|
+
const NAME_RE = /^[A-Za-z][A-Za-z0-9_-]*(\.[A-Za-z][A-Za-z0-9_-]*)*$/;
|
|
8
8
|
function parse(s) {
|
|
9
9
|
const v = JSON.parse(s);
|
|
10
10
|
if (v && typeof v === "object" && !Array.isArray(v) && typeof v.error === "string" && Object.keys(v).length === 1) {
|
|
@@ -94,7 +94,7 @@ export function createCodeMode(options) {
|
|
|
94
94
|
return {
|
|
95
95
|
register(op) {
|
|
96
96
|
if (!NAME_RE.test(op.name))
|
|
97
|
-
throw new Error(`clicodemode: invalid operation name "${op.name}" (want dotted
|
|
97
|
+
throw new Error(`clicodemode: invalid operation name "${op.name}" (want dotted segments of letters, digits, _ and -, e.g. health.check)`);
|
|
98
98
|
if (typeof op.handler !== "function")
|
|
99
99
|
throw new Error(`clicodemode: operation "${op.name}" has no handler`);
|
|
100
100
|
if (specs.has(op.name))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clicodemode",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Code Mode for JS and TS CLIs: register your commands as operations, agents run a small JavaScript-like program that calls them. Engine is Go compiled to WASM.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|