@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/registry.js CHANGED
@@ -133,7 +133,7 @@ var codexRegistryOperations = {
133
133
  return { sessionId: threadId, rolloutPath };
134
134
  },
135
135
  async forkSession({ parentSessionId }) {
136
- const { forkCodexSession } = await import("./chunk-8nr3h475.js");
136
+ const { forkCodexSession } = await import("./chunk-rpymxwjr.js");
137
137
  return await forkCodexSession(parentSessionId);
138
138
  },
139
139
  async cleanupRollouts({ sessionIds }) {
File without changes
@@ -91,6 +91,22 @@ export function createBrowserProfile(ownerId: string, rawName: string): string {
91
91
  return name;
92
92
  }
93
93
 
94
+ /**
95
+ * The host's assignment of a room to a browser profile (`PATCH /topics/:id`
96
+ * `browserProfile`): the room's owner's, as `assignTopicBrowserProfile` makes
97
+ * it when the owner asks from inside the room. `null` returns the room to the
98
+ * default profile. Takes effect on the room's next turn.
99
+ */
100
+ export function setTopicBrowserProfile(topicId: string, profile: string | null): void {
101
+ const owner = getBrowserProfileOwner(topicId, "");
102
+ if (!owner) throw new Error(`Topic "${topicId}" not found or has no owner.`);
103
+ assignTopicBrowserProfile({
104
+ topicId,
105
+ actorUserId: owner,
106
+ profile: profile ?? DEFAULT_BROWSER_PROFILE,
107
+ });
108
+ }
109
+
94
110
  export function assignTopicBrowserProfile(opts: {
95
111
  topicId: string;
96
112
  actorUserId: string;
@@ -27,7 +27,12 @@ import {
27
27
  setTopicPlugins,
28
28
  upsertTopic,
29
29
  } from "#storage/api-topics";
30
- import { isBrowserConnectPort, setTopicBrowserConnectPort } from "#storage/browser-profiles";
30
+ import {
31
+ isBrowserConnectPort,
32
+ normalizeBrowserProfileName,
33
+ setTopicBrowserConnectPort,
34
+ setTopicBrowserProfile,
35
+ } from "#storage/browser-profiles";
31
36
  import { db } from "#storage/forum-db";
32
37
  import { getTopicHostMcpGrant } from "#storage/topic-host-mcp-grants";
33
38
  import { TopicValidationError } from "#topics/create";
@@ -58,6 +63,12 @@ export interface UpdateTopicSettingsOptions {
58
63
  * its browser tools attach there. `null` returns the room to its profile.
59
64
  */
60
65
  browserConnectPort?: number | null;
66
+ /**
67
+ * The named browser profile the room's browser tools use from its next
68
+ * turn: rooms on one profile share one browser and its logins. `null`
69
+ * returns the room to the default profile.
70
+ */
71
+ browserProfile?: string | null;
61
72
  /**
62
73
  * Absolute paths of Agent Plugins folders (`#topics/plugins`) whose
63
74
  * skills and servers every turn of the room gets, in this order. Each is
@@ -192,6 +203,15 @@ export function updateTopicSettings(opts: UpdateTopicSettingsOptions): TopicDto
192
203
  ) {
193
204
  throw new TopicValidationError("browserConnectPort must be an integer from 1024 to 65535");
194
205
  }
206
+ if (opts.browserProfile !== undefined && opts.browserProfile !== null) {
207
+ try {
208
+ normalizeBrowserProfileName(opts.browserProfile);
209
+ } catch (err) {
210
+ throw new TopicValidationError(
211
+ `browserProfile: ${err instanceof Error ? err.message : String(err)}`,
212
+ );
213
+ }
214
+ }
195
215
 
196
216
  if (opts.plugins) checkTopicPlugins(current, opts.plugins);
197
217
 
@@ -279,6 +299,7 @@ export function updateTopicSettings(opts: UpdateTopicSettingsOptions): TopicDto
279
299
  if (opts.browserConnectPort !== undefined) {
280
300
  setTopicBrowserConnectPort(next.id, opts.browserConnectPort);
281
301
  }
302
+ if (opts.browserProfile !== undefined) setTopicBrowserProfile(next.id, opts.browserProfile);
282
303
  if (opts.plugins !== undefined) setTopicPlugins(next.id, opts.plugins);
283
304
 
284
305
  // `resolveTopicTurnExecution` reads `config.model ?? topic.defaultModel`, so a
@@ -1 +1 @@
1
- export const NEGOTIUM_VERSION = "0.24.2";
1
+ export const NEGOTIUM_VERSION = "0.24.3";
@@ -18,6 +18,13 @@ export declare function getTopicBrowserConnectPort(topicId: string): number | un
18
18
  export declare function setTopicBrowserConnectPort(topicId: string, port: number | null): void;
19
19
  export declare function hasBrowserProfileTopic(topicId: string): boolean;
20
20
  export declare function createBrowserProfile(ownerId: string, rawName: string): string;
21
+ /**
22
+ * The host's assignment of a room to a browser profile (`PATCH /topics/:id`
23
+ * `browserProfile`): the room's owner's, as `assignTopicBrowserProfile` makes
24
+ * it when the owner asks from inside the room. `null` returns the room to the
25
+ * default profile. Takes effect on the room's next turn.
26
+ */
27
+ export declare function setTopicBrowserProfile(topicId: string, profile: string | null): void;
21
28
  export declare function assignTopicBrowserProfile(opts: {
22
29
  topicId: string;
23
30
  actorUserId: string;
@@ -1 +1 @@
1
- export declare const NEGOTIUM_VERSION = "0.24.2";
1
+ export declare const NEGOTIUM_VERSION = "0.24.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otium-team/negotium",
3
- "version": "0.24.2",
3
+ "version": "0.24.3",
4
4
  "type": "module",
5
5
  "description": "Install the Negotium multi-agent runtime and CLI with one package",
6
6
  "license": "Apache-2.0",