@textcortex/zenocode 0.1.14 → 0.1.16
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/README.md +36 -1
- package/package.json +1 -1
- package/scripts/build-branded-opencode.mjs +292 -215
- package/scripts/build-branded-opencode.test.mjs +85 -59
- package/scripts/opencode-version.mjs +5 -3
- package/scripts/run-zenocode.mjs +600 -763
- package/scripts/run-zenocode.test.mjs +625 -430
- package/scripts/source-branding.mjs +721 -0
- package/scripts/source-branding.test.mjs +106 -0
- package/scripts/branding-patch.mjs +0 -193
- package/scripts/branding-patch.test.mjs +0 -89
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import assert from
|
|
2
|
-
import test from
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import test from 'node:test';
|
|
3
3
|
import {
|
|
4
4
|
buildPublishCommandArgs,
|
|
5
5
|
buildWrapperBinMap,
|
|
6
|
-
|
|
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
|
-
|
|
16
|
+
zenocodeRuntimeVersion,
|
|
17
|
+
} from './build-branded-opencode.mjs';
|
|
16
18
|
|
|
17
|
-
test(
|
|
18
|
-
assert.equal(defaultOpenCodeForkUrl,
|
|
19
|
-
assert.equal(defaultOpenCodeRef,
|
|
20
|
-
assert.equal(defaultOpenCodeVersion,
|
|
21
|
-
assert.
|
|
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.2');
|
|
24
|
+
assert.deepEqual(defaultOpenCodeBuildArgs, []);
|
|
22
25
|
});
|
|
23
26
|
|
|
24
|
-
test(
|
|
25
|
-
assert.equal(
|
|
26
|
-
assert.equal(
|
|
27
|
-
assert.equal(
|
|
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(
|
|
31
|
-
assert.equal(
|
|
32
|
-
assert.equal(
|
|
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(
|
|
42
|
+
test('mapBrandedBinaryPackageName scopes runtime binaries under zenocode', () => {
|
|
36
43
|
assert.equal(
|
|
37
|
-
mapBrandedBinaryPackageName(
|
|
38
|
-
|
|
44
|
+
mapBrandedBinaryPackageName(
|
|
45
|
+
'opencode-darwin-arm64',
|
|
46
|
+
'@textcortex/zenocode-ai'
|
|
47
|
+
),
|
|
48
|
+
'@textcortex/zenocode-darwin-arm64'
|
|
39
49
|
);
|
|
40
50
|
assert.equal(
|
|
41
|
-
mapBrandedBinaryPackageName(
|
|
42
|
-
|
|
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(
|
|
47
|
-
assert.deepEqual(buildWrapperBinMap(
|
|
48
|
-
|
|
49
|
-
opencode:
|
|
50
|
-
zenocode:
|
|
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(
|
|
77
|
+
test('generated runtime packages point trusted publishing at this repository', () => {
|
|
55
78
|
assert.deepEqual(trustedPublishingRepository, {
|
|
56
|
-
type:
|
|
57
|
-
url:
|
|
79
|
+
type: 'git',
|
|
80
|
+
url: 'git+https://github.com/textcortex/platform.git',
|
|
58
81
|
});
|
|
59
82
|
});
|
|
60
83
|
|
|
61
|
-
test(
|
|
62
|
-
assert.deepEqual(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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(
|
|
74
|
-
assert.deepEqual(buildPublishCommandArgs(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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(
|
|
85
|
-
assert.deepEqual(buildPublishCommandArgs(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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(
|
|
119
|
+
test('selectLatestTarball returns the sorted newest tarball', () => {
|
|
94
120
|
assert.equal(
|
|
95
121
|
selectLatestTarball([
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
122
|
+
'README.md',
|
|
123
|
+
'textcortex-zenocode-linux-x64-1.9.0.tgz',
|
|
124
|
+
'textcortex-zenocode-linux-x64-1.10.0.tgz',
|
|
99
125
|
]),
|
|
100
|
-
|
|
126
|
+
'textcortex-zenocode-linux-x64-1.10.0.tgz'
|
|
101
127
|
);
|
|
102
|
-
assert.equal(selectLatestTarball([
|
|
128
|
+
assert.equal(selectLatestTarball(['README.md']), null);
|
|
103
129
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const openCodeVersion = "1.17.6";
|
|
1
|
+
export const openCodeVersion = '1.18.10';
|
|
3
2
|
export const openCodeRef = `v${openCodeVersion}`;
|
|
4
|
-
export const
|
|
3
|
+
export const zenocodeRuntimePackageName = '@textcortex/zenocode-ai';
|
|
4
|
+
export const zenocodeRuntimeRevision = 2;
|
|
5
|
+
export const zenocodeRuntimeVersion = `${openCodeVersion}-zenocode.${zenocodeRuntimeRevision}`;
|
|
6
|
+
export const zenocodeRuntimePackageSpec = `${zenocodeRuntimePackageName}@${zenocodeRuntimeVersion}`;
|