@dsh-workbench/adapters-default 1.5.2 → 1.5.3

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,5 +1,5 @@
1
1
  import { ADAPTER_SET_API_VERSION, runningVersionOf, seamOf } from '@dsh-workbench/shared/host';
2
- import { createCommandReader, createDataReader, createGitReader, createLibReader, opencliCommandOf, sessionStateDir, } from '@dsh-workbench/adapter-runtime';
2
+ import { createCommandReader, createDataReader, createGitReader, createLibReader, installedOpencliVersion, opencliCommandOf, sessionDialectOf, 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
+ dialectOf: () => sessionDialectOf(installedOpencliVersion()),
50
51
  sessionRegistryDir: sessionStateDir(),
51
52
  ...(onQueue === undefined ? {} : { onQueue }),
52
53
  ...(saveBytes === undefined ? {} : { saveBytes }),
@@ -1,5 +1,9 @@
1
1
  import type { RuntimePort } from '@dsh-workbench/shared/host';
2
+ import { type BrowserExtensionOptions } from '@dsh-workbench/adapter-runtime';
2
3
  import { runtimeSeedPaths } from '@dsh-workbench/adapter-probe';
3
4
  export declare function runtimePathDirs(paths: ReturnType<typeof runtimeSeedPaths>): readonly string[];
4
5
  export declare function prependRuntimePath(paths: ReturnType<typeof runtimeSeedPaths>, env?: NodeJS.ProcessEnv): readonly string[];
5
- export declare function createRuntimePort(): RuntimePort;
6
+ export interface RuntimePortOptions {
7
+ readonly extension?: BrowserExtensionOptions | undefined;
8
+ }
9
+ export declare function createRuntimePort(options?: RuntimePortOptions): RuntimePort;
@@ -1,7 +1,7 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { dirname, join } from 'node:path';
3
3
  import { packageRootOf, seamOf } from '@dsh-workbench/shared/host';
4
- import { backgroundLine, libsBinDir } from '@dsh-workbench/adapter-runtime';
4
+ import { backgroundLine, browserExtensionOf, libsBinDir } from '@dsh-workbench/adapter-runtime';
5
5
  import { platformName } from '@dsh-workbench/adapter-probe';
6
6
  import { lastBridgeFacts, raiseBrowser, rememberFrontApp, restoreFocus } from '@dsh-workbench/adapter-probe';
7
7
  import { ensureLibsOpencliPeer, ensureVendorOpencliPeer, opencliBrowserCaptureOf, installedOpencliVersion, opencliResultOf, sessionDialectOf, opencliCommandOf, opencliHandshakeOk, opencliHandshakeNote, opencliHandshakeText, opencliRunnerOf, opencliVersionReport, } from '@dsh-workbench/adapter-runtime';
@@ -18,7 +18,7 @@ export function prependRuntimePath(paths, env = process.env) {
18
18
  return added;
19
19
  }
20
20
  const OPENCLI_RUNNER_TIMEOUT_MS = 30 * 60_000;
21
- export function createRuntimePort() {
21
+ export function createRuntimePort(options = {}) {
22
22
  return {
23
23
  packageRoot: packageRootOf,
24
24
  platformName() {
@@ -145,6 +145,12 @@ export function createRuntimePort() {
145
145
  const seam = seamOf(ctx);
146
146
  return seam === undefined ? false : raiseBrowser(seam);
147
147
  },
148
+ browserExtension(ctx) {
149
+ const warn = ctx.logger?.warn;
150
+ const log = options.extension?.log ??
151
+ (warn === undefined ? undefined : (message) => warn.call(ctx.logger, message));
152
+ return browserExtensionOf({ ...options.extension, ...(log === undefined ? {} : { log }) });
153
+ },
148
154
  seed(ctx, options) {
149
155
  const root = runtimeSeedRootOf(ctx);
150
156
  if (root === null)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/adapters-default",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
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.5.2",
17
- "@dsh-workbench/adapter-supply": "1.5.2",
18
- "@dsh-workbench/adapter-profile": "1.5.2",
19
- "@dsh-workbench/shared": "1.5.2",
20
- "@dsh-workbench/adapter-runtime": "1.5.2"
16
+ "@dsh-workbench/adapter-probe": "1.5.3",
17
+ "@dsh-workbench/adapter-profile": "1.5.3",
18
+ "@dsh-workbench/adapter-runtime": "1.5.3",
19
+ "@dsh-workbench/adapter-supply": "1.5.3",
20
+ "@dsh-workbench/shared": "1.5.3"
21
21
  },
22
22
  "publishConfig": {
23
23
  "access": "public"