@segmentstream/ontology 0.181.0 → 0.183.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/CHANGELOG.md +36 -0
- package/README.md +23 -15
- package/dist/action.d.ts +11 -4
- package/dist/agent-chat.d.ts +8 -2
- package/dist/agent-chat.js +45 -29
- package/dist/agent-draft.d.ts +8 -8
- package/dist/analyze.d.ts +7 -9
- package/dist/analyze.js +159 -71
- package/dist/authoring.js +7 -1
- package/dist/chat.d.ts +32 -3
- package/dist/chat.js +33 -12
- package/dist/index.d.ts +1 -1
- package/dist/manifest.d.ts +174 -68
- package/dist/manifest.js +33 -2
- package/dist/migrate/model.d.ts +94 -50
- package/dist/permissions.d.ts +17 -0
- package/dist/permissions.js +17 -0
- package/dist/render.d.ts +6 -0
- package/dist/render.js +25 -10
- package/dist/runtime/agent-web.js +47 -26
- package/dist/runtime/agents.js +25 -0
- package/dist/runtime/guests.d.ts +4 -1
- package/dist/runtime/guests.js +24 -5
- package/dist/runtime/pipeline.d.ts +3 -3
- package/dist/runtime/pipeline.js +11 -4
- package/dist/service/agent/server.d.ts +0 -2
- package/dist/service/agent/server.js +42 -47
- package/dist/service/authentication.js +14 -3
- package/dist/service/catalog.js +3 -3
- package/dist/service/chat/chat-draft.d.ts +1 -1
- package/dist/service/chat/delivery.js +43 -22
- package/dist/service/chat/envelope.d.ts +8 -8
- package/dist/service/chat/local-reads.d.ts +5 -5
- package/dist/service/chat/routes.js +2 -0
- package/dist/service/chat/schemas.d.ts +40 -0
- package/dist/service/chat/schemas.js +3 -1
- package/dist/service/discovery-search.d.ts +1 -1
- package/dist/service/mcp/server.js +2 -0
- package/dist/service/mcp/tools.d.ts +10 -2
- package/dist/service/mcp/tools.js +11 -4
- package/dist/service/operations.js +10 -5
- package/dist/service/plan.d.ts +3 -1
- package/dist/service/plan.js +4 -2
- package/dist/service/runtime-contract.d.ts +3 -1
- package/dist/service/runtime-identity.d.ts +1 -0
- package/dist/service/runtime-identity.js +2 -0
- package/dist/service/schemas.d.ts +8 -0
- package/dist/service/service.js +2 -12
- package/dist/service/toolsets.d.ts +1 -1
- package/dist/service/toolsets.js +38 -4
- package/dist/sign-in.d.ts +14 -7
- package/dist/sign-in.js +4 -3
- package/dist/toolset.d.ts +17 -1
- package/package.json +1 -1
- package/dist/service/agent/public-group-action.d.ts +0 -23
- package/dist/service/agent/public-group-action.js +0 -53
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.183.0
|
|
4
|
+
|
|
5
|
+
`agent_chat.send` is the one action that sends a message to a chat, in the voice its new `as`
|
|
6
|
+
names: `as: "agent"`, the default and what `send` did before, as the agent without attribution,
|
|
7
|
+
under `agent_chat:send`; or `as: "me"`, the caller's own message signed through
|
|
8
|
+
`chat.attribution`, exactly as `postMessage` posts it, under `agent_chat:post_message`.
|
|
9
|
+
|
|
10
|
+
- Either permission opens the action, and the delivery checks the voice's own, scoped grants
|
|
11
|
+
included: `agent_chat:send` alone cannot write as oneself, nor `agent_chat:post_message` alone as
|
|
12
|
+
the agent. Existing grants keep their meaning, and input still never names another sender.
|
|
13
|
+
- `files`, `buttons`, `template` and `replyTo` work in both voices. A WhatsApp template cannot
|
|
14
|
+
carry an attribution: in the caller's voice it goes only where their message is unsigned, a
|
|
15
|
+
member's own reply in the inbox under `inbox.attribution: "none"`, and is refused elsewhere with
|
|
16
|
+
`refusal: "attribution_unsupported"` before anything is reserved.
|
|
17
|
+
- `send` lists the chat connections it sends through in the manifest, as `postMessage` does, so a
|
|
18
|
+
preview deployment refuses it as it refuses posting.
|
|
19
|
+
- `previewMessage` is unchanged: it previews a text post in the caller's voice, what `send` with
|
|
20
|
+
`as: "me"` delivers, under `agent_chat:post_message`.
|
|
21
|
+
- An action may name several permissions, `permission: [a, b]`, any one of which runs it, for an
|
|
22
|
+
action whose input chooses what it does and that checks inside, with `isAllowed`, what the
|
|
23
|
+
choice needs. Such an action writes nothing itself (a `prepare` without a handler); `check`
|
|
24
|
+
refuses a list on any other. The manifest writes the list as the action's `anyOf`, with
|
|
25
|
+
`permission` its first, and the catalog, `describe` and MCP offer the action to a holder of any.
|
|
26
|
+
- The starter's guidance for coding agents sends chat messages with `agent_chat.send`.
|
|
27
|
+
|
|
28
|
+
Action required: replace `agent_chat.postMessage(input)` with
|
|
29
|
+
`agent_chat.send({ ...input, as: "me" })`, the MCP tool `chat_post_message` with `chat_send` and
|
|
30
|
+
`as: "me"`, and `POST /api/ontology/chat/actions/post_message` with
|
|
31
|
+
`POST /api/ontology/agent_chat/actions/send` and `"as": "me"` in its input. The earlier names post
|
|
32
|
+
exactly as `send` with `as: "me"` until 2027-05-27, a key spent through one being the same delivery
|
|
33
|
+
through the other; after that date they stop working. `previewMessage` stays.
|
|
34
|
+
|
|
35
|
+
## 0.182.0
|
|
36
|
+
|
|
37
|
+
Guest turns on admitted messaging channels use workspace roles, regular agent personas, and ontology tools. Workspaces select guest roles by channel and can handle authorized provider tools in workspace code. This replaces isolated group responses and their dedicated action and connection bindings.
|
|
38
|
+
|
|
3
39
|
## 0.181.0
|
|
4
40
|
|
|
5
41
|
The ontology service applies reply review. `POST /api/ontology/agent/replies` takes a reply the
|
package/README.md
CHANGED
|
@@ -659,9 +659,10 @@ with its input in TypeScript names; so do the workflow's `connections`. Every re
|
|
|
659
659
|
through the same path as the HTTP routes: it is checked against the workflow user's permissions,
|
|
660
660
|
validated, and recorded in history under the workflow user. Batch writes (`createMany`,
|
|
661
661
|
`updateMany`, `upsertMany`) are refused in steps; run an action that writes the batch. In production,
|
|
662
|
-
workflow roles can explicitly grant `agent_chat:post_message`
|
|
663
|
-
|
|
664
|
-
agent
|
|
662
|
+
workflow roles can explicitly grant `agent_chat:post_message` for attributed chat delivery,
|
|
663
|
+
`agent_chat.send` with `as: "me"`, and its destination preview, `previewMessage`, or
|
|
664
|
+
`agent_chat:send` for `send` as the agent. Preview deployments refuse sending; agent tasks cannot
|
|
665
|
+
send to chat on either target.
|
|
665
666
|
|
|
666
667
|
A step calls a model through Vercel AI Gateway with the AI SDK (`ai`), outside `run`: the
|
|
667
668
|
deployment authenticates with its Vercel project identity, so the workspace holds no key. Give
|
|
@@ -730,8 +731,8 @@ async function draftReply(input: { message: string }) {
|
|
|
730
731
|
predates tasks, or the run is outside production), `busy` (the workspace has 10 live tasks; the
|
|
731
732
|
agent was not called) or `agent_failed` (its turn failed, its cost cap included); or
|
|
732
733
|
`{ status: "timed_out" }`. Text beyond 65,536 characters is cut and marked `truncated`.
|
|
733
|
-
- A task cannot post to chat in this release: `agent_chat.
|
|
734
|
-
whatever the role grants. The answer reaches people through the workflow's later steps.
|
|
734
|
+
- A task cannot post to chat in this release: `agent_chat.send` is refused for a task in either
|
|
735
|
+
voice, as is its earlier name `post_message`, whatever the role grants. The answer reaches people through the workflow's later steps.
|
|
735
736
|
- At least once: a start step retried after the agent accepted the task hands it over again, and
|
|
736
737
|
the agent ends the earlier session. Write prompts and later steps that tolerate a repeat.
|
|
737
738
|
- Tasks run only in production, where the agent's runtime tokens are valid. Locally and in
|
|
@@ -1543,8 +1544,13 @@ its id, with their files as the chat's attachments, for a caller with `agent_cha
|
|
|
1543
1544
|
`agent_chat:read` and `agent_chat:update`, granted explicitly; wildcard entity grants do not
|
|
1544
1545
|
cover this built-in registry.
|
|
1545
1546
|
|
|
1546
|
-
|
|
1547
|
-
`ChatDelivery
|
|
1547
|
+
`agent_chat.send` (MCP `chat_send`) sends exact text directly through the ontology service's
|
|
1548
|
+
`ChatDelivery`, as the agent by default, under `agent_chat:send`, or with `as: "me"` in the
|
|
1549
|
+
caller's own voice, signed through `chat.attribution`, under `agent_chat:post_message`. Either
|
|
1550
|
+
grant opens the action, and the delivery checks the voice's own, scopes included; input never
|
|
1551
|
+
names another sender. Its earlier name for `as: "me"`, `postMessage` (MCP `chat_post_message`,
|
|
1552
|
+
`POST /api/ontology/chat/actions/post_message`), works the same until 2027-05-27. <!-- @legacy ontology.chat-post-message --> Nothing it
|
|
1553
|
+
sends starts an agent turn. Configure a declared provider connection:
|
|
1548
1554
|
|
|
1549
1555
|
```ts
|
|
1550
1556
|
const telegram = connection("telegram", { description: "Workspace Telegram bot." });
|
|
@@ -1556,8 +1562,8 @@ defineOntology({
|
|
|
1556
1562
|
});
|
|
1557
1563
|
```
|
|
1558
1564
|
|
|
1559
|
-
Grant `agent_chat:post_message` explicitly (`agent_chat:*`
|
|
1560
|
-
`agent_chat:send_message` grant does not grant posting. The old send action, instruction relay,
|
|
1565
|
+
Grant `agent_chat:post_message` and `agent_chat:send` explicitly (`agent_chat:*` covers both).
|
|
1566
|
+
The former `agent_chat:send_message` grant does not grant posting. The old send action, instruction relay,
|
|
1561
1567
|
`AgentChannel`/`AgentMessage` exports and agent-origin configuration have been removed.
|
|
1562
1568
|
Older ontology definitions still expose reads; posting requires the provider mapping.
|
|
1563
1569
|
|
|
@@ -1614,7 +1620,8 @@ Paired private chats have stable handles `telegram:private:<member UUID>`, and
|
|
|
1614
1620
|
Posting permission
|
|
1615
1621
|
allows target discovery independently of history. `user_find` still requires `user:read`.
|
|
1616
1622
|
|
|
1617
|
-
External OAuth/service clients
|
|
1623
|
+
External OAuth/service clients post in their own voice with
|
|
1624
|
+
`chat_send({ chat, text, reply_to?, files?, buttons?, idempotency_key, as: "me" })`.
|
|
1618
1625
|
Attribution comes from verified authentication and stored names. The workspace can set
|
|
1619
1626
|
`chat.attribution: { template, separator }`; defaults are `{name}` and `\n\n`.
|
|
1620
1627
|
The delivered plain text is `text + separator + attribution`, preserving Unicode, whitespace and
|
|
@@ -1639,12 +1646,13 @@ participants it names. A posting service cannot read member chats. They read the
|
|
|
1639
1646
|
`reason` beside the archive's fields, and the platform's chat archive before; `after`, a revision,
|
|
1640
1647
|
reads the chat's changes since. `chat.retentionDays` (1–3650, 365 by default) sets how long the
|
|
1641
1648
|
workspace keeps them. The canonical
|
|
1642
|
-
REST facade is `/api/ontology/chat/{list,history,search
|
|
1643
|
-
|
|
1644
|
-
|
|
1649
|
+
REST facade is `/api/ontology/chat/{list,history,search}`, and `send` is
|
|
1650
|
+
`POST /api/ontology/agent_chat/actions/send`, with the standard
|
|
1651
|
+
`{ input, options?: { validate_only? } }` envelope and action response.
|
|
1652
|
+
Validation checks eligibility, the voice's permission and exact text without reserving or sending.
|
|
1645
1653
|
|
|
1646
|
-
`chat_get` and `chat_update` use the registry implementations.
|
|
1647
|
-
|
|
1654
|
+
`chat_get` and `chat_update` use the registry implementations. The agent's sessions post
|
|
1655
|
+
through `chat_post_message` with the agent SDK's application-owned
|
|
1648
1656
|
`_segmentstream` protocol; the model sees only `{ chat, text, reply_to? }`. Authenticated tools/list
|
|
1649
1657
|
advertises `segmentstream/chat-post: 1` only with a configured provider. Deploy the updated agent
|
|
1650
1658
|
first, then the archive migration/backend, then enable ontology delivery.
|
package/dist/action.d.ts
CHANGED
|
@@ -66,10 +66,11 @@ export interface Action<Input extends Schema.Top = Schema.Top, Result = unknown>
|
|
|
66
66
|
readonly description: string;
|
|
67
67
|
readonly input: Input;
|
|
68
68
|
/**
|
|
69
|
-
* The permission a principal needs to run the action, as `action({ permission })` set it
|
|
70
|
-
* is not set, the action requires
|
|
69
|
+
* The permission a principal needs to run the action, as `action({ permission })` set it, or the
|
|
70
|
+
* permissions any one of which runs it. When it is not set, the action requires
|
|
71
|
+
* `<entity>:<action name>`, for example `lead:changeStatus`.
|
|
71
72
|
*/
|
|
72
|
-
readonly permission: string | undefined;
|
|
73
|
+
readonly permission: string | ReadonlyArray<string> | undefined;
|
|
73
74
|
/** How the action behaves, as `action({ hints })` set it; see {@link ActionHints}. */
|
|
74
75
|
readonly hints: ActionHints | undefined;
|
|
75
76
|
/** See `action({ retryOnDeadlock })`. Absent or false means the handler runs at most once. */
|
|
@@ -115,8 +116,14 @@ interface ActionOptions<Input extends Schema.Top> {
|
|
|
115
116
|
* The permission a principal needs to run the action. It defaults to `<entity>:<action name>`;
|
|
116
117
|
* set it only to share one permission between actions, for example two actions behind `lead:edit`.
|
|
117
118
|
* Roles grant it in their `permissions`.
|
|
119
|
+
*
|
|
120
|
+
* A list names several permissions, any one of which runs the action: for an action whose input
|
|
121
|
+
* chooses what it does, each choice needing its own permission, which the action checks inside
|
|
122
|
+
* with `isAllowed`, as `agent_chat.send` checks `agent_chat:send` for `as: "agent"` and
|
|
123
|
+
* `agent_chat:post_message` for `as: "me"`. Such an action writes nothing itself, a `prepare`
|
|
124
|
+
* without a handler: a scope could not tell which of the permissions a write was made under.
|
|
118
125
|
*/
|
|
119
|
-
readonly permission?: string
|
|
126
|
+
readonly permission?: string | ReadonlyArray<string>;
|
|
120
127
|
/**
|
|
121
128
|
* How the action behaves, for the agents that run it over MCP. Set `destructive: false` for an
|
|
122
129
|
* routine reversible action, `irreversible: true` for an effect without a complete undo, and
|
package/dist/agent-chat.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function agentChatKey(provider: string, externalId: string): stri
|
|
|
8
8
|
/** Existing chat registry and membership storage; delivery lives in the ontology service. */
|
|
9
9
|
export declare const AgentChat: import("./entity.js").Entity<"agent_chat", {
|
|
10
10
|
readonly provider: import("./property.js").Property<string, false, false>;
|
|
11
|
-
readonly kind: import("./property.js").Property<"
|
|
11
|
+
readonly kind: import("./property.js").Property<"group" | "private", true, false>;
|
|
12
12
|
readonly externalId: import("./property.js").Property<string, false, false>;
|
|
13
13
|
readonly key: Schema.optionalKey<import("./property.js").Property<string, false, true>>;
|
|
14
14
|
readonly title: import("./property.js").Property<string, false, false>;
|
|
@@ -130,6 +130,12 @@ export declare const AgentChat: import("./entity.js").Entity<"agent_chat", {
|
|
|
130
130
|
readonly text: Schema.String;
|
|
131
131
|
readonly token: Schema.String;
|
|
132
132
|
}>]>>>>;
|
|
133
|
+
readonly files: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
134
|
+
readonly entity: Schema.String;
|
|
135
|
+
readonly id: Schema.String;
|
|
136
|
+
readonly property: Schema.optionalKey<Schema.String>;
|
|
137
|
+
}>>>;
|
|
138
|
+
readonly as: Schema.optionalKey<Schema.Literals<readonly ["agent", "me"]>>;
|
|
133
139
|
readonly idempotencyKey: Schema.String;
|
|
134
140
|
}>, {
|
|
135
141
|
readonly status: "sent" | "uncertain";
|
|
@@ -162,7 +168,7 @@ export declare const AgentChat: import("./entity.js").Entity<"agent_chat", {
|
|
|
162
168
|
readonly createdBy: string | null;
|
|
163
169
|
readonly updatedBy: string | null;
|
|
164
170
|
readonly provider: string;
|
|
165
|
-
readonly kind: "
|
|
171
|
+
readonly kind: "group" | "private";
|
|
166
172
|
readonly externalId: string;
|
|
167
173
|
readonly key: string | null;
|
|
168
174
|
readonly title: string;
|
package/dist/agent-chat.js
CHANGED
|
@@ -91,7 +91,8 @@ export const AgentChat = entity("agent_chat", {
|
|
|
91
91
|
managed: true,
|
|
92
92
|
maxLength: 12,
|
|
93
93
|
label: "Group access",
|
|
94
|
-
description: "
|
|
94
|
+
description: "Allow unlinked senders to chat with the guest roles configured for this channel. " +
|
|
95
|
+
"The default requires a linked account.",
|
|
95
96
|
}),
|
|
96
97
|
personaNoticeAt: p.timestamp({
|
|
97
98
|
optional: true,
|
|
@@ -197,7 +198,7 @@ export const AgentChat = entity("agent_chat", {
|
|
|
197
198
|
takeOver: action({
|
|
198
199
|
description: "Take a person's private chat over from the agent, as yourself, also when the agent handed " +
|
|
199
200
|
"the person over: until a member hands it back, the agent records the person's messages " +
|
|
200
|
-
"and answers none of them, and staff answer with
|
|
201
|
+
"and answers none of them, and staff answer with send as me. Refused for a group chat, " +
|
|
201
202
|
"for a chat on a channel the ontology's inbox.takeover does not list, and for a chat " +
|
|
202
203
|
"another member took over; taking over a chat you hold changes nothing.",
|
|
203
204
|
hints: { destructive: false, irreversible: false, idempotent: true },
|
|
@@ -306,9 +307,11 @@ export const AgentChat = entity("agent_chat", {
|
|
|
306
307
|
}),
|
|
307
308
|
}),
|
|
308
309
|
previewMessage: action({
|
|
309
|
-
description: "Render an exact
|
|
310
|
-
"
|
|
311
|
-
"
|
|
310
|
+
description: "Render an exact text message in your own voice, as send with as me delivers it, with its " +
|
|
311
|
+
"verified destination and sender attribution, without reserving a key, writing history or " +
|
|
312
|
+
"sending. Requires agent_chat:post_message, as sending in your voice does. A preview is " +
|
|
313
|
+
"not authorization to send.",
|
|
314
|
+
// A preview shows what only your voice adds, the attribution, so only it is previewed.
|
|
312
315
|
permission: "agent_chat:post_message",
|
|
313
316
|
input: ChatPostInput,
|
|
314
317
|
connections: [],
|
|
@@ -348,22 +351,33 @@ export const AgentChat = entity("agent_chat", {
|
|
|
348
351
|
}),
|
|
349
352
|
}),
|
|
350
353
|
send: action({
|
|
351
|
-
description: "Send a message to
|
|
352
|
-
"person reads it as the agent's,
|
|
353
|
-
"
|
|
354
|
-
"
|
|
355
|
-
"
|
|
356
|
-
"
|
|
357
|
-
"
|
|
358
|
-
"(
|
|
359
|
-
"
|
|
360
|
-
"
|
|
361
|
-
"
|
|
362
|
-
"
|
|
363
|
-
"
|
|
364
|
-
"
|
|
365
|
-
"
|
|
366
|
-
"
|
|
354
|
+
description: "Send a message to an eligible chat ID or exact title, in one of two voices. as agent, the " +
|
|
355
|
+
"default, needs agent_chat:send: the person reads it as the agent's, without sender " +
|
|
356
|
+
"attribution, and the chat store keeps who asked for it, as for a workflow or a member that " +
|
|
357
|
+
"writes first, such as a follow-up the workspace decides on. as me needs " +
|
|
358
|
+
"agent_chat:post_message: you write as yourself, and the platform adds your name as the " +
|
|
359
|
+
"sender attribution, except in your own reply in the inbox where its attribution is none. " +
|
|
360
|
+
"Nothing else chooses the sender. text is Markdown (bold, italic, code, lists, " +
|
|
361
|
+
"[text](url)); each channel renders it natively and degrades constructs it can't show. " +
|
|
362
|
+
"Ambiguous titles require an explicit ID; a scoped grant names the chat by its agent_chat " +
|
|
363
|
+
"record. Confirm the full final text, attribution and destination before calling. The " +
|
|
364
|
+
"agent's tasks cannot call it, and its sessions do not send as the agent: a task's workflow " +
|
|
365
|
+
"sends what the task wrote. Reuse the same idempotency key on replay; an uncertain " +
|
|
366
|
+
"operation is never resent. A message the provider refuses spends its key and says why in " +
|
|
367
|
+
"refusal: outside_reply_window (on WhatsApp the person last wrote more than 24 hours ago), " +
|
|
368
|
+
"recipient_unreachable or recipient_opted_out. On WhatsApp, template sends an approved " +
|
|
369
|
+
"template in place of text, which reaches a person outside the 24 hours, with its body's, " +
|
|
370
|
+
"header's and buttons' values; give exactly one of text and template. A template cannot " +
|
|
371
|
+
"carry an attribution: as me it is refused with refusal attribution_unsupported unless your " +
|
|
372
|
+
"message is unsigned. buttons puts rows of buttons under a text: links ({ text, url }) and " +
|
|
373
|
+
"workspace buttons ({ text, token }), whose press calls the workspace's button action with " +
|
|
374
|
+
"{ token } as the member who pressed it. A channel that cannot show them as given refuses " +
|
|
375
|
+
"the message with refusal buttons_unsupported before spending the key: WhatsApp shows one " +
|
|
376
|
+
"link, or up to three workspace buttons with labels of at most 20 characters, under at most " +
|
|
377
|
+
"1,024 characters. files sends stored files after the text in the same delivery; files a " +
|
|
378
|
+
"channel cannot send are refused before the key is spent.",
|
|
379
|
+
// Each voice needs its own permission, which the delivery checks: either opens the action.
|
|
380
|
+
permission: ["agent_chat:send", "agent_chat:post_message"],
|
|
367
381
|
input: ChatSendInput,
|
|
368
382
|
hints: { destructive: false, irreversible: true, idempotent: true },
|
|
369
383
|
connections: [],
|
|
@@ -371,29 +385,31 @@ export const AgentChat = entity("agent_chat", {
|
|
|
371
385
|
const delivery = yield* Effect.serviceOption(ChatDelivery);
|
|
372
386
|
if (Option.isNone(delivery) || delivery.value.send === undefined) {
|
|
373
387
|
return yield* new ActionRejected({
|
|
374
|
-
message: "Sending
|
|
388
|
+
message: "Sending a message requires the authenticated ontology service.",
|
|
375
389
|
});
|
|
376
390
|
}
|
|
377
391
|
return yield* delivery.value.send(input);
|
|
378
392
|
}),
|
|
379
393
|
}),
|
|
394
|
+
// @legacy ontology.chat-post-message
|
|
380
395
|
postMessage: action({
|
|
381
|
-
description: "Post to an eligible chat ID or exact title. text is Markdown
|
|
382
|
-
"[text](url)); each channel renders it natively and degrades
|
|
383
|
-
"The exact Markdown source is posted; the platform adds the
|
|
384
|
-
"Ambiguous titles require an explicit ID. Confirm the full final text,
|
|
385
|
-
"before calling. Reuse the same idempotency key on replay; an
|
|
396
|
+
description: "Post to an eligible chat ID or exact title, as send with as me does. text is Markdown " +
|
|
397
|
+
"(bold, italic, code, lists, [text](url)); each channel renders it natively and degrades " +
|
|
398
|
+
"constructs it can't show. The exact Markdown source is posted; the platform adds the " +
|
|
399
|
+
"sender attribution. Ambiguous titles require an explicit ID. Confirm the full final text, " +
|
|
400
|
+
"attribution and destination before calling. Reuse the same idempotency key on replay; an " +
|
|
401
|
+
"uncertain operation is never resent.",
|
|
386
402
|
input: ChatPostInput,
|
|
387
403
|
hints: { destructive: false, irreversible: true, idempotent: true },
|
|
388
404
|
connections: [],
|
|
389
405
|
prepare: ({ input }) => Effect.gen(function* () {
|
|
390
406
|
const delivery = yield* Effect.serviceOption(ChatDelivery);
|
|
391
|
-
if (Option.isNone(delivery)) {
|
|
407
|
+
if (Option.isNone(delivery) || delivery.value.send === undefined) {
|
|
392
408
|
return yield* new ActionRejected({
|
|
393
409
|
message: "Chat delivery requires the authenticated ontology service.",
|
|
394
410
|
});
|
|
395
411
|
}
|
|
396
|
-
return yield* delivery.value.
|
|
412
|
+
return yield* delivery.value.send({ ...input, as: "me" });
|
|
397
413
|
}),
|
|
398
414
|
}),
|
|
399
415
|
}));
|
package/dist/agent-draft.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ export declare const AgentDraft: import("./entity.js").Entity<"agent_draft", {
|
|
|
91
91
|
readonly to: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
92
92
|
readonly cc: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
93
93
|
readonly participants: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
94
|
-
readonly chatKind: import("./property.js").Property<"
|
|
94
|
+
readonly chatKind: import("./property.js").Property<"group" | "private", false, false>;
|
|
95
95
|
readonly threadId: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
96
96
|
readonly replyTo: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
97
97
|
readonly sessionId: import("./property.js").Property<string, false, false>;
|
|
@@ -101,7 +101,7 @@ export declare const AgentDraft: import("./entity.js").Entity<"agent_draft", {
|
|
|
101
101
|
readonly draft: import("./property.js").Property<string, false, false>;
|
|
102
102
|
readonly files: Schema.optionalKey<import("./property.js").Property<Schema.Json, false, false>>;
|
|
103
103
|
readonly text: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
104
|
-
readonly status: import("./property.js").Property<"pending" | "sent" | "failed" | "uncertain" | "rejected" | "
|
|
104
|
+
readonly status: import("./property.js").Property<"pending" | "sent" | "failed" | "uncertain" | "rejected" | "dismissed" | "superseded", false, false>;
|
|
105
105
|
readonly mode: import("./property.js").Property<"requested" | "always" | "whenUnsure", false, false>;
|
|
106
106
|
readonly confidence: Schema.optionalKey<import("./property.js").Property<number, false, false>>;
|
|
107
107
|
readonly messageId: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
@@ -181,7 +181,7 @@ export declare const AgentDraft: import("./entity.js").Entity<"agent_draft", {
|
|
|
181
181
|
readonly to: string | null;
|
|
182
182
|
readonly cc: string | null;
|
|
183
183
|
readonly participants: string | null;
|
|
184
|
-
readonly chatKind: "
|
|
184
|
+
readonly chatKind: "group" | "private";
|
|
185
185
|
readonly threadId: string | null;
|
|
186
186
|
readonly replyTo: string | null;
|
|
187
187
|
readonly sessionId: string;
|
|
@@ -191,7 +191,7 @@ export declare const AgentDraft: import("./entity.js").Entity<"agent_draft", {
|
|
|
191
191
|
readonly draft: string;
|
|
192
192
|
readonly files: Schema.Json;
|
|
193
193
|
readonly text: string | null;
|
|
194
|
-
readonly status: "pending" | "sent" | "failed" | "uncertain" | "rejected" | "
|
|
194
|
+
readonly status: "pending" | "sent" | "failed" | "uncertain" | "rejected" | "dismissed" | "superseded";
|
|
195
195
|
readonly mode: "requested" | "always" | "whenUnsure";
|
|
196
196
|
readonly confidence: number | null;
|
|
197
197
|
readonly messageId: string | null;
|
|
@@ -217,7 +217,7 @@ export declare const AgentReview: import("./entity.js").Entity<"agent_draft", {
|
|
|
217
217
|
readonly to: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
218
218
|
readonly cc: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
219
219
|
readonly participants: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
220
|
-
readonly chatKind: import("./property.js").Property<"
|
|
220
|
+
readonly chatKind: import("./property.js").Property<"group" | "private", false, false>;
|
|
221
221
|
readonly threadId: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
222
222
|
readonly replyTo: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
223
223
|
readonly sessionId: import("./property.js").Property<string, false, false>;
|
|
@@ -227,7 +227,7 @@ export declare const AgentReview: import("./entity.js").Entity<"agent_draft", {
|
|
|
227
227
|
readonly draft: import("./property.js").Property<string, false, false>;
|
|
228
228
|
readonly files: Schema.optionalKey<import("./property.js").Property<Schema.Json, false, false>>;
|
|
229
229
|
readonly text: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
230
|
-
readonly status: import("./property.js").Property<"pending" | "sent" | "failed" | "uncertain" | "rejected" | "
|
|
230
|
+
readonly status: import("./property.js").Property<"pending" | "sent" | "failed" | "uncertain" | "rejected" | "dismissed" | "superseded", false, false>;
|
|
231
231
|
readonly mode: import("./property.js").Property<"requested" | "always" | "whenUnsure", false, false>;
|
|
232
232
|
readonly confidence: Schema.optionalKey<import("./property.js").Property<number, false, false>>;
|
|
233
233
|
readonly messageId: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
@@ -307,7 +307,7 @@ export declare const AgentReview: import("./entity.js").Entity<"agent_draft", {
|
|
|
307
307
|
readonly to: string | null;
|
|
308
308
|
readonly cc: string | null;
|
|
309
309
|
readonly participants: string | null;
|
|
310
|
-
readonly chatKind: "
|
|
310
|
+
readonly chatKind: "group" | "private";
|
|
311
311
|
readonly threadId: string | null;
|
|
312
312
|
readonly replyTo: string | null;
|
|
313
313
|
readonly sessionId: string;
|
|
@@ -317,7 +317,7 @@ export declare const AgentReview: import("./entity.js").Entity<"agent_draft", {
|
|
|
317
317
|
readonly draft: string;
|
|
318
318
|
readonly files: Schema.Json;
|
|
319
319
|
readonly text: string | null;
|
|
320
|
-
readonly status: "pending" | "sent" | "failed" | "uncertain" | "rejected" | "
|
|
320
|
+
readonly status: "pending" | "sent" | "failed" | "uncertain" | "rejected" | "dismissed" | "superseded";
|
|
321
321
|
readonly mode: "requested" | "always" | "whenUnsure";
|
|
322
322
|
readonly confidence: number | null;
|
|
323
323
|
readonly messageId: string | null;
|
package/dist/analyze.d.ts
CHANGED
|
@@ -30,13 +30,6 @@ export interface OntologyConfig<Entities extends ReadonlyArray<AnyEntity> = Read
|
|
|
30
30
|
* Builders default to declared roles explicitly granting user:grantRoles or user:*.
|
|
31
31
|
*/
|
|
32
32
|
readonly feedback?: boolean | FeedbackOptions;
|
|
33
|
-
/** One workspace-authored action that the agent may invoke for a sender in an opened group.
|
|
34
|
-
* The named role must grant the action. This does not assign that role to a user. */
|
|
35
|
-
readonly publicGroupAction?: {
|
|
36
|
-
readonly entity: string;
|
|
37
|
-
readonly action: string;
|
|
38
|
-
readonly role: string;
|
|
39
|
-
};
|
|
40
33
|
/** Opt-in after-commit service execution; only this declared role supplies permissions. */
|
|
41
34
|
readonly hooks?: {
|
|
42
35
|
readonly role: string;
|
|
@@ -71,7 +64,7 @@ export interface OntologyConfig<Entities extends ReadonlyArray<AnyEntity> = Read
|
|
|
71
64
|
* `origins` names, on `web`. A guest is a session, not a user, and holds the built-in role
|
|
72
65
|
* `guest` with `permissions` alone. Absent, nobody chats without signing in or signing up.
|
|
73
66
|
*/
|
|
74
|
-
readonly guest?: GuestOptions<RolePermission>;
|
|
67
|
+
readonly guest?: GuestOptions<RolePermission, Role | string>;
|
|
75
68
|
/** Who may become a member by signing in. Only invited people by default. */
|
|
76
69
|
readonly signIn?: SignInOptions;
|
|
77
70
|
/**
|
|
@@ -184,8 +177,13 @@ export interface ResolvedRelationship {
|
|
|
184
177
|
export interface ResolvedAction {
|
|
185
178
|
readonly name: string;
|
|
186
179
|
readonly action: Action;
|
|
187
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* The permission the action requires: its `permission`, or `<entity>:<action name>`; for an action
|
|
182
|
+
* several permissions open, the first of them.
|
|
183
|
+
*/
|
|
188
184
|
readonly permission: string;
|
|
185
|
+
/** For an action several permissions open, each of them, any one of which runs it. */
|
|
186
|
+
readonly anyOf?: ReadonlyArray<string>;
|
|
189
187
|
/** The input as JSON Schema, or `undefined` when it could not be generated. */
|
|
190
188
|
readonly input: JsonSchemaObject | undefined;
|
|
191
189
|
/** The keys of the connections the action's `prepare` calls, in declaration order. */
|