@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.
- package/dist/PostgresMeteringStore-CzNv6xil.d.ts +224 -0
- package/dist/app/front/index.d.ts +212 -3
- package/dist/app/front/index.js +820 -44
- package/dist/app/server/index.d.ts +3 -3
- package/dist/app/server/index.js +13 -6
- package/dist/{authHook-DUqyxueY.d.ts → authHook-CzBsMwwM.d.ts} +2 -2
- package/dist/{chunk-C3YMOITB.js → chunk-I56OTSPB.js} +649 -6
- package/dist/{chunk-H5KU6R6Y.js → chunk-LIBHVT7V.js} +5 -1
- package/dist/{chunk-GZVKZD4P.js → chunk-UM5SHYIS.js} +11 -2
- package/dist/{chunk-MLTJKZL4.js → chunk-VYXEXOCO.js} +21 -10
- package/dist/{connection-AL8KSENV.d.ts → connection-C5SiqoNc.d.ts} +1 -1
- package/dist/front/index.d.ts +15 -2
- package/dist/front/index.js +2 -2
- package/dist/server/db/index.d.ts +4 -4
- package/dist/server/db/index.js +6 -2
- package/dist/server/index.d.ts +594 -7
- package/dist/server/index.js +1467 -4
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/{types-CbMOXLBf.d.ts → types-CWtJ4kgd.d.ts} +3 -0
- package/drizzle/0011_usage_metering.sql +57 -0
- package/drizzle/0012_credit_purchases.sql +9 -0
- package/drizzle/0013_credit_purchase_lifecycle.sql +28 -0
- package/drizzle/0014_reservation_charge_on_expire.sql +7 -0
- package/drizzle/meta/_journal.json +28 -0
- package/package.json +4 -4
- package/dist/migrate-B4dwdtGP.d.ts +0 -8
|
@@ -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-
|
|
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-
|
|
8
|
-
import { D as Database, U as UserStore, W as WorkspaceStore } from '../../connection-
|
|
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';
|
package/dist/app/server/index.js
CHANGED
|
@@ -9,20 +9,20 @@ import {
|
|
|
9
9
|
registerRoutes,
|
|
10
10
|
registerSettingsRoutes,
|
|
11
11
|
registerWorkspaceRoutes
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-UM5SHYIS.js";
|
|
13
13
|
import {
|
|
14
14
|
PostgresUserStore,
|
|
15
15
|
PostgresWorkspaceStore,
|
|
16
16
|
createDatabase,
|
|
17
17
|
telemetryEvents
|
|
18
|
-
} from "../../chunk-
|
|
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-
|
|
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
|
|
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-
|
|
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-
|
|
4
|
+
import { W as WorkspaceStore, D as Database } from './connection-C5SiqoNc.js';
|
|
5
5
|
|
|
6
6
|
interface LoadConfigOptions {
|
|
7
7
|
tomlPath?: string;
|