@notis_ai/cli 0.2.29 → 0.2.30

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.
Files changed (64) hide show
  1. package/README.md +25 -8
  2. package/dist/agent-hooks/notis-agent-hook.mjs +1030 -610
  3. package/dist/base-skills/notis-cli/.notis-base-skill.json +1 -1
  4. package/dist/base-skills/notis-cli/SKILL.md +11 -0
  5. package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -1
  6. package/dist/base-skills/notis-spaces/references/release.md +6 -5
  7. package/dist/base-skills/notis-spaces/references/sdk.md +82 -17
  8. package/dist/sdk/src/hooks/useThreadItem.ts +56 -0
  9. package/dist/sdk/src/index.ts +6 -1
  10. package/dist/sdk/src/runtime.ts +8 -1
  11. package/dist/sdk/src/space.ts +230 -0
  12. package/dist/skill-sync-worker.mjs +185 -30
  13. package/dist/space-harness/host.js +237 -93
  14. package/dist/space-sdk/dist/{chunk-BFGB6XXC.js → chunk-6GJ2BS7B.js} +1 -3
  15. package/dist/space-sdk/dist/index.js +4 -2
  16. package/dist/space-sdk/dist/ui.js +18 -13
  17. package/dist/space-sdk/src/hooks/useThreadItem.d.ts +28 -0
  18. package/dist/space-sdk/src/index.d.ts +3 -1
  19. package/dist/space-sdk/src/runtime.d.ts +8 -1
  20. package/dist/space-sdk/src/space.ts +230 -0
  21. package/dist/space-sdk/src/tailwind-candidates.d.ts +492 -14
  22. package/dist/space-sdk/src/ui/actions/useToast.d.ts +2 -0
  23. package/dist/space-sdk/src/ui/comments/CommentPane.d.ts +56 -10
  24. package/dist/space-sdk/src/ui/comments/PassageComments.d.ts +16 -7
  25. package/dist/space-sdk/src/ui/comments/agentRuntime.d.ts +59 -0
  26. package/dist/space-sdk/src/ui/comments/commentFiles.d.ts +5 -2
  27. package/dist/space-sdk/src/ui/comments/commentModel.d.ts +103 -8
  28. package/dist/space-sdk/src/ui/comments/commentWords.d.ts +82 -0
  29. package/dist/space-sdk/src/ui/comments/hostComments.d.ts +37 -0
  30. package/dist/space-sdk/src/ui/comments/index.d.ts +4 -0
  31. package/dist/space-sdk/src/ui/comments/paneParts.d.ts +119 -0
  32. package/dist/space-sdk/src/ui/comments/useCommentRouting.d.ts +75 -0
  33. package/dist/space-sdk/src/ui/comments/useComments.d.ts +147 -15
  34. package/dist/space-sdk/src/ui/comments/usePassageComments.d.ts +24 -8
  35. package/dist/space-sdk/src/ui/index.d.ts +2 -1
  36. package/dist/space-sdk/src/ui/layout/SidePane.d.ts +6 -1
  37. package/dist/space-sdk/src/ui/overlay/Tooltip.d.ts +8 -2
  38. package/dist/space-sdk/src/ui/styles.d.ts +27 -5
  39. package/dist/view-renderer/dist/host.js +307 -163
  40. package/dist/view-renderer/src/host.tsx +6 -3
  41. package/dist/view-renderer/src/renderer.js +25 -2
  42. package/package.json +3 -3
  43. package/skills/notis-cli/AGENT_INSTRUCTIONS.md +2 -1
  44. package/skills/notis-spaces/cli.md +8 -8
  45. package/src/cli.js +10 -2
  46. package/src/command-specs/computer.js +21 -1
  47. package/src/command-specs/profile.js +12 -5
  48. package/src/command-specs/spaces.js +30 -16
  49. package/src/runtime/agent-identity.js +187 -0
  50. package/src/runtime/api-hosts.js +92 -0
  51. package/src/runtime/channel.js +3 -7
  52. package/src/runtime/oauth.js +95 -4
  53. package/src/runtime/profiles.js +200 -41
  54. package/src/runtime/skill-sync-service.js +4 -5
  55. package/src/runtime/space-platform.js +2 -0
  56. package/src/runtime/space-source.js +66 -1
  57. package/src/runtime/space-test-server.js +20 -4
  58. package/src/runtime/space-verification.js +5 -1
  59. package/src/runtime/telemetry.js +14 -1
  60. package/src/runtime/transport.js +12 -0
  61. package/src/runtime/upsell.js +3 -6
  62. package/src/runtime/view-render.js +3 -1
  63. package/src/skill-sync-worker.js +13 -2
  64. package/src/space-harness-host.ts +6 -3
