@composable-os/pack-knowledge 0.1.0-beta.12 → 0.1.0-beta.14

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.
@@ -1,4 +1,14 @@
1
- export declare const reviewDue: any;
1
+ export declare const reviewDue: import("@composable-os/sdk").AutomationSpec<{
2
+ readonly type: "dateRelative";
3
+ readonly object: "knowledge.procedure";
4
+ readonly field: "nextReview";
5
+ readonly offsetDays: 0;
6
+ }>;
2
7
  export declare const knowledgeAutomations: {
3
- reviewDue: any;
8
+ reviewDue: import("@composable-os/sdk").AutomationSpec<{
9
+ readonly type: "dateRelative";
10
+ readonly object: "knowledge.procedure";
11
+ readonly field: "nextReview";
12
+ readonly offsetDays: 0;
13
+ }>;
4
14
  };
@@ -142,35 +142,327 @@ export declare const KNOWLEDGE_HOOKS_CALL: {
142
142
  export declare function createKnowledgeHooks<C extends ClientHolding>(react: {
143
143
  useQuery: UseQuery;
144
144
  useMutation: UseMutation;
145
- }, client: C): any;
145
+ }, client: C): import("@composable-os/client").HooksFor<{
146
+ /** Staff: a page of published procedures (by section, or as asked). */
147
+ useProcedures(input?: Omit<In<"content.staffList">, "object">): {
148
+ data: Page<Published> | undefined;
149
+ isPending: boolean;
150
+ error: unknown;
151
+ refetch?: () => unknown;
152
+ };
153
+ /** Staff: one procedure as published, by id or address. */
154
+ useProcedure(by: {
155
+ id: string;
156
+ } | {
157
+ slug: string;
158
+ } | null): {
159
+ data: (Published & {
160
+ redirect?: string;
161
+ }) | undefined;
162
+ isPending: boolean;
163
+ error: unknown;
164
+ refetch?: () => unknown;
165
+ };
166
+ /** Staff: procedures whose published words match, each with its section's anchor. */
167
+ useSearchProcedures(q: string): {
168
+ data: Page<SearchHit> | undefined;
169
+ isPending: boolean;
170
+ error: unknown;
171
+ refetch?: () => unknown;
172
+ };
173
+ /** Staff: what I must read, and what I confirmed. */
174
+ useToRead(): {
175
+ data: {
176
+ toRead: {
177
+ id: string;
178
+ title: string | null;
179
+ version: number;
180
+ publishedAt: string;
181
+ since: string;
182
+ }[];
183
+ confirmed: {
184
+ id: string;
185
+ title: string | null;
186
+ version: number;
187
+ publishedAt: string;
188
+ confirmedAt: string;
189
+ }[];
190
+ } | undefined;
191
+ isPending: boolean;
192
+ error: unknown;
193
+ refetch?: () => unknown;
194
+ };
195
+ /** Staff: "I have read and understood this", for the version read. */
196
+ useConfirm(): {
197
+ mutate(input: {
198
+ id: string;
199
+ version: number;
200
+ }): void;
201
+ mutateAsync(input: {
202
+ id: string;
203
+ version: number;
204
+ }): Promise<{
205
+ id: string;
206
+ version: number;
207
+ confirmedAt: string;
208
+ }>;
209
+ data: {
210
+ id: string;
211
+ version: number;
212
+ confirmedAt: string;
213
+ } | undefined;
214
+ isPending: boolean;
215
+ error: unknown;
216
+ reset?: () => void;
217
+ };
218
+ /** Those who manage: who has read what (one procedure, or every one's counts). */
219
+ useReadStatus(id?: string): {
220
+ data: {
221
+ procedures: {
222
+ id: string;
223
+ title: string | null;
224
+ version: number;
225
+ publishedAt: string;
226
+ mustRead: number;
227
+ confirmed: number;
228
+ }[];
229
+ procedure: {
230
+ id: string;
231
+ title: string | null;
232
+ version: number;
233
+ publishedAt: string;
234
+ everyone: boolean;
235
+ roles: string[];
236
+ people: {
237
+ account: string;
238
+ name: string;
239
+ email: string;
240
+ confirmed: {
241
+ version: number;
242
+ confirmedAt: string;
243
+ } | null;
244
+ lastConfirmed: {
245
+ version: number;
246
+ confirmedAt: string;
247
+ } | null;
248
+ since: string | null;
249
+ }[];
250
+ } | null;
251
+ } | undefined;
252
+ isPending: boolean;
253
+ error: unknown;
254
+ refetch?: () => unknown;
255
+ };
256
+ /** Anyone: the help topics, in their order. */
257
+ useHelpTopics(): {
258
+ data: {
259
+ topics: {
260
+ id: string;
261
+ name: string | null;
262
+ slug: string | null;
263
+ order: number | null;
264
+ icon: string | null;
265
+ }[];
266
+ } | undefined;
267
+ isPending: boolean;
268
+ error: unknown;
269
+ refetch?: () => unknown;
270
+ };
271
+ /** Anyone: a page of published help pages (a topic's, or as asked). */
272
+ useHelpPages(input?: Omit<In<"content.list">, "object">): {
273
+ data: Page<Published> | undefined;
274
+ isPending: boolean;
275
+ error: unknown;
276
+ refetch?: () => unknown;
277
+ };
278
+ /** Anyone: one published help page by its address; an old address answers `redirect`. */
279
+ useHelpPage(slug: string | null): {
280
+ data: (Published & {
281
+ kind: "record";
282
+ }) | {
283
+ kind: "redirect";
284
+ object: string;
285
+ slug: string;
286
+ } | undefined;
287
+ isPending: boolean;
288
+ error: unknown;
289
+ refetch?: () => unknown;
290
+ };
291
+ /** Anyone: help pages whose published words match, as the reader types. */
292
+ useSearchHelp(q: string): {
293
+ data: Page<SearchHit> | undefined;
294
+ isPending: boolean;
295
+ error: unknown;
296
+ refetch?: () => unknown;
297
+ };
298
+ }, {
299
+ readonly useProcedures: readonly ["content.staffList"];
300
+ readonly useProcedure: readonly ["content.staffGet"];
301
+ readonly useSearchProcedures: readonly ["content.search"];
302
+ readonly useToRead: readonly ["x.knowledge.toRead"];
303
+ readonly useConfirm: readonly ["x.knowledge.confirm"];
304
+ readonly useReadStatus: readonly ["x.knowledge.readStatus"];
305
+ readonly useHelpTopics: readonly ["x.knowledge.helpTopics"];
306
+ readonly useHelpPages: readonly ["content.list"];
307
+ readonly useHelpPage: readonly ["content.get"];
308
+ readonly useSearchHelp: readonly ["content.search"];
309
+ }, import("@composable-os/client").OperationsOf<C>>;
146
310
  declare function allKnowledgeHooks(react: {
147
311
  useQuery: UseQuery;
148
312
  useMutation: UseMutation;
149
313
  }, api: KnowledgeClient): {
150
314
  /** Staff: a page of published procedures (by section, or as asked). */
151
- useProcedures(input?: Omit<In<"content.staffList">, "object">): any;
315
+ useProcedures(input?: Omit<In<"content.staffList">, "object">): {
316
+ data: Page<Published> | undefined;
317
+ isPending: boolean;
318
+ error: unknown;
319
+ refetch?: () => unknown;
320
+ };
152
321
  /** Staff: one procedure as published, by id or address. */
153
322
  useProcedure(by: {
154
323
  id: string;
155
324
  } | {
156
325
  slug: string;
157
- } | null): any;
326
+ } | null): {
327
+ data: (Published & {
328
+ redirect?: string;
329
+ }) | undefined;
330
+ isPending: boolean;
331
+ error: unknown;
332
+ refetch?: () => unknown;
333
+ };
158
334
  /** Staff: procedures whose published words match, each with its section's anchor. */
