dsh-as-aistudio 0.2.2 → 0.2.4
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 +7 -5
- package/src/client.js +2 -2
- package/src/components.js +1 -1
- package/src/studio.js +1 -1
- package/src/vendor/dsh-edit-turn.js +2 -2
- package/tools/bump.mjs +82 -0
- package/tools/verify-manifest.mjs +77 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-as-aistudio",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Google-AI-Studio-style turn controls for DeepSeek Harness, in one install: edit a prompt and re-run it, re-run a reply in place, delete a turn from the model context, and render sent prompts as Markdown. Self-contained: the plugin list shows this one row; the four components are dependencies mounted by it. Each still installs alone and works alone.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -41,13 +41,15 @@
|
|
|
41
41
|
"vendor": "node tools/vendor.mjs",
|
|
42
42
|
"build": "node tools/vendor.mjs && node tools/build.mjs",
|
|
43
43
|
"test": "node --test test/*.test.js",
|
|
44
|
-
"check": "npm run build && npm test",
|
|
44
|
+
"check": "npm run verify:manifest && npm run build && npm test",
|
|
45
|
+
"bump": "node tools/bump.mjs",
|
|
45
46
|
"verify:vendor": "node tools/vendor.mjs --check",
|
|
46
|
-
"verify:build": "node tools/build.mjs --check"
|
|
47
|
+
"verify:build": "node tools/build.mjs --check",
|
|
48
|
+
"verify:manifest": "node tools/verify-manifest.mjs"
|
|
47
49
|
},
|
|
48
50
|
"dependencies": {
|
|
49
51
|
"dsh-delete-turn": "^0.1.7",
|
|
50
|
-
"dsh-edit-turn": "^0.2.
|
|
52
|
+
"dsh-edit-turn": "^0.2.16",
|
|
51
53
|
"dsh-markdown-bubble": "^0.1.4",
|
|
52
54
|
"dsh-rerun-turn": "^0.1.24"
|
|
53
55
|
},
|
|
@@ -71,7 +73,7 @@
|
|
|
71
73
|
"compatibility": {
|
|
72
74
|
"dshReleases": {
|
|
73
75
|
"0.1.6-alpha.2": "compatible",
|
|
74
|
-
"0.2.
|
|
76
|
+
"0.2.0-rc.2": "compatible"
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
}
|
package/src/client.js
CHANGED
|
@@ -32,7 +32,7 @@ window.__ModuleLoader__.load({
|
|
|
32
32
|
const RERUN_PREFIX = '/dsh-rerun-turn'
|
|
33
33
|
|
|
34
34
|
/** Keep in sync with package.json and lib/index.js. */
|
|
35
|
-
const PLUGIN_VERSION = '0.2.
|
|
35
|
+
const PLUGIN_VERSION = '0.2.16'
|
|
36
36
|
|
|
37
37
|
// --- copy -----------------------------------------------------------------
|
|
38
38
|
|
|
@@ -4795,7 +4795,7 @@ window.__ModuleLoader__.load({
|
|
|
4795
4795
|
const NS = 'dsh-as-aistudio'
|
|
4796
4796
|
|
|
4797
4797
|
/** Keep in sync with package.json and src/components.js. */
|
|
4798
|
-
const PLUGIN_VERSION = '0.2.
|
|
4798
|
+
const PLUGIN_VERSION = '0.2.4'
|
|
4799
4799
|
|
|
4800
4800
|
/** Presence marker the live verifier reads. */
|
|
4801
4801
|
const DEBUG_KEY = '__DSH_AS_AISTUDIO__'
|
package/src/components.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
export const STUDIO_ID = 'dsh-as-aistudio'
|
|
20
20
|
|
|
21
21
|
/** Keep in sync with package.json and src/client.js. */
|
|
22
|
-
export const STUDIO_VERSION = '0.2.
|
|
22
|
+
export const STUDIO_VERSION = '0.2.4'
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The AI Studio action strip this studio composes, in the order the user meets
|
package/src/studio.js
CHANGED
|
@@ -49,7 +49,7 @@ window.__ModuleLoader__.load({
|
|
|
49
49
|
const NS = 'dsh-as-aistudio'
|
|
50
50
|
|
|
51
51
|
/** Keep in sync with package.json and src/components.js. */
|
|
52
|
-
const PLUGIN_VERSION = '0.2.
|
|
52
|
+
const PLUGIN_VERSION = '0.2.4'
|
|
53
53
|
|
|
54
54
|
/** Presence marker the live verifier reads. */
|
|
55
55
|
const DEBUG_KEY = '__DSH_AS_AISTUDIO__'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// dsh-edit-turn browser half, VENDORED by tools/vendor.mjs - DO NOT EDIT.
|
|
2
2
|
//
|
|
3
|
-
// Source: ../dsh-edit-turn/lib/client.js (v0.2.
|
|
3
|
+
// Source: ../dsh-edit-turn/lib/client.js (v0.2.16, sha256 3ccc92a337c0541e)
|
|
4
4
|
// Regenerate with `npm run vendor`; test/vendor-sync.test.js fails when this is stale.
|
|
5
5
|
//
|
|
6
6
|
// The component registers its factory with the host module loader; inside this
|
|
@@ -24,7 +24,7 @@ export default (require) => {
|
|
|
24
24
|
const RERUN_PREFIX = '/dsh-rerun-turn'
|
|
25
25
|
|
|
26
26
|
/** Keep in sync with package.json and lib/index.js. */
|
|
27
|
-
const PLUGIN_VERSION = '0.2.
|
|
27
|
+
const PLUGIN_VERSION = '0.2.16'
|
|
28
28
|
|
|
29
29
|
// --- copy -----------------------------------------------------------------
|
|
30
30
|
|
package/tools/bump.mjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Bump this package's version in the three places that legitimately carry it -
|
|
2
|
+
// and assert that NOTHING ELSE in those files changed.
|
|
3
|
+
//
|
|
4
|
+
// The rule this tool exists to enforce. Do not bump with a blind replace:
|
|
5
|
+
//
|
|
6
|
+
// s.split('0.2.1').join('0.2.2') // WRONG
|
|
7
|
+
//
|
|
8
|
+
// That also rewrites every other string containing the old version. '^0.2.15'
|
|
9
|
+
// contains '0.2.1', so a dependency range silently became '^0.2.25' - a version
|
|
10
|
+
// that has never existed - and the package shipped unable to install at all.
|
|
11
|
+
// It also rewrote a DSH release key ('0.2.0-rc.1' -> '0.2.1-rc.1'), which has
|
|
12
|
+
// nothing to do with this package's version.
|
|
13
|
+
//
|
|
14
|
+
// node tools/bump.mjs 0.2.3 # write
|
|
15
|
+
// node tools/bump.mjs --check # verify the three sites agree, write nothing
|
|
16
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
17
|
+
import { dirname, join } from 'node:path'
|
|
18
|
+
import { fileURLToPath } from 'node:url'
|
|
19
|
+
|
|
20
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
21
|
+
|
|
22
|
+
/** file, the one regex that matches its version literal, and a human name. */
|
|
23
|
+
const SITES = [
|
|
24
|
+
{ file: 'package.json', pattern: /(^\s*"version":\s*")([^"]+)(")/m, label: 'package.json version' },
|
|
25
|
+
{ file: 'src/components.js', pattern: /(export const STUDIO_VERSION = ')([^']+)(')/, label: 'STUDIO_VERSION' },
|
|
26
|
+
{ file: 'src/studio.js', pattern: /(const PLUGIN_VERSION = ')([^']+)(')/, label: 'PLUGIN_VERSION' },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
function currentOf(site) {
|
|
30
|
+
const text = readFileSync(join(root, site.file), 'utf8')
|
|
31
|
+
const match = site.pattern.exec(text)
|
|
32
|
+
if (match === null) throw new Error(site.label + ': the version literal is not in ' + site.file)
|
|
33
|
+
return match[2]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const versions = SITES.map((site) => ({ ...site, current: currentOf(site) }))
|
|
37
|
+
const distinct = [...new Set(versions.map((v) => v.current))]
|
|
38
|
+
|
|
39
|
+
if (process.argv.includes('--check')) {
|
|
40
|
+
if (distinct.length !== 1) {
|
|
41
|
+
console.error('the three version sites disagree: ' + versions.map((v) => v.label + '=' + v.current).join(', '))
|
|
42
|
+
process.exit(1)
|
|
43
|
+
}
|
|
44
|
+
console.log('the version is one number in three places: ' + distinct[0])
|
|
45
|
+
process.exit(0)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const next = process.argv[2]
|
|
49
|
+
if (!/^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$/.test(next || '')) {
|
|
50
|
+
console.error('usage: node tools/bump.mjs <semver> (for example 0.2.3)')
|
|
51
|
+
process.exit(2)
|
|
52
|
+
}
|
|
53
|
+
if (distinct.length !== 1) {
|
|
54
|
+
console.error('refusing to bump: the three sites already disagree (' + distinct.join(', ') + '); fix them first')
|
|
55
|
+
process.exit(2)
|
|
56
|
+
}
|
|
57
|
+
const from = distinct[0]
|
|
58
|
+
if (from === next) {
|
|
59
|
+
console.error('already at ' + next)
|
|
60
|
+
process.exit(2)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
for (const site of versions) {
|
|
64
|
+
const path = join(root, site.file)
|
|
65
|
+
const before = readFileSync(path, 'utf8')
|
|
66
|
+
const after = before.replace(site.pattern, (_m, head, _old, tail) => head + next + tail)
|
|
67
|
+
if (before === after) throw new Error(site.label + ': nothing changed in ' + site.file)
|
|
68
|
+
// The whole point: exactly one line may differ, and it must be the version line.
|
|
69
|
+
const beforeLines = before.split('\n')
|
|
70
|
+
const afterLines = after.split('\n')
|
|
71
|
+
if (beforeLines.length !== afterLines.length) throw new Error(site.file + ': the line count changed')
|
|
72
|
+
const changed = beforeLines.map((line, index) => (line === afterLines[index] ? null : index)).filter((index) => index !== null)
|
|
73
|
+
if (changed.length !== 1) {
|
|
74
|
+
throw new Error(site.file + ': expected exactly 1 changed line, got ' + changed.length + '; refusing to write')
|
|
75
|
+
}
|
|
76
|
+
writeFileSync(path, after)
|
|
77
|
+
console.log(' ' + site.file + ':' + (changed[0] + 1) + ' ' + site.label + ' ' + from + ' -> ' + next)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
console.log('')
|
|
81
|
+
console.log('bumped ' + from + ' -> ' + next + ' in ' + versions.length + ' places, nothing else touched.')
|
|
82
|
+
console.log('Now: node tools/verify-manifest.mjs, npm run build, npm test.')
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Gate the manifest against the registry before publishing.
|
|
2
|
+
//
|
|
3
|
+
// This is the check whose absence shipped a broken release: dsh-as-aistudio@0.2.2
|
|
4
|
+
// declared 'dsh-edit-turn': '^0.2.25'. No such version exists (the latest is
|
|
5
|
+
// 0.2.15), so `pnpm add dsh-as-aistudio@0.2.2` failed with
|
|
6
|
+
// ERR_PNPM_NO_MATCHING_VERSION and the package could not be installed at all -
|
|
7
|
+
// while every test that exercised the bundle inside it passed, because unpacking
|
|
8
|
+
// a tarball never resolves its dependencies.
|
|
9
|
+
//
|
|
10
|
+
// node tools/verify-manifest.mjs # exit 1 on any unresolvable range
|
|
11
|
+
import { execFileSync } from 'node:child_process'
|
|
12
|
+
import { readFileSync } from 'node:fs'
|
|
13
|
+
import { dirname, join } from 'node:path'
|
|
14
|
+
import { fileURLToPath } from 'node:url'
|
|
15
|
+
|
|
16
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
17
|
+
const manifest = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'))
|
|
18
|
+
let failed = 0
|
|
19
|
+
|
|
20
|
+
// 1. every dependency range must resolve to a published version
|
|
21
|
+
const deps = Object.entries(manifest.dependencies || {})
|
|
22
|
+
if (deps.length === 0) {
|
|
23
|
+
console.error('no dependencies declared; that is not the shape of this package')
|
|
24
|
+
failed += 1
|
|
25
|
+
}
|
|
26
|
+
for (const [name, range] of deps) {
|
|
27
|
+
let resolved = ''
|
|
28
|
+
try {
|
|
29
|
+
resolved = execFileSync('npm', ['view', name + '@' + range, 'version'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim().split('\n').pop().trim()
|
|
30
|
+
} catch (error) {
|
|
31
|
+
resolved = ''
|
|
32
|
+
}
|
|
33
|
+
if (resolved === '') {
|
|
34
|
+
console.error(' UNRESOLVABLE ' + name + '@' + range + ' <- no published version satisfies this')
|
|
35
|
+
failed += 1
|
|
36
|
+
} else {
|
|
37
|
+
console.log(' ok ' + name + '@' + range + ' -> ' + resolved)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 2. the version must be one number in the three places that carry it
|
|
42
|
+
const sites = [
|
|
43
|
+
['package.json', /(^\s*"version":\s*")([^"]+)(")/m],
|
|
44
|
+
['src/components.js', /(export const STUDIO_VERSION = ')([^']+)(')/],
|
|
45
|
+
['src/studio.js', /(const PLUGIN_VERSION = ')([^']+)(')/],
|
|
46
|
+
]
|
|
47
|
+
const found = sites.map(([file, pattern]) => {
|
|
48
|
+
const match = pattern.exec(readFileSync(join(root, file), 'utf8'))
|
|
49
|
+
return { file, version: match === null ? null : match[2] }
|
|
50
|
+
})
|
|
51
|
+
const distinct = [...new Set(found.map((s) => s.version))]
|
|
52
|
+
if (distinct.length !== 1 || distinct[0] === null) {
|
|
53
|
+
console.error(' VERSION DRIFT ' + found.map((s) => s.file + '=' + s.version).join(', '))
|
|
54
|
+
failed += 1
|
|
55
|
+
} else {
|
|
56
|
+
console.log(' ok version ' + distinct[0] + ' in all three places')
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 3. DSH compatibility keys must look like DSH releases, not like this package
|
|
60
|
+
const releases = Object.keys(manifest.dsh?.compatibility?.dshReleases || {})
|
|
61
|
+
if (releases.length === 0) {
|
|
62
|
+
console.error(' NO DSH RELEASES declared in dsh.compatibility.dshReleases')
|
|
63
|
+
failed += 1
|
|
64
|
+
}
|
|
65
|
+
for (const release of releases) {
|
|
66
|
+
if (!/^0\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$/.test(release)) {
|
|
67
|
+
console.error(' BAD DSH KEY ' + release + ' does not look like a DSH release')
|
|
68
|
+
failed += 1
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
console.log('')
|
|
73
|
+
if (failed > 0) {
|
|
74
|
+
console.error(failed + ' manifest problem(s); do not publish')
|
|
75
|
+
process.exit(1)
|
|
76
|
+
}
|
|
77
|
+
console.log('manifest ok: ' + deps.length + ' dependency ranges resolve, version ' + distinct[0] + ' consistent')
|