@tetsuo-ai/agenc 0.6.0 → 0.7.2

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/package.json CHANGED
@@ -1,21 +1,41 @@
1
1
  {
2
2
  "name": "@tetsuo-ai/agenc",
3
- "version": "0.6.0",
3
+ "version": "0.7.2",
4
4
  "description": "Public AgenC CLI launcher package",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/tetsuo-ai/agenc-core.git",
10
+ "directory": "packages/agenc"
11
+ },
12
+ "homepage": "https://github.com/tetsuo-ai/agenc-core#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/tetsuo-ai/agenc-core/issues"
15
+ },
7
16
  "bin": {
8
17
  "agenc": "bin/agenc"
9
18
  },
10
19
  "files": [
11
- "bin",
12
- "src",
13
- "lib",
14
- "scripts",
15
- "generated"
20
+ "bin/agenc",
21
+ "src/launcher.mjs",
22
+ "lib/activation-lock-identity.d.mts",
23
+ "lib/activation-lock-identity.mjs",
24
+ "lib/generated-wrapper.d.mts",
25
+ "lib/generated-wrapper.mjs",
26
+ "lib/runtime-archive.mjs",
27
+ "lib/runtime-compatibility.mjs",
28
+ "lib/runtime-manager.mjs",
29
+ "lib/runtime-release-contract.d.mts",
30
+ "lib/runtime-release-contract.mjs",
31
+ "lib/sqlite-lock.d.mts",
32
+ "lib/sqlite-lock.mjs",
33
+ "scripts/postinstall.mjs",
34
+ "generated/agenc-runtime-manifest-v2.json"
16
35
  ],
17
36
  "scripts": {
18
37
  "postinstall": "node ./scripts/postinstall.mjs",
38
+ "prepack": "node ./scripts/check-package-ready.mjs && node ../../scripts/canonicalize-package-modes.mjs .",
19
39
  "build:runtime-tarball": "node ./scripts/build-runtime-tarball.mjs",
20
40
  "gen:manifest": "node ./scripts/gen-manifest.mjs",
21
41
  "test": "node --test test/*.test.mjs"
@@ -27,6 +47,6 @@
27
47
  "@tetsuo-ai/runtime": "file:../../runtime"
28
48
  },
29
49
  "engines": {
30
- "node": ">=25.0.0"
50
+ "node": ">=25.9.0 <26.0.0"
31
51
  }
32
52
  }
