@dsh-workbench/adapters-default 1.3.2 → 1.4.0-beta.1
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 +32 -3
- 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, opencliBrowserCaptureOf, installedOpencliVersion, opencliResultOf, sessionDialectOf, 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];
|
|
@@ -92,7 +93,9 @@ export function createRuntimePort() {
|
|
|
92
93
|
invoke: (site, command) => command === undefined || command === '' ? `opencli ${site}` : `opencli ${site} ${command}`,
|
|
93
94
|
help: (site) => `opencli ${site} --help`,
|
|
94
95
|
browser: (verb) => `opencli browser ${verb.join(' ')}`,
|
|
95
|
-
|
|
96
|
+
commandResult: (stdout) => opencliResultOf(stdout),
|
|
97
|
+
browserCapture: (text) => opencliBrowserCaptureOf(text),
|
|
98
|
+
background: (command, argv) => backgroundLine(command, argv, { dialect: sessionDialectOf(installedOpencliVersion()) }),
|
|
96
99
|
authorHint: 'opencli skills read opencli-adapter-author',
|
|
97
100
|
};
|
|
98
101
|
},
|
|
@@ -107,7 +110,32 @@ export function createRuntimePort() {
|
|
|
107
110
|
};
|
|
108
111
|
},
|
|
109
112
|
health(ctx) {
|
|
110
|
-
|
|
113
|
+
const versions = opencliVersionReport();
|
|
114
|
+
const bridge = lastBridgeFacts();
|
|
115
|
+
const ready = opencliHandshakeOk(versions);
|
|
116
|
+
const note = ready ? undefined : opencliHandshakeNote(versions);
|
|
117
|
+
return {
|
|
118
|
+
opencli: {
|
|
119
|
+
...opencliCommandOf(ctx),
|
|
120
|
+
versions,
|
|
121
|
+
handshake: { ok: ready, detail: opencliHandshakeText(versions) },
|
|
122
|
+
...(versions.cli === undefined && versions.pin === '' ? {} : { version: versions.cli ?? versions.pin }),
|
|
123
|
+
ready,
|
|
124
|
+
...(note === undefined ? {} : { note }),
|
|
125
|
+
...(bridge === undefined ? {} : { bridge }),
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
versionReport() {
|
|
130
|
+
return opencliVersionReport();
|
|
131
|
+
},
|
|
132
|
+
async frontApp(ctx) {
|
|
133
|
+
const seam = seamOf(ctx);
|
|
134
|
+
return seam === undefined ? undefined : rememberFrontApp(seam, opencliCommandOf(ctx).command);
|
|
135
|
+
},
|
|
136
|
+
async bringToFront(ctx, app) {
|
|
137
|
+
const seam = seamOf(ctx);
|
|
138
|
+
return seam === undefined ? false : restoreFocus(seam, opencliCommandOf(ctx).command, app);
|
|
111
139
|
},
|
|
112
140
|
seed(ctx, options) {
|
|
113
141
|
const root = runtimeSeedRootOf(ctx);
|
|
@@ -121,6 +149,7 @@ export function createRuntimePort() {
|
|
|
121
149
|
for (const file of seedRuntimeFiles({ root, home, packageRoot, log }))
|
|
122
150
|
log(`自举写下 ${file}`);
|
|
123
151
|
ensureLibsOpencliPeer();
|
|
152
|
+
ensureVendorOpencliPeer();
|
|
124
153
|
for (const dir of prependRuntimePath(paths))
|
|
125
154
|
log(`PATH 前插 ${dir}`);
|
|
126
155
|
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.1",
|
|
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-runtime": "1.
|
|
19
|
-
"@dsh-workbench/
|
|
20
|
-
"@dsh-workbench/
|
|
16
|
+
"@dsh-workbench/adapter-probe": "1.4.0-beta.1",
|
|
17
|
+
"@dsh-workbench/adapter-profile": "1.4.0-beta.1",
|
|
18
|
+
"@dsh-workbench/adapter-runtime": "1.4.0-beta.1",
|
|
19
|
+
"@dsh-workbench/adapter-supply": "1.4.0-beta.1",
|
|
20
|
+
"@dsh-workbench/shared": "1.4.0-beta.1"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|