@otium-team/negotium 0.24.2 → 0.24.3

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/main.js CHANGED
@@ -8934,7 +8934,7 @@ var init_codex = __esm(async () => {
8934
8934
  });
8935
8935
 
8936
8936
  // ../../packages/core/src/version.ts
8937
- var NEGOTIUM_VERSION = "0.24.2";
8937
+ var NEGOTIUM_VERSION = "0.24.3";
8938
8938
 
8939
8939
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
8940
8940
  import { spawn as spawn2 } from "child_process";
@@ -10498,6 +10498,16 @@ function createBrowserProfile(ownerId, rawName) {
10498
10498
  db.query("INSERT OR IGNORE INTO browser_profiles (owner_id, name, created_at) VALUES (?, ?, ?)").run("local", name, new Date().toISOString());
10499
10499
  return name;
10500
10500
  }
10501
+ function setTopicBrowserProfile(topicId, profile) {
10502
+ const owner = getBrowserProfileOwner(topicId, "");
10503
+ if (!owner)
10504
+ throw new Error(`Topic "${topicId}" not found or has no owner.`);
10505
+ assignTopicBrowserProfile({
10506
+ topicId,
10507
+ actorUserId: owner,
10508
+ profile: profile ?? DEFAULT_BROWSER_PROFILE
10509
+ });
10510
+ }
10501
10511
  function assignTopicBrowserProfile(opts) {
10502
10512
  const actualOwner = getBrowserProfileOwner(opts.topicId, "");
10503
10513
  if (!actualOwner)
@@ -29505,6 +29515,13 @@ function updateTopicSettings(opts) {
29505
29515
  if (opts.browserConnectPort !== undefined && opts.browserConnectPort !== null && !isBrowserConnectPort(opts.browserConnectPort)) {
29506
29516
  throw new TopicValidationError("browserConnectPort must be an integer from 1024 to 65535");
29507
29517
  }
29518
+ if (opts.browserProfile !== undefined && opts.browserProfile !== null) {
29519
+ try {
29520
+ normalizeBrowserProfileName(opts.browserProfile);
29521
+ } catch (err) {
29522
+ throw new TopicValidationError(`browserProfile: ${err instanceof Error ? err.message : String(err)}`);
29523
+ }
29524
+ }
29508
29525
  if (opts.plugins)
29509
29526
  checkTopicPlugins(current, opts.plugins);
29510
29527
  if (opts.agent !== undefined && opts.agent !== null && !isAgentKind(opts.agent)) {
@@ -29561,6 +29578,8 @@ function updateTopicSettings(opts) {
29561
29578
  if (opts.browserConnectPort !== undefined) {
29562
29579
  setTopicBrowserConnectPort(next.id, opts.browserConnectPort);
29563
29580
  }
29581
+ if (opts.browserProfile !== undefined)
29582
+ setTopicBrowserProfile(next.id, opts.browserProfile);
29564
29583
  if (opts.plugins !== undefined)
29565
29584
  setTopicPlugins(next.id, opts.plugins);
29566
29585
  const config = getApiTopicConfig(next.id);
@@ -39194,6 +39213,7 @@ function createNodeControlHandler(options) {
39194
39213
  "canonical-topic-update",
39195
39214
  "canonical-topic-description",
39196
39215
  "canonical-topic-browser-connect",
39216
+ "canonical-topic-browser-profile",
39197
39217
  "topic-plugins",
39198
39218
  "canonical-topic-delete",
39199
39219
  "turn-submit-silent",
@@ -40319,6 +40339,9 @@ function createNodeControlHandler(options) {
40319
40339
  if (body.browserConnectPort !== undefined && body.browserConnectPort !== null && typeof body.browserConnectPort !== "number") {
40320
40340
  return jsonError(400, "browserConnectPort must be a number or null");
40321
40341
  }
40342
+ if (body.browserProfile !== undefined && body.browserProfile !== null && typeof body.browserProfile !== "string") {
40343
+ return jsonError(400, "browserProfile must be a string or null");
40344
+ }
40322
40345
  if (body.plugins !== undefined && body.plugins !== null && !(Array.isArray(body.plugins) && body.plugins.every((dir) => typeof dir === "string"))) {
40323
40346
  return jsonError(400, "plugins must be a list of folder paths or null");
40324
40347
  }
@@ -40332,6 +40355,7 @@ function createNodeControlHandler(options) {
40332
40355
  ...body.aiMode !== undefined ? { aiMode: body.aiMode } : {},
40333
40356
  ...body.description !== undefined ? { description: body.description } : {},
40334
40357
  ...body.browserConnectPort !== undefined ? { browserConnectPort: body.browserConnectPort } : {},
40358
+ ...body.browserProfile !== undefined ? { browserProfile: body.browserProfile } : {},
40335
40359
  ...body.plugins !== undefined ? { plugins: body.plugins } : {}
40336
40360
  });
40337
40361
  return Response.json({ ok: true, v: NODE_RUNTIME_CONTRACT_VERSION, topic });
@@ -61337,4 +61361,4 @@ switch (command) {
61337
61361
  }
61338
61362
  }
61339
61363
 
61340
- //# debugId=36D8D1C0A0825AED64756E2164756E21
61364
+ //# debugId=256C1E80D30E10ED64756E2164756E21