@owlmeans/llm-common 0.1.18-rc.9 → 0.1.18

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 (96) hide show
  1. package/README.md +2 -2
  2. package/agent-meta/manifest.json +3 -3
  3. package/agent-meta/skills/llm-common/SKILL.md +64 -12
  4. package/build/consts.d.ts +107 -7
  5. package/build/consts.d.ts.map +1 -1
  6. package/build/consts.js +125 -5
  7. package/build/consts.js.map +1 -1
  8. package/build/delegate/consts.d.ts +25 -0
  9. package/build/delegate/consts.d.ts.map +1 -0
  10. package/build/delegate/consts.js +28 -0
  11. package/build/delegate/consts.js.map +1 -0
  12. package/build/delegate/index.d.ts +3 -0
  13. package/build/delegate/index.d.ts.map +1 -0
  14. package/build/delegate/index.js +3 -0
  15. package/build/delegate/index.js.map +1 -0
  16. package/build/delegate/types.d.ts +85 -0
  17. package/build/delegate/types.d.ts.map +1 -0
  18. package/build/delegate/types.js +13 -0
  19. package/build/delegate/types.js.map +1 -0
  20. package/build/files/types.d.ts +10 -0
  21. package/build/files/types.d.ts.map +1 -1
  22. package/build/index.d.ts +3 -0
  23. package/build/index.d.ts.map +1 -1
  24. package/build/index.js +3 -0
  25. package/build/index.js.map +1 -1
  26. package/build/inquiry/consts.d.ts +48 -0
  27. package/build/inquiry/consts.d.ts.map +1 -0
  28. package/build/inquiry/consts.js +50 -0
  29. package/build/inquiry/consts.js.map +1 -0
  30. package/build/inquiry/helper/types.d.ts +47 -0
  31. package/build/inquiry/helper/types.d.ts.map +1 -0
  32. package/build/inquiry/helper/types.js +2 -0
  33. package/build/inquiry/helper/types.js.map +1 -0
  34. package/build/inquiry/helper.d.ts +4 -0
  35. package/build/inquiry/helper.d.ts.map +1 -0
  36. package/build/inquiry/helper.js +39 -0
  37. package/build/inquiry/helper.js.map +1 -0
  38. package/build/inquiry/index.d.ts +6 -0
  39. package/build/inquiry/index.d.ts.map +1 -0
  40. package/build/inquiry/index.js +4 -0
  41. package/build/inquiry/index.js.map +1 -0
  42. package/build/inquiry/types.d.ts +72 -0
  43. package/build/inquiry/types.d.ts.map +1 -0
  44. package/build/inquiry/types.js +2 -0
  45. package/build/inquiry/types.js.map +1 -0
  46. package/build/inquiry/utils.d.ts +14 -0
  47. package/build/inquiry/utils.d.ts.map +1 -0
  48. package/build/inquiry/utils.js +14 -0
  49. package/build/inquiry/utils.js.map +1 -0
  50. package/build/results/consts.d.ts +19 -0
  51. package/build/results/consts.d.ts.map +1 -0
  52. package/build/results/consts.js +30 -0
  53. package/build/results/consts.js.map +1 -0
  54. package/build/results/consts.local.d.ts +3 -0
  55. package/build/results/consts.local.d.ts.map +1 -0
  56. package/build/results/consts.local.js +3 -0
  57. package/build/results/consts.local.js.map +1 -0
  58. package/build/results/index.d.ts +4 -0
  59. package/build/results/index.d.ts.map +1 -0
  60. package/build/results/index.js +3 -0
  61. package/build/results/index.js.map +1 -0
  62. package/build/results/types.d.ts +37 -0
  63. package/build/results/types.d.ts.map +1 -0
  64. package/build/results/types.js +2 -0
  65. package/build/results/types.js.map +1 -0
  66. package/build/results/utils.d.ts +11 -0
  67. package/build/results/utils.d.ts.map +1 -0
  68. package/build/results/utils.js +27 -0
  69. package/build/results/utils.js.map +1 -0
  70. package/build/spectator/types.d.ts +6 -0
  71. package/build/spectator/types.d.ts.map +1 -1
  72. package/build/types.d.ts +99 -7
  73. package/build/types.d.ts.map +1 -1
  74. package/package.json +5 -4
  75. package/src/consts.ts +129 -5
  76. package/src/delegate/consts.ts +26 -0
  77. package/src/delegate/index.ts +2 -0
  78. package/src/delegate/types.ts +91 -0
  79. package/src/files/types.ts +11 -0
  80. package/src/index.ts +3 -0
  81. package/src/inquiry/consts.ts +52 -0
  82. package/src/inquiry/helper/types.ts +47 -0
  83. package/src/inquiry/helper.ts +53 -0
  84. package/src/inquiry/index.ts +5 -0
  85. package/src/inquiry/types.ts +77 -0
  86. package/src/inquiry/utils.ts +20 -0
  87. package/src/results/consts.local.ts +2 -0
  88. package/src/results/consts.ts +32 -0
  89. package/src/results/index.ts +3 -0
  90. package/src/results/types.ts +37 -0
  91. package/src/results/utils.ts +34 -0
  92. package/src/spectator/types.ts +6 -0
  93. package/src/types.ts +101 -7
  94. package/tests/inquiry.spec.ts +111 -0
  95. package/tests/results.spec.ts +81 -0
  96. package/tsconfig.json +3 -1
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The serializable form of one model call, for a performer outside this process.
3
+ *
4
+ * A delegated call cannot pass a `BaseChatModel` or a langchain message anywhere: the thing that
5
+ * answers it is a coding agent on somebody's laptop, a test double, or a person. So the call is
6
+ * reduced to what any of them can act on — a persona, a conversation, and the shape the answer
7
+ * must take — and everything provider-specific is left behind.
8
+ *
9
+ * There is no vocabulary here from whatever pipeline asked. A `role` and a `tier` travel because
10
+ * the performer has to choose a model; nothing else about the caller does.
11
+ */
12
+ import { DelegatedMode, DelegatedResultKind, DelegatedRole } from './consts.js';
13
+ export interface DelegatedToolCall {
14
+ id?: string;
15
+ name: string;
16
+ args: Record<string, unknown>;
17
+ }
18
+ export interface DelegatedMessage {
19
+ role: DelegatedRole;
20
+ content: string;
21
+ /** Assistant turns that called tools. */
22
+ toolCalls?: DelegatedToolCall[];
23
+ /** Tool turns answer one call, and name the tool they answer. */
24
+ toolCallId?: string;
25
+ name?: string;
26
+ }
27
+ export interface DelegatedTool {
28
+ name: string;
29
+ description?: string;
30
+ /** JSON Schema of the arguments. */
31
+ parameters: Record<string, unknown>;
32
+ }
33
+ export type DelegatedToolChoice = 'auto' | 'none' | {
34
+ name: string;
35
+ };
36
+ export interface DelegatedTask {
37
+ id: string;
38
+ /** Which transport is expected to answer it — the key the application seated it under. */
39
+ delegate: string;
40
+ /** The performer's role name, for its own logging. Never load-bearing. */
41
+ role?: string;
42
+ /** Which power class the performer should run this on. */
43
+ tier?: string;
44
+ /** 0-based. Above zero means a previous answer was refused; `feedback` says why. */
45
+ attempt: number;
46
+ mode: DelegatedMode;
47
+ system?: string;
48
+ messages: DelegatedMessage[];
49
+ tools?: DelegatedTool[];
50
+ toolChoice?: DelegatedToolChoice;
51
+ outputSchema?: Record<string, unknown>;
52
+ /** A soft cap, stated so a performer can size its own call. */
53
+ maxOutputChars?: number;
54
+ feedback?: string;
55
+ /** ISO. A performer past this may say so rather than answer. */
56
+ expiresAt?: string;
57
+ }
58
+ export interface DelegatedUsage {
59
+ inputTokens?: number;
60
+ outputTokens?: number;
61
+ }
62
+ export interface DelegatedResult {
63
+ taskId: string;
64
+ kind: DelegatedResultKind;
65
+ text?: string;
66
+ json?: unknown;
67
+ toolCalls?: DelegatedToolCall[];
68
+ error?: string;
69
+ /** What the performer spent. Recorded; it costs this deployment nothing. */
70
+ usage?: DelegatedUsage;
71
+ /** What the performer actually ran. Display only. */
72
+ model?: string;
73
+ }
74
+ /**
75
+ * How a delegated call reaches its performer.
76
+ *
77
+ * One method, because that is the whole seam: everything about routing, waiting, redelivery and
78
+ * giving up belongs to whoever implements it. A transport that cannot serve the call must THROW
79
+ * rather than answer with an error result — an error result is a bad answer, which is retried,
80
+ * while a transport that is gone is terminal.
81
+ */
82
+ export interface DelegateTransport {
83
+ dispatch: (task: DelegatedTask, signal?: AbortSignal) => Promise<DelegatedResult>;
84
+ }
85
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/delegate/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE/E,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,yCAAyC;IACzC,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC/B,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,CAAA;IAChB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,aAAa,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,gBAAgB,EAAE,CAAA;IAC5B,KAAK,CAAC,EAAE,aAAa,EAAE,CAAA;IACvB,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,mBAAmB,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4EAA4E;IAC5E,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;CAClF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The serializable form of one model call, for a performer outside this process.
3
+ *
4
+ * A delegated call cannot pass a `BaseChatModel` or a langchain message anywhere: the thing that
5
+ * answers it is a coding agent on somebody's laptop, a test double, or a person. So the call is
6
+ * reduced to what any of them can act on — a persona, a conversation, and the shape the answer
7
+ * must take — and everything provider-specific is left behind.
8
+ *
9
+ * There is no vocabulary here from whatever pipeline asked. A `role` and a `tier` travel because
10
+ * the performer has to choose a model; nothing else about the caller does.
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/delegate/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -17,6 +17,16 @@
17
17
  * that stops a rich helper from satisfying this one.