@@ -0,0 +1,28 @@
1
+ import type { SpaceThreadItem, SpaceThreadItemRun } from '../space';
2
+ export interface UseThreadItemResult {
3
+ /** The attached item this page draws, or null while reading or when the page is not opened for one. */
4
+ item: SpaceThreadItem | null;
5
+ loading: boolean;
6
+ error: Error | null;
7
+ /**
8
+ * Run one of the item's actions (its `actions[].id`). Notis asks the person first when the action
9
+ * confirms, then reads the item again; `ran` is false when they cancelled. Resolves `{ ran: false }`
10
+ * on hosts that cannot run actions.
11
+ */
12
+ run: (actionId: string) => Promise<SpaceThreadItemRun>;
13
+ /** False outside a thread's panel and on hosts without thread items (Sites, links, the dev harness). */
14
+ available: boolean;
15
+ refresh: () => Promise<Error | null>;
16
+ }
17
+ /**
18
+ * The live item (a pull request, an order) a thread's panel shows on this page, from the view's
19
+ * `threadItems` declaration. Notis keeps it fresh; the page reads it again about every minute.
20
+ *
21
+ * ```tsx
22
+ * const { item, run } = useThreadItem();
23
+ * if (!item) return null;
24
+ * return <>{item.title} {item.actions.map(action =>
25
+ * <Button key={action.id} onClick={() => void run(action.id)}>{text(action.label)}</Button>)}</>;
26
+ * ```
27
+ */
28
+ export declare function useThreadItem(): UseThreadItemResult;
@@ -26,7 +26,7 @@ export { SPACE_CLOUD_COMPUTER_OPERATIONS, spaceCloudComputerAllows } from './spa
26
26
  export { spaceCloudComputerAccess } from './space';
27
27
  export type { SpaceCloudComputerLevel, SpaceCloudComputerOperation, SpaceCloudComputerStatus, SpaceCloudComputerRelease, SpaceCloudComputerRunInput, SpaceCloudComputerRunResult, SpaceCloudComputerUploadInput, SpaceCloudComputerUploadResult, SpaceCloudComputerTransport, SpaceCloudComputerDeclaration, SpaceCloudComputerService, SpaceCloudComputerJobOperation, SpaceCloudComputerJobInput, SpaceCloudComputerJobStatus, SpaceCloudComputerJobLogs, SpaceCloudComputerJobResult, SpaceCloudComputerLeaseInput, SpaceCloudComputerLeaseResult, SpaceCloudComputerFolder, JobState, SpaceCloudComputerAccessInput, SpaceCloudComputerAccessResult, SpaceCloudComputerMediaLink, SpaceCloudComputerFrameCode, SpaceCloudComputerTransferOperation, SpaceCloudComputerFileUpload, SpaceCloudComputerUploadProgress, SpaceCloudComputerFileUploadResult, SpaceCloudComputerImportInput, SpaceCloudComputerImportResult } from './space';
28
28
  export type { SpaceViewerReadFamily, SpaceViewerReadOperation, SpaceViewerReadInput, SpaceViewerReadResult, SpaceViewerLink, SpaceViewerDatabase, SpaceViewerDatabaseSchema, SpaceViewerSkill, SpaceViewerSkillPage } from './space';
