negotium 0.2.20 → 0.2.22

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.
Files changed (37) hide show
  1. package/dist/agent-helpers.js +233 -307
  2. package/dist/agent-helpers.js.map +3 -3
  3. package/dist/background-bash.js.map +1 -1
  4. package/dist/browser-runtime.js +17 -1
  5. package/dist/browser-runtime.js.map +2 -2
  6. package/dist/canonical-mcp-bridge.js +1 -1
  7. package/dist/{chunk-g2kqfdwm.js → chunk-rhp26p2c.js} +18 -3
  8. package/dist/{chunk-g2kqfdwm.js.map → chunk-rhp26p2c.js.map} +2 -2
  9. package/dist/{chunk-r0xs3t81.js → chunk-s2gez3wg.js} +18 -3
  10. package/dist/{chunk-r0xs3t81.js.map → chunk-s2gez3wg.js.map} +2 -2
  11. package/dist/hosted-agent.js +4 -3
  12. package/dist/hosted-agent.js.map +3 -3
  13. package/dist/main.js +645 -722
  14. package/dist/main.js.map +10 -9
  15. package/dist/mcp-catalog.js.map +1 -1
  16. package/dist/mcp-factories.js +219 -287
  17. package/dist/mcp-factories.js.map +3 -3
  18. package/dist/outbox.js.map +1 -1
  19. package/dist/platform-runtime.js.map +1 -1
  20. package/dist/prompts.js.map +1 -1
  21. package/dist/query-runtime.js +17 -1
  22. package/dist/query-runtime.js.map +2 -2
  23. package/dist/registry.js +4 -3
  24. package/dist/registry.js.map +3 -3
  25. package/dist/rollout.js +1 -1
  26. package/dist/runtime/src/node-host.ts +1 -1
  27. package/dist/runtime/src/version.ts +1 -1
  28. package/dist/runtime-helpers.js +17 -1
  29. package/dist/runtime-helpers.js.map +2 -2
  30. package/dist/sqlite.js +17 -1
  31. package/dist/sqlite.js.map +2 -2
  32. package/dist/storage.js +17 -6
  33. package/dist/storage.js.map +2 -2
  34. package/dist/types/packages/core/src/version.d.ts +1 -1
  35. package/dist/vault.js +17 -1
  36. package/dist/vault.js.map +2 -2
  37. package/package.json +1 -1
@@ -1,20 +1,30 @@
1
1
  // @bun
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
2
4
  var __defProp = Object.defineProperty;
3
- var __returnValue = (v) => v;
4
- function __exportSetter(name, newValue) {
5
- this[name] = __returnValue.bind(null, newValue);
6
- }
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __toESM = (mod, isNodeMode, target) => {
8
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
9
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
+ for (let key of __getOwnPropNames(mod))
11
+ if (!__hasOwnProp.call(to, key))
12
+ __defProp(to, key, {
13
+ get: () => mod[key],
14
+ enumerable: true
15
+ });
16
+ return to;
17
+ };
7
18
  var __export = (target, all) => {
8
19
  for (var name in all)
9
20
  __defProp(target, name, {
10
21
  get: all[name],
11
22
  enumerable: true,
12
23
  configurable: true,
13
- set: __exportSetter.bind(all, name)
24
+ set: (newValue) => all[name] = () => newValue
14
25
  });
15
26
  };
16
27
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
- var __promiseAll = (args) => Promise.all(args);
18
28
  var __require = import.meta.require;
19
29
 
20
30
  // ../../packages/core/src/security/sensitive-path.ts
