@dsh-workbench/adapters-default 1.3.1 → 1.4.0-beta.0
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/dist/adapter-set.js +2 -1
- package/dist/runtime-port.js +29 -2
- package/package.json +6 -6
package/dist/adapter-set.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ADAPTER_SET_API_VERSION, runningVersionOf, seamOf } from '@dsh-workbench/shared/host';
|
|
2
|
-
import { createCommandReader, createDataReader, createGitReader, createLibReader, opencliCommandOf, } from '@dsh-workbench/adapter-runtime';
|
|
2
|
+
import { createCommandReader, createDataReader, createGitReader, createLibReader, opencliCommandOf, sessionStateDir, } from '@dsh-workbench/adapter-runtime';
|
|
3
3
|
import { dshPluginsHandler, profileDirOf } from '@dsh-workbench/adapter-supply';
|
|
4
4
|
import { createHostActions } from '@dsh-workbench/adapter-profile';
|
|
5
5
|
import { createProbePort, createSupplyPort, readSelfUpdateView } from '@dsh-workbench/adapter-probe';
|
|
@@ -47,6 +47,7 @@ export function createAdapterSet(ctx, options = {}) {
|
|
|
47
47
|
data: createDataReader({
|
|
48
48
|
seam,
|
|
49
49
|
command: opencli.command,
|
|
50
|
+
sessionRegistryDir: sessionStateDir(),
|
|
50
51
|
...(onQueue === undefined ? {} : { onQueue }),
|
|
51
52
|
...(saveBytes === undefined ? {} : { saveBytes }),
|
|
52
53
|
}),
|
package/dist/runtime-port.js
CHANGED
|
@@ -2,7 +2,8 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import { packageRootOf, seamOf } from '@dsh-workbench/shared/host';
|
|
4
4
|
import { backgroundLine, libsBinDir } from '@dsh-workbench/adapter-runtime';
|
|
5
|
-
import {
|
|
5
|
+
import { lastBridgeFacts, rememberFrontApp, restoreFocus } from '@dsh-workbench/adapter-probe';
|
|
6
|
+
import { ensureLibsOpencliPeer, ensureVendorOpencliPeer, opencliCommandOf, opencliHandshakeOk, opencliHandshakeNote, opencliHandshakeText, opencliRunnerOf, opencliVersionReport, } from '@dsh-workbench/adapter-runtime';
|
|
6
7
|
import { isInstalledCopy, prependPath, runDetached, runtimeSeedPaths, runtimeSeedRootOf, seedRuntimeFiles, seedWorkbenchToolchain, workshopSeedPlan, } from '@dsh-workbench/adapter-probe';
|
|
7
8
|
export function runtimePathDirs(paths) {
|
|
8
9
|
return [paths.opencliBinDir, libsBinDir(), paths.entryDir];
|
|
@@ -107,7 +108,32 @@ export function createRuntimePort() {
|
|
|
107
108
|
};
|
|
108
109
|
},
|
|
109
110
|
health(ctx) {
|
|
110
|
-
|
|
111
|
+
const versions = opencliVersionReport();
|
|
112
|
+
const bridge = lastBridgeFacts();
|
|
113
|
+
const ready = opencliHandshakeOk(versions);
|
|
114
|
+
const note = ready ? undefined : opencliHandshakeNote(versions);
|
|
115
|
+
return {
|
|
116
|
+
opencli: {
|
|
117
|
+
...opencliCommandOf(ctx),
|
|
118
|
+
versions,
|
|
119
|
+
handshake: { ok: ready, detail: opencliHandshakeText(versions) },
|
|
120
|
+
...(versions.cli === undefined && versions.pin === '' ? {} : { version: versions.cli ?? versions.pin }),
|
|
121
|
+
ready,
|
|
122
|
+
...(note === undefined ? {} : { note }),
|
|
123
|
+
...(bridge === undefined ? {} : { bridge }),
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
versionReport() {
|
|
128
|
+
return opencliVersionReport();
|
|
129
|
+
},
|
|
130
|
+
async frontApp(ctx) {
|
|
131
|
+
const seam = seamOf(ctx);
|
|
132
|
+
return seam === undefined ? undefined : rememberFrontApp(seam, opencliCommandOf(ctx).command);
|
|
133
|
+
},
|
|
134
|
+
async bringToFront(ctx, app) {
|
|
135
|
+
const seam = seamOf(ctx);
|
|
136
|
+
return seam === undefined ? false : restoreFocus(seam, opencliCommandOf(ctx).command, app);
|
|
111
137
|
},
|
|
112
138
|
seed(ctx, options) {
|
|
113
139
|
const root = runtimeSeedRootOf(ctx);
|
|
@@ -121,6 +147,7 @@ export function createRuntimePort() {
|
|
|
121
147
|
for (const file of seedRuntimeFiles({ root, home, packageRoot, log }))
|
|
122
148
|
log(`自举写下 ${file}`);
|
|
123
149
|
ensureLibsOpencliPeer();
|
|
150
|
+
ensureVendorOpencliPeer();
|
|
124
151
|
for (const dir of prependRuntimePath(paths))
|
|
125
152
|
log(`PATH 前插 ${dir}`);
|
|
126
153
|
void seedWorkbenchToolchain(root, log, seam).then(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/adapters-default",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-beta.0",
|
|
4
4
|
"description": "Default host adapter set installed with @dsh-workbench/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"dist"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@dsh-workbench/adapter-probe": "1.
|
|
17
|
-
"@dsh-workbench/adapter-profile": "1.
|
|
18
|
-
"@dsh-workbench/adapter-supply": "1.
|
|
19
|
-
"@dsh-workbench/
|
|
20
|
-
"@dsh-workbench/
|
|
16
|
+
"@dsh-workbench/adapter-probe": "1.4.0-beta.0",
|
|
17
|
+
"@dsh-workbench/adapter-profile": "1.4.0-beta.0",
|
|
18
|
+
"@dsh-workbench/adapter-supply": "1.4.0-beta.0",
|
|
19
|
+
"@dsh-workbench/adapter-runtime": "1.4.0-beta.0",
|
|
20
|
+
"@dsh-workbench/shared": "1.4.0-beta.0"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|