@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/dist/manifest.js
CHANGED
|
@@ -114,6 +114,9 @@ import { CHANNEL_PROVIDERS, DEFAULT_SIGN_IN_POLICY, isGuestBotCheckScheme, isGue
|
|
|
114
114
|
* Within version 16, an entity may carry `erase_from_warehouse_on_delete: true`, written only when
|
|
115
115
|
* declared: deleting a record erases its replicated history from the warehouse. The SDK's own
|
|
116
116
|
* replication capture acts on it; readers ignore it.
|
|
117
|
+
* Within version 16, an action may carry `anyOf`, written only when several permissions open it,
|
|
118
|
+
* as the built-in `agent_chat.send` is: any one of them runs it, and `permission` is the first.
|
|
119
|
+
* Older readers show the action as requiring `permission` alone.
|
|
117
120
|
*/
|
|
118
121
|
export const MANIFEST_VERSION = 16;
|
|
119
122
|
/** The first version whose documents use snake_case names on the wire. */
|
|
@@ -197,6 +200,11 @@ export const ActionManifest = Schema.Struct({
|
|
|
197
200
|
* written; absent from version 1 manifests, where it reads as `<entity>:<action name>`.
|
|
198
201
|
*/
|
|
199
202
|
permission: Schema.optionalKey(Schema.String),
|
|
203
|
+
/**
|
|
204
|
+
* For an action several permissions open, each of them, any one of which runs it; `permission` is
|
|
205
|
+
* the first. Written only then; an older reader shows the action as requiring `permission` alone.
|
|
206
|
+
*/
|
|
207
|
+
anyOf: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
200
208
|
/** JSON Schema (draft 2020-12) of the input object. */
|
|
201
209
|
input: Schema.Record(Schema.String, Schema.Json),
|
|
202
210
|
/** Opt-in SQL handler replay after a confirmed deadlock rollback; absent means disabled. */
|
|
@@ -509,6 +517,8 @@ export const SignUpManifest = Schema.Struct({
|
|
|
509
517
|
* know admit nobody.
|
|
510
518
|
*/
|
|
511
519
|
export const GuestManifest = Schema.Struct({
|
|
520
|
+
openOnInvite: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
521
|
+
byChannel: Schema.optionalKey(Schema.Record(Schema.String, Schema.Array(Schema.String))),
|
|
512
522
|
channels: Schema.Array(Schema.String),
|
|
513
523
|
origins: Schema.Array(Schema.String),
|
|
514
524
|
/** The challenge a new guest passes, and the workspace secret holding its secret key. */
|
|
@@ -872,7 +882,7 @@ export function guestOf(manifest) {
|
|
|
872
882
|
if (typeof declared !== "object" || declared === null) {
|
|
873
883
|
return undefined;
|
|
874
884
|
}
|
|
875
|
-
const { channels, origins, botCheck, confirmations } = declared;
|
|
885
|
+
const { channels, origins, byChannel, openOnInvite, botCheck, confirmations } = declared;
|
|
876
886
|
const known = Array.isArray(channels) ? channels.filter(isGuestChannel) : [];
|
|
877
887
|
const websites = Array.isArray(origins)
|
|
878
888
|
? origins.flatMap((candidate) => {
|
|
@@ -887,7 +897,16 @@ export function guestOf(manifest) {
|
|
|
887
897
|
check.connection !== "" &&
|
|
888
898
|
typeof check.input === "string" &&
|
|
889
899
|
check.input !== "";
|
|
890
|
-
if (
|
|
900
|
+
if (byChannel !== undefined &&
|
|
901
|
+
(byChannel === null ||
|
|
902
|
+
typeof byChannel !== "object" ||
|
|
903
|
+
Array.isArray(byChannel) ||
|
|
904
|
+
Object.entries(byChannel).some(([key, roles]) => !known.some((channel) => channel === key) ||
|
|
905
|
+
!Array.isArray(roles) ||
|
|
906
|
+
!roles.every((role) => typeof role === "string")))) {
|
|
907
|
+
return undefined;
|
|
908
|
+
}
|
|
909
|
+
if (known.length === 0 || (known.includes("web") && websites.length === 0)) {
|
|
891
910
|
return undefined;
|
|
892
911
|
}
|
|
893
912
|
// A bot check this reader cannot verify admits no new guest, rather than none without a check.
|
|
@@ -901,6 +920,8 @@ export function guestOf(manifest) {
|
|
|
901
920
|
return {
|
|
902
921
|
channels: [...new Set(known)],
|
|
903
922
|
origins: websites,
|
|
923
|
+
...(byChannel && { byChannel }),
|
|
924
|
+
...(Array.isArray(openOnInvite) && { openOnInvite }),
|
|
904
925
|
...(check === undefined
|
|
905
926
|
? {}
|
|
906
927
|
: connected
|
|
@@ -1101,6 +1122,7 @@ function entityManifest(input) {
|
|
|
1101
1122
|
name: action.name,
|
|
1102
1123
|
description: action.action.description,
|
|
1103
1124
|
permission: action.permission,
|
|
1125
|
+
...(action.anyOf === undefined ? {} : { anyOf: [...action.anyOf] }),
|
|
1104
1126
|
input: action.input ?? {},
|
|
1105
1127
|
...(action.action.retryOnDeadlock === undefined
|
|
1106
1128
|
? {}
|
|
@@ -1187,6 +1209,15 @@ export function buildManifest(input) {
|
|
|
1187
1209
|
: {
|
|
1188
1210
|
guest: {
|
|
1189
1211
|
channels: [...input.signIn.guest.channels],
|
|
1212
|
+
...(input.signIn.guest.openOnInvite && {
|
|
1213
|
+
openOnInvite: input.signIn.guest.openOnInvite,
|
|
1214
|
+
}),
|
|
1215
|
+
...(input.signIn.guest.byChannel && {
|
|
1216
|
+
byChannel: Object.fromEntries(Object.entries(input.signIn.guest.byChannel).map(([channel, roles]) => [
|
|
1217
|
+
channel,
|
|
1218
|
+
[...roles],
|
|
1219
|
+
])),
|
|
1220
|
+
}),
|
|
1190
1221
|
origins: [...input.signIn.guest.origins],
|
|
1191
1222
|
...(input.signIn.guest.botCheck === undefined
|
|
1192
1223
|
? {}
|