159
- useSearchProcedures(q: string): any;
335
+ useSearchProcedures(q: string): {
336
+ data: Page<SearchHit> | undefined;
337
+ isPending: boolean;
338
+ error: unknown;
339
+ refetch?: () => unknown;
340
+ };
160
341
  /** Staff: what I must read, and what I confirmed. */
161
- useToRead(): any;
342
+ useToRead(): {
343
+ data: {
344
+ toRead: {
345
+ id: string;
346
+ title: string | null;
347
+ version: number;
348
+ publishedAt: string;
349
+ since: string;
350
+ }[];
351
+ confirmed: {
352
+ id: string;
353
+ title: string | null;
354
+ version: number;
355
+ publishedAt: string;
356
+ confirmedAt: string;
357
+ }[];
358
+ } | undefined;
359
+ isPending: boolean;
360
+ error: unknown;
361
+ refetch?: () => unknown;
362
+ };
162
363
  /** Staff: "I have read and understood this", for the version read. */
163
- useConfirm(): any;
364
+ useConfirm(): {
365
+ mutate(input: {
366
+ id: string;
367
+ version: number;
368
+ }): void;
369
+ mutateAsync(input: {
370
+ id: string;
371
+ version: number;
372
+ }): Promise<{
373
+ id: string;
374
+ version: number;
375
+ confirmedAt: string;
376
+ }>;
377
+ data: {
378
+ id: string;
379
+ version: number;
380
+ confirmedAt: string;
381
+ } | undefined;
382
+ isPending: boolean;
383
+ error: unknown;
384
+ reset?: () => void;
385
+ };
164
386
  /** Those who manage: who has read what (one procedure, or every one's counts). */
