@graview/core 0.2.17 → 0.2.18
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 +9 -0
- package/dist/app-places.d.ts.map +1 -1
- package/dist/app-places.js +3 -1
- package/dist/app-places.js.map +1 -1
- package/dist/app.d.ts +13 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +3 -1
- package/dist/app.js.map +1 -1
- package/dist/beginning.d.ts.map +1 -1
- package/dist/beginning.js +6 -2
- package/dist/beginning.js.map +1 -1
- package/dist/catalog.d.ts +52 -0
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +145 -0
- package/dist/catalog.js.map +1 -1
- package/dist/city.d.ts.map +1 -1
- package/dist/city.js +3 -1
- package/dist/city.js.map +1 -1
- package/dist/cli/check/index.d.ts +1 -0
- package/dist/cli/check/index.d.ts.map +1 -1
- package/dist/cli/check/index.js +1 -0
- package/dist/cli/check/index.js.map +1 -1
- package/dist/cli/check/policy.d.ts.map +1 -1
- package/dist/cli/check/policy.js +3 -1
- package/dist/cli/check/policy.js.map +1 -1
- package/dist/cli/check/rooms.d.ts +10 -0
- package/dist/cli/check/rooms.d.ts.map +1 -0
- package/dist/cli/check/rooms.js +23 -0
- package/dist/cli/check/rooms.js.map +1 -0
- package/dist/cli/check.d.ts +1 -1
- package/dist/cli/check.d.ts.map +1 -1
- package/dist/cli/check.js +18 -2
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/describe.d.ts +1 -1
- package/dist/cli/describe.d.ts.map +1 -1
- package/dist/cli/describe.js +38 -4
- package/dist/cli/describe.js.map +1 -1
- package/dist/cli/document-schema.d.ts.map +1 -1
- package/dist/cli/document-schema.js +21 -0
- package/dist/cli/document-schema.js.map +1 -1
- package/dist/compose-home.js +1 -1
- package/dist/compose-home.js.map +1 -1
- package/dist/conformance/index.d.ts.map +1 -1
- package/dist/conformance/index.js +3 -1
- package/dist/conformance/index.js.map +1 -1
- package/dist/document/compile-checked.d.ts.map +1 -1
- package/dist/document/compile-checked.js +3 -2
- package/dist/document/compile-checked.js.map +1 -1
- package/dist/document/compiled.d.ts.map +1 -1
- package/dist/document/compiled.js +9 -1
- package/dist/document/compiled.js.map +1 -1
- package/dist/document/graview-template.d.ts +3 -3
- package/dist/document/purpose-spec.d.ts +2 -2
- package/dist/document/schema.d.ts +22 -21
- package/dist/document/schema.d.ts.map +1 -1
- package/dist/document/schema.js +6 -0
- package/dist/document/schema.js.map +1 -1
- package/dist/document/to-document.d.ts +1 -1
- package/dist/document/to-document.d.ts.map +1 -1
- package/dist/document/to-document.js +6 -2
- package/dist/document/to-document.js.map +1 -1
- package/dist/document/workflow-spec.d.ts +2 -2
- package/dist/document.schema.json +53 -2
- package/dist/field-sight.d.ts.map +1 -1
- package/dist/field-sight.js +6 -1
- package/dist/field-sight.js.map +1 -1
- package/dist/friction-record.d.ts +8 -0
- package/dist/friction-record.d.ts.map +1 -1
- package/dist/friction-record.js +25 -0
- package/dist/friction-record.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/installation.d.ts +2 -2
- package/dist/installation.d.ts.map +1 -1
- package/dist/installation.js +2 -0
- package/dist/installation.js.map +1 -1
- package/dist/mutations/define-mutation.d.ts +3 -0
- package/dist/mutations/define-mutation.d.ts.map +1 -1
- package/dist/mutations/define-mutation.js +2 -0
- package/dist/mutations/define-mutation.js.map +1 -1
- package/dist/mutations/derive-edits.d.ts.map +1 -1
- package/dist/mutations/derive-edits.js +7 -0
- package/dist/mutations/derive-edits.js.map +1 -1
- package/dist/mutations/derive-relations.d.ts.map +1 -1
- package/dist/mutations/derive-relations.js +4 -0
- package/dist/mutations/derive-relations.js.map +1 -1
- package/dist/mutations/derive-repeats.d.ts.map +1 -1
- package/dist/mutations/derive-repeats.js +4 -0
- package/dist/mutations/derive-repeats.js.map +1 -1
- package/dist/mutations/types.d.ts +24 -0
- package/dist/mutations/types.d.ts.map +1 -1
- package/dist/mutations/visitor-form.js +1 -1
- package/dist/mutations/visitor-form.js.map +1 -1
- package/dist/ops/digest.d.ts +2 -1
- package/dist/ops/digest.d.ts.map +1 -1
- package/dist/ops/digest.js +7 -1
- package/dist/ops/digest.js.map +1 -1
- package/dist/permissions/policy.d.ts +16 -0
- package/dist/permissions/policy.d.ts.map +1 -1
- package/dist/permissions/policy.js +16 -0
- package/dist/permissions/policy.js.map +1 -1
- package/dist/permissions/sight.d.ts +9 -0
- package/dist/permissions/sight.d.ts.map +1 -1
- package/dist/permissions/sight.js +18 -0
- package/dist/permissions/sight.js.map +1 -1
- package/dist/permissions/types.d.ts +24 -0
- package/dist/permissions/types.d.ts.map +1 -1
- package/dist/permissions/types.js.map +1 -1
- package/dist/rooms/findings.d.ts +53 -0
- package/dist/rooms/findings.d.ts.map +1 -0
- package/dist/rooms/findings.js +109 -0
- package/dist/rooms/findings.js.map +1 -0
- package/dist/rooms/kind.d.ts +86 -0
- package/dist/rooms/kind.d.ts.map +1 -0
- package/dist/rooms/kind.js +530 -0
- package/dist/rooms/kind.js.map +1 -0
- package/dist/rooms/read.d.ts +164 -0
- package/dist/rooms/read.d.ts.map +1 -0
- package/dist/rooms/read.js +246 -0
- package/dist/rooms/read.js.map +1 -0
- package/dist/rooms/shape.d.ts +133 -0
- package/dist/rooms/shape.d.ts.map +1 -0
- package/dist/rooms/shape.js +71 -0
- package/dist/rooms/shape.js.map +1 -0
- package/dist/rooms/support-open.d.ts +7 -0
- package/dist/rooms/support-open.d.ts.map +1 -0
- package/dist/rooms/support-open.js +25 -0
- package/dist/rooms/support-open.js.map +1 -0
- package/dist/rooms/support.d.ts +95 -0
- package/dist/rooms/support.d.ts.map +1 -0
- package/dist/rooms/support.js +62 -0
- package/dist/rooms/support.js.map +1 -0
- package/dist/rooms.d.ts +12 -0
- package/dist/rooms.d.ts.map +1 -0
- package/dist/rooms.js +25 -0
- package/dist/rooms.js.map +1 -0
- package/dist/seen.d.ts.map +1 -1
- package/dist/seen.js +84 -12
- package/dist/seen.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +12 -2
- package/dist/store.js.map +1 -1
- package/dist/subscription-shape.d.ts +4 -0
- package/dist/subscription-shape.d.ts.map +1 -1
- package/dist/subscription-shape.js.map +1 -1
- package/dist/subscriptions.d.ts +8 -0
- package/dist/subscriptions.d.ts.map +1 -1
- package/dist/subscriptions.js +48 -2
- package/dist/subscriptions.js.map +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +4 -0
- package/dist/testing.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import * as z from "../schema/zod.js";
|
|
2
|
+
import { defineMutation } from "../mutations/define-mutation.js";
|
|
3
|
+
import { refTo } from "../mutations/node-ref.js";
|
|
4
|
+
import { rolesSaid } from "../permissions/policy.js";
|
|
5
|
+
import { ActRefusal } from "../refused.js";
|
|
6
|
+
import { createSchema } from "../schema/schema.js";
|
|
7
|
+
import { defineNode, labelOf, withArticle } from "../schema/define-node.js";
|
|
8
|
+
import { excerpt } from "../excerpt.js";
|
|
9
|
+
import { AI_ROOM_ACTS, ASKS_ROOM, DESIGN_ROOM, EDIT_MESSAGE, FRAMEWORK_ROOMS, isFrameworkRoom, KEEP_AI_TURN, LONGEST_MESSAGE, MESSAGE_KIND, POST_MESSAGE, REMOVE_MESSAGE, ROOM_ACTS, SETTLE_AI_TURN, SHARE_CONVERSATION } from "./shape.js";
|
|
10
|
+
/*
|
|
11
|
+
* AN APP WITH ROOMS IS GIVEN WHAT THEY NEED, from the declaration alone
|
|
12
|
+
* (Graview HQ feature:f-chat-rooms): the framework's `message` kind, the
|
|
13
|
+
* three acts that make, change and take out a message, a grant that lets
|
|
14
|
+
* whoever a room admits run them, and — where the app says who sees what —
|
|
15
|
+
* a sight for each room's messages. `defineApp` folds them in, and so does
|
|
16
|
+
* a compiled document, so every host that opens the app opens it with
|
|
17
|
+
* them; `toDocument` gives the declaration back without them.
|
|
18
|
+
*
|
|
19
|
+
* EVERY APP KEEPS ITS CONVERSATIONS WITH THE AI THE SAME WAY (Graview HQ
|
|
20
|
+
* feature:f-conversations-in-the-graph): the kind is folded into an app
|
|
21
|
+
* that declares no room too, with the framework's own rooms (`~asks`,
|
|
22
|
+
* `~design`), the three acts that keep a finished turn, settle what became
|
|
23
|
+
* of it and share the conversation, and a sight that shows a conversation
|
|
24
|
+
* to whoever asked it alone until they share it.
|
|
25
|
+
*/
|
|
26
|
+
/** The framework's own kinds, by definition: they stand on no page, list, district or export of the app's (`isPlaceless`). */
|
|
27
|
+
const PLACELESS = new WeakSet();
|
|
28
|
+
/** Whether a kind's definition is the framework's own, that stands on no page of the app: a room's messages are read in their room. */
|
|
29
|
+
export const isPlaceless = (definition) => typeof definition === "object" && definition !== null && PLACELESS.has(definition);
|
|
30
|
+
/** The app as its author declared it, before its rooms were folded in: what `toDocument` writes. */
|
|
31
|
+
const UNFOLDED = new WeakMap();
|
|
32
|
+
/** The framework's own acts, grant and sights, by object: what an app copied after it was folded is told apart by. */
|
|
33
|
+
const FRAMEWORK = new WeakSet();
|
|
34
|
+
/** Whether an act, a grant or a sight is one `withRooms` folded in. */
|
|
35
|
+
export const isRoomsOwn = (part) => typeof part === "object" && part !== null && FRAMEWORK.has(part);
|
|
36
|
+
/**
|
|
37
|
+
* THE APP BEFORE `withRooms`: the one it was folded from, or — for a copy
|
|
38
|
+
* of a folded app (`{ ...app, lenses }`) — the copy without the message
|
|
39
|
+
* kind, the three acts, their grant and their sights. Any other app is
|
|
40
|
+
* itself.
|
|
41
|
+
*/
|
|
42
|
+
export function unfoldedApp(app) {
|
|
43
|
+
const held = UNFOLDED.get(app);
|
|
44
|
+
if (held)
|
|
45
|
+
return held;
|
|
46
|
+
const folded = app;
|
|
47
|
+
if (!folded.schema?.definitions?.some(isPlaceless))
|
|
48
|
+
return app;
|
|
49
|
+
const schema = createSchema(folded.schema.definitions.filter((definition) => !isPlaceless(definition)), folded.schema.computed);
|
|
50
|
+
const made = folded.policy && folded.policy.grants.every((grant) => FRAMEWORK.has(grant)) && (folded.policy.sees ?? []).every((sight) => FRAMEWORK.has(sight));
|
|
51
|
+
const policy = folded.policy && !made ? { ...folded.policy, grants: folded.policy.grants.filter((grant) => !FRAMEWORK.has(grant)), ...(folded.policy.sees ? { sees: folded.policy.sees.filter((sight) => !FRAMEWORK.has(sight)) } : {}) } : undefined;
|
|
52
|
+
const { policy: _folded, ...rest } = folded;
|
|
53
|
+
const own = { ...rest, schema, mutations: (folded.mutations ?? []).filter((act) => !FRAMEWORK.has(act)), ...(policy ? { policy: policy.sees?.length === 0 ? (({ sees: _, ...kept }) => kept)(policy) : policy } : {}) };
|
|
54
|
+
UNFOLDED.set(app, own);
|
|
55
|
+
return own;
|
|
56
|
+
}
|
|
57
|
+
/** Whether an app had its rooms folded in. */
|
|
58
|
+
export const roomsFolded = (app) => UNFOLDED.has(app);
|
|
59
|
+
/** The kinds a room's thread is on, each once. */
|
|
60
|
+
const threadKinds = (rooms) => [...new Set(Object.values(rooms).flatMap((room) => (room.about ? [room.about] : [])))];
|
|
61
|
+
/** The rooms a message kind was made for, by its definition. */
|
|
62
|
+
const ROOMS_OF_KIND = new WeakMap();
|
|
63
|
+
/** Whether a room of the app reads `@Name` as a mention: unless it says `mentions: false`. A room the kind was not made for reads none. */
|
|
64
|
+
export function mentionsOnIn(schema, room) {
|
|
65
|
+
const rooms = ROOMS_OF_KIND.get(schema.tryDefinition(MESSAGE_KIND) ?? {});
|
|
66
|
+
const declared = typeof room === "string" ? rooms?.[room] : undefined;
|
|
67
|
+
return declared !== undefined && declared.mentions !== false;
|
|
68
|
+
}
|
|
69
|
+
/** The rooms an app's schema was given its message kind for: what a page reads them from when it holds only the store. */
|
|
70
|
+
export const roomsOfSchema = (schema) => {
|
|
71
|
+
const definition = schema.tryDefinition(MESSAGE_KIND);
|
|
72
|
+
return definition ? ROOMS_OF_KIND.get(definition) : undefined;
|
|
73
|
+
};
|
|
74
|
+
/** The framework's message kind, for these rooms. */
|
|
75
|
+
export function messageKind(rooms) {
|
|
76
|
+
const ids = [...Object.keys(rooms), ...FRAMEWORK_ROOMS];
|
|
77
|
+
const definition = defineNode(MESSAGE_KIND, {
|
|
78
|
+
description: "Something somebody said in one of the app's rooms or in the thread on one of its records, or to the app's AI and what it said back.",
|
|
79
|
+
// In zod/mini, as a compiled document's kinds are: a page that draws a room carries no classic zod.
|
|
80
|
+
fields: z.object({
|
|
81
|
+
room: ids.length > 0 ? z.enum(ids) : z.string(),
|
|
82
|
+
about: z.optional(z.string()),
|
|
83
|
+
body: z.string().check(z.maxLength(LONGEST_MESSAGE)),
|
|
84
|
+
author: z.string().check(z.minLength(1)),
|
|
85
|
+
authorName: z.optional(z.string()),
|
|
86
|
+
authorKind: z.optional(z.string()),
|
|
87
|
+
at: z.string().check(z.minLength(1)),
|
|
88
|
+
replyTo: z.optional(z.string()),
|
|
89
|
+
editedAt: z.optional(z.string()),
|
|
90
|
+
removed: z.optional(z.boolean()),
|
|
91
|
+
asker: z.optional(z.string()),
|
|
92
|
+
door: z.optional(z.enum(["menu", "seat", "better"])),
|
|
93
|
+
interaction: z.optional(z.string()),
|
|
94
|
+
outcome: z.optional(z.string()),
|
|
95
|
+
batches: z.optional(z.array(z.string())),
|
|
96
|
+
entry: z.optional(z.string()),
|
|
97
|
+
shared: z.optional(z.enum(["editors", "everyone"])),
|
|
98
|
+
}),
|
|
99
|
+
plural: "Messages",
|
|
100
|
+
display: { glance: ["body", "authorName", "at"] },
|
|
101
|
+
label: (node) => (node.removed ? "A removed message" : excerpt(node.body, 60) || "A message"),
|
|
102
|
+
// A message is talk: kept, changed by its author, taken out by its tombstone — never archived, merged or tidied.
|
|
103
|
+
archives: false,
|
|
104
|
+
tidying: "never",
|
|
105
|
+
fixed: { room: "A message stays in the room it was said in.", about: "A message stays on the record it was said about.", author: "A message is its author's.", authorName: "Said as they were named when they posted.", authorKind: "Said as who they were when they posted.", at: "When it was said.", replyTo: "What it answers stays what it answered.", asker: "A conversation with the AI stays its asker's.", door: "Where the conversation was had.", interaction: "What the AI was asked, once." },
|
|
106
|
+
});
|
|
107
|
+
PLACELESS.add(definition);
|
|
108
|
+
// The rooms the app declared, never the framework's: a page draws a room, a thread or a bell only for those.
|
|
109
|
+
if (Object.keys(rooms).length > 0)
|
|
110
|
+
ROOMS_OF_KIND.set(definition, rooms);
|
|
111
|
+
return definition;
|
|
112
|
+
}
|
|
113
|
+
/** Whether a seat holding these roles is one a list of roles admits: unsaid, everybody. The host's own seat, acting for nobody, is always admitted. */
|
|
114
|
+
const admits = (allowed, by) => allowed === undefined || by?.system === true || (by?.roles ?? []).some((role) => allowed.includes(role));
|
|
115
|
+
/** Eight letters nobody guesses: what a message's id is made unguessable by. */
|
|
116
|
+
function unguessable() {
|
|
117
|
+
const random = globalThis.crypto?.randomUUID?.() ?? `${Date.now().toString(36)}${Math.random().toString(36).slice(2)}`;
|
|
118
|
+
return random.replace(/-/g, "").slice(0, 10);
|
|
119
|
+
}
|
|
120
|
+
/** The room a message names, or a refusal that says which rooms there are. */
|
|
121
|
+
function roomNamed(rooms, id) {
|
|
122
|
+
const room = rooms[id];
|
|
123
|
+
if (!room)
|
|
124
|
+
throw new ActRefusal(`There is no room "${id}" here. The rooms are: ${Object.keys(rooms).join(", ") || "none"}.`, "missing");
|
|
125
|
+
return room;
|
|
126
|
+
}
|
|
127
|
+
/** The message an act names, as the seat sees it. */
|
|
128
|
+
function messageNamed(ctx, id) {
|
|
129
|
+
const node = ctx.graph.getNode(id);
|
|
130
|
+
if (!node || node.kind !== MESSAGE_KIND)
|
|
131
|
+
throw new ActRefusal(`There is no message "${id}" here.`, "missing");
|
|
132
|
+
return node;
|
|
133
|
+
}
|
|
134
|
+
/** Whether a message is the acting seat's own: its author is the seat, or the person the seat acts as. */
|
|
135
|
+
const ownMessage = (ctx, message) => (ctx.by?.id !== undefined && message.author === ctx.by.id) || (ctx.me !== undefined && message.author === ctx.me);
|
|
136
|
+
/** A body as it is kept: trimmed at its ends, never empty, never longer than a message is. */
|
|
137
|
+
function bodyOf(body) {
|
|
138
|
+
const said = body.replace(/\r\n?/g, "\n").trim();
|
|
139
|
+
if (said === "")
|
|
140
|
+
throw new ActRefusal("Write something to say first.", "invalid");
|
|
141
|
+
if (said.length > LONGEST_MESSAGE)
|
|
142
|
+
throw new ActRefusal(`A message holds ${LONGEST_MESSAGE} characters; this one has ${said.length}.`, "invalid");
|
|
143
|
+
return said;
|
|
144
|
+
}
|
|
145
|
+
/** The three acts of an app's rooms: post, edit your own, remove your own (or anybody's, for a role a room lets moderate). */
|
|
146
|
+
export function roomActs(rooms, schema) {
|
|
147
|
+
const ids = Object.keys(rooms);
|
|
148
|
+
const threads = threadKinds(rooms);
|
|
149
|
+
const post = defineMutation(POST_MESSAGE, {
|
|
150
|
+
title: "Post a message",
|
|
151
|
+
description: "Say something in one of the app's rooms, or in the thread on a record.",
|
|
152
|
+
creates: [MESSAGE_KIND],
|
|
153
|
+
input: z.object({
|
|
154
|
+
room: ids.length > 0 ? z.enum(ids) : z.string(),
|
|
155
|
+
...(threads.length > 0 ? { about: z.optional(refTo(threads)) } : {}),
|
|
156
|
+
body: z.string().check(z.minLength(1), z.maxLength(LONGEST_MESSAGE)),
|
|
157
|
+
replyTo: z.optional(refTo([MESSAGE_KIND])),
|
|
158
|
+
}),
|
|
159
|
+
describe: (args, graph) => {
|
|
160
|
+
const room = rooms[args.room];
|
|
161
|
+
const about = "about" in args && typeof args.about === "string" ? graph.getNode(args.about) : undefined;
|
|
162
|
+
// The record's name as its kind says it, never its id.
|
|
163
|
+
const named = about ? labelOf(schema?.tryDefinition(String(about.kind)), about) : undefined;
|
|
164
|
+
return `Post in ${room?.title ?? args.room}${named && named !== about.id ? ` about ${named}` : ""}: ${excerpt(args.body, 60)}`;
|
|
165
|
+
},
|
|
166
|
+
apply(ctx, args) {
|
|
167
|
+
const room = roomNamed(rooms, args.room);
|
|
168
|
+
const about = "about" in args && typeof args.about === "string" && args.about !== "" ? args.about : undefined;
|
|
169
|
+
if (room.about && about === undefined)
|
|
170
|
+
throw new ActRefusal(`${room.title} is a thread on each ${room.about}: say which one this is about.`, "invalid");
|
|
171
|
+
if (!room.about && about !== undefined)
|
|
172
|
+
throw new ActRefusal(`${room.title} is one room for the whole app, about no one record.`, "invalid");
|
|
173
|
+
if (about !== undefined) {
|
|
174
|
+
const record = ctx.graph.getNode(about);
|
|
175
|
+
if (!record || record.kind !== room.about)
|
|
176
|
+
throw new ActRefusal(`There is no ${room.about} "${about}" here to talk about.`, "missing");
|
|
177
|
+
}
|
|
178
|
+
const allowed = room.post ?? room.read;
|
|
179
|
+
if (!admits(allowed, ctx.by))
|
|
180
|
+
throw new ActRefusal(`Only ${rolesSaid(allowed)} may post in ${room.title}.`, "forbidden");
|
|
181
|
+
if (args.replyTo !== undefined) {
|
|
182
|
+
const answered = messageNamed(ctx, args.replyTo);
|
|
183
|
+
if (answered.room !== args.room || (answered.about ?? undefined) !== about)
|
|
184
|
+
throw new ActRefusal("A reply answers a message in the same room, or the same thread.", "invalid");
|
|
185
|
+
}
|
|
186
|
+
const by = ctx.by;
|
|
187
|
+
const author = by?.id ?? ctx.me ?? by?.kind ?? "someone";
|
|
188
|
+
ctx.addNode({
|
|
189
|
+
// Unguessable, so an id asked for or stepped past says nothing of a room the seat may not read.
|
|
190
|
+
id: ctx.freshId(`${args.room}-${unguessable()}`, MESSAGE_KIND),
|
|
191
|
+
kind: MESSAGE_KIND,
|
|
192
|
+
room: args.room,
|
|
193
|
+
...(about !== undefined ? { about } : {}),
|
|
194
|
+
body: bodyOf(args.body),
|
|
195
|
+
author,
|
|
196
|
+
...(by?.name ? { authorName: by.name } : {}),
|
|
197
|
+
...(by?.kind ? { authorKind: by.kind } : {}),
|
|
198
|
+
at: ctx.now ?? new Date().toISOString(),
|
|
199
|
+
...(args.replyTo !== undefined ? { replyTo: args.replyTo } : {}),
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
const edit = defineMutation(EDIT_MESSAGE, {
|
|
204
|
+
title: "Edit the message",
|
|
205
|
+
description: "Change what you said. Only its author may.",
|
|
206
|
+
subject: { kinds: [MESSAGE_KIND], arg: "id" },
|
|
207
|
+
writes: ["body", "editedAt"],
|
|
208
|
+
idempotent: true,
|
|
209
|
+
input: z.object({ id: refTo([MESSAGE_KIND]), body: z.string().check(z.minLength(1), z.maxLength(LONGEST_MESSAGE)) }),
|
|
210
|
+
describe: (args) => `Edit a message: ${excerpt(args.body, 60)}`,
|
|
211
|
+
apply(ctx, args) {
|
|
212
|
+
const message = messageNamed(ctx, args.id);
|
|
213
|
+
if (message.removed)
|
|
214
|
+
throw new ActRefusal("That message was removed; there is nothing to edit.", "invalid");
|
|
215
|
+
if (!ownMessage(ctx, message))
|
|
216
|
+
throw new ActRefusal("Only whoever said it may edit a message.", "forbidden");
|
|
217
|
+
const body = bodyOf(args.body);
|
|
218
|
+
if (body === message.body)
|
|
219
|
+
return;
|
|
220
|
+
ctx.patchNode(args.id, { body, editedAt: ctx.now ?? new Date().toISOString() });
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
const remove = defineMutation(REMOVE_MESSAGE, {
|
|
224
|
+
title: "Remove the message",
|
|
225
|
+
description: "Take a message out. It says it was removed where it stood; undo puts it back.",
|
|
226
|
+
subject: { kinds: [MESSAGE_KIND], arg: "id" },
|
|
227
|
+
writes: ["body", "removed"],
|
|
228
|
+
destructive: true,
|
|
229
|
+
idempotent: true,
|
|
230
|
+
input: z.object({ id: refTo([MESSAGE_KIND]) }),
|
|
231
|
+
describe: () => "Remove a message",
|
|
232
|
+
apply(ctx, args) {
|
|
233
|
+
const message = messageNamed(ctx, args.id);
|
|
234
|
+
if (message.removed)
|
|
235
|
+
return;
|
|
236
|
+
const room = rooms[message.room];
|
|
237
|
+
if (!ownMessage(ctx, message) && !(room?.moderate && admits(room.moderate, ctx.by))) {
|
|
238
|
+
throw new ActRefusal(room?.moderate ? `Only whoever said it, or ${rolesSaid(room.moderate)}, may remove a message.` : "Only whoever said it may remove a message.", "forbidden");
|
|
239
|
+
}
|
|
240
|
+
ctx.patchNode(args.id, { body: "", removed: true });
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
for (const act of [post, edit, remove])
|
|
244
|
+
FRAMEWORK.add(act);
|
|
245
|
+
return [post, edit, remove];
|
|
246
|
+
}
|
|
247
|
+
/** The instant one thousandth of a second after another, so an answer is read after what it answers. */
|
|
248
|
+
const justAfter = (at) => {
|
|
249
|
+
const time = Date.parse(at);
|
|
250
|
+
return Number.isNaN(time) ? at : new Date(time + 1).toISOString();
|
|
251
|
+
};
|
|
252
|
+
/** Who a conversation with the AI is kept for: the account acting, or the person an agent acts for. */
|
|
253
|
+
const askerOf = (ctx) => (ctx.by?.system ? undefined : ctx.by?.person ? ctx.by.person.id : ctx.by?.id);
|
|
254
|
+
/** Whether the acting seat is the asker of a conversation: its own account or the person it is bound to, or the host's own seat. */
|
|
255
|
+
const asksIt = (ctx, message) => ctx.by?.system === true || (message.asker !== undefined && message.asker === askerOf(ctx));
|
|
256
|
+
/** Whether the AI is what keeps a turn: an agent acting for a person, or the host's own seat. A person does not write what the AI said. */
|
|
257
|
+
const theAi = (ctx) => ctx.by?.system === true || (ctx.by?.kind === "agent" && ctx.by.person?.id !== undefined);
|
|
258
|
+
/** The AI's answers already kept in the framework's rooms, as the acting seat sees them. */
|
|
259
|
+
const aiAnswers = (ctx) => ctx.graph.nodesOfKind(MESSAGE_KIND).filter((message) => isFrameworkRoom(message.room) && message.authorKind === "agent" && message.interaction !== undefined);
|
|
260
|
+
/** Whether an interaction's kept entry, where it names who asked, names the conversation's asker. The host's own seat keeps any. */
|
|
261
|
+
function entryIsFor(ctx, entry, asker) {
|
|
262
|
+
if (entry === undefined || ctx.by?.system === true)
|
|
263
|
+
return true;
|
|
264
|
+
let by;
|
|
265
|
+
try {
|
|
266
|
+
by = JSON.parse(entry).by;
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
const id = by && typeof by === "object" ? by.id : undefined;
|
|
272
|
+
return id === undefined || id === asker;
|
|
273
|
+
}
|
|
274
|
+
/** The opening message of a conversation with the AI: the one it replies to, or itself. */
|
|
275
|
+
function openerOf(ctx, id) {
|
|
276
|
+
const message = messageNamed(ctx, id);
|
|
277
|
+
if (!isFrameworkRoom(message.room))
|
|
278
|
+
throw new ActRefusal("That message is not part of a conversation with the AI.", "invalid");
|
|
279
|
+
return message.replyTo ? messageNamed(ctx, message.replyTo) : message;
|
|
280
|
+
}
|
|
281
|
+
/** Every message of a conversation with the AI, its opener first. */
|
|
282
|
+
function threadMessages(ctx, opener) {
|
|
283
|
+
return [opener, ...ctx.graph.nodesOfKind(MESSAGE_KIND).filter((message) => message.replyTo === opener.id)];
|
|
284
|
+
}
|
|
285
|
+
/** A body as an AI turn keeps it: what was said, cut to what a message holds. */
|
|
286
|
+
const turnBody = (said, fallback) => {
|
|
287
|
+
const kept = said.replace(/\r\n?/g, "\n").trim() || fallback;
|
|
288
|
+
return kept.length > LONGEST_MESSAGE ? `${kept.slice(0, LONGEST_MESSAGE - 1)}…` : kept;
|
|
289
|
+
};
|
|
290
|
+
const OUTCOMES = ["offered", "accepted", "partly", "dismissed", "drawn", "failed", "said"];
|
|
291
|
+
/**
|
|
292
|
+
* THE THREE ACTS OF A CONVERSATION WITH THE AI (Graview HQ
|
|
293
|
+
* feature:f-conversations-in-the-graph): keep a finished turn — what the
|
|
294
|
+
* person asked, as a message by them, and what the AI said, as a message by
|
|
295
|
+
* it — as the opening of a conversation or a reply in one; settle what
|
|
296
|
+
* became of what it offered; and share the conversation with the app's
|
|
297
|
+
* editors or everybody, or keep it to its asker again. Streamed words are
|
|
298
|
+
* never kept: only a turn once it is over.
|
|
299
|
+
*/
|
|
300
|
+
export function aiRoomActs(schema) {
|
|
301
|
+
void schema;
|
|
302
|
+
const keep = defineMutation(KEEP_AI_TURN, {
|
|
303
|
+
title: "Keep a conversation with the AI",
|
|
304
|
+
description: "Keep what somebody asked the app's AI and what it said back, as two messages of a conversation only they see until they share it.",
|
|
305
|
+
creates: [MESSAGE_KIND],
|
|
306
|
+
input: z.object({
|
|
307
|
+
room: z.enum([ASKS_ROOM, DESIGN_ROOM]),
|
|
308
|
+
about: z.optional(z.string()),
|
|
309
|
+
ask: z.string().check(z.minLength(1)),
|
|
310
|
+
answer: z.string(),
|
|
311
|
+
follows: z.optional(refTo([MESSAGE_KIND])),
|
|
312
|
+
door: z.optional(z.enum(["menu", "seat", "better"])),
|
|
313
|
+
agent: z.optional(z.string().check(z.maxLength(80))),
|
|
314
|
+
interaction: z.optional(z.string()),
|
|
315
|
+
outcome: z.optional(z.enum(OUTCOMES)),
|
|
316
|
+
batches: z.optional(z.array(z.string())),
|
|
317
|
+
entry: z.optional(z.string()),
|
|
318
|
+
}),
|
|
319
|
+
describe: (args) => `Keep a conversation with the AI: ${excerpt(args.ask, 60)}`,
|
|
320
|
+
apply(ctx, args) {
|
|
321
|
+
if (!theAi(ctx))
|
|
322
|
+
throw new ActRefusal("A conversation with the AI is kept by the app's AI, acting for the person who asked.", "forbidden");
|
|
323
|
+
const asker = askerOf(ctx);
|
|
324
|
+
if (asker === undefined && !ctx.by?.system)
|
|
325
|
+
throw new ActRefusal("A conversation with the AI is kept for somebody: sign in to keep one.", "forbidden");
|
|
326
|
+
if (args.interaction !== undefined && aiAnswers(ctx).some((message) => message.interaction === args.interaction))
|
|
327
|
+
throw new ActRefusal("That turn with the AI is already kept; what became of it is settled instead.", "invalid");
|
|
328
|
+
if (!entryIsFor(ctx, args.entry, asker))
|
|
329
|
+
throw new ActRefusal("A turn with the AI is kept only for whoever asked it.", "forbidden");
|
|
330
|
+
const opener = args.follows !== undefined ? openerOf(ctx, args.follows) : undefined;
|
|
331
|
+
if (opener && (opener.room !== args.room || !asksIt(ctx, opener)))
|
|
332
|
+
throw new ActRefusal("A conversation with the AI goes on only in its own room, and only for whoever asked it.", "forbidden");
|
|
333
|
+
const now = ctx.now ?? new Date().toISOString();
|
|
334
|
+
const about = opener ? opener.about : args.about !== undefined && args.about !== "" ? args.about : undefined;
|
|
335
|
+
const by = ctx.by;
|
|
336
|
+
const person = by?.person ?? (by?.kind === "agent" ? undefined : by);
|
|
337
|
+
// Named for the interaction where there is one (its id is unguessable), so the entry and its messages are found by each other; else unguessable.
|
|
338
|
+
const token = args.interaction ? args.interaction.toLowerCase().replace(/[^a-z0-9-]+/g, "-").slice(0, 48) : unguessable();
|
|
339
|
+
const askId = ctx.freshId(`ask-${token}`, MESSAGE_KIND);
|
|
340
|
+
const common = {
|
|
341
|
+
kind: MESSAGE_KIND,
|
|
342
|
+
room: args.room,
|
|
343
|
+
...(about !== undefined ? { about } : {}),
|
|
344
|
+
...(asker !== undefined ? { asker } : {}),
|
|
345
|
+
...(args.door ? { door: args.door } : {}),
|
|
346
|
+
...(opener?.shared ? { shared: opener.shared } : {}),
|
|
347
|
+
};
|
|
348
|
+
ctx.addNode({
|
|
349
|
+
...common,
|
|
350
|
+
id: askId,
|
|
351
|
+
body: turnBody(args.ask, "(asked)"),
|
|
352
|
+
author: asker ?? "someone",
|
|
353
|
+
...(person?.name ? { authorName: person.name } : {}),
|
|
354
|
+
authorKind: "human",
|
|
355
|
+
at: now,
|
|
356
|
+
...(opener ? { replyTo: opener.id } : {}),
|
|
357
|
+
});
|
|
358
|
+
const agentName = args.agent ?? (by?.kind === "agent" ? by.name : undefined) ?? "AI";
|
|
359
|
+
ctx.addNode({
|
|
360
|
+
...common,
|
|
361
|
+
id: ctx.freshId(`answer-${token}`, MESSAGE_KIND),
|
|
362
|
+
body: turnBody(args.answer, "(no answer)"),
|
|
363
|
+
author: by?.kind === "agent" && by.id ? by.id : "ai",
|
|
364
|
+
authorName: agentName,
|
|
365
|
+
authorKind: "agent",
|
|
366
|
+
at: justAfter(now),
|
|
367
|
+
replyTo: opener?.id ?? askId,
|
|
368
|
+
...(args.interaction ? { interaction: args.interaction } : {}),
|
|
369
|
+
...(args.outcome ? { outcome: args.outcome } : {}),
|
|
370
|
+
...(args.batches && args.batches.length > 0 ? { batches: args.batches } : {}),
|
|
371
|
+
...(args.entry ? { entry: args.entry } : {}),
|
|
372
|
+
});
|
|
373
|
+
},
|
|
374
|
+
});
|
|
375
|
+
const settle = defineMutation(SETTLE_AI_TURN, {
|
|
376
|
+
title: "Settle what the AI offered",
|
|
377
|
+
description: "Say what became of what the AI offered in a conversation: taken, put away, undone.",
|
|
378
|
+
subject: { kinds: [MESSAGE_KIND], arg: "id" },
|
|
379
|
+
writes: ["outcome", "batches", "entry"],
|
|
380
|
+
idempotent: true,
|
|
381
|
+
input: z.object({
|
|
382
|
+
id: refTo([MESSAGE_KIND]),
|
|
383
|
+
outcome: z.optional(z.enum(OUTCOMES)),
|
|
384
|
+
batches: z.optional(z.array(z.string())),
|
|
385
|
+
entry: z.optional(z.string()),
|
|
386
|
+
}),
|
|
387
|
+
describe: (args) => `Settle what the AI offered${args.outcome ? `: ${args.outcome}` : ""}`,
|
|
388
|
+
apply(ctx, args) {
|
|
389
|
+
const message = messageNamed(ctx, args.id);
|
|
390
|
+
if (!isFrameworkRoom(message.room) || message.authorKind !== "agent")
|
|
391
|
+
throw new ActRefusal("Only what the AI said in a conversation with it is settled.", "invalid");
|
|
392
|
+
if (!theAi(ctx))
|
|
393
|
+
throw new ActRefusal("What the AI offered is settled by the app's AI, acting for the person who asked.", "forbidden");
|
|
394
|
+
if (!asksIt(ctx, message))
|
|
395
|
+
throw new ActRefusal("Only whoever asked may settle what the AI offered them.", "forbidden");
|
|
396
|
+
if (!entryIsFor(ctx, args.entry, message.asker))
|
|
397
|
+
throw new ActRefusal("What the AI offered is settled only for whoever asked it.", "forbidden");
|
|
398
|
+
const patch = {};
|
|
399
|
+
if (args.outcome !== undefined && args.outcome !== message.outcome)
|
|
400
|
+
patch["outcome"] = args.outcome;
|
|
401
|
+
if (args.batches !== undefined && args.batches.join("\u0000") !== (message.batches ?? []).join("\u0000"))
|
|
402
|
+
patch["batches"] = args.batches;
|
|
403
|
+
if (args.entry !== undefined && args.entry !== message.entry)
|
|
404
|
+
patch["entry"] = args.entry;
|
|
405
|
+
if (Object.keys(patch).length > 0)
|
|
406
|
+
ctx.patchNode(args.id, patch);
|
|
407
|
+
},
|
|
408
|
+
});
|
|
409
|
+
const share = defineMutation(SHARE_CONVERSATION, {
|
|
410
|
+
title: "Share the conversation",
|
|
411
|
+
description: "Let the app's editors, or everybody, read a conversation you had with the AI; or keep it to yourself again.",
|
|
412
|
+
subject: { kinds: [MESSAGE_KIND], arg: "id" },
|
|
413
|
+
writes: ["shared"],
|
|
414
|
+
idempotent: true,
|
|
415
|
+
input: z.object({ id: refTo([MESSAGE_KIND]), with: z.enum(["editors", "everyone", "nobody"]) }),
|
|
416
|
+
describe: (args) => (args.with === "nobody" ? "Keep the conversation to yourself" : args.with === "editors" ? "Share the conversation with the app's editors" : "Share the conversation with everybody"),
|
|
417
|
+
apply(ctx, args) {
|
|
418
|
+
const opener = openerOf(ctx, args.id);
|
|
419
|
+
if (!asksIt(ctx, opener))
|
|
420
|
+
throw new ActRefusal("Only whoever asked may share a conversation with the AI.", "forbidden");
|
|
421
|
+
const shared = args.with === "nobody" ? undefined : args.with;
|
|
422
|
+
for (const message of threadMessages(ctx, opener))
|
|
423
|
+
if (message.shared !== shared)
|
|
424
|
+
ctx.patchNode(message.id, { shared });
|
|
425
|
+
},
|
|
426
|
+
});
|
|
427
|
+
for (const act of [keep, settle, share])
|
|
428
|
+
FRAMEWORK.add(act);
|
|
429
|
+
return [keep, settle, share];
|
|
430
|
+
}
|
|
431
|
+
/** The grant that lets the acts be run: each room says who it admits, and the acts hold to it. */
|
|
432
|
+
export const ROOMS_GRANT = {
|
|
433
|
+
roles: "*",
|
|
434
|
+
mutations: [...ROOM_ACTS, ...AI_ROOM_ACTS],
|
|
435
|
+
kinds: "*",
|
|
436
|
+
describe: "Whoever a room lets in may post in it, and change or take out what they said; everybody may keep and share their own conversations with the AI.",
|
|
437
|
+
};
|
|
438
|
+
FRAMEWORK.add(ROOMS_GRANT);
|
|
439
|
+
/** Each room's sight over its messages: its readers, and a thread's messages only where the record is seen too. */
|
|
440
|
+
export function roomSights(rooms) {
|
|
441
|
+
return Object.entries(rooms).map(([id, room]) => framework({
|
|
442
|
+
roles: room.read ?? "*",
|
|
443
|
+
kinds: [MESSAGE_KIND],
|
|
444
|
+
where: { field: "room", is: [id] },
|
|
445
|
+
...(room.about ? { follows: "about" } : {}),
|
|
446
|
+
describe: `${room.read ? `Only ${rolesSaid(room.read)}` : "Everybody"} may read ${room.title}${room.about ? `, and only on ${withArticle(room.about)} they can see` : ""}.`,
|
|
447
|
+
}));
|
|
448
|
+
}
|
|
449
|
+
/** A part of the policy the framework folded in, known as such. */
|
|
450
|
+
function framework(part) {
|
|
451
|
+
FRAMEWORK.add(part);
|
|
452
|
+
return part;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* WHO MAY CHANGE EVERYTHING IN THE APP: the roles a grant of every act
|
|
456
|
+
* names, which "Share with the app's editors" shares a conversation with.
|
|
457
|
+
* Everybody, without a policy or with a grant of every act to everybody.
|
|
458
|
+
*/
|
|
459
|
+
export function editorRolesOf(policy) {
|
|
460
|
+
if (!policy)
|
|
461
|
+
return "*";
|
|
462
|
+
const whole = policy.grants.filter((grant) => !FRAMEWORK.has(grant) && grant.mutations === "*" && !grant.self && !grant.ownEnd && (grant.kinds === undefined || grant.kinds === "*"));
|
|
463
|
+
if (whole.some((grant) => grant.roles === "*"))
|
|
464
|
+
return "*";
|
|
465
|
+
return [...new Set(whole.flatMap((grant) => grant.roles))];
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* THE SIGHTS OVER THE FRAMEWORK'S ROOMS: a conversation with the AI is its
|
|
469
|
+
* asker's alone; shared, it is seen by the app's editors or by everybody.
|
|
470
|
+
* Nobody else sees it — an owner included — unless it is shared.
|
|
471
|
+
*/
|
|
472
|
+
export function frameworkRoomSights(policy) {
|
|
473
|
+
const editors = editorRolesOf(policy);
|
|
474
|
+
return [
|
|
475
|
+
framework({ roles: "*", kinds: [MESSAGE_KIND], where: { field: "room", is: [...FRAMEWORK_ROOMS] }, mine: "asker", describe: "A conversation with the AI is seen by whoever asked it." }),
|
|
476
|
+
framework({ roles: "*", kinds: [MESSAGE_KIND], where: { field: "shared", is: ["everyone"] }, follows: "about", describe: "A conversation with the AI shared with everybody is seen by everybody who may see what it is about." }),
|
|
477
|
+
...(editors === "*" || editors.length > 0 ? [framework({ roles: editors, kinds: [MESSAGE_KIND], where: { field: "shared", is: ["editors"] }, follows: "about", describe: "A conversation with the AI shared with the app's editors is seen by those of them who may see what it is about." })] : []),
|
|
478
|
+
];
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* THE POLICY WITH ITS ROOMS FOLDED IN. Without a policy, nothing of the
|
|
482
|
+
* app's own is kept from anybody; the framework's rooms bring a policy
|
|
483
|
+
* that sees everything else as before and keeps each conversation with the
|
|
484
|
+
* AI to whoever asked it.
|
|
485
|
+
*/
|
|
486
|
+
export function roomsPolicy(policy, rooms, kinds, taken = new Set()) {
|
|
487
|
+
const base = policy ?? { grants: [framework({ roles: "*", mutations: "*", describe: "Everybody may do everything here." })] };
|
|
488
|
+
const acts = [...(Object.keys(rooms).length > 0 ? ROOM_ACTS : []), ...AI_ROOM_ACTS];
|
|
489
|
+
const grant = taken.size === 0 && acts.length === ROOMS_GRANT.mutations.length ? ROOMS_GRANT : framework({ ...ROOMS_GRANT, mutations: acts.filter((act) => !taken.has(act)) });
|
|
490
|
+
const grants = base.grants.some((one) => FRAMEWORK.has(one) && one.mutations !== "*") ? base.grants : [...base.grants, grant];
|
|
491
|
+
const sights = base.sees?.length ? base.sees : [framework({ roles: "*", kinds: kinds.filter((kind) => kind !== MESSAGE_KIND), describe: "Everybody sees everything else here." })];
|
|
492
|
+
return { ...base, grants, sees: [...sights.filter((sight) => !sight.kinds.includes(MESSAGE_KIND)), ...roomSights(rooms), ...frameworkRoomSights(policy)] };
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* FOLD AN APP'S ROOMS IN: its schema with the message kind, its acts with
|
|
496
|
+
* the three a declared room brings and the three every app's conversations
|
|
497
|
+
* with the AI need, its policy with their grant and sights. One already
|
|
498
|
+
* folded, and one that declares a `message` kind of its own (which
|
|
499
|
+
* `graview check` refuses where it declares rooms, `room-kind-taken`, and
|
|
500
|
+
* warns of where it does not, `ai-room-kind-taken`) come back as they are.
|
|
501
|
+
*/
|
|
502
|
+
export function withRooms(app) {
|
|
503
|
+
if (UNFOLDED.has(app) || !app.schema?.tryDefinition)
|
|
504
|
+
return app;
|
|
505
|
+
if (app.schema.tryDefinition(MESSAGE_KIND))
|
|
506
|
+
return app;
|
|
507
|
+
const rooms = app.rooms ?? {};
|
|
508
|
+
const kind = messageKind(rooms);
|
|
509
|
+
const schema = createSchema([...app.schema.definitions, kind], app.schema.computed);
|
|
510
|
+
const taken = new Set((app.mutations ?? []).map((mutation) => mutation.name));
|
|
511
|
+
const acts = [...(Object.keys(rooms).length > 0 ? roomActs(rooms, schema) : []), ...aiRoomActs(schema)].filter((act) => !taken.has(act.name));
|
|
512
|
+
// An act of the app's own by one of these names (`room-act-taken`) is not widened by the rooms' grant.
|
|
513
|
+
const policy = roomsPolicy(app.policy, rooms, schema.kinds, taken);
|
|
514
|
+
const folded = { ...app, schema, mutations: [...(app.mutations ?? []), ...acts], ...(policy ? { policy } : {}) };
|
|
515
|
+
UNFOLDED.set(folded, app);
|
|
516
|
+
return folded;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* A SNAPSHOT WITHOUT ITS TALK: every message taken out, for a copy that is
|
|
520
|
+
* not this app's own history — a template, a remix, an export for
|
|
521
|
+
* strangers. What people said to each other stays with the app it was said
|
|
522
|
+
* in.
|
|
523
|
+
*/
|
|
524
|
+
export function withoutTalk(snapshot) {
|
|
525
|
+
const talk = new Set(snapshot.nodes.filter((node) => node.kind === MESSAGE_KIND).map((node) => node.id));
|
|
526
|
+
if (talk.size === 0)
|
|
527
|
+
return snapshot;
|
|
528
|
+
return { ...snapshot, nodes: snapshot.nodes.filter((node) => !talk.has(node.id)), edges: snapshot.edges.filter((edge) => !talk.has(edge.from) && !talk.has(edge.to)) };
|
|
529
|
+
}
|
|
530
|
+
//# sourceMappingURL=kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kind.js","sourceRoot":"","sources":["../../src/rooms/kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,kBAAkB,CAAC;AAItC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,kBAAkB,EAA2D,MAAM,YAAY,CAAC;AAErS;;;;;;;;;;;;;;;GAeG;AAEH,8HAA8H;AAC9H,MAAM,SAAS,GAAG,IAAI,OAAO,EAAU,CAAC;AAExC,uIAAuI;AACvI,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAAmB,EAAW,EAAE,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAA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