@iveri/contracts 0.9.0 → 0.10.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.
- package/README.md +7 -1
- package/dist/cjs/api/unibox-ai/agent-run.type.d.ts +39 -0
- package/dist/cjs/api/unibox-ai/agent-run.type.d.ts.map +1 -0
- package/dist/cjs/api/unibox-ai/agent-run.type.js +9 -0
- package/dist/cjs/api/unibox-ai/agent-run.type.js.map +1 -0
- package/dist/cjs/api/unibox-ai/index.d.ts +2 -0
- package/dist/cjs/api/unibox-ai/index.d.ts.map +1 -0
- package/dist/cjs/api/unibox-ai/index.js +18 -0
- package/dist/cjs/api/unibox-ai/index.js.map +1 -0
- package/dist/cjs/enum/user-permission.enum.d.ts +3 -1
- package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -1
- package/dist/cjs/enum/user-permission.enum.js +3 -0
- package/dist/cjs/enum/user-permission.enum.js.map +1 -1
- package/dist/esm/api/unibox-ai/agent-run.type.d.ts +39 -0
- package/dist/esm/api/unibox-ai/agent-run.type.d.ts.map +1 -0
- package/dist/esm/api/unibox-ai/agent-run.type.js +6 -0
- package/dist/esm/api/unibox-ai/agent-run.type.js.map +1 -0
- package/dist/esm/api/unibox-ai/index.d.ts +2 -0
- package/dist/esm/api/unibox-ai/index.d.ts.map +1 -0
- package/dist/esm/api/unibox-ai/index.js +2 -0
- package/dist/esm/api/unibox-ai/index.js.map +1 -0
- package/dist/esm/enum/user-permission.enum.d.ts +3 -1
- package/dist/esm/enum/user-permission.enum.d.ts.map +1 -1
- package/dist/esm/enum/user-permission.enum.js +3 -0
- package/dist/esm/enum/user-permission.enum.js.map +1 -1
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ import type { AuthSession, Principal } from '@iveri/contracts/identity';
|
|
|
17
17
|
import type { Conversation, Message } from '@iveri/contracts/unibox';
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Five entry points, and no others — never `@iveri/contracts/dist/...`.
|
|
21
21
|
|
|
22
22
|
The per-service surfaces are **not** re-exported from the root, deliberately. Conduit owns a
|
|
23
23
|
`Provider`, a `Connection` and an `Endpoint`; Unibox owns a `Channel` and a `Contact` and would
|
|
@@ -105,6 +105,11 @@ Plus the request bodies for each, and the seven enums they are built from — `S
|
|
|
105
105
|
`ConversationStatus`, `MessageDirection`, `MessageAuthorType`, `MessageStatus`,
|
|
106
106
|
`MessageContentType`.
|
|
107
107
|
|
|
108
|
+
### `api/unibox-ai/` → `@iveri/contracts/unibox-ai`
|
|
109
|
+
|
|
110
|
+
The authenticated agent-runtime boundary: bounded conversation context, the handoff-aware agent
|
|
111
|
+
run request, and its acceptance statuses and response.
|
|
112
|
+
|
|
108
113
|
Two of those enums carry members nothing writes yet, and both are deliberate rather than
|
|
109
114
|
speculative. `MessageAuthorType.AI` exists before `unibox-ai` does, because it is what an agent
|
|
110
115
|
taking over reads to know what the customer was already told — adding it later would leave every
|
|
@@ -137,6 +142,7 @@ Conduit's outbox.
|
|
|
137
142
|
removed permission silently downgrades every live session whose token still carries it.
|
|
138
143
|
- Version `0.9.0` adds the first Commerce permissions: `commerce:catalog:read` and
|
|
139
144
|
`commerce:catalog:manage`.
|
|
145
|
+
- Version `0.10.0` adds the Unibox AI agent-run entry point and `unibox:ai:run` permission.
|
|
140
146
|
- Widening a type is minor; narrowing it is major.
|
|
141
147
|
- Under `api/`, the contract follows the service: add the field to the service's DTO and to the
|
|
142
148
|
interface in the same release, and let `implements` prove they agree.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { ConversationStatus } from '../unibox/conversation-status.enum.js';
|
|
5
|
+
import type { MessageAuthorType } from '../unibox/message-author-type.enum.js';
|
|
6
|
+
import type { MessageContentType } from '../unibox/message-content-type.enum.js';
|
|
7
|
+
/** A bounded message snapshot supplied to the agent runtime for one run. */
|
|
8
|
+
export interface AgentContextMessage {
|
|
9
|
+
id: UUID;
|
|
10
|
+
authorType: MessageAuthorType;
|
|
11
|
+
contentType: MessageContentType;
|
|
12
|
+
text: Nullable<string>;
|
|
13
|
+
sentAt: IsoDateTime;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `POST /api/v1/agent-runs`.
|
|
17
|
+
*
|
|
18
|
+
* The tenant is derived from the authenticated principal, never from this body. A non-null
|
|
19
|
+
* `handedOverAt` is authoritative: the runtime acknowledges the request without generating.
|
|
20
|
+
*/
|
|
21
|
+
export interface AgentRunRequest {
|
|
22
|
+
conversationId: UUID;
|
|
23
|
+
triggerMessageId: UUID;
|
|
24
|
+
contactDisplayName: string;
|
|
25
|
+
conversationStatus: ConversationStatus;
|
|
26
|
+
handedOverAt: Nullable<IsoDateTime>;
|
|
27
|
+
messages: AgentContextMessage[];
|
|
28
|
+
}
|
|
29
|
+
export declare enum AgentRunStatus {
|
|
30
|
+
ACCEPTED = "accepted",
|
|
31
|
+
HANDED_OVER = "handed_over"
|
|
32
|
+
}
|
|
33
|
+
/** The acceptance response; generation and delivery are separate later stages. */
|
|
34
|
+
export interface AgentRunAcceptedResponse {
|
|
35
|
+
runId: UUID;
|
|
36
|
+
status: AgentRunStatus;
|
|
37
|
+
acceptedAt: IsoDateTime;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=agent-run.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-run.type.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox-ai/agent-run.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,4EAA4E;AAC5E,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,IAAI,CAAC;IACT,UAAU,EAAE,iBAAiB,CAAC;IAC9B,WAAW,EAAE,kBAAkB,CAAC;IAChC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,cAAc,EAAE,IAAI,CAAC;IACrB,gBAAgB,EAAE,IAAI,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACpC,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACnC;AAED,oBAAY,cAAc;IACtB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;CAC9B;AAED,kFAAkF;AAClF,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;CAC3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentRunStatus = void 0;
|
|
4
|
+
var AgentRunStatus;
|
|
5
|
+
(function (AgentRunStatus) {
|
|
6
|
+
AgentRunStatus["ACCEPTED"] = "accepted";
|
|
7
|
+
AgentRunStatus["HANDED_OVER"] = "handed_over";
|
|
8
|
+
})(AgentRunStatus || (exports.AgentRunStatus = AgentRunStatus = {}));
|
|
9
|
+
//# sourceMappingURL=agent-run.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-run.type.js","sourceRoot":"","sources":["../../../../src/api/unibox-ai/agent-run.type.ts"],"names":[],"mappings":";;;AA+BA,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,uCAAqB,CAAA;IACrB,6CAA2B,CAAA;AAC/B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox-ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./agent-run.type.js"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/unibox-ai/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
|
|
@@ -179,7 +179,9 @@ export declare enum UserPermission {
|
|
|
179
179
|
UNIBOX_TEAM_MANAGE = "unibox:team:manage",
|
|
180
180
|
UNIBOX_CANNED_REPLY_READ = "unibox:canned-reply:read",
|
|
181
181
|
/** Author the saved replies every agent in the tenant will send. */
|
|
182
|
-
UNIBOX_CANNED_REPLY_MANAGE = "unibox:canned-reply:manage"
|
|
182
|
+
UNIBOX_CANNED_REPLY_MANAGE = "unibox:canned-reply:manage",
|
|
183
|
+
/** Allows a trusted service principal to submit bounded conversation context for generation. */
|
|
184
|
+
UNIBOX_AI_RUN = "unibox:ai:run"
|
|
183
185
|
}
|
|
184
186
|
/**
|
|
185
187
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-permission.enum.d.ts","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,cAAc;IAItB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,sFAAsF;IACtF,aAAa,kBAAkB;IAG/B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,eAAe,oBAAoB;IACnC,6EAA6E;IAC7E,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,sBAAsB,2BAA2B;IAGjD,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IAKjC,qEAAqE;IACrE,qBAAqB,0BAA0B;IAC/C,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;IAGnD;;;;OAIG;IACH,oBAAoB,yBAAyB;IAC7C,sBAAsB,2BAA2B;IAGjD;;;;OAIG;IACH,sBAAsB,2BAA2B;IAGjD,qBAAqB,0BAA0B;IAC/C,yFAAyF;IACzF,uBAAuB,4BAA4B;IAGnD,mEAAmE;IACnE,wBAAwB,6BAA6B;IACrD;;;;;;;OAOG;IACH,0BAA0B,+BAA+B;IAGzD,kBAAkB,uBAAuB;IACzC,2DAA2D;IAC3D,oBAAoB,yBAAyB;IAG7C;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;OAMG;IACH,wBAAwB,6BAA6B;IAGrD,wFAAwF;IACxF,sBAAsB,2BAA2B;IACjD;;;;;;;;OAQG;IACH,wBAAwB,6BAA6B;IAGrD,sEAAsE;IACtE,uBAAuB,4BAA4B;IACnD;;;;;OAKG;IACH,yBAAyB,8BAA8B;IAGvD;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;;OAOG;IACH,qBAAqB,0BAA0B;IAC/C,qEAAqE;IACrE,wBAAwB,6BAA6B;IAKrD,4EAA4E;IAC5E,qBAAqB,0BAA0B;IAC/C,yEAAyE;IACzE,uBAAuB,4BAA4B;IAKnD,kFAAkF;IAClF,mBAAmB,wBAAwB;IAC3C;;;;;;OAMG;IACH,qBAAqB,0BAA0B;IAG/C,2FAA2F;IAC3F,mBAAmB,wBAAwB;IAC3C,gDAAgD;IAChD,qBAAqB,0BAA0B;IAG/C;;;;;;;OAOG;IACH,wBAAwB,6BAA6B;IACrD,yFAAyF;IACzF,0BAA0B,+BAA+B;IACzD;;;;;;OAMG;IACH,0BAA0B,+BAA+B;IAGzD;;;;;;OAMG;IACH,mBAAmB,wBAAwB;IAG3C,gBAAgB,qBAAqB;IACrC,8FAA8F;IAC9F,kBAAkB,uBAAuB;IAGzC,wBAAwB,6BAA6B;IACrD,oEAAoE;IACpE,0BAA0B,+BAA+B;
|
|
1
|
+
{"version":3,"file":"user-permission.enum.d.ts","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,cAAc;IAItB,WAAW,gBAAgB;IAC3B,aAA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kFAAkF;IAClF,mBAAmB,wBAAwB;IAC3C;;;;;;OAMG;IACH,qBAAqB,0BAA0B;IAG/C,2FAA2F;IAC3F,mBAAmB,wBAAwB;IAC3C,gDAAgD;IAChD,qBAAqB,0BAA0B;IAG/C;;;;;;;OAOG;IACH,wBAAwB,6BAA6B;IACrD,yFAAyF;IACzF,0BAA0B,+BAA+B;IACzD;;;;;;OAMG;IACH,0BAA0B,+BAA+B;IAGzD;;;;;;OAMG;IACH,mBAAmB,wBAAwB;IAG3C,gBAAgB,qBAAqB;IACrC,8FAA8F;IAC9F,kBAAkB,uBAAuB;IAGzC,wBAAwB,6BAA6B;IACrD,oEAAoE;IACpE,0BAA0B,+BAA+B;IAGzD,gGAAgG;IAChG,aAAa,kBAAkB;CAClC;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAAiD,CAAC"}
|
|
@@ -210,6 +210,9 @@ var UserPermission;
|
|
|
210
210
|
UserPermission["UNIBOX_CANNED_REPLY_READ"] = "unibox:canned-reply:read";
|
|
211
211
|
/** Author the saved replies every agent in the tenant will send. */
|
|
212
212
|
UserPermission["UNIBOX_CANNED_REPLY_MANAGE"] = "unibox:canned-reply:manage";
|
|
213
|
+
// ── AI runtime ──────────────────────────────────────────────────────────
|
|
214
|
+
/** Allows a trusted service principal to submit bounded conversation context for generation. */
|
|
215
|
+
UserPermission["UNIBOX_AI_RUN"] = "unibox:ai:run";
|
|
213
216
|
})(UserPermission || (exports.UserPermission = UserPermission = {}));
|
|
214
217
|
/**
|
|
215
218
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names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AQG;IACH,uEAAqD,CAAA;IAErD,2EAA2E;IAC3E,sEAAsE;IACtE,qEAAmD,CAAA;IACnD;;;;;OAKG;IACH,yEAAuD,CAAA;IAEvD,2EAA2E;IAC3E;;;;;OAKG;IACH,iEAA+C,CAAA;IAC/C;;;;;;;OAOG;IACH,iEAA+C,CAAA;IAC/C,qEAAqE;IACrE,uEAAqD,CAAA;IAErD,4EAA4E;IAE5E,2EAA2E;IAC3E,4EAA4E;IAC5E,iEAA+C,CAAA;IAC/C,yEAAyE;IACzE,qEAAmD,CAAA;IAEnD,4EAA4E;IAE5E,2EAA2E;IAC3E,kFAAkF;IAClF,6DAA2C,CAAA;IAC3C;;;;;;OAMG;IACH,iEAA+C,CAAA;IAE/C,2EAA2E;IAC3E,2FAA2F;IAC3F,6DAA2C,CAAA;IAC3C,gDAAgD;IAChD,iEAA+C,CAAA;IAE/C,2EAA2E;IAC3E;;;;;;;OAOG;IACH,uEAAqD,CAAA;IACrD,yFAAyF;IACzF,2EAAyD,CAAA;IACzD;;;;;;OAMG;IACH,2EAAyD,CAAA;IAEzD,2EAA2E;IAC3E;;;;;;OAMG;IACH,6DAA2C,CAAA;IAE3C,2EAA2E;IAC3E,uDAAqC,CAAA;IACrC,8FAA8F;IAC9F,2DAAyC,CAAA;IAEzC,2EAA2E;IAC3E,uEAAqD,CAAA;IACrD,oEAAoE;IACpE,2EAAyD,CAAA;IAEzD,2EAA2E;IAC3E,gGAAgG;IAChG,iDAA+B,CAAA;AACnC,CAAC,EA3NW,cAAc,8BAAd,cAAc,QA2NzB;AAED;;;;;GAKG;AACU,QAAA,oBAAoB,GAA8B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { ConversationStatus } from '../unibox/conversation-status.enum.js';
|
|
5
|
+
import type { MessageAuthorType } from '../unibox/message-author-type.enum.js';
|
|
6
|
+
import type { MessageContentType } from '../unibox/message-content-type.enum.js';
|
|
7
|
+
/** A bounded message snapshot supplied to the agent runtime for one run. */
|
|
8
|
+
export interface AgentContextMessage {
|
|
9
|
+
id: UUID;
|
|
10
|
+
authorType: MessageAuthorType;
|
|
11
|
+
contentType: MessageContentType;
|
|
12
|
+
text: Nullable<string>;
|
|
13
|
+
sentAt: IsoDateTime;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `POST /api/v1/agent-runs`.
|
|
17
|
+
*
|
|
18
|
+
* The tenant is derived from the authenticated principal, never from this body. A non-null
|
|
19
|
+
* `handedOverAt` is authoritative: the runtime acknowledges the request without generating.
|
|
20
|
+
*/
|
|
21
|
+
export interface AgentRunRequest {
|
|
22
|
+
conversationId: UUID;
|
|
23
|
+
triggerMessageId: UUID;
|
|
24
|
+
contactDisplayName: string;
|
|
25
|
+
conversationStatus: ConversationStatus;
|
|
26
|
+
handedOverAt: Nullable<IsoDateTime>;
|
|
27
|
+
messages: AgentContextMessage[];
|
|
28
|
+
}
|
|
29
|
+
export declare enum AgentRunStatus {
|
|
30
|
+
ACCEPTED = "accepted",
|
|
31
|
+
HANDED_OVER = "handed_over"
|
|
32
|
+
}
|
|
33
|
+
/** The acceptance response; generation and delivery are separate later stages. */
|
|
34
|
+
export interface AgentRunAcceptedResponse {
|
|
35
|
+
runId: UUID;
|
|
36
|
+
status: AgentRunStatus;
|
|
37
|
+
acceptedAt: IsoDateTime;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=agent-run.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-run.type.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox-ai/agent-run.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,k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c,KAAd,cAAc,QAGzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox-ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/unibox-ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -179,7 +179,9 @@ export declare enum UserPermission {
|
|
|
179
179
|
UNIBOX_TEAM_MANAGE = "unibox:team:manage",
|
|
180
180
|
UNIBOX_CANNED_REPLY_READ = "unibox:canned-reply:read",
|
|
181
181
|
/** Author the saved replies every agent in the tenant will send. */
|
|
182
|
-
UNIBOX_CANNED_REPLY_MANAGE = "unibox:canned-reply:manage"
|
|
182
|
+
UNIBOX_CANNED_REPLY_MANAGE = "unibox:canned-reply:manage",
|
|
183
|
+
/** Allows a trusted service principal to submit bounded conversation context for generation. */
|
|
184
|
+
UNIBOX_AI_RUN = "unibox:ai:run"
|
|
183
185
|
}
|
|
184
186
|
/**
|
|
185
187
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-permission.enum.d.ts","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,cAAc;IAItB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,sFAAsF;IACtF,aAAa,kBAAkB;IAG/B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,eAAe,oBAAoB;IACnC,6EAA6E;IAC7E,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,sBAAsB,2BAA2B;IAGjD,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAA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;IACjD;;;;;;;;OAQG;IACH,wBAAwB,6BAA6B;IAGrD,sEAAsE;IACtE,uBAAuB,4BAA4B;IACnD;;;;;OAKG;IACH,yBAAyB,8BAA8B;IAGvD;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;;OAOG;IACH,qBAAqB,0BAA0B;IAC/C,qEAAqE;IACrE,wBAAwB,6BAA6B;IAKrD,4EAA4E;IAC5E,qBAAqB,0BAA0B;IAC/C,yEAAyE;IACzE,uBAAuB,4BAA4B;IAKnD,kFAAkF;IAClF,mBAAmB,wBAAwB;IAC3C;;;;;;OAMG;IACH,qBAAqB,0BAA0B;IAG/C,2FAA2F;IAC3F,mBAAmB,wBAAwB;IAC3C,gDAAgD;IAChD,qBAAqB,0BAA0B;IAG/C;;;;;;;OAOG;IACH,wBAAwB,6BAA6B;IACrD,yFAAyF;IACzF,0BAA0B,+BAA+B;IACzD;;;;;;OAMG;IACH,0BAA0B,+BAA+B;IAGzD;;;;;;OAMG;IACH,mBAAmB,wBAAwB;IAG3C,gBAAgB,qBAAqB;IACrC,8FAA8F;IAC9F,kBAAkB,uBAAuB;IAGzC,wBAAwB,6BAA6B;IACrD,oEAAoE;IACpE,0BAA0B,+BAA+B;IAGzD,gGAAgG;IAChG,aAAa,kBAAkB;CAClC;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAAiD,CAAC"}
|
|
@@ -207,6 +207,9 @@ export var UserPermission;
|
|
|
207
207
|
UserPermission["UNIBOX_CANNED_REPLY_READ"] = "unibox:canned-reply:read";
|
|
208
208
|
/** Author the saved replies every agent in the tenant will send. */
|
|
209
209
|
UserPermission["UNIBOX_CANNED_REPLY_MANAGE"] = "unibox:canned-reply:manage";
|
|
210
|
+
// ── AI runtime ──────────────────────────────────────────────────────────
|
|
211
|
+
/** Allows a trusted service principal to submit bounded conversation context for generation. */
|
|
212
|
+
UserPermission["UNIBOX_AI_RUN"] = "unibox:ai:run";
|
|
210
213
|
})(UserPermission || (UserPermission = {}));
|
|
211
214
|
/**
|
|
212
215
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,cA2NX;AA3ND,WAAY,cAAc;IACtB,4EAA4E;IAE5E,2EAA2E;IAC3E,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAC/B,sFAAsF;IACtF,iDAA+B,CAAA;IAE/B,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,qDAAmC,CAAA;IACnC,6EAA6E;IAC7E,yDAAuC,CAAA;IACvC;;;OAGG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,+CAA6B,CAAA;IAC7B,iDAA+B,CAAA;IAC/B,mDAAiC,CAAA;IAEjC,4EAA4E;IAE5E,2EAA2E;IAC3E,qEAAqE;IACrE,iEAA+C,CAAA;IAC/C,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IAEnD,2EAA2E;IAC3E;;;;OAIG;IACH,+DAA6C,CAAA;IAC7C,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E;;;;OAIG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,iEAA+C,CAAA;IAC/C,yFAAyF;IACzF,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IAChG,iDAA+B,CAAA;AACnC,CAAC,EA3NW,cAAc,KAAd,cAAc,QA2NzB;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA8B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iveri/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -39,6 +39,11 @@
|
|
|
39
39
|
"import": "./dist/esm/api/unibox/index.js",
|
|
40
40
|
"require": "./dist/cjs/api/unibox/index.js"
|
|
41
41
|
},
|
|
42
|
+
"./unibox-ai": {
|
|
43
|
+
"types": "./dist/cjs/api/unibox-ai/index.d.ts",
|
|
44
|
+
"import": "./dist/esm/api/unibox-ai/index.js",
|
|
45
|
+
"require": "./dist/cjs/api/unibox-ai/index.js"
|
|
46
|
+
},
|
|
42
47
|
"./package.json": "./package.json"
|
|
43
48
|
},
|
|
44
49
|
"typesVersions": {
|
|
@@ -51,6 +56,9 @@
|
|
|
51
56
|
],
|
|
52
57
|
"unibox": [
|
|
53
58
|
"./dist/cjs/api/unibox/index.d.ts"
|
|
59
|
+
],
|
|
60
|
+
"unibox-ai": [
|
|
61
|
+
"./dist/cjs/api/unibox-ai/index.d.ts"
|
|
54
62
|
]
|
|
55
63
|
}
|
|
56
64
|
},
|