@codeworksh/tui 0.0.2-dev.20261013121551 → 0.0.2-dev.20261013124604
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/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/package.json +4 -5
package/index.mjs
CHANGED
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/binary.ts","../../src/index.ts"],"sourcesContent":["/* @effect-diagnostics nodeBuiltinImport:off -- the launcher resolves a file on the host. */\nimport { createRequire } from \"node:module\";\nimport { existsSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst require = createRequire(import.meta.url);\n\n/** The Rust binary, by the package that publishes a prebuilt for this platform. */\nexport interface Platform {\n\treadonly os: \"darwin\" | \"linux\";\n\treadonly arch: \"arm64\" | \"x64\";\n}\n\n/** Resolve the current platform, or `undefined` where no prebuilt is published. */\nexport function platform(): Platform | undefined {\n\tconst os = process.platform;\n\tconst arch = process.arch;\n\tif (os !== \"darwin\" && os !== \"linux\") return undefined;\n\tif (arch !== \"arm64\" && arch !== \"x64\") return undefined;\n\treturn { os, arch };\n}\n\nconst packageFor = (value: Platform) => `@codeworksh/tui-${value.os}-${value.arch}`;\nconst binaryName = \"codework-tui\";\n\n/** A source-tree build, used when neither an override nor a platform package is present. */\nfunction devBuild(): string | undefined {\n\tfor (const profile of [\"release\", \"debug\"]) {\n\t\tconst candidate = fileURLToPath(new URL(`../target/${profile}/${binaryName}`, import.meta.url));\n\t\tif (existsSync(candidate)) return candidate;\n\t}\n\treturn undefined;\n}\n\nexport class LauncherError extends Error {}\n\n/**\n * The `codework-tui` executable to run.\n *\n * Resolution order, most specific first:\n * 1. `CODEWORK_TUI_BIN` — an explicit path, for a local build or a test.\n * 2. The platform package's `bin/` — what a normal install ships.\n * 3. A `target/{release,debug}` build in the source tree, so `codework tui`\n * works from a checkout without publishing anything.\n *\n * Nothing is ever downloaded: a missing binary is an error that names the\n * package to install, because a silent runtime fetch is both surprising and a\n * supply-chain surface.\n */\nexport function resolveBinary(env: NodeJS.ProcessEnv = process.env): string {\n\tconst override = env[\"CODEWORK_TUI_BIN\"];\n\tif (override !== undefined && override.length > 0) {\n\t\tif (!existsSync(override)) throw new LauncherError(`CODEWORK_TUI_BIN points at a missing file: ${override}`);\n\t\treturn override;\n\t}\n\n\tconst current = platform();\n\tif (current !== undefined) {\n\t\ttry {\n\t\t\t// Resolve through the package's own manifest so the binary path is not part of\n\t\t\t// the platform package's public `exports` surface.\n\t\t\tconst manifest = require.resolve(`${packageFor(current)}/package.json`);\n\t\t\t// In a checkout the platform package is a workspace link with no binary staged.\n\t\t\tconst binary = join(dirname(manifest), \"bin\", binaryName);\n\t\t\tif (existsSync(binary)) return binary;\n\t\t} catch {\n\t\t\t// Fall through to the source-tree build below.\n\t\t}\n\t}\n\n\tconst dev = devBuild();\n\tif (dev !== undefined) return dev;\n\n\tthrow new LauncherError(\n\t\tcurrent === undefined\n\t\t\t? `no prebuilt CodeWork TUI is published for ${process.platform}-${process.arch}`\n\t\t\t: `the CodeWork TUI binary is missing. Install ${packageFor(current)}, or build it with \\`cargo build --release\\` in packages/tui`,\n\t);\n}\n","/**\n * Finds the CodeWork TUI binary. Running it is the CLI's job: the child must\n * share the CLI's lifetime and terminal, which the CLI's own runtime manages.\n */\nexport { LauncherError, platform, resolveBinary, type Platform } from \"./binary.ts\";\n\n/** The environment variable the Rust TUI reads for the server endpoint. */\nexport const ENV_SERVER = \"CODEWORK_RPC_SERVER\";\n"],"mappings":";;;;;AAMA,MAAM,UAAU,cAAc,YAAY,GAAG;;AAS7C,SAAgB,WAAiC;CAChD,MAAM,KAAK,QAAQ;CACnB,MAAM,OAAO,QAAQ;CACrB,IAAI,OAAO,YAAY,OAAO,SAAS,OAAO,KAAA;CAC9C,IAAI,SAAS,WAAW,SAAS,OAAO,OAAO,KAAA;
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/binary.ts","../../src/index.ts"],"sourcesContent":["/* @effect-diagnostics nodeBuiltinImport:off -- the launcher resolves a file on the host. */\nimport { createRequire } from \"node:module\";\nimport { existsSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst require = createRequire(import.meta.url);\n\n/** The Rust binary, by the package that publishes a prebuilt for this platform. */\nexport interface Platform {\n\treadonly os: \"darwin\" | \"linux\";\n\treadonly arch: \"arm64\" | \"x64\";\n}\n\n/** Resolve the current platform, or `undefined` where no prebuilt is published. */\nexport function platform(): Platform | undefined {\n\tconst os = process.platform;\n\tconst arch = process.arch;\n\tif (os !== \"darwin\" && os !== \"linux\") return undefined;\n\tif (arch !== \"arm64\" && arch !== \"x64\") return undefined;\n\t// Intel Macs are no longer supported; `@codeworksh/tui-darwin-x64` is deprecated.\n\tif (os === \"darwin\" && arch === \"x64\") return undefined;\n\treturn { os, arch };\n}\n\nconst packageFor = (value: Platform) => `@codeworksh/tui-${value.os}-${value.arch}`;\nconst binaryName = \"codework-tui\";\n\n/** A source-tree build, used when neither an override nor a platform package is present. */\nfunction devBuild(): string | undefined {\n\tfor (const profile of [\"release\", \"debug\"]) {\n\t\tconst candidate = fileURLToPath(new URL(`../target/${profile}/${binaryName}`, import.meta.url));\n\t\tif (existsSync(candidate)) return candidate;\n\t}\n\treturn undefined;\n}\n\nexport class LauncherError extends Error {}\n\n/**\n * The `codework-tui` executable to run.\n *\n * Resolution order, most specific first:\n * 1. `CODEWORK_TUI_BIN` — an explicit path, for a local build or a test.\n * 2. The platform package's `bin/` — what a normal install ships.\n * 3. A `target/{release,debug}` build in the source tree, so `codework tui`\n * works from a checkout without publishing anything.\n *\n * Nothing is ever downloaded: a missing binary is an error that names the\n * package to install, because a silent runtime fetch is both surprising and a\n * supply-chain surface.\n */\nexport function resolveBinary(env: NodeJS.ProcessEnv = process.env): string {\n\tconst override = env[\"CODEWORK_TUI_BIN\"];\n\tif (override !== undefined && override.length > 0) {\n\t\tif (!existsSync(override)) throw new LauncherError(`CODEWORK_TUI_BIN points at a missing file: ${override}`);\n\t\treturn override;\n\t}\n\n\tconst current = platform();\n\tif (current !== undefined) {\n\t\ttry {\n\t\t\t// Resolve through the package's own manifest so the binary path is not part of\n\t\t\t// the platform package's public `exports` surface.\n\t\t\tconst manifest = require.resolve(`${packageFor(current)}/package.json`);\n\t\t\t// In a checkout the platform package is a workspace link with no binary staged.\n\t\t\tconst binary = join(dirname(manifest), \"bin\", binaryName);\n\t\t\tif (existsSync(binary)) return binary;\n\t\t} catch {\n\t\t\t// Fall through to the source-tree build below.\n\t\t}\n\t}\n\n\tconst dev = devBuild();\n\tif (dev !== undefined) return dev;\n\n\tthrow new LauncherError(\n\t\tcurrent === undefined\n\t\t\t? `no prebuilt CodeWork TUI is published for ${process.platform}-${process.arch}`\n\t\t\t: `the CodeWork TUI binary is missing. Install ${packageFor(current)}, or build it with \\`cargo build --release\\` in packages/tui`,\n\t);\n}\n","/**\n * Finds the CodeWork TUI binary. Running it is the CLI's job: the child must\n * share the CLI's lifetime and terminal, which the CLI's own runtime manages.\n */\nexport { LauncherError, platform, resolveBinary, type Platform } from \"./binary.ts\";\n\n/** The environment variable the Rust TUI reads for the server endpoint. */\nexport const ENV_SERVER = \"CODEWORK_RPC_SERVER\";\n"],"mappings":";;;;;AAMA,MAAM,UAAU,cAAc,YAAY,GAAG;;AAS7C,SAAgB,WAAiC;CAChD,MAAM,KAAK,QAAQ;CACnB,MAAM,OAAO,QAAQ;CACrB,IAAI,OAAO,YAAY,OAAO,SAAS,OAAO,KAAA;CAC9C,IAAI,SAAS,WAAW,SAAS,OAAO,OAAO,KAAA;CAE/C,IAAI,OAAO,YAAY,SAAS,OAAO,OAAO,KAAA;CAC9C,OAAO;EAAE;EAAI;CAAK;AACnB;AAEA,MAAM,cAAc,UAAoB,mBAAmB,MAAM,GAAG,GAAG,MAAM;AAC7E,MAAM,aAAa;;AAGnB,SAAS,WAA+B;CACvC,KAAK,MAAM,WAAW,CAAC,WAAW,OAAO,GAAG;EAC3C,MAAM,YAAY,cAAc,IAAI,IAAI,aAAa,QAAQ,GAAG,cAAc,YAAY,GAAG,CAAC;EAC9F,IAAI,WAAW,SAAS,GAAG,OAAO;CACnC;AAED;AAEA,IAAa,gBAAb,cAAmC,MAAM,CAAC;;;;;;;;;;;;;;AAe1C,SAAgB,cAAc,MAAyB,QAAQ,KAAa;CAC3E,MAAM,WAAW,IAAI;CACrB,IAAI,aAAa,KAAA,KAAa,SAAS,SAAS,GAAG;EAClD,IAAI,CAAC,WAAW,QAAQ,GAAG,MAAM,IAAI,cAAc,8CAA8C,UAAU;EAC3G,OAAO;CACR;CAEA,MAAM,UAAU,SAAS;CACzB,IAAI,YAAY,KAAA,GACf,IAAI;EAGH,MAAM,WAAW,QAAQ,QAAQ,GAAG,WAAW,OAAO,EAAE,cAAc;EAEtE,MAAM,SAAS,KAAK,QAAQ,QAAQ,GAAG,OAAO,UAAU;EACxD,IAAI,WAAW,MAAM,GAAG,OAAO;CAChC,QAAQ,CAER;CAGD,MAAM,MAAM,SAAS;CACrB,IAAI,QAAQ,KAAA,GAAW,OAAO;CAE9B,MAAM,IAAI,cACT,YAAY,KAAA,IACT,6CAA6C,QAAQ,SAAS,GAAG,QAAQ,SACzE,+CAA+C,WAAW,OAAO,EAAE,6DACvE;AACD;;;;AC1EA,MAAa,aAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeworksh/tui",
|
|
3
|
-
"version": "0.0.2-dev.
|
|
3
|
+
"version": "0.0.2-dev.20261013124604",
|
|
4
4
|
"description": "High-performance Terminal User Interface (TUI) for CodeWork in Rust, with a thin TypeScript launcher",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codework",
|
|
@@ -33,9 +33,8 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@codeworksh/tui-darwin-arm64": "0.0.2-dev.
|
|
37
|
-
"@codeworksh/tui-
|
|
38
|
-
"@codeworksh/tui-linux-
|
|
39
|
-
"@codeworksh/tui-linux-x64": "0.0.2-dev.20261013121551"
|
|
36
|
+
"@codeworksh/tui-darwin-arm64": "0.0.2-dev.20261013124604",
|
|
37
|
+
"@codeworksh/tui-linux-arm64": "0.0.2-dev.20261013124604",
|
|
38
|
+
"@codeworksh/tui-linux-x64": "0.0.2-dev.20261013124604"
|
|
40
39
|
}
|
|
41
40
|
}
|