@textcortex/zenocode 0.1.13 → 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,70 +1,129 @@
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,
10
11
  defaultOpenCodeVersion,
11
12
  deriveOpenCodeVersionFromRef,
12
13
  mapBrandedBinaryPackageName,
13
- } from "./build-branded-opencode.mjs";
14
+ selectLatestTarball,
15
+ trustedPublishingRepository,
16
+ zenocodeRuntimeVersion,
17
+ } from './build-branded-opencode.mjs';
14
18
 
15
- test("branded OpenCode build defaults to the latest stable upstream release", () => {
16
- assert.equal(defaultOpenCodeForkUrl, "https://github.com/sst/opencode");
17
- assert.equal(defaultOpenCodeRef, "v1.17.6");
18
- assert.equal(defaultOpenCodeVersion, "1.17.6");
19
- 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, []);
20
25
  });
21
26
 
22
- test("deriveOpenCodeVersionFromRef follows explicit tag overrides", () => {
23
- assert.equal(deriveOpenCodeVersionFromRef("v1.17.5"), "1.17.5");
24
- assert.equal(deriveOpenCodeVersionFromRef("1.18.0-beta.1"), "1.18.0-beta.1");
25
- 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
+ );
26
34
  });
27
35
 
28
- test("display-name-only branding is limited to reviewed upstream refs", () => {
29
- assert.equal(allowsDisplayNameOnlyBranding(defaultOpenCodeRef), true);
30
- 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');
31
40
  });
32
41
 
33
- test("mapBrandedBinaryPackageName scopes runtime binaries under zenocode", () => {
42
+ test('mapBrandedBinaryPackageName scopes runtime binaries under zenocode', () => {
34
43
  assert.equal(
35
- mapBrandedBinaryPackageName("opencode-darwin-arm64", "@textcortex/zenocode-ai"),
36
- "@textcortex/zenocode-darwin-arm64",
44
+ mapBrandedBinaryPackageName(
45
+ 'opencode-darwin-arm64',
46
+ '@textcortex/zenocode-ai'
47
+ ),
48
+ '@textcortex/zenocode-darwin-arm64'
37
49
  );
38
50
  assert.equal(
39
- mapBrandedBinaryPackageName("opencode-linux-x64-baseline-musl", "@textcortex/zenocode-ai"),
40
- "@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'
41
56
  );
42
57
  });
43
58
 
44
- test("buildWrapperBinMap includes package, opencode, and zenocode entrypoints", () => {
45
- assert.deepEqual(buildWrapperBinMap("@textcortex/zenocode-ai", "zenocode"), {
46
- "zenocode-ai": "./bin/opencode",
47
- opencode: "./bin/opencode",
48
- 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',
70
+ });
71
+
72
+ assert.doesNotMatch(source, /OPENCODE_BIN_PATH/);
73
+ assert.doesNotMatch(source, /legacyName/);
74
+ assert.doesNotMatch(source, /name\.replace\(new RegExp/);
75
+ });
76
+
77
+ test('generated runtime packages point trusted publishing at this repository', () => {
78
+ assert.deepEqual(trustedPublishingRepository, {
79
+ type: 'git',
80
+ url: 'git+https://github.com/textcortex/platform.git',
49
81
  });
50
82
  });
51
83
 
52
- test("buildPublishCommandArgs omits npm provenance for runtime tarball publishing", () => {
53
- assert.deepEqual(buildPublishCommandArgs("package.tgz", { tag: "latest" }), [
54
- "publish",
55
- "package.tgz",
56
- "--access",
57
- "public",
58
- "--tag",
59
- "latest",
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
+ );
97
+ });
98
+
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',
60
107
  ]);
61
108
  });
62
109
 
63
- test("buildPublishCommandArgs omits tag arguments when no tag is provided", () => {
64
- assert.deepEqual(buildPublishCommandArgs("package.tgz"), [
65
- "publish",
66
- "package.tgz",
67
- "--access",
68
- "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',
69
116
  ]);
70
117
  });
118
+
119
+ test('selectLatestTarball returns the sorted newest tarball', () => {
120
+ assert.equal(
121
+ selectLatestTarball([
122
+ 'README.md',
123
+ 'textcortex-zenocode-linux-x64-1.9.0.tgz',
124
+ 'textcortex-zenocode-linux-x64-1.10.0.tgz',
125
+ ]),
126
+ 'textcortex-zenocode-linux-x64-1.10.0.tgz'
127
+ );
128
+ assert.equal(selectLatestTarball(['README.md']), null);
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}`;