File without changes
@@ -1,63 +0,0 @@
1
- {
2
- "manifestVersion": 1,
3
- "runtimeVersion": "0.6.0",
4
- "releaseRepository": "tetsuo-ai/agenc-releases",
5
- "releaseTag": "agenc-v0.6.0",
6
- "artifacts": [
7
- {
8
- "platform": "darwin",
9
- "arch": "arm64",
10
- "runtimeVersion": "0.6.0",
11
- "url": "https://github.com/tetsuo-ai/agenc-releases/releases/download/agenc-v0.6.0/agenc-runtime-0.6.0-darwin-arm64.tar.gz",
12
- "sha256": "6f75ee2cb44deece56a6ae3185b86b256b56fae2ebb944e45120a203cf5b4eea",
13
- "bytes": 82107008,
14
- "bins": {
15
- "agenc": "node_modules/@tetsuo-ai/runtime/bin/agenc"
16
- }
17
- },
18
- {
19
- "platform": "darwin",
20
- "arch": "x64",
21
- "runtimeVersion": "0.6.0",
22
- "url": "https://github.com/tetsuo-ai/agenc-releases/releases/download/agenc-v0.6.0/agenc-runtime-0.6.0-darwin-x64.tar.gz",
23
- "sha256": "ac47bfc9277186992318b3a303a2a06fc694560d02439f82a9e730cee3048419",
24
- "bytes": 82900964,
25
- "bins": {
26
- "agenc": "node_modules/@tetsuo-ai/runtime/bin/agenc"
27
- }
28
- },
29
- {
30
- "platform": "linux",
31
- "arch": "arm64",
32
- "runtimeVersion": "0.6.0",
33
- "url": "https://github.com/tetsuo-ai/agenc-releases/releases/download/agenc-v0.6.0/agenc-runtime-0.6.0-linux-arm64.tar.gz",
34
- "sha256": "55e5c0325413278d75ea05777cee68a6bdd7cba79900ea61e6dcd44967a73895",
35
- "bytes": 82494984,
36
- "bins": {
37
- "agenc": "node_modules/@tetsuo-ai/runtime/bin/agenc"
38
- }
39
- },
40
- {
41
- "platform": "linux",
42
- "arch": "x64",
43
- "runtimeVersion": "0.6.0",
44
- "url": "https://github.com/tetsuo-ai/agenc-releases/releases/download/agenc-v0.6.0/agenc-runtime-0.6.0-linux-x64.tar.gz",
45
- "sha256": "d5f460e16c1159443fbd6646b7aff0c6b281f78c72848495695a9d6e75a8bb7e",
46
- "bytes": 82510381,
47
- "bins": {
48
- "agenc": "node_modules/@tetsuo-ai/runtime/bin/agenc"
49
- }
50
- },
51
- {
52
- "platform": "win",
53
- "arch": "x64",
54
- "runtimeVersion": "0.6.0",
55
- "url": "https://github.com/tetsuo-ai/agenc-releases/releases/download/agenc-v0.6.0/agenc-runtime-0.6.0-win-x64.tar.gz",
56
- "sha256": "3f8481fd545fe4ab04bebf09a13729319a9a7dfef6c31fb35aa3a72e19d45036",
57
- "bytes": 81864491,
58
- "bins": {
59
- "agenc": "node_modules/@tetsuo-ai/runtime/bin/agenc"
60
- }
61
- }
62
- ]
63
- }
@@ -1,201 +0,0 @@
1
- #!/usr/bin/env node
2
- // Build a self-contained, per-platform runtime artifact for GitHub Releases.
3
- //
4
- // The runtime (@tetsuo-ai/runtime) is NOT published to npm — it ships as a
5
- // platform-specific tarball because it pulls native deps (better-sqlite3,
6
- // node-pty) that must be compiled for the host OS/arch. This script produces
7
- // one such artifact for the CURRENT platform; the release CI matrix runs it on
8
- // each target runner.
9
- //
10
- // Output layout (what the install-side runtime-manager extracts verbatim into
11
- // ~/.agenc/runtime/<version>/):
12
- //
13
- // node_modules/@tetsuo-ai/runtime/{bin,dist,package.json,README.md}
14
- // node_modules/<every production dep, natively built for this platform>/...
15
- //
16
- // So the runtime entry after extraction is:
17
- // <root>/node_modules/@tetsuo-ai/runtime/bin/agenc
18
- //
19
- // Steps: build runtime → `npm pack` it (respects its `files`) → `npm install`
20
- // that tarball with --omit=dev into a staging dir (resolves the prod dep tree
21
- // and compiles native modules for THIS platform) → tar the resulting
22
- // node_modules → emit sha256. Pure npm; no hand-rolled dependency resolution.
23
-
24
- import { spawnSync } from "node:child_process";
25
- import { createHash } from "node:crypto";
26
- import { existsSync, mkdtempSync, readFileSync, rmSync, mkdirSync, statSync, writeFileSync } from "node:fs";
27
- import { createReadStream } from "node:fs";
28
- import { tmpdir } from "node:os";
29
- import { dirname, join, resolve } from "node:path";
30
- import { fileURLToPath } from "node:url";
31
-
32
- const __dirname = dirname(fileURLToPath(import.meta.url));
33
- const launcherDir = resolve(__dirname, "..");
34
- const repoRoot = resolve(launcherDir, "..", "..");
35
- const runtimeDir = join(repoRoot, "runtime");
36
-
37
- // On Windows, npm/tar-style launchers are .cmd shims that spawnSync cannot
38
- // exec directly (ENOENT surfaces as a null status — exactly the CI matrix
39
- // failure mode). `shell: true` resolves them through cmd.exe; argv here is
40
- // always static, never user input.
41
- const IS_WINDOWS = process.platform === "win32";
42
-
43
- function run(cmd, args, opts = {}) {
44
- const res = spawnSync(cmd, args, {
45
- stdio: "inherit",
46
- shell: IS_WINDOWS,
47
- ...opts,
48
- });
49
- if (res.status !== 0) {
50
- throw new Error(
51
- `command failed (${res.status ?? res.signal}): ${cmd} ${args.join(" ")}`,
52
- );
53
- }
54
- return res;
55
- }
56
-
57
- function capture(cmd, args, opts = {}) {
58
- const res = spawnSync(cmd, args, {
59
- encoding: "utf8",
60
- shell: IS_WINDOWS,
61
- ...opts,
62
- });
63
- if (res.status !== 0) {
64
- throw new Error(
65
- `command failed (${res.status ?? res.signal}): ${cmd} ${args.join(" ")}\n${res.stderr ?? ""}`,
66
- );
67
- }
68
- return res.stdout.trim();
69
- }
70
-
71
- // node platform/arch → the artifact slug used in filenames + the manifest.
72
- function platformSlug() {
73
- const os = process.platform === "win32" ? "win" : process.platform; // linux | darwin | win
74
- const arch = process.arch; // x64 | arm64
75
- return { os, arch, slug: `${os}-${arch}` };
76
- }
77
-
78
- function sha256(file) {
79
- return new Promise((resolveHash, reject) => {
80
- const hash = createHash("sha256");
81
- const stream = createReadStream(file);
82
- stream.on("error", reject);
83
- stream.on("data", (chunk) => hash.update(chunk));
84
- stream.on("end", () => resolveHash(hash.digest("hex")));
85
- });
86
- }
87
-
88
- async function main() {
89
- const runtimePkg = JSON.parse(
90
- readFileSync(join(runtimeDir, "package.json"), "utf8"),
91
- );
92
- const version = runtimePkg.version;
93
- const { os, arch, slug } = platformSlug();
94
-
95
- const outDir = resolve(
96
- process.env.AGENC_RELEASE_OUT_DIR ?? join(launcherDir, "release-artifacts"),
97
- );
98
- mkdirSync(outDir, { recursive: true });
99
-
100
- const stage = mkdtempSync(join(tmpdir(), "agenc-runtime-build-"));
101
- try {
102
- // 1. Build the runtime (produces dist/).
103
- console.error(`[build] runtime ${version} (${slug})`);
104
- run("npm", ["run", "build"], { cwd: runtimeDir });
105
-
106
- // 2. Pack the runtime package into a tgz (honors runtime's `files`).
107
- const packed = capture(
108
- "npm",
109
- ["pack", "--silent", "--pack-destination", stage],
110
- { cwd: runtimeDir },
111
- )
112
- .split("\n")
113
- .map((l) => l.trim())
114
- .filter(Boolean)
115
- .pop();
116
- const runtimeTgz = join(stage, packed);
117
-
118
- // 3. Install the packed runtime + its PROD deps into the staging dir,
119
- // compiling native modules for THIS platform.
120
- const installRoot = join(stage, "install");
121
- mkdirSync(installRoot, { recursive: true });
122
- // A bare package.json so npm installs into install/node_modules.
123
- // (Written in-process: a `node -e` child with embedded quotes breaks
124
- // under the Windows shell resolution above.)
125
- writeFileSync(
126
- join(installRoot, "package.json"),
127
- JSON.stringify({
128
- name: "agenc-runtime-bundle",
129
- private: true,
130
- version: "0.0.0",
131
- }),
132
- );
133
- run(
134
- "npm",
135
- [
136
- "install",
137
- runtimeTgz,
138
- "--omit=dev",
139
- "--no-audit",
140
- "--no-fund",
141
- "--install-strategy=hoisted",
142
- ],
143
- { cwd: installRoot },
144
- );
145
-
146
- const nodeModules = join(installRoot, "node_modules");
147
- const runtimeEntry = join(
148
- nodeModules,
149
- "@tetsuo-ai",
150
- "runtime",
151
- "bin",
152
- "agenc",
153
- );
154
- statSync(runtimeEntry); // hard-fail if the layout isn't what we promise
155
-
156
- // 4. Tar node_modules into the release artifact.
157
- const artifactName = `agenc-runtime-${version}-${slug}.tar.gz`;
158
- const artifactPath = join(outDir, artifactName);
159
- // Windows: bash-on-PATH resolves `tar` to GNU tar, which parses drive
160
- // letters (D:\...) as remote hosts ("Cannot connect to D:"). The system
161
- // bsdtar handles Windows paths natively — use it explicitly.
162
- const tarBin =
163
- IS_WINDOWS && existsSync("C:\\Windows\\System32\\tar.exe")
164
- ? "C:\\Windows\\System32\\tar.exe"
165
- : "tar";
166
- run(tarBin, ["-czf", artifactPath, "-C", installRoot, "node_modules"]);
167
-
168
- // 5. Hash + report.
169
- const digest = await sha256(artifactPath);
170
- const size = statSync(artifactPath).size;
171
- const meta = {
172
- platform: os,
173
- arch,
174
- runtimeVersion: version,
175
- artifact: artifactName,
176
- sha256: digest,
177
- bytes: size,
178
- bins: {
179
- agenc: "node_modules/@tetsuo-ai/runtime/bin/agenc",
180
- },
181
- };
182
- // Sidecar meta so gen-manifest.mjs can assemble the manifest by globbing
183
- // release-artifacts/ across the CI matrix's downloaded artifacts.
184
- writeFileSync(
185
- join(outDir, `${artifactName}.meta.json`),
186
- JSON.stringify(meta, null, 2),
187
- );
188
- // Machine-readable line for CI; human summary on stderr.
189
- process.stdout.write(JSON.stringify(meta) + "\n");
190
- console.error(
191
- `[build] wrote ${artifactPath} (${(size / 1e6).toFixed(1)} MB)\n[build] sha256 ${digest}`,
192
- );
193
- } finally {
194
- rmSync(stage, { recursive: true, force: true });
195
- }
196
- }
197
-
198
- main().catch((err) => {
199
- console.error(`[build] FAILED: ${err?.stack ?? err}`);
200
- process.exitCode = 1;
201
- });
@@ -1,91 +0,0 @@
1
- #!/usr/bin/env node
2
- // Assemble generated/agenc-runtime-manifest.json from the per-platform sidecar
3
- // meta files (release-artifacts/*.meta.json) produced by build-runtime-tarball.
4
- //
5
- // In CI the matrix builds each platform on its own runner, uploads the tarball +
6
- // .meta.json as workflow artifacts; this step runs after they're all collected,
7
- // then the manifest is committed into the npm launcher before publish.
8
- //
9
- // Usage:
10
- // node scripts/gen-manifest.mjs --repo tetsuo-ai/agenc-releases --tag agenc-v0.2.0
11
- // [--artifacts <dir>] (default: packages/agenc/release-artifacts)
12
- // [--base-url <url>] (override; default: GitHub Releases download URL)
13
-
14
- import {
15
- existsSync,
16
- mkdirSync,
17
- readFileSync,
18
- readdirSync,
19
- writeFileSync,
20
- } from "node:fs";
21
- import { dirname, join, resolve } from "node:path";
22
- import { fileURLToPath } from "node:url";
23
-
24
- const __dirname = dirname(fileURLToPath(import.meta.url));
25
- const launcherDir = resolve(__dirname, "..");
26
-
27
- function arg(name, fallback) {
28
- const i = process.argv.indexOf(`--${name}`);
29
- return i !== -1 && i + 1 < process.argv.length ? process.argv[i + 1] : fallback;
30
- }
31
-
32
- const repo = arg("repo", "tetsuo-ai/agenc-releases");
33
- const tag = arg("tag");
34
- const artifactsDir = resolve(
35
- arg("artifacts", join(launcherDir, "release-artifacts")),
36
- );
37
- const baseUrl =
38
- arg("base-url") ??
39
- (tag ? `https://github.com/${repo}/releases/download/${tag}` : undefined);
40
-
41
- if (!tag) {
42
- console.error("gen-manifest: --tag is required (e.g. agenc-v0.2.0)");
43
- process.exit(1);
44
- }
45
- if (!existsSync(artifactsDir)) {
46
- console.error(`gen-manifest: artifacts dir not found: ${artifactsDir}`);
47
- process.exit(1);
48
- }
49
-
50
- const metas = readdirSync(artifactsDir)
51
- .filter((f) => f.endsWith(".meta.json"))
52
- .map((f) => JSON.parse(readFileSync(join(artifactsDir, f), "utf8")));
53
-
54
- if (metas.length === 0) {
55
- console.error(`gen-manifest: no *.meta.json in ${artifactsDir}`);
56
- process.exit(1);
57
- }
58
-
59
- const versions = [...new Set(metas.map((m) => m.runtimeVersion))];
60
- if (versions.length !== 1) {
61
- console.error(`gen-manifest: mixed runtime versions: ${versions.join(", ")}`);
62
- process.exit(1);
63
- }
64
-
65
- const manifest = {
66
- manifestVersion: 1,
67
- runtimeVersion: versions[0],
68
- releaseRepository: repo,
69
- releaseTag: tag,
70
- artifacts: metas
71
- .map((m) => ({
72
- platform: m.platform,
73
- arch: m.arch,
74
- runtimeVersion: m.runtimeVersion,
75
- url: `${baseUrl}/${m.artifact}`,
76
- sha256: m.sha256,
77
- bytes: m.bytes,
78
- bins: m.bins,
79
- }))
80
- .sort((a, b) => `${a.platform}-${a.arch}`.localeCompare(`${b.platform}-${b.arch}`)),
81
- };
82
-
83
- const outDir = join(launcherDir, "generated");
84
- mkdirSync(outDir, { recursive: true });
85
- const outPath = join(outDir, "agenc-runtime-manifest.json");
86
- writeFileSync(outPath, JSON.stringify(manifest, null, 2) + "\n");
87
- console.error(
88
- `gen-manifest: wrote ${outPath} (${manifest.artifacts.length} platform(s): ${manifest.artifacts
89
- .map((a) => `${a.platform}-${a.arch}`)
90
- .join(", ")})`,
91
- );