165
- useReadStatus(id?: string): any;
387
+ useReadStatus(id?: string): {
388
+ data: {
389
+ procedures: {
390
+ id: string;
391
+ title: string | null;
392
+ version: number;
393
+ publishedAt: string;
394
+ mustRead: number;
395
+ confirmed: number;
396
+ }[];
397
+ procedure: {
398
+ id: string;
399
+ title: string | null;
400
+ version: number;
401
+ publishedAt: string;
402
+ everyone: boolean;
403
+ roles: string[];
404
+ people: {
405
+ account: string;
406
+ name: string;
407
+ email: string;
408
+ confirmed: {
409
+ version: number;
410
+ confirmedAt: string;
411
+ } | null;
412
+ lastConfirmed: {
413
+ version: number;
414
+ confirmedAt: string;
415
+ } | null;
416
+ since: string | null;
417
+ }[];
418
+ } | null;
419
+ } | undefined;
420
+ isPending: boolean;
421
+ error: unknown;
422
+ refetch?: () => unknown;
423
+ };
166
424
  /** Anyone: the help topics, in their order. */
167
- useHelpTopics(): any;
425
+ useHelpTopics(): {
426
+ data: {
427
+ topics: {
428
+ id: string;
429
+ name: string | null;
430
+ slug: string | null;
431
+ order: number | null;
432
+ icon: string | null;
433
+ }[];
434
+ } | undefined;
435
+ isPending: boolean;
436
+ error: unknown;
437
+ refetch?: () => unknown;
438
+ };
168
439
  /** Anyone: a page of published help pages (a topic's, or as asked). */
169
- useHelpPages(input?: Omit<In<"content.list">, "object">): any;
440
+ useHelpPages(input?: Omit<In<"content.list">, "object">): {
441
+ data: Page<Published> | undefined;
442
+ isPending: boolean;
443
+ error: unknown;
444
+ refetch?: () => unknown;
445
+ };
170
446
  /** Anyone: one published help page by its address; an old address answers `redirect`. */
171
- useHelpPage(slug: string | null): any;
447
+ useHelpPage(slug: string | null): {
448
+ data: (Published & {
449
+ kind: "record";
450
+ }) | {
451
+ kind: "redirect";
452
+ object: string;
453
+ slug: string;
454
+ } | undefined;
455
+ isPending: boolean;
456
+ error: unknown;
457
+ refetch?: () => unknown;
458
+ };
172
459
  /** Anyone: help pages whose published words match, as the reader types. */
173
- useSearchHelp(q: string): any;
460
+ useSearchHelp(q: string): {
461
+ data: Page<SearchHit> | undefined;
462
+ isPending: boolean;
463
+ error: unknown;
464
+ refetch?: () => unknown;
465
+ };
174
466
  };
175
467
  /** Every hook of this entry. A block takes the ones it calls: `Pick<KnowledgeHooks, "useToRead">`. */
176
468
  export type KnowledgeHooks = ReturnType<typeof allKnowledgeHooks>;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,453 @@
