@graview/core 0.2.20 → 0.2.21
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/dist/arranging.d.ts.map +1 -1
- package/dist/arranging.js +8 -1
- package/dist/arranging.js.map +1 -1
- package/dist/document.schema.json +2 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/mutations/types.d.ts +2 -0
- package/dist/mutations/types.d.ts.map +1 -1
- package/dist/permissions/policy.d.ts +1 -0
- package/dist/permissions/policy.d.ts.map +1 -1
- package/dist/permissions/policy.js +2 -0
- package/dist/permissions/policy.js.map +1 -1
- package/dist/rooms/findings.d.ts +2 -2
- package/dist/rooms/findings.d.ts.map +1 -1
- package/dist/rooms/findings.js +8 -3
- package/dist/rooms/findings.js.map +1 -1
- package/dist/rooms/intent.d.ts +22 -0
- package/dist/rooms/intent.d.ts.map +1 -0
- package/dist/rooms/intent.js +54 -0
- package/dist/rooms/intent.js.map +1 -0
- package/dist/rooms/kind.d.ts +24 -4
- package/dist/rooms/kind.d.ts.map +1 -1
- package/dist/rooms/kind.js +144 -35
- package/dist/rooms/kind.js.map +1 -1
- package/dist/rooms/read.d.ts +33 -2
- package/dist/rooms/read.d.ts.map +1 -1
- package/dist/rooms/read.js +50 -2
- package/dist/rooms/read.js.map +1 -1
- package/dist/rooms/shape.d.ts +40 -2
- package/dist/rooms/shape.d.ts.map +1 -1
- package/dist/rooms/shape.js +35 -2
- package/dist/rooms/shape.js.map +1 -1
- package/dist/rooms/talk-shape.d.ts +29 -0
- package/dist/rooms/talk-shape.d.ts.map +1 -0
- package/dist/rooms/talk-shape.js +2 -0
- package/dist/rooms/talk-shape.js.map +1 -0
- package/dist/rooms/talk.d.ts +50 -0
- package/dist/rooms/talk.d.ts.map +1 -0
- package/dist/rooms/talk.js +105 -0
- package/dist/rooms/talk.js.map +1 -0
- package/dist/rooms/touches.d.ts +13 -0
- package/dist/rooms/touches.d.ts.map +1 -0
- package/dist/rooms/touches.js +70 -0
- package/dist/rooms/touches.js.map +1 -0
- package/dist/rooms/touchpoints.d.ts +66 -0
- package/dist/rooms/touchpoints.d.ts.map +1 -0
- package/dist/rooms/touchpoints.js +131 -0
- package/dist/rooms/touchpoints.js.map +1 -0
- package/dist/rooms.d.ts +12 -2
- package/dist/rooms.d.ts.map +1 -1
- package/dist/rooms.js +13 -2
- package/dist/rooms.js.map +1 -1
- package/dist/store.d.ts +14 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +9 -1
- package/dist/store.js.map +1 -1
- package/dist/subscription-shape.d.ts +11 -0
- package/dist/subscription-shape.d.ts.map +1 -1
- package/dist/subscription-shape.js.map +1 -1
- package/dist/subscriptions.d.ts.map +1 -1
- package/dist/subscriptions.js +19 -1
- package/dist/subscriptions.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { GraviewApp } from "../app.js";
|
|
2
|
+
import type { AnyMutationDefinition } from "../mutations/types.js";
|
|
3
|
+
import type { Policy } from "../permissions/types.js";
|
|
4
|
+
import type { AnySchema } from "../schema/schema.js";
|
|
5
|
+
import { type AppRooms } from "./shape.js";
|
|
6
|
+
import type { TalkOptions, TalkSettings, TalkSwitch } from "./talk-shape.js";
|
|
7
|
+
/** The room for everybody in the app. */
|
|
8
|
+
export declare const EVERYONE_ROOM = "everyone";
|
|
9
|
+
/** The thread on any record. */
|
|
10
|
+
export declare const COMMENTS_ROOM = "comments";
|
|
11
|
+
/** The room to the owners: requests and problem reports, each seen by whoever sent it and the owners. */
|
|
12
|
+
export declare const OWNERS_ROOM = "owners";
|
|
13
|
+
/** The standard set: a room for everybody, a thread on any record, and a room to the owners. */
|
|
14
|
+
export declare const STANDARD_ROOMS: AppRooms;
|
|
15
|
+
/** The switch said in full, or undefined where talk is off: `true` is the standard set, visitors kept out. */
|
|
16
|
+
export declare function talkOptionsOf(talk: TalkSwitch | undefined): TalkOptions | undefined;
|
|
17
|
+
/** What a store keeps of a switch that is on. */
|
|
18
|
+
export declare const talkSettingsOf: (options: TalkOptions) => TalkSettings;
|
|
19
|
+
/**
|
|
20
|
+
* THE ROOMS AN APP HAS WITH ITS HOST'S: the app's own first, as declared,
|
|
21
|
+
* then the host's — each but one whose word the app already uses, and of the
|
|
22
|
+
* standard set, the room for everybody only where the app has no room for
|
|
23
|
+
* the whole app of its own, and the room to the owners only where it has no
|
|
24
|
+
* such room. A thread on any record stands only where a kind has no thread
|
|
25
|
+
* of its own (`threadRoomsFor`).
|
|
26
|
+
*/
|
|
27
|
+
export declare function talkRooms(declared: AppRooms | undefined, options: TalkOptions): AppRooms;
|
|
28
|
+
/**
|
|
29
|
+
* AN APP WITH ITS HOST'S ROOMS FOLDED IN: the app as declared, folded with
|
|
30
|
+
* the rooms `talkRooms` says. Talk off, it is the app as it was. Asked
|
|
31
|
+
* twice with the same switch, the same app comes back.
|
|
32
|
+
*/
|
|
33
|
+
export declare function withTalk<A extends GraviewApp<AnySchema>>(app: A, talk: TalkSwitch | undefined): A;
|
|
34
|
+
/** What a store is opened from: its schema, acts and policy. */
|
|
35
|
+
interface StoreParts {
|
|
36
|
+
readonly schema: AnySchema;
|
|
37
|
+
readonly mutations?: readonly AnyMutationDefinition<AnySchema>[] | undefined;
|
|
38
|
+
readonly policy?: Policy | undefined;
|
|
39
|
+
readonly talk?: TalkSwitch | undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A STORE'S PARTS WITH ITS HOST'S TALK FOLDED IN: the schema, acts and
|
|
43
|
+
* policy of `withTalk` for the app the schema was folded for, where the
|
|
44
|
+
* store was opened with talk on. The acts and policy the host handed are
|
|
45
|
+
* kept, the framework's own in them swapped for the fold's. A schema no
|
|
46
|
+
* fold made, or talk off, comes back as handed.
|
|
47
|
+
*/
|
|
48
|
+
export declare function talkedParts<P extends StoreParts>(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U;IAClB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,qBAAqB,CAAC,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACxC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAS7D"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { foldedAppOfSchema, foldRooms, isRoomsOwn, unfoldedApp } from "./kind.js";
|
|
2
|
+
import { ANY_RECORD } from "./shape.js";
|
|
3
|
+
/*
|
|
4
|
+
* HOST-SUPPLIED ROOMS (Graview HQ feature:f-talk-to-the-app): the standard
|
|
5
|
+
* set a host turns on with one switch, merged with whatever rooms the app
|
|
6
|
+
* declares, and folded in where the store is opened — so a store, the
|
|
7
|
+
* server's and the page's alike, has the message kind, the acts and the
|
|
8
|
+
* sights for them without the app declaring a room.
|
|
9
|
+
*/
|
|
10
|
+
/** The room for everybody in the app. */
|
|
11
|
+
export const EVERYONE_ROOM = "everyone";
|
|
12
|
+
/** The thread on any record. */
|
|
13
|
+
export const COMMENTS_ROOM = "comments";
|
|
14
|
+
/** The room to the owners: requests and problem reports, each seen by whoever sent it and the owners. */
|
|
15
|
+
export const OWNERS_ROOM = "owners";
|
|
16
|
+
/** The standard set: a room for everybody, a thread on any record, and a room to the owners. */
|
|
17
|
+
export const STANDARD_ROOMS = {
|
|
18
|
+
[EVERYONE_ROOM]: { title: "Everyone", description: "One room for everybody in the app." },
|
|
19
|
+
[COMMENTS_ROOM]: { title: "Comments", about: ANY_RECORD },
|
|
20
|
+
[OWNERS_ROOM]: { title: "To the owners", description: "Requests and problem reports, seen by you and the app's owners.", to: "owners" },
|
|
21
|
+
};
|
|
22
|
+
/** The switch said in full, or undefined where talk is off: `true` is the standard set, visitors kept out. */
|
|
23
|
+
export function talkOptionsOf(talk) {
|
|
24
|
+
if (talk === undefined || talk === false)
|
|
25
|
+
return undefined;
|
|
26
|
+
return talk === true ? {} : talk;
|
|
27
|
+
}
|
|
28
|
+
/** What a store keeps of a switch that is on. */
|
|
29
|
+
export const talkSettingsOf = (options) => ({ visitors: options.visitors === "limited" ? "limited" : false });
|
|
30
|
+
/**
|
|
31
|
+
* THE ROOMS AN APP HAS WITH ITS HOST'S: the app's own first, as declared,
|
|
32
|
+
* then the host's — each but one whose word the app already uses, and of the
|
|
33
|
+
* standard set, the room for everybody only where the app has no room for
|
|
34
|
+
* the whole app of its own, and the room to the owners only where it has no
|
|
35
|
+
* such room. A thread on any record stands only where a kind has no thread
|
|
36
|
+
* of its own (`threadRoomsFor`).
|
|
37
|
+
*/
|
|
38
|
+
export function talkRooms(declared, options) {
|
|
39
|
+
const own = declared ?? {};
|
|
40
|
+
const host = options.rooms === undefined || options.rooms === "standard" ? STANDARD_ROOMS : options.rooms;
|
|
41
|
+
const standard = host === STANDARD_ROOMS;
|
|
42
|
+
const ownValues = Object.values(own);
|
|
43
|
+
const out = { ...own };
|
|
44
|
+
for (const [id, room] of Object.entries(host)) {
|
|
45
|
+
if (id in own)
|
|
46
|
+
continue;
|
|
47
|
+
if (standard && id === EVERYONE_ROOM && ownValues.some((one) => !one.about && one.to === undefined))
|
|
48
|
+
continue;
|
|
49
|
+
if (standard && id === OWNERS_ROOM && ownValues.some((one) => one.to === "owners"))
|
|
50
|
+
continue;
|
|
51
|
+
out[id] = room;
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
/** Each app's folds with its host's talk, by what was said: one schema for one switch, so every store opened with it agrees. */
|
|
56
|
+
const TALKED = new WeakMap();
|
|
57
|
+
/**
|
|
58
|
+
* AN APP WITH ITS HOST'S ROOMS FOLDED IN: the app as declared, folded with
|
|
59
|
+
* the rooms `talkRooms` says. Talk off, it is the app as it was. Asked
|
|
60
|
+
* twice with the same switch, the same app comes back.
|
|
61
|
+
*/
|
|
62
|
+
export function withTalk(app, talk) {
|
|
63
|
+
const options = talkOptionsOf(talk);
|
|
64
|
+
if (!options || !app.schema?.tryDefinition)
|
|
65
|
+
return app;
|
|
66
|
+
const base = unfoldedApp(app);
|
|
67
|
+
const rooms = talkRooms(base.rooms, options);
|
|
68
|
+
const settings = talkSettingsOf(options);
|
|
69
|
+
const key = JSON.stringify([rooms, settings]);
|
|
70
|
+
let made = TALKED.get(base);
|
|
71
|
+
if (!made)
|
|
72
|
+
TALKED.set(base, (made = new Map()));
|
|
73
|
+
const held = made.get(key);
|
|
74
|
+
if (held)
|
|
75
|
+
return held;
|
|
76
|
+
const folded = foldRooms(base, rooms, settings);
|
|
77
|
+
made.set(key, folded);
|
|
78
|
+
return folded;
|
|
79
|
+
}
|
|
80
|
+
/** A policy with the framework's grants and sights swapped for another fold's. */
|
|
81
|
+
function refolded(policy, from) {
|
|
82
|
+
const sees = [...(policy.sees ?? []).filter((sight) => !isRoomsOwn(sight)), ...(from?.sees ?? []).filter((sight) => isRoomsOwn(sight))];
|
|
83
|
+
return { ...policy, grants: [...policy.grants.filter((grant) => !isRoomsOwn(grant)), ...(from?.grants ?? []).filter((grant) => isRoomsOwn(grant))], ...(sees.length > 0 ? { sees } : {}) };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A STORE'S PARTS WITH ITS HOST'S TALK FOLDED IN: the schema, acts and
|
|
87
|
+
* policy of `withTalk` for the app the schema was folded for, where the
|
|
88
|
+
* store was opened with talk on. The acts and policy the host handed are
|
|
89
|
+
* kept, the framework's own in them swapped for the fold's. A schema no
|
|
90
|
+
* fold made, or talk off, comes back as handed.
|
|
91
|
+
*/
|
|
92
|
+
export function talkedParts(parts) {
|
|
93
|
+
if (!talkOptionsOf(parts.talk))
|
|
94
|
+
return parts;
|
|
95
|
+
const app = foldedAppOfSchema(parts.schema);
|
|
96
|
+
if (!app)
|
|
97
|
+
return parts;
|
|
98
|
+
const talked = withTalk(app, parts.talk);
|
|
99
|
+
if (talked === app)
|
|
100
|
+
return parts;
|
|
101
|
+
const mutations = parts.mutations === undefined ? undefined : parts.mutations === app.mutations ? talked.mutations : [...parts.mutations.filter((act) => !isRoomsOwn(act)), ...(talked.mutations ?? []).filter((act) => isRoomsOwn(act))];
|
|
102
|
+
const policy = parts.policy === undefined ? undefined : parts.policy === app.policy ? talked.policy : refolded(parts.policy, talked.policy);
|
|
103
|
+
return { ...parts, schema: talked.schema, ...(mutations ? { mutations } : {}), ...(policy ? { policy } : {}) };
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=talk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"talk.js","sourceRoot":"","sources":["../../src/rooms/talk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClF,OAAO,EAAE,UAAU,EAAiB,MAAM,YAAY,CAAC;AAGvD;;;;;;GAMG;AAEH,yCAAyC;AACzC,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;AACxC,gCAAgC;AAChC,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;AACxC,yGAAyG;AACzG,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC;AAEpC,gGAAgG;AAChG,MAAM,CAAC,MAAM,cAAc,GAAa;IACtC,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,oCAAoC,EAAE;IACzF,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACzD,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,iEAAiE,EAAE,EAAE,EAAE,QAAQ,EA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;IACjC,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC1O,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5I,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACjH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AnySchema } from "../schema/schema.js";
|
|
2
|
+
interface GraphLike {
|
|
3
|
+
getNode(id: string): unknown;
|
|
4
|
+
nodesOfKind(kind: string): readonly unknown[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* THE RECORDS A BODY NAMES, each once, in the order first named: its
|
|
8
|
+
* `@` mentions of a record by its whole name, then its links to one. The
|
|
9
|
+
* record it is said about (`about`) is not counted again.
|
|
10
|
+
*/
|
|
11
|
+
export declare function touchesIn(body: string, graph: GraphLike, schema: AnySchema, about?: string): readonly string[];
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=touches.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touches.d.ts","sourceRoot":"","sources":["../../src/rooms/touches.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAWrD,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,OAAO,EAAE,CAAC;CAC/C;AAwDD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAG9G"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { labelOf } from "../schema/define-node.js";
|
|
2
|
+
import { MESSAGE_KIND } from "./shape.js";
|
|
3
|
+
const WORD = /[\p{L}\p{N}_'-]/u;
|
|
4
|
+
/** A link's target in markdown (`[words](target)`), or a bare address or path. */
|
|
5
|
+
const LINKS = /\]\(([^)\s]+)\)|\bhttps?:\/\/[^\s<>()]+|(?:^|\s)(\/[^\s<>()]+)/g;
|
|
6
|
+
/** The most records a message is read as naming: talk, not an index. */
|
|
7
|
+
const MOST_TOUCHES = 24;
|
|
8
|
+
/** Each record a link names: a segment of its path that is a record's id. */
|
|
9
|
+
function linkedIn(body, graph, schema) {
|
|
10
|
+
const found = [];
|
|
11
|
+
for (const match of body.matchAll(LINKS)) {
|
|
12
|
+
const target = match[1] ?? match[2] ?? match[0];
|
|
13
|
+
const path = target.replace(/^\s+/, "").replace(/^https?:\/\/[^/]+/, "").split(/[?#]/)[0] ?? "";
|
|
14
|
+
for (const segment of path.split("/").reverse()) {
|
|
15
|
+
if (segment === "")
|
|
16
|
+
continue;
|
|
17
|
+
let id;
|
|
18
|
+
try {
|
|
19
|
+
id = decodeURIComponent(segment);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const node = graph.getNode(id);
|
|
25
|
+
if (node && node.kind !== MESSAGE_KIND && schema.tryDefinition(node.kind)) {
|
|
26
|
+
found.push(node.id);
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return found;
|
|
32
|
+
}
|
|
33
|
+
/** Each record named after an `@` by its whole name — the longest name first, so "@Sam Rivera" is Sam Rivera before anybody called Sam. */
|
|
34
|
+
function namedIn(body, graph, schema) {
|
|
35
|
+
if (!body.includes("@"))
|
|
36
|
+
return [];
|
|
37
|
+
const names = [];
|
|
38
|
+
for (const definition of schema.definitions) {
|
|
39
|
+
if (definition.kind === MESSAGE_KIND)
|
|
40
|
+
continue;
|
|
41
|
+
for (const node of graph.nodesOfKind(definition.kind)) {
|
|
42
|
+
const name = labelOf(definition, node).trim().toLowerCase();
|
|
43
|
+
if (name !== "" && name !== node.id.toLowerCase())
|
|
44
|
+
names.push({ id: node.id, name });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
names.sort((a, b) => b.name.length - a.name.length);
|
|
48
|
+
const lower = body.toLowerCase();
|
|
49
|
+
const found = [];
|
|
50
|
+
for (let at = lower.indexOf("@"); at >= 0; at = lower.indexOf("@", at + 1)) {
|
|
51
|
+
if (at > 0 && WORD.test(lower[at - 1]))
|
|
52
|
+
continue;
|
|
53
|
+
const rest = lower.slice(at + 1);
|
|
54
|
+
const whole = names.filter((one) => rest.startsWith(one.name) && !WORD.test(rest[one.name.length] ?? " "));
|
|
55
|
+
// Two records of one name are named by neither.
|
|
56
|
+
if (whole.length > 0 && whole.filter((one) => one.name === whole[0].name).length === 1)
|
|
57
|
+
found.push(whole[0].id);
|
|
58
|
+
}
|
|
59
|
+
return found;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* THE RECORDS A BODY NAMES, each once, in the order first named: its
|
|
63
|
+
* `@` mentions of a record by its whole name, then its links to one. The
|
|
64
|
+
* record it is said about (`about`) is not counted again.
|
|
65
|
+
*/
|
|
66
|
+
export function touchesIn(body, graph, schema, about) {
|
|
67
|
+
const all = [...namedIn(body, graph, schema), ...linkedIn(body, graph, schema)];
|
|
68
|
+
return [...new Set(all)].filter((id) => id !== about).slice(0, MOST_TOUCHES);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=touches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touches.js","sourceRoot":"","sources":["../../src/rooms/touches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAe1C,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,kFAAkF;AAClF,MAAM,KAAK,GAAG,iEAAiE,CAAC;AAChF,wEAAwE;AACxE,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,6EAA6E;AAC7E,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAgB,EAAE,MAAiB;IACjE,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC,KAA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CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAC;IACpH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,KAAgB,EAAE,MAAiB,EAAE,KAAc;IACzF,MAAM,GAAG,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAChF,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type Primitive } from "../graph/primitives.js";
|
|
2
|
+
import type { Principal } from "../permissions/types.js";
|
|
3
|
+
import type { AnySchema } from "../schema/schema.js";
|
|
4
|
+
import { type MessageRecord } from "./shape.js";
|
|
5
|
+
/** How a record was touched: said about, named in the words, or changed by the AI's batches. */
|
|
6
|
+
export type TouchKind = "about" | "mentioned" | "changed";
|
|
7
|
+
/** The records a message or a thread touched, by how, each once; `all` is every one of them, in that order. */
|
|
8
|
+
export interface Touchpoints {
|
|
9
|
+
readonly about: readonly string[];
|
|
10
|
+
readonly mentioned: readonly string[];
|
|
11
|
+
readonly changed: readonly string[];
|
|
12
|
+
readonly all: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
interface GraphLike {
|
|
15
|
+
getNode(id: string): unknown;
|
|
16
|
+
nodesOfKind(kind: string): readonly unknown[];
|
|
17
|
+
}
|
|
18
|
+
/** What the touchpoints are read from: a store (or its graph, schema and log). With `seenBy`, a seat's sight is honored. */
|
|
19
|
+
export interface TalkStore {
|
|
20
|
+
readonly graph: GraphLike;
|
|
21
|
+
readonly schema?: AnySchema;
|
|
22
|
+
readonly log?: {
|
|
23
|
+
all(): readonly {
|
|
24
|
+
readonly batch: string;
|
|
25
|
+
readonly primitives: readonly Primitive[];
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
seenBy?(principal: Principal): {
|
|
29
|
+
readonly graph: GraphLike;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* THE RECORDS ONE MESSAGE TOUCHED: what it is about, what it names, and —
|
|
34
|
+
* the AI's answer — what its batches changed. With a seat, only what that
|
|
35
|
+
* seat may see, and nothing of a message it may not read.
|
|
36
|
+
*/
|
|
37
|
+
export declare function touchpointsOf(message: MessageRecord, store: TalkStore, seat?: Principal): Touchpoints;
|
|
38
|
+
/**
|
|
39
|
+
* THE RECORDS A THREAD TOUCHED: the union over its messages. The key is a
|
|
40
|
+
* thread's (`threadKey`: the replies under one message) or a whole room's
|
|
41
|
+
* or record thread's (`roomKey`). With a seat, only what it may see.
|
|
42
|
+
*/
|
|
43
|
+
export declare function threadTouchpoints(store: TalkStore, key: string, seat?: Principal): Touchpoints;
|
|
44
|
+
/** One thread that touched a record, as a record's panel lists it. */
|
|
45
|
+
export interface ThreadTouch {
|
|
46
|
+
/** The thread: its room, the record it is on, and the message it began with (`threadKey`). */
|
|
47
|
+
readonly key: string;
|
|
48
|
+
/** The room or record thread it is in (`roomKey`). */
|
|
49
|
+
readonly conversation: string;
|
|
50
|
+
readonly room: string;
|
|
51
|
+
readonly about?: string;
|
|
52
|
+
/** The message it began with. */
|
|
53
|
+
readonly root: string;
|
|
54
|
+
/** How it touched the record: said about, named, changed. */
|
|
55
|
+
readonly via: readonly TouchKind[];
|
|
56
|
+
/** When it was last added to. */
|
|
57
|
+
readonly lastAt: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* EVERY THREAD THAT TOUCHED A RECORD, newest first: each message and the
|
|
61
|
+
* replies under it whose touchpoints include the record. With a seat, only
|
|
62
|
+
* threads it may read, and none at all where it may not see the record.
|
|
63
|
+
*/
|
|
64
|
+
export declare function threadsTouching(store: TalkStore, recordId: string, seat?: Principal): readonly ThreadTouch[];
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=touchpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touchpoints.d.ts","sourceRoot":"","sources":["../../src/rooms/touchpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAcvE,gGAAgG;AAChG,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;AAE1D,+GAA+G;AAC/G,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,OAAO,EAAE,CAAC;CAC/C;AAED,4HAA4H;AAC5H,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE;QAAE,GAAG,IAAI,SAAS;YAAE,QAAQ,CAAC,KAAK,EAAE,M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|
+
import { touchesIn } from "./touches.js";
|
|
5
|
+
/** The store as a seat is served it; the store itself with no seat. */
|
|
6
|
+
const NOTHING = { getNode: () => undefined, nodesOfKind: () => [] };
|
|
7
|
+
/** Handed a seat but no way to serve it, nothing: a seat is never told what its sight was not asked of. */
|
|
8
|
+
const viewOf = (store, seat) => (seat ? (store.seenBy ? store.seenBy(seat).graph : NOTHING) : store.graph);
|
|
9
|
+
/** The records each batch changed, from the log, kept per log for as long as the log does not grow. */
|
|
10
|
+
const BATCHES = new WeakMap();
|
|
11
|
+
function batchRecords(store) {
|
|
12
|
+
const log = store.log;
|
|
13
|
+
if (!log)
|
|
14
|
+
return new Map();
|
|
15
|
+
const ops = log.all();
|
|
16
|
+
const held = BATCHES.get(log);
|
|
17
|
+
if (held && held.length === ops.length)
|
|
18
|
+
return held.byBatch;
|
|
19
|
+
const byBatch = new Map();
|
|
20
|
+
for (const op of ops) {
|
|
21
|
+
const ids = byBatch.get(op.batch) ?? [];
|
|
22
|
+
for (const primitive of op.primitives)
|
|
23
|
+
for (const id of writesOf(primitive))
|
|
24
|
+
if (!ids.includes(id))
|
|
25
|
+
ids.push(id);
|
|
26
|
+
byBatch.set(op.batch, ids);
|
|
27
|
+
}
|
|
28
|
+
BATCHES.set(log, { length: ops.length, byBatch });
|
|
29
|
+
return byBatch;
|
|
30
|
+
}
|
|
31
|
+
/** A record a seat is shown, never a message: what a touchpoint may be. */
|
|
32
|
+
const shownRecord = (graph, id) => {
|
|
33
|
+
const node = graph.getNode(id);
|
|
34
|
+
return node !== undefined && node.kind !== MESSAGE_KIND;
|
|
35
|
+
};
|
|
36
|
+
/** The touchpoints of one message against a graph, as read already. */
|
|
37
|
+
function touchOf(message, graph, store, batches) {
|
|
38
|
+
const about = message.about !== undefined && shownRecord(graph, message.about) ? [message.about] : [];
|
|
39
|
+
const named = message.touches ?? (store.schema ? touchesIn(message.body, graph, store.schema, message.about) : []);
|
|
40
|
+
const mentioned = named.filter((id) => !about.includes(id) && shownRecord(graph, id));
|
|
41
|
+
const changed = message.batches && message.batches.length > 0 ? [...new Set(message.batches.flatMap((batch) => batches().get(batch) ?? []))].filter((id) => shownRecord(graph, id)) : [];
|
|
42
|
+
return { about, mentioned, changed, all: [...new Set([...about, ...mentioned, ...changed])] };
|
|
43
|
+
}
|
|
44
|
+
const NONE = { about: [], mentioned: [], changed: [], all: [] };
|
|
45
|
+
/** Many touchpoints as one, each record once, in the order first touched. */
|
|
46
|
+
function union(all) {
|
|
47
|
+
const about = [...new Set(all.flatMap((one) => one.about))];
|
|
48
|
+
const mentioned = [...new Set(all.flatMap((one) => one.mentioned))];
|
|
49
|
+
const changed = [...new Set(all.flatMap((one) => one.changed))];
|
|
50
|
+
return { about, mentioned, changed, all: [...new Set([...about, ...mentioned, ...changed])] };
|
|
51
|
+
}
|
|
52
|
+
/** Whether a seat reads a message: served it, and — for a conversation with the AI — its asker or shared with them. */
|
|
53
|
+
const reads = (graph, message, seat) => graph.getNode(message.id) !== undefined && (seat === undefined || mayReadAiTurn(message, seat.onBehalfOf?.id ?? seat.id));
|
|
54
|
+
/**
|
|
55
|
+
* THE RECORDS ONE MESSAGE TOUCHED: what it is about, what it names, and —
|
|
56
|
+
* the AI's answer — what its batches changed. With a seat, only what that
|
|
57
|
+
* seat may see, and nothing of a message it may not read.
|
|
58
|
+
*/
|
|
59
|
+
export function touchpointsOf(message, store, seat) {
|
|
60
|
+
const graph = viewOf(store, seat);
|
|
61
|
+
if (!reads(graph, message, seat))
|
|
62
|
+
return NONE;
|
|
63
|
+
return touchOf(message, graph, store, () => batchRecords(store));
|
|
64
|
+
}
|
|
65
|
+
/** A thread or conversation's key, read: `room`, `room@record`, and either with `#message` for the replies under one message (`threadKey`). */
|
|
66
|
+
function parseKey(key) {
|
|
67
|
+
const hash = key.lastIndexOf("#");
|
|
68
|
+
const conversation = hash >= 0 ? key.slice(0, hash) : key;
|
|
69
|
+
const root = hash >= 0 ? key.slice(hash + 1) : undefined;
|
|
70
|
+
const at = conversation.indexOf("@");
|
|
71
|
+
return { room: at >= 0 ? conversation.slice(0, at) : conversation, about: at >= 0 ? conversation.slice(at + 1) : undefined, root };
|
|
72
|
+
}
|
|
73
|
+
/** The messages a key names, as a seat reads them. */
|
|
74
|
+
function messagesOf(graph, key, seat) {
|
|
75
|
+
const { room, about, root } = parseKey(key);
|
|
76
|
+
const messages = allMessages(graph).filter((message) => message.room === room && (message.about ?? undefined) === about && reads(graph, message, seat));
|
|
77
|
+
if (root === undefined)
|
|
78
|
+
return messages;
|
|
79
|
+
const byId = new Map(messages.map((message) => [message.id, message]));
|
|
80
|
+
return messages.filter((message) => threadRootOf(message, byId) === root);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* THE RECORDS A THREAD TOUCHED: the union over its messages. The key is a
|
|
84
|
+
* thread's (`threadKey`: the replies under one message) or a whole room's
|
|
85
|
+
* or record thread's (`roomKey`). With a seat, only what it may see.
|
|
86
|
+
*/
|
|
87
|
+
export function threadTouchpoints(store, key, seat) {
|
|
88
|
+
const graph = viewOf(store, seat);
|
|
89
|
+
const batches = () => batchRecords(store);
|
|
90
|
+
return union(messagesOf(graph, key, seat).filter((message) => !message.removed).map((message) => touchOf(message, graph, store, batches)));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* EVERY THREAD THAT TOUCHED A RECORD, newest first: each message and the
|
|
94
|
+
* replies under it whose touchpoints include the record. With a seat, only
|
|
95
|
+
* threads it may read, and none at all where it may not see the record.
|
|
96
|
+
*/
|
|
97
|
+
export function threadsTouching(store, recordId, seat) {
|
|
98
|
+
const graph = viewOf(store, seat);
|
|
99
|
+
if (!shownRecord(graph, recordId))
|
|
100
|
+
return [];
|
|
101
|
+
const batches = () => batchRecords(store);
|
|
102
|
+
const messages = allMessages(graph).filter((message) => reads(graph, message, seat));
|
|
103
|
+
const byId = new Map(messages.map((message) => [message.id, message]));
|
|
104
|
+
const threads = new Map();
|
|
105
|
+
for (const message of messages) {
|
|
106
|
+
if (message.removed)
|
|
107
|
+
continue;
|
|
108
|
+
const touched = touchOf(message, graph, store, batches);
|
|
109
|
+
const root = byId.get(threadRootOf(message, byId)) ?? message;
|
|
110
|
+
const key = `${roomKey(root.room, root.about)}#${root.id}`;
|
|
111
|
+
const via = [...(touched.about.includes(recordId) ? ["about"] : []), ...(touched.mentioned.includes(recordId) ? ["mentioned"] : []), ...(touched.changed.includes(recordId) ? ["changed"] : [])];
|
|
112
|
+
const thread = threads.get(key);
|
|
113
|
+
if (thread) {
|
|
114
|
+
for (const one of via)
|
|
115
|
+
thread.via.add(one);
|
|
116
|
+
if (message.at > thread.lastAt)
|
|
117
|
+
thread.lastAt = message.at;
|
|
118
|
+
}
|
|
119
|
+
else
|
|
120
|
+
threads.set(key, { root, via: new Set(via), lastAt: message.at });
|
|
121
|
+
}
|
|
122
|
+
const out = [];
|
|
123
|
+
for (const [key, thread] of threads) {
|
|
124
|
+
if (thread.via.size === 0)
|
|
125
|
+
continue;
|
|
126
|
+
const order = ["about", "mentioned", "changed"];
|
|
127
|
+
out.push({ key, conversation: roomKey(thread.root.room, thread.root.about), room: thread.root.room, ...(thread.root.about !== undefined ? { about: thread.root.about } : {}), root: thread.root.id, via: order.filter((one) => thread.via.has(one)), lastAt: thread.lastAt });
|
|
128
|
+
}
|
|
129
|
+
return out.sort((a, b) => (a.lastAt < b.lastAt ? 1 : a.lastAt > b.lastAt ? -1 : a.key < b.key ? -1 : 1));
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=touchpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touchpoints.js","sourceRoot":"","sources":["../../src/rooms/touchpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,wBAAwB,CAAC;AAGlE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAsB,MAAM,YAAY,CAAC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Y_RECORD, INTENT_LABELS, INTENTS, isIntent, SET_MESSAGE_INTENT } from "./rooms/shape.js";
|
|
2
|
+
export type { Intent } from "./rooms/shape.js";
|
|
3
|
+
export { guessIntent, intentFor } from "./rooms/intent.js";
|
|
4
|
+
export type { IntentContext, IntentGuesser } from "./rooms/intent.js";
|
|
5
|
+
export { touchesIn } from "./rooms/touches.js";
|
|
6
|
+
export { threadTouchpoints, threadsTouching, touchpointsOf } from "./rooms/touchpoints.js";
|
|
7
|
+
export type { TalkStore, ThreadTouch, Touchpoints, TouchKind } from "./rooms/touchpoints.js";
|
|
8
|
+
export { COMMENTS_ROOM, EVERYONE_ROOM, OWNERS_ROOM, STANDARD_ROOMS, talkOptionsOf, talkRooms } from "./rooms/talk.js";
|
|
9
|
+
export type { TalkOptions, TalkSettings, TalkSwitch } from "./rooms/talk-shape.js";
|
|
1
10
|
export { AI_ROOM_ACTS, ASKS_ROOM, DESIGN_ROOM, FRAMEWORK_ROOMS, frameworkRoomTitle, isFrameworkRoom, KEEP_AI_TURN, SETTLE_AI_TURN, SHARE_CONVERSATION } from "./rooms/shape.js";
|
|
2
11
|
export type { AiDoor, ConversationShare, FrameworkRoom } from "./rooms/shape.js";
|
|
3
12
|
export { EDIT_MESSAGE, LONGEST_MESSAGE, LONGEST_ROOM_TITLE, MESSAGE_KIND, MOST_ROOMS, POST_MESSAGE, REMOVE_MESSAGE, ROOM_ACTS, ROOMS_READ_STATE, roomKey } from "./rooms/shape.js";
|
|
4
13
|
export type { AppRooms, MessageRecord, RoomDeclaration } from "./rooms/shape.js";
|
|
5
14
|
export { isKeptTalk, keptTalkIn, KEPT_TALK_TAKEN } from "./rooms/held.js";
|
|
6
|
-
export { aiRoomActs, editorRolesOf, frameworkRoomSights, isPlaceless, messageKind, roomActs, roomSights, isRoomsOwn, roomsFolded, roomsPolicy, ROOMS_GRANT, unfoldedApp, withoutTalk, withRooms, mentionsOnIn } from "./rooms/kind.js";
|
|
7
|
-
export { allMessages, appRooms, conversationsOf, hasRooms, mayEdit, mayPostIn, mayReadAiTurn, mayReadRoom, mayRemove, mentionablesOf, mentionsIn, messagesIn, readUpToOf, roomsOf, roomWords, talkAbout, threadKey, threadOf, threadRootOf, threadsIn, threadsOf, unreadFor } from "./rooms/read.js";
|
|
15
|
+
export { aiRoomActs, foldedAppOfSchema, foldRooms, editorRolesOf, frameworkRoomSights, isPlaceless, messageKind, roomActs, roomSights, isRoomsOwn, roomsFolded, roomsPolicy, ROOMS_GRANT, unfoldedApp, withoutTalk, withRooms, mentionsOnIn } from "./rooms/kind.js";
|
|
16
|
+
export { allMessages, appRooms, conversationsOf, hasRooms, isVisitorPrincipal, mayEdit, mayPostIn, mayReadToOwners, talkSeenBy, mayReadAiTurn, mayReadRoom, mayRemove, mentionablesOf, mentionsIn, messagesIn, readUpToOf, roomsOf, roomWords, talkAbout, threadKey, threadOf, threadRootOf, threadsIn, threadsOf, unreadFor } from "./rooms/read.js";
|
|
8
17
|
export type { Conversation, ConversationsOptions, Mentionable, MessageThread, ReadUpTo, ResolvedRoom, Unread } from "./rooms/read.js";
|
|
9
18
|
export { appRoomFindings, documentRoomFindings, roomFindings, roomWorldOfApp } from "./rooms/findings.js";
|
|
19
|
+
export type { RoomActsOptions } from "./rooms/kind.js";
|
|
10
20
|
export type { RoomFinding, RoomFindingCode, RoomWorld } from "./rooms/findings.js";
|
|
11
21
|
export { supportContextOf, memorySupport, SUPPORT_CONTEXT_FRICTION } from "./rooms/support.js";
|
|
12
22
|
export type { MemorySupport, SupportContext, SupportDraft, SupportMessage, SupportReply, SupportTransport, SupportDeclaration } from "./rooms/support.js";
|
package/dist/rooms.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../src/rooms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../src/rooms.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,UAAU,EAAE,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omDeclaration`, `MessageRecord`) are on
|
|
17
17
|
* `@graview/core`.
|
|
18
|
+
*
|
|
19
|
+
* TALK TO THE APP (Graview HQ feature:f-talk-to-the-app): the rooms a host
|
|
20
|
+
* supplies with one switch (`talk`, `STANDARD_ROOMS`, `talkRooms`; `withTalk` is on `@graview/core`), what each
|
|
21
|
+
* message is (`INTENTS`, `INTENT_LABELS`, `guessIntent`, `intentFor`) and
|
|
22
|
+
* what a message or a thread touched (`touchpointsOf`, `threadTouchpoints`,
|
|
23
|
+
* `threadsTouching`).
|
|
18
24
|
*/
|
|
25
|
+
export { ANY_RECORD, INTENT_LABELS, INTENTS, isIntent, SET_MESSAGE_INTENT } from "./rooms/shape.js";
|
|
26
|
+
export { guessIntent, intentFor } from "./rooms/intent.js";
|
|
27
|
+
export { touchesIn } from "./rooms/touches.js";
|
|
28
|
+
export { threadTouchpoints, threadsTouching, touchpointsOf } from "./rooms/touchpoints.js";
|
|
29
|
+
export { COMMENTS_ROOM, EVERYONE_ROOM, OWNERS_ROOM, STANDARD_ROOMS, talkOptionsOf, talkRooms } from "./rooms/talk.js";
|
|
19
30
|
export { AI_ROOM_ACTS, ASKS_ROOM, DESIGN_ROOM, FRAMEWORK_ROOMS, frameworkRoomTitle, isFrameworkRoom, KEEP_AI_TURN, SETTLE_AI_TURN, SHARE_CONVERSATION } from "./rooms/shape.js";
|
|
20
31
|
export { EDIT_MESSAGE, LONGEST_MESSAGE, LONGEST_ROOM_TITLE, MESSAGE_KIND, MOST_ROOMS, POST_MESSAGE, REMOVE_MESSAGE, ROOM_ACTS, ROOMS_READ_STATE, roomKey } from "./rooms/shape.js";
|
|
21
32
|
export { isKeptTalk, keptTalkIn, KEPT_TALK_TAKEN } from "./rooms/held.js";
|
|
22
|
-
export { aiRoomActs, editorRolesOf, frameworkRoomSights, isPlaceless, messageKind, roomActs, roomSights, isRoomsOwn, roomsFolded, roomsPolicy, ROOMS_GRANT, unfoldedApp, withoutTalk, withRooms, mentionsOnIn } from "./rooms/kind.js";
|
|
23
|
-
export { allMessages, appRooms, conversationsOf, hasRooms, mayEdit, mayPostIn, mayReadAiTurn, mayReadRoom, mayRemove, mentionablesOf, mentionsIn, messagesIn, readUpToOf, roomsOf, roomWords, talkAbout, threadKey, threadOf, threadRootOf, threadsIn, threadsOf, unreadFor } from "./rooms/read.js";
|
|
33
|
+
export { aiRoomActs, foldedAppOfSchema, foldRooms, editorRolesOf, frameworkRoomSights, isPlaceless, messageKind, roomActs, roomSights, isRoomsOwn, roomsFolded, roomsPolicy, ROOMS_GRANT, unfoldedApp, withoutTalk, withRooms, mentionsOnIn } from "./rooms/kind.js";
|
|
34
|
+
export { allMessages, appRooms, conversationsOf, hasRooms, isVisitorPrincipal, mayEdit, mayPostIn, mayReadToOwners, talkSeenBy, mayReadAiTurn, mayReadRoom, mayRemove, mentionablesOf, mentionsIn, messagesIn, readUpToOf, roomsOf, roomWords, talkAbout, threadKey, threadOf, threadRootOf, threadsIn, threadsOf, unreadFor } from "./rooms/read.js";
|
|
24
35
|
export { appRoomFindings, documentRoomFindings, roomFindings, roomWorldOfApp } from "./rooms/findings.js";
|
|
25
36
|
export { supportContextOf, memorySupport, SUPPORT_CONTEXT_FRICTION } from "./rooms/support.js";
|
|
26
37
|
//# sourceMappingURL=rooms.js.map
|
package/dist/rooms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.js","sourceRoot":"","sources":["../src/rooms.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rooms.js","sourceRoot":"","sources":["../src/rooms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEpG,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MA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AAoB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1G,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/store.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TalkOptions, TalkSwitch } from "./rooms/talk-shape.js";
|
|
1
2
|
import { type SeenOptions } from "./seen.js";
|
|
2
3
|
import { TOLD_TO } from "./served-touches.js";
|
|
3
4
|
import type { IntelligenceProviderDeclaration } from "./app.js";
|
|
@@ -148,6 +149,16 @@ export interface StoreOptions<S extends AnySchema> {
|
|
|
148
149
|
* Unsaid, chat is on.
|
|
149
150
|
*/
|
|
150
151
|
readonly chat?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* TALK, AS THE HOST SUPPLIES IT (Graview HQ feature:f-talk-to-the-app).
|
|
154
|
+
* `true` (or `{ rooms, visitors }`) folds the host's rooms into the app
|
|
155
|
+
* this store opens — the standard set unless it names its own: a room for
|
|
156
|
+
* everybody, a thread on any record, a room to the owners — beside the
|
|
157
|
+
* app's own, with the acts and sights they need (`withTalk`). Open the
|
|
158
|
+
* server's store and the page's with the same switch. `chat: false`
|
|
159
|
+
* still turns every room off. Unsaid, only the app's own rooms.
|
|
160
|
+
*/
|
|
161
|
+
readonly talk?: TalkSwitch;
|
|
151
162
|
/**
|
|
152
163
|
* The app's declared intelligence providers, so an AGENT is held to the
|
|
153
164
|
* allowlist it was declared with.
|
|
@@ -507,6 +518,8 @@ export declare class Store<S extends AnySchema> {
|
|
|
507
518
|
private readonly startingModules;
|
|
508
519
|
/** Whether chat is on: unless the host opened the store with `chat: false` (`chatOn`). */
|
|
509
520
|
readonly chat: boolean;
|
|
521
|
+
/** The talk its host supplied (`StoreOptions.talk`), said in full; undefined where it supplied none. */
|
|
522
|
+
readonly talk: TalkOptions | undefined;
|
|
510
523
|
/** The projection, and the log it was read from: its length and its last op. */
|
|
511
524
|
private projected;
|
|
512
525
|
private readonly nextId;
|
|
@@ -557,7 +570,7 @@ export declare class Store<S extends AnySchema> {
|
|
|
557
570
|
/** What `version` reads: each time this store told its subscribers something, or would have. */
|
|
558
571
|
private told;
|
|
559
572
|
private readonly listeners;
|
|
560
|
-
constructor(
|
|
573
|
+
constructor(handed: StoreOptions<S>);
|
|
561
574
|
/** Refuses any change to a store of the past (Roadmap f-playback). */
|
|
562
575
|
private stillNow;
|
|
563
576
|
/** Winds the default op and batch counters past every id the log holds, and past the horizon (FR-23). */
|