@allurereport/plugin-agent 3.10.0 → 3.11.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/README.md +85 -79
- package/dist/capabilities.d.ts +99 -0
- package/dist/capabilities.js +173 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +15 -0
- package/dist/guidance.d.ts +4 -5
- package/dist/guidance.js +194 -57
- package/dist/harness.d.ts +68 -4
- package/dist/harness.js +45 -17
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -0
- package/dist/inline-expectations.d.ts +23 -0
- package/dist/inline-expectations.js +186 -0
- package/dist/invalid-output.d.ts +58 -0
- package/dist/invalid-output.js +238 -0
- package/dist/model.d.ts +34 -0
- package/dist/model.js +8 -1
- package/dist/paths.d.ts +3 -0
- package/dist/paths.js +10 -0
- package/dist/plugin.js +847 -136
- package/dist/query.d.ts +193 -0
- package/dist/query.js +175 -0
- package/dist/selection.d.ts +42 -0
- package/dist/selection.js +141 -0
- package/dist/state.d.ts +15 -0
- package/dist/state.js +83 -0
- package/package.json +6 -6
package/dist/model.d.ts
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
export type AgentExpectationSelectorInput = {
|
|
2
|
+
environments?: string[];
|
|
3
|
+
full_names?: string[];
|
|
4
|
+
full_name_prefixes?: string[];
|
|
5
|
+
label_values?: Record<string, string | string[]>;
|
|
6
|
+
test_count?: number;
|
|
7
|
+
};
|
|
8
|
+
export type AgentAttachmentExpectationInput = {
|
|
9
|
+
name?: string;
|
|
10
|
+
content_type?: string;
|
|
11
|
+
};
|
|
12
|
+
export type AgentEvidenceExpectationInput = {
|
|
13
|
+
required?: boolean;
|
|
14
|
+
min_steps?: number;
|
|
15
|
+
min_attachments?: number;
|
|
16
|
+
step_name_contains?: string[];
|
|
17
|
+
attachments?: AgentAttachmentExpectationInput[];
|
|
18
|
+
};
|
|
19
|
+
export type AgentExpectationsInput = {
|
|
20
|
+
goal?: string;
|
|
21
|
+
task_id?: string;
|
|
22
|
+
expected?: AgentExpectationSelectorInput;
|
|
23
|
+
forbidden?: AgentExpectationSelectorInput;
|
|
24
|
+
evidence?: AgentEvidenceExpectationInput;
|
|
25
|
+
notes?: string | string[];
|
|
26
|
+
};
|
|
1
27
|
export type AgentPluginOptions = {
|
|
2
28
|
outputDir?: string;
|
|
29
|
+
expectationsPath?: string;
|
|
30
|
+
expectations?: AgentExpectationsInput;
|
|
31
|
+
command?: string;
|
|
32
|
+
agentName?: string;
|
|
33
|
+
loopId?: string;
|
|
34
|
+
taskId?: string;
|
|
35
|
+
conversationId?: string;
|
|
3
36
|
};
|
|
37
|
+
export declare const parseAgentExpectations: (rawContent: string) => AgentExpectationsInput;
|
package/dist/model.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { parse } from "yaml";
|
|
2
|
+
export const parseAgentExpectations = (rawContent) => {
|
|
3
|
+
const parsed = parse(rawContent);
|
|
4
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
5
|
+
throw new Error("Expected a YAML or JSON object");
|
|
6
|
+
}
|
|
7
|
+
return parsed;
|
|
8
|
+
};
|
package/dist/paths.d.ts
ADDED
package/dist/paths.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { join, relative } from "node:path";
|
|
2
|
+
export const isPathInside = (parentPath, candidatePath) => {
|
|
3
|
+
const rel = relative(parentPath, candidatePath);
|
|
4
|
+
return rel === "" || (!rel.startsWith("..") && rel !== "." && !rel.startsWith("../"));
|
|
5
|
+
};
|
|
6
|
+
export const resolveAgentIndexPath = (outputDir) => join(outputDir, "index.md");
|
|
7
|
+
export const formatAgentOutputLinks = (outputDir) => [
|
|
8
|
+
`agent output: ${outputDir}`,
|
|
9
|
+
`agent index: ${resolveAgentIndexPath(outputDir)}`,
|
|
10
|
+
];
|