@ego-z/contracts 0.15.13 → 0.15.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ego-z/contracts",
3
- "version": "0.15.13",
3
+ "version": "0.15.15",
4
4
  "description": "Wire-format type contracts shared between EgoZ backend, SDK, MCP and console. Type-only — no runtime artifacts.",
5
5
  "types": "./src/index.d.ts",
6
6
  "exports": {
package/src/ask.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import type { Intent, JsonSchemaDefinition, ResponseFormat, TokenUsage } from './envelope';
9
- import type { InitContextItem, InitContextItemAccepted, InitContextUi } from './draft-conv';
9
+ import type { InitContextItem, InitContextItemAccepted, InitContextTenant, InitContextUi } from './draft-conv';
10
10
  import type { AskQuestionSet } from './questions';
11
11
 
12
12
  // ============================================================================
@@ -242,6 +242,32 @@ export interface AskRequestBody {
242
242
  */
243
243
  contextItems?: InitContextItem[];
244
244
 
245
+ /**
246
+ * The tenant AS IT IS NOW — sent when it may have changed since the
247
+ * conversation began.
248
+ *
249
+ * ── Why per-turn ─────────────────────────────────────────────────────
250
+ *
251
+ * The draft's `initContext.tenant` is captured once, and its `features`
252
+ * are rendered to the agent as a hard rule on every turn: disabled means
253
+ * "never offer". A tenant whose features change mid-conversation — a setup
254
+ * flow switching bookings on — would otherwise be told, turn after turn,
255
+ * that the thing it just enabled is off.
256
+ *
257
+ * ── Merged, and kept ─────────────────────────────────────────────────
258
+ *
259
+ * The keys you SEND replace the stored ones; keys you omit keep their
260
+ * stored value, and `null` clears one. `features` is replaced as a whole
261
+ * map — send the complete current set, not a delta. The merged block is
262
+ * kept on the conversation (except for a no-store tenant), so a later
263
+ * turn that omits this field still sees it.
264
+ *
265
+ * Validated exactly like `initContext.tenant`: an invalid block is a 400.
266
+ *
267
+ * Optional and additive: omit it and nothing changes.
268
+ */
269
+ tenant?: InitContextTenant;
270
+
245
271
  /**
246
272
  * Output a MACHINE produced for this turn — the result of something the
247
273
  * user asked to have run, not anything the user said.
@@ -275,6 +301,49 @@ export interface AskRequestBody {
275
301
  * Optional and additive: omit it and nothing changes.
276
302
  */
277
303
  machineOutput?: AskMachineOutput[];
304
+
305
+ /**
306
+ * A one-shot COMPLETION: `message` is the whole instruction, and EgoZ adds
307
+ * nothing from the project around it.
308
+ *
309
+ * ── What it switches off ─────────────────────────────────────────────
310
+ *
311
+ * The project's prompt, personality, session context, greeting, knowledge
312
+ * base, tools, memory and conversation title. Nothing is stored either:
313
+ * `true` implies `noStore`. The project still supplies the provider key,
314
+ * the quota and the model menu, so `model` works as usual.
315
+ *
316
+ * What remains is what you put on this request for a program to read:
317
+ * with `responseFormat: 'json_object'`, the `jsonSchema` instructions; and
318
+ * any `machineOutput`.
319
+ *
320
+ * ── Why it exists ────────────────────────────────────────────────────
321
+ *
322
+ * A project that serves a chat agent also answers one-off program calls
323
+ * (a classifier, a planner). Without this, such a call runs AS the agent —
324
+ * its persona, every enabled tool, a knowledge-base lookup and the
325
+ * project's conversation temperature — which is slower, costlier and less
326
+ * predictable than the call needs.
327
+ *
328
+ * ── Why it is explicit ───────────────────────────────────────────────
329
+ *
330
+ * A JSON turn is not implicitly a completion, stored or not: testing the
331
+ * agent itself answering in JSON is a real use. Only `true` changes
332
+ * anything.
333
+ *
334
+ * Optional and additive: omit it and nothing changes.
335
+ */
336
+ completion?: boolean;
337
+
338
+ /**
339
+ * The sampling temperature for a `completion`, from 0 to 2. Omit it to use
340
+ * the project's own.
341
+ *
342
+ * Accepted ONLY together with `completion: true`; on any other turn it is a
343
+ * 400. It is not a general per-call override: a conversation's temperature
344
+ * belongs to the project.
345
+ */
346
+ temperature?: number;
278
347
  }
279
348
 
280
349
  /**
@@ -456,6 +456,8 @@ export interface InitContextTenant {
456
456
  name?: string | null;
457
457
  description?: string | null;
458
458
  category?: string | null;
459
+ /** What the business is, in the caller's words — finer than `category` ("barbershop"). */
460
+ niche?: string | null;
459
461
  /** Enabled-feature flags, e.g. `{ products: true, booking: false }`. */
460
462
  features?: Record<string, boolean>;
461
463
  }