@joe-broadhead/opencode-mem 0.9.5 → 0.9.12
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 +1281 -0
- package/README.md +105 -31
- package/docs/agent-protocol.md +28 -27
- package/docs/permissions.md +148 -0
- package/package.json +24 -12
- package/skills/mem.pages/SKILL.md +35 -16
- package/skills/mem.sharing/SKILL.md +39 -6
- package/skills/mem.sources/SKILL.md +41 -10
- package/skills/mem.usage/SKILL.md +37 -16
- package/src/backend/records.js +8 -0
- package/src/backend/v3.js +15 -10
- package/src/call-shapes.js +18 -25
- package/src/capture-pause.js +136 -0
- package/src/capture.js +7 -5
- package/src/collector-service.js +212 -35
- package/src/collector.js +186 -47
- package/src/commands.js +37 -0
- package/src/compaction.js +4 -2
- package/src/config.js +151 -1
- package/src/curation.js +6 -10
- package/src/events.js +144 -36
- package/src/forget-purge.js +377 -0
- package/src/forgotten.js +152 -0
- package/src/hooks.js +9 -4
- package/src/index.js +5 -3
- package/src/permissions.js +116 -38
- package/src/protocol.js +21 -11
- package/src/records.js +4 -1
- package/src/runtime.js +202 -15
- package/src/shapes.js +63 -0
- package/src/sources.js +183 -12
- package/src/spaces.js +58 -1
- package/src/spool.js +442 -64
- package/src/stated.js +334 -0
- package/src/storable.js +477 -0
- package/src/tools/aliases.js +36 -147
- package/src/tools/commitments.js +69 -12
- package/src/tools/index.js +25 -43
- package/src/tools/ingest.js +33 -128
- package/src/tools/memory.js +503 -904
- package/src/tools/page-sections.js +147 -0
- package/src/tools/page.js +314 -82
- package/src/tools/recall-browse.js +173 -0
- package/src/tools/recall.js +36 -8
- package/src/tools/share.js +494 -131
- package/src/tools/shared.js +97 -19
- package/src/tools/spaces.js +194 -101
- package/src/tools/status.js +31 -3
- package/src/tools/wiki.js +5 -13
- package/src/util.js +10 -59
- package/src/views/profile.js +2 -3
- package/src/views/records-reads.js +6 -1
- package/src/erase.js +0 -36
package/src/tools/spaces.js
CHANGED
|
@@ -19,9 +19,10 @@ const REVIEW_LIMIT = 20
|
|
|
19
19
|
* - `health`: the backend, the layers, the records service's counts and the
|
|
20
20
|
* collector (it absorbs `mem_status`).
|
|
21
21
|
* - `sources`: the funnel's bindings (memory-funnel-v1.md §10). Listing reads
|
|
22
|
-
* them; `bind`
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* them; `bind` asks the person's collector for the signed-in account
|
|
23
|
+
* (`sources.request`) and answers with the console link where the person
|
|
24
|
+
* confirms it (0.9.7, owner decision D1: no agent binds); `unbind` previews
|
|
25
|
+
* unless `confirm`, then stops collection and deletes the source's events.
|
|
25
26
|
* - `review`: the routines' proposals; `decide` accepts, edits or rejects one.
|
|
26
27
|
*
|
|
27
28
|
* @param {any} editor
|
|
@@ -32,7 +33,7 @@ export function registerSpaces(editor, toolkit) {
|
|
|
32
33
|
editor.add({
|
|
33
34
|
name: "spaces",
|
|
34
35
|
description:
|
|
35
|
-
"Where memory lives and what flows in: spaces, members, access, health, sources, review. current: the active space and whether this session is bound to it. list: every space you can use. members: who is in a space, with user ids. access: your role and the grants that name you. health: whether memory is reachable, what each layer holds, and whether the collector runs; use it when memory itself may be down, not to explain an ordinary recall miss. Do not inspect spaces or health to verify a successful read or write; use the answer already returned. sources: the accounts Memory collects from (mail, chat, meetings); bind one only when the person asks: it
|
|
36
|
+
"Where memory lives and what flows in: spaces, members, access, health, sources, review. current: the active space and whether this session is bound to it; with bind {space} it binds this session to that space (\"personal\" for your personal space), only when the person asks; a team space asks the person first: the binding is where recall without a space, the pinned block and team capture go. Passing space to any tool never binds. list: every space you can use. members: who is in a space, with user ids. access: your role and the grants that name you. health: whether memory is reachable, what each layer holds, and whether the collector runs; use it when memory itself may be down, not to explain an ordinary recall miss. Do not inspect spaces or health to verify a successful read or write; use the answer already returned. sources: the accounts Memory collects from (mail, chat, meetings); bind one only when the person asks: it asks the person's collector which account the source is signed in to and answers with the console link where the person confirms it (no agent binds; nothing is collected until they do); unbind previews unless confirm is true, then stops collection and deletes that source's events. review: proposals the daily routine made; decide accepts, edits or rejects one, only when the person says (in a shared space it asks). current, list, members and access need a control plane; health, sources and review work without one. It says who can see what, never what the rules are: \"am I allowed\" is a mem_recall question. Never bind an account or decide a proposal the person did not ask for. Membership and roles are the control plane's: this tool never changes them.",
|
|
36
37
|
input: {
|
|
37
38
|
type: "object",
|
|
38
39
|
properties: {
|
|
@@ -45,12 +46,13 @@ export function registerSpaces(editor, toolkit) {
|
|
|
45
46
|
space: { type: "string", description: "Space id (control plane) for members, access, health, sources and review; defaults to the session's space (sources: your personal space). Never rebinds the session" },
|
|
46
47
|
bind: {
|
|
47
48
|
type: "object",
|
|
48
|
-
description:
|
|
49
|
+
description:
|
|
50
|
+
'current: bind this session to a space, only when the person asks. Example: {"action": "current", "bind": {"space": "personal"}}. sources: ask to collect from one source; the person confirms the account in the Memory console, from the link the answer gives. Example: {"action": "sources", "bind": {"source": "gmail", "account": "work"}}',
|
|
49
51
|
properties: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
space: { type: "string", description: 'current: "personal" or a space id from list' },
|
|
53
|
+
source: { type: "string", description: "sources: the source plugin's Code Mode namespace, such as gmail or slack" },
|
|
54
|
+
account: { type: "string", description: 'sources: the account within it; default "default"' },
|
|
52
55
|
},
|
|
53
|
-
required: ["source"],
|
|
54
56
|
additionalProperties: false,
|
|
55
57
|
},
|
|
56
58
|
unbind: {
|
|
@@ -69,8 +71,8 @@ export function registerSpaces(editor, toolkit) {
|
|
|
69
71
|
description: 'review: answer one proposal. Example: {"action": "review", "decide": {"id": "rec_...", "decision": "reject", "reason": "vendor newsletters are noise"}}',
|
|
70
72
|
properties: {
|
|
71
73
|
id: { type: "string", description: "The proposal id review listed" },
|
|
72
|
-
decision: { type: "string", enum: [...DECISIONS], description: "accept applies it; edit applies payload instead; reject drops it
|
|
73
|
-
reason: { type: "string", description: "Why;
|
|
74
|
+
decision: { type: "string", enum: [...DECISIONS], description: "accept applies it; edit applies payload instead; reject drops it" },
|
|
75
|
+
reason: { type: "string", description: "Why; kept on the proposal, never a memory" },
|
|
74
76
|
payload: { type: "string", description: "edit: the text to apply instead of the proposal's" },
|
|
75
77
|
},
|
|
76
78
|
required: ["id", "decision"],
|
|
@@ -88,8 +90,7 @@ export function registerSpaces(editor, toolkit) {
|
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
/**
|
|
91
|
-
* The spaces actions
|
|
92
|
-
* `mem_grants` and `mem_members`.
|
|
93
|
+
* The spaces actions behind `mem_spaces`.
|
|
93
94
|
*
|
|
94
95
|
* @param {ReturnType<import("./shared.js").createToolkit>} toolkit
|
|
95
96
|
*/
|
|
@@ -98,12 +99,69 @@ export function createSpacesActions(toolkit) {
|
|
|
98
99
|
const records = () => recordsOf(toolkit)
|
|
99
100
|
const noControl = (what) => text(`control plane not configured; set MEMORY_CONTROL_URL to ${what}`)
|
|
100
101
|
|
|
101
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Bind this session to a space: the one way a session's binding changes.
|
|
104
|
+
* The target is resolved first without the session, so a session bound to
|
|
105
|
+
* an archived space can still be moved, and the ask can name the space.
|
|
106
|
+
* Binding to the personal space only narrows and does not ask; any other
|
|
107
|
+
* space asks `session.bind` with what the binding changes. The answer must
|
|
108
|
+
* report the session bound to the target: a gateway before 0.9.7 drops
|
|
109
|
+
* `bind`, and then nothing was bound.
|
|
110
|
+
*/
|
|
111
|
+
async function bindSession(bind, context) {
|
|
112
|
+
const target = String(bind?.space ?? "").trim()
|
|
113
|
+
if (!target) return { message: 'bind needs a space: {"action": "current", "bind": {"space": "personal"}} or a space id from {"action": "list"}.' }
|
|
114
|
+
if (!context?.sessionID) return { message: "there is no session to bind." }
|
|
115
|
+
const own = await toolkit.resolveContext({ agent: context?.agent })
|
|
116
|
+
const personalId = own?.personal_space_id || (own?.space_kind === "personal" ? own.space_id : "")
|
|
117
|
+
const spaceId = target === "personal" ? personalId : target
|
|
118
|
+
if (!spaceId) return { error: "the control plane returned no personal space" }
|
|
119
|
+
const targetContext = spaceId === own?.space_id ? own : await toolkit.resolveContext({ space: spaceId, agent: context?.agent })
|
|
120
|
+
if (!targetContext?.space_id) return { error: "the control plane returned no space context" }
|
|
121
|
+
const narrows = targetContext.space_kind === "personal" && targetContext.space_id === personalId
|
|
122
|
+
if (!narrows) {
|
|
123
|
+
try {
|
|
124
|
+
await toolkit.assert({
|
|
125
|
+
sessionID: context.sessionID,
|
|
126
|
+
agent: context?.agent,
|
|
127
|
+
source: { type: "tool", messageID: context?.messageID, id: context?.id },
|
|
128
|
+
action: "session.bind",
|
|
129
|
+
resources: [targetContext.space_id],
|
|
130
|
+
save: [],
|
|
131
|
+
metadata: {
|
|
132
|
+
space: targetContext.space_id,
|
|
133
|
+
space_name: oneLine(targetContext.space_name || targetContext.space_id, 200),
|
|
134
|
+
space_kind: targetContext.space_kind || "unknown",
|
|
135
|
+
changes: `This session's recall without a space, its pinned block, team capture and team writes without a space would use ${oneLine(targetContext.space_name || targetContext.space_id, 120)} until it is bound again; passing space to a call is unaffected.`,
|
|
136
|
+
},
|
|
137
|
+
})
|
|
138
|
+
} catch (error) {
|
|
139
|
+
return { message: `not bound (approval): ${errorMessage(error)}. The session keeps its binding.` }
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const bound = await toolkit.resolveContext({ space: spaceId, sessionID: context.sessionID, agent: context?.agent, bind: true })
|
|
143
|
+
if (!bound?.space_id) return { error: "the control plane returned no space context" }
|
|
144
|
+
if (bound.space_id !== spaceId || bound.session_space_id !== spaceId) {
|
|
145
|
+
return {
|
|
146
|
+
message: `not bound: the server answered without binding this session to ${oneLine(spaceId, 80)}. An older Memory gateway (before 0.9.7) drops the bind; ask the operator to upgrade it. Meanwhile pass space on each call.`,
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return { bound }
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function current(input, context) {
|
|
102
153
|
if (!control) return noControl("use spaces")
|
|
154
|
+
let boundLine = ""
|
|
155
|
+
if (input?.bind !== undefined) {
|
|
156
|
+
const result = await bindSession(input.bind, context)
|
|
157
|
+
if (result.message) return text(result.message)
|
|
158
|
+
if (result.error) return fail(result.error)
|
|
159
|
+
boundLine = `bound: this session now uses ${describeSpace(result.bound)}`
|
|
160
|
+
}
|
|
103
161
|
const spaceContext = await toolkit.resolveContext({ sessionID: context?.sessionID, agent: context?.agent })
|
|
104
162
|
if (!spaceContext) return fail("the control plane returned no space context")
|
|
105
163
|
const scoped = toolkit.scopeFor(spaceContext, { sessionID: context?.sessionID, agent: context?.agent })
|
|
106
|
-
const lines = ["<space_context>", `space: ${describeSpace(spaceContext)}`]
|
|
164
|
+
const lines = ["<space_context>", ...(boundLine ? [boundLine] : []), `space: ${describeSpace(spaceContext)}`]
|
|
107
165
|
const collection = describeCollection(spaceContext)
|
|
108
166
|
if (collection) lines.push(`collection: ${collection}`)
|
|
109
167
|
if (spaceContext.role) lines.push(`role: ${spaceContext.role}`)
|
|
@@ -203,6 +261,7 @@ export function createSpacesActions(toolkit) {
|
|
|
203
261
|
} else spaceContext = await toolkit.runtime.sessionContext(context?.sessionID, context?.agent)
|
|
204
262
|
if (!spaceContext?.space_id) return { error: "the control plane returned no space context" }
|
|
205
263
|
return {
|
|
264
|
+
context: spaceContext,
|
|
206
265
|
where: requested || personalDefault ? { space: spaceContext.space_id } : { sessionID: context?.sessionID, space: spaceContext.space_id },
|
|
207
266
|
label: describeSpace(spaceContext),
|
|
208
267
|
shared: spaceContext.space_kind === "shared",
|
|
@@ -232,8 +291,27 @@ export function createSpacesActions(toolkit) {
|
|
|
232
291
|
}
|
|
233
292
|
|
|
234
293
|
async function listSources(where) {
|
|
294
|
+
return (await listAll(where)).sources
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/** Bindings and the person's open bind requests (a request made in the console, or here). */
|
|
298
|
+
async function listAll(where) {
|
|
235
299
|
const answer = await records().call("sources.list", {}, where)
|
|
236
|
-
return
|
|
300
|
+
return {
|
|
301
|
+
sources: Array.isArray(answer?.sources) ? answer.sources.filter(isPlainObject) : [],
|
|
302
|
+
requests: Array.isArray(answer?.requests) ? answer.requests.filter(isPlainObject) : [],
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const describeRequest = (row) => {
|
|
307
|
+
const name = `${oneLine(row.source, 64)}:${oneLine(row.account || DEFAULT_ACCOUNT, 128)}`
|
|
308
|
+
const asked = row.requested_at ? ` (asked ${oneLine(row.requested_at, 40)})` : ""
|
|
309
|
+
if (row.state === "reported" && row.owner?.id) {
|
|
310
|
+
return `- ${name} bind requested${asked}: the collector reports it is signed in as ${oneLine(row.owner.label || row.owner.id, 120)}; the person confirms it in ${consoleAt("sources")}${row.note ? `. The source says: ${oneLine(row.note, 240)}` : ""}`
|
|
311
|
+
}
|
|
312
|
+
if (row.state === "attention") return `- ${name} bind requested${asked}: needs attention: the collector could not read the account ${Number(row.failures) || 3} times${row.note ? ` (${oneLine(row.note, 240)})` : ""}; it stopped trying. Bind… again in the console once the source is signed in`
|
|
313
|
+
if (row.state === "failed") return `- ${name} bind requested${asked}: the collector could not learn the account${row.note ? ` (${oneLine(row.note, 240)})` : ""}; it tries again${row.retry_at ? ` after ${oneLine(row.retry_at, 40)}` : " on its next run"}`
|
|
314
|
+
return `- ${name} bind requested${asked}: waiting for the collector's next run to report the signed-in account`
|
|
237
315
|
}
|
|
238
316
|
|
|
239
317
|
/** Keep a host schedule (where there is one) in step with the sources; one line on how collection runs. */
|
|
@@ -253,32 +331,51 @@ export function createSpacesActions(toolkit) {
|
|
|
253
331
|
: "Collection: the collection timer is off (collect: false); /mem-collect collects now."
|
|
254
332
|
}
|
|
255
333
|
|
|
334
|
+
/** Memory's console page for an area, or how to find it when no gateway is configured. */
|
|
335
|
+
function consoleAt(area) {
|
|
336
|
+
const url = config?.controlURL ?? toolkit.runtime?.config?.controlURL
|
|
337
|
+
try {
|
|
338
|
+
return `${new URL(String(url ?? "")).origin}/console/${area}`
|
|
339
|
+
} catch {
|
|
340
|
+
return `Memory's console (${area[0].toUpperCase()}${area.slice(1)})`
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
256
344
|
/**
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
345
|
+
* `sources` with `bind` (0.9.7, owner decision D1): the person confirms
|
|
346
|
+
* whose account Memory collects in a browser, in the console; no agent
|
|
347
|
+
* confirms it, and the records service refuses `sources.bind` from any key
|
|
348
|
+
* or token. Here the plugin only asks: it records a bind request when there
|
|
349
|
+
* is none (`sources.request`, which reads and collects nothing; the
|
|
350
|
+
* person's collector then reports the signed-in account), and answers with
|
|
351
|
+
* the console link where the person confirms it.
|
|
262
352
|
*/
|
|
263
|
-
async function
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
353
|
+
async function bindSource(value, space, rows, requests) {
|
|
354
|
+
const asked = bindingOf(value, { known: true })
|
|
355
|
+
if (asked.error) return `not bound: ${asked.error}`
|
|
356
|
+
const name = `${asked.source}${asked.asked ? `:${asked.account}` : ""}`
|
|
357
|
+
const label = asked.source
|
|
358
|
+
const link = consoleAt("sources")
|
|
359
|
+
const matches = (row, ...accounts) => row.source === asked.source && (!asked.asked || accounts.some((account) => (account || DEFAULT_ACCOUNT) === asked.account))
|
|
360
|
+
const bound = rows.find((row) => matches(row, row.account) && row.status === "confirmed" && (row.enabled === true || row.enabled === 1))
|
|
361
|
+
if (bound) return `${asked.source}:${oneLine(bound.account || DEFAULT_ACCOUNT, 128)} is already collecting from ${oneLine(bound.owner_label || bound.owner_id || "its owner", 120)}. Nothing changed.`
|
|
362
|
+
const confirm = `Confirming whose account Memory collects is the person's own act, in a browser: open ${link} and choose Confirm for ${label}. Nothing is collected until they do; no agent and no key can confirm it.`
|
|
363
|
+
const open = requests.find((row) => matches(row, row.account, row.reported_account))
|
|
364
|
+
if (open?.state === "reported" && open.owner?.id) {
|
|
365
|
+
return `not bound here: the person's collector reports ${name} is signed in as ${oneLine(open.owner.label || open.owner.id, 120)} (${oneLine(open.owner.id, 120)}). ${confirm}`
|
|
366
|
+
}
|
|
367
|
+
if (open) {
|
|
368
|
+
const why = open.state === "attention" || open.state === "failed" ? ` The collector could not read the account yet${open.note ? ` (${oneLine(open.note, 240)})` : ""}.` : ""
|
|
369
|
+
return `not bound here: a bind request for ${name} is open; the person's collector reports the signed-in account on its next run.${why} ${confirm}`
|
|
370
|
+
}
|
|
371
|
+
try {
|
|
372
|
+
await records().call("sources.request", { source: asked.source, account: asked.account }, space.where)
|
|
373
|
+
} catch (error) {
|
|
374
|
+
log.warn("sources request failed", error)
|
|
375
|
+
return `not asked: ${recordsFailure(error)}`
|
|
276
376
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const pending = rows.find((row) => row.source === binding.source && (!binding.asked || (row.account || DEFAULT_ACCOUNT) === binding.account) && row.owner_id)
|
|
280
|
-
if (pending) return { owner: { id: pending.owner_id, label: pending.owner_label || pending.owner_id }, source: binding.source, account: pending.account || DEFAULT_ACCOUNT, from: "the binding the records service holds" }
|
|
281
|
-
return { notes }
|
|
377
|
+
log.info("sources request", { source: asked.source })
|
|
378
|
+
return `not bound here: asked. On its next run (every 30 minutes while OpenCode is open, or now with mem_collect when the person asks), the person's collector reads only which account ${label} is signed in to. ${confirm}`
|
|
282
379
|
}
|
|
283
380
|
|
|
284
381
|
async function sources(input, context) {
|
|
@@ -288,68 +385,56 @@ export function createSpacesActions(toolkit) {
|
|
|
288
385
|
if (space.message) return text(space.message)
|
|
289
386
|
if (space.error) return fail(space.error)
|
|
290
387
|
let rows
|
|
388
|
+
let requests
|
|
291
389
|
try {
|
|
292
|
-
rows = await
|
|
390
|
+
;({ sources: rows, requests } = await listAll(space.where))
|
|
293
391
|
} catch (error) {
|
|
294
392
|
return fail(recordsFailure(error))
|
|
295
393
|
}
|
|
296
394
|
|
|
395
|
+
// A source belongs to a personal space: a bind request, or its cancel, in
|
|
396
|
+
// a shared space is refused here (the records service refuses it too). An
|
|
397
|
+
// unbind there deletes the team's events, so it goes through the one gate
|
|
398
|
+
// and asks sources.unbind.
|
|
399
|
+
const personalOnly = (verb) => `not ${verb}: sources belong to your personal space, where they collect the person's own mail and chat; ${space.label} is shared. Nothing changed.`
|
|
400
|
+
const gateUnbind = async (binding, deletes) => (await toolkit.gateWrite(context, {
|
|
401
|
+
action: "sources.unbind",
|
|
402
|
+
spaceContext: space.context,
|
|
403
|
+
shared: space.shared,
|
|
404
|
+
resources: [`${binding.source}:${binding.account}`],
|
|
405
|
+
metadata: { space: space.spaceId, source: binding.source, account: binding.account, deletes },
|
|
406
|
+
})).denied
|
|
407
|
+
|
|
297
408
|
if (input?.bind) {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
const known = await ownerOf(asked, rows, context)
|
|
301
|
-
if (known.refused) return text(`not bound: ${known.refused}`)
|
|
302
|
-
if (!known.owner) {
|
|
303
|
-
const why = known.notes?.length ? ` (${known.notes.join("; ")})` : ""
|
|
304
|
-
return text(
|
|
305
|
-
`not bound: Memory could not learn which account ${asked.source}${asked.asked ? `:${asked.account}` : ""} is signed in to${why}. Sign in to that source in its own plugin, then try again; Memory shows the account and asks the person before anything is collected.`,
|
|
306
|
-
)
|
|
307
|
-
}
|
|
308
|
-
const owner = { id: oneLine(known.owner.id, 300), label: oneLine(known.owner.label ?? known.owner.email ?? known.owner.id, 300) }
|
|
309
|
-
// The binding is the one the source's own answer names (§4.5).
|
|
310
|
-
const binding = { source: known.source, account: known.account }
|
|
311
|
-
try {
|
|
312
|
-
await toolkit.assert({
|
|
313
|
-
sessionID: context?.sessionID,
|
|
314
|
-
agent: context?.agent,
|
|
315
|
-
source: { type: "tool", messageID: context?.messageID, id: context?.id },
|
|
316
|
-
action: "sources.bind",
|
|
317
|
-
resources: [`${binding.source}:${binding.account}`],
|
|
318
|
-
save: [],
|
|
319
|
-
metadata: { space: space.spaceId ?? "local", source: binding.source, account: binding.account, owner: `${owner.label} (${owner.id})`, from: known.from },
|
|
320
|
-
})
|
|
321
|
-
} catch (error) {
|
|
322
|
-
return text(`not bound (approval): ${errorMessage(error)}`)
|
|
323
|
-
}
|
|
324
|
-
try {
|
|
325
|
-
await records().call("sources.bind", { source: binding.source, account: binding.account, owner, enabled: true }, space.where)
|
|
326
|
-
} catch (error) {
|
|
327
|
-
log.warn("sources bind failed", error)
|
|
328
|
-
return fail(`${error?.outcomeUnknown ? "bind outcome unknown" : "not bound"}: ${recordsFailure(error)}`)
|
|
329
|
-
}
|
|
330
|
-
let after = rows
|
|
331
|
-
try {
|
|
332
|
-
after = await listSources(space.where)
|
|
333
|
-
} catch {
|
|
334
|
-
/* the schedule is brought in step at the next list */
|
|
335
|
-
}
|
|
336
|
-
const sync = await syncCollector(after)
|
|
337
|
-
log.info("sources bind", { source: binding.source })
|
|
338
|
-
return text(
|
|
339
|
-
`bound ${binding.source}:${binding.account} in ${space.label} to ${owner.label} (${owner.id}), as the person confirmed. Memory accepts its events only while that account is the one signed in. Raw events stay private to this space for 30 days; the daily routine turns them into journal pages and proposals for review.${sync ? ` ${sync}` : ""}`,
|
|
340
|
-
)
|
|
409
|
+
if (space.shared) return text(personalOnly("bound"))
|
|
410
|
+
return text(await bindSource(input.bind, space, rows, requests))
|
|
341
411
|
}
|
|
342
412
|
|
|
343
413
|
if (input?.unbind) {
|
|
344
414
|
const binding = bindingOf(input.unbind)
|
|
345
415
|
if (binding.error) return text(`not unbound: ${binding.error}`)
|
|
346
416
|
const row = rows.find((entry) => entry.source === binding.source && (entry.account || DEFAULT_ACCOUNT) === binding.account)
|
|
417
|
+
const request = requests.find((entry) => entry.source === binding.source && (entry.account || DEFAULT_ACCOUNT) === binding.account)
|
|
418
|
+
if (!row && request) {
|
|
419
|
+
if (space.shared) return text(personalOnly("cancelled"))
|
|
420
|
+
// Only a bind request: nothing was collected, so cancelling it deletes nothing.
|
|
421
|
+
try {
|
|
422
|
+
await records().call("sources.cancel", { source: binding.source, account: binding.account }, space.where)
|
|
423
|
+
} catch (error) {
|
|
424
|
+
return fail(`not cancelled: ${recordsFailure(error)}`)
|
|
425
|
+
}
|
|
426
|
+
// No session keeps this binding's allow rules once nobody asks for it.
|
|
427
|
+
await toolkit.collector?.forgetSession?.({ source: binding.source, account: binding.account })
|
|
428
|
+
return text(`cancelled the bind request for ${binding.source}:${binding.account} in ${space.label}; nothing had been collected from it.`)
|
|
429
|
+
}
|
|
347
430
|
if (!row) return text(`not unbound: ${binding.source}:${binding.account} is not a source in ${space.label}.`)
|
|
348
431
|
if (input?.confirm !== true) {
|
|
349
432
|
return text(
|
|
350
433
|
`preview, nothing changed: unbinding ${binding.source}:${binding.account} (${oneLine(row.owner_label || row.owner_id || "owner unknown", 120)}) stops its collection and deletes every event collected from it in ${space.label}. Journal pages and memories already made from them stay. Call again with "confirm": true to unbind.`,
|
|
351
434
|
)
|
|
352
435
|
}
|
|
436
|
+
const denied = await gateUnbind(binding, `stops collecting ${binding.source}:${binding.account} and deletes every event collected from it in ${oneLine(space.context?.space_name || space.spaceId || "this space", 120)}; pages and memories already made from them stay.`)
|
|
437
|
+
if (denied) return text(`not unbound (approval): ${denied}`)
|
|
353
438
|
let answer
|
|
354
439
|
try {
|
|
355
440
|
answer = await records().call("sources.unbind", { source: binding.source, account: binding.account }, space.where)
|
|
@@ -357,6 +442,7 @@ export function createSpacesActions(toolkit) {
|
|
|
357
442
|
log.warn("sources unbind failed", error)
|
|
358
443
|
return fail(`${error?.outcomeUnknown ? "unbind outcome unknown" : "not unbound"}: ${recordsFailure(error)}`)
|
|
359
444
|
}
|
|
445
|
+
await toolkit.collector?.forgetSession?.({ source: binding.source, account: binding.account })
|
|
360
446
|
let after = rows.filter((entry) => entry !== row)
|
|
361
447
|
try {
|
|
362
448
|
after = await listSources(space.where)
|
|
@@ -371,8 +457,9 @@ export function createSpacesActions(toolkit) {
|
|
|
371
457
|
|
|
372
458
|
const sync = await syncCollector(rows)
|
|
373
459
|
const lines = ["<sources>", `space: ${space.label}`]
|
|
374
|
-
if (rows.length === 0) lines.push('(no sources: Memory collects nothing. When the person asks, bind one with {"action": "sources", "bind": {"source": "<namespace>"}}.)')
|
|
460
|
+
if (rows.length === 0 && requests.length === 0) lines.push('(no sources: Memory collects nothing. When the person asks, bind one with {"action": "sources", "bind": {"source": "<namespace>"}}.)')
|
|
375
461
|
for (const row of rows) lines.push(describeBinding(row))
|
|
462
|
+
for (const row of requests) lines.push(describeRequest(row))
|
|
376
463
|
lines.push("</sources>")
|
|
377
464
|
if (toolkit.collector) lines.push(toolkit.collector.describe())
|
|
378
465
|
else if (sync) lines.push(sync)
|
|
@@ -402,32 +489,38 @@ export function createSpacesActions(toolkit) {
|
|
|
402
489
|
if (decision === "edit" && !payload) return text("not decided: an edit needs payload, the text to apply instead.")
|
|
403
490
|
const reason = String(input.decide.reason ?? "").trim()
|
|
404
491
|
// A decision in a shared space changes what every member reads, so it
|
|
405
|
-
// asks, as
|
|
406
|
-
|
|
492
|
+
// goes through the one gate and asks, as a revise does.
|
|
493
|
+
const metadata = { space: space.spaceId, proposal: id, decision, ...(reason ? { reason: oneLine(reason, 300) } : {}), ...(payload ? { payload: oneLine(payload, 300) } : {}) }
|
|
494
|
+
const gate = await toolkit.gateWrite(context, { action: "memory.revise", spaceContext: space.context, shared: space.shared, resources: [id], metadata })
|
|
495
|
+
if (gate.denied) return text(`not decided (approval): ${gate.denied}`)
|
|
496
|
+
const decide = (extra = {}) => records().call("review.decide", { id, decision, ...(payload ? { payload } : {}), ...(reason ? { reason } : {}), ...extra }, space.where)
|
|
497
|
+
let answer
|
|
498
|
+
try {
|
|
407
499
|
try {
|
|
408
|
-
await
|
|
409
|
-
sessionID: context?.sessionID,
|
|
410
|
-
agent: context?.agent,
|
|
411
|
-
source: { type: "tool", messageID: context?.messageID, id: context?.id },
|
|
412
|
-
action: "memory.revise",
|
|
413
|
-
resources: [id],
|
|
414
|
-
save: [],
|
|
415
|
-
metadata: { space: space.spaceId, proposal: id, decision, ...(reason ? { reason: oneLine(reason, 300) } : {}), ...(payload ? { payload: oneLine(payload, 300) } : {}) },
|
|
416
|
-
})
|
|
500
|
+
answer = await decide()
|
|
417
501
|
} catch (error) {
|
|
418
|
-
|
|
502
|
+
// Whether the decision writes the pinned `index` is the store's to
|
|
503
|
+
// say, from what it would write (slice 7 review P2). It refuses a
|
|
504
|
+
// bearer without confirm_pinned and rolls back; ask, then repeat.
|
|
505
|
+
if (error?.code !== "pinned_confirmation_required") throw error
|
|
506
|
+
const pinned = await toolkit.gateWrite(context, {
|
|
507
|
+
action: "page.write",
|
|
508
|
+
spaceContext: space.context,
|
|
509
|
+
shared: space.shared,
|
|
510
|
+
pinned: true,
|
|
511
|
+
resources: ["index", id],
|
|
512
|
+
metadata: { ...metadata, page: "index" },
|
|
513
|
+
})
|
|
514
|
+
if (pinned.denied) return text(`not decided (approval): ${pinned.denied}`)
|
|
515
|
+
answer = await decide({ confirm_pinned: true })
|
|
419
516
|
}
|
|
420
|
-
}
|
|
421
|
-
let answer
|
|
422
|
-
try {
|
|
423
|
-
answer = await records().call("review.decide", { id, decision, ...(payload ? { payload } : {}), ...(reason ? { reason } : {}) }, space.where)
|
|
424
517
|
} catch (error) {
|
|
425
518
|
log.warn("review decide failed", error)
|
|
426
519
|
return fail(`${error?.outcomeUnknown ? "decision outcome unknown" : "not decided"}: ${recordsFailure(error)}`)
|
|
427
520
|
}
|
|
428
521
|
const applied = answer?.applied
|
|
429
522
|
const appliedText = isPlainObject(applied) && applied.id ? ` Applied as ${oneLine(applied.id, 40)}${applied.path ? ` (${oneLine(applied.path, 120)})` : ""}.` : ""
|
|
430
|
-
const learned = decision === "reject" && reason ? " The reason
|
|
523
|
+
const learned = decision === "reject" && reason ? " The reason is kept on the proposal only, not as a memory." : ""
|
|
431
524
|
return text(`${decision === "reject" ? "rejected" : decision === "edit" ? "edited and applied" : "accepted"} proposal ${oneLine(id, 40)} in ${space.label}.${appliedText}${learned}`)
|
|
432
525
|
}
|
|
433
526
|
|
|
@@ -467,7 +560,7 @@ export function createSpacesActions(toolkit) {
|
|
|
467
560
|
const action = String(input?.action ?? "").trim() || "list"
|
|
468
561
|
if (!SPACES_ACTIONS.includes(action)) return text(`unknown action ${oneLine(action || "(none)", 40)}: use ${SPACES_ACTIONS.join(", ")}.`)
|
|
469
562
|
try {
|
|
470
|
-
if (action === "current") return await current(context)
|
|
563
|
+
if (action === "current") return await current(input, context)
|
|
471
564
|
if (action === "list") return await list()
|
|
472
565
|
if (action === "members") return await members(input, context)
|
|
473
566
|
if (action === "access") return await access(input, context)
|
package/src/tools/status.js
CHANGED
|
@@ -2,8 +2,7 @@ import { describeBootstrap, describeSpool, errorMessage, isPlainObject, oneLine
|
|
|
2
2
|
import { recordsFailure, recordsOf } from "./share.js"
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The health report `mem_spaces` (`"action": "health"`) gives,
|
|
6
|
-
* deprecated `mem_status` alias with it: backend health, active scope,
|
|
5
|
+
* The health report `mem_spaces` (`"action": "health"`) gives: backend health, active scope,
|
|
7
6
|
* per-layer counts (L0-L3), skills, knowledge assets, queued captures, then the
|
|
8
7
|
* records service's counts for the space (`space.stats`) and the collector.
|
|
9
8
|
*
|
|
@@ -18,6 +17,8 @@ export async function renderHealth(toolkit, input, context) {
|
|
|
18
17
|
try {
|
|
19
18
|
status = await toolkit.runtime.status({
|
|
20
19
|
sessionID: input?.space ? undefined : context?.sessionID,
|
|
20
|
+
// The pause belongs to this session, whatever space the counts are for.
|
|
21
|
+
captureSession: context?.sessionID,
|
|
21
22
|
agent: context?.agent,
|
|
22
23
|
context: spaceContext,
|
|
23
24
|
})
|
|
@@ -84,11 +85,38 @@ async function recordsLines(toolkit, input, context, spaceContext) {
|
|
|
84
85
|
if (isPlainObject(stats?.events)) lines.push(`events: ${Number(stats.events.total) || 0}`)
|
|
85
86
|
if (isPlainObject(stats?.sources)) {
|
|
86
87
|
const sources = stats.sources
|
|
87
|
-
|
|
88
|
+
const requested = Number(sources.requested) || 0
|
|
89
|
+
const attention = Number(sources.attention) || 0
|
|
90
|
+
const asks = requested ? `; ${requested} bind request(s)${attention ? `, ${attention} needing attention: press Bind… again in the console` : ""}` : ""
|
|
91
|
+
lines.push(`sources: ${Number(sources.total) || 0} (${Number(sources.confirmed) || 0} confirmed, ${Number(sources.pending) || 0} pending)${asks}`)
|
|
88
92
|
}
|
|
93
|
+
lines.push(await routinesLine(records, where, stats))
|
|
89
94
|
const runs = Array.isArray(stats?.last_runs) ? stats.last_runs : []
|
|
90
95
|
for (const run of runs.slice(0, 5)) {
|
|
91
96
|
lines.push(`routine ${oneLine(run?.routine ?? "?", 20)}: ${oneLine(run?.status ?? "?", 20)} ${oneLine(run?.date ?? run?.ended ?? run?.started ?? "", 40)}${run?.error ? ` (${oneLine(run.error, 120)})` : ""}`)
|
|
92
97
|
}
|
|
93
98
|
return lines
|
|
94
99
|
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Whether the records service runs the routines, and with which model
|
|
103
|
+
* (`routines.status` `scheduled`, `model`). Off, collected events only wait
|
|
104
|
+
* out their 30 days: nothing turns them into journal pages or proposals.
|
|
105
|
+
*/
|
|
106
|
+
async function routinesLine(records, where, stats) {
|
|
107
|
+
let status
|
|
108
|
+
try {
|
|
109
|
+
status = await records.call("routines.status", {}, where)
|
|
110
|
+
} catch (error) {
|
|
111
|
+
const code = String(error?.code ?? error?.error?.code ?? "")
|
|
112
|
+
if (code === "routines_unavailable") return "routines: off (this records build has none); collected events only wait out their 30 days"
|
|
113
|
+
return `routines: unknown (${oneLine(recordsFailure(error), 160)})`
|
|
114
|
+
}
|
|
115
|
+
if (typeof status?.scheduled !== "boolean") return "routines: unknown (the records service does not say; it predates 0.9.7)"
|
|
116
|
+
const sources = Number(stats?.sources?.enabled) || 0
|
|
117
|
+
if (!status.scheduled) {
|
|
118
|
+
return `routines: off${status.model ? ` (model ${oneLine(status.model, 80)} set, but the scheduler is off)` : ""}; ${sources ? `the ${sources} collecting source(s) only buffer events for 30 days: nothing turns them into journal pages or proposals` : "collection would only buffer events for 30 days"}. The operator turns routines on.`
|
|
119
|
+
}
|
|
120
|
+
const hour = Number.isInteger(status.hour) ? `, daily after ${String(status.hour).padStart(2, "0")}:00 in the space's zone` : ""
|
|
121
|
+
return `routines: on (model ${oneLine(status.model || "unknown", 80)}${hour})`
|
|
122
|
+
}
|
package/src/tools/wiki.js
CHANGED
|
@@ -75,7 +75,6 @@ export function registerWiki(editor, toolkit) {
|
|
|
75
75
|
resolveReadSpace,
|
|
76
76
|
resolvePrivateSpace,
|
|
77
77
|
resolveWriteSpace,
|
|
78
|
-
assertTeamWrite,
|
|
79
78
|
runtime,
|
|
80
79
|
} = toolkit
|
|
81
80
|
|
|
@@ -160,21 +159,14 @@ export function registerWiki(editor, toolkit) {
|
|
|
160
159
|
/**
|
|
161
160
|
* Ask for a team write, once everything that could refuse it has passed.
|
|
162
161
|
* Every team-visible write asks, in local mode too: mem_remember and
|
|
163
|
-
*
|
|
162
|
+
* revise forget already do, and the wiki is the more durable of the three.
|
|
164
163
|
* Returns the denial's words, or "".
|
|
165
164
|
*/
|
|
166
165
|
async function approveWrite(context, visibility, spaceContext, approval) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
...(spaceContext?.space_id ? { space_id: spaceContext.space_id } : {}),
|
|
172
|
-
...(spaceContext?.space_name ? { space_name: oneLine(spaceContext.space_name, 200) } : {}),
|
|
173
|
-
})
|
|
174
|
-
return ""
|
|
175
|
-
} catch (error) {
|
|
176
|
-
return errorMessage(error)
|
|
177
|
-
}
|
|
166
|
+
// The one gate (toolkit.gateWrite): a wiki file is not a record, so a
|
|
167
|
+
// team write is asked, never held.
|
|
168
|
+
const gate = await toolkit.gateWrite(context, { action: "wiki.write", spaceContext, shared: visibility === "team", metadata: approval })
|
|
169
|
+
return gate.denied ?? ""
|
|
178
170
|
}
|
|
179
171
|
|
|
180
172
|
/**
|
package/src/util.js
CHANGED
|
@@ -78,76 +78,27 @@ export function rememberBounded(store, key, value, max = 500) {
|
|
|
78
78
|
return store
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
[
|
|
86
|
-
/\b(api[_-]?key|access[_-]?token|refresh[_-]?token|token|password|passwd|secret)\b["']?(\s*[:=]\s*)(?:"[^"\n]*"|'[^'\n]*'|[^\s,;]+)/gi,
|
|
87
|
-
"$1$2[redacted]",
|
|
88
|
-
],
|
|
89
|
-
[/\bBearer\s+[A-Za-z0-9._~+/=-]{3,}/gi, "Bearer [redacted]"],
|
|
90
|
-
[/\bsk-[A-Za-z0-9_-]{6,}/g, "[redacted-key]"],
|
|
91
|
-
[/\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{8,}\b/g, "[redacted-token]"],
|
|
92
|
-
])
|
|
93
|
-
|
|
94
|
-
/** Redact values that look like credentials. Used on every text this plugin stores or logs. */
|
|
95
|
-
export function redactSecrets(value) {
|
|
96
|
-
let text = String(value ?? "")
|
|
97
|
-
for (const [pattern, replacement] of SECRET_PATTERNS) text = text.replace(pattern, replacement)
|
|
98
|
-
return text
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Absolute local paths: they name the user and the machine, and are wrong on
|
|
102
|
-
// every other one. The derived core applies the same rules to L1 output
|
|
103
|
-
// (opencode-mem-deploy build/core/memory-redact.ts); test/fixtures/
|
|
104
|
-
// redaction-vectors.json is shared by both, so keep them in step.
|
|
105
|
-
const PATH_SEGMENT = String.raw`[^\s/\\"'\x60<>|()\[\]{},;]+`
|
|
106
|
-
const LOCAL_PATHS = Object.freeze([
|
|
107
|
-
// POSIX: home and machine-local roots, optionally as a file:// url.
|
|
108
|
-
new RegExp(
|
|
109
|
-
String.raw`(?<![\w.~/\\-])(?:file://)?/(?:Users|home|root|private|var|tmp|Volumes|mnt|media|srv)(?:/${PATH_SEGMENT})+/?`,
|
|
110
|
-
"g",
|
|
111
|
-
),
|
|
112
|
-
// The home directory as ~.
|
|
113
|
-
new RegExp(String.raw`(?<![\w.~/\\-])~(?:/${PATH_SEGMENT})+/?`, "g"),
|
|
114
|
-
// Windows: a drive or a UNC share, with \ or / (or JSON's \\) between parts.
|
|
115
|
-
new RegExp(String.raw`(?<![\w.~/\\-])(?:[A-Za-z]:|\\\\${PATH_SEGMENT})(?:[\\/]+${PATH_SEGMENT})+[\\/]*`, "g"),
|
|
116
|
-
])
|
|
117
|
-
|
|
118
|
-
/** `<path>/<last part>`, or `<path>` when the last part is a user's name. */
|
|
119
|
-
function neutralPath(match) {
|
|
120
|
-
const trail = /[.,:;!?]+$/.exec(match)?.[0] ?? ""
|
|
121
|
-
const body = match.slice(0, match.length - trail.length).replace(/^file:\/\//, "")
|
|
122
|
-
const parts = body.split(/[\\/]+/).filter(Boolean)
|
|
123
|
-
const last = parts.at(-1)
|
|
124
|
-
const before = parts.at(-2)
|
|
125
|
-
const named = parts.length >= 2 && last && !/^(?:users|home)$/i.test(before ?? "") && !/^[A-Za-z]:$/.test(last)
|
|
126
|
-
return `${named ? `<path>/${last}` : "<path>"}${trail}`
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Replace absolute local paths (macOS, Linux, Windows, `~`) with a neutral
|
|
131
|
-
* placeholder that keeps the file name: a macOS home path to `app.ts` becomes
|
|
132
|
-
* `<path>/app.ts`. Used on captured turns before they leave this process.
|
|
133
|
-
*/
|
|
134
|
-
export function redactLocalPaths(value) {
|
|
135
|
-
let text = String(value ?? "")
|
|
136
|
-
for (const pattern of LOCAL_PATHS) text = text.replace(pattern, neutralPath)
|
|
137
|
-
return text
|
|
138
|
-
}
|
|
81
|
+
// The redaction rules live in storable.js, with the decision of what may be
|
|
82
|
+
// stored (owner decision D3); the logger, ask excerpts and the redaction
|
|
83
|
+
// vectors use them from here.
|
|
84
|
+
export { redactLocalPaths, redactSecrets } from "./storable.js"
|
|
139
85
|
|
|
140
86
|
/**
|
|
141
87
|
* One line describing the capture spool: pending depth, quarantined entries,
|
|
142
88
|
* claims in flight, and the age of the oldest pending entry.
|
|
143
89
|
*
|
|
144
|
-
* @param {{ pending?: number, quarantined?: number, inflight?: number, oldest?: string | null } | number} stats
|
|
90
|
+
* @param {{ pending?: number, quarantined?: number, inflight?: number, oldest?: string | null, reasons?: { reason: string, expires: string }[], quarantineDays?: number } | number} stats
|
|
145
91
|
*/
|
|
146
92
|
export function describeSpool(stats) {
|
|
147
93
|
if (typeof stats === "number") return `${stats} pending`
|
|
148
94
|
const parts = [`${stats?.pending ?? 0} pending`, `${stats?.quarantined ?? 0} quarantined`]
|
|
149
95
|
if (stats?.inflight) parts.push(`${stats.inflight} in flight`)
|
|
150
96
|
if (stats?.pending && stats?.oldest) parts.push(`oldest ${stats.oldest}`)
|
|
97
|
+
// A quarantined capture was refused or gave up; say why, and when it goes.
|
|
98
|
+
const newest = Array.isArray(stats?.reasons) ? stats.reasons[0] : null
|
|
99
|
+
if (stats?.quarantined && newest) {
|
|
100
|
+
parts.push(`latest quarantine: ${newest.reason} (deleted ${String(newest.expires).slice(0, 10)}; quarantined captures are kept ${stats.quarantineDays ?? 14} days)`)
|
|
101
|
+
}
|
|
151
102
|
return parts.join(", ")
|
|
152
103
|
}
|
|
153
104
|
|
package/src/views/profile.js
CHANGED
|
@@ -34,9 +34,8 @@ const LEFT_OUT = "Some of what Memory holds about you is not shown here, to keep
|
|
|
34
34
|
* `notes` and `incomplete` is set; only when nothing could be read at all is
|
|
35
35
|
* the call a refusal, never an empty profile that looks like "nothing held".
|
|
36
36
|
*
|
|
37
|
-
* It only reads. Erasing
|
|
38
|
-
*
|
|
39
|
-
* scenarios under the person's own permission ask.
|
|
37
|
+
* It only reads. Erasing a phrase, with a preview, is the console's Profile
|
|
38
|
+
* page (deploy/auth/console/profile-area.mjs).
|
|
40
39
|
*
|
|
41
40
|
* @param {{ runtime: any, personalScopes: () => Promise<Array<{ context: any, scope: any }>>, available: () => Promise<void>, describe: (error: unknown) => string }} input
|
|
42
41
|
*/
|