codeassembly-agent-logic 0.0.0 → 0.2.0
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.
- package/.meta/changelog.json +105 -0
- package/CHANGELOG.md +38 -0
- package/LICENSE +7 -0
- package/README.md +77 -1
- package/bin/agent-logic.js +26 -0
- package/dist/esm/cli/check-coverage-command.d.ts +3 -0
- package/dist/esm/cli/check-coverage-command.js +99 -0
- package/dist/esm/cli/convert-command.d.ts +3 -0
- package/dist/esm/cli/convert-command.js +116 -0
- package/dist/esm/cli/find-package-root.d.ts +7 -0
- package/dist/esm/cli/find-package-root.js +31 -0
- package/dist/esm/cli/index.d.ts +1 -0
- package/dist/esm/cli/index.js +11 -0
- package/dist/esm/cli/run.d.ts +8 -0
- package/dist/esm/cli/run.js +62 -0
- package/dist/esm/contract/built-in-harnesses.d.ts +22 -0
- package/dist/esm/contract/built-in-harnesses.js +30 -0
- package/dist/esm/contract/conversion-job.d.ts +36 -0
- package/dist/esm/contract/conversion-job.js +17 -0
- package/dist/esm/contract/index.d.ts +4 -0
- package/dist/esm/contract/index.js +3 -0
- package/dist/esm/contract/viewer-contract.d.ts +804 -0
- package/dist/esm/contract/viewer-contract.js +38 -0
- package/dist/esm/convert/convert-prompt.d.ts +21 -0
- package/dist/esm/convert/convert-prompt.js +60 -0
- package/dist/esm/convert/draft-schema.d.ts +308 -0
- package/dist/esm/convert/draft-schema.js +57 -0
- package/dist/esm/convert/find-gate-spans.d.ts +6 -0
- package/dist/esm/convert/find-gate-spans.js +18 -0
- package/dist/esm/convert/format-state-name.d.ts +6 -0
- package/dist/esm/convert/format-state-name.js +6 -0
- package/dist/esm/convert/normalize-config.d.ts +11 -0
- package/dist/esm/convert/normalize-config.js +164 -0
- package/dist/esm/convert/resolve-quotes.d.ts +18 -0
- package/dist/esm/convert/resolve-quotes.js +169 -0
- package/dist/esm/convert/sanitize-name.d.ts +5 -0
- package/dist/esm/convert/sanitize-name.js +8 -0
- package/dist/esm/coverage-map/check-coverage.d.ts +20 -0
- package/dist/esm/coverage-map/check-coverage.js +21 -0
- package/dist/esm/coverage-map/coverage-map-schema.d.ts +11 -0
- package/dist/esm/coverage-map/coverage-map-schema.js +2 -0
- package/dist/esm/coverage-map/find-prompt-blocks.d.ts +15 -0
- package/dist/esm/coverage-map/find-prompt-blocks.js +140 -0
- package/dist/esm/examples/change-approval.d.ts +2 -0
- package/dist/esm/examples/change-approval.js +438 -0
- package/dist/esm/examples/examples.d.ts +9 -0
- package/dist/esm/examples/examples.js +8 -0
- package/dist/esm/examples/password-reset.d.ts +2 -0
- package/dist/esm/examples/password-reset.js +235 -0
- package/dist/esm/examples/refund-request.d.ts +2 -0
- package/dist/esm/examples/refund-request.js +233 -0
- package/dist/esm/index.d.ts +14 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/layout/build-elk-graph.d.ts +18 -0
- package/dist/esm/layout/build-elk-graph.js +96 -0
- package/dist/esm/layout/card-limits.d.ts +8 -0
- package/dist/esm/layout/card-limits.js +4 -0
- package/dist/esm/layout/describe-config.d.ts +118 -0
- package/dist/esm/layout/describe-config.js +199 -0
- package/dist/esm/layout/layout-config.d.ts +5 -0
- package/dist/esm/layout/layout-config.js +73 -0
- package/dist/esm/layout/layout-metrics.d.ts +6 -0
- package/dist/esm/layout/layout-metrics.js +6 -0
- package/dist/esm/layout/pack-preamble.d.ts +20 -0
- package/dist/esm/layout/pack-preamble.js +66 -0
- package/dist/esm/layout/to-flow-elements.d.ts +46 -0
- package/dist/esm/layout/to-flow-elements.js +83 -0
- package/dist/esm/react/canvas/AmbientSelectionContext.d.ts +7 -0
- package/dist/esm/react/canvas/AmbientSelectionContext.js +5 -0
- package/dist/esm/react/canvas/DetailLevelContext.d.ts +3 -0
- package/dist/esm/react/canvas/DetailLevelContext.js +2 -0
- package/dist/esm/react/canvas/FocusNavigation.d.ts +8 -0
- package/dist/esm/react/canvas/FocusNavigation.js +92 -0
- package/dist/esm/react/canvas/StateNode.d.ts +5 -0
- package/dist/esm/react/canvas/StateNode.js +91 -0
- package/dist/esm/react/canvas/StatechartCanvas.d.ts +16 -0
- package/dist/esm/react/canvas/StatechartCanvas.js +184 -0
- package/dist/esm/react/canvas/TransitionEdge.d.ts +5 -0
- package/dist/esm/react/canvas/TransitionEdge.js +22 -0
- package/dist/esm/react/canvas/canvas-key-entries.d.ts +14 -0
- package/dist/esm/react/canvas/canvas-key-entries.js +51 -0
- package/dist/esm/react/canvas/find-element-box.d.ts +8 -0
- package/dist/esm/react/canvas/find-element-box.js +25 -0
- package/dist/esm/react/canvas/find-view-centre.d.ts +15 -0
- package/dist/esm/react/canvas/find-view-centre.js +16 -0
- package/dist/esm/react/canvas/list-chart-marks.d.ts +5 -0
- package/dist/esm/react/canvas/list-chart-marks.js +37 -0
- package/dist/esm/react/canvas/marks.d.ts +19 -0
- package/dist/esm/react/canvas/marks.js +24 -0
- package/dist/esm/react/canvas/useNewLayout.d.ts +17 -0
- package/dist/esm/react/canvas/useNewLayout.js +44 -0
- package/dist/esm/react/canvas/zoom-levels.d.ts +28 -0
- package/dist/esm/react/canvas/zoom-levels.js +54 -0
- package/dist/esm/react/hooks/conversion-client.d.ts +77 -0
- package/dist/esm/react/hooks/conversion-client.js +132 -0
- package/dist/esm/react/hooks/describe-agent-selection.d.ts +6 -0
- package/dist/esm/react/hooks/describe-agent-selection.js +18 -0
- package/dist/esm/react/hooks/describe-load-outcome.d.ts +13 -0
- package/dist/esm/react/hooks/describe-load-outcome.js +30 -0
- package/dist/esm/react/hooks/download-config.d.ts +6 -0
- package/dist/esm/react/hooks/download-config.js +11 -0
- package/dist/esm/react/hooks/example-location.d.ts +7 -0
- package/dist/esm/react/hooks/example-location.js +14 -0
- package/dist/esm/react/hooks/label-source.d.ts +21 -0
- package/dist/esm/react/hooks/label-source.js +19 -0
- package/dist/esm/react/hooks/parse-config-text.d.ts +16 -0
- package/dist/esm/react/hooks/parse-config-text.js +38 -0
- package/dist/esm/react/hooks/useAgentBridge.d.ts +28 -0
- package/dist/esm/react/hooks/useAgentBridge.js +52 -0
- package/dist/esm/react/hooks/useAgentSync.d.ts +29 -0
- package/dist/esm/react/hooks/useAgentSync.js +75 -0
- package/dist/esm/react/hooks/useChartLayout.d.ts +25 -0
- package/dist/esm/react/hooks/useChartLayout.js +29 -0
- package/dist/esm/react/hooks/useConversion.d.ts +31 -0
- package/dist/esm/react/hooks/useConversion.js +177 -0
- package/dist/esm/react/hooks/useConvertDraft.d.ts +18 -0
- package/dist/esm/react/hooks/useConvertDraft.js +11 -0
- package/dist/esm/react/hooks/useDocumentTitle.d.ts +2 -0
- package/dist/esm/react/hooks/useDocumentTitle.js +7 -0
- package/dist/esm/react/hooks/useEscapeToClear.d.ts +2 -0
- package/dist/esm/react/hooks/useEscapeToClear.js +16 -0
- package/dist/esm/react/hooks/useHarnessList.d.ts +26 -0
- package/dist/esm/react/hooks/useHarnessList.js +24 -0
- package/dist/esm/react/hooks/usePromptDirectory.d.ts +27 -0
- package/dist/esm/react/hooks/usePromptDirectory.js +34 -0
- package/dist/esm/react/hooks/useSelection.d.ts +17 -0
- package/dist/esm/react/hooks/useSelection.js +21 -0
- package/dist/esm/react/hooks/useShowAmbient.d.ts +7 -0
- package/dist/esm/react/hooks/useShowAmbient.js +22 -0
- package/dist/esm/react/hooks/useUnknownExample.d.ts +7 -0
- package/dist/esm/react/hooks/useUnknownExample.js +26 -0
- package/dist/esm/react/index.d.ts +24 -0
- package/dist/esm/react/index.js +23 -0
- package/dist/esm/react/styles.css +482 -0
- package/dist/esm/schema/agent-logic-schema.d.ts +439 -0
- package/dist/esm/schema/agent-logic-schema.js +100 -0
- package/dist/esm/schema/config-traversal.d.ts +19 -0
- package/dist/esm/schema/config-traversal.js +32 -0
- package/dist/esm/schema/validate-config.d.ts +17 -0
- package/dist/esm/schema/validate-config.js +205 -0
- package/dist/esm/schema/write-json-schema.d.ts +4 -0
- package/dist/esm/schema/write-json-schema.js +12 -0
- package/dist/esm/server/conversion-job-implementation.d.ts +11 -0
- package/dist/esm/server/conversion-job-implementation.js +84 -0
- package/dist/esm/server/create-prompts-app.d.ts +26 -0
- package/dist/esm/server/create-prompts-app.js +41 -0
- package/dist/esm/server/create-viewer-server-plugins.d.ts +15 -0
- package/dist/esm/server/create-viewer-server-plugins.js +76 -0
- package/dist/esm/server/index.d.ts +7 -0
- package/dist/esm/server/index.js +6 -0
- package/dist/esm/server/prompt-directory-schemas.d.ts +30 -0
- package/dist/esm/server/prompt-directory-schemas.js +11 -0
- package/dist/esm/server/prompt-directory.d.ts +40 -0
- package/dist/esm/server/prompt-directory.js +86 -0
- package/dist/esm/server/viewer-contract-implementation.d.ts +12 -0
- package/dist/esm/server/viewer-contract-implementation.js +85 -0
- package/dist/esm/source/fence.d.ts +16 -0
- package/dist/esm/source/fence.js +15 -0
- package/dist/esm/source/find-comment-spans.d.ts +6 -0
- package/dist/esm/source/find-comment-spans.js +60 -0
- package/dist/esm/source/find-occurrences.d.ts +2 -0
- package/dist/esm/source/find-occurrences.js +7 -0
- package/dist/esm/source/prompt-segments.d.ts +21 -0
- package/dist/esm/source/prompt-segments.js +65 -0
- package/docs/conversion-agreement.md +37 -0
- package/docs/corpus.md +19 -0
- package/docs/extraction-rules.md +123 -0
- package/package.json +108 -2
- package/schema/agent-logic.schema.json +475 -0
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** A half-open range of UTF-16 offsets into the config's prompt text. */
|
|
3
|
+
export declare const spanSchema: z.ZodObject<{
|
|
4
|
+
start: z.ZodInt;
|
|
5
|
+
end: z.ZodInt;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
/** A guard, stated in natural language, and the shape that an action extends. */
|
|
8
|
+
export declare const nlEntrySchema: z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"nl">;
|
|
10
|
+
params: z.ZodObject<{
|
|
11
|
+
text: z.ZodString;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
/** An action, stated in natural language; a gated action quotes its gate. */
|
|
15
|
+
export declare const actionSchema: z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"nl">;
|
|
17
|
+
params: z.ZodObject<{
|
|
18
|
+
text: z.ZodString;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
source: z.ZodObject<{
|
|
22
|
+
start: z.ZodInt;
|
|
23
|
+
end: z.ZodInt;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
gate: z.ZodLiteral<true>;
|
|
26
|
+
}, z.core.$strict>>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
/** The span of an ambient instruction. */
|
|
29
|
+
export declare const ambientSpanSchema: z.ZodObject<{
|
|
30
|
+
start: z.ZodInt;
|
|
31
|
+
end: z.ZodInt;
|
|
32
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
/** The kinds of flaw that a converter can judge from the prompt's prose but that the chart's structure does not show. */
|
|
35
|
+
export declare const findingKindSchema: z.ZodEnum<{
|
|
36
|
+
contradiction: "contradiction";
|
|
37
|
+
"unused-input": "unused-input";
|
|
38
|
+
"unhandled-case": "unhandled-case";
|
|
39
|
+
"inferred-resolution": "inferred-resolution";
|
|
40
|
+
}>;
|
|
41
|
+
/** A flaw in the prompt as judged by the converter, with the passages that show it. */
|
|
42
|
+
export declare const findingSchema: z.ZodObject<{
|
|
43
|
+
kind: z.ZodEnum<{
|
|
44
|
+
contradiction: "contradiction";
|
|
45
|
+
"unused-input": "unused-input";
|
|
46
|
+
"unhandled-case": "unhandled-case";
|
|
47
|
+
"inferred-resolution": "inferred-resolution";
|
|
48
|
+
}>;
|
|
49
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
50
|
+
start: z.ZodInt;
|
|
51
|
+
end: z.ZodInt;
|
|
52
|
+
}, z.core.$strict>>;
|
|
53
|
+
reason: z.ZodString;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
declare const elementMetaSchema: z.ZodObject<{
|
|
56
|
+
source: z.ZodObject<{
|
|
57
|
+
start: z.ZodInt;
|
|
58
|
+
end: z.ZodInt;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
inferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
61
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
62
|
+
ambient: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63
|
+
start: z.ZodInt;
|
|
64
|
+
end: z.ZodInt;
|
|
65
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
66
|
+
}, z.core.$strict>>>;
|
|
67
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
+
kind: z.ZodEnum<{
|
|
69
|
+
contradiction: "contradiction";
|
|
70
|
+
"unused-input": "unused-input";
|
|
71
|
+
"unhandled-case": "unhandled-case";
|
|
72
|
+
"inferred-resolution": "inferred-resolution";
|
|
73
|
+
}>;
|
|
74
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
75
|
+
start: z.ZodInt;
|
|
76
|
+
end: z.ZodInt;
|
|
77
|
+
}, z.core.$strict>>;
|
|
78
|
+
reason: z.ZodString;
|
|
79
|
+
}, z.core.$strict>>>;
|
|
80
|
+
}, z.core.$strict>;
|
|
81
|
+
declare const stateMetaSchema: z.ZodObject<{
|
|
82
|
+
source: z.ZodObject<{
|
|
83
|
+
start: z.ZodInt;
|
|
84
|
+
end: z.ZodInt;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
inferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
87
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
88
|
+
ambient: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
89
|
+
start: z.ZodInt;
|
|
90
|
+
end: z.ZodInt;
|
|
91
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
92
|
+
}, z.core.$strict>>>;
|
|
93
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
94
|
+
kind: z.ZodEnum<{
|
|
95
|
+
contradiction: "contradiction";
|
|
96
|
+
"unused-input": "unused-input";
|
|
97
|
+
"unhandled-case": "unhandled-case";
|
|
98
|
+
"inferred-resolution": "inferred-resolution";
|
|
99
|
+
}>;
|
|
100
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
101
|
+
start: z.ZodInt;
|
|
102
|
+
end: z.ZodInt;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
reason: z.ZodString;
|
|
105
|
+
}, z.core.$strict>>>;
|
|
106
|
+
name: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
export declare const transitionSchema: z.ZodObject<{
|
|
109
|
+
target: z.ZodOptional<z.ZodString>;
|
|
110
|
+
guard: z.ZodOptional<z.ZodObject<{
|
|
111
|
+
type: z.ZodLiteral<"nl">;
|
|
112
|
+
params: z.ZodObject<{
|
|
113
|
+
text: z.ZodString;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
}, z.core.$strict>>;
|
|
116
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
117
|
+
type: z.ZodLiteral<"nl">;
|
|
118
|
+
params: z.ZodObject<{
|
|
119
|
+
text: z.ZodString;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
source: z.ZodObject<{
|
|
123
|
+
start: z.ZodInt;
|
|
124
|
+
end: z.ZodInt;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
gate: z.ZodLiteral<true>;
|
|
127
|
+
}, z.core.$strict>>;
|
|
128
|
+
}, z.core.$strict>>>;
|
|
129
|
+
meta: z.ZodObject<{
|
|
130
|
+
source: z.ZodObject<{
|
|
131
|
+
start: z.ZodInt;
|
|
132
|
+
end: z.ZodInt;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
inferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
135
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
136
|
+
ambient: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
137
|
+
start: z.ZodInt;
|
|
138
|
+
end: z.ZodInt;
|
|
139
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
140
|
+
}, z.core.$strict>>>;
|
|
141
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
142
|
+
kind: z.ZodEnum<{
|
|
143
|
+
contradiction: "contradiction";
|
|
144
|
+
"unused-input": "unused-input";
|
|
145
|
+
"unhandled-case": "unhandled-case";
|
|
146
|
+
"inferred-resolution": "inferred-resolution";
|
|
147
|
+
}>;
|
|
148
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
149
|
+
start: z.ZodInt;
|
|
150
|
+
end: z.ZodInt;
|
|
151
|
+
}, z.core.$strict>>;
|
|
152
|
+
reason: z.ZodString;
|
|
153
|
+
}, z.core.$strict>>>;
|
|
154
|
+
}, z.core.$strict>;
|
|
155
|
+
}, z.core.$strict>;
|
|
156
|
+
export declare const eventNameSchema: z.ZodString;
|
|
157
|
+
/** A state below the root. Declared by hand because zod cannot infer a recursive type. */
|
|
158
|
+
export interface StateConfig {
|
|
159
|
+
id: string;
|
|
160
|
+
type?: 'final' | undefined;
|
|
161
|
+
initial?: string | undefined;
|
|
162
|
+
states?: Record<string, StateConfig> | undefined;
|
|
163
|
+
on?: Record<string, TransitionConfig | TransitionConfig[]> | undefined;
|
|
164
|
+
always?: TransitionConfig | TransitionConfig[] | undefined;
|
|
165
|
+
entry?: Action[] | undefined;
|
|
166
|
+
exit?: Action[] | undefined;
|
|
167
|
+
meta: StateMeta;
|
|
168
|
+
}
|
|
169
|
+
export declare const stateSchema: z.ZodType<StateConfig>;
|
|
170
|
+
export declare const unconvertedSpanSchema: z.ZodObject<{
|
|
171
|
+
start: z.ZodInt;
|
|
172
|
+
end: z.ZodInt;
|
|
173
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
/** The agent-logic representation: an XState v5 machine config whose root contains the prompt that it describes. */
|
|
176
|
+
export declare const agentLogicConfigSchema: z.ZodObject<{
|
|
177
|
+
initial: z.ZodString;
|
|
178
|
+
states: z.ZodRecord<z.ZodString, z.ZodType<StateConfig, unknown, z.core.$ZodTypeInternals<StateConfig, unknown>>>;
|
|
179
|
+
meta: z.ZodObject<{
|
|
180
|
+
name: z.ZodOptional<z.ZodString>;
|
|
181
|
+
prompt: z.ZodString;
|
|
182
|
+
source: z.ZodObject<{
|
|
183
|
+
start: z.ZodInt;
|
|
184
|
+
end: z.ZodInt;
|
|
185
|
+
}, z.core.$strict>;
|
|
186
|
+
unconverted: z.ZodArray<z.ZodObject<{
|
|
187
|
+
start: z.ZodInt;
|
|
188
|
+
end: z.ZodInt;
|
|
189
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strict>>;
|
|
191
|
+
ambient: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
192
|
+
start: z.ZodInt;
|
|
193
|
+
end: z.ZodInt;
|
|
194
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
195
|
+
}, z.core.$strict>>>;
|
|
196
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
197
|
+
kind: z.ZodEnum<{
|
|
198
|
+
contradiction: "contradiction";
|
|
199
|
+
"unused-input": "unused-input";
|
|
200
|
+
"unhandled-case": "unhandled-case";
|
|
201
|
+
"inferred-resolution": "inferred-resolution";
|
|
202
|
+
}>;
|
|
203
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
204
|
+
start: z.ZodInt;
|
|
205
|
+
end: z.ZodInt;
|
|
206
|
+
}, z.core.$strict>>;
|
|
207
|
+
reason: z.ZodString;
|
|
208
|
+
}, z.core.$strict>>>;
|
|
209
|
+
}, z.core.$strict>;
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
on: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
212
|
+
target: z.ZodOptional<z.ZodString>;
|
|
213
|
+
guard: z.ZodOptional<z.ZodObject<{
|
|
214
|
+
type: z.ZodLiteral<"nl">;
|
|
215
|
+
params: z.ZodObject<{
|
|
216
|
+
text: z.ZodString;
|
|
217
|
+
}, z.core.$strict>;
|
|
218
|
+
}, z.core.$strict>>;
|
|
219
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
220
|
+
type: z.ZodLiteral<"nl">;
|
|
221
|
+
params: z.ZodObject<{
|
|
222
|
+
text: z.ZodString;
|
|
223
|
+
}, z.core.$strict>;
|
|
224
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
source: z.ZodObject<{
|
|
226
|
+
start: z.ZodInt;
|
|
227
|
+
end: z.ZodInt;
|
|
228
|
+
}, z.core.$strict>;
|
|
229
|
+
gate: z.ZodLiteral<true>;
|
|
230
|
+
}, z.core.$strict>>;
|
|
231
|
+
}, z.core.$strict>>>;
|
|
232
|
+
meta: z.ZodObject<{
|
|
233
|
+
source: z.ZodObject<{
|
|
234
|
+
start: z.ZodInt;
|
|
235
|
+
end: z.ZodInt;
|
|
236
|
+
}, z.core.$strict>;
|
|
237
|
+
inferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
238
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
239
|
+
ambient: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
240
|
+
start: z.ZodInt;
|
|
241
|
+
end: z.ZodInt;
|
|
242
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
243
|
+
}, z.core.$strict>>>;
|
|
244
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
245
|
+
kind: z.ZodEnum<{
|
|
246
|
+
contradiction: "contradiction";
|
|
247
|
+
"unused-input": "unused-input";
|
|
248
|
+
"unhandled-case": "unhandled-case";
|
|
249
|
+
"inferred-resolution": "inferred-resolution";
|
|
250
|
+
}>;
|
|
251
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
252
|
+
start: z.ZodInt;
|
|
253
|
+
end: z.ZodInt;
|
|
254
|
+
}, z.core.$strict>>;
|
|
255
|
+
reason: z.ZodString;
|
|
256
|
+
}, z.core.$strict>>>;
|
|
257
|
+
}, z.core.$strict>;
|
|
258
|
+
}, z.core.$strict>, z.ZodArray<z.ZodObject<{
|
|
259
|
+
target: z.ZodOptional<z.ZodString>;
|
|
260
|
+
guard: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
type: z.ZodLiteral<"nl">;
|
|
262
|
+
params: z.ZodObject<{
|
|
263
|
+
text: z.ZodString;
|
|
264
|
+
}, z.core.$strict>;
|
|
265
|
+
}, z.core.$strict>>;
|
|
266
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
267
|
+
type: z.ZodLiteral<"nl">;
|
|
268
|
+
params: z.ZodObject<{
|
|
269
|
+
text: z.ZodString;
|
|
270
|
+
}, z.core.$strict>;
|
|
271
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
source: z.ZodObject<{
|
|
273
|
+
start: z.ZodInt;
|
|
274
|
+
end: z.ZodInt;
|
|
275
|
+
}, z.core.$strict>;
|
|
276
|
+
gate: z.ZodLiteral<true>;
|
|
277
|
+
}, z.core.$strict>>;
|
|
278
|
+
}, z.core.$strict>>>;
|
|
279
|
+
meta: z.ZodObject<{
|
|
280
|
+
source: z.ZodObject<{
|
|
281
|
+
start: z.ZodInt;
|
|
282
|
+
end: z.ZodInt;
|
|
283
|
+
}, z.core.$strict>;
|
|
284
|
+
inferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
285
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
286
|
+
ambient: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
287
|
+
start: z.ZodInt;
|
|
288
|
+
end: z.ZodInt;
|
|
289
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
290
|
+
}, z.core.$strict>>>;
|
|
291
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
292
|
+
kind: z.ZodEnum<{
|
|
293
|
+
contradiction: "contradiction";
|
|
294
|
+
"unused-input": "unused-input";
|
|
295
|
+
"unhandled-case": "unhandled-case";
|
|
296
|
+
"inferred-resolution": "inferred-resolution";
|
|
297
|
+
}>;
|
|
298
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
299
|
+
start: z.ZodInt;
|
|
300
|
+
end: z.ZodInt;
|
|
301
|
+
}, z.core.$strict>>;
|
|
302
|
+
reason: z.ZodString;
|
|
303
|
+
}, z.core.$strict>>>;
|
|
304
|
+
}, z.core.$strict>;
|
|
305
|
+
}, z.core.$strict>>]>>>;
|
|
306
|
+
always: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
307
|
+
target: z.ZodOptional<z.ZodString>;
|
|
308
|
+
guard: z.ZodOptional<z.ZodObject<{
|
|
309
|
+
type: z.ZodLiteral<"nl">;
|
|
310
|
+
params: z.ZodObject<{
|
|
311
|
+
text: z.ZodString;
|
|
312
|
+
}, z.core.$strict>;
|
|
313
|
+
}, z.core.$strict>>;
|
|
314
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
315
|
+
type: z.ZodLiteral<"nl">;
|
|
316
|
+
params: z.ZodObject<{
|
|
317
|
+
text: z.ZodString;
|
|
318
|
+
}, z.core.$strict>;
|
|
319
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
320
|
+
source: z.ZodObject<{
|
|
321
|
+
start: z.ZodInt;
|
|
322
|
+
end: z.ZodInt;
|
|
323
|
+
}, z.core.$strict>;
|
|
324
|
+
gate: z.ZodLiteral<true>;
|
|
325
|
+
}, z.core.$strict>>;
|
|
326
|
+
}, z.core.$strict>>>;
|
|
327
|
+
meta: z.ZodObject<{
|
|
328
|
+
source: z.ZodObject<{
|
|
329
|
+
start: z.ZodInt;
|
|
330
|
+
end: z.ZodInt;
|
|
331
|
+
}, z.core.$strict>;
|
|
332
|
+
inferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
333
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
334
|
+
ambient: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
335
|
+
start: z.ZodInt;
|
|
336
|
+
end: z.ZodInt;
|
|
337
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
338
|
+
}, z.core.$strict>>>;
|
|
339
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
340
|
+
kind: z.ZodEnum<{
|
|
341
|
+
contradiction: "contradiction";
|
|
342
|
+
"unused-input": "unused-input";
|
|
343
|
+
"unhandled-case": "unhandled-case";
|
|
344
|
+
"inferred-resolution": "inferred-resolution";
|
|
345
|
+
}>;
|
|
346
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
347
|
+
start: z.ZodInt;
|
|
348
|
+
end: z.ZodInt;
|
|
349
|
+
}, z.core.$strict>>;
|
|
350
|
+
reason: z.ZodString;
|
|
351
|
+
}, z.core.$strict>>>;
|
|
352
|
+
}, z.core.$strict>;
|
|
353
|
+
}, z.core.$strict>, z.ZodArray<z.ZodObject<{
|
|
354
|
+
target: z.ZodOptional<z.ZodString>;
|
|
355
|
+
guard: z.ZodOptional<z.ZodObject<{
|
|
356
|
+
type: z.ZodLiteral<"nl">;
|
|
357
|
+
params: z.ZodObject<{
|
|
358
|
+
text: z.ZodString;
|
|
359
|
+
}, z.core.$strict>;
|
|
360
|
+
}, z.core.$strict>>;
|
|
361
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
362
|
+
type: z.ZodLiteral<"nl">;
|
|
363
|
+
params: z.ZodObject<{
|
|
364
|
+
text: z.ZodString;
|
|
365
|
+
}, z.core.$strict>;
|
|
366
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
367
|
+
source: z.ZodObject<{
|
|
368
|
+
start: z.ZodInt;
|
|
369
|
+
end: z.ZodInt;
|
|
370
|
+
}, z.core.$strict>;
|
|
371
|
+
gate: z.ZodLiteral<true>;
|
|
372
|
+
}, z.core.$strict>>;
|
|
373
|
+
}, z.core.$strict>>>;
|
|
374
|
+
meta: z.ZodObject<{
|
|
375
|
+
source: z.ZodObject<{
|
|
376
|
+
start: z.ZodInt;
|
|
377
|
+
end: z.ZodInt;
|
|
378
|
+
}, z.core.$strict>;
|
|
379
|
+
inferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
380
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
381
|
+
ambient: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
382
|
+
start: z.ZodInt;
|
|
383
|
+
end: z.ZodInt;
|
|
384
|
+
gate: z.ZodOptional<z.ZodLiteral<true>>;
|
|
385
|
+
}, z.core.$strict>>>;
|
|
386
|
+
findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
387
|
+
kind: z.ZodEnum<{
|
|
388
|
+
contradiction: "contradiction";
|
|
389
|
+
"unused-input": "unused-input";
|
|
390
|
+
"unhandled-case": "unhandled-case";
|
|
391
|
+
"inferred-resolution": "inferred-resolution";
|
|
392
|
+
}>;
|
|
393
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
394
|
+
start: z.ZodInt;
|
|
395
|
+
end: z.ZodInt;
|
|
396
|
+
}, z.core.$strict>>;
|
|
397
|
+
reason: z.ZodString;
|
|
398
|
+
}, z.core.$strict>>>;
|
|
399
|
+
}, z.core.$strict>;
|
|
400
|
+
}, z.core.$strict>>]>>;
|
|
401
|
+
entry: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
402
|
+
type: z.ZodLiteral<"nl">;
|
|
403
|
+
params: z.ZodObject<{
|
|
404
|
+
text: z.ZodString;
|
|
405
|
+
}, z.core.$strict>;
|
|
406
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
407
|
+
source: z.ZodObject<{
|
|
408
|
+
start: z.ZodInt;
|
|
409
|
+
end: z.ZodInt;
|
|
410
|
+
}, z.core.$strict>;
|
|
411
|
+
gate: z.ZodLiteral<true>;
|
|
412
|
+
}, z.core.$strict>>;
|
|
413
|
+
}, z.core.$strict>>>;
|
|
414
|
+
exit: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
415
|
+
type: z.ZodLiteral<"nl">;
|
|
416
|
+
params: z.ZodObject<{
|
|
417
|
+
text: z.ZodString;
|
|
418
|
+
}, z.core.$strict>;
|
|
419
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
420
|
+
source: z.ZodObject<{
|
|
421
|
+
start: z.ZodInt;
|
|
422
|
+
end: z.ZodInt;
|
|
423
|
+
}, z.core.$strict>;
|
|
424
|
+
gate: z.ZodLiteral<true>;
|
|
425
|
+
}, z.core.$strict>>;
|
|
426
|
+
}, z.core.$strict>>>;
|
|
427
|
+
}, z.core.$strict>;
|
|
428
|
+
export type Action = z.output<typeof actionSchema>;
|
|
429
|
+
export type AmbientSpan = z.output<typeof ambientSpanSchema>;
|
|
430
|
+
export type ElementMeta = z.output<typeof elementMetaSchema>;
|
|
431
|
+
export type Finding = z.output<typeof findingSchema>;
|
|
432
|
+
export type FindingKind = z.output<typeof findingKindSchema>;
|
|
433
|
+
export type AgentLogicConfig = z.output<typeof agentLogicConfigSchema>;
|
|
434
|
+
export type NlEntry = z.output<typeof nlEntrySchema>;
|
|
435
|
+
export type Span = z.output<typeof spanSchema>;
|
|
436
|
+
export type StateMeta = z.output<typeof stateMetaSchema>;
|
|
437
|
+
export type TransitionConfig = z.output<typeof transitionSchema>;
|
|
438
|
+
export type UnconvertedSpan = z.output<typeof unconvertedSpanSchema>;
|
|
439
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const spanSchema = z
|
|
3
|
+
.strictObject({
|
|
4
|
+
start: z.int().nonnegative(),
|
|
5
|
+
end: z.int().nonnegative(),
|
|
6
|
+
})
|
|
7
|
+
.meta({ id: 'Span' });
|
|
8
|
+
export const nlEntrySchema = z
|
|
9
|
+
.strictObject({
|
|
10
|
+
type: z.literal('nl'),
|
|
11
|
+
params: z.strictObject({ text: z.string().min(1) }),
|
|
12
|
+
})
|
|
13
|
+
.meta({ id: 'NlEntry' });
|
|
14
|
+
const gateSchema = z.literal(true).optional().meta({
|
|
15
|
+
description: 'Present when the passage is the body of a `<HARD-GATE>`, an absolute instruction, in the prompt.',
|
|
16
|
+
});
|
|
17
|
+
export const actionSchema = nlEntrySchema
|
|
18
|
+
.extend({
|
|
19
|
+
meta: z.strictObject({ source: spanSchema, gate: z.literal(true) }).optional(),
|
|
20
|
+
})
|
|
21
|
+
.meta({ id: 'Action' });
|
|
22
|
+
export const ambientSpanSchema = spanSchema.extend({ gate: gateSchema }).meta({ id: 'AmbientSpan' });
|
|
23
|
+
const ambientSchema = z.array(ambientSpanSchema).optional().meta({
|
|
24
|
+
description: 'Spans of the ambient instructions that hold throughout the state, such as persona, tone, background knowledge, and standing rules. Allowed only on the root and on a compound state.',
|
|
25
|
+
});
|
|
26
|
+
export const findingKindSchema = z
|
|
27
|
+
.enum(['contradiction', 'unused-input', 'unhandled-case', 'inferred-resolution'])
|
|
28
|
+
.meta({ id: 'FindingKind' });
|
|
29
|
+
export const findingSchema = z
|
|
30
|
+
.strictObject({
|
|
31
|
+
kind: findingKindSchema,
|
|
32
|
+
sources: z.array(spanSchema).min(1),
|
|
33
|
+
reason: z.string().min(1),
|
|
34
|
+
})
|
|
35
|
+
.meta({ id: 'Finding' });
|
|
36
|
+
const findingsSchema = z.array(findingSchema).optional().meta({
|
|
37
|
+
description: "The converter's judgment of flaws in the prompt that concern this element, or the prompt as a whole on the root. An `inferred-resolution` finding sits on the inferred element that it explains.",
|
|
38
|
+
});
|
|
39
|
+
const elementMetaSchema = z
|
|
40
|
+
.strictObject({
|
|
41
|
+
source: spanSchema,
|
|
42
|
+
inferred: z.literal(true).optional(),
|
|
43
|
+
gate: gateSchema,
|
|
44
|
+
ambient: ambientSchema,
|
|
45
|
+
findings: findingsSchema,
|
|
46
|
+
})
|
|
47
|
+
.meta({ id: 'ElementMeta' });
|
|
48
|
+
const stateNameSchema = z.string().min(1).optional().meta({
|
|
49
|
+
description: 'The name that the viewer shows for the state, written as words. Absent, the viewer shows the id.',
|
|
50
|
+
});
|
|
51
|
+
const stateMetaSchema = elementMetaSchema.extend({ name: stateNameSchema }).meta({ id: 'StateMeta' });
|
|
52
|
+
export const transitionSchema = z
|
|
53
|
+
.strictObject({
|
|
54
|
+
target: z.string().regex(/^#.+$/).optional().meta({
|
|
55
|
+
description: 'The `#id` of the target state. Omitted, the transition runs its actions without leaving.',
|
|
56
|
+
}),
|
|
57
|
+
guard: nlEntrySchema.optional(),
|
|
58
|
+
actions: z.array(actionSchema).optional(),
|
|
59
|
+
meta: elementMetaSchema,
|
|
60
|
+
})
|
|
61
|
+
.meta({ id: 'Transition' });
|
|
62
|
+
const transitionsSchema = z.union([transitionSchema, z.array(transitionSchema).min(1)]);
|
|
63
|
+
export const eventNameSchema = z
|
|
64
|
+
.string()
|
|
65
|
+
.regex(/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$/)
|
|
66
|
+
.meta({ description: 'A dotted lowercase event name; events from the user start with `user.`.' });
|
|
67
|
+
const stateMembers = {
|
|
68
|
+
id: z.string().min(1),
|
|
69
|
+
on: z.record(eventNameSchema, transitionsSchema).optional(),
|
|
70
|
+
always: transitionsSchema.optional(),
|
|
71
|
+
entry: z.array(actionSchema).optional(),
|
|
72
|
+
exit: z.array(actionSchema).optional(),
|
|
73
|
+
};
|
|
74
|
+
export const stateSchema = z
|
|
75
|
+
.strictObject({
|
|
76
|
+
...stateMembers,
|
|
77
|
+
type: z.literal('final').optional(),
|
|
78
|
+
initial: z.string().optional(),
|
|
79
|
+
get states() {
|
|
80
|
+
return z.record(z.string(), stateSchema).optional();
|
|
81
|
+
},
|
|
82
|
+
meta: stateMetaSchema,
|
|
83
|
+
})
|
|
84
|
+
.meta({ id: 'State' });
|
|
85
|
+
export const unconvertedSpanSchema = spanSchema.extend({ reason: z.string().min(1).optional() });
|
|
86
|
+
export const agentLogicConfigSchema = z
|
|
87
|
+
.strictObject({
|
|
88
|
+
...stateMembers,
|
|
89
|
+
initial: z.string(),
|
|
90
|
+
states: z.record(z.string(), stateSchema),
|
|
91
|
+
meta: z.strictObject({
|
|
92
|
+
name: stateNameSchema,
|
|
93
|
+
prompt: z.string(),
|
|
94
|
+
source: spanSchema,
|
|
95
|
+
unconverted: z.array(unconvertedSpanSchema),
|
|
96
|
+
ambient: ambientSchema,
|
|
97
|
+
findings: findingsSchema,
|
|
98
|
+
}),
|
|
99
|
+
})
|
|
100
|
+
.meta({ title: 'Agent logic config' });
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AgentLogicConfig, StateConfig, TransitionConfig } from './agent-logic-schema.js';
|
|
2
|
+
/** A state or the root, which share the members that hold children and transitions. */
|
|
3
|
+
export type StateLike = AgentLogicConfig | StateConfig;
|
|
4
|
+
export interface StateEntry {
|
|
5
|
+
/** Path from the root of the config to the state. */
|
|
6
|
+
path: PropertyKey[];
|
|
7
|
+
state: StateLike;
|
|
8
|
+
}
|
|
9
|
+
export interface TransitionEntry {
|
|
10
|
+
/** Path from the transition's state to the transition. */
|
|
11
|
+
path: PropertyKey[];
|
|
12
|
+
/** The event that triggers the transition; absent for an `always` transition. */
|
|
13
|
+
event: string | undefined;
|
|
14
|
+
transition: TransitionConfig;
|
|
15
|
+
}
|
|
16
|
+
/** Lists each state with its path into the config, the root first, parents before children. */
|
|
17
|
+
export declare function listStates(config: AgentLogicConfig): StateEntry[];
|
|
18
|
+
/** Lists each transition of a state, `on` before `always`. */
|
|
19
|
+
export declare function listTransitions(state: StateLike): TransitionEntry[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function listStates(config) {
|
|
2
|
+
const entries = [];
|
|
3
|
+
visit([], config);
|
|
4
|
+
return entries;
|
|
5
|
+
function visit(path, state) {
|
|
6
|
+
entries.push({ path, state });
|
|
7
|
+
const children = Object.entries(state.states ?? {});
|
|
8
|
+
for (const [key, child] of children) {
|
|
9
|
+
visit([...path, 'states', key], child);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function listTransitions(state) {
|
|
14
|
+
const entries = [];
|
|
15
|
+
const eventTransitions = Object.entries(state.on ?? {});
|
|
16
|
+
for (const [event, transitions] of eventTransitions) {
|
|
17
|
+
appendTransitions(entries, ['on', event], event, transitions);
|
|
18
|
+
}
|
|
19
|
+
if (state.always !== undefined) {
|
|
20
|
+
appendTransitions(entries, ['always'], undefined, state.always);
|
|
21
|
+
}
|
|
22
|
+
return entries;
|
|
23
|
+
}
|
|
24
|
+
function appendTransitions(entries, path, event, transitions) {
|
|
25
|
+
if (!Array.isArray(transitions)) {
|
|
26
|
+
entries.push({ path, event, transition: transitions });
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
for (const [index, transition] of transitions.entries()) {
|
|
30
|
+
entries.push({ path: [...path, index], event, transition });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type AgentLogicConfig } from './agent-logic-schema.js';
|
|
2
|
+
export interface Problem {
|
|
3
|
+
/** Where the problem is, as a dotted path into the config; empty for the root. */
|
|
4
|
+
path: string;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export type ValidationResult = {
|
|
8
|
+
ok: true;
|
|
9
|
+
config: AgentLogicConfig;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
problems: Problem[];
|
|
13
|
+
};
|
|
14
|
+
/** Formats a path into the config as dotted segments, bracketing a key that contains a dot. */
|
|
15
|
+
export declare function formatPath(path: readonly PropertyKey[]): string;
|
|
16
|
+
/** Checks a value against the schema, then against the rules that the schema cannot express. */
|
|
17
|
+
export declare function validateConfig(value: unknown): ValidationResult;
|