1
- declare const _default: any;
1
+ declare const _default: import("@composable-os/sdk").Extension<{
2
+ readonly id: "knowledge";
3
+ readonly version: "0.1.0";
4
+ readonly contractVersion: 1;
5
+ readonly label: "Knowledge";
6
+ readonly description: string;
7
+ readonly permissions: {
8
+ readonly operations: ["ack.mine", "ack.confirm", "ack.status", "ack.overview", "public.list", "notification.send"];
9
+ readonly modules: ["ops"];
10
+ };
11
+ readonly grantable: readonly ["knowledge:manage", "knowledge:write"];
12
+ readonly restricted: readonly ["knowledge:manage"];
13
+ readonly grantableLabels: {
14
+ readonly "knowledge:manage": "See who has read and confirmed each procedure, and change who must read one once published";
15
+ readonly "knowledge:write": "Write procedures and help pages (a person allowed to publish publishes them)";
16
+ };
17
+ readonly objects: {
18
+ readonly procedure: {
19
+ readonly label: "Procedure";
20
+ readonly plural: "Procedures";
21
+ readonly icon: "list-checks";
22
+ readonly titleField: "title";
23
+ readonly owner: "owner";
24
+ readonly description: string;
25
+ readonly navigation: "main";
26
+ readonly navigationOrder: 60;
27
+ readonly fields: {
28
+ readonly title: {
29
+ readonly type: "text";
30
+ readonly label: "Title";
31
+ readonly required: true;
32
+ };
33
+ readonly slug: {
34
+ readonly type: "slug";
35
+ readonly label: "Address";
36
+ readonly description: "How a link names the procedure. Made from the title.";
37
+ };
38
+ readonly summary: {
39
+ readonly type: "text";
40
+ readonly label: "Summary";
41
+ readonly description: "One or two sentences for lists and search results.";
42
+ };
43
+ readonly body: {
44
+ readonly type: "richText";
45
+ readonly label: "Body";
46
+ readonly description: string;
47
+ };
48
+ readonly section: {
49
+ readonly type: "relation";
50
+ readonly label: "Section";
51
+ readonly to: "knowledge.section";
52
+ };
53
+ readonly owner: {
54
+ readonly type: "user";
55
+ readonly label: "Kept right by";
56
+ readonly description: string;
57
+ };
58
+ readonly mustRead: {
59
+ readonly type: "document";
60
+ readonly label: "Must read";
61
+ readonly schema: import("@composable-os/sdk").DocumentSchema;
62
+ readonly description: string;
63
+ };
64
+ readonly reviewEvery: {
65
+ readonly type: "number";
66
+ readonly label: "Review every (months)";
67
+ readonly default: 12;
68
+ readonly min: 0;
69
+ readonly max: 120;
70
+ readonly step: 1;
71
+ readonly description: "How often its owner is asked to check it is still right. 0: never.";
72
+ };
73
+ readonly nextReview: {
74
+ readonly type: "formula";
75
+ readonly label: "Next review";
76
+ readonly description: "Its last publish plus the review period. Empty when it is never reviewed.";
77
+ readonly expression: "if(coalesce(reviewEvery, 12) > 0, dateAdd(publishedAt, coalesce(reviewEvery, 12), \"month\"), null)";
78
+ };
79
+ };
80
+ readonly indexes: readonly [readonly ["section"], readonly ["owner"]];
81
+ readonly publishable: {
82
+ readonly content: readonly ["title", "summary", "body", "section"];
83
+ readonly slug: "slug";
84
+ readonly staffRead: true;
85
+ readonly acknowledge: {
86
+ readonly who: "mustRead";
87
+ readonly manage: "knowledge:manage";
88
+ readonly managed: readonly ["reviewEvery", "owner"];
89
+ readonly owner: "owner";
90
+ readonly notices: {
91
+ readonly asked: {
92
+ readonly title: "Please read: {record}";
93
+ readonly body: string;
94
+ };
95
+ readonly reminder: {
96
+ readonly title: "Still to read: {record}";
97
+ readonly body: "Read this procedure and confirm you have read and understood it.";
98
+ readonly afterDays: 7;
99
+ };
100
+ readonly outstanding: {
101
+ readonly title: "Not yet confirmed: {record}";
102
+ };
103
+ readonly welcome: {
104
+ readonly title: "Procedures to read";
105
+ readonly body: "Welcome. Read these procedures and confirm each one:";
106
+ };
107
+ };
108
+ };
109
+ };
110
+ };
111
+ readonly section: {
112
+ readonly label: "Section";
113
+ readonly plural: "Sections";
114
+ readonly icon: "shapes";
115
+ readonly titleField: "name";
116
+ readonly navigation: "settings";
117
+ readonly description: "A group of procedures (opening and closing, safety, the front desk). Staff only.";
118
+ readonly fields: {
119
+ readonly name: {
120
+ readonly type: "text";
121
+ readonly label: "Name";
122
+ readonly required: true;
123
+ };
124
+ readonly order: {
125
+ readonly type: "number";
126
+ readonly label: "Order";
127
+ readonly step: 1;
128
+ };
129
+ };
130
+ readonly indexes: readonly [readonly ["order"]];
131
+ };
132
+ readonly helppage: {
133
+ readonly label: "Help page";
134
+ readonly plural: "Help pages";
135
+ readonly icon: "newspaper";
136
+ readonly titleField: "title";
137
+ readonly description: string;
138
+ readonly navigation: "main";
139
+ readonly navigationOrder: 61;
140
+ readonly fields: {
141
+ readonly title: {
142
+ readonly type: "text";
143
+ readonly label: "Title";
144
+ readonly required: true;
145
+ };
146
+ readonly slug: {
147
+ readonly type: "slug";
148
+ readonly label: "Address";
149
+ readonly description: "Where the page is read: /help/<address>. Made from the title.";
150
+ };
151
+ readonly summary: {
152
+ readonly type: "text";
153
+ readonly label: "Summary";
154
+ readonly description: "One or two sentences for lists, search results and link previews.";
155
+ };
156
+ readonly body: {
157
+ readonly type: "richText";
158
+ readonly label: "Body";
159
+ };
160
+ readonly topic: {
161
+ readonly type: "relation";
162
+ readonly label: "Topic";
163
+ readonly to: "knowledge.helptopic";
164
+ };
165
+ readonly order: {
166
+ readonly type: "number";
167
+ readonly label: "Order in its topic";
168
+ readonly step: 1;
169
+ };
170
+ readonly related: {
171
+ readonly type: "relation";
172
+ readonly label: "Related pages";
173
+ readonly to: "knowledge.helppage";
174
+ readonly many: true;
175
+ };
176
+ readonly seoTitle: {
177
+ readonly type: "text";
178
+ readonly label: "Search title";
179
+ };
180
+ readonly seoDescription: {
181
+ readonly type: "text";
182
+ readonly label: "Search description";
183
+ };
184
+ readonly noindex: {
185
+ readonly type: "boolean";
186
+ readonly label: "Hide from search engines";
187
+ readonly description: "Asks search engines not to list the page.";
188
+ };
189
+ };
190
+ readonly indexes: readonly [readonly ["topic", "order"]];
191
+ readonly publishable: {
192
+ readonly content: readonly ["title", "summary", "body", "topic", "order", "related", "seoTitle", "seoDescription", "noindex"];
193
+ readonly slug: "slug";
194
+ };
195
+ readonly public: {
196
+ readonly read: readonly ["title", "slug", "summary", "body", "topic", "order", "related", "seoTitle", "seoDescription", "noindex", "publishedAt"];
197
+ };
198
+ };
199
+ readonly helptopic: {
200
+ readonly label: "Help topic";
201
+ readonly plural: "Help topics";
202
+ readonly icon: "tags";
203
+ readonly titleField: "name";
204
+ readonly navigation: "settings";
205
+ readonly description: "A group of help pages, as the help centre's menu shows them.";
206
+ readonly fields: {
207
+ readonly name: {
208
+ readonly type: "text";
209
+ readonly label: "Name";
210
+ readonly required: true;
211
+ };
212
+ readonly slug: {
213
+ readonly type: "slug";
214
+ readonly label: "Address";
215
+ };
216
+ readonly order: {
217
+ readonly type: "number";
218
+ readonly label: "Order";
219
+ readonly step: 1;
220
+ };
221
+ readonly icon: {
222
+ readonly type: "select";
223
+ readonly label: "Icon";
224
+ readonly options: {
225
+ value: string;
226
+ label: string;
227
+ }[];
228
+ };
229
+ };
230
+ readonly indexes: readonly [readonly ["order"]];
231
+ readonly public: {
232
+ readonly read: readonly ["name", "slug", "order", "icon"];
233
+ };
234
+ };
235
+ };
236
+ readonly views: {
237
+ readonly procedureDrafts: {
238
+ readonly label: "Procedure drafts";
239
+ readonly object: "knowledge.procedure";
240
+ readonly filter: {
241
+ readonly field: "publishState";
242
+ readonly op: "eq";
243
+ readonly value: "draft";
244
+ };
245
+ readonly sort: {
246
+ readonly field: "updatedAt";
247
+ readonly direction: "desc";
248
+ };
249
+ readonly columns: ["title", "section", "owner", "updatedAt"];
250
+ };
251
+ readonly procedures: {
252
+ readonly label: "Published procedures";
253
+ readonly object: "knowledge.procedure";
254
+ readonly filter: {
255
+ readonly field: "publishState";
256
+ readonly op: "eq";
257
+ readonly value: "published";
258
+ };
259
+ readonly sort: {
260
+ readonly field: "title";
261
+ readonly direction: "asc";
262
+ };
263
+ readonly columns: ["title", "section", "owner", "publishedVersion", "publishedAt", "nextReview"];
264
+ };
265
+ readonly reviewDue: {
266
+ readonly label: "Procedures by next review";
267
+ readonly object: "knowledge.procedure";
268
+ readonly filter: {
269
+ readonly and: [{
270
+ readonly field: "publishState";
271
+ readonly op: "eq";
272
+ readonly value: "published";
273
+ }, {
274
+ readonly field: "nextReview";
275
+ readonly op: "is_not_null";
276
+ }];
277
+ };
278
+ readonly sort: {
279
+ readonly field: "nextReview";
280
+ readonly direction: "asc";
281
+ };
282
+ readonly columns: ["title", "owner", "nextReview", "publishedAt"];
283
+ };
284
+ readonly helpDrafts: {
285
+ readonly label: "Help page drafts";
286
+ readonly object: "knowledge.helppage";
287
+ readonly filter: {
288
+ readonly field: "publishState";
289
+ readonly op: "eq";
290
+ readonly value: "draft";
291
+ };
292
+ readonly sort: {
293
+ readonly field: "updatedAt";
294
+ readonly direction: "desc";
295
+ };
296
+ readonly columns: ["title", "topic", "updatedAt"];
297
+ };
298
+ readonly helpPages: {
299
+ readonly label: "Published help pages";
300
+ readonly object: "knowledge.helppage";
301
+ readonly filter: {
302
+ readonly field: "publishState";
303
+ readonly op: "eq";
304
+ readonly value: "published";
305
+ };
306
+ readonly sort: {
307
+ readonly field: "title";
308
+ readonly direction: "asc";
309
+ };
310
+ readonly columns: ["title", "topic", "publishedVersion", "publishedAt"];
311
+ };
312
+ };
313
+ readonly recordTabs: {
314
+ readonly sectionProcedures: {
315
+ readonly label: "Procedures";
316
+ readonly on: "knowledge.section";
317
+ readonly view: {
318
+ readonly type: "table";
319
+ readonly object: "knowledge.procedure";
320
+ readonly relation: "section";
321
+ readonly columns: ["title", "publishState", "owner", "nextReview"];
322
+ readonly sort: {
323
+ readonly field: "title";
324
+ readonly direction: "asc";
325
+ };
326
+ };
327
+ readonly order: 10;
328
+ };
329
+ readonly topicPages: {
330
+ readonly label: "Help pages";
331
+ readonly on: "knowledge.helptopic";
332
+ readonly view: {
333
+ readonly type: "table";
334
+ readonly object: "knowledge.helppage";
335
+ readonly relation: "topic";
336
+ readonly columns: ["title", "publishState", "order"];
337
+ readonly sort: {
338
+ readonly field: "order";
339
+ readonly direction: "asc";
340
+ };
341
+ };
342
+ readonly order: 10;
343
+ };
344
+ };
345
+ readonly tools: {
346
+ readonly toRead: import("@composable-os/sdk").ToolSpec<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
347
+ toRead: import("zod").ZodArray<import("zod").ZodObject<{
348
+ id: import("zod").ZodString;
349
+ title: import("zod").ZodNullable<import("zod").ZodString>;
350
+ version: import("zod").ZodNumber;
351
+ publishedAt: import("zod").ZodString;
352
+ since: import("zod").ZodString;
353
+ }, import("zod/v4/core").$strip>>;
354
+ confirmed: import("zod").ZodArray<import("zod").ZodObject<{
355
+ id: import("zod").ZodString;
356
+ title: import("zod").ZodNullable<import("zod").ZodString>;
357
+ version: import("zod").ZodNumber;
358
+ publishedAt: import("zod").ZodString;
359
+ confirmedAt: import("zod").ZodString;
360
+ }, import("zod/v4/core").$strip>>;
361
+ }, import("zod/v4/core").$strip>>;
362
+ readonly confirm: import("@composable-os/sdk").ToolSpec<import("zod").ZodObject<{
363
+ id: import("zod").ZodString;
364
+ version: import("zod").ZodNumber;
365
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
366
+ id: import("zod").ZodString;
367
+ version: import("zod").ZodNumber;
368
+ confirmedAt: import("zod").ZodString;
369
+ }, import("zod/v4/core").$strip>>;
370
+ readonly readStatus: import("@composable-os/sdk").ToolSpec<import("zod").ZodObject<{
371
+ id: import("zod").ZodOptional<import("zod").ZodString>;
372
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
373
+ procedures: import("zod").ZodArray<import("zod").ZodObject<{
374
+ id: import("zod").ZodString;
375
+ title: import("zod").ZodNullable<import("zod").ZodString>;
376
+ version: import("zod").ZodNumber;
377
+ publishedAt: import("zod").ZodString;
378
+ mustRead: import("zod").ZodNumber;
379
+ confirmed: import("zod").ZodNumber;
380
+ }, import("zod/v4/core").$strip>>;
381
+ procedure: import("zod").ZodNullable<import("zod").ZodObject<{
382
+ id: import("zod").ZodString;
383
+ title: import("zod").ZodNullable<import("zod").ZodString>;
384
+ version: import("zod").ZodNumber;
385
+ publishedAt: import("zod").ZodString;
386
+ everyone: import("zod").ZodBoolean;
387
+ roles: import("zod").ZodArray<import("zod").ZodString>;
388
+ people: import("zod").ZodArray<import("zod").ZodObject<{
389
+ account: import("zod").ZodString;
390
+ name: import("zod").ZodString;
391
+ email: import("zod").ZodString;
392
+ confirmed: import("zod").ZodNullable<import("zod").ZodObject<{
393
+ version: import("zod").ZodNumber;
394
+ confirmedAt: import("zod").ZodString;
395
+ }, import("zod/v4/core").$strip>>;
396
+ lastConfirmed: import("zod").ZodNullable<import("zod").ZodObject<{
397
+ version: import("zod").ZodNumber;
398
+ confirmedAt: import("zod").ZodString;
399
+ }, import("zod/v4/core").$strip>>;
400
+ since: import("zod").ZodNullable<import("zod").ZodString>;
401
+ }, import("zod/v4/core").$strip>>;
402
+ }, import("zod/v4/core").$strip>>;
403
+ }, import("zod/v4/core").$strip>>;
404
+ readonly helpTopics: import("@composable-os/sdk").ToolSpec<import("zod").ZodObject<{
405
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
406
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
407
+ topics: import("zod").ZodArray<import("zod").ZodObject<{
408
+ id: import("zod").ZodString;
409
+ name: import("zod").ZodNullable<import("zod").ZodString>;
410
+ slug: import("zod").ZodNullable<import("zod").ZodString>;
411
+ order: import("zod").ZodNullable<import("zod").ZodNumber>;
412
+ icon: import("zod").ZodNullable<import("zod").ZodString>;
413
+ }, import("zod/v4/core").$strip>>;
414
+ }, import("zod/v4/core").$strip>>;
415
+ readonly draftProcedure: import("@composable-os/sdk").ToolSpec<import("zod").ZodObject<{
416
+ section: import("zod").ZodOptional<import("zod").ZodString>;
417
+ id: import("zod").ZodOptional<import("zod").ZodString>;
418
+ title: import("zod").ZodString;
419
+ summary: import("zod").ZodOptional<import("zod").ZodString>;
420
+ notes: import("zod").ZodOptional<import("zod").ZodString>;
421
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
422
+ id: import("zod").ZodString;
423
+ created: import("zod").ZodBoolean;
424
+ open: import("zod").ZodObject<{
425
+ object: import("zod").ZodString;
426
+ id: import("zod").ZodString;
427
+ }, import("zod/v4/core").$strip>;
428
+ }, import("zod/v4/core").$strip>>;
429
+ readonly draftHelpPage: import("@composable-os/sdk").ToolSpec<import("zod").ZodObject<{
430
+ topic: import("zod").ZodOptional<import("zod").ZodString>;
431
+ id: import("zod").ZodOptional<import("zod").ZodString>;
432
+ title: import("zod").ZodString;
433
+ summary: import("zod").ZodOptional<import("zod").ZodString>;
434
+ notes: import("zod").ZodOptional<import("zod").ZodString>;
435
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
436
+ id: import("zod").ZodString;
437
+ created: import("zod").ZodBoolean;
438
+ open: import("zod").ZodObject<{
439
+ object: import("zod").ZodString;
440
+ id: import("zod").ZodString;
441
+ }, import("zod/v4/core").$strip>;
442
+ }, import("zod/v4/core").$strip>>;
443
+ };
444
+ readonly automations: {
445
+ reviewDue: import("@composable-os/sdk").AutomationSpec<{
446
+ readonly type: "dateRelative";
447
+ readonly object: "knowledge.procedure";
448
+ readonly field: "nextReview";
449
+ readonly offsetDays: 0;
450
+ }>;
451
+ };
452
+ }>;
2
453
  export default _default;
