@estiva-app/interop 0.58.0 → 0.59.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 +14 -0
- package/dist/references.d.ts +7 -2
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +16 -2
- package/dist/references.js.map +1 -1
- package/package.json +1 -1
- package/src/references.ts +17 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,20 @@ how a declaration is read, is a MAJOR — in `0.x`, a MINOR — even when no
|
|
|
6
6
|
TypeScript signature moved. A consumer upgrading must be able to tell whether
|
|
7
7
|
manifests already published still mean what they meant.
|
|
8
8
|
|
|
9
|
+
## 0.59.0 — 2026-10-16
|
|
10
|
+
|
|
11
|
+
**`[` offers Leaf pages, and every row carries its file's summary** (SUM-7).
|
|
12
|
+
|
|
13
|
+
- `REFERENCE_FILE_TYPES` gains `30842` as `'document'`, so `fileCandidates`
|
|
14
|
+
and `searchFileReferences` offer a Leaf page in every app, beside topics,
|
|
15
|
+
projects and issues (Miky, 2026-10-16). The relay finds it by title already:
|
|
16
|
+
it indexes every object kind's `title` (checked on production, 2026-10-16).
|
|
17
|
+
- Each file row carries `summary`, its `subtitle` slot (SPEC §6.12), one line
|
|
18
|
+
of plain text; none when the file has no summary or it was cleared.
|
|
19
|
+
|
|
20
|
+
Manifests: none. Nothing a manifest declares, or how a declaration is read,
|
|
21
|
+
changed. Needs @estiva-app/conversation 0.12.0 for the types.
|
|
22
|
+
|
|
9
23
|
## 0.58.0 — 2026-10-15
|
|
10
24
|
|
|
11
25
|
**Manifests: no manifest is read for a Folder (`kind:39000`) or a chat message
|
package/dist/references.d.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* resolved object into a row, and typed text into the search tier — so Peek
|
|
7
7
|
* and Ship draw the same rows from the same reads.
|
|
8
8
|
*
|
|
9
|
-
* A row is the type word
|
|
9
|
+
* A row is the type word, the current title and, when it has one, the file's
|
|
10
|
+
* summary (SPEC §6.12, SUM-7); an issue is captioned with its
|
|
10
11
|
* project's title, and nothing names a Folder (Miky, 2026-10-03). Only what the
|
|
11
12
|
* reader resolved is offered: an object the relay did not hand back to them is
|
|
12
13
|
* never a row, so nothing unreadable is offered. An archived file is offered
|
|
@@ -14,7 +15,11 @@
|
|
|
14
15
|
*/
|
|
15
16
|
import { type ReferenceCandidate, type ReferenceType } from '@estiva-app/conversation';
|
|
16
17
|
import { type ForeignObject, type ProjectionCache, type QueryFn } from './projection.js';
|
|
17
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* The kinds `[` offers as files, and the type word each draws as. A Leaf page
|
|
20
|
+
* is offered in every app, beside topics, projects and issues (Miky, SUM-7
|
|
21
|
+
* kickoff, 2026-10-16).
|
|
22
|
+
*/
|
|
18
23
|
export declare const REFERENCE_FILE_TYPES: Readonly<Record<number, ReferenceType>>;
|
|
19
24
|
export interface FileCandidatesOptions {
|
|
20
25
|
cache?: ProjectionCache;
|
package/dist/references.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAML,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAA;AAMxB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAKxE,CAAA;AA2BD,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,0FAA0F;IAC1F,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,EACtD,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,EAAE,KAAK,EAAE,EAAE,EAAE,GAAE,qBAA0B,GACxC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA+B/B;AAED,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC;IACpF,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAWD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,EAAE,KAAU,EAAE,GAAG,OAAO,EAAE,GAAE,2BAAgC,GAC3D,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAqB/B"}
|
package/dist/references.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* resolved object into a row, and typed text into the search tier — so Peek
|
|
7
7
|
* and Ship draw the same rows from the same reads.
|
|
8
8
|
*
|
|
9
|
-
* A row is the type word
|
|
9
|
+
* A row is the type word, the current title and, when it has one, the file's
|
|
10
|
+
* summary (SPEC §6.12, SUM-7); an issue is captioned with its
|
|
10
11
|
* project's title, and nothing names a Folder (Miky, 2026-10-03). Only what the
|
|
11
12
|
* reader resolved is offered: an object the relay did not hand back to them is
|
|
12
13
|
* never a row, so nothing unreadable is offered. An archived file is offered
|
|
@@ -16,11 +17,22 @@ import { FILE_TIER, fileReference, KIND_CHANGE, referenceMatch, refMatch, } from
|
|
|
16
17
|
import { isClosedStatus, KIND_BARE_FILE, resolveForeignRoots, } from './projection.js';
|
|
17
18
|
const KIND_PROJECT = 30850;
|
|
18
19
|
const KIND_ISSUE = 30851;
|
|
19
|
-
|
|
20
|
+
const KIND_DOCUMENT = 30842;
|
|
21
|
+
/**
|
|
22
|
+
* The kinds `[` offers as files, and the type word each draws as. A Leaf page
|
|
23
|
+
* is offered in every app, beside topics, projects and issues (Miky, SUM-7
|
|
24
|
+
* kickoff, 2026-10-16).
|
|
25
|
+
*/
|
|
20
26
|
export const REFERENCE_FILE_TYPES = {
|
|
21
27
|
[KIND_PROJECT]: 'project',
|
|
22
28
|
[KIND_ISSUE]: 'issue',
|
|
23
29
|
[KIND_BARE_FILE]: 'topic',
|
|
30
|
+
[KIND_DOCUMENT]: 'document',
|
|
31
|
+
};
|
|
32
|
+
/** A file's summary as a row's second line: plain text, never a body declared into the slot. */
|
|
33
|
+
const summaryOf = (object) => {
|
|
34
|
+
const slot = object.slots.subtitle;
|
|
35
|
+
return slot && !slot.format ? slot.value.replace(/\s+/g, ' ').trim() || undefined : undefined;
|
|
24
36
|
};
|
|
25
37
|
const typeOf = (kind) => REFERENCE_FILE_TYPES[kind];
|
|
26
38
|
/** An object `[` may offer: a file kind it knows, resolved, with a title. */
|
|
@@ -63,6 +75,7 @@ export async function fileCandidates(objects, tier, query, { cache, at } = {}) {
|
|
|
63
75
|
return files.map((o) => {
|
|
64
76
|
const parent = o.kind === KIND_ISSUE && o.parentRef ? parents.get(o.parentRef) : undefined;
|
|
65
77
|
const ref = refOf(o);
|
|
78
|
+
const summary = summaryOf(o);
|
|
66
79
|
return {
|
|
67
80
|
id: o.address,
|
|
68
81
|
uri: fileReference(o.address),
|
|
@@ -71,6 +84,7 @@ export async function fileCandidates(objects, tier, query, { cache, at } = {}) {
|
|
|
71
84
|
title: o.slots.title.value,
|
|
72
85
|
// An issue reads "CON-33 · Conversation standard": the ref first, so a hit by ref shows it (Miky, 2026-10-05).
|
|
73
86
|
caption: [ref, parent?.slots.title?.value].filter(Boolean).join(' · '),
|
|
87
|
+
...(summary ? { summary } : {}),
|
|
74
88
|
tier,
|
|
75
89
|
...(ref ? { search: ref } : {}),
|
|
76
90
|
...(isClosedStatus(o.slots.status) ? { closed: true } : {}),
|
package/dist/references.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.js","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,QAAQ,GAGT,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,cAAc,EACd,cAAc,EACd,mBAAmB,GAIpB,MAAM,iBAAiB,CAAA;AAExB,MAAM,YAAY,GAAG,KAAK,CAAA;AAC1B,MAAM,UAAU,GAAG,KAAK,CAAA;AACxB,MAAM,aAAa,GAAG,KAAK,CAAA;AAE3B;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA4C;IAC3E,CAAC,YAAY,CAAC,EAAE,SAAS;IACzB,CAAC,UAAU,CAAC,EAAE,OAAO;IACrB,CAAC,cAAc,CAAC,EAAE,OAAO;IACzB,CAAC,aAAa,CAAC,EAAE,UAAU;CAC5B,CAAA;AAED,gGAAgG;AAChG,MAAM,SAAS,GAAG,CAAC,MAAqB,EAAsB,EAAE;IAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAA;IAClC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAC/F,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,CAAC,IAAY,EAA6B,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;AAItF,6EAA6E;AAC7E,MAAM,SAAS,GAAG,CAAC,MAAwC,EAAuB,EAAE,CAClF,CAAC,CAAC,MAAM;IACR,CAA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,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IAC/E,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;IAC5I,OAAO,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;AAC9E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@estiva-app/interop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
4
4
|
"description": "Render and act on another app's objects from its published NIP-89 manifest. The owner defines the projection; the consumer decides how it looks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/references.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* resolved object into a row, and typed text into the search tier — so Peek
|
|
7
7
|
* and Ship draw the same rows from the same reads.
|
|
8
8
|
*
|
|
9
|
-
* A row is the type word
|
|
9
|
+
* A row is the type word, the current title and, when it has one, the file's
|
|
10
|
+
* summary (SPEC §6.12, SUM-7); an issue is captioned with its
|
|
10
11
|
* project's title, and nothing names a Folder (Miky, 2026-10-03). Only what the
|
|
11
12
|
* reader resolved is offered: an object the relay did not hand back to them is
|
|
12
13
|
* never a row, so nothing unreadable is offered. An archived file is offered
|
|
@@ -32,12 +33,24 @@ import {
|
|
|
32
33
|
|
|
33
34
|
const KIND_PROJECT = 30850
|
|
34
35
|
const KIND_ISSUE = 30851
|
|
36
|
+
const KIND_DOCUMENT = 30842
|
|
35
37
|
|
|
36
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* The kinds `[` offers as files, and the type word each draws as. A Leaf page
|
|
40
|
+
* is offered in every app, beside topics, projects and issues (Miky, SUM-7
|
|
41
|
+
* kickoff, 2026-10-16).
|
|
42
|
+
*/
|
|
37
43
|
export const REFERENCE_FILE_TYPES: Readonly<Record<number, ReferenceType>> = {
|
|
38
44
|
[KIND_PROJECT]: 'project',
|
|
39
45
|
[KIND_ISSUE]: 'issue',
|
|
40
46
|
[KIND_BARE_FILE]: 'topic',
|
|
47
|
+
[KIND_DOCUMENT]: 'document',
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** A file's summary as a row's second line: plain text, never a body declared into the slot. */
|
|
51
|
+
const summaryOf = (object: ForeignObject): string | undefined => {
|
|
52
|
+
const slot = object.slots.subtitle
|
|
53
|
+
return slot && !slot.format ? slot.value.replace(/\s+/g, ' ').trim() || undefined : undefined
|
|
41
54
|
}
|
|
42
55
|
|
|
43
56
|
const typeOf = (kind: number): ReferenceType | undefined => REFERENCE_FILE_TYPES[kind]
|
|
@@ -95,6 +108,7 @@ export async function fileCandidates(
|
|
|
95
108
|
return files.map((o) => {
|
|
96
109
|
const parent = o.kind === KIND_ISSUE && o.parentRef ? parents.get(o.parentRef) : undefined
|
|
97
110
|
const ref = refOf(o)
|
|
111
|
+
const summary = summaryOf(o)
|
|
98
112
|
return {
|
|
99
113
|
id: o.address,
|
|
100
114
|
uri: fileReference(o.address),
|
|
@@ -103,6 +117,7 @@ export async function fileCandidates(
|
|
|
103
117
|
title: o.slots.title!.value,
|
|
104
118
|
// An issue reads "CON-33 · Conversation standard": the ref first, so a hit by ref shows it (Miky, 2026-10-05).
|
|
105
119
|
caption: [ref, parent?.slots.title?.value].filter(Boolean).join(' · '),
|
|
120
|
+
...(summary ? { summary } : {}),
|
|
106
121
|
tier,
|
|
107
122
|
...(ref ? { search: ref } : {}),
|
|
108
123
|
...(isClosedStatus(o.slots.status) ? { closed: true } : {}),
|