18
18
  */
19
19
  export interface LlmFileProvider {
20
+ /**
21
+ * Stable identity of WHAT this provider reads — a project root, a sandbox id.
22
+ *
23
+ * A prompt plugin that caches resolved reads across calls has nothing else to key on:
24
+ * providers are late-bound and often rebuilt per request, so object identity says
25
+ * nothing, and a cache shared between two projects serves the first one's files to the
26
+ * second. A provider that supplies no key is treated as uncacheable rather than as one
27
+ * more anonymous member of a shared bucket.
28
+ */
29
+ key?: string;
20
30
  /** Read a file relative to the root. With `noThrow`, a missing file yields `''`. */
21
31
  readFile: (filePath: string, noThrow?: boolean) => Promise<string>;
22
32
  /** Glob for files relative to the root. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/files/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAElE,2CAA2C;IAC3C,aAAa,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAEtD,gFAAgF;IAChF,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/D,qFAAqF;IACrF,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,CAAC,MAAM,eAAe,CAAC,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/files/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;OAQG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,oFAAoF;IACpF,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAElE,2CAA2C;IAC3C,aAAa,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAEtD,gFAAgF;IAChF,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/D,qFAAqF;IACrF,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,CAAC,MAAM,eAAe,CAAC,CAAA"}
package/build/index.d.ts CHANGED
@@ -3,4 +3,7 @@ export type * from './types.js';
3
3
  export type * from './spectator/types.js';
4
4
  export type * from './files/types.js';
5
5
  export * from './files/utils.js';
6
+ export * from './delegate/index.js';
7
+ export * from './inquiry/index.js';
8
+ export * from './results/index.js';
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,sBAAsB,CAAA;AACzC,mBAAmB,kBAAkB,CAAA;AACrC,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,sBAAsB,CAAA;AACzC,mBAAmB,kBAAkB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
package/build/index.js CHANGED
@@ -1,3 +1,6 @@
1
1
  export * from './consts.js';
2
2
  export * from './files/utils.js';
3
+ export * from './delegate/index.js';
4
+ export * from './inquiry/index.js';
5
+ export * from './results/index.js';
3
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAI3B,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAI3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * What shape of answer a question expects. Deliberately three, because a question a person is
3
+ * asked mid-run is answered in seconds or not at all: pick one of these, say it in your own
4
+ * words, or say yes/no. Anything richer is a form, and a form belongs to an application screen.
5
+ */
6
+ export declare enum InquiryKind {
7
+ Choice = "choice",
8
+ Text = "text",
9
+ Confirm = "confirm"
10
+ }
11
+ /**
12
+ * What a run is allowed to do when it needs a decision that is not its own.
13
+ *
14
+ * - `Ask` — put it to a person through the seated transport and wait.
15
+ * - `Default` — assume the question's own default (or record a decline) and carry on. The caller
16
+ * is expected to RECORD the assumption; a run nobody is watching must never block.
17
+ * - `Refuse` — nobody may be asked at all; the attempt is an error.
18
+ */
19
+ export declare enum InquiryPolicy {
20
+ Ask = "ask",
21
+ Default = "default",
22
+ Refuse = "refuse"
23
+ }
24
+ /**
25
+ * The ONE ceiling on a stored answer, in characters. An answer is a decision, not a document.
26
+ *
27
+ * Every layer that carries an answer references this constant rather than choosing its own:
28
+ * `viable-common`'s `CONNECT_INQUIRY_MAX_TEXT` (the wire copy) equals it, `capAnswer` enforces it,
29
+ * and the connector's answer schema caps `text` at it. Three ceilings for one value is how a
30
+ * user's answer gets accepted on the wire and silently halved further in.
31
+ */
32
+ export declare const DEFAULT_INQUIRY_ANSWER_CHARS = 2000;
33
+ /** How many options one question may offer. Beyond this it is not a question. */
34
+ export declare const DEFAULT_INQUIRY_OPTIONS = 12;
35
+ /**
36
+ * How much of an answer's free text a resumable pipeline STATE may hold.
37
+ *
38
+ * A pipeline state is keys, markers and paths — a couple of full-size answers would make it prose,
39
+ * which is the invariant the whole pipeline design rests on. The decision (`value`/`declined`)
40
+ * stays whole; the prose is cut here and belongs in whatever document the application keeps for
41
+ * it (`stateAnswerOf`).
42
+ */
43
+ export declare const INQUIRY_STATE_TEXT_CHARS = 200;
44
+ /** The answer value of a confirmed {@link InquiryKind.Confirm}. */
45
+ export declare const CONFIRM_YES = "yes";
46
+ /** The answer value of a refused {@link InquiryKind.Confirm}. */
47
+ export declare const CONFIRM_NO = "no";
48
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/inquiry/consts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED;;;;;;;GAOG;AACH,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,OAAQ,CAAA;AAEjD,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,KAAK,CAAA;AAEzC;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAE3C,mEAAmE;AACnE,eAAO,MAAM,WAAW,QAAQ,CAAA;AAChC,iEAAiE;AACjE,eAAO,MAAM,UAAU,OAAO,CAAA"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * What shape of answer a question expects. Deliberately three, because a question a person is
3
+ * asked mid-run is answered in seconds or not at all: pick one of these, say it in your own
4
+ * words, or say yes/no. Anything richer is a form, and a form belongs to an application screen.
5
+ */
6
+ export var InquiryKind;
7
+ (function (InquiryKind) {
8
+ InquiryKind["Choice"] = "choice";
9
+ InquiryKind["Text"] = "text";
10
+ InquiryKind["Confirm"] = "confirm";
11
+ })(InquiryKind || (InquiryKind = {}));
12
+ /**
13
+ * What a run is allowed to do when it needs a decision that is not its own.
14
+ *
15
+ * - `Ask` — put it to a person through the seated transport and wait.
16
+ * - `Default` — assume the question's own default (or record a decline) and carry on. The caller
17
+ * is expected to RECORD the assumption; a run nobody is watching must never block.
18
+ * - `Refuse` — nobody may be asked at all; the attempt is an error.
19
+ */
20
+ export var InquiryPolicy;
21
+ (function (InquiryPolicy) {
22
+ InquiryPolicy["Ask"] = "ask";
23
+ InquiryPolicy["Default"] = "default";
24
+ InquiryPolicy["Refuse"] = "refuse";
25
+ })(InquiryPolicy || (InquiryPolicy = {}));
26
+ /**
27
+ * The ONE ceiling on a stored answer, in characters. An answer is a decision, not a document.
28
+ *
29
+ * Every layer that carries an answer references this constant rather than choosing its own:
30
+ * `viable-common`'s `CONNECT_INQUIRY_MAX_TEXT` (the wire copy) equals it, `capAnswer` enforces it,
31
+ * and the connector's answer schema caps `text` at it. Three ceilings for one value is how a
32
+ * user's answer gets accepted on the wire and silently halved further in.
33
+ */
34
+ export const DEFAULT_INQUIRY_ANSWER_CHARS = 2_000;
35
+ /** How many options one question may offer. Beyond this it is not a question. */
36
+ export const DEFAULT_INQUIRY_OPTIONS = 12;
37
+ /**
38
+ * How much of an answer's free text a resumable pipeline STATE may hold.
39
+ *
40
+ * A pipeline state is keys, markers and paths — a couple of full-size answers would make it prose,
41
+ * which is the invariant the whole pipeline design rests on. The decision (`value`/`declined`)
42
+ * stays whole; the prose is cut here and belongs in whatever document the application keeps for
43
+ * it (`stateAnswerOf`).
44
+ */
45
+ export const INQUIRY_STATE_TEXT_CHARS = 200;
46
+ /** The answer value of a confirmed {@link InquiryKind.Confirm}. */
47
+ export const CONFIRM_YES = 'yes';
48
+ /** The answer value of a refused {@link InquiryKind.Confirm}. */
49
+ export const CONFIRM_NO = 'no';
50
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/inquiry/consts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,kCAAmB,CAAA;AACrB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;AACnB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAA;AAEjD,iFAAiF;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAEzC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;AAE3C,mEAAmE;AACnE,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAA;AAChC,iEAAiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAA"}
@@ -0,0 +1,47 @@
1
+ import type { Inquiry, InquiryAnswer } from '../types.js';
2
+ /**
3
+ * Pure helpers over an inquiry and its answer — no IO, no state, no clock.
4
+ *
5
+ * They are here rather than in the runtime because every layer needs the same reading of an
6
+ * answer: the execution service, the pipeline runner, the `ask_user` tool, the connector and the
7
+ * screen that finally shows it. A second reading of "was this answered" is a second contract.
8
+ */
9
+ export interface InquiryHelper {
10
+ /**
11
+ * What to assume when nobody answers: the question's own default, or a decline.
12
+ *
13
+ * A decline is an ANSWER — the run carries on and records what it assumed — which is why this
14
+ * never throws and never returns null.
15
+ */
16
+ defaultAnswerFor: (inquiry: Inquiry) => InquiryAnswer;
17
+ /**
18
+ * The one thing an answer says, as a string — the first chosen value, else the free text, else
19
+ * `null` when it says nothing at all (a decline, or an empty answer).
20
+ */
21
+ answeredWith: (answer: InquiryAnswer) => string | null;
22
+ /** Nobody could decide. Distinct from an empty answer — see {@link InquiryHelper.answeredWith}. */
23
+ isDeclined: (answer: InquiryAnswer) => boolean;
24
+ /**
25
+ * Cut an answer's free TEXT to the ceiling and SAY SO.
26
+ *
27
+ * Only the prose is cut. A `value` IS the decision — for a choice it has to equal one of the
28
+ * question's own option values — so slicing one does not degrade an answer, it silently replaces
29
+ * it with an identifier nobody offered and nothing matches, which `answeredWith` then hands on as
30
+ * what the person chose. An over-long value is a defect upstream rather than a long answer (the
31
+ * connector's schema refuses one outright instead of shortening it), so it travels on whole and is
32
+ * REPORTED through `truncated` — the flag every consumer already reads as "this is not exactly
33
+ * what the person gave".
34
+ */
35
+ capAnswer: (answer: InquiryAnswer, max?: number) => InquiryAnswer;
36
+ /**
37
+ * The copy of an answer a resumable pipeline STATE keeps: the decision whole, the prose cut to
38
+ * {@link INQUIRY_STATE_TEXT_CHARS}.
39
+ *
40
+ * The full answer goes back to whoever asked; only this reduced one is persisted, so a run that
41
+ * asks several questions still holds a state made of keys rather than of paragraphs.
42
+ */
43
+ stateAnswerOf: (answer: InquiryAnswer) => InquiryAnswer;
44
+ /** One-line label of a question — for a note, a trace line or a run row. */
45
+ renderInquiry: (inquiry: Inquiry) => string;
46
+ }
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/inquiry/helper/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,gBAAgB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,aAAa,CAAA;IACrD;;;OAGG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,MAAM,GAAG,IAAI,CAAA;IACtD,mGAAmG;IACnG,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAA;IAC9C;;;;;;;;;;OAUG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,aAAa,CAAA;IACjE;;;;;;OAMG;IACH,aAAa,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,aAAa,CAAA;IACvD,4EAA4E;IAC5E,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;CAC5C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/inquiry/helper/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { InquiryHelper } from './helper/types.js';
2
+ export declare const createInquiryHelper: () => InquiryHelper;
3
+ export declare const inquiryHelper: InquiryHelper;
4
+ //# sourceMappingURL=helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/inquiry/helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD,eAAO,MAAM,mBAAmB,QAAO,aA8CtC,CAAA;AAED,eAAO,MAAM,aAAa,eAAwB,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { DEFAULT_INQUIRY_ANSWER_CHARS, INQUIRY_STATE_TEXT_CHARS } from './consts.js';
2
+ export const createInquiryHelper = () => {
3
+ const defaultAnswerFor = (inquiry) => inquiry.default != null
4
+ ? { inquiryId: inquiry.id, value: inquiry.default }
5
+ : { inquiryId: inquiry.id, declined: true };
6
+ const answeredWith = (answer) => {
7
+ const value = Array.isArray(answer.value) ? answer.value[0] : answer.value;
8
+ if (value != null && value !== '')
9
+ return value;
10
+ if (answer.text != null && answer.text !== '')
11
+ return answer.text;
12
+ return null;
13
+ };
14
+ const isDeclined = (answer) => answer.declined === true;
15
+ const capAnswer = (answer, max = DEFAULT_INQUIRY_ANSWER_CHARS) => {
16
+ const text = answer.text != null && answer.text.length > max
17
+ ? answer.text.slice(0, max)
18
+ : undefined;
19
+ const values = Array.isArray(answer.value)
20
+ ? answer.value
21
+ : answer.value != null ? [answer.value] : [];
22
+ const oversized = values.some(value => value.length > max);
23
+ if (text == null && !oversized)
24
+ return answer;
25
+ return { ...answer, ...(text != null ? { text } : {}), truncated: true };
26
+ };
27
+ const stateAnswerOf = (answer) => answer.text != null && answer.text.length > INQUIRY_STATE_TEXT_CHARS
28
+ ? { ...answer, text: answer.text.slice(0, INQUIRY_STATE_TEXT_CHARS), truncated: true }
29
+ : answer;
30
+ const renderInquiry = (inquiry) => {
31
+ const options = inquiry.options != null && inquiry.options.length > 0
32
+ ? ` (${inquiry.options.map(option => option.value).join(' | ')})`
33
+ : '';
34
+ return `[${inquiry.kind}] ${inquiry.question}${options}`.replace(/\s+/g, ' ').trim();
35
+ };
36
+ return { defaultAnswerFor, answeredWith, isDeclined, capAnswer, stateAnswerOf, renderInquiry };
37
+ };
38
+ export const inquiryHelper = createInquiryHelper();
39
+ //# sourceMappingURL=helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/inquiry/helper.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ export * from './consts.js';
2
+ export type * from './types.js';
3
+ export type * from './helper/types.js';
4
+ export * from './helper.js';
5
+ export * from './utils.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inquiry/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,mBAAmB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './consts.js';
2
+ export * from './helper.js';
3
+ export * from './utils.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inquiry/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAG3B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
@@ -0,0 +1,72 @@
1
+ import type { InquiryKind, InquiryPolicy } from './consts.js';
2
+ /**
3
+ * One question put to a person while a run is in flight, and the answer that comes back.
4
+ *
5
+ * Everything here is serializable for the same reason a delegated task is: whoever answers is
6
+ * outside this process — a browser dialog, a coding agent driving the application through a
7
+ * connector, a test double — and the question may outlive the process that asked it, parked on a
8
+ * pipeline run row until somebody comes back to it.
9
+ */
10
+ export interface InquiryOption {
11
+ value: string;
12
+ label: string;
13
+ description?: string;
14
+ }
15
+ export interface Inquiry {
16
+ /** Stable id, chosen by whoever asks. The ONLY thing that routes an answer back. */
17
+ id: string;
18
+ kind: InquiryKind;
19
+ /** One question, in plain words. */
20
+ question: string;
21
+ /** One or two sentences of background. Never the whole task. */
22
+ context?: string;
23
+ /** Required for {@link InquiryKind.Choice}; ignored otherwise. */
24
+ options?: InquiryOption[];
25
+ multiple?: boolean;
26
+ /** A `Choice` the answerer may answer in their own words instead. */
27
+ allowText?: boolean;
28
+ /** What to assume when nobody answers. {@link InquiryPolicy.Default} returns exactly this. */
29
+ default?: string | string[];
30
+ expiresAt?: string;
31
+ }
32
+ export interface InquiryAnswer {
33
+ inquiryId: string;
34
+ value?: string | string[];
35
+ text?: string;
36
+ /** Nobody could decide. A legitimate ANSWER, never a failure. */
37
+ declined?: boolean;
38
+ /**
39
+ * This answer is not exactly the one that was given. Never an answerer's own flag.
40
+ *
41
+ * Two writers, two ceilings: `capAnswer` cuts the text to `DEFAULT_INQUIRY_ANSWER_CHARS` (and
42
+ * raises this WITHOUT cutting when a `value` arrived over that ceiling, since a shortened
43
+ * identifier matches no option), while `stateAnswerOf` cuts the text again to the much smaller
44
+ * `INQUIRY_STATE_TEXT_CHARS` a pipeline state may hold. So a flag read back off a resumed run
45
+ * says the state's copy is short — not that the person hit the answer ceiling.
46
+ *
47
+ * It exists so no cut is silent: whoever records the answer can say that the rest of it was
48
+ * dropped, instead of the answerer discovering it in the work that followed.
49
+ */
50
+ truncated?: boolean;
51
+ }
52
+ /**
53
+ * How a question reaches a person.
54
+ *
55
+ * One method, like `DelegateTransport` beside it, and for the same reason: routing, waiting,
56
+ * redelivery and giving up all belong to whoever implements it. A transport that cannot serve the
57
+ * question must THROW rather than answer — a declined answer is a decision, while a channel that
58
+ * is not there is terminal, and the two must never look alike.
59
+ */
60
+ export interface InquiryTransport {
61
+ ask: (inquiry: Inquiry, signal?: AbortSignal) => Promise<InquiryAnswer>;
62
+ }
63
+ /**
64
+ * How one run may put a question to a person. Carried on an execution's serializable state, so a
65
+ * resumed run keeps the channel and the policy it was started with.
66
+ */
67
+ export interface InquiryConfig {
68
+ /** The key the application seated an {@link InquiryTransport} under. */
69
+ transport?: string;
70
+ policy: InquiryPolicy;
71
+ }
72
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/inquiry/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE7D;;;;;;;GAOG;AAEH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,oFAAoF;IACpF,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,WAAW,CAAA;IACjB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kEAAkE;IAClE,OAAO,CAAC,EAAE,aAAa,EAAE,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,8FAA8F;IAC9F,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;CACxE;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,aAAa,CAAA;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/inquiry/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import type { Inquiry, InquiryAnswer } from './types.js';
2
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.defaultAnswerFor(…)` */
3
+ export declare const defaultAnswerFor: (inquiry: Inquiry) => InquiryAnswer;
4
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.answeredWith(…)` */
5
+ export declare const answeredWith: (answer: InquiryAnswer) => string | null;
6
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.isDeclined(…)` */
7
+ export declare const isDeclined: (answer: InquiryAnswer) => boolean;
8
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.capAnswer(…)` */
9
+ export declare const capAnswer: (answer: InquiryAnswer, max?: number) => InquiryAnswer;
10
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.stateAnswerOf(…)` */
11
+ export declare const stateAnswerOf: (answer: InquiryAnswer) => InquiryAnswer;
12
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.renderInquiry(…)` */
13
+ export declare const renderInquiry: (inquiry: Inquiry) => string;
14
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/inquiry/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAExD,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,YAAa,OAAO,KAAG,aAAwD,CAAA;AAE5G,gFAAgF;AAChF,eAAO,MAAM,YAAY,WAAY,aAAa,KAAG,MAAM,GAAG,IAA0C,CAAA;AAExG,8EAA8E;AAC9E,eAAO,MAAM,UAAU,WAAY,aAAa,KAAG,OAA2C,CAAA;AAE9F,6EAA6E;AAC7E,eAAO,MAAM,SAAS,WAAY,aAAa,QAAQ,MAAM,KAAG,aAAqD,CAAA;AAErH,iFAAiF;AACjF,eAAO,MAAM,aAAa,WAAY,aAAa,KAAG,aAAoD,CAAA;AAE1G,iFAAiF;AACjF,eAAO,MAAM,aAAa,YAAa,OAAO,KAAG,MAA8C,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { inquiryHelper } from './helper.js';
2
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.defaultAnswerFor(…)` */
3
+ export const defaultAnswerFor = (inquiry) => inquiryHelper.defaultAnswerFor(inquiry);
4
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.answeredWith(…)` */
5
+ export const answeredWith = (answer) => inquiryHelper.answeredWith(answer);
6
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.isDeclined(…)` */
7
+ export const isDeclined = (answer) => inquiryHelper.isDeclined(answer);
8
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.capAnswer(…)` */
9
+ export const capAnswer = (answer, max) => inquiryHelper.capAnswer(answer, max);
10
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.stateAnswerOf(…)` */
11
+ export const stateAnswerOf = (answer) => inquiryHelper.stateAnswerOf(answer);
12
+ /** @deprecated compat:factory-refactor — use `inquiryHelper.renderInquiry(…)` */
13
+ export const renderInquiry = (inquiry) => inquiryHelper.renderInquiry(inquiry);
14
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/inquiry/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,oFAAoF;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAgB,EAAiB,EAAE,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;AAE5G,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAqB,EAAiB,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;AAExG,8EAA8E;AAC9E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAqB,EAAW,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;AAE9F,6EAA6E;AAC7E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAqB,EAAE,GAAY,EAAiB,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAErH,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAqB,EAAiB,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;AAE1G,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAU,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The fixed wording that introduces a {@link CumulativeResults} view in a prompt.
3
+ *
4
+ * Written for the WEAKEST model a pipeline may run on, so every rule is literal and says what to do
5
+ * rather than what to consider. It is a pure constant — no interpolation, no clock — because it
6
+ * opens a block that recurs verbatim on every call of a step, and the rules are the reason the
7
+ * block exists at all: a list of names with no instruction attached is read as a suggestion, and a
8
+ * suggestion is exactly what a model re-derives, renames or re-cases.
9
+ *
10
+ * The last rules carry the list's own limits. It is written between steps and can go stale in ways
11
+ * a live file read cannot, so a file actually shown in the conversation must win; and it may leave
12
+ * things out for space, so "not listed" means "does not exist yet" only when nothing was left out.
13
+ */
14
+ export declare const CUMULATIVE_RESULTS_PREAMBLE = "## Results of earlier steps\n\nEverything below was read from the project's files by code, after each earlier step of this work finished. No model wrote it.\n\nRules for using it:\n- These are the AUTHORITATIVE names produced by earlier steps. Use every name, path and import specifier exactly as written here. Never re-derive, rename, re-case or guess a different path.\n- Import a listed symbol only from the specifier listed for it.\n- Never declare anything listed here a second time. Import it, call it or extend it instead.\n- Anything the current task needs that this list does not contain does not exist yet, unless the list says it left something out for space; then look in the project's files first. Create a missing thing only if the task says to, and never under a name that merely resembles a listed one.\n- A source file actually shown elsewhere in this conversation is NEWER than this list and wins wherever the two disagree: this list can go stale between steps, a file you are shown cannot.\n- An entry marked \"(names only)\" lists names without their detail. Read that file before relying on its shape.\n- A summary marked \"(not verified)\" was written by a model and never checked against the files. Treat it as a hint, never as a fact.";
15
+ /** Opens the line naming the steps a view left out for space. The names follow it. */
16
+ export declare const CUMULATIVE_RESULTS_OMITTED_LEAD = "Not listed here for space:";
17
+ /** Closes that line — what the model is to do about a step it cannot see. */
18
+ export declare const CUMULATIVE_RESULTS_OMITTED_TAIL = "Those steps finished and what they made exists in the project's files. Look there before creating anything they may already have made.";
19
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/results/consts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,+uCAW6F,CAAA;AAErI,sFAAsF;AACtF,eAAO,MAAM,+BAA+B,+BAA+B,CAAA;AAE3E,6EAA6E;AAC7E,eAAO,MAAM,+BAA+B,2IAC+F,CAAA"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The fixed wording that introduces a {@link CumulativeResults} view in a prompt.
3
+ *
4
+ * Written for the WEAKEST model a pipeline may run on, so every rule is literal and says what to do
5
+ * rather than what to consider. It is a pure constant — no interpolation, no clock — because it
6
+ * opens a block that recurs verbatim on every call of a step, and the rules are the reason the
7
+ * block exists at all: a list of names with no instruction attached is read as a suggestion, and a
8
+ * suggestion is exactly what a model re-derives, renames or re-cases.
9
+ *
10
+ * The last rules carry the list's own limits. It is written between steps and can go stale in ways
11
+ * a live file read cannot, so a file actually shown in the conversation must win; and it may leave
12
+ * things out for space, so "not listed" means "does not exist yet" only when nothing was left out.
13
+ */
14
+ export const CUMULATIVE_RESULTS_PREAMBLE = `## Results of earlier steps
15
+
16
+ Everything below was read from the project's files by code, after each earlier step of this work finished. No model wrote it.
17
+
18
+ Rules for using it:
19
+ - These are the AUTHORITATIVE names produced by earlier steps. Use every name, path and import specifier exactly as written here. Never re-derive, rename, re-case or guess a different path.
20
+ - Import a listed symbol only from the specifier listed for it.
21
+ - Never declare anything listed here a second time. Import it, call it or extend it instead.
22
+ - Anything the current task needs that this list does not contain does not exist yet, unless the list says it left something out for space; then look in the project's files first. Create a missing thing only if the task says to, and never under a name that merely resembles a listed one.
23
+ - A source file actually shown elsewhere in this conversation is NEWER than this list and wins wherever the two disagree: this list can go stale between steps, a file you are shown cannot.
24
+ - An entry marked "(names only)" lists names without their detail. Read that file before relying on its shape.
25
+ - A summary marked "(not verified)" was written by a model and never checked against the files. Treat it as a hint, never as a fact.`;
26
+ /** Opens the line naming the steps a view left out for space. The names follow it. */
27
+ export const CUMULATIVE_RESULTS_OMITTED_LEAD = 'Not listed here for space:';
28
+ /** Closes that line — what the model is to do about a step it cannot see. */
29
+ export const CUMULATIVE_RESULTS_OMITTED_TAIL = 'Those steps finished and what they made exists in the project\'s files. Look there before creating anything they may already have made.';
30
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/results/consts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;qIAW0F,CAAA;AAErI,sFAAsF;AACtF,MAAM,CAAC,MAAM,+BAA+B,GAAG,4BAA4B,CAAA;AAE3E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,+BAA+B,GAC1C,yIAAyI,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** Separator between sections — the same two newlines every other prompt join uses. */
2
+ export declare const SEPARATOR = "\n\n";
3
+ //# sourceMappingURL=consts.local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/results/consts.local.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,eAAO,MAAM,SAAS,SAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** Separator between sections — the same two newlines every other prompt join uses. */
2
+ export const SEPARATOR = '\n\n';
3
+ //# sourceMappingURL=consts.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/results/consts.local.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './consts.js';
2
+ export type * from './types.js';
3
+ export * from './utils.js';
4
+ //# sourceMappingURL=index.d.ts.map