negotium 0.2.4 → 0.2.6
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/agent-helpers.js +241 -127
- package/dist/agent-helpers.js.map +19 -19
- package/dist/background-bash.js +1 -3
- package/dist/background-bash.js.map +4 -4
- package/dist/browser-runtime.js +1 -3
- package/dist/browser-runtime.js.map +4 -4
- package/dist/{chunk-1s9ryz8g.js → chunk-qmbcbhyy.js} +20 -12
- package/dist/chunk-qmbcbhyy.js.map +35 -0
- package/dist/hosted-agent.js +13 -10
- package/dist/hosted-agent.js.map +10 -10
- package/dist/main.js +607 -438
- package/dist/main.js.map +30 -29
- package/dist/mcp-factories.js +238 -123
- package/dist/mcp-factories.js.map +18 -18
- package/dist/prompts.js +1 -3
- package/dist/prompts.js.map +4 -4
- package/dist/query-runtime.js +1 -3
- package/dist/query-runtime.js.map +5 -5
- package/dist/registry.js +3 -3
- package/dist/registry.js.map +2 -2
- package/dist/rollout.js +1 -1
- package/dist/runtime/src/agents/api-topic-agent-switch.ts +6 -12
- package/dist/runtime/src/agents/claude-provider.ts +2 -2
- package/dist/runtime/src/agents/codex-provider.ts +1 -0
- package/dist/runtime/src/agents/index.ts +19 -14
- package/dist/runtime/src/agents/maestro-provider.ts +1 -1
- package/dist/runtime/src/agents/rollout/codex.ts +25 -18
- package/dist/runtime/src/agents/self-config-core.ts +2 -4
- package/dist/runtime/src/agents/topic-agent-switch.ts +4 -10
- package/dist/runtime/src/application/submit-runtime-gateway-turn.ts +91 -19
- package/dist/runtime/src/application/switch-topic-model.ts +7 -10
- package/dist/runtime/src/index.ts +4 -0
- package/dist/runtime/src/mcp/wiki-server.ts +19 -12
- package/dist/runtime/src/platform/config.ts +0 -2
- package/dist/runtime/src/platform/log-rotation.ts +45 -0
- package/dist/runtime/src/platform/mcp-config.ts +9 -3
- package/dist/runtime/src/query/active-rooms.ts +7 -1
- package/dist/runtime/src/runtime/errors.ts +1 -0
- package/dist/runtime/src/runtime/turn-event-stream.ts +46 -1
- package/dist/runtime/src/runtime/turn-runner.ts +176 -100
- package/dist/runtime/src/runtime/user-turn-envelope.ts +19 -0
- package/dist/runtime/src/storage/runtime-gateway-submissions.ts +32 -3
- package/dist/runtime/src/storage/runtime-turn-requests.ts +68 -7
- package/dist/runtime/src/types.ts +2 -0
- package/dist/runtime/src/version.ts +1 -1
- package/dist/runtime-helpers.js +1 -3
- package/dist/runtime-helpers.js.map +4 -4
- package/dist/storage.js.map +1 -1
- package/dist/types/packages/core/src/agents/api-topic-agent-switch.d.ts +1 -1
- package/dist/types/packages/core/src/agents/self-config-core.d.ts +1 -1
- package/dist/types/packages/core/src/platform/config.d.ts +0 -1
- package/dist/types/packages/core/src/platform/mcp-config.d.ts +3 -0
- package/dist/types/packages/core/src/query/active-rooms.d.ts +7 -1
- package/dist/types/packages/core/src/runtime/turn-runner.d.ts +42 -1
- package/dist/types/packages/core/src/runtime/user-turn-envelope.d.ts +7 -0
- package/dist/types/packages/core/src/storage/runtime-turn-requests.d.ts +17 -0
- package/dist/types/packages/core/src/types.d.ts +2 -0
- package/dist/types/packages/core/src/version.d.ts +1 -1
- package/dist/vault.js +1 -3
- package/dist/vault.js.map +4 -4
- package/package.json +1 -1
- package/dist/chunk-1s9ryz8g.js.map +0 -35
package/dist/hosted-agent.js
CHANGED
|
@@ -119,7 +119,6 @@ var BROWSER_DIR = resolveLocalStateDir("NEGOTIUM_BROWSER_DIR", "browser");
|
|
|
119
119
|
var BROWSER_PROFILES_DIR = resolve(BROWSER_DIR, "profiles");
|
|
120
120
|
var BINARIES_DIR = resolve(STATE_DIR, "binaries");
|
|
121
121
|
var SECRETS_DIR = resolve(STATE_DIR, "secrets");
|
|
122
|
-
var CONTEXTS_DIR = resolve(STATE_DIR, "data", "contexts");
|
|
123
122
|
var DM_WORKSPACE_DIR = resolve(STATE_DIR, "data", "dm");
|
|
124
123
|
var SESSION_WORKSPACE_DIR = resolve(STATE_DIR, "data", "sessions");
|
|
125
124
|
var CLAUDE_EXECUTABLE_ENV = envText("NEGOTIUM_CLAUDE_EXECUTABLE");
|
|
@@ -268,7 +267,6 @@ mkdirSync(WORKSPACE_DIR, { recursive: true });
|
|
|
268
267
|
mkdirSync(TOPIC_WORKSPACE_DIR, { recursive: true });
|
|
269
268
|
mkdirSync(SHARED_WIKI_DIR, { recursive: true });
|
|
270
269
|
mkdirSync(CRON_WORKSPACE_DIR, { recursive: true });
|
|
271
|
-
mkdirSync(CONTEXTS_DIR, { recursive: true });
|
|
272
270
|
mkdirSync(DM_WORKSPACE_DIR, { recursive: true });
|
|
273
271
|
mkdirSync(SESSION_WORKSPACE_DIR, { recursive: true });
|
|
274
272
|
mkdirSync(BROWSER_DIR, { recursive: true });
|
|
@@ -1084,11 +1082,11 @@ var MCP_CATALOG = {
|
|
|
1084
1082
|
vault: {
|
|
1085
1083
|
...commonRuntimeMcpPolicy("vault"),
|
|
1086
1084
|
build(ctx) {
|
|
1087
|
-
const { userId, agent } = ctx;
|
|
1088
|
-
const args = [`--user-id=${userId}`];
|
|
1085
|
+
const { userId, vaultUserId, agent } = ctx;
|
|
1086
|
+
const args = [`--user-id=${vaultUserId ?? userId}`];
|
|
1089
1087
|
if (agent !== "codex")
|
|
1090
1088
|
args.push("--list-only=true");
|
|
1091
|
-
return buildBuiltinMcpServer("vault", ctx, () => buildStdioMcpServer(agent, VAULT_SERVER, args));
|
|
1089
|
+
return buildBuiltinMcpServer("vault", { ...ctx, userId: vaultUserId ?? userId }, () => buildStdioMcpServer(agent, VAULT_SERVER, args));
|
|
1092
1090
|
}
|
|
1093
1091
|
}
|
|
1094
1092
|
};
|
|
@@ -1168,6 +1166,7 @@ function getManagerMcpServers(opts) {
|
|
|
1168
1166
|
function getForumMcpServers(opts) {
|
|
1169
1167
|
const {
|
|
1170
1168
|
userId,
|
|
1169
|
+
vaultUserId,
|
|
1171
1170
|
session,
|
|
1172
1171
|
topicId,
|
|
1173
1172
|
subagentParentTopicId,
|
|
@@ -1198,6 +1197,7 @@ function getForumMcpServers(opts) {
|
|
|
1198
1197
|
};
|
|
1199
1198
|
const base = buildScope("forum", {
|
|
1200
1199
|
userId,
|
|
1200
|
+
vaultUserId,
|
|
1201
1201
|
session,
|
|
1202
1202
|
topicId,
|
|
1203
1203
|
subagentParentTopicId,
|
|
@@ -1291,6 +1291,7 @@ function getMcpServersForQuery(opts) {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
return getForumMcpServers({
|
|
1293
1293
|
userId: opts.userId || "local",
|
|
1294
|
+
vaultUserId: opts.vaultUserId,
|
|
1294
1295
|
session: opts.session || "default",
|
|
1295
1296
|
topicId: opts.topicId,
|
|
1296
1297
|
subagentParentTopicId: opts.subagentParentTopicId,
|
|
@@ -1917,7 +1918,7 @@ async function* claudeProvider(opts) {
|
|
|
1917
1918
|
}
|
|
1918
1919
|
};
|
|
1919
1920
|
}
|
|
1920
|
-
const userId = opts.userId ?? "";
|
|
1921
|
+
const userId = opts.vaultUserId ?? opts.userId ?? "";
|
|
1921
1922
|
const withVault = substituteClaudeToolInput(userId, tool_name, tool_input);
|
|
1922
1923
|
if (JSON.stringify(withVault) === JSON.stringify(tool_input)) {
|
|
1923
1924
|
return { continue: true };
|
|
@@ -1937,7 +1938,7 @@ async function* claudeProvider(opts) {
|
|
|
1937
1938
|
hooks: [
|
|
1938
1939
|
async (input) => {
|
|
1939
1940
|
const { tool_response } = input;
|
|
1940
|
-
const userId = opts.userId ?? "";
|
|
1941
|
+
const userId = opts.vaultUserId ?? opts.userId ?? "";
|
|
1941
1942
|
const redacted = deepMapStrings(tool_response, (value) => redactHostedSecrets(userId, value));
|
|
1942
1943
|
if (JSON.stringify(redacted) === JSON.stringify(tool_response)) {
|
|
1943
1944
|
return { continue: true };
|
|
@@ -2153,7 +2154,7 @@ import { tmpdir } from "os";
|
|
|
2153
2154
|
import { dirname as dirname4, join as join3 } from "path";
|
|
2154
2155
|
|
|
2155
2156
|
// ../../packages/core/src/version.ts
|
|
2156
|
-
var NEGOTIUM_VERSION = "0.2.
|
|
2157
|
+
var NEGOTIUM_VERSION = "0.2.6";
|
|
2157
2158
|
|
|
2158
2159
|
// ../../packages/core/src/agents/codex-native-multi-agent.ts
|
|
2159
2160
|
var moduleRequire = createRequire2(import.meta.url);
|
|
@@ -3375,6 +3376,8 @@ async function* codexProvider(opts) {
|
|
|
3375
3376
|
throw err;
|
|
3376
3377
|
if (!currentSessionId || !isMissingCodexRolloutError(err))
|
|
3377
3378
|
throw err;
|
|
3379
|
+
if (opts.userId && opts.session)
|
|
3380
|
+
throw err;
|
|
3378
3381
|
logger.warn({ staleSessionId: currentSessionId, err: errMsg(err) }, "codexProvider: stale/missing rollout, restarting fresh thread");
|
|
3379
3382
|
thread = codex.startThread(threadOptions);
|
|
3380
3383
|
prompt = promptForThread(opts, true);
|
|
@@ -3681,7 +3684,7 @@ function maestroProvider(opts) {
|
|
|
3681
3684
|
if (opts.agent !== undefined && opts.agent !== "maestro") {
|
|
3682
3685
|
throw new Error(`maestroProvider: unexpected agent "${opts.agent}", expected "maestro"`);
|
|
3683
3686
|
}
|
|
3684
|
-
const userId = opts.userId ?? "";
|
|
3687
|
+
const userId = opts.vaultUserId ?? opts.userId ?? "";
|
|
3685
3688
|
setMcpResolver(hostedMcpServers);
|
|
3686
3689
|
const callerDisallowedTools = opts.disallowedTools ?? [];
|
|
3687
3690
|
const callerToolHooks = opts.toolHooks ?? [];
|
|
@@ -3782,4 +3785,4 @@ export {
|
|
|
3782
3785
|
buildClaudeDisallowedTools
|
|
3783
3786
|
};
|
|
3784
3787
|
|
|
3785
|
-
//# debugId=
|
|
3788
|
+
//# debugId=9B89F2FCE6B2FAC464756E2164756E21
|