@@ -1772,11 +1782,9 @@ function redactVaultSecrets(userId, text) {
1772
1782
  var vaultDb, vaultMasterKey, VAULT_VALUE_MAX_BYTES;
1773
1783
  var init_vault = __esm(async () => {
1774
1784
  init_config();
1785
+ await init_sqlite();
1786
+ await init_storage_host();
1775
1787
  init_vault_crypto();
1776
- await __promiseAll([
1777
- init_sqlite(),
1778
- init_storage_host()
1779
- ]);
1780
1788
  vaultMasterKey = VAULT_MASTER_KEY;
1781
1789
  VAULT_VALUE_MAX_BYTES = 64 * 1024;
1782
1790
  });
@@ -2386,7 +2394,7 @@ var init_claude_registry = __esm(() => {
2386
2394
  });
2387
2395
 
2388
2396
  // ../../packages/core/src/version.ts
2389
- var NEGOTIUM_VERSION = "0.2.20";
2397
+ var NEGOTIUM_VERSION = "0.2.22";
2390
2398
 
2391
2399
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
2392
2400
  import { spawn as spawn2 } from "child_process";
@@ -3142,10 +3150,10 @@ function formatDateBucket(d) {
3142
3150
  }
3143
3151
  var _shellCache = null, MAX_DAY_SPAN = 30, DAY_MS = 86400000, LOCAL_DATE_SKEW_DAYS = 1;
3144
3152
  var init_codex = __esm(async () => {
3153
+ await init_execution_host();
3145
3154
  init_shared();
3146
3155
  init_jsonl();
3147
3156
  init_logger();
3148
- await init_execution_host();
3149
3157
  });
3150
3158
 
3151
3159
  // ../../packages/core/src/agents/codex-app-server.ts
@@ -3249,10 +3257,8 @@ async function forkCodexSession(parentThreadId) {
3249
3257
  var forkCodexThread;
3250
3258
  var init_codex_app_server = __esm(async () => {
3251
3259
  init_codex_native_multi_agent();
3252
- await __promiseAll([
3253
- init_execution_host(),
3254
- init_codex()
3255
- ]);
3260
+ await init_execution_host();
3261
+ await init_codex();
3256
3262
  forkCodexThread = createCodexAppServerForker({
3257
3263
  spawnServer() {
3258
3264
  return spawn3(process.execPath, [codexCliScriptPath(), "app-server", "--stdio"], {
@@ -3270,13 +3276,11 @@ import { existsSync as existsSync6, unlinkSync as unlinkSync6 } from "fs";
3270
3276
  import { join as join8 } from "path";
3271
3277
  var VALID_EFFORTS2, codexRegistry, codexRegistryOperations;
3272
3278
  var init_codex_registry = __esm(async () => {
3279
+ await init_codex_app_server();
3280
+ await init_execution_host();
3281
+ await init_codex();
3273
3282
  init_logger();
3274
3283
  init_types();
3275
- await __promiseAll([
3276
- init_codex_app_server(),
3277
- init_execution_host(),
3278
- init_codex()
3279
- ]);
3280
3284
  VALID_EFFORTS2 = new Set(CODEX_EFFORT_VALUES);
3281
3285
  codexRegistry = {
3282
3286
  kind: "codex",
@@ -3499,8 +3503,8 @@ function getRegistryOperations(agent) {
3499
3503
  var REGISTRIES, OPERATIONS;
3500
3504
  var init_registry = __esm(async () => {
3501
3505
  init_claude_registry();
3502
- init_maestro_registry();
3503
3506
  await init_codex_registry();
3507
+ init_maestro_registry();
3504
3508
  REGISTRIES = {
3505
3509
  claude: claudeRegistry,
3506
3510
  codex: codexRegistry,
@@ -4307,10 +4311,10 @@ async function* claudeProvider(opts) {
4307
4311
  var CLAUDE_DEFAULT_DISALLOWED_TOOLS, CLAUDE_NATIVE_AGENT_TOOLS, CLAUDE_IMAGE_MAX_BYTES, CLAUDE_IMAGE_MIME_TYPES, CLAUDE_ABORT_SIGKILL_DELAY_MS = 2500;
4308
4312
  var init_claude_provider = __esm(async () => {
4309
4313
  init_claude_registry();
4314
+ await init_execution_host();
4310
4315
  init_vault_tool_policy();
4311
4316
  init_file_events();
4312
4317
  init_logger();
4313
- await init_execution_host();
4314
4318
  CLAUDE_DEFAULT_DISALLOWED_TOOLS = [
4315
4319
  "AskUserQuestion",
4316
4320
  "Workflow",
@@ -5745,14 +5749,12 @@ var CODEX_MCP_SERVER_NAME_OVERRIDES, CODEX_DIFF_FILE_LIMIT, CODEX_DIFF_BASELINE_
5745
5749
  var init_codex_provider = __esm(async () => {
5746
5750
  init_codex_native_multi_agent();
5747
5751
  init_codex_tree_kill();
5752
+ await init_execution_host();
5753
+ await init_codex();
5748
5754
  init_tool_format();
5749
5755
  init_file_events();
5750
5756
  init_logger();
5751
5757
  init_mcp_config();
5752
- await __promiseAll([
5753
- init_execution_host(),
5754
- init_codex()
5755
- ]);
5756
5758
  CODEX_MCP_SERVER_NAME_OVERRIDES = {
5757
5759
  playwright: "otium_playwright"
5758
5760
  };
@@ -5873,12 +5875,10 @@ function maestroProvider(opts) {
5873
5875
  var MAESTRO_DEFAULT_MAX_TOKENS = 32768, PROVIDER_ASK_USER_TOOL = "AskUserQuestion", PROVIDER_SUBAGENT_TOOL = "Agent", MAESTRO_NATIVE_TASK_TOOLS, MAESTRO_PROVIDER_OWNED_TOOL_SET, DEFAULT_MAESTRO_DISALLOWED_TOOLS, MAESTRO_ALL_BUILTIN_TOOLS, MAESTRO_TOOL_OUTPUT_DIR;
5874
5876
  var init_maestro_provider = __esm(async () => {
5875
5877
  init_maestro_bootstrap_env();
5878
+ await init_execution_host();
5876
5879
  init_vault_tool_policy();
5877
5880
  init_config();
5878
- await __promiseAll([
5879
- init_execution_host(),
5880
- init_vault()
5881
- ]);
5881
+ await init_vault();
5882
5882
  MAESTRO_NATIVE_TASK_TOOLS = [
5883
5883
  "TaskCreate",
5884
5884
  "TaskUpdate",
@@ -6024,15 +6024,13 @@ async function* runAgent(opts) {
6024
6024
  }
6025
6025
  }
6026
6026
  var init_agents = __esm(async () => {
6027
+ await init_execution_host();
6028
+ await init_registry();
6027
6029
  init_claude();
6030
+ await init_task_events();
6028
6031
  init_logger();
6032
+ await init_conversations();
6029
6033
  init_types();
6030
- await __promiseAll([
6031
- init_execution_host(),
6032
- init_registry(),
6033
- init_task_events(),
6034
- init_conversations()
6035
- ]);
6036
6034
  });
6037
6035
 
6038
6036
  // ../../packages/core/src/storage/forum-db.ts
@@ -6081,10 +6079,8 @@ function listRuntimeEventsAfter(seq, limit = 500) {
6081
6079
  }
6082
6080
  var RUNTIME_EVENT_TYPES, types;
6083
6081
  var init_runtime_events = __esm(async () => {
6084
- await __promiseAll([
6085
- init_forum_db(),
6086
- init_storage_host()
6087
- ]);
6082
+ await init_forum_db();
6083
+ await init_storage_host();
6088
6084
  RUNTIME_EVENT_TYPES = [
6089
6085
  "message",
6090
6086
  "message-updated",
@@ -7100,10 +7096,8 @@ function getMessagesForTopicAfterRowid(topicId, afterRowid) {
7100
7096
  }
7101
7097
  var appendHooks;
7102
7098
  var init_api_messages = __esm(async () => {
7103
- await __promiseAll([
7104
- init_forum_db(),
7105
- init_storage_host()
7106
- ]);
7099
+ await init_forum_db();
7100
+ await init_storage_host();
7107
7101
  registerStorageSchemaInitializer(initializeApiMessagesSchema, 30);
7108
7102
  appendHooks = new Set;
7109
7103
  });
@@ -7193,11 +7187,9 @@ function deleteTopicBrief(topicId) {
7193
7187
  db.query("DELETE FROM api_topic_brief WHERE topic_id = ?").run(topicId);
7194
7188
  }
7195
7189
  var init_api_topic_brief = __esm(async () => {
7190
+ await init_forum_db();
7191
+ await init_storage_host();
7196
7192
  init_wiki_summary_names();
7197
- await __promiseAll([
7198
- init_forum_db(),
7199
- init_storage_host()
7200
- ]);
7201
7193
  registerStorageSchemaInitializer((database) => {
7202
7194
  database.exec(`
7203
7195
  CREATE TABLE IF NOT EXISTS api_topic_brief (
@@ -7342,10 +7334,8 @@ function deleteApiTopicConfig(topicId) {
7342
7334
  db.query("DELETE FROM api_topic_config WHERE topic_id = ?").run(topicId);
7343
7335
  }
7344
7336
  var init_api_topic_config = __esm(async () => {
7345
- await __promiseAll([
7346
- init_forum_db(),
7347
- init_storage_host()
7348
- ]);
7337
+ await init_forum_db();
7338
+ await init_storage_host();
7349
7339
  registerStorageSchemaInitializer(initializeApiTopicConfigSchema, 40);
7350
7340
  });
7351
7341
 
@@ -7904,10 +7894,8 @@ var DEFAULT_AGENT_ROOM_AGENT = "maestro";
7904
7894
  var init_api_topics = __esm(async () => {
7905
7895
  init_constants();
7906
7896
  init_logger();
7907
- await __promiseAll([
7908
- init_forum_db(),
7909
- init_storage_host()
7910
- ]);
7897
+ await init_forum_db();
7898
+ await init_storage_host();
7911
7899
  registerStorageSchemaInitializer(initializeApiTopicsSchema, 20);
7912
7900
  });
7913
7901
 
@@ -7950,13 +7938,11 @@ function isLegacySharedGeneral(topicId) {
7950
7938
  }
7951
7939
  var LEGACY_PERSONAL_GENERAL_DESCRIPTION = "\uB098\uB9CC\uC758 \uAC1C\uC778 \uACF5\uAC04\uC774\uC5D0\uC694. \uB300\uD654\uC640 AI \uC791\uC5C5\uC740 \uB2E4\uB978 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uACF5\uAC1C\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.", PERSONAL_GENERAL_DESCRIPTION = "Your private General. Messages and membership are visible only to you. Workspace memory, wiki, and skills are shared with your workspace.";
7952
7940
  var init_personal_general = __esm(async () => {
7941
+ await init_registry();
7953
7942
  init_config();
7954
7943
  init_constants();
7955
- await __promiseAll([
7956
- init_registry(),
7957
- init_api_topic_config(),
7958
- init_api_topics()
7959
- ]);
7944
+ await init_api_topic_config();
7945
+ await init_api_topics();
7960
7946
  });
7961
7947
 
7962
7948
  // ../../packages/core/src/agents/archiver.ts
@@ -8290,20 +8276,18 @@ function runArchiverTurn(params) {
8290
8276
  }
8291
8277
  var MAX_BRIEF_ENTRIES = 8, defaultArchiverRuntime;
8292
8278
  var init_archiver = __esm(async () => {
8279
+ await init_agents();
8293
8280
  init_tool_format();
8281
+ await init_bus();
8294
8282
  init_config();
8295
8283
  init_logger();
8296
8284
  init_builders();
8297
8285
  init_background_session_policy();
8286
+ await init_api_messages();
8287
+ await init_api_topic_brief();
8288
+ await init_wiki();
8298
8289
  init_wiki_summary_names();
8299
- await __promiseAll([
8300
- init_agents(),
8301
- init_bus(),
8302
- init_api_messages(),
8303
- init_api_topic_brief(),
8304
- init_wiki(),
8305
- init_personal_general()
8306
- ]);
8290
+ await init_personal_general();
8307
8291
  defaultArchiverRuntime = createArchiverRuntime({
8308
8292
  storage: {
8309
8293
  getWikiDir: getSharedWikiDir,
@@ -8475,8 +8459,8 @@ function cleanupAgentFork(handle) {
8475
8459
  }
8476
8460
  var defaultForkHelpers;
8477
8461
  var init_fork = __esm(async () => {
8478
- init_logger();
8479
8462
  await init_registry();
8463
+ init_logger();
8480
8464
  defaultForkHelpers = createAgentForkHelpers({
8481
8465
  forkSession: (agent, options) => getRegistryOperations(agent).forkSession(options),
8482
8466
  exists: existsSync15,
@@ -8595,10 +8579,8 @@ function beginRuntimeTopicMaintenance(topicId, options = {}) {
8595
8579
  }
8596
8580
  var TOPIC_MAINTENANCE_STALE_MS = 30000, TOPIC_MAINTENANCE_HEARTBEAT_MS = 1000;
8597
8581
  var init_runtime_topic_state = __esm(async () => {
8598
- await __promiseAll([
8599
- init_forum_db(),
8600
- init_storage_host()
8601
- ]);
8582
+ await init_forum_db();
8583
+ await init_storage_host();
8602
8584
  registerStorageSchemaInitializer((database) => {
8603
8585
  database.exec(`
8604
8586
  CREATE TABLE IF NOT EXISTS runtime_topic_state (
@@ -8695,11 +8677,9 @@ function releaseRuntimeTurnLease(topicId, queryId, ownerId = RUNTIME_INSTANCE_ID
8695
8677
  }
8696
8678
  var RUNTIME_INSTANCE_ID, TURN_LEASE_STALE_MS = 1e4;
8697
8679
  var init_runtime_leases = __esm(async () => {
8698
- await __promiseAll([
8699
- init_forum_db(),
8700
- init_runtime_topic_state(),
8701
- init_storage_host()
8702
- ]);
8680
+ await init_forum_db();
8681
+ await init_runtime_topic_state();
8682
+ await init_storage_host();
8703
8683
  RUNTIME_INSTANCE_ID = `${process.pid}-${randomUUID8()}`;
8704
8684
  registerStorageSchemaInitializer((database) => {
8705
8685
  database.exec(`
@@ -9065,8 +9045,8 @@ function wsAbortReason(reason) {
9065
9045
  var roomQueryRegistry, interSessionQueue;
9066
9046
  var init_active_rooms = __esm(async () => {
9067
9047
  init_logger();
9068
- init_types2();
9069
9048
  await init_runtime_leases();
9049
+ init_types2();
9070
9050
  roomQueryRegistry = createRoomQueryRegistry({
9071
9051
  instanceId: RUNTIME_INSTANCE_ID,
9072
9052
  internalAbortReason: "internal" /* Internal */,
@@ -9245,11 +9225,9 @@ function archiveConversationEvents(topicId, topicTitle, userId, options = {}) {
9245
9225
  }
9246
9226
  var init_topic_archive = __esm(async () => {
9247
9227
  init_logger();
9248
- await __promiseAll([
9249
- init_api_messages(),
9250
- init_conversations(),
9251
- init_wiki()
9252
- ]);
9228
+ await init_api_messages();
9229
+ await init_conversations();
9230
+ await init_wiki();
9253
9231
  });
9254
9232
 
9255
9233
  // ../../packages/core/src/storage/topic-archive-state.ts
@@ -9362,10 +9340,8 @@ function deleteTopicArchiveState(topicId) {
9362
9340
  }
9363
9341
  var ARCHIVE_JOB_STALE_MS;
9364
9342
  var init_topic_archive_state = __esm(async () => {
9365
- await __promiseAll([
9366
- init_forum_db(),
9367
- init_storage_host()
9368
- ]);
9343
+ await init_forum_db();
9344
+ await init_storage_host();
9369
9345
  registerStorageSchemaInitializer((database) => {
9370
9346
  database.exec(`
9371
9347
  CREATE TABLE IF NOT EXISTS api_topic_archive_state (
@@ -9541,15 +9517,13 @@ function archiveActiveTopicForMemory(topicId, userId, options) {
9541
9517
  }
9542
9518
  var DEFAULT_IDLE_DELAY_MS, DEFAULT_MIN_MESSAGES = 8, timers;
9543
9519
  var init_idle_archiver = __esm(async () => {
9520
+ await init_archiver();
9544
9521
  init_logger();
9545
- await __promiseAll([
9546
- init_archiver(),
9547
- init_active_rooms(),
9548
- init_api_messages(),
9549
- init_api_topics(),
9550
- init_topic_archive(),
9551
- init_topic_archive_state()
9552
- ]);
9522
+ await init_active_rooms();
9523
+ await init_api_messages();
9524
+ await init_api_topics();
9525
+ await init_topic_archive();
9526
+ await init_topic_archive_state();
9553
9527
  DEFAULT_IDLE_DELAY_MS = 6 * 60 * 60 * 1000;
9554
9528
  timers = new Map;
9555
9529
  });
@@ -9764,10 +9738,8 @@ function cancelAskUserGate(topicId, messageId, ownerId, now = new Date().toISOSt
9764
9738
  }).immediate();
9765
9739
  }
9766
9740
  var init_ask_user_gates = __esm(async () => {
9767
- await __promiseAll([
9768
- init_forum_db(),
9769
- init_storage_host()
9770
- ]);
9741
+ await init_forum_db();
9742
+ await init_storage_host();
9771
9743
  registerStorageSchemaInitializer(initializeAskUserGateSchema, 31);
9772
9744
  });
9773
9745
 
@@ -9886,11 +9858,9 @@ function acquireRuntimeProcessLease(role, options = {}) {
9886
9858
  }
9887
9859
  var PROCESS_LEASE_STALE_MS = 5000, PROCESS_LEASE_HEARTBEAT_MS = 1000;
9888
9860
  var init_runtime_process_leases = __esm(async () => {
9889
- await __promiseAll([
9890
- init_forum_db(),
9891
- init_runtime_leases(),
9892
- init_storage_host()
9893
- ]);
9861
+ await init_forum_db();
9862
+ await init_runtime_leases();
9863
+ await init_storage_host();
9894
9864
  registerStorageSchemaInitializer((database) => {
9895
9865
  database.exec(`
9896
9866
  CREATE TABLE IF NOT EXISTS runtime_process_leases (
@@ -10208,14 +10178,12 @@ function cancelPendingAskUserQuestions(topicId, queryId) {
10208
10178
  var MAX_QUESTION_CHARS = 2000, MAX_CHOICE_LABEL_CHARS = 128, MAX_CHOICE_DESCRIPTION_CHARS = 500, MAX_CHOICES = 12, MAX_IDEMPOTENCY_KEY_CHARS = 200, ASK_GATE_OWNER_ID, ASK_GATE_LEASE_ROLE_PREFIX = "ask-user-gate:", defaultAskUserDurabilityHost, defaultAskUserRuntime;
10209
10179
  var init_ask_user = __esm(async () => {
10210
10180
  init_common();
10211
- await __promiseAll([
10212
- init_bus(),
10213
- init_api_messages(),
10214
- init_api_topic_config(),
10215
- init_api_topics(),
10216
- init_ask_user_gates(),
10217
- init_runtime_process_leases()
10218
- ]);
10181
+ await init_bus();
10182
+ await init_api_messages();
10183
+ await init_api_topic_config();
10184
+ await init_api_topics();
10185
+ await init_ask_user_gates();
10186
+ await init_runtime_process_leases();
10219
10187
  ASK_GATE_OWNER_ID = `ask-user-${process.pid}-${randomUUID9()}`;
10220
10188
  defaultAskUserDurabilityHost = {
10221
10189
  gates: {
@@ -10320,12 +10288,10 @@ function deleteSelfSchedulesForTopic(topicId) {
10320
10288
  return Number(result.changes ?? 0);
10321
10289
  }
10322
10290
  var init_self_schedules = __esm(async () => {
10323
- await __promiseAll([
10324
- init_forum_db(),
10325
- init_runtime_leases(),
10326
- init_runtime_topic_state(),
10327
- init_storage_host()
10328
- ]);
10291
+ await init_forum_db();
10292
+ await init_runtime_leases();
10293
+ await init_runtime_topic_state();
10294
+ await init_storage_host();
10329
10295
  registerStorageSchemaInitializer((database) => {
10330
10296
  database.exec(`
10331
10297
  CREATE TABLE IF NOT EXISTS runtime_self_schedules (
@@ -10674,8 +10640,8 @@ var init_transport_probe = __esm(() => {
10674
10640
 
10675
10641
  // ../../packages/core/src/storage/vault-public.ts
10676
10642
  var init_vault_public = __esm(async () => {
10677
- init_vault_crypto();
10678
10643
  await init_vault();
10644
+ init_vault_crypto();
10679
10645
  });
10680
10646
 
10681
10647
  // ../../packages/core/src/platform/playwright/vault-broker.ts
@@ -10953,10 +10919,8 @@ function assignTopicBrowserProfile(opts) {
10953
10919
  }
10954
10920
  var DEFAULT_BROWSER_PROFILE = "default";
10955
10921
  var init_browser_profiles = __esm(async () => {
10956
- await __promiseAll([
10957
- init_forum_db(),
10958
- init_storage_host()
10959
- ]);
10922
+ await init_forum_db();
10923
+ await init_storage_host();
10960
10924
  registerStorageSchemaInitializer((database) => {
10961
10925
  database.exec(`
10962
10926
  CREATE TABLE IF NOT EXISTS browser_profiles (
@@ -11605,17 +11569,15 @@ var defaultManagerHost, managerHost, MAX_IDLE_MS, instances, usedPorts, spawning
11605
11569
  var init_manager2 = __esm(async () => {
11606
11570
  init_config();
11607
11571
  init_logger();
11572
+ await init_browser_processes();
11608
11573
  init_headed_launch();
11609
11574
  init_transport_probe();
11575
+ await init_vault_broker();
11576
+ await init_browser_profiles();
11610
11577
  init_manager_utils();
11578
+ await init_browser_processes();
11611
11579
  init_transport_probe();
11612
11580
  init_manager_utils();
11613
- await __promiseAll([
11614
- init_browser_processes(),
11615
- init_vault_broker(),
11616
- init_browser_profiles(),
11617
- init_browser_processes()
11618
- ]);
11619
11581
  defaultManagerHost = Object.freeze({
11620
11582
  portsDir: PLAYWRIGHT_PORTS_DIR,
11621
11583
  basePort: PLAYWRIGHT_BASE_PORT,
@@ -11835,12 +11797,10 @@ function createTopicLogMaintenance(host) {
11835
11797
  }
11836
11798
  var defaultTopicLogMaintenance, cleanupTopicRollouts, cleanupTopicRolloutsFromEntries, rotateTopicLogs, purgeTopicLogs;
11837
11799
  var init_topic_cleanup = __esm(async () => {
11800
+ await init_agents();
11801
+ await init_registry();
11838
11802
  init_logger();
11839
- await __promiseAll([
11840
- init_agents(),
11841
- init_registry(),
11842
- init_conversations()
11843
- ]);
11803
+ await init_conversations();
11844
11804
  defaultTopicLogMaintenance = createTopicLogMaintenance({
11845
11805
  agents: SUPPORTED_AGENTS,
11846
11806
  readActiveConversation: readConversation,
@@ -11923,14 +11883,12 @@ function text(value, maxLen) {
11923
11883
  }
11924
11884
  var providers, transientSessions;
11925
11885
  var init_background_sessions = __esm(async () => {
11886
+ await init_archiver();
11926
11887
  init_tool_format();
11888
+ await init_api_topics();
11889
+ await init_runtime_events();
11890
+ await init_runtime_leases();
11927
11891
  init_background_session_policy();
11928
- await __promiseAll([
11929
- init_archiver(),
11930
- init_api_topics(),
11931
- init_runtime_events(),
11932
- init_runtime_leases()
11933
- ]);
11934
11892
  providers = new Set;
11935
11893
  transientSessions = new Map;
11936
11894
  });
@@ -12226,12 +12184,10 @@ function getRuntimeUserTurnRequest(topicId) {
12226
12184
  }
12227
12185
  var REQUEST_CLAIM_STALE_MS;
12228
12186
  var init_runtime_turn_requests = __esm(async () => {
12229
- await __promiseAll([
12230
- init_forum_db(),
12231
- init_runtime_leases(),
12232
- init_runtime_topic_state(),
12233
- init_storage_host()
12234
- ]);
12187
+ await init_forum_db();
12188
+ await init_runtime_leases();
12189
+ await init_runtime_topic_state();
12190
+ await init_storage_host();
12235
12191
  REQUEST_CLAIM_STALE_MS = TURN_LEASE_STALE_MS;
12236
12192
  registerStorageSchemaInitializer((database) => ensureRuntimeUserTurnRequestsSchema(database));
12237
12193
  });
@@ -12616,31 +12572,29 @@ async function createCompactedRolloutEntries(request, summarize = summarizeTopic
12616
12572
  }
12617
12573
  var RESET_MEMORY_ARCHIVE_WAIT_MS, COMPACTION_INLINE_CHARS = 1e5, COMPACTION_SOURCE_CHARS, COMPACTION_MEMORY_CHARS = 80000, COMPACTION_OUTPUT_CHARS = 30000, COMPACTION_TIMEOUT_MS, COMPACTION_LOG_TIMEOUT_MS, COMPACTION_LOG_MAX_CALLS = 12, COMPACTION_LOG_MAX_TOTAL_BYTES, COMPACTION_LOG_MAX_CHUNK_BYTES, COMPACT_CONTEXT_MARKER = "[Negotium compacted context]", AUTO_FORK_COMPACTION_TOKENS = 28000;
12618
12574
  var init_session = __esm(async () => {
12575
+ await init_idle_archiver();
12576
+ await init_agents();
12619
12577
  init_model_catalog();
12578
+ await init_registry();
12620
12579
  init_shared();
12580
+ await init_topic_cleanup();
12581
+ await init_bus();
12621
12582
  init_config();
12622
12583
  init_logger();
12623
12584
  init_mcp_config();
12585
+ await init_active_rooms();
12586
+ await init_background_sessions();
12624
12587
  init_usage_alert();
12625
- await __promiseAll([
12626
- init_idle_archiver(),
12627
- init_agents(),
12628
- init_registry(),
12629
- init_topic_cleanup(),
12630
- init_bus(),
12631
- init_active_rooms(),
12632
- init_background_sessions(),
12633
- init_api_messages(),
12634
- init_api_topic_brief(),
12635
- init_api_topic_config(),
12636
- init_api_topics(),
12637
- init_conversations(),
12638
- init_runtime_leases(),
12639
- init_runtime_topic_state(),
12640
- init_runtime_turn_requests(),
12641
- init_topic_archive(),
12642
- init_personal_general()
12643
- ]);
12588
+ await init_api_messages();
12589
+ await init_api_topic_brief();
12590
+ await init_api_topic_config();
12591
+ await init_api_topics();
12592
+ await init_conversations();
12593
+ await init_runtime_leases();
12594
+ await init_runtime_topic_state();
12595
+ await init_runtime_turn_requests();
12596
+ await init_topic_archive();
12597
+ await init_personal_general();
12644
12598
  RESET_MEMORY_ARCHIVE_WAIT_MS = 5 * 60 * 1000;
12645
12599
  COMPACTION_SOURCE_CHARS = 512 * 1024;
12646
12600
  COMPACTION_TIMEOUT_MS = 2 * 60000;
@@ -12971,24 +12925,22 @@ async function createDerivedTopicImpl(topic, sourceTopicId, userId, copyHistory,
12971
12925
  }
12972
12926
  var TopicTitleConflictError, TopicDeriveBusyError, TopicForkCompactionError;
12973
12927
  var init_derive = __esm(async () => {
12928
+ await init_fork();
12974
12929
  init_model_catalog();
12930
+ await init_registry();
12931
+ await init_bus();
12975
12932
  init_config();
12976
12933
  init_logger();
12977
- await __promiseAll([
12978
- init_fork(),
12979
- init_registry(),
12980
- init_bus(),
12981
- init_manager2(),
12982
- init_active_rooms(),
12983
- init_api_messages(),
12984
- init_api_topic_config(),
12985
- init_api_topics(),
12986
- init_conversations(),
12987
- init_forum_db(),
12988
- init_runtime_topic_state(),
12989
- init_personal_general(),
12990
- init_session()
12991
- ]);
12934
+ await init_manager2();
12935
+ await init_active_rooms();
12936
+ await init_api_messages();
12937
+ await init_api_topic_config();
12938
+ await init_api_topics();
12939
+ await init_conversations();
12940
+ await init_forum_db();
12941
+ await init_runtime_topic_state();
12942
+ await init_personal_general();
12943
+ await init_session();
12992
12944
  TopicTitleConflictError = class TopicTitleConflictError extends Error {
12993
12945
  title;
12994
12946
  constructor(title) {
@@ -13647,11 +13599,9 @@ async function failInterruptedRemoteAskCallbacks() {
13647
13599
  }
13648
13600
  var pendingAsks, MAX_ASK_AGE_MS;
13649
13601
  var init_ask_callbacks = __esm(async () => {
13650
- await __promiseAll([
13651
- init_forum_db(),
13652
- init_session_asks(),
13653
- init_storage_host()
13654
- ]);
13602
+ await init_forum_db();
13603
+ await init_session_asks();
13604
+ await init_storage_host();
13655
13605
  registerStorageSchemaInitializer((database) => {
13656
13606
  database.exec(`
13657
13607
  CREATE TABLE IF NOT EXISTS remote_ask_callbacks (
@@ -13877,10 +13827,8 @@ paint();document.body.appendChild(b)}
13877
13827
  if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",init);else init()})();
13878
13828
  </script>`;
13879
13829
  var init_visual_store = __esm(async () => {
13880
- await __promiseAll([
13881
- init_forum_db(),
13882
- init_storage_host()
13883
- ]);
13830
+ await init_forum_db();
13831
+ await init_storage_host();
13884
13832
  registerStorageSchemaInitializer((database) => {
13885
13833
  database.exec(`
13886
13834
  CREATE TABLE IF NOT EXISTS api_topic_visuals (
@@ -14113,37 +14061,35 @@ async function deleteTopicCascadeImpl(topic, userId, options, deletingAncestorId
14113
14061
  }
14114
14062
  var DELETE_TURN_WAIT_MS = 5000, TopicArchiveRequiredError, TopicTurnStillActiveError, TopicCleanupRequiredError;
14115
14063
  var init_lifecycle = __esm(async () => {
14064
+ await init_archiver();
14065
+ await init_idle_archiver();
14066
+ await init_spawn_subagent();
14067
+ await init_topic_cleanup();
14068
+ await init_bus();
14116
14069
  init_manager();
14117
14070
  init_config();
14118
14071
  init_constants();
14119
14072
  init_logger();
14073
+ await init_manager2();
14074
+ await init_active_rooms();
14120
14075
  init_session_inbox_cleanup();
14121
14076
  init_state();
14077
+ await init_ask_callbacks();
14122
14078
  init_file_hooks();
14123
14079
  init_usage_alert();
14124
- await __promiseAll([
14125
- init_archiver(),
14126
- init_idle_archiver(),
14127
- init_spawn_subagent(),
14128
- init_topic_cleanup(),
14129
- init_bus(),
14130
- init_manager2(),
14131
- init_active_rooms(),
14132
- init_ask_callbacks(),
14133
- init_visual_store(),
14134
- init_api_messages(),
14135
- init_api_topic_brief(),
14136
- init_api_topic_config(),
14137
- init_api_topics(),
14138
- init_browser_profiles(),
14139
- init_runtime_leases(),
14140
- init_runtime_topic_state(),
14141
- init_runtime_turn_requests(),
14142
- init_self_schedules(),
14143
- init_session_asks(),
14144
- init_topic_archive(),
14145
- init_topic_archive_state()
14146
- ]);
14080
+ await init_visual_store();
14081
+ await init_api_messages();
14082
+ await init_api_topic_brief();
14083
+ await init_api_topic_config();
14084
+ await init_api_topics();
14085
+ await init_browser_profiles();
14086
+ await init_runtime_leases();
14087
+ await init_runtime_topic_state();
14088
+ await init_runtime_turn_requests();
14089
+ await init_self_schedules();
14090
+ await init_session_asks();
14091
+ await init_topic_archive();
14092
+ await init_topic_archive_state();
14147
14093
  TopicArchiveRequiredError = class TopicArchiveRequiredError extends Error {
14148
14094
  code = "TOPIC_ARCHIVE_FAILED";
14149
14095
  topicId;
@@ -14503,8 +14449,8 @@ function abortPlaywrightTurns(instanceKey, failure) {
14503
14449
  var turnsByInstance;
14504
14450
  var init_playwright_turn_abort = __esm(async () => {
14505
14451
  init_logger();
14506
- init_types2();
14507
14452
  await init_manager2();
14453
+ init_types2();
14508
14454
  turnsByInstance = new Map;
14509
14455
  onPlaywrightFailure(abortPlaywrightTurns);
14510
14456
  });
@@ -14581,10 +14527,8 @@ function upsertTaskPanelMessage(topicId, queryId, tasks, lastRenderedText) {
14581
14527
  return text2;
14582
14528
  }
14583
14529
  var init_tasks2 = __esm(async () => {
14584
- await __promiseAll([
14585
- init_bus(),
14586
- init_api_messages()
14587
- ]);
14530
+ await init_bus();
14531
+ await init_api_messages();
14588
14532
  });
14589
14533
 
14590
14534
  // ../../packages/core/src/runtime/visual-html.ts
@@ -14820,12 +14764,10 @@ var ACTIVE_VISUAL_PROMPT_MAX_CHARS = 24000, ACTIVE_VISUAL_PROMPT_TAIL_CHARS = 60
14820
14764
  var init_visuals = __esm(async () => {
14821
14765
  init_attachments();
14822
14766
  init_file_hooks();
14767
+ await init_visual_store();
14823
14768
  init_sensitive_path();
14769
+ await init_api_messages();
14824
14770
  init_visual_html();
14825
- await __promiseAll([
14826
- init_visual_store(),
14827
- init_api_messages()
14828
- ]);
14829
14771
  });
14830
14772
 
14831
14773
  // ../../packages/core/src/storage/token-stats.ts
@@ -15468,32 +15410,30 @@ ${JSON.stringify(event.input ?? {})}`);
15468
15410
  return outcome;
15469
15411
  }
15470
15412
  var init_turn_event_stream = __esm(async () => {
15413
+ await init_fork();
15414
+ await init_idle_archiver();
15415
+ await init_ask_user();
15416
+ await init_spawn_subagent();
15471
15417
  init_model_catalog();
15418
+ await init_registry();
15472
15419
  init_tool_format();
15420
+ await init_bus();
15473
15421
  init_logger();
15422
+ await init_active_rooms();
15474
15423
  init_state();
15475
15424
  init_types2();
15476
15425
  init_attachments();
15477
15426
  init_errors();
15427
+ await init_tasks2();
15428
+ await init_topic_config();
15478
15429
  init_usage_alert();
15430
+ await init_visual_store();
15431
+ await init_visuals();
15479
15432
  init_sensitive_path();
15480
- await __promiseAll([
15481
- init_fork(),
15482
- init_idle_archiver(),
15483
- init_ask_user(),
15484
- init_spawn_subagent(),
15485
- init_registry(),
15486
- init_bus(),
15487
- init_active_rooms(),
15488
- init_tasks2(),
15489
- init_topic_config(),
15490
- init_visual_store(),
15491
- init_visuals(),
15492
- init_api_messages(),
15493
- init_api_topics(),
15494
- init_runtime_turn_requests(),
15495
- init_token_stats()
15496
- ]);
15433
+ await init_api_messages();
15434
+ await init_api_topics();
15435
+ await init_runtime_turn_requests();
15436
+ await init_token_stats();
15497
15437
  });
15498
15438
 
15499
15439
  // ../../packages/core/src/runtime/turn-session.ts
@@ -15525,11 +15465,9 @@ function resolveInitialTurnSessionId(topicId, requestedSessionId, isolated) {
15525
15465
  }
15526
15466
  var init_turn_session = __esm(async () => {
15527
15467
  init_model_catalog();
15528
- await __promiseAll([
15529
- init_registry(),
15530
- init_topic_config(),
15531
- init_api_topics()
15532
- ]);
15468
+ await init_registry();
15469
+ await init_topic_config();
15470
+ await init_api_topics();
15533
15471
  });
15534
15472
 
15535
15473
  // ../../packages/core/src/storage/app-settings.ts
@@ -16857,43 +16795,41 @@ function triggerTopicAiTurn(topicId, userId, prompt, agentType, opts) {
16857
16795
  }
16858
16796
  var PLAYWRIGHT_UNAVAILABLE_NOTICE_COOLDOWN_MS, ASK_REPLY_INJECT_BATCH_MS = 500, playwrightUnavailableNoticeAt, askReplyInjectBatcher, remoteInjectWaiters, durableTurnWorker = null, durableTurnWorkerBusy = false;
16859
16797
  var init_turn_runner = __esm(async () => {
16798
+ await init_fork();
16799
+ await init_agents();
16800
+ await init_spawn_subagent();
16801
+ await init_registry();
16802
+ await init_bus();
16860
16803
  init_manager();
16861
16804
  init_constants();
16862
16805
  init_logger();
16863
16806
  init_mcp_config();
16807
+ await init_manager2();
16864
16808
  init_builders();
16809
+ await init_active_rooms();
16865
16810
  init_state();
16866
16811
  init_types2();
16867
16812
  init_attachments();
16813
+ await init_channel_context();
16868
16814
  init_errors();
16815
+ await init_playwright_turn_abort();
16816
+ await init_topic_config();
16817
+ await init_turn_event_stream();
16818
+ await init_turn_session();
16819
+ await init_visual_store();
16820
+ await init_visuals();
16821
+ await init_api_messages();
16822
+ await init_api_topic_brief();
16823
+ await init_api_topics();
16824
+ await init_app_settings();
16825
+ await init_browser_profiles();
16826
+ await init_conversations();
16827
+ await init_runtime_leases();
16828
+ await init_runtime_topic_state();
16829
+ await init_runtime_turn_requests();
16830
+ await init_wiki();
16869
16831
  init_wiki_summary_names();
16870
- await __promiseAll([
16871
- init_fork(),
16872
- init_agents(),
16873
- init_spawn_subagent(),
16874
- init_registry(),
16875
- init_bus(),
16876
- init_manager2(),
16877
- init_active_rooms(),
16878
- init_channel_context(),
16879
- init_playwright_turn_abort(),
16880
- init_topic_config(),
16881
- init_turn_event_stream(),
16882
- init_turn_session(),
16883
- init_visual_store(),
16884
- init_visuals(),
16885
- init_api_messages(),
16886
- init_api_topic_brief(),
16887
- init_api_topics(),
16888
- init_app_settings(),
16889
- init_browser_profiles(),
16890
- init_conversations(),
16891
- init_runtime_leases(),
16892
- init_runtime_topic_state(),
16893
- init_runtime_turn_requests(),
16894
- init_wiki(),
16895
- init_derive()
16896
- ]);
16832
+ await init_derive();
16897
16833
  init_model_catalog();
16898
16834
  init_attachments();
16899
16835
  init_channel_context();
@@ -17603,16 +17539,14 @@ function processOwnerIsAlive(ownerId) {
17603
17539
  var MAX_TASK_CHARS = 8000, MAX_NAME_CHARS = 80, MAX_LIVE_CHILDREN_PER_PARENT = 5, MAX_PREPARED_CHILDREN_PER_PARENT = 10, MAX_SUBAGENT_DEPTH = 2, RESULT_SUMMARY_CHARS = 300, defaultSubagentLifecycleHost, defaultSubagentLifecycle, computeSubagentDepth, canSpawnSubagentsFromTopic, takeSubagentWatch, cancelSubagentWatchForDeletedTopic, settleSubagentSuccess, settleSubagentFailure, sweepStaleSubagentCards, subagentReportMode, createSubagentManagementToolDefinitions, createSpawnSubagentToolDefinition, createPrepareSubagentToolDefinition;
17604
17540
  var init_spawn_subagent = __esm(async () => {
17605
17541
  init_common();
17542
+ await init_bus();
17606
17543
  init_logger();
17544
+ await init_api_messages();
17545
+ await init_api_topics();
17546
+ await init_runtime_leases();
17547
+ await init_runtime_turn_requests();
17607
17548
  init_wiki_summary_names();
17608
17549
  init_types();
17609
- await __promiseAll([
17610
- init_bus(),
17611
- init_api_messages(),
17612
- init_api_topics(),
17613
- init_runtime_leases(),
17614
- init_runtime_turn_requests()
17615
- ]);
17616
17550
  defaultSubagentLifecycleHost = {
17617
17551
  storage: {
17618
17552
  getTopic,
@@ -17747,14 +17681,12 @@ var init_spawn_subagent = __esm(async () => {
17747
17681
  });
17748
17682
 
17749
17683
  // ../../packages/core/src/agents/public-helpers.ts
17684
+ await init_archiver();
17685
+ await init_auth_check();
17750
17686
  init_codex_tree_kill();
17751
- await __promiseAll([
17752
- init_archiver(),
17753
- init_auth_check(),
17754
- init_fork(),
17755
- init_idle_archiver(),
17756
- init_ask_user()
17757
- ]);
17687
+ await init_fork();
17688
+ await init_idle_archiver();
17689
+ await init_ask_user();
17758
17690
 
17759
17691
  // ../../packages/core/src/agents/mcp-tools/publish-html.ts
17760
17692
  init_common();
@@ -18003,15 +17935,13 @@ init_common();
18003
17935
  import { z as z3 } from "zod";
18004
17936
 
18005
17937
  // ../../packages/core/src/agents/api-topic-agent-switch.ts
17938
+ await init_auth_check();
18006
17939
  init_model_catalog();
17940
+ await init_registry();
18007
17941
  init_logger();
18008
- await __promiseAll([
18009
- init_auth_check(),
18010
- init_registry(),
18011
- init_api_topic_config(),
18012
- init_api_topics(),
18013
- init_conversations()
18014
- ]);
17942
+ await init_api_topic_config();
17943
+ await init_api_topics();
17944
+ await init_conversations();
18015
17945
  import { unlinkSync as unlinkSync9 } from "fs";
18016
17946
  function commitApiTopicSwitch(opts, bridgedSessionId) {
18017
17947
  const registry = getRegistry(opts.agent);
@@ -18111,16 +18041,14 @@ function switchApiTopicAgent(opts) {
18111
18041
  }
18112
18042
 
18113
18043
  // ../../packages/core/src/agents/self-config-core.ts
18044
+ await init_auth_check();
18114
18045
  init_model_catalog();
18046
+ await init_registry();
18047
+ await init_bus();
18115
18048
  init_config();
18116
- await __promiseAll([
18117
- init_auth_check(),
18118
- init_registry(),
18119
- init_bus(),
18120
- init_api_topic_config(),
18121
- init_api_topics(),
18122
- init_self_schedules()
18123
- ]);
18049
+ await init_api_topic_config();
18050
+ await init_api_topics();
18051
+ await init_self_schedules();
18124
18052
 
18125
18053
  // ../../packages/core/src/topics/links.ts
18126
18054
  function topicAppLink(topicId) {
@@ -18768,12 +18696,10 @@ var otiumVisualToolDefinitions = [
18768
18696
  ];
18769
18697
 
18770
18698
  // ../../packages/core/src/agents/public-helpers.ts
18699
+ await init_task_events();
18771
18700
  init_tool_format();
18701
+ await init_topic_cleanup();
18772
18702
  init_vault_tool_policy();
18773
- await __promiseAll([
18774
- init_task_events(),
18775
- init_topic_cleanup()
18776
- ]);
18777
18703
  export {
18778
18704
  withTaskSnapshots,
18779
18705
  withCodexSpawnSerial,
@@ -18830,4 +18756,4 @@ export {
18830
18756
  DEFAULT_SELF_CONFIG_PRODUCT
18831
18757
  };
18832
18758
 
18833
- //# debugId=260456A5E72011F164756E2164756E21
18759
+ //# debugId=15F87D2CCCF498CF64756E2164756E21