@estiva-app/interop 0.49.0 → 0.50.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 +18 -0
- package/dist/references.d.ts +8 -7
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +25 -13
- package/dist/references.js.map +1 -1
- package/package.json +3 -3
- package/src/references.ts +29 -12
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,24 @@ 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.50.0 — 2026-10-05
|
|
10
|
+
|
|
11
|
+
**Manifests: one declaration is read in a new way.** On an issue (`30851`),
|
|
12
|
+
a `meta` slot whose field is `ref` is now read as the issue's ref (SPEC §6.1),
|
|
13
|
+
which Ship's manifest already declares. That lets `[` find an issue by its ref
|
|
14
|
+
(PEE-21, CON-33). A manifest without such a slot works as before.
|
|
15
|
+
|
|
16
|
+
- `searchFileReferences` counts a `kind:1851` hit on `ref` as well as on
|
|
17
|
+
`title`, but a ref change only when it is aimed at an issue (SPEC §5.2). It
|
|
18
|
+
keeps a hit when the current title or current ref holds what was typed, so
|
|
19
|
+
an old ref finds nothing. A ref is matched through conversation's
|
|
20
|
+
`refMatch`: from its start, and only once a digit or hyphen is typed (Miky,
|
|
21
|
+
2026-10-05).
|
|
22
|
+
- `fileCandidates` sets an issue's `search` to its current ref, and captions
|
|
23
|
+
it with the ref and then the project: "CON-33 · Conversation standard"
|
|
24
|
+
(Miky, 2026-10-05). Before this, the caption was the project alone.
|
|
25
|
+
- Needs conversation ≥ 0.6.1.
|
|
26
|
+
|
|
9
27
|
## 0.49.0 — 2026-10-05
|
|
10
28
|
|
|
11
29
|
**Manifests: nothing changes.** This release only adds a planner (SHI-37). It
|
package/dist/references.d.ts
CHANGED
|
@@ -38,14 +38,15 @@ export interface SearchFileReferencesOptions extends Omit<FileCandidatesOptions,
|
|
|
38
38
|
limit?: number;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* The files whose **current** title
|
|
41
|
+
* The files whose **current** title — or, for an issue, current ref (CON-33)
|
|
42
|
+
* — holds `text`, as the search tier.
|
|
42
43
|
*
|
|
43
|
-
* The relay indexes a root's `title` and a
|
|
44
|
-
*
|
|
45
|
-
* it was created with, and a rename found by an old word may since have
|
|
46
|
-
* renamed again. So a hit is only an address: each is read back as its
|
|
47
|
-
* and changes, folded through its app's manifest, and kept only when what
|
|
48
|
-
* is called now matches what was typed.
|
|
44
|
+
* The relay indexes a root's `title` and `ref` and a change's `value` for those
|
|
45
|
+
* fields (SPEC §5.2); none is the current one on its own — a root keeps the
|
|
46
|
+
* name it was created with, and a rename found by an old word may since have
|
|
47
|
+
* been renamed again. So a hit is only an address: each is read back as its
|
|
48
|
+
* root and changes, folded through its app's manifest, and kept only when what
|
|
49
|
+
* it is called now matches what was typed.
|
|
49
50
|
*
|
|
50
51
|
* Roots and renames are asked for separately, so a burst of renames cannot
|
|
51
52
|
* crowd every root out of the answer, and with buzz's prefix mode, so the word
|
package/dist/references.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;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;AAKxB,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAIxE,CAAA;AAqBD,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,CA6B/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
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* never a row, so nothing unreadable is offered. An archived file is offered
|
|
13
13
|
* at the lowest priority, and so is an issue in an archived project.
|
|
14
14
|
*/
|
|
15
|
-
import { FILE_TIER, fileReference, KIND_CHANGE, referenceMatch, } from '@estiva-app/conversation';
|
|
15
|
+
import { FILE_TIER, fileReference, KIND_CHANGE, referenceMatch, refMatch, } from '@estiva-app/conversation';
|
|
16
16
|
import { isClosedStatus, KIND_BARE_FILE, resolveForeignRoots, } from './projection.js';
|
|
17
17
|
const KIND_PROJECT = 30850;
|
|
18
18
|
const KIND_ISSUE = 30851;
|
|
@@ -29,6 +29,11 @@ const offerable = (object) => !!object &&
|
|
|
29
29
|
!object.unreachable &&
|
|
30
30
|
typeOf(object.kind) !== undefined &&
|
|
31
31
|
!!object.slots.title?.value.trim();
|
|
32
|
+
/**
|
|
33
|
+
* An issue's current ref (`CON-33`, SPEC §6.1) — the manifest slot that folds
|
|
34
|
+
* the `ref` field — so typing it finds the issue. Only an issue has one.
|
|
35
|
+
*/
|
|
36
|
+
const refOf = (object) => object.kind === KIND_ISSUE ? object.meta.find((slot) => slot.field === 'ref')?.value.trim() || undefined : undefined;
|
|
32
37
|
/**
|
|
33
38
|
* Rows for resolved files, all in one tier.
|
|
34
39
|
*
|
|
@@ -57,14 +62,17 @@ export async function fileCandidates(objects, tier, query, { cache, at } = {}) {
|
|
|
57
62
|
}
|
|
58
63
|
return files.map((o) => {
|
|
59
64
|
const parent = o.kind === KIND_ISSUE && o.parentRef ? parents.get(o.parentRef) : undefined;
|
|
65
|
+
const ref = refOf(o);
|
|
60
66
|
return {
|
|
61
67
|
id: o.address,
|
|
62
68
|
uri: fileReference(o.address),
|
|
63
69
|
type: typeOf(o.kind),
|
|
64
70
|
kind: o.kind,
|
|
65
71
|
title: o.slots.title.value,
|
|
66
|
-
|
|
72
|
+
// An issue reads "CON-33 · Conversation standard": the ref first, so a hit by ref shows it (Miky, 2026-10-05).
|
|
73
|
+
caption: [ref, parent?.slots.title?.value].filter(Boolean).join(' · '),
|
|
67
74
|
tier,
|
|
75
|
+
...(ref ? { search: ref } : {}),
|
|
68
76
|
...(isClosedStatus(o.slots.status) ? { closed: true } : {}),
|
|
69
77
|
...(o.archived || parent?.archived ? { archived: true } : {}),
|
|
70
78
|
...(at?.has(o.address) ? { at: at.get(o.address) } : {}),
|
|
@@ -73,14 +81,20 @@ export async function fileCandidates(objects, tier, query, { cache, at } = {}) {
|
|
|
73
81
|
}
|
|
74
82
|
const tagOf = (event, name) => event.tags.find((t) => t[0] === name)?.[1];
|
|
75
83
|
/**
|
|
76
|
-
* The
|
|
84
|
+
* The file a `kind:1851` hit names, when it is one the relay indexes for `[`
|
|
85
|
+
* (SPEC §5.2): a title change on any file, a ref change only on an issue.
|
|
86
|
+
*/
|
|
87
|
+
const searchedChange = (field, address) => field === 'title' || (field === 'ref' && address?.startsWith(`${KIND_ISSUE}:`)) ? address : undefined;
|
|
88
|
+
/**
|
|
89
|
+
* The files whose **current** title — or, for an issue, current ref (CON-33)
|
|
90
|
+
* — holds `text`, as the search tier.
|
|
77
91
|
*
|
|
78
|
-
* The relay indexes a root's `title` and a
|
|
79
|
-
*
|
|
80
|
-
* it was created with, and a rename found by an old word may since have
|
|
81
|
-
* renamed again. So a hit is only an address: each is read back as its
|
|
82
|
-
* and changes, folded through its app's manifest, and kept only when what
|
|
83
|
-
* is called now matches what was typed.
|
|
92
|
+
* The relay indexes a root's `title` and `ref` and a change's `value` for those
|
|
93
|
+
* fields (SPEC §5.2); none is the current one on its own — a root keeps the
|
|
94
|
+
* name it was created with, and a rename found by an old word may since have
|
|
95
|
+
* been renamed again. So a hit is only an address: each is read back as its
|
|
96
|
+
* root and changes, folded through its app's manifest, and kept only when what
|
|
97
|
+
* it is called now matches what was typed.
|
|
84
98
|
*
|
|
85
99
|
* Roots and renames are asked for separately, so a burst of renames cannot
|
|
86
100
|
* crowd every root out of the answer, and with buzz's prefix mode, so the word
|
|
@@ -100,9 +114,7 @@ export async function searchFileReferences(text, query, { limit = 32, ...options
|
|
|
100
114
|
const at = new Map();
|
|
101
115
|
for (const hit of hits) {
|
|
102
116
|
const address = hit.kind === KIND_CHANGE
|
|
103
|
-
? tagOf(hit, 'field')
|
|
104
|
-
? tagOf(hit, 'a')
|
|
105
|
-
: undefined
|
|
117
|
+
? searchedChange(tagOf(hit, 'field'), tagOf(hit, 'a'))
|
|
106
118
|
: typeOf(hit.kind) && `${hit.kind}:${hit.pubkey}:${tagOf(hit, 'd') ?? ''}`;
|
|
107
119
|
if (!address || !typeOf(Number(address.split(':')[0])))
|
|
108
120
|
continue;
|
|
@@ -111,7 +123,7 @@ export async function searchFileReferences(text, query, { limit = 32, ...options
|
|
|
111
123
|
if (at.size === 0)
|
|
112
124
|
return [];
|
|
113
125
|
const objects = await resolveForeignRoots([...at.keys()], query, options.cache);
|
|
114
|
-
const matching = objects.filter((o) => o.slots.title && referenceMatch(o.slots.title.value, wanted) > 0);
|
|
126
|
+
const matching = objects.filter((o) => (o.slots.title && referenceMatch(o.slots.title.value, wanted) > 0) || refMatch(refOf(o), wanted) > 0);
|
|
115
127
|
return fileCandidates(matching, FILE_TIER.search, query, { ...options, at });
|
|
116
128
|
}
|
|
117
129
|
//# sourceMappingURL=references.js.map
|
package/dist/references.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.js","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;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;AAExB,sEAAsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAA4C;IAC3E,CAAC,YAAY,CAAC,EAAE,SAAS;IACzB,CAAC,UAAU,CAAC,EAAE,OAAO;IACrB,CAAC,cAAc,CAAC,EAAE,OAAO;CAC1B,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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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.50.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",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"prepublishOnly": "npm run build"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@estiva-app/conversation": ">=0.
|
|
50
|
+
"@estiva-app/conversation": ">=0.6.1",
|
|
51
51
|
"@estiva-app/protocol": ">=0.24.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@estiva-app/conversation": ">=0.
|
|
54
|
+
"@estiva-app/conversation": ">=0.6.1",
|
|
55
55
|
"@estiva-app/protocol": ">=0.24.0",
|
|
56
56
|
"typescript": "~5.9.3"
|
|
57
57
|
}
|
package/src/references.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
fileReference,
|
|
18
18
|
KIND_CHANGE,
|
|
19
19
|
referenceMatch,
|
|
20
|
+
refMatch,
|
|
20
21
|
type ReferenceCandidate,
|
|
21
22
|
type ReferenceType,
|
|
22
23
|
} from '@estiva-app/conversation'
|
|
@@ -51,6 +52,13 @@ const offerable = (object: ForeignObject | null | undefined): object is Addresse
|
|
|
51
52
|
typeOf(object.kind) !== undefined &&
|
|
52
53
|
!!object.slots.title?.value.trim()
|
|
53
54
|
|
|
55
|
+
/**
|
|
56
|
+
* An issue's current ref (`CON-33`, SPEC §6.1) — the manifest slot that folds
|
|
57
|
+
* the `ref` field — so typing it finds the issue. Only an issue has one.
|
|
58
|
+
*/
|
|
59
|
+
const refOf = (object: ForeignObject): string | undefined =>
|
|
60
|
+
object.kind === KIND_ISSUE ? object.meta.find((slot) => slot.field === 'ref')?.value.trim() || undefined : undefined
|
|
61
|
+
|
|
54
62
|
export interface FileCandidatesOptions {
|
|
55
63
|
cache?: ProjectionCache
|
|
56
64
|
/** When each address was last written or read, in seconds — newer first within a tier. */
|
|
@@ -86,14 +94,17 @@ export async function fileCandidates(
|
|
|
86
94
|
}
|
|
87
95
|
return files.map((o) => {
|
|
88
96
|
const parent = o.kind === KIND_ISSUE && o.parentRef ? parents.get(o.parentRef) : undefined
|
|
97
|
+
const ref = refOf(o)
|
|
89
98
|
return {
|
|
90
99
|
id: o.address,
|
|
91
100
|
uri: fileReference(o.address),
|
|
92
101
|
type: typeOf(o.kind)!,
|
|
93
102
|
kind: o.kind,
|
|
94
103
|
title: o.slots.title!.value,
|
|
95
|
-
|
|
104
|
+
// An issue reads "CON-33 · Conversation standard": the ref first, so a hit by ref shows it (Miky, 2026-10-05).
|
|
105
|
+
caption: [ref, parent?.slots.title?.value].filter(Boolean).join(' · '),
|
|
96
106
|
tier,
|
|
107
|
+
...(ref ? { search: ref } : {}),
|
|
97
108
|
...(isClosedStatus(o.slots.status) ? { closed: true } : {}),
|
|
98
109
|
...(o.archived || parent?.archived ? { archived: true } : {}),
|
|
99
110
|
...(at?.has(o.address) ? { at: at.get(o.address) } : {}),
|
|
@@ -109,14 +120,22 @@ export interface SearchFileReferencesOptions extends Omit<FileCandidatesOptions,
|
|
|
109
120
|
const tagOf = (event: { tags: string[][] }, name: string) => event.tags.find((t) => t[0] === name)?.[1]
|
|
110
121
|
|
|
111
122
|
/**
|
|
112
|
-
* The
|
|
123
|
+
* The file a `kind:1851` hit names, when it is one the relay indexes for `[`
|
|
124
|
+
* (SPEC §5.2): a title change on any file, a ref change only on an issue.
|
|
125
|
+
*/
|
|
126
|
+
const searchedChange = (field: string | undefined, address: string | undefined) =>
|
|
127
|
+
field === 'title' || (field === 'ref' && address?.startsWith(`${KIND_ISSUE}:`)) ? address : undefined
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The files whose **current** title — or, for an issue, current ref (CON-33)
|
|
131
|
+
* — holds `text`, as the search tier.
|
|
113
132
|
*
|
|
114
|
-
* The relay indexes a root's `title` and a
|
|
115
|
-
*
|
|
116
|
-
* it was created with, and a rename found by an old word may since have
|
|
117
|
-
* renamed again. So a hit is only an address: each is read back as its
|
|
118
|
-
* and changes, folded through its app's manifest, and kept only when what
|
|
119
|
-
* is called now matches what was typed.
|
|
133
|
+
* The relay indexes a root's `title` and `ref` and a change's `value` for those
|
|
134
|
+
* fields (SPEC §5.2); none is the current one on its own — a root keeps the
|
|
135
|
+
* name it was created with, and a rename found by an old word may since have
|
|
136
|
+
* been renamed again. So a hit is only an address: each is read back as its
|
|
137
|
+
* root and changes, folded through its app's manifest, and kept only when what
|
|
138
|
+
* it is called now matches what was typed.
|
|
120
139
|
*
|
|
121
140
|
* Roots and renames are asked for separately, so a burst of renames cannot
|
|
122
141
|
* crowd every root out of the answer, and with buzz's prefix mode, so the word
|
|
@@ -140,15 +159,13 @@ export async function searchFileReferences(
|
|
|
140
159
|
for (const hit of hits) {
|
|
141
160
|
const address =
|
|
142
161
|
hit.kind === KIND_CHANGE
|
|
143
|
-
? tagOf(hit, 'field')
|
|
144
|
-
? tagOf(hit, 'a')
|
|
145
|
-
: undefined
|
|
162
|
+
? searchedChange(tagOf(hit, 'field'), tagOf(hit, 'a'))
|
|
146
163
|
: typeOf(hit.kind) && `${hit.kind}:${hit.pubkey}:${tagOf(hit, 'd') ?? ''}`
|
|
147
164
|
if (!address || !typeOf(Number(address.split(':')[0]))) continue
|
|
148
165
|
at.set(address, Math.max(at.get(address) ?? 0, hit.created_at))
|
|
149
166
|
}
|
|
150
167
|
if (at.size === 0) return []
|
|
151
168
|
const objects = await resolveForeignRoots([...at.keys()], query, options.cache)
|
|
152
|
-
const matching = objects.filter((o) => o.slots.title && referenceMatch(o.slots.title.value, wanted) > 0)
|
|
169
|
+
const matching = objects.filter((o) => (o.slots.title && referenceMatch(o.slots.title.value, wanted) > 0) || refMatch(refOf(o), wanted) > 0)
|
|
153
170
|
return fileCandidates(matching, FILE_TIER.search, query, { ...options, at })
|
|
154
171
|
}
|