@rivus/gateway 0.22.0 → 0.22.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/bootstrap/feishu.d.ts +3 -6
- package/dist/bootstrap/feishu.js +1889 -1931
- package/dist/chunks/herdr-feishu-runtime.js +65 -65
- package/dist/chunks/rivus-home-deployment-env.js +2 -2
- package/dist/chunks/rivus-node-entrypoint.js +105 -16
- package/dist/index.d.ts +1 -1
- package/package.json +7 -4
|
@@ -5,8 +5,8 @@ import { isAbsolute, join, resolve } from "node:path";
|
|
|
5
5
|
import { chmod, lstat, mkdir, open, readFile, readdir } from "node:fs/promises";
|
|
6
6
|
import { isNodeErrorWithCode } from "@rivus/platform/filesystem";
|
|
7
7
|
import { createConnection } from "node:net";
|
|
8
|
-
import { acquireProcessLock } from "@rivus/agent-kit-collab/process-lock";
|
|
9
8
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
9
|
+
import { acquireProcessLock } from "@rivus/agent-kit-collab/process-lock";
|
|
10
10
|
import { stripVTControlCharacters } from "node:util";
|
|
11
11
|
import { Worker } from "node:worker_threads";
|
|
12
12
|
import { eastAsianWidth } from "get-east-asian-width";
|
|
@@ -70,70 +70,6 @@ var ConversationStateStore = class extends Context.Service()("@rivus/gateway/ter
|
|
|
70
70
|
var TerminalMessageClaims = class extends Context.Service()("@rivus/gateway/terminal-session/TerminalMessageClaims") {};
|
|
71
71
|
var TerminalMessageClaimLookup = class extends Context.Service()("@rivus/gateway/terminal-session/TerminalMessageClaimLookup") {};
|
|
72
72
|
//#endregion
|
|
73
|
-
//#region src/terminal-session/application/services/terminal-session-bindings.ts
|
|
74
|
-
var TerminalBindingPersistenceError = class extends Error {
|
|
75
|
-
constructor(cause) {
|
|
76
|
-
super("Terminal binding snapshot could not be saved", { cause });
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
function createTerminalSessionBindings(options) {
|
|
80
|
-
let bindings = new Map((options.store?.initial ?? []).map((entry) => [entry.handle, entry]));
|
|
81
|
-
const serial = Semaphore.makeUnsafe(1);
|
|
82
|
-
const commit = (candidate) => Effect.gen(function* () {
|
|
83
|
-
if (options.store) yield* options.store.save([...candidate.values()]).pipe(Effect.mapError((cause) => new TerminalBindingPersistenceError(cause)));
|
|
84
|
-
bindings = candidate;
|
|
85
|
-
});
|
|
86
|
-
const insert = (candidate, entry) => {
|
|
87
|
-
candidate.delete(entry.handle);
|
|
88
|
-
candidate.set(entry.handle, entry);
|
|
89
|
-
if (candidate.size > 1e3) candidate.delete(candidate.keys().next().value);
|
|
90
|
-
return entry;
|
|
91
|
-
};
|
|
92
|
-
const fresh = (candidate, message, agent, expires) => {
|
|
93
|
-
let handle = options.newHandle();
|
|
94
|
-
while (candidate.has(handle)) handle = options.newHandle();
|
|
95
|
-
return insert(candidate, {
|
|
96
|
-
handle,
|
|
97
|
-
actorId: message.actorId,
|
|
98
|
-
chatId: message.chatId,
|
|
99
|
-
agent,
|
|
100
|
-
...expires === void 0 ? {} : { expires }
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
return {
|
|
104
|
-
lookup: (handle, message) => serial.withPermits(1)(Effect.uninterruptible(Effect.gen(function* () {
|
|
105
|
-
const binding = bindings.get(handle);
|
|
106
|
-
if (!binding) return { kind: "missing" };
|
|
107
|
-
if (binding.actorId !== message.actorId || binding.chatId !== message.chatId) return { kind: "unauthorized" };
|
|
108
|
-
const candidate = new Map(bindings);
|
|
109
|
-
insert(candidate, binding);
|
|
110
|
-
yield* commit(candidate);
|
|
111
|
-
return {
|
|
112
|
-
kind: "found",
|
|
113
|
-
binding
|
|
114
|
-
};
|
|
115
|
-
}))),
|
|
116
|
-
selections: (message, agents) => serial.withPermits(1)(Effect.uninterruptible(Effect.gen(function* () {
|
|
117
|
-
const candidate = new Map(bindings);
|
|
118
|
-
const selected = agents.map((agent) => {
|
|
119
|
-
const existing = [...candidate.values()].find((entry) => entry.expires === void 0 && entry.actorId === message.actorId && entry.chatId === message.chatId && entry.agent.session === agent.session && entry.agent.pane === agent.pane && entry.agent.identity === agent.identity);
|
|
120
|
-
return existing ? insert(candidate, {
|
|
121
|
-
...existing,
|
|
122
|
-
agent
|
|
123
|
-
}) : fresh(candidate, message, agent);
|
|
124
|
-
});
|
|
125
|
-
if (agents.length) yield* commit(candidate);
|
|
126
|
-
return selected;
|
|
127
|
-
}))),
|
|
128
|
-
form: (message, agent, expires) => serial.withPermits(1)(Effect.uninterruptible(Effect.gen(function* () {
|
|
129
|
-
const candidate = new Map(bindings);
|
|
130
|
-
const binding = fresh(candidate, message, agent, expires);
|
|
131
|
-
yield* commit(candidate);
|
|
132
|
-
return binding;
|
|
133
|
-
})))
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
//#endregion
|
|
137
73
|
//#region src/terminal-session/application/services/conversation-mode.ts
|
|
138
74
|
const stateKey = (actorId, chatId) => `${actorId}\u0000${chatId}`;
|
|
139
75
|
/**
|
|
@@ -313,6 +249,70 @@ function createConversationMode(options) {
|
|
|
313
249
|
};
|
|
314
250
|
}
|
|
315
251
|
//#endregion
|
|
252
|
+
//#region src/terminal-session/application/services/terminal-session-bindings.ts
|
|
253
|
+
var TerminalBindingPersistenceError = class extends Error {
|
|
254
|
+
constructor(cause) {
|
|
255
|
+
super("Terminal binding snapshot could not be saved", { cause });
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
function createTerminalSessionBindings(options) {
|
|
259
|
+
let bindings = new Map((options.store?.initial ?? []).map((entry) => [entry.handle, entry]));
|
|
260
|
+
const serial = Semaphore.makeUnsafe(1);
|
|
261
|
+
const commit = (candidate) => Effect.gen(function* () {
|
|
262
|
+
if (options.store) yield* options.store.save([...candidate.values()]).pipe(Effect.mapError((cause) => new TerminalBindingPersistenceError(cause)));
|
|
263
|
+
bindings = candidate;
|
|
264
|
+
});
|
|
265
|
+
const insert = (candidate, entry) => {
|
|
266
|
+
candidate.delete(entry.handle);
|
|
267
|
+
candidate.set(entry.handle, entry);
|
|
268
|
+
if (candidate.size > 1e3) candidate.delete(candidate.keys().next().value);
|
|
269
|
+
return entry;
|
|
270
|
+
};
|
|
271
|
+
const fresh = (candidate, message, agent, expires) => {
|
|
272
|
+
let handle = options.newHandle();
|
|
273
|
+
while (candidate.has(handle)) handle = options.newHandle();
|
|
274
|
+
return insert(candidate, {
|
|
275
|
+
handle,
|
|
276
|
+
actorId: message.actorId,
|
|
277
|
+
chatId: message.chatId,
|
|
278
|
+
agent,
|
|
279
|
+
...expires === void 0 ? {} : { expires }
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
return {
|
|
283
|
+
lookup: (handle, message) => serial.withPermits(1)(Effect.uninterruptible(Effect.gen(function* () {
|
|
284
|
+
const binding = bindings.get(handle);
|
|
285
|
+
if (!binding) return { kind: "missing" };
|
|
286
|
+
if (binding.actorId !== message.actorId || binding.chatId !== message.chatId) return { kind: "unauthorized" };
|
|
287
|
+
const candidate = new Map(bindings);
|
|
288
|
+
insert(candidate, binding);
|
|
289
|
+
yield* commit(candidate);
|
|
290
|
+
return {
|
|
291
|
+
kind: "found",
|
|
292
|
+
binding
|
|
293
|
+
};
|
|
294
|
+
}))),
|
|
295
|
+
selections: (message, agents) => serial.withPermits(1)(Effect.uninterruptible(Effect.gen(function* () {
|
|
296
|
+
const candidate = new Map(bindings);
|
|
297
|
+
const selected = agents.map((agent) => {
|
|
298
|
+
const existing = [...candidate.values()].find((entry) => entry.expires === void 0 && entry.actorId === message.actorId && entry.chatId === message.chatId && entry.agent.session === agent.session && entry.agent.pane === agent.pane && entry.agent.identity === agent.identity);
|
|
299
|
+
return existing ? insert(candidate, {
|
|
300
|
+
...existing,
|
|
301
|
+
agent
|
|
302
|
+
}) : fresh(candidate, message, agent);
|
|
303
|
+
});
|
|
304
|
+
if (agents.length) yield* commit(candidate);
|
|
305
|
+
return selected;
|
|
306
|
+
}))),
|
|
307
|
+
form: (message, agent, expires) => serial.withPermits(1)(Effect.uninterruptible(Effect.gen(function* () {
|
|
308
|
+
const candidate = new Map(bindings);
|
|
309
|
+
const binding = fresh(candidate, message, agent, expires);
|
|
310
|
+
yield* commit(candidate);
|
|
311
|
+
return binding;
|
|
312
|
+
})))
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
316
|
//#region src/terminal-session/domain/bridge/value-objects/terminal-bridge-model.ts
|
|
317
317
|
var TerminalTargetChangedError = class extends Error {
|
|
318
318
|
constructor() {
|
|
@@ -5,8 +5,8 @@ import { basename, delimiter, dirname, isAbsolute, join, relative, resolve } fro
|
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { access, constants, cp, mkdir, readFile, readdir, rename, rm, stat } from "node:fs/promises";
|
|
7
7
|
import { isNodeErrorWithCode, isPathWithin } from "@rivus/platform/filesystem";
|
|
8
|
-
import { acquireProcessLock } from "@rivus/agent-kit-collab/process-lock";
|
|
9
8
|
import { createHash, randomUUID } from "node:crypto";
|
|
9
|
+
import { acquireProcessLock } from "@rivus/agent-kit-collab/process-lock";
|
|
10
10
|
import { spawn } from "node:child_process";
|
|
11
11
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
12
12
|
//#region src/lib/deep-freeze.ts
|
|
@@ -741,7 +741,7 @@ const gatewayAudioTranscriberAssetDirectory = fileURLToPath(new URL("assets/audi
|
|
|
741
741
|
//#endregion
|
|
742
742
|
//#region src/home/infra/adapters/project/release-descriptor.ts
|
|
743
743
|
const RIVUS_RELEASE_DESCRIPTOR = Object.freeze({
|
|
744
|
-
version: "0.22.
|
|
744
|
+
version: "0.22.1",
|
|
745
745
|
dependencies: Object.freeze({
|
|
746
746
|
"@earendil-works/pi-coding-agent": "0.84.4",
|
|
747
747
|
"@larksuiteoapi/node-sdk": "1.74.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as loadMergedLocalEnvFile, C as loadRivusDeploymentManifest, D as gatewayPackageManifestPath, E as gatewayPackageDirectory, F as validateRivusDeploymentManifest, I as validateRivusProjectSpaceDeployment, L as createBackgroundSessionToolContracts, M as resolveFeishuEndpointCredentials, N as InvalidRivusProjectSpace, P as parseRivusDeploymentManifest, R as narrowBackgroundSessionDefinition, S as renderRivusModelCliHelp, T as gatewayAudioTranscriberAssetDirectory, b as parseRivusModelCliArguments, c as readRivusAudioStatus, d as invokeRuntimeControl, g as createRivusModelManagementWireRequest, i as runRivusAudioProcess, j as resolveAcpRuntimeEnvironment, k as gatewayTemplateDirectory, l as createRuntimeCache, n as withoutRivusHomeDeployment, o as installRivusAudioTranscriber, p as parseRivusModelManagementEnabled, r as runRivusAudioPassthroughProcess, s as readRivusAudioInstalledRelease, t as RIVUS_HOME_DEPLOYMENT_ENV, u as disposeRuntimeCacheEntries, w as RIVUS_RELEASE_DESCRIPTOR, x as renderRivusModelCliArgumentError, z as deepFreeze } from "./rivus-home-deployment-env.js";
|
|
2
2
|
import { t as decodeFeishuReceiveMessage } from "./feishu-receive-message.js";
|
|
3
|
-
import { createRequire, findPackageJSON } from "node:module";
|
|
3
|
+
import { createRequire, findPackageJSON, registerHooks } from "node:module";
|
|
4
4
|
import { createSha256Digest, createStableId } from "@rivus/platform/identity";
|
|
5
5
|
import { Cause, Context, Deferred, Effect, Exit, Layer, Option, Result, Schema, SchemaIssue, Semaphore } from "effect";
|
|
6
6
|
import { RIVUS_MEMORY_TOOL_PLUGIN_ID, RIVUS_RUNTIME_TOOL_IDS, createRivusMemoryToolContract, isRivusRuntimeToolId } from "@rivus/runtime";
|
|
@@ -13,9 +13,9 @@ import { createNodePlatform } from "@rivus/agent-kit/node";
|
|
|
13
13
|
import { access, chmod, constants, copyFile, link, lstat, mkdir, open, readFile, readdir, realpath, rename, rm, rmdir, stat, symlink, unlink, writeFile } from "node:fs/promises";
|
|
14
14
|
import { assertPathWithin, isNodeErrorWithCode, isPathWithin } from "@rivus/platform/filesystem";
|
|
15
15
|
import { createConnection } from "node:net";
|
|
16
|
-
import { acquireProcessLock } from "@rivus/agent-kit-collab/process-lock";
|
|
17
16
|
import { randomUUID } from "node:crypto";
|
|
18
|
-
import {
|
|
17
|
+
import { acquireProcessLock } from "@rivus/agent-kit-collab/process-lock";
|
|
18
|
+
import { constants as constants$1, realpathSync } from "node:fs";
|
|
19
19
|
import { spawn } from "node:child_process";
|
|
20
20
|
import { isDeepStrictEqual } from "node:util";
|
|
21
21
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
@@ -1946,11 +1946,11 @@ function checkModules(home, manifest, resolveModule, resolvePluginModule) {
|
|
|
1946
1946
|
if (result._tag === "Failure") missing.push(`${plugin.module} (${formatError(result.failure)})`);
|
|
1947
1947
|
}
|
|
1948
1948
|
return missing.length === 0 ? {
|
|
1949
|
-
message: "Bootstrap, Plugin, runtime, and Feishu modules resolve
|
|
1949
|
+
message: "Bootstrap, Plugin, runtime, and Feishu modules resolve; run check-config --load-plugins to import them",
|
|
1950
1950
|
name: "modules",
|
|
1951
1951
|
status: "pass"
|
|
1952
1952
|
} : {
|
|
1953
|
-
message: `
|
|
1953
|
+
message: `modules are unavailable: ${missing.join(", ")}`,
|
|
1954
1954
|
name: "modules",
|
|
1955
1955
|
status: "fail"
|
|
1956
1956
|
};
|
|
@@ -2322,6 +2322,95 @@ function isRivusModelManagementEnabled(env) {
|
|
|
2322
2322
|
return value === "1" || value === "true";
|
|
2323
2323
|
}
|
|
2324
2324
|
//#endregion
|
|
2325
|
+
//#region src/bootstrap/cli/release-package-resolution.ts
|
|
2326
|
+
/**
|
|
2327
|
+
* Packages the running release provides to every module in the process. Rivus classes, services and Effect values
|
|
2328
|
+
* are compared by identity (`instanceof`, Context keys, fiber internals), so a process may hold only one copy of each.
|
|
2329
|
+
*/
|
|
2330
|
+
const RELEASE_PACKAGES = [
|
|
2331
|
+
"@rivus/agent",
|
|
2332
|
+
"@rivus/gateway",
|
|
2333
|
+
"@rivus/runtime",
|
|
2334
|
+
"@rivus/platform",
|
|
2335
|
+
"effect"
|
|
2336
|
+
];
|
|
2337
|
+
let installed = false;
|
|
2338
|
+
let resolvingReleasePackage = false;
|
|
2339
|
+
/** Returns the release package a bare specifier names, such as `effect` for `effect/Schema`. */
|
|
2340
|
+
function releasePackageOf(specifier) {
|
|
2341
|
+
return RELEASE_PACKAGES.find((name) => specifier === name || specifier.startsWith(`${name}/`));
|
|
2342
|
+
}
|
|
2343
|
+
function copyOutsideRoots(path, releaseRoots) {
|
|
2344
|
+
const segments = path.split(sep);
|
|
2345
|
+
return RELEASE_PACKAGES.find((name) => {
|
|
2346
|
+
const nameSegments = name.split("/");
|
|
2347
|
+
const found = segments.some((segment, index) => segment === "node_modules" && nameSegments.every((part, offset) => segments[index + 1 + offset] === part) && index + nameSegments.length + 1 < segments.length);
|
|
2348
|
+
const root = releaseRoots.get(name);
|
|
2349
|
+
return found && (root === void 0 || !isPathWithin(root, path));
|
|
2350
|
+
});
|
|
2351
|
+
}
|
|
2352
|
+
/**
|
|
2353
|
+
* Returns the release package whose installed copy contains `path` when that copy is not the running one. A copy is
|
|
2354
|
+
* recognized by its `node_modules/<name>/` directory, which also matches pnpm's `.pnpm/.../node_modules/<name>/`.
|
|
2355
|
+
* A match is rechecked by real path, because `--preserve-symlinks` reports files of the running copy by link paths
|
|
2356
|
+
* while the running roots are real paths.
|
|
2357
|
+
*/
|
|
2358
|
+
function foreignReleasePackageOf(path, releaseRoots) {
|
|
2359
|
+
if (!copyOutsideRoots(path, releaseRoots)) return;
|
|
2360
|
+
try {
|
|
2361
|
+
return copyOutsideRoots(realpathSync(path), releaseRoots);
|
|
2362
|
+
} catch {
|
|
2363
|
+
return copyOutsideRoots(path, releaseRoots);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
function releaseRoots() {
|
|
2367
|
+
const roots = /* @__PURE__ */ new Map();
|
|
2368
|
+
for (const name of RELEASE_PACKAGES) try {
|
|
2369
|
+
const manifest = findPackageJSON(name, import.meta.url);
|
|
2370
|
+
if (manifest) roots.set(name, realpathSync(dirname(manifest)));
|
|
2371
|
+
} catch {}
|
|
2372
|
+
return roots;
|
|
2373
|
+
}
|
|
2374
|
+
function describeParent(parentURL) {
|
|
2375
|
+
return parentURL?.startsWith("file:") ? fileURLToPath(parentURL) : parentURL ?? "the process entry";
|
|
2376
|
+
}
|
|
2377
|
+
/**
|
|
2378
|
+
* Makes every module the process loads, including Home Bootstrap modules, Home Plugins and their own dependencies,
|
|
2379
|
+
* use the running release's copy of the release packages, as if they were peer dependencies. A bare import resolves
|
|
2380
|
+
* from this Gateway; a file path into another installed copy fails and names the importing module. `require` callers
|
|
2381
|
+
* receive the same ESM entry as importers, so CommonJS and ESM share one instance.
|
|
2382
|
+
*/
|
|
2383
|
+
function installReleasePackageResolution() {
|
|
2384
|
+
if (installed) return;
|
|
2385
|
+
installed = true;
|
|
2386
|
+
const roots = releaseRoots();
|
|
2387
|
+
const resolve = (specifier, context, nextResolve) => {
|
|
2388
|
+
if (resolvingReleasePackage) return nextResolve(specifier, context);
|
|
2389
|
+
if (releasePackageOf(specifier)) {
|
|
2390
|
+
resolvingReleasePackage = true;
|
|
2391
|
+
try {
|
|
2392
|
+
return {
|
|
2393
|
+
shortCircuit: true,
|
|
2394
|
+
url: import.meta.resolve(specifier)
|
|
2395
|
+
};
|
|
2396
|
+
} catch (error) {
|
|
2397
|
+
throw new Error(`${describeParent(context.parentURL)} imports ${specifier}, which the running Rivus installation does not provide`, { cause: error });
|
|
2398
|
+
} finally {
|
|
2399
|
+
resolvingReleasePackage = false;
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
const resolved = nextResolve(specifier, context);
|
|
2403
|
+
const path = resolved.url.startsWith("file:") ? fileURLToPath(resolved.url) : void 0;
|
|
2404
|
+
const foreign = path === void 0 ? void 0 : foreignReleasePackageOf(path, roots);
|
|
2405
|
+
if (foreign) {
|
|
2406
|
+
const root = roots.get(foreign);
|
|
2407
|
+
throw new Error(`${describeParent(context.parentURL)} loads ${foreign} from ${path}, outside the running Rivus installation${root ? ` (${root})` : ""}; import ${foreign} by package name so the running release provides it`);
|
|
2408
|
+
}
|
|
2409
|
+
return resolved;
|
|
2410
|
+
};
|
|
2411
|
+
registerHooks({ resolve });
|
|
2412
|
+
}
|
|
2413
|
+
//#endregion
|
|
2325
2414
|
//#region src/cli/domain/cli/value-objects/rivus-cli-protocol.ts
|
|
2326
2415
|
const RIVUS_CLI_USAGE = `Usage:
|
|
2327
2416
|
rivus setup [directory]
|
|
@@ -3893,9 +3982,12 @@ function checkDeploymentPlugins(input) {
|
|
|
3893
3982
|
}
|
|
3894
3983
|
//#endregion
|
|
3895
3984
|
//#region src/bootstrap/daemon/rivus-daemon-cli.ts
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
return
|
|
3985
|
+
function loadDeploymentFactory(options, specifier) {
|
|
3986
|
+
const loadBootstrap = options.loadBootstrap ?? ((module) => import(module));
|
|
3987
|
+
return Effect.tryPromise({
|
|
3988
|
+
try: () => loadBootstrap(specifier),
|
|
3989
|
+
catch: (error) => error
|
|
3990
|
+
}).pipe(Effect.flatMap(({ createRivusDeploymentAdapters }) => createRivusDeploymentAdapters ? Effect.succeed(createRivusDeploymentAdapters) : Effect.fail(/* @__PURE__ */ new Error("Manifest bootstrap module must export createRivusDeploymentAdapters(context)"))));
|
|
3899
3991
|
}
|
|
3900
3992
|
function runOneShotDaemon(daemon, action) {
|
|
3901
3993
|
return Effect.exit(Effect.suspend(action)).pipe(Effect.flatMap((exit) => daemon.stop().pipe(Effect.flatMap(() => exit._tag === "Success" ? Effect.succeed(exit.value) : Effect.failCause(exit.cause)))));
|
|
@@ -3992,6 +4084,7 @@ function runRivusDaemonCli(options) {
|
|
|
3992
4084
|
try: () => validateRivusDeploymentManifest(manifest),
|
|
3993
4085
|
catch: (error) => error
|
|
3994
4086
|
});
|
|
4087
|
+
if (options.checkPlugins && bootstrapSpecifier) yield* loadDeploymentFactory(options, bootstrapSpecifier);
|
|
3995
4088
|
options.stdout.write(formatRivusDaemonJson(toRedactedDeploymentManifest(manifest)));
|
|
3996
4089
|
return 0;
|
|
3997
4090
|
}
|
|
@@ -3999,13 +4092,9 @@ function runRivusDaemonCli(options) {
|
|
|
3999
4092
|
options.stderr.write(formatRivusDaemonUsageError("Missing --bootstrap <module> or RIVUS_BOOTSTRAP_MODULE"));
|
|
4000
4093
|
return 1;
|
|
4001
4094
|
}
|
|
4002
|
-
const
|
|
4003
|
-
const module = yield* Effect.tryPromise({
|
|
4004
|
-
try: () => loadBootstrap(bootstrapSpecifier),
|
|
4005
|
-
catch: (error) => error
|
|
4006
|
-
});
|
|
4095
|
+
const factory = yield* loadDeploymentFactory(options, bootstrapSpecifier);
|
|
4007
4096
|
const daemon = yield* Effect.tryPromise({
|
|
4008
|
-
try: () =>
|
|
4097
|
+
try: () => createRivusDeploymentCliProcess(factory, {
|
|
4009
4098
|
argv: options.argv,
|
|
4010
4099
|
env,
|
|
4011
4100
|
...parsed.envFilePath ? { envFilePath: parsed.envFilePath } : {},
|
|
@@ -6075,7 +6164,7 @@ function toImportSpecifier(specifier) {
|
|
|
6075
6164
|
return specifier;
|
|
6076
6165
|
}
|
|
6077
6166
|
function runRivusNodeEntrypoint(options) {
|
|
6078
|
-
return runRivusCli({
|
|
6167
|
+
return Effect.sync(installReleasePackageResolution).pipe(Effect.andThen(() => runRivusCli({
|
|
6079
6168
|
argv: options.argv,
|
|
6080
6169
|
changeWorkingDirectory: options.changeWorkingDirectory,
|
|
6081
6170
|
cwd: options.cwd,
|
|
@@ -6100,7 +6189,7 @@ function runRivusNodeEntrypoint(options) {
|
|
|
6100
6189
|
signalSource: options.signalSource,
|
|
6101
6190
|
stderr: options.stderr,
|
|
6102
6191
|
stdout: options.stdout
|
|
6103
|
-
});
|
|
6192
|
+
})));
|
|
6104
6193
|
}
|
|
6105
6194
|
//#endregion
|
|
6106
6195
|
export { RIVUS_PLUGIN_API_VERSION as i, createRivusPluginCatalog as n, resolveRivusAgentDefinition as r, runRivusNodeEntrypoint as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { a as RivusHome, i as RivusHomeApi, n as RivusDeploymentBootstrapFactory
|
|
|
2
2
|
import { A as AutomationLineChart, C as AutomationPresentationSection, D as AutomationPresentationTableColumn, E as AutomationPresentationTableCell, O as AutomationPresentationTrend, S as AutomationPresentationKind, T as AutomationPresentationTable, a as RivusAutomationInput, b as AutomationPresentation, c as RivusAutomationTickContext, d as RivusPluginRegistry, f as RIVUS_PLUGIN_API_VERSION, g as RivusAgentProfile, h as RivusAgentDeployment, k as readAutomationPresentation, l as RivusPlugin, m as ResolvedRivusAgentDefinition, o as RivusAutomationOutput, p as RivusPluginManifest, s as RivusAutomationTemplate, u as RivusPluginCatalog, v as RivusAutomationRetryPolicy, w as AutomationPresentationSource, x as AutomationPresentationItem } from "./chunks/public.js";
|
|
3
3
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
4
|
import "@rivus/runtime";
|
|
5
|
-
import { ProcessLockPlatform } from "@rivus/agent-kit-collab/process-lock";
|
|
6
5
|
import { createPiModelRuntime } from "@rivus/runtime/pi";
|
|
6
|
+
import { ProcessLockPlatform } from "@rivus/agent-kit-collab/process-lock";
|
|
7
7
|
//#region src/automation/domain/automation-occurrence/errors/rivus-automation-failure.d.ts
|
|
8
8
|
export declare class RivusAutomationFailure extends Error {
|
|
9
9
|
readonly name = "RivusAutomationFailure";
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivus/gateway",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "Message gateway, channels, host binding, automation, and daemon assembly for Rivus.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"sideEffects":
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"./dist/cli.js",
|
|
8
|
+
"./dist/mcp.js"
|
|
9
|
+
],
|
|
7
10
|
"license": "GPL-3.0-only",
|
|
8
11
|
"engines": {
|
|
9
12
|
"node": "^24.11.0"
|
|
@@ -60,8 +63,8 @@
|
|
|
60
63
|
"@resvg/resvg-js": "2.6.2",
|
|
61
64
|
"@rivus/agent-kit": "0.24.0",
|
|
62
65
|
"@rivus/agent-kit-collab": "0.24.0",
|
|
63
|
-
"@rivus/platform": "0.22.
|
|
64
|
-
"@rivus/runtime": "0.22.
|
|
66
|
+
"@rivus/platform": "0.22.1",
|
|
67
|
+
"@rivus/runtime": "0.22.1",
|
|
65
68
|
"axios": "1.20.0",
|
|
66
69
|
"effect": "4.1.1",
|
|
67
70
|
"get-east-asian-width": "1.7.0",
|