@mistriwork/engine 1.0.0-rc.63 → 1.0.0-rc.64

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.
@@ -9,10 +9,16 @@ interface WriteAttribution {
9
9
  readonly via: WriteVia;
10
10
  /** The action or command the write came from, in the App's words. */
11
11
  readonly action?: string;
12
+ /** What kind of maker ran the command (a receipt's actor kind), or `job:<id>` and the like when the maker names itself. */
13
+ readonly kind?: string;
14
+ /** The proposal a person approved, when the command ran as one. */
15
+ readonly proposal?: string;
12
16
  }
13
17
  /** Run `work` with its writes attributed; a nested call refines the outer one. */
14
18
  export declare function attributeWrites<T>(attribution: WriteAttribution, work: () => T): T;
15
19
  /** Name the action or command a write came from, keeping who made it. */
16
20
  export declare function attributeAction<T>(action: string | undefined, work: () => T): T;
21
+ /** Name who made a command's writes and the proposal it carried out, keeping the person and the action. */
22
+ export declare function attributeMaker<T>(kind: string, proposal: string | undefined, work: () => T): T;
17
23
  export declare const currentWriteAttribution: () => WriteAttribution | undefined;
18
24
  export {};
@@ -20,4 +20,9 @@ export function attributeAction(action, work) {
20
20
  return work();
21
21
  return attributions.run(Object.freeze({ ...(outer ?? { via: 'system' }), action }), work);
22
22
  }
23
+ /** Name who made a command's writes and the proposal it carried out, keeping the person and the action. */
24
+ export function attributeMaker(kind, proposal, work) {
25
+ const outer = attributions.getStore();
26
+ return attributions.run(Object.freeze({ ...(outer ?? { via: 'system' }), kind, ...(proposal === undefined ? {} : { proposal }) }), work);
27
+ }
23
28
  export const currentWriteAttribution = () => attributions.getStore();
@@ -706,6 +706,12 @@ export interface ServedApp<View extends object = ServedDashboardView | ServedFor
706
706
  directory?: {
707
707
  icon: import('./appIcons.js').AppIconName;
708
708
  };
709
+ /** The word the App's AI mark says (`ai.label`), "AI" when absent (kit AiMark). */
710
+ ai?: {
711
+ label: string;
712
+ };
713
+ /** This reader may approve something an AI can propose: For review, `/{app}/review`, and the proposals list. */
714
+ review?: true;
709
715
  }
710
716
  /** A menu node as the view order reads it: a view's reference, a group of nodes, or a link elsewhere. */
711
717
  export type ServedNavNode = {
@@ -738,6 +744,9 @@ export declare const DIRECTORY_ROOM = "all-pages";
738
744
  /** The reader's settings, `/{app}/settings`: their profile and their preferences on one page. An App that already
739
745
  * uses the word keeps it, as with the Directory, and the account menu still opens the room. */
740
746
  export declare const SETTINGS_ROOM = "settings";
747
+ /** For review, `/{app}/review`: what an AI proposed that this reader may approve, and the values it wrote that no
748
+ * person has confirmed. Claimed like the settings: an App that already uses the word keeps it. */
749
+ export declare const REVIEW_ROOM = "review";
741
750
  /** How many places a menu holds before a Directory is offered beside it: past a dozen, scanning a menu is a search. */
742
751
  export declare const DIRECTORY_AT = 12;
743
752
  /** The places a served menu leads to — its views and its links, not the headings over them. */
@@ -52,6 +52,9 @@ export const DIRECTORY_ROOM = 'all-pages';
52
52
  /** The reader's settings, `/{app}/settings`: their profile and their preferences on one page. An App that already
53
53
  * uses the word keeps it, as with the Directory, and the account menu still opens the room. */
54
54
  export const SETTINGS_ROOM = 'settings';
55
+ /** For review, `/{app}/review`: what an AI proposed that this reader may approve, and the values it wrote that no
56
+ * person has confirmed. Claimed like the settings: an App that already uses the word keeps it. */
57
+ export const REVIEW_ROOM = 'review';
55
58
  /** How many places a menu holds before a Directory is offered beside it: past a dozen, scanning a menu is a search. */
56
59
  export const DIRECTORY_AT = 12;
57
60
  /** The places a served menu leads to — its views and its links, not the headings over them. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/engine",
3
- "version": "1.0.0-rc.63",
3
+ "version": "1.0.0-rc.64",
4
4
  "description": "The engine both products stand on: the adapters (SQLite, Postgres), the catalog, the query language, keyset pages, the HTTP kit and the shared rules. No React.",
5
5
  "homepage": "https://mistriwork.dev",
6
6
  "bugs": {