29
- export type { SpaceAgentDeclaration, SpaceItemThread, SpaceAgentQueue, SpaceAgentsStatus, SpaceThreadsTransport } from './space';
29
+ export type { SpaceAgentDeclaration, SpaceItemThread, SpaceAgentQueue, SpaceAgentsStatus, SpaceThreadsTransport, SpaceThreadItemText, SpaceThreadItemCondition, SpaceThreadItemState, SpaceThreadItemConfirm, SpaceThreadItemAction, SpaceThreadItemKind, SpaceThreadItem, SpaceThreadItemRun, SpaceThreadItemTransport, SpaceCommentSource, SpaceCommentsTransport, SpaceCommentViewer, SpaceCommentThreadRef, SpaceCommentThreadPick } from './space';
30
30
  export { SpaceActionError, SpaceNavigationCancelled, isSpaceNavigationCancelled } from './space';
31
31
  export { spaceAudience, spaceMarksEditorsOnly, publicSpaceDescriptor, withoutEditorColumns } from './space';
32
32
  export type { SpaceAudience, SpaceEditorsOnly, SpaceResourceColumns, EditorOnlyColumns, AudienceRow } from './space';
@@ -59,6 +59,8 @@ export { useCloudComputer } from './hooks/useCloudComputer';
59
59
  export type { UseCloudComputerResult } from './hooks/useCloudComputer';
60
60
  export { useItemThread } from './hooks/useItemThread';
61
61
  export type { UseItemThreadResult } from './hooks/useItemThread';
62
+ export { useThreadItem } from './hooks/useThreadItem';
63
+ export type { UseThreadItemResult } from './hooks/useThreadItem';
62
64
  export { useAgentQueue, AGENT_QUEUE_WORDS } from './hooks/useAgentQueue';
63
65
  export type { UseAgentQueueResult, AgentQueueStatus } from './hooks/useAgentQueue';
64
66
  export { useCloudComputerShell } from './hooks/useCloudComputerShell';
@@ -10,7 +10,7 @@ import type { AgentContextContent, AgentContextItem, AgentContextSource } from '
10
10
  import type { ComponentType, ReactNode } from 'react';
11
11
  import type { NotisQueryClient } from './queryCache';
12
12
  import type { NotisSpaceSkeleton } from './skeleton';
13
- import type { SpaceRuntimeDescriptor, SpaceActionOptions, SpaceDocumentBodyRequest, SpaceDocumentBodyResult, SpaceViewerReadOperation, SpaceShownOptions, SpaceCloudComputerTransport, SpaceFilesTransport, SpaceThreadsTransport } from './space';
13
+ import type { SpaceRuntimeDescriptor, SpaceActionOptions, SpaceDocumentBodyRequest, SpaceDocumentBodyResult, SpaceViewerReadOperation, SpaceShownOptions, SpaceCloudComputerTransport, SpaceFilesTransport, SpaceThreadsTransport, SpaceThreadItemTransport, SpaceCommentsTransport } from './space';
14
14
  export type DatabasePropertyType = 'title' | 'rich_text' | 'text' | 'number' | 'checkbox' | 'date' | 'select' | 'multi_select' | 'status' | 'relation' | 'formula' | 'files' | 'secret';
15
15
  /**
16
16
  * The value of a `secret` property. The platform stores a pointer to a
@@ -580,6 +580,13 @@ export interface NotisRuntime {
580
580
  * older hosts.
581
581
  */
582
582
  spaceThreads?: SpaceThreadsTransport;
583
+ /** The thread item a page draws in a thread's panel, and its actions. Signed-in Portal viewers only. */
584
+ spaceThreadItem?: SpaceThreadItemTransport;
585
+ /**
586
+ * Space-only host Comments panel: comment controllers attach here and the host lists and answers their threads beside
587
+ * the chat. Absent while comments are off for the viewer, on Sites, links, previews and older hosts.
588
+ */
589
+ spaceComments?: SpaceCommentsTransport;
583
590
  /** Authenticated runtime identity; app below is presentation metadata only. */
