@hachej/boring-core 0.1.42 → 0.1.43

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.
@@ -2,10 +2,10 @@ import { RuntimeProvisioningContribution, RegisterAgentRoutesOptions } from '@ha
2
2
  import { DirPluginEntry, CreateWorkspaceAgentServerOptions } from '@hachej/boring-workspace/app/server';
3
3
  import { WorkspaceServerPlugin } from '@hachej/boring-workspace/server';
4
4
  import { FastifyInstance } from 'fastify';
5
- import { C as CoreConfig } from '../../types-CbMOXLBf.js';
5
+ import { C as CoreConfig } from '../../types-CWtJ4kgd.js';
6
6
  import { TelemetrySink } from '../../shared/index.js';
7
- import { B as BetterAuthInstance, L as LoadConfigOptions } from '../../authHook-DUqyxueY.js';
8
- import { D as Database, U as UserStore, W as WorkspaceStore } from '../../connection-AL8KSENV.js';
7
+ import { B as BetterAuthInstance, L as LoadConfigOptions } from '../../authHook-CzBsMwwM.js';
8
+ import { D as Database, U as UserStore, W as WorkspaceStore } from '../../connection-C5SiqoNc.js';
9
9
  import { IncomingMessage, ServerResponse } from 'node:http';
10
10
  import 'better-auth';
11
11
  import 'drizzle-orm/postgres-js';
@@ -9,20 +9,20 @@ import {
9
9
  registerRoutes,
10
10
  registerSettingsRoutes,
11
11
  registerWorkspaceRoutes
12
- } from "../../chunk-GZVKZD4P.js";
12
+ } from "../../chunk-UM5SHYIS.js";
13
13
  import {
14
14
  PostgresUserStore,
15
15
  PostgresWorkspaceStore,
16
16
  createDatabase,
17
17
  telemetryEvents
18
- } from "../../chunk-C3YMOITB.js";
18
+ } from "../../chunk-I56OTSPB.js";
19
19
  import {
20
20
  noopTelemetry,
21
21
  safeCapture
22
22
  } from "../../chunk-AQBXNPMD.js";
23
23
  import {
24
24
  ERROR_CODES
25
- } from "../../chunk-H5KU6R6Y.js";
25
+ } from "../../chunk-LIBHVT7V.js";
26
26
  import "../../chunk-MLKGABMK.js";
27
27
 
28
28
  // src/app/server/createCoreWorkspaceAgentServer.ts
@@ -31,6 +31,7 @@ import { createReadStream } from "fs";
31
31
  import path from "path";
32
32
  import {
33
33
  compactPiPackages,
34
+ createRemoteWorkerModeAdapter,
34
35
  provisionWorkspaceRuntime,
35
36
  registerAgentRoutes
36
37
  } from "@hachej/boring-agent/server";
@@ -578,7 +579,8 @@ async function createCoreWorkspaceAgentServer(options = {}) {
578
579
  pluginResolveContext
579
580
  ))
580
581
  );
581
- const installPluginAuthoring = options.installPluginAuthoring === true;
582
+ const externalPluginsEnabled = options.externalPlugins !== false;
583
+ const installPluginAuthoring = externalPluginsEnabled && options.installPluginAuthoring === true;
582
584
  const pluginCollection = collectWorkspaceAgentServerPlugins({
583
585
  workspaceRoot: pluginWorkspaceRoot,
584
586
  systemPromptAppend: staticSystemPromptAppend,
@@ -592,6 +594,8 @@ async function createCoreWorkspaceAgentServer(options = {}) {
592
594
  const root = options.getWorkspaceRoot ? await options.getWorkspaceRoot(workspaceId, request) : await resolveWorkspaceRoot(workspaceRoot, workspaceId);
593
595
  return root;
594
596
  };
597
+ const workerBaseUrl = process.env.BORING_WORKER_BASE_URL?.trim();
598
+ const remoteWorkerModeAdapter = workerBaseUrl ? createRemoteWorkerModeAdapter({ baseUrl: workerBaseUrl }) : void 0;
595
599
  const piOptionsByRoot = /* @__PURE__ */ new Map();
596
600
  const getPluginPiOptions = (root) => {
597
601
  const resolvedRoot = path.resolve(root);
@@ -613,7 +617,7 @@ async function createCoreWorkspaceAgentServer(options = {}) {
613
617
  return scopedPluginCollection.agentOptions.pi;
614
618
  };
615
619
  const resolvePiOptions = async (ctx) => {
616
- const pluginOptions = getPluginPiOptions(ctx.workspaceRoot);
620
+ const pluginOptions = remoteWorkerModeAdapter ? pluginCollection.agentOptions.pi : getPluginPiOptions(ctx.workspaceRoot);
617
621
  const callerOptions = options.getPi ? await options.getPi(ctx) : void 0;
618
622
  return mergePiOptions(pluginOptions, callerOptions);
619
623
  };
@@ -623,6 +627,8 @@ async function createCoreWorkspaceAgentServer(options = {}) {
623
627
  templatePath: options.templatePath,
624
628
  getTemplatePath: options.getTemplatePath,
625
629
  mode: options.mode,
630
+ externalPlugins: externalPluginsEnabled,
631
+ runtimeModeAdapter: remoteWorkerModeAdapter,
626
632
  version: options.version,
627
633
  extraTools: [
628
634
  ...options.extraTools ?? [],
@@ -665,7 +671,8 @@ async function createCoreWorkspaceAgentServer(options = {}) {
665
671
  },
666
672
  provisionWorkspace: options.provisionWorkspace,
667
673
  registerHealthRoute: options.registerHealthRoute ?? false,
668
- telemetry
674
+ telemetry,
675
+ metering: options.metering
669
676
  });
670
677
  await app.register(uiRoutes, {
671
678
  getWorkspaceId: resolveWorkspaceId,
@@ -1,7 +1,7 @@
1
- import { C as CoreConfig, R as RuntimeConfig } from './types-CbMOXLBf.js';
1
+ import { C as CoreConfig, R as RuntimeConfig } from './types-CWtJ4kgd.js';
2
2
  import { FastifyPluginAsync } from 'fastify';
3
3
  import { Auth } from 'better-auth';
4
- import { W as WorkspaceStore, D as Database } from './connection-AL8KSENV.js';
4
+ import { W as WorkspaceStore, D as Database } from './connection-C5SiqoNc.js';
5
5
 
6
6
  interface LoadConfigOptions {
7
7
  tomlPath?: string;