package/dist/tools.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { z } from "@composable-os/sdk";
1
2
  export declare const PROCEDURE = "knowledge.procedure";
2
3
  export declare const SECTION = "knowledge.section";
3
4
  export declare const HELP_PAGE = "knowledge.helppage";
@@ -30,10 +31,101 @@ type Block = {
30
31
  export declare function notesToRichText(notes: string): {
31
32
  blocks: Block[];
32
33
  };
33
- export declare const toRead: any;
34
- export declare const confirm: any;
35
- export declare const readStatus: any;
36
- export declare const helpTopics: any;
37
- export declare const draftProcedure: any;
38
- export declare const draftHelpPage: any;
34
+ export declare const toRead: import("@composable-os/sdk").ToolSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
35
+ toRead: z.ZodArray<z.ZodObject<{
36
+ id: z.ZodString;
37
+ title: z.ZodNullable<z.ZodString>;
38
+ version: z.ZodNumber;
39
+ publishedAt: z.ZodString;
40
+ since: z.ZodString;
41
+ }, z.core.$strip>>;
42
+ confirmed: z.ZodArray<z.ZodObject<{
43
+ id: z.ZodString;
44
+ title: z.ZodNullable<z.ZodString>;
45
+ version: z.ZodNumber;
46
+ publishedAt: z.ZodString;
47
+ confirmedAt: z.ZodString;
48
+ }, z.core.$strip>>;
49
+ }, z.core.$strip>>;
50
+ export declare const confirm: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
51
+ id: z.ZodString;
52
+ version: z.ZodNumber;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ id: z.ZodString;
55
+ version: z.ZodNumber;
56
+ confirmedAt: z.ZodString;
57
+ }, z.core.$strip>>;
58
+ export declare const readStatus: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
59
+ id: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$strip>, z.ZodObject<{
61
+ procedures: z.ZodArray<z.ZodObject<{
62
+ id: z.ZodString;
63
+ title: z.ZodNullable<z.ZodString>;
64
+ version: z.ZodNumber;
65
+ publishedAt: z.ZodString;
66
+ mustRead: z.ZodNumber;
67
+ confirmed: z.ZodNumber;
68
+ }, z.core.$strip>>;
69
+ procedure: z.ZodNullable<z.ZodObject<{
70
+ id: z.ZodString;
71
+ title: z.ZodNullable<z.ZodString>;
72
+ version: z.ZodNumber;
73
+ publishedAt: z.ZodString;
74
+ everyone: z.ZodBoolean;
75
+ roles: z.ZodArray<z.ZodString>;
76
+ people: z.ZodArray<z.ZodObject<{
77
+ account: z.ZodString;
78
+ name: z.ZodString;
79
+ email: z.ZodString;
80
+ confirmed: z.ZodNullable<z.ZodObject<{
81
+ version: z.ZodNumber;
82
+ confirmedAt: z.ZodString;
83
+ }, z.core.$strip>>;
84
+ lastConfirmed: z.ZodNullable<z.ZodObject<{
85
+ version: z.ZodNumber;
86
+ confirmedAt: z.ZodString;
87
+ }, z.core.$strip>>;
88
+ since: z.ZodNullable<z.ZodString>;
89
+ }, z.core.$strip>>;
90
+ }, z.core.$strip>>;
91
+ }, z.core.$strip>>;
92
+ export declare const helpTopics: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
93
+ limit: z.ZodDefault<z.ZodNumber>;
94
+ }, z.core.$strip>, z.ZodObject<{
95
+ topics: z.ZodArray<z.ZodObject<{
96
+ id: z.ZodString;
97
+ name: z.ZodNullable<z.ZodString>;
98
+ slug: z.ZodNullable<z.ZodString>;
99
+ order: z.ZodNullable<z.ZodNumber>;
100
+ icon: z.ZodNullable<z.ZodString>;
101
+ }, z.core.$strip>>;
102
+ }, z.core.$strip>>;
103
+ export declare const draftProcedure: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
104
+ section: z.ZodOptional<z.ZodString>;
105
+ id: z.ZodOptional<z.ZodString>;
106
+ title: z.ZodString;
107
+ summary: z.ZodOptional<z.ZodString>;
108
+ notes: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strip>, z.ZodObject<{
110
+ id: z.ZodString;
111
+ created: z.ZodBoolean;
112
+ open: z.ZodObject<{
113
+ object: z.ZodString;
114
+ id: z.ZodString;
115
+ }, z.core.$strip>;
116
+ }, z.core.$strip>>;
117
+ export declare const draftHelpPage: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
118
+ topic: z.ZodOptional<z.ZodString>;
119
+ id: z.ZodOptional<z.ZodString>;
120
+ title: z.ZodString;
121
+ summary: z.ZodOptional<z.ZodString>;
122
+ notes: z.ZodOptional<z.ZodString>;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ id: z.ZodString;
125
+ created: z.ZodBoolean;
126
+ open: z.ZodObject<{
127
+ object: z.ZodString;
128
+ id: z.ZodString;
129
+ }, z.core.$strip>;
130
+ }, z.core.$strip>>;
39
131
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composable-os/pack-knowledge",
3
- "version": "0.1.0-beta.12",
3
+ "version": "0.1.0-beta.14",
4
4
  "license": "FSL-1.1-ALv2",
5
5
  "type": "module",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "description": "Staff procedures everyone reads in their published wording and confirms with one tap, and help pages for your customers on your website."
33
33
  },
34
34
  "dependencies": {
35
- "@composable-os/client": "0.1.0-beta.12",
36
- "@composable-os/sdk": "0.1.0-beta.12"
35
+ "@composable-os/client": "0.1.0-beta.14",
36
+ "@composable-os/sdk": "0.1.0-beta.14"
37
37
  }
38
38
  }