@textcortex/zenocode 0.1.14 → 0.1.15

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.
@@ -1,9 +1,10 @@
1
- import assert from "node:assert/strict";
2
- import test from "node:test";
1
+ import assert from 'node:assert/strict';
2
+ import test from 'node:test';
3
3
  import {
4
4
  buildPublishCommandArgs,
5
5
  buildWrapperBinMap,
6
- allowsDisplayNameOnlyBranding,
6
+ binaryFilenameForPackage,
7
+ buildWrapperExecutable,
7
8
  defaultOpenCodeBuildArgs,
8
9
  defaultOpenCodeForkUrl,
9
10
  defaultOpenCodeRef,
@@ -12,92 +13,117 @@ import {
12
13
  mapBrandedBinaryPackageName,
13
14
  selectLatestTarball,
14
15
  trustedPublishingRepository,
15
- } from "./build-branded-opencode.mjs";
16
+ zenocodeRuntimeVersion,
17
+ } from './build-branded-opencode.mjs';
16
18
 
17
- test("branded OpenCode build defaults to the latest stable upstream release", () => {
18
- assert.equal(defaultOpenCodeForkUrl, "https://github.com/sst/opencode");
19
- assert.equal(defaultOpenCodeRef, "v1.17.6");
20
- assert.equal(defaultOpenCodeVersion, "1.17.6");
21
- assert.deepEqual(defaultOpenCodeBuildArgs, ["--skip-install"]);
19
+ test('branded OpenCode build defaults to the latest stable upstream release', () => {
20
+ assert.equal(defaultOpenCodeForkUrl, 'https://github.com/sst/opencode');
21
+ assert.equal(defaultOpenCodeRef, 'v1.18.10');
22
+ assert.equal(defaultOpenCodeVersion, '1.18.10');
23
+ assert.equal(zenocodeRuntimeVersion, '1.18.10-zenocode.1');
24
+ assert.deepEqual(defaultOpenCodeBuildArgs, []);
22
25
  });
23
26
 
24
- test("deriveOpenCodeVersionFromRef follows explicit tag overrides", () => {
25
- assert.equal(deriveOpenCodeVersionFromRef("v1.17.5"), "1.17.5");
26
- assert.equal(deriveOpenCodeVersionFromRef("1.18.0-beta.1"), "1.18.0-beta.1");
27
- assert.equal(deriveOpenCodeVersionFromRef("main", "1.17.4"), "1.17.4");
27
+ test('cross-platform packages preserve the executable name for their target OS', () => {
28
+ assert.equal(binaryFilenameForPackage('opencode-darwin-arm64'), 'opencode');
29
+ assert.equal(binaryFilenameForPackage('opencode-linux-x64'), 'opencode');
30
+ assert.equal(
31
+ binaryFilenameForPackage('opencode-windows-x64'),
32
+ 'opencode.exe'
33
+ );
28
34
  });
29
35
 
30
- test("display-name-only branding is limited to reviewed upstream refs", () => {
31
- assert.equal(allowsDisplayNameOnlyBranding(defaultOpenCodeRef), true);
32
- assert.equal(allowsDisplayNameOnlyBranding("v1.17.7"), false);
36
+ test('deriveOpenCodeVersionFromRef follows explicit tag overrides', () => {
37
+ assert.equal(deriveOpenCodeVersionFromRef('v1.17.5'), '1.17.5');
38
+ assert.equal(deriveOpenCodeVersionFromRef('1.18.0-beta.1'), '1.18.0-beta.1');
39
+ assert.equal(deriveOpenCodeVersionFromRef('main', '1.17.4'), '1.17.4');
33
40
  });
34
41
 
35
- test("mapBrandedBinaryPackageName scopes runtime binaries under zenocode", () => {
42
+ test('mapBrandedBinaryPackageName scopes runtime binaries under zenocode', () => {
36
43
  assert.equal(
37
- mapBrandedBinaryPackageName("opencode-darwin-arm64", "@textcortex/zenocode-ai"),
38
- "@textcortex/zenocode-darwin-arm64",
44
+ mapBrandedBinaryPackageName(
45
+ 'opencode-darwin-arm64',
46
+ '@textcortex/zenocode-ai'
47
+ ),
48
+ '@textcortex/zenocode-darwin-arm64'
39
49
  );
40
50
  assert.equal(
41
- mapBrandedBinaryPackageName("opencode-linux-x64-baseline-musl", "@textcortex/zenocode-ai"),
42
- "@textcortex/zenocode-linux-x64-baseline-musl",
51
+ mapBrandedBinaryPackageName(
52
+ 'opencode-linux-x64-baseline-musl',
53
+ '@textcortex/zenocode-ai'
54
+ ),
55
+ '@textcortex/zenocode-linux-x64-baseline-musl'
43
56
  );
44
57
  });
45
58
 
46
- test("buildWrapperBinMap includes package, opencode, and zenocode entrypoints", () => {
47
- assert.deepEqual(buildWrapperBinMap("@textcortex/zenocode-ai", "zenocode"), {
48
- "zenocode-ai": "./bin/opencode",
49
- opencode: "./bin/opencode",
50
- zenocode: "./bin/opencode",
59
+ test('buildWrapperBinMap includes package, opencode, and zenocode entrypoints', () => {
60
+ assert.deepEqual(buildWrapperBinMap('@textcortex/zenocode-ai', 'zenocode'), {
61
+ 'zenocode-ai': './bin/opencode',
62
+ opencode: './bin/opencode',
63
+ zenocode: './bin/opencode',
64
+ });
65
+ });
66
+
67
+ test('generated runtime dispatcher never falls back to upstream binary packages', () => {
68
+ const source = buildWrapperExecutable({
69
+ runtimePackageName: '@textcortex/zenocode-ai',
51
70
  });
71
+
72
+ assert.doesNotMatch(source, /OPENCODE_BIN_PATH/);
73
+ assert.doesNotMatch(source, /legacyName/);
74
+ assert.doesNotMatch(source, /name\.replace\(new RegExp/);
52
75
  });
53
76
 
54
- test("generated runtime packages point trusted publishing at this repository", () => {
77
+ test('generated runtime packages point trusted publishing at this repository', () => {
55
78
  assert.deepEqual(trustedPublishingRepository, {
56
- type: "git",
57
- url: "git+https://github.com/textcortex/platform.git",
79
+ type: 'git',
80
+ url: 'git+https://github.com/textcortex/platform.git',
58
81
  });
59
82
  });
60
83
 
61
- test("buildPublishCommandArgs enables npm provenance for trusted publishing", () => {
62
- assert.deepEqual(buildPublishCommandArgs("package.tgz", { tag: "latest", provenance: true }), [
63
- "publish",
64
- "package.tgz",
65
- "--access",
66
- "public",
67
- "--provenance",
68
- "--tag",
69
- "latest",
70
- ]);
84
+ test('buildPublishCommandArgs enables npm provenance for trusted publishing', () => {
85
+ assert.deepEqual(
86
+ buildPublishCommandArgs('package.tgz', { tag: 'latest', provenance: true }),
87
+ [
88
+ 'publish',
89
+ 'package.tgz',
90
+ '--access',
91
+ 'public',
92
+ '--provenance',
93
+ '--tag',
94
+ 'latest',
95
+ ]
96
+ );
71
97
  });
72
98
 
73
- test("buildPublishCommandArgs omits npm provenance unless requested", () => {
74
- assert.deepEqual(buildPublishCommandArgs("package.tgz", { tag: "latest" }), [
75
- "publish",
76
- "package.tgz",
77
- "--access",
78
- "public",
79
- "--tag",
80
- "latest",
99
+ test('buildPublishCommandArgs omits npm provenance unless requested', () => {
100
+ assert.deepEqual(buildPublishCommandArgs('package.tgz', { tag: 'latest' }), [
101
+ 'publish',
102
+ 'package.tgz',
103
+ '--access',
104
+ 'public',
105
+ '--tag',
106
+ 'latest',
81
107
  ]);
82
108
  });
83
109
 
84
- test("buildPublishCommandArgs omits tag arguments when no tag is provided", () => {
85
- assert.deepEqual(buildPublishCommandArgs("package.tgz"), [
86
- "publish",
87
- "package.tgz",
88
- "--access",
89
- "public",
110
+ test('buildPublishCommandArgs omits tag arguments when no tag is provided', () => {
111
+ assert.deepEqual(buildPublishCommandArgs('package.tgz'), [
112
+ 'publish',
113
+ 'package.tgz',
114
+ '--access',
115
+ 'public',
90
116
  ]);
91
117
  });
92
118
 
93
- test("selectLatestTarball returns the sorted newest tarball", () => {
119
+ test('selectLatestTarball returns the sorted newest tarball', () => {
94
120
  assert.equal(
95
121
  selectLatestTarball([
96
- "README.md",
97
- "textcortex-zenocode-linux-x64-1.9.0.tgz",
98
- "textcortex-zenocode-linux-x64-1.10.0.tgz",
122
+ 'README.md',
123
+ 'textcortex-zenocode-linux-x64-1.9.0.tgz',
124
+ 'textcortex-zenocode-linux-x64-1.10.0.tgz',
99
125
  ]),
100
- "textcortex-zenocode-linux-x64-1.10.0.tgz",
126
+ 'textcortex-zenocode-linux-x64-1.10.0.tgz'
101
127
  );
102
- assert.equal(selectLatestTarball(["README.md"]), null);
128
+ assert.equal(selectLatestTarball(['README.md']), null);
103
129
  });
@@ -1,4 +1,6 @@
1
- export const openCodePackageName = "opencode-ai";
2
- export const openCodeVersion = "1.17.6";
1
+ export const openCodeVersion = '1.18.10';
3
2
  export const openCodeRef = `v${openCodeVersion}`;
4
- export const openCodePackageSpec = `${openCodePackageName}@${openCodeVersion}`;
3
+ export const zenocodeRuntimePackageName = '@textcortex/zenocode-ai';
4
+ export const zenocodeRuntimeRevision = 1;
5
+ export const zenocodeRuntimeVersion = `${openCodeVersion}-zenocode.${zenocodeRuntimeRevision}`;
6
+ export const zenocodeRuntimePackageSpec = `${zenocodeRuntimePackageName}@${zenocodeRuntimeVersion}`;