@segmentstream/ontology 0.131.1 → 0.133.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 +53 -0
- package/README.md +10 -6
- package/dist/agent-chat.d.ts +24 -2
- package/dist/agent-chat.js +22 -1
- package/dist/agent-review.d.ts +2 -2
- package/dist/analyze.js +56 -18
- package/dist/chat.d.ts +40 -0
- package/dist/chat.js +39 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/manifest.d.ts +49 -13
- package/dist/manifest.js +34 -8
- package/dist/migrate/model.d.ts +24 -8
- package/dist/service/agent/bot-check.d.ts +8 -7
- package/dist/service/agent/bot-check.js +10 -6
- package/dist/service/agent/web-tokens.d.ts +2 -2
- package/dist/service/chat/delivery.d.ts +4 -1
- package/dist/service/chat/delivery.js +16 -2
- package/dist/service/chat/envelope.d.ts +2 -2
- package/dist/service/chat/history-import.d.ts +72 -0
- package/dist/service/chat/history-import.js +210 -0
- package/dist/service/config.d.ts +3 -0
- package/dist/service/operations.js +3 -3
- package/dist/service/schemas.d.ts +6 -2
- package/dist/service/service.js +2 -1
- package/dist/sign-in.d.ts +30 -7
- package/dist/sign-in.js +1 -1
- package/dist/user-identity.d.ts +1 -1
- package/package.json +1 -1
|
@@ -463,7 +463,9 @@ export declare const Catalog: Schema.decodeTo<Schema.Struct<{
|
|
|
463
463
|
readonly origins: Schema.$Array<Schema.String>;
|
|
464
464
|
readonly botCheck: Schema.optionalKey<Schema.Struct<{
|
|
465
465
|
readonly scheme: Schema.String;
|
|
466
|
-
readonly
|
|
466
|
+
readonly connection: Schema.optionalKey<Schema.String>;
|
|
467
|
+
readonly input: Schema.optionalKey<Schema.String>;
|
|
468
|
+
readonly secret: Schema.optionalKey<Schema.String>;
|
|
467
469
|
}>>;
|
|
468
470
|
readonly confirmations: Schema.optionalKey<Schema.Boolean>;
|
|
469
471
|
}>, {
|
|
@@ -823,7 +825,9 @@ export declare const Catalog: Schema.decodeTo<Schema.Struct<{
|
|
|
823
825
|
readonly origins: Schema.$Array<Schema.String>;
|
|
824
826
|
readonly botCheck: Schema.optionalKey<Schema.Struct<{
|
|
825
827
|
readonly scheme: Schema.String;
|
|
826
|
-
readonly
|
|
828
|
+
readonly connection: Schema.optionalKey<Schema.String>;
|
|
829
|
+
readonly input: Schema.optionalKey<Schema.String>;
|
|
830
|
+
readonly secret: Schema.optionalKey<Schema.String>;
|
|
827
831
|
}>>;
|
|
828
832
|
readonly confirmations: Schema.optionalKey<Schema.Boolean>;
|
|
829
833
|
}>, {
|
package/dist/service/service.js
CHANGED
|
@@ -23,6 +23,7 @@ import { platformChatArchive } from "./agent/chat-archive.js";
|
|
|
23
23
|
import { archiveRoutes } from "./agent/archive-routes.js";
|
|
24
24
|
import { makeChatDelivery } from "./chat/delivery.js";
|
|
25
25
|
import { platformDeliveryArchive } from "./chat/archive.js";
|
|
26
|
+
import { platformHistoryArchive } from "./chat/history-import.js";
|
|
26
27
|
import { chatRoutes } from "./chat/routes.js";
|
|
27
28
|
import { agentLayer } from "./agent/server.js";
|
|
28
29
|
import { agentTasksLayer } from "./agent/tasks.js";
|
|
@@ -348,7 +349,7 @@ export function createOntologyService(ontology, config) {
|
|
|
348
349
|
{
|
|
349
350
|
origin: config.agentOrigin,
|
|
350
351
|
...(config.agentTaskTransport === undefined ? {} : { fetch: config.agentTaskTransport }),
|
|
351
|
-
});
|
|
352
|
+
}, config.chatHistoryArchive ?? platformHistoryArchive(config));
|
|
352
353
|
const chatHistory = config.runtimeIdentity === undefined ? undefined : platformChatArchive(config);
|
|
353
354
|
const metricQueries = makeMetricQueries({
|
|
354
355
|
ontology,
|
package/dist/sign-in.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AnyConnectionHandle } from "./connection.js";
|
|
1
2
|
/**
|
|
2
3
|
* Who may become a member by signing in. `invited`: only a person whose email a member row already
|
|
3
4
|
* holds, created by an invitation or a role grant; anyone else is refused. `open`: anyone who signs
|
|
@@ -77,8 +78,9 @@ export interface GuestOptions<P = unknown> {
|
|
|
77
78
|
/**
|
|
78
79
|
* A bot check before a guest exists: the website shows a challenge, and a new guest's agent token
|
|
79
80
|
* is issued only for a token from it that the challenge's provider accepts. `scheme` names the
|
|
80
|
-
* provider; `
|
|
81
|
-
*
|
|
81
|
+
* provider; `connection` and `input` the connection's verification value holding the provider's
|
|
82
|
+
* secret key, such as a `TurnstileConnection`'s `secret_key`, which only the platform reads.
|
|
83
|
+
* Absent, no challenge is asked for.
|
|
82
84
|
*/
|
|
83
85
|
readonly botCheck?: GuestBotCheck;
|
|
84
86
|
/**
|
|
@@ -89,23 +91,44 @@ export interface GuestOptions<P = unknown> {
|
|
|
89
91
|
}
|
|
90
92
|
/**
|
|
91
93
|
* The challenge providers a guest's bot check can verify. `turnstile` is Cloudflare Turnstile: the
|
|
92
|
-
* website renders its widget with the site key, and
|
|
94
|
+
* website renders its widget with the site key, and a connection holds its secret key.
|
|
93
95
|
*/
|
|
94
96
|
export declare const GUEST_BOT_CHECK_SCHEMES: readonly ["turnstile"];
|
|
95
97
|
export type GuestBotCheckScheme = (typeof GUEST_BOT_CHECK_SCHEMES)[number];
|
|
96
98
|
export declare function isGuestBotCheckScheme(value: unknown): value is GuestBotCheckScheme;
|
|
97
99
|
/** The challenge a website's visitor passes before they become a guest. */
|
|
98
|
-
export
|
|
100
|
+
export type GuestBotCheck = {
|
|
99
101
|
readonly scheme: GuestBotCheckScheme;
|
|
100
|
-
/** The
|
|
102
|
+
/** The connection holding the provider's secret key, listed in `defineOntology({ connections })`. */
|
|
103
|
+
readonly connection: AnyConnectionHandle;
|
|
104
|
+
/** Its verification value, such as a `TurnstileConnection`'s `secret_key`. */
|
|
105
|
+
readonly input: string;
|
|
106
|
+
readonly secret?: undefined;
|
|
107
|
+
} | {
|
|
108
|
+
readonly scheme: GuestBotCheckScheme;
|
|
109
|
+
/** The workspace secret holding the provider's secret key: the older form. */
|
|
101
110
|
readonly secret: string;
|
|
102
|
-
|
|
111
|
+
readonly connection?: undefined;
|
|
112
|
+
readonly input?: undefined;
|
|
113
|
+
};
|
|
114
|
+
/** A bot check as the manifest carries it: the connection by its key. */
|
|
115
|
+
export type ResolvedGuestBotCheck = {
|
|
116
|
+
readonly scheme: GuestBotCheckScheme;
|
|
117
|
+
readonly connection: string;
|
|
118
|
+
readonly input: string;
|
|
119
|
+
readonly secret?: undefined;
|
|
120
|
+
} | {
|
|
121
|
+
readonly scheme: GuestBotCheckScheme;
|
|
122
|
+
readonly secret: string;
|
|
123
|
+
readonly connection?: undefined;
|
|
124
|
+
readonly input?: undefined;
|
|
125
|
+
};
|
|
103
126
|
/** Guests as the manifest carries them; the built-in role `guest` holds their permissions. */
|
|
104
127
|
export interface ResolvedGuest {
|
|
105
128
|
readonly channels: ReadonlyArray<GuestChannel>;
|
|
106
129
|
readonly origins: ReadonlyArray<string>;
|
|
107
130
|
/** The challenge a new guest passes, when declared. */
|
|
108
|
-
readonly botCheck?:
|
|
131
|
+
readonly botCheck?: ResolvedGuestBotCheck;
|
|
109
132
|
/** Present when guests may confirm actions that need a confirmation. */
|
|
110
133
|
readonly confirmations?: true;
|
|
111
134
|
}
|
package/dist/sign-in.js
CHANGED
|
@@ -30,7 +30,7 @@ export function isGuestChannel(value) {
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* The challenge providers a guest's bot check can verify. `turnstile` is Cloudflare Turnstile: the
|
|
33
|
-
* website renders its widget with the site key, and
|
|
33
|
+
* website renders its widget with the site key, and a connection holds its secret key.
|
|
34
34
|
*/
|
|
35
35
|
export const GUEST_BOT_CHECK_SCHEMES = ["turnstile"];
|
|
36
36
|
export function isGuestBotCheckScheme(value) {
|
package/dist/user-identity.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const UserIdentity: import("./entity.js").DraftEntity<"user_ident
|
|
|
29
29
|
readonly subject: import("./property.js").Property<string, false, false>;
|
|
30
30
|
readonly username: import("effect/Schema").optionalKey<import("./property.js").Property<string, false, false>>;
|
|
31
31
|
readonly display: import("effect/Schema").optionalKey<import("./property.js").Property<string, false, false>>;
|
|
32
|
-
readonly origin: import("./property.js").Property<"link" | "invite" | "attach" | "
|
|
32
|
+
readonly origin: import("./property.js").Property<"link" | "invite" | "attach" | "channel" | "sign_in" | "pairing", false, false>;
|
|
33
33
|
readonly revokedAt: import("effect/Schema").optionalKey<import("./property.js").Property<string, false, false>>;
|
|
34
34
|
readonly accountKey: import("effect/Schema").optionalKey<import("./property.js").Property<string, false, true>>;
|
|
35
35
|
readonly memberKey: import("effect/Schema").optionalKey<import("./property.js").Property<string, false, true>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segmentstream/ontology",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.133.0",
|
|
4
4
|
"description": "Define a SegmentStream workspace app's ontology: entities, relationships, roles and actions, written with Effect.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "SegmentStream",
|