584
591
  resource?: RuntimeResource;
585
592
  /** Optional host-scoped in-memory read cache. Older hosts remain supported. */
@@ -80,6 +80,222 @@ export interface SpaceThreadsTransport {
80
80
  agentStatus(agentId: string, scope?: string): Promise<SpaceAgentsStatus>;
81
81
  approveAgents(): Promise<{ approved: boolean; released: number }>;
82
82
  }
83
+
84
+ /** Words shown to people: one string, or one per language (`en` required). */
85
+ export type SpaceThreadItemText = string | { en: string; fr?: string };
86
+ /**
87
+ * A condition on the item's last read. `path` starts with `data.` (the read action's answer) or `item.`
88
+ * (the attached inputs); `*` in a path flattens a list, and a condition on a list matches when any value does.
89
+ */
90
+ export type SpaceThreadItemCondition =
91
+ | { path: string; equals: string | number | boolean | null }
92
+ | { path: string; in: Array<string | number | boolean | null> }
93
+ | { path: string; exists: boolean }
94
+ | { all: SpaceThreadItemCondition[] }
95
+ | { any: SpaceThreadItemCondition[] }
96
+ | { not: SpaceThreadItemCondition };
97
+ /** One state of a kind. States are tried in order; the first whose `when` matches wins, and the last has no `when`. */
98
+ export interface SpaceThreadItemState {
99
+ id: string;
100
+ label: SpaceThreadItemText;
101
+ /** `phosphor:<kebab-name>`, shown on the panel and on the thread's row. */
102
+ icon: string;
103
+ when?: SpaceThreadItemCondition;
104
+ /** Reaching this state opens the panel and brings the thread back to the inbox, unread. */
105
+ needsYou?: boolean;
106
+ /** Notis stops reading an item in a final state (merged, closed). Never also `needsYou`. */
107
+ final?: boolean;
108
+ }
109
+ /**
110
+ * A confirmation asked once, in a Notis dialog, before the action runs. Templates like `{item.number}` apply.
111
+ * A plain string is the title. In two languages, give each part as `{ en, fr }` (SPC-289):
112
+ * `{ title: { en, fr } }`, never the whole confirmation as `{ en, fr }`.
113
+ */
114
+ export type SpaceThreadItemConfirm = string
115
+ | { title: SpaceThreadItemText; body?: SpaceThreadItemText; button?: SpaceThreadItemText };
116
+ /** A button on the item, run with the person's own connection to the tool's app. */
117
+ export interface SpaceThreadItemAction {
118
+ label: SpaceThreadItemText;
119
+ /** A connected app tool, such as `GITHUB_MERGE_A_PULL_REQUEST`. */
120
+ tool: string;
121
+ /** Templated arguments: a whole-string placeholder such as `'{item.number}'` keeps its type. */
122
+ arguments?: Record<string, unknown>;
123
+ confirm?: SpaceThreadItemConfirm;
124
+ /** The states it is offered in; every state that is not final when omitted. */
125
+ states?: string[];
126
+ primary?: boolean;
127
+ }
128
+ /**
129
+ * A kind of live item agents attach to a thread (`LOCAL_NOTIS_THREAD_ITEMS`), such as a pull request.
130
+ * Notis reads it through `read.action`, about every minute while the thread is open and every 15 minutes
131
+ * otherwise, until a final state. Declare it on the Space's root view:
132
+ *
133
+ * ```ts
134
+ * threadItems: { pull_request: {
135
+ * label: 'Pull request',
136
+ * inputs: { type: 'object', additionalProperties: false, required: ['owner', 'repo', 'number'],
137
+ * properties: { owner: { type: 'string' }, repo: { type: 'string' }, number: { type: 'integer' } } },
138
+ * read: { action: 'read_pull_request' },
139
+ * title: '#{item.number} {data.title}',
140
+ * states: [
141
+ * { id: 'merged', when: { path: 'data.merged', equals: true }, icon: 'phosphor:git-merge', label: 'Merged', final: true },
142
+ * { id: 'ready', icon: 'phosphor:git-pull-request', label: 'Ready to merge', needsYou: true },
143
+ * ],
144
+ * actions: { merge: { label: 'Merge', tool: 'GITHUB_MERGE_A_PULL_REQUEST', primary: true,
145
+ * arguments: { owner: '{item.owner}', repo: '{item.repo}', pull_number: '{item.number}' },
146
+ * confirm: { title: 'Merge #{item.number}?', button: 'Merge' } } },
147
+ * page: { params: { pr: '{item.number}' } },
148
+ * } }
149
+ * ```
150
+ */
151
+ export interface SpaceThreadItemKind {
152
+ label: SpaceThreadItemText;
153
+ description?: string;
154
+ /** A closed object schema of scalar fields: what an agent gives to attach one item. */
155
+ inputs: { type: 'object'; properties: Record<string, Record<string, unknown>>; required?: string[]; additionalProperties: false };
156
+ /** A read action of this view; its inputs default to the item's inputs by name. */
157
+ read: { action: string; inputs?: Record<string, unknown> };
158
+ title: string;
159
+ /** An https link to the item where it lives ("Open on GitHub"). */
160
+ url?: string;
161
+ states: SpaceThreadItemState[];
162
+ /** Summarises a list of checks into "2 of 9 failing": the latest run per `name` counts. */
163
+ checks?: { list: string; name: string; state: string; passed: string[]; failed: string[] };
164
+ actions?: Record<string, SpaceThreadItemAction>;
165
+ /** This view draws the item in the thread's panel; it receives these params plus the item through `useThreadItem`. */
166
+ page?: { params?: Record<string, string> };
167
+ }
168
+ /** An attached item as Notis last read it. */
169
+ export interface SpaceThreadItem {
170
+ id: string;
171
+ kind: string;
172
+ kind_label?: SpaceThreadItemText | null;
173
+ thread_id: string;
174
+ space_id: string;
175
+ space?: { id: string; name: string | null; icon: string | null; has_page: boolean };
176
+ inputs: Record<string, unknown>;
177
+ state: string | null;
178
+ state_label: SpaceThreadItemText | null;
179
+ icon: string | null;
180
+ needs_you: boolean;
181
+ final: boolean;
182
+ title: string;
183
+ url: string | null;
184
+ checks: { total: number; passed: number; failed: number; running: number } | null;
185
+ /** The actions offered in the current state. */
186
+ /** `fingerprint` names the exact declaration shown; a confirmed run sends it back so a changed one is refused. */
187
+ actions: Array<{ id: string; label: SpaceThreadItemText; primary: boolean;
188
+ confirm?: { title: SpaceThreadItemText; body?: SpaceThreadItemText; button?: SpaceThreadItemText };
189
+ fingerprint?: string }>;
190
+ /** The kind's `page.params`, filled in for this item. */
191
+ page_params?: Record<string, unknown> | null;
192
+ /** The read action's last answer (only on the item a page draws). */
193
+ data?: unknown;
194
+ attached_at?: string | null;
195
+ refreshed_at: string | null;
196
+ /** The code of the last failed read, kept until a read succeeds. */
197
+ error: string | null;
198
+ }
199
+ export interface SpaceThreadItemRun {
200
+ /** False when the person cancelled the confirmation or the host cannot run actions. */
201
+ ran: boolean;
202
+ successful?: boolean;
203
+ error?: string | null;
204
+ item?: SpaceThreadItem;
205
+ }
206
+ /** Space-only transport of the item a thread's panel shows (`useThreadItem`). */
207
+ export interface SpaceThreadItemTransport {
208
+ /** The item this page draws, or null when the page is not opened for one. */
209
+ current(): Promise<SpaceThreadItem | null>;
210
+ /** Run one of the item's actions; the host asks the person first when the action confirms. */
211
+ run(itemId: string, actionId: string): Promise<SpaceThreadItemRun>;
212
+ }
213
+ /**
214
+ * A Space's comments as the host Comments panel reads them: one comment controller of the view (a `CommentController`
215
+ * from `useComments`, or a `PassageCommentController` from `usePassageComments` for kind 'passage'), with the options its
216
+ * pane was given. The host reads `current()` again after each `subscribe` call-back.
217
+ *
218
+ * `revealRequest` (the controller's, 0 at first) goes up by one each time the person picks a comment on the page (a pin,
219
+ * a highlight, a key on the page): the host opens its Comments panel, on Comments, at each increase. Picking a comment
220
+ * inside the panel leaves it as it is. The source object stays the same for the life of the pane, whatever transport
221
+ * object the host hands later.
222
+ */
223
+ export interface SpaceCommentSource {
224
+ readonly kind: 'pins' | 'passage';
225
+ current(): { controller: unknown; options: Readonly<Record<string, unknown>>; revealRequest?: number };
226
+ subscribe(listener: () => void): () => void;
227
+ /**
228
+ * The host hands the element of its Comments panel the source draws its threads in (inside a shadow root carrying
229
+ * the toolkit styles), or null when the panel is closed, shows Chat or shows another source.
230
+ */
231
+ show(target: HTMLElement | null): void;
232
+ }
233
+ /**
234
+ * Space-only host Comments panel: the comment threads of the page sit in the host's right panel, beside the chat,
235
+ * instead of a pane inside the Space. Absent while comments are off for the viewer, on Sites, links, previews and
236
+ * older hosts: a Space then shows no comments at all (no pane, no pins, no highlights).
237
+ */
238
+ export interface SpaceCommentsTransport {
239
+ /** Lists a source in the Comments panel until the returned call-back runs. */
240
+ attach(source: SpaceCommentSource): () => void;
241
+ /**
242
+ * The signed-in viewer: their name (the Author they write as; the server stamps it too) and whether they may edit
243
+ * the Space. Undefined while it is not known yet: comments cannot be sent until it is.
244
+ */
245
+ viewer?: SpaceCommentViewer;
246
+ /**
247
+ * The manager threads each comment thread is linked to (1..n, SPC-113), by root record key, for the comment database
248
+ * alias. The first one is where a reply goes ("Goes to"). A root missing from the answer has no link yet.
249
+ */
250
+ links?(input: { database: string; rootKeys: readonly string[] }): Promise<Record<string, SpaceCommentThreadRef[]>>;
251
+ /** The best-match thread for a new comment on this page (THR-024), the one the chat suggests; null starts a new one. */
252
+ bestMatch?(input: { recordKey?: string | null }): Promise<SpaceCommentThreadRef | null>;
253
+ /**
254
+ * Opens the host @ thread picker (chips All, Threads, Harness, People, Spaces; SPC-119) under `anchor`. Resolves with
255
+ * the pick, `{ newThread: harness }` for a "New Claude thread" style row, or null when dismissed.
256
+ */
257
+ pickThread?(input: { anchor: HTMLElement; current?: string | null; query?: string }): Promise<SpaceCommentThreadPick | null>;
258
+ /**
259
+ * Links a comment thread to a manager thread: after its first comment is saved (the To chip's thread), on Change, or
260
+ * when a reply @-mentions another thread (`primary: false` adds it). Resolves with the thread replies now go to.
261
+ */
262
+ link?(input: { database: string; rootKey: string; pick: SpaceCommentThreadPick; primary?: boolean }): Promise<SpaceCommentThreadRef | null>;
263
+ /** Opens a manager thread in the chat (the panel switches to Chat). */
264
+ openThread?(threadId: string): void;
265
+ /**
266
+ * The link that opens this Space page with one comment thread revealed (`comment=<root key>`, the link a push or a
267
+ * chat pill opens), as a full address another person can open: Copy link on a thread card copies it. Null when the
268
+ * page has no shareable address. Without it the pane copies the page's own address with that param. `database` is
269
+ * the comments database (its alias): the host may answer later (a promise) with the thread's own page in the link,
270
+ * wherever the pane is (the Space home, another page).
271
+ */
272
+ commentLink?(input: { rootKey: string; database?: string }): string | null | Promise<string | null>;
273
+ /**
274
+ * Shows the page under the Comments panel (SPC-132): called when a point, box, items or time mode starts on a narrow
275
+ * screen (under 768px wide), where the full-screen panel covers the page. The host closes its full-screen panel; the
276
+ * page tool bar shows the mode's hint, and the panel opens again when the new comment starts. A host whose panel
277
+ * does not cover the page ignores it.
278
+ */
279
+ showPage?(): void;
280
+ }
281
+ /**
282
+ * The viewer as comments see them. `id` (their user id), when the host gives it, tells their comments by the row's
283
+ * creator (`created_by`) instead of the Author name, so a renamed person keeps Edit and Delete on their comments.
284
+ */
285
+ export interface SpaceCommentViewer { name: string; canEditSpace: boolean; id?: string | null }
286
+ /**
287
+ * A manager thread a comment thread is linked to. `subagent` names the subagent a reply goes back to, when one wrote it.
288
+ * `threadId: null` with `status: 'pending'` is a "New <harness> thread" pick not started yet: the first wake
289
+ * starts it.
290
+ */
291
+ export interface SpaceCommentThreadRef {
292
+ threadId: string | null;
293
+ title: string;
294
+ harness?: string | null;
295
+ status?: string | null;
296
+ subagent?: string | null;
297
+ }
298
+ export type SpaceCommentThreadPick = SpaceCommentThreadRef | { newThread: string };
83
299
  /**
84
300
  * A long-running program the Space keeps up on the viewer's cloud computer while the page is on screen (a dev
85
301
  * server, a media server). It runs with `bash -lc`, listens on `127.0.0.1:$PORT`, and gets `HOST`,
@@ -537,6 +753,11 @@ export interface SpaceDefinition {
537
753
  * moment, once that person allowed this Space's agents. Agents' own writes never wake anything.
538
754
  */
