@usecontextlayer/ctxs 0.2.12 → 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/dist/cli.mjs +18621 -0
- package/dist/prompt-CHIvwqcZ.mjs +849 -0
- package/package.json +30 -28
- package/launcher/launcher.cjs +0 -75
package/package.json
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
"bin": {
|
|
3
|
+
"ctxs": "./dist/cli.mjs"
|
|
4
|
+
},
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.146",
|
|
7
|
+
"@hono/node-server": "^1.19.14",
|
|
8
|
+
"@hono/node-ws": "^1.3.1",
|
|
9
|
+
"@parcel/watcher": "^2.5.6",
|
|
10
|
+
"hono": "^4.12.23",
|
|
11
|
+
"microsandbox": "^0.4.6",
|
|
12
|
+
"ws": "^8.20.1"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"commander": "^14.0.3",
|
|
16
|
+
"consola": "^3.4.2",
|
|
17
|
+
"@usecontextlayer/shared": "0.3.0",
|
|
18
|
+
"@usecontextlayer/slate-bridge": "0.3.0"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"name": "@usecontextlayer/ctxs",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"version": "0.3.0",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "npx tsdown",
|
|
28
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
29
|
+
"tsc": "npx tsc -b tsconfig.json"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/launcher/launcher.cjs
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Platform launcher — SHARED, GENERIC, PARAMETER-FREE. Byte-for-byte identical
|
|
3
|
-
// in every @usecontextlayer CLI package (ctxb, ctxe, ctxs, …). It derives its
|
|
4
|
-
// ENTIRE identity at runtime from its own package.json, so there is nothing in
|
|
5
|
-
// this file to edit per CLI. DO NOT add CLI-specific values here.
|
|
6
|
-
//
|
|
7
|
-
// ── Adding a new CLI `ctxX` ─────────────────────────────────────────────────
|
|
8
|
-
// 1. Copy this file VERBATIM to packages/<x>-cli/launcher/launcher.cjs.
|
|
9
|
-
// Do NOT rename or edit it. Preserve the executable bit: `chmod 0755`.
|
|
10
|
-
// 2. In packages/<x>-cli/package.json set:
|
|
11
|
-
// "bin": { "ctxX": "./launcher/launcher.cjs" }
|
|
12
|
-
// "files": ["launcher/launcher.cjs"]
|
|
13
|
-
// "optionalDependencies": {
|
|
14
|
-
// "@usecontextlayer/ctxX-darwin-arm64": "<this package's current version>",
|
|
15
|
-
// "@usecontextlayer/ctxX-linux-arm64": "<this package's current version>",
|
|
16
|
-
// "@usecontextlayer/ctxX-linux-x64": "<this package's current version>"
|
|
17
|
-
// }
|
|
18
|
-
// Pin each to a REAL x.y.z (copy this package's own `version` field) — not a
|
|
19
|
-
// literal placeholder. You don't maintain these afterward: `bun
|
|
20
|
-
// scripts/release.ts <version>` rewrites every @usecontextlayer/* pin in
|
|
21
|
-
// lockstep and auto-discovers the package. `scripts/check-workspace-
|
|
22
|
-
// references.ts` verifies the entries point at real workspace packages.
|
|
23
|
-
// 3. Done. From package.json `name` + `optionalDependencies` this file derives
|
|
24
|
-
// the CLI name, the supported platforms, the per-platform package, the
|
|
25
|
-
// `CTXX_BINARY` dev-override env var, and the resolved binary path.
|
|
26
|
-
//
|
|
27
|
-
// Resolution: spawns the compiled bun binary shipped inside the host's
|
|
28
|
-
// platform-binary package (an optionalDependency). `<CLI>_BINARY` (the
|
|
29
|
-
// uppercased CLI name) bypasses resolution for local dev / integration tests.
|
|
30
|
-
//
|
|
31
|
-
// CommonJS (.cjs) is required: the wrapper package.json carries "type":
|
|
32
|
-
// "module" for the dev workspace; .cjs forces CJS regardless. The require-based
|
|
33
|
-
// pattern (from Biome's launcher) loads faster than ESM-plus-createRequire.
|
|
34
|
-
|
|
35
|
-
const { spawnSync } = require("node:child_process")
|
|
36
|
-
|
|
37
|
-
const manifest = require("../package.json")
|
|
38
|
-
const name = manifest.name // @usecontextlayer/ctxb
|
|
39
|
-
const cli = name.slice(name.lastIndexOf("/") + 1) // ctxb
|
|
40
|
-
const prefix = `${name}-` // @usecontextlayer/ctxb-
|
|
41
|
-
|
|
42
|
-
// Supported platforms ARE the platform-binary optionalDependencies. Adding a
|
|
43
|
-
// platform = adding an optionalDependency; this file never changes for it.
|
|
44
|
-
const platforms = {}
|
|
45
|
-
for (const dep of Object.keys(manifest.optionalDependencies ?? {})) {
|
|
46
|
-
if (dep.startsWith(prefix)) platforms[dep.slice(prefix.length)] = dep
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const key = `${process.platform}-${process.arch}`
|
|
50
|
-
const binaryFromEnv = process.env[`${cli.toUpperCase()}_BINARY`]
|
|
51
|
-
const pkg = platforms[key]
|
|
52
|
-
|
|
53
|
-
if (!binaryFromEnv && !pkg) {
|
|
54
|
-
console.error(
|
|
55
|
-
`${name}: unsupported platform ${key}. ` +
|
|
56
|
-
`Supported: ${Object.keys(platforms).join(", ")}. ` +
|
|
57
|
-
`Set ${cli.toUpperCase()}_BINARY to override.`,
|
|
58
|
-
)
|
|
59
|
-
process.exit(1)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
let binary
|
|
63
|
-
try {
|
|
64
|
-
binary = binaryFromEnv ?? require.resolve(`${pkg}/bin/${cli}`)
|
|
65
|
-
} catch {
|
|
66
|
-
console.error(
|
|
67
|
-
`${name}: platform package ${pkg} is not installed. ` +
|
|
68
|
-
`If you used --omit=optional, re-run npm install with --include=optional.`,
|
|
69
|
-
)
|
|
70
|
-
process.exit(1)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" })
|
|
74
|
-
if (result.signal) process.kill(process.pid, result.signal)
|
|
75
|
-
else process.exit(result.status ?? 1)
|