negotium 0.2.32 → 0.3.0

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.
@@ -147,11 +147,36 @@ export declare function findTopicTitleConflict(title: string, kind: TopicKind, o
147
147
  * lives in that adapter's database, not this one).
148
148
  */
149
149
  export declare function setTopicSurfaces(topicIds: readonly string[], surface: TopicSurface): number;
150
- /** Look up a topic by title, restricted to topics where `userId` participates. */
151
- export declare function getTopicByNameForUser(title: string, userId: string, opts?: {
152
- surface?: TopicSurface;
150
+ /**
151
+ * How wide a title lookup is allowed to reach.
152
+ *
153
+ * `surface` is required rather than optional. It used to default to "search
154
+ * every surface", which contradicted S-6's promise that a missed call site
155
+ * "cannot leak a topic across surfaces" — the guarantee only held where a
156
+ * caller remembered to opt in, and four did not: Telegram's `/load` and `/del`
157
+ * (the latter could delete a terminal room), the runtime MCP id path, the cron
158
+ * id path, and the session inbox. Every one of those was a silent leak with a
159
+ * correct-looking call. Making the parameter explicit turns each future
160
+ * omission into a compile error instead.
161
+ *
162
+ * `{ scope: "all" }` is the deliberate way to search every surface. It exists
163
+ * for operator tooling — the CLI manages jobs across surfaces on purpose — and
164
+ * reads as a decision at the call site rather than as an oversight.
165
+ */
166
+ export type TopicNameLookupScope = {
167
+ surface: TopicSurface;
153
168
  surfaceScope?: string | null;
154
- }): TopicDto | null;
169
+ } | {
170
+ scope: "all";
171
+ };
172
+ /**
173
+ * Look up a topic by title, restricted to topics where `userId` participates.
174
+ *
175
+ * Answers only on a single match: a title is unique per surface (S-3), so an
176
+ * `{ scope: "all" }` lookup of a name used on two surfaces resolves to null
177
+ * rather than picking one.
178
+ */
179
+ export declare function getTopicByNameForUser(title: string, userId: string, lookupScope: TopicNameLookupScope): TopicDto | null;
155
180
  /** Persist the agent session ID for a topic after a successful turn. */
156
181
  export declare function setTopicSessionId(topicId: string, sessionId: string, context?: TopicSessionLogContext): void;
157
182
  /** Clear the session ID (e.g. on topic reset). */
@@ -1 +1 @@
1
- export declare const NEGOTIUM_VERSION = "0.2.32";
1
+ export declare const NEGOTIUM_VERSION = "0.3.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "negotium",
3
- "version": "0.2.32",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Install the Negotium multi-agent runtime and CLI with one package",
6
6
  "license": "Apache-2.0",