539
755
  agents?: SpaceAgentDeclaration[];
756
+ /**
757
+ * Kinds of live items agents attach to a thread (truth SPC-093), shown docked on the thread's composer
758
+ * with their state and actions. Declared on the view whose `actions` hold each kind's read action.
759
+ */
760
+ threadItems?: Record<string, SpaceThreadItemKind>;
540
761
  /**
541
762
  * Lists the database's records as sidebar rows under this Space. Only for a short list people navigate
542
763
  * like pages (folders, chapters); a database that keeps growing belongs in the view's `shows` instead.
@@ -644,6 +865,15 @@ export interface SpaceActionOptions {
644
865
  * answer a moment later. Hosts that predate it ignore it.
645
866
  */
646
867
  fresh?: boolean;
868
+ /**
869
+ * A read that accepts an answer up to this many seconds old (1 to 300): a signed-in host answers it with the
870
+ * person's own result of that exact read from that window, checked like a last result (same sign-in, no write
871
+ * since), and asks the provider only when there is none. For data that changes slowly, such as a health board's
872
+ * provider reads, so a page opened again soon after costs the provider nothing. Pass it to `useAction(id).call`
873
+ * (or `callAction`); a `useActionQuery` read already opens on its last result. The host caps it at 300 and ignores
874
+ * it below 1, with `fresh` or `requestId`, and for Site or link visitors; hosts that predate it ignore it.
875
+ */
876
+ maxAgeSeconds?: number;
647
877
  }
648
878
 
649
879
  export type SpaceDocumentBodyRequest = {