@pinecall/dot 0.11.23 → 0.11.25

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 (124) hide show
  1. package/README.md +145 -63
  2. package/dist/agent/index.d.ts +3 -2
  3. package/dist/agent/index.d.ts.map +1 -1
  4. package/dist/agent/index.js +2 -1
  5. package/dist/agent/index.js.map +1 -1
  6. package/dist/agent/tutor.d.ts +12 -10
  7. package/dist/agent/tutor.d.ts.map +1 -1
  8. package/dist/agent/tutor.js +81 -68
  9. package/dist/agent/tutor.js.map +1 -1
  10. package/dist/agent/walks.d.ts +19 -0
  11. package/dist/agent/walks.d.ts.map +1 -0
  12. package/dist/agent/walks.js +89 -0
  13. package/dist/agent/walks.js.map +1 -0
  14. package/dist/page/page.d.ts +2 -2
  15. package/dist/page/page.d.ts.map +1 -1
  16. package/dist/page/page.js +5 -5
  17. package/dist/page/page.js.map +1 -1
  18. package/dist/page/roles.d.ts +2 -0
  19. package/dist/page/roles.d.ts.map +1 -1
  20. package/dist/page/roles.js +21 -2
  21. package/dist/page/roles.js.map +1 -1
  22. package/dist/pointer/asking.d.ts +25 -0
  23. package/dist/pointer/asking.d.ts.map +1 -0
  24. package/dist/pointer/asking.js +82 -0
  25. package/dist/pointer/asking.js.map +1 -0
  26. package/dist/pointer/flight.d.ts +40 -4
  27. package/dist/pointer/flight.d.ts.map +1 -1
  28. package/dist/pointer/flight.js +139 -17
  29. package/dist/pointer/flight.js.map +1 -1
  30. package/dist/pointer/frames.d.ts +28 -0
  31. package/dist/pointer/frames.d.ts.map +1 -0
  32. package/dist/pointer/frames.js +66 -0
  33. package/dist/pointer/frames.js.map +1 -0
  34. package/dist/pointer/icons.d.ts +8 -0
  35. package/dist/pointer/icons.d.ts.map +1 -0
  36. package/dist/pointer/icons.js +15 -0
  37. package/dist/pointer/icons.js.map +1 -0
  38. package/dist/pointer/menu.d.ts +5 -4
  39. package/dist/pointer/menu.d.ts.map +1 -1
  40. package/dist/pointer/menu.js +56 -47
  41. package/dist/pointer/menu.js.map +1 -1
  42. package/dist/pointer/person.d.ts +13 -2
  43. package/dist/pointer/person.d.ts.map +1 -1
  44. package/dist/pointer/person.js +47 -41
  45. package/dist/pointer/person.js.map +1 -1
  46. package/dist/pointer/pressing.d.ts +6 -0
  47. package/dist/pointer/pressing.d.ts.map +1 -0
  48. package/dist/pointer/pressing.js +32 -0
  49. package/dist/pointer/pressing.js.map +1 -0
  50. package/dist/pointer/sections.d.ts +4 -7
  51. package/dist/pointer/sections.d.ts.map +1 -1
  52. package/dist/pointer/sections.js +11 -17
  53. package/dist/pointer/sections.js.map +1 -1
  54. package/dist/pointer/typing.d.ts +5 -3
  55. package/dist/pointer/typing.d.ts.map +1 -1
  56. package/dist/pointer/typing.js +46 -15
  57. package/dist/pointer/typing.js.map +1 -1
  58. package/dist/server/index.d.ts +34 -0
  59. package/dist/server/index.d.ts.map +1 -0
  60. package/dist/server/index.js +108 -0
  61. package/dist/server/index.js.map +1 -0
  62. package/dist/server/questions.d.ts +30 -0
  63. package/dist/server/questions.d.ts.map +1 -0
  64. package/dist/server/questions.js +136 -0
  65. package/dist/server/questions.js.map +1 -0
  66. package/dist/server/saying.d.ts +31 -0
  67. package/dist/server/saying.d.ts.map +1 -0
  68. package/dist/server/saying.js +124 -0
  69. package/dist/server/saying.js.map +1 -0
  70. package/dist/tutor/acting.d.ts +42 -0
  71. package/dist/tutor/acting.d.ts.map +1 -0
  72. package/dist/tutor/acting.js +180 -0
  73. package/dist/tutor/acting.js.map +1 -0
  74. package/dist/tutor/aloud.d.ts +50 -0
  75. package/dist/tutor/aloud.d.ts.map +1 -0
  76. package/dist/tutor/aloud.js +288 -0
  77. package/dist/tutor/aloud.js.map +1 -0
  78. package/dist/tutor/ask.d.ts +49 -0
  79. package/dist/tutor/ask.d.ts.map +1 -0
  80. package/dist/tutor/ask.js +47 -0
  81. package/dist/tutor/ask.js.map +1 -0
  82. package/dist/tutor/listening.d.ts +17 -0
  83. package/dist/tutor/listening.d.ts.map +1 -0
  84. package/dist/tutor/listening.js +66 -0
  85. package/dist/tutor/listening.js.map +1 -0
  86. package/dist/tutor/options.d.ts +37 -1
  87. package/dist/tutor/options.d.ts.map +1 -1
  88. package/dist/tutor/options.js +1 -1
  89. package/dist/tutor/options.js.map +1 -1
  90. package/dist/tutor/reading.d.ts +58 -0
  91. package/dist/tutor/reading.d.ts.map +1 -0
  92. package/dist/tutor/reading.js +193 -0
  93. package/dist/tutor/reading.js.map +1 -0
  94. package/dist/tutor/text.d.ts +16 -0
  95. package/dist/tutor/text.d.ts.map +1 -0
  96. package/dist/tutor/text.js +119 -0
  97. package/dist/tutor/text.js.map +1 -0
  98. package/dist/tutor/tutor.d.ts +2 -9
  99. package/dist/tutor/tutor.d.ts.map +1 -1
  100. package/dist/tutor/tutor.js +110 -87
  101. package/dist/tutor/tutor.js.map +1 -1
  102. package/dist/tutor/walking.d.ts +26 -8
  103. package/dist/tutor/walking.d.ts.map +1 -1
  104. package/dist/tutor/walking.js +145 -30
  105. package/dist/tutor/walking.js.map +1 -1
  106. package/dist/tutor/walks.d.ts +33 -0
  107. package/dist/tutor/walks.d.ts.map +1 -1
  108. package/dist/tutor/walks.js +121 -13
  109. package/dist/tutor/walks.js.map +1 -1
  110. package/dist/wire/acts.d.ts +60 -0
  111. package/dist/wire/acts.d.ts.map +1 -0
  112. package/dist/wire/acts.js +120 -0
  113. package/dist/wire/acts.js.map +1 -0
  114. package/dist/wire/ask.d.ts +132 -0
  115. package/dist/wire/ask.d.ts.map +1 -0
  116. package/dist/wire/ask.js +102 -0
  117. package/dist/wire/ask.js.map +1 -0
  118. package/dist/wire/index.d.ts +38 -8
  119. package/dist/wire/index.d.ts.map +1 -1
  120. package/dist/wire/index.js +86 -12
  121. package/dist/wire/index.js.map +1 -1
  122. package/docs/macros.md +216 -0
  123. package/docs/write-a-tutor.md +247 -0
  124. package/package.json +11 -6
@@ -0,0 +1,60 @@
1
+ /** A macro as a function: the params it takes, the steps that act on the page (fill, press, wait, read), and the `{slots}` its words are filled from. */
2
+ /** What a walk is called with, or read on its way: each slot's text. */
3
+ export type Values = Record<string, string>;
4
+ /** One param of a walk: what it is, in the words the model reads, and the options it is one of; none, the visitor's own words. */
5
+ export interface Param {
6
+ about: string;
7
+ oneOf?: Record<string, string> | undefined;
8
+ }
9
+ /** Type the filled `with` into the field the screen names `fill`: the visitor's words, never a password or a card. */
10
+ export interface FillAct {
11
+ fill: string;
12
+ with: string;
13
+ }
14
+ /** Press the button the screen names `press`: one outside any form, or in a search form. Never a slot: the site names it. */
15
+ export interface PressAct {
16
+ press: string;
17
+ }
18
+ /** Wait for the page to change after a press, a search answered: `ms` at most, 8 seconds when not said. */
19
+ export interface WaitAct {
20
+ wait: string;
21
+ ms?: number | undefined;
22
+ }
23
+ /** Read the table the screen names `read`: one row, the first or the one that best answers the visitor, its cells as `{as.Column}`. */
24
+ export interface ReadAct {
25
+ read: string;
26
+ as: string;
27
+ row?: "first" | "best" | undefined;
28
+ }
29
+ export type Act = FillAct | PressAct | WaitAct | ReadAct;
30
+ /** When a step is taken: `if` a slot has a value, `unless` it has one. */
31
+ export interface Guarded {
32
+ if?: string | undefined;
33
+ unless?: string | undefined;
34
+ }
35
+ /** The longest a wait may be, in ms. */
36
+ export declare const LONGEST_WAIT = 20000;
37
+ /** The longest a value may be: a name, a phone, a cell. */
38
+ export declare const LONGEST_VALUE = 80;
39
+ /** The slots a text names, in order: `{name}`, `{hit.Time}`. */
40
+ export declare function slotsOf(text: string): string[];
41
+ /** `text` with its slots filled; null when one has no value. */
42
+ export declare function filled(text: string, values: Values): string | null;
43
+ /** Whether a step is taken, with these values. */
44
+ export declare function taken(step: Guarded, values: Values): boolean;
45
+ /** A value as it may fill a slot: one line, cut. */
46
+ export declare function valueOf(text: string): string;
47
+ /** Whether a step is an act rather than a sentence. */
48
+ export declare function isAct(step: object): step is Act;
49
+ /** An act as a file or a document says it, checked; null for one that is not. */
50
+ export declare function actOf(fields: Record<string, unknown>): Act | null;
51
+ /** A step's guards, checked; null when one is not a slot's name. */
52
+ export declare function guardsOf(fields: Record<string, unknown>): Guarded | null;
53
+ /** A walk's params, as its file or document says them (`one_of` for the options), checked; null for any that is not one. */
54
+ export declare function paramsOf(value: unknown): Record<string, Param> | null;
55
+ /** The values a walk is called with, checked against its params: a list's value one of its options, the rest the visitor's words, cut. */
56
+ export declare function valuesFor(params: Record<string, Param>, given: Record<string, unknown>): {
57
+ values: Values;
58
+ wrong: string[];
59
+ };
60
+ //# sourceMappingURL=acts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acts.d.ts","sourceRoot":"","sources":["../../src/wire/acts.ts"],"names":[],"mappings":"AAAA,yJAAyJ;AASzJ,wEAAwE;AACxE,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE5C,kIAAkI;AAClI,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC5C;AAED,sHAAsH;AACtH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6HAA6H;AAC7H,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,2GAA2G;AAC3G,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED,uIAAuI;AACvI,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAEzD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MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAa5H"}
@@ -0,0 +1,120 @@
1
+ /** A macro as a function: the params it takes, the steps that act on the page (fill, press, wait, read), and the `{slots}` its words are filled from. */
2
+ //
3
+ // A walk that takes params is called with them: in a call the agent's model passes them, with no call
4
+ // the site's server picks them out of what the visitor typed (`@pinecall/dot/server`). A param is the
5
+ // visitor's own words (a name, a phone, what to search for) or one option of a list. Its value fills
6
+ // the `{name}` slots of the walk's sentences and of what a step types, and `read` adds the cells of a
7
+ // row of a table the page shows (`{hit.Time}`). A step with a slot nothing filled is left out, so a
8
+ // walk said without a param says the rest; `if` and `unless` keep a step for a value there, or not.
9
+ /** The longest a wait may be, in ms. */
10
+ export const LONGEST_WAIT = 20_000;
11
+ /** The longest a value may be: a name, a phone, a cell. */
12
+ export const LONGEST_VALUE = 80;
13
+ const SLOT = /\{([A-Za-z_][\w]*(?:\.[^{}\n]+)?)\}/g;
14
+ /** The slots a text names, in order: `{name}`, `{hit.Time}`. */
15
+ export function slotsOf(text) {
16
+ return [...text.matchAll(SLOT)].map((found) => found[1] ?? "");
17
+ }
18
+ /** `text` with its slots filled; null when one has no value. */
19
+ export function filled(text, values) {
20
+ let missing = false;
21
+ const out = text.replace(SLOT, (_, slot) => {
22
+ const value = values[slot];
23
+ if (value === undefined || value === "")
24
+ missing = true;
25
+ return value ?? "";
26
+ });
27
+ return missing ? null : out;
28
+ }
29
+ /** Whether a step is taken, with these values. */
30
+ export function taken(step, values) {
31
+ const has = (slot) => (values[slot] ?? "") !== "";
32
+ return (step.if === undefined || has(step.if)) && (step.unless === undefined || !has(step.unless));
33
+ }
34
+ /** A value as it may fill a slot: one line, cut. */
35
+ export function valueOf(text) {
36
+ return text.replace(/\s+/g, " ").trim().slice(0, LONGEST_VALUE);
37
+ }
38
+ /** Whether a step is an act rather than a sentence. */
39
+ export function isAct(step) {
40
+ return "fill" in step || "press" in step || "wait" in step || "read" in step;
41
+ }
42
+ const text = (value) => typeof value === "string" && value.trim() !== "";
43
+ /** An act as a file or a document says it, checked; null for one that is not. */
44
+ export function actOf(fields) {
45
+ if ("fill" in fields)
46
+ return text(fields["fill"]) && text(fields["with"]) ? { fill: fields["fill"], with: fields["with"] } : null;
47
+ if ("press" in fields)
48
+ return text(fields["press"]) && slotsOf(fields["press"]).length === 0 ? { press: fields["press"] } : null;
49
+ if ("wait" in fields) {
50
+ const ms = fields["ms"];
51
+ if (!text(fields["wait"]) || (ms !== undefined && (typeof ms !== "number" || ms <= 0 || ms > LONGEST_WAIT)))
52
+ return null;
53
+ return { wait: fields["wait"], ...(ms === undefined ? {} : { ms }) };
54
+ }
55
+ if ("read" in fields) {
56
+ const row = fields["row"];
57
+ if (!text(fields["read"]) || !text(fields["as"]) || !/^[A-Za-z_]\w*$/.test(fields["as"]))
58
+ return null;
59
+ if (row !== undefined && row !== "first" && row !== "best")
60
+ return null;
61
+ return { read: fields["read"], as: fields["as"], ...(row === undefined ? {} : { row }) };
62
+ }
63
+ return null;
64
+ }
65
+ /** A step's guards, checked; null when one is not a slot's name. */
66
+ export function guardsOf(fields) {
67
+ const guards = {};
68
+ for (const key of ["if", "unless"]) {
69
+ const slot = fields[key];
70
+ if (slot === undefined)
71
+ continue;
72
+ if (typeof slot !== "string" || slot === "")
73
+ return null;
74
+ guards[key] = slot;
75
+ }
76
+ return guards;
77
+ }
78
+ /** A walk's params, as its file or document says them (`one_of` for the options), checked; null for any that is not one. */
79
+ export function paramsOf(value) {
80
+ if (typeof value !== "object" || value === null || Array.isArray(value))
81
+ return null;
82
+ const params = {};
83
+ for (const [name, declared] of Object.entries(value)) {
84
+ if (!/^[A-Za-z_]\w*$/.test(name) || typeof declared !== "object" || declared === null)
85
+ return null;
86
+ const fields = { ...declared };
87
+ const about = fields["about"];
88
+ const options = fields["one_of"] ?? fields["oneOf"];
89
+ if (!text(about))
90
+ return null;
91
+ if (options === undefined) {
92
+ params[name] = { about };
93
+ continue;
94
+ }
95
+ if (typeof options !== "object" || options === null || Array.isArray(options))
96
+ return null;
97
+ const entries = Object.entries(options);
98
+ if (entries.length === 0 || !entries.every(([, said]) => typeof said === "string"))
99
+ return null;
100
+ params[name] = { about, oneOf: Object.fromEntries(entries) };
101
+ }
102
+ return params;
103
+ }
104
+ /** The values a walk is called with, checked against its params: a list's value one of its options, the rest the visitor's words, cut. */
105
+ export function valuesFor(params, given) {
106
+ const values = {};
107
+ const wrong = [];
108
+ for (const [name, value] of Object.entries(given)) {
109
+ const param = params[name];
110
+ if (param === undefined || typeof value !== "string" || value.trim() === "")
111
+ continue;
112
+ if (param.oneOf !== undefined && !(value in param.oneOf)) {
113
+ wrong.push(`${name} is one of ${Object.keys(param.oneOf).join(", ")}`);
114
+ continue;
115
+ }
116
+ values[name] = valueOf(value);
117
+ }
118
+ return { values, wrong };
119
+ }
120
+ //# sourceMappingURL=acts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acts.js","sourceRoot":"","sources":["../../src/wire/acts.ts"],"names":[],"mappings":"AAAA,yJAAyJ;AACzJ,EAAE;AACF,sGAAsG;AACtG,sGAAsG;AACtG,qGAAqG;AACrG,sGAAsG;AACtG,oGAAoG;AACpG,oGAAoG;AA2CpG,wCAAwC;AACxC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AACnC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAEhC,MAAM,IAAI,GAAG,sCAAsC,CAAC;AAEpD,gEAAgE;AAChE,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACjE,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,MAAc;IACjD,IAAI,OAAO,GAAG,KAAK,C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AAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,SAAS;QACtF,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACzD,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,cAAc,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvE,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,132 @@
1
+ /** What the dot asks when the visitor types to it, and the one thing it may be told to do: a walk, a thing shown, the agent, or nothing. */
2
+ import { type Values } from "./acts.js";
3
+ /** What the visitor typed, and the page it was typed on, as the dot sends it to be decided. */
4
+ export interface AskRequest {
5
+ message: string;
6
+ /** The path of the page: `/pricing`. */
7
+ path: string;
8
+ /** The page as the agent reads it: each thing with its role, its name and its ref. */
9
+ page: string;
10
+ /** The walks of this page, and what each takes. */
11
+ walks: {
12
+ name: string;
13
+ title: string;
14
+ when?: string | undefined;
15
+ params?: Record<string, {
16
+ about: string;
17
+ oneOf?: Record<string, string> | undefined;
18
+ }> | undefined;
19
+ }[];
20
+ }
21
+ /** Which row of a table a walk read best answers what the visitor typed: each row as its cells, joined. */
22
+ export interface RowRequest {
23
+ message: string;
24
+ rows: string[];
25
+ }
26
+ /** A sentence of a walk with slots, to record now its values are known: the page it is on, the walk, the step, the values. */
27
+ export interface SayRequest {
28
+ path: string;
29
+ walk: string;
30
+ step: number;
31
+ values: Values;
32
+ }
33
+ /** A text of the page itself to record in the agent's voice: a part of a page read aloud. */
34
+ export interface ReadRequest {
35
+ text: string;
36
+ }
37
+ /** A command's output a page shows, for the agent's model to explain: notes, each on a line of it. */
38
+ export interface ExplainRequest {
39
+ output: string;
40
+ command?: string | undefined;
41
+ language?: string | undefined;
42
+ }
43
+ /** One turn of a chat the dot talks to, as it was heard: whose, and what was said. */
44
+ export interface Heard {
45
+ who: "agent" | "caller";
46
+ said: string;
47
+ }
48
+ /** The dot's next line on a chat it talks to for a goal: the goal, what was said so far, the language. */
49
+ export interface NextRequest {
50
+ goal: string;
51
+ heard: Heard[];
52
+ language?: string | undefined;
53
+ }
54
+ /** The dot's next line, and whether it says goodbye with it. */
55
+ export interface NextLine {
56
+ say: string;
57
+ hangup: boolean;
58
+ }
59
+ /** The most turns a talk sends as heard: the gateway's own ceiling. */
60
+ export declare const MOST_HEARD = 80;
61
+ /** A note of an output: a fragment of one of its lines, and what is said of it. */
62
+ export interface Note {
63
+ find: string;
64
+ say: string;
65
+ }
66
+ /** What the page asks the site's door: one of the five. */
67
+ export type DoorRequest = {
68
+ decide: AskRequest;
69
+ } | {
70
+ row: RowRequest;
71
+ } | {
72
+ say: SayRequest;
73
+ } | {
74
+ read: ReadRequest;
75
+ } | {
76
+ explain: ExplainRequest;
77
+ } | {
78
+ next: NextRequest;
79
+ };
80
+ /** The site's door's answer to a `row`: the row's index, or null when none answers it. */
81
+ export interface RowAnswer {
82
+ row: number | null;
83
+ }
84
+ /** The door's answer to a `say`: the sentence as recorded. */
85
+ export interface SaidAnswer {
86
+ say: string;
87
+ audio: string;
88
+ durationMs: number;
89
+ words: {
90
+ text: string;
91
+ startMs: number;
92
+ endMs: number;
93
+ }[];
94
+ }
95
+ /** The one thing to do, and how sure the decision is, 0 to 1. */
96
+ export type Decision = {
97
+ do: "walk";
98
+ walk: string;
99
+ params?: Values | undefined;
100
+ confidence: number;
101
+ } | {
102
+ do: "show";
103
+ target: string;
104
+ confidence: number;
105
+ } | {
106
+ do: "talk";
107
+ confidence: number;
108
+ } | {
109
+ do: "none";
110
+ confidence: number;
111
+ };
112
+ /** A thing of the page with a name: its ref, its role and its name. */
113
+ export interface Named {
114
+ ref: string;
115
+ role: string;
116
+ name: string;
117
+ }
118
+ /** The things of a page with a name and a ref, in the page's order. */
119
+ export declare function namedIn(page: string): Named[];
120
+ /** A decision as a server answered it, checked; null for anything else. */
121
+ export declare function decisionOf(value: unknown): Decision | null;
122
+ /** The most notes an output is explained with. */
123
+ export declare const MOST_NOTES = 6;
124
+ /** An explanation's notes, checked, the first six; none for anything else. */
125
+ /** The door's answer to `{ next }` read as the dot's next line; null when it gave none. */
126
+ export declare function nextOf(value: unknown): NextLine | null;
127
+ export declare function notesOf(value: unknown): Note[];
128
+ /** A row answer, checked; null for anything else. */
129
+ export declare function rowOf(value: unknown): number | null;
130
+ /** A recorded sentence, checked; null for anything else. */
131
+ export declare function saidOf(value: unknown): SaidAnswer | null;
132
+ //# sourceMappingURL=ask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../../src/wire/ask.ts"],"names":[],"mappings":"AAAA,4IAA4I;AAS5I,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAEvD,+FAA+F;AAC/F,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,MAAM,CAAC,EAAE,MA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D,uEAAuE;AACvE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,EAAE,CAK7C;AAID,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAuB1D;AAED,kDAAkD;AAClD,eAAO,MAAM,UAAU,IAAI,CAAC;AAE5B,8EAA8E;AAC9E,2FAA2F;AAC3F,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAItD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,CAY9C;AAED,qDAAqD;AACrD,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAInD;AAED,4DAA4D;AAC5D,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAWxD"}
@@ -0,0 +1,102 @@
1
+ /** What the dot asks when the visitor types to it, and the one thing it may be told to do: a walk, a thing shown, the agent, or nothing. */
2
+ //
3
+ // The visitor types "where do I see what each plan includes?" and the dot does something on the page,
4
+ // never a conversation: it plays one of the page's walks, shows one thing of the page, offers the agent
5
+ // for a question a person answers, or says it cannot find it. What decides is a server's (`@pinecall/dot/server`);
6
+ // this is what the two say to each other. A walk that takes params is told them, picked out of what was typed.
7
+ // The same door picks the row of a table a walk read that best answers the visitor, and records a sentence
8
+ // of a walk once its slots are filled: one door, three asks, told apart by their one key.
9
+ import { LONGEST_VALUE } from "./acts.js";
10
+ /** The most turns a talk sends as heard: the gateway's own ceiling. */
11
+ export const MOST_HEARD = 80;
12
+ // A line of the page as Page writes it: ` - heading "Pricing" [level=2] [ref=e10]`. A name's own quotes are
13
+ // written as apostrophes, so the first closing quote ends it.
14
+ const A_THING = /^\s*- ([a-z]+) "([^"]*)".*?\[ref=(e\d+)\]/;
15
+ /** The things of a page with a name and a ref, in the page's order. */
16
+ export function namedIn(page) {
17
+ return page.split("\n").flatMap((line) => {
18
+ const found = A_THING.exec(line);
19
+ return found === null || found[2] === undefined || found[2].trim() === "" ? [] : [{ role: found[1] ?? "", name: found[2], ref: found[3] ?? "" }];
20
+ });
21
+ }
22
+ const isNumber = (value) => typeof value === "number" && Number.isFinite(value);
23
+ /** A decision as a server answered it, checked; null for anything else. */
24
+ export function decisionOf(value) {
25
+ if (typeof value !== "object" || value === null)
26
+ return null;
27
+ const fields = { ...value };
28
+ const confidence = fields["confidence"];
29
+ if (!isNumber(confidence))
30
+ return null;
31
+ switch (fields["do"]) {
32
+ case "walk": {
33
+ if (typeof fields["walk"] !== "string")
34
+ return null;
35
+ const given = fields["params"];
36
+ if (given === undefined)
37
+ return { do: "walk", walk: fields["walk"], confidence };
38
+ if (typeof given !== "object" || given === null)
39
+ return null;
40
+ const params = Object.fromEntries(Object.entries(given).filter((entry) => typeof entry[1] === "string" && entry[1].length <= LONGEST_VALUE));
41
+ return { do: "walk", walk: fields["walk"], params, confidence };
42
+ }
43
+ case "show":
44
+ return typeof fields["target"] === "string" && /^e\d+$/.test(fields["target"]) ? { do: "show", target: fields["target"], confidence } : null;
45
+ case "talk":
46
+ return { do: "talk", confidence };
47
+ case "none":
48
+ return { do: "none", confidence };
49
+ default:
50
+ return null;
51
+ }
52
+ }
53
+ /** The most notes an output is explained with. */
54
+ export const MOST_NOTES = 6;
55
+ /** An explanation's notes, checked, the first six; none for anything else. */
56
+ /** The door's answer to `{ next }` read as the dot's next line; null when it gave none. */
57
+ export function nextOf(value) {
58
+ if (typeof value !== "object" || value === null)
59
+ return null;
60
+ const { say, hangup } = value;
61
+ return typeof say === "string" && say.trim() !== "" ? { say: say.trim(), hangup: hangup === true } : null;
62
+ }
63
+ export function notesOf(value) {
64
+ if (typeof value !== "object" || value === null)
65
+ return [];
66
+ const notes = value["notes"];
67
+ if (!Array.isArray(notes))
68
+ return [];
69
+ return notes
70
+ .flatMap((note) => {
71
+ if (typeof note !== "object" || note === null)
72
+ return [];
73
+ const fields = { ...note };
74
+ const { find, say } = fields;
75
+ return typeof find === "string" && find.trim() !== "" && typeof say === "string" && say.trim() !== "" ? [{ find, say }] : [];
76
+ })
77
+ .slice(0, MOST_NOTES);
78
+ }
79
+ /** A row answer, checked; null for anything else. */
80
+ export function rowOf(value) {
81
+ if (typeof value !== "object" || value === null)
82
+ return null;
83
+ const row = value["row"];
84
+ return typeof row === "number" && Number.isInteger(row) && row >= 0 ? row : null;
85
+ }
86
+ /** A recorded sentence, checked; null for anything else. */
87
+ export function saidOf(value) {
88
+ if (typeof value !== "object" || value === null)
89
+ return null;
90
+ const said = { ...value };
91
+ const { say, audio, durationMs, words } = said;
92
+ if (typeof say !== "string" || typeof audio !== "string" || !/^https?:\/\//.test(audio) || typeof durationMs !== "number" || !Array.isArray(words))
93
+ return null;
94
+ const timed = words.filter((word) => {
95
+ if (typeof word !== "object" || word === null)
96
+ return false;
97
+ const one = { ...word };
98
+ return typeof one["text"] === "string" && typeof one["startMs"] === "number" && typeof one["endMs"] === "number";
99
+ });
100
+ return timed.length === words.length ? { say, audio, durationMs, words: timed } : null;
101
+ }
102
+ //# sourceMappingURL=ask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask.js","sourceRoot":"","sources":["../../src/wire/ask.ts"],"names":[],"mappings":"AAAA,4IAA4I;AAC5I,EAAE;AACF,sGAAsG;AACtG,wGAAwG;AACxG,mHAAmH;AACnH,+GAA+G;AAC/G,2GAA2G;AAC3G,0FAA0F;AAE1F,OAAO,EAAE,aAAa,EAAe,MAAM,WAAW,CAAC;AA0DvD,uEAAuE;AACvE,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAsC7B,6GAA6G;AAC7G,8DAA8D;AAC9D,MAAM,OAAO,GAAG,2CAA2C,CAAC;AAE5D,uEAAuE;AACvE,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,IAA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AAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACzF,CAAC"}
@@ -1,4 +1,6 @@
1
1
  /** What a tutored page and its agent say to each other: the page's events, and the cursor and macro messages it takes. */
2
+ import { type Act, type Guarded, type Param } from "./acts.js";
3
+ export * from "./acts.js";
2
4
  /** The topic the agent sends on, and the page's `onUi` hears. */
3
5
  export declare const UI = "pinecall.ui";
4
6
  /**
@@ -20,10 +22,11 @@ export declare const WALKED = "page.walked";
20
22
  /** The name the agent publishes its recorded walks under, which the page reads with no key. */
21
23
  export declare const WALKS = "walks";
22
24
  /**
23
- * What the pointer can do. `type` fills a field with what the visitor said: it never submits a form,
24
- * clicks, or leaves the page for them, and never touches a password or a card.
25
+ * What the pointer can do. `type` fills a field with what the visitor said, and never touches a password
26
+ * or a card. `press` presses a button a walk names, one outside any form or in a search form: never a
27
+ * form that sends the visitor's details, and never a page left. `wait` waits for the page to change.
25
28
  */
26
- export declare const ACTIONS: readonly ["point", "highlight", "unhighlight", "scroll_to", "here", "home", "type"];
29
+ export declare const ACTIONS: readonly ["point", "highlight", "unhighlight", "scroll_to", "here", "home", "type", "press", "wait"];
27
30
  export type Action = (typeof ACTIONS)[number];
28
31
  /** What the site wrote for the agent to say about one element, and the move it is said with. */
29
32
  export interface Line {
@@ -39,6 +42,8 @@ export interface Cursor {
39
42
  target?: string | undefined;
40
43
  /** What `type` writes in the field: its text, or the option of a list to choose. */
41
44
  text?: string | undefined;
45
+ /** How long `wait` waits at most, in ms. */
46
+ ms?: number | undefined;
42
47
  }
43
48
  /** A target that is a ref of the snapshot rather than a name. */
44
49
  export declare const A_REF: RegExp;
@@ -60,11 +65,13 @@ export interface Shown {
60
65
  code?: CodeView | null | undefined;
61
66
  lines?: [from: number, to: number] | undefined;
62
67
  }
63
- /** One sentence of a macro and the moves hung on its words. */
64
- export interface MacroStep extends Shown {
68
+ /** One sentence of a macro and the moves hung on its words; its `{slots}` filled when it is said. */
69
+ export interface MacroStep extends Shown, Guarded {
65
70
  say: string;
66
71
  beats: Beat[];
67
72
  }
73
+ /** A step of a macro that acts on the page instead of saying a sentence. */
74
+ export type ActStep = Act & Guarded;
68
75
  /** A guided walk an agent was given: `macros/<name>.json` in its folder. */
69
76
  export interface Macro {
70
77
  name: string;
@@ -72,8 +79,20 @@ export interface Macro {
72
79
  title?: string | undefined;
73
80
  /** When to run it, in the words the model reads: "the visitor asks to be shown around". */
74
81
  when?: string | undefined;
75
- steps: MacroStep[];
82
+ /** The paths of the pages it is for: `["/security"]`. Left out, it is for every page. */
83
+ pages?: string[] | undefined;
84
+ /** What it is called with, by name. */
85
+ params?: Record<string, Param> | undefined;
86
+ steps: (MacroStep | ActStep)[];
76
87
  }
88
+ /**
89
+ * The name of the document the walks of a page are published under: `walks` for the home, `walks-security`
90
+ * for `/security`. A document is read by every visitor of its page, so each page has its own: a page asks
91
+ * only for the walks that are for it. (A document's name is a lower case letter, then letters, digits and dashes, 40 at most.)
92
+ */
93
+ export declare function walksDocument(path: string): string;
94
+ /** Whether a walk for `pages` is for the page at `path`: any walk is, with no pages named; a path unknown is any page. */
95
+ export declare function onPage(pages: readonly string[] | undefined, path: string): boolean;
77
96
  /** A written word of a recorded sentence, and when it is said, in ms from the start of its audio. */
78
97
  export interface TimedWord {
79
98
  text: string;
@@ -81,13 +100,20 @@ export interface TimedWord {
81
100
  endMs: number;
82
101
  }
83
102
  /** One sentence of a recorded walk, as the page plays it: its audio, when each word is said, its beats. */
84
- export interface RecordedStep extends Shown {
103
+ export interface RecordedStep extends Shown, Guarded {
85
104
  say: string;
86
105
  audio: string;
87
106
  durationMs: number;
88
107
  words: TimedWord[];
89
108
  beats: Beat[];
90
109
  }
110
+ /** A sentence with slots: recorded when it is reached, once its values are known (`live`). */
111
+ export interface LiveStep extends Shown, Guarded {
112
+ say: string;
113
+ beats: Beat[];
114
+ live: true;
115
+ }
116
+ export type WalkStep = RecordedStep | LiveStep | ActStep;
91
117
  /** A walk recorded in the agent's voice, published for the page to play with no call. */
92
118
  export interface RecordedWalk {
93
119
  name: string;
@@ -95,7 +121,11 @@ export interface RecordedWalk {
95
121
  when?: string | undefined;
96
122
  /** The voice it was recorded in, as the gateway names it: `cartesia sonic-3 f786b574…`. */
97
123
  voice?: string | undefined;
98
- steps: RecordedStep[];
124
+ /** The paths of the pages it is for; none, every page. */
125
+ pages?: string[] | undefined;
126
+ /** What it is called with: a walk with params is asked for, not picked from the menu. */
127
+ params?: Record<string, Param> | undefined;
128
+ steps: WalkStep[];
99
129
  }
100
130
  /** The agent asking for the page as it is now: sent when its call opens, answered with `page.seen`. */
101
131
  export interface Look {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wire/index.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAM1H,iEAAiE;AACjE,eAAO,MAAM,EAAE,gBAAgB,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,IAAI,cAAc,CAAC;AAChC,wEAAwE;AACxE,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,uDAAuD;AACvD,eAAO,MAAM,OAAO,iBAAiB,CAAC;AACtC,8FAA8F;AAC9F,eAAO,MAAM,OAAO,iBAAiB,CAAC;AACtC,4FAA4F;AAC5F,eAAO,MAAM,OAAO,iBAAiB,CAAC;AACtC,yHAAyH;AACzH,eAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,+FAA+F;AAC/F,eAAO,MAAM,KAAK,UAAU,CAAC;AAE7B;;;GAGG;AACH,eAAO,MAAM,OAAO,YAAI,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAC3G,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,gGAAgG;AAChG,MAAM,WAAW,IAAI;IACnB,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,E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