@sanity/ailf 0.1.11 → 0.1.12
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/dist/_vendor/ailf-core/ports/context.d.ts +1 -1
- package/dist/commands/pipeline-action.d.ts +1 -1
- package/dist/commands/pipeline-action.js +3 -1
- package/dist/commands/pipeline.js +1 -1
- package/dist/composition-root.js +13 -1
- package/dist/pipeline/map-request-to-config.js +5 -1
- package/package.json +1 -1
|
@@ -92,7 +92,7 @@ export interface ResolvedConfig {
|
|
|
92
92
|
/** Before option for comparison */
|
|
93
93
|
beforeOption?: string;
|
|
94
94
|
/** Task source adapter selection */
|
|
95
|
-
taskSourceType?: "content-lake" | "yaml";
|
|
95
|
+
taskSourceType?: "content-lake" | "repo" | "yaml";
|
|
96
96
|
/** Path to repo-based tasks directory (e.g., .ailf/tasks/) */
|
|
97
97
|
repoTasksPath?: string;
|
|
98
98
|
/** Report store project ID from .ailf/config.yaml reportStore block */
|
|
@@ -53,7 +53,7 @@ export interface ResolvedOptions {
|
|
|
53
53
|
remote: boolean;
|
|
54
54
|
repoTasksPath?: string;
|
|
55
55
|
taskOption?: string;
|
|
56
|
-
taskSourceType?: "content-lake" | "yaml";
|
|
56
|
+
taskSourceType?: "content-lake" | "repo" | "yaml";
|
|
57
57
|
urlArgs: string[];
|
|
58
58
|
apiUrl: string;
|
|
59
59
|
apiKey?: string;
|
|
@@ -246,7 +246,9 @@ function resolveTaskSourceType(raw) {
|
|
|
246
246
|
return undefined; // default — Content Lake
|
|
247
247
|
if (raw === "yaml")
|
|
248
248
|
return "yaml";
|
|
249
|
-
|
|
249
|
+
if (raw === "repo")
|
|
250
|
+
return "repo";
|
|
251
|
+
console.error(`❌ Invalid --task-source "${raw}". Must be "yaml", "repo", or "content-lake".`);
|
|
250
252
|
process.exit(1);
|
|
251
253
|
}
|
|
252
254
|
// ---------------------------------------------------------------------------
|
|
@@ -39,7 +39,7 @@ export function createPipelineCommand() {
|
|
|
39
39
|
.option("--config <path>", "Load pipeline config from a JSON/YAML file (overrides most CLI flags)")
|
|
40
40
|
.option("-o, --output <path>", "Write PR comment markdown to file")
|
|
41
41
|
.option("--promptfoo-url <url>", "Promptfoo share URL for report")
|
|
42
|
-
.option("--task-source <type>", "Task definition source: content-lake (default — Sanity Content Lake), yaml (tasks/*.yaml files, legacy)", "content-lake")
|
|
42
|
+
.option("--task-source <type>", "Task definition source: content-lake (default — Sanity Content Lake), repo (repo tasks only, no Content Lake merge), yaml (tasks/*.yaml files, legacy)", "content-lake")
|
|
43
43
|
.option("--repo-tasks-path <path>", "Path to repo-based task definitions (.ailf/tasks/ directory)")
|
|
44
44
|
.option("--remote", "Submit evaluation to the AILF API instead of running locally", false)
|
|
45
45
|
.option("--api-url <url>", "AILF API base URL (default: https://ailf-api.sanity.build)")
|
package/dist/composition-root.js
CHANGED
|
@@ -78,6 +78,17 @@ function createCache(config) {
|
|
|
78
78
|
return new ContentLakeCacheAdapter(local, createReportStore(config));
|
|
79
79
|
}
|
|
80
80
|
function createTaskSource(config) {
|
|
81
|
+
// "repo" mode — use ONLY repo tasks, no Content Lake or YAML merge.
|
|
82
|
+
// This is the correct mode for API-triggered inline-task evaluations
|
|
83
|
+
// where the caller sent their own task definitions. Without this,
|
|
84
|
+
// CompositeTaskSource would merge the caller's tasks with ALL Content
|
|
85
|
+
// Lake tasks, running the entire suite instead of just the caller's.
|
|
86
|
+
if (config.taskSourceType === "repo") {
|
|
87
|
+
if (!config.repoTasksPath) {
|
|
88
|
+
throw new Error('taskSourceType "repo" requires --repo-tasks-path to be set');
|
|
89
|
+
}
|
|
90
|
+
return new RepoTaskSource(config.repoTasksPath);
|
|
91
|
+
}
|
|
81
92
|
// Primary source — selected by config.taskSourceType
|
|
82
93
|
// Content Lake tasks may require the report token for access.
|
|
83
94
|
const primary = config.taskSourceType === "yaml"
|
|
@@ -87,7 +98,8 @@ function createTaskSource(config) {
|
|
|
87
98
|
process.env.SANITY_API_TOKEN ??
|
|
88
99
|
undefined,
|
|
89
100
|
}));
|
|
90
|
-
// If repo tasks path is set, combine primary + repo sources
|
|
101
|
+
// If repo tasks path is set, combine primary + repo sources.
|
|
102
|
+
// This is the "augment" mode — repo tasks extend the primary source.
|
|
91
103
|
if (config.repoTasksPath) {
|
|
92
104
|
return new CompositeTaskSource([
|
|
93
105
|
primary,
|
|
@@ -77,6 +77,10 @@ function mapDebug(debug) {
|
|
|
77
77
|
function mapTaskSourceType(taskMode) {
|
|
78
78
|
if (taskMode === "content-lake" || taskMode === "yaml")
|
|
79
79
|
return taskMode;
|
|
80
|
-
// "inline"
|
|
80
|
+
// "inline" means the caller sent inline tasks that will be materialized
|
|
81
|
+
// to a temp directory and loaded via --repo-tasks-path. Use "repo" to
|
|
82
|
+
// ensure ONLY those tasks are used (no Content Lake merge).
|
|
83
|
+
if (taskMode === "inline")
|
|
84
|
+
return "repo";
|
|
81
85
|
return undefined;
|
|
82
86
|
}
|