@gobing-ai/spur 0.4.14 → 0.4.15
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/.claude-plugin/marketplace.json +1 -1
- package/config/pipeline-budgets.json +0 -14
- package/config/workflow-candidates.json +18 -0
- package/config/workflows/feature-lifecycle.yaml +9 -16
- package/config/workflows/idea-pipeline.yaml +158 -740
- package/config/workflows/wrapup-pipeline.yaml +91 -623
- package/package.json +9 -9
- package/plugins/sp/README.md +8 -4
- package/plugins/sp/commands/dev-idea.md +9 -5
- package/plugins/sp/commands/dev-plan.md +1 -1
- package/plugins/sp/commands/dev-pr-review.md +6 -6
- package/plugins/sp/commands/dev-wrap.md +1 -1
- package/plugins/sp/commands/dev-wrapall.md +4 -4
- package/plugins/sp/plugin.json +1 -1
- package/plugins/sp/skills/pr-reviewing/SKILL.md +36 -18
- package/plugins/sp/skills/spec-decomposition/references/decomposition.md +2 -1
- package/plugins/sp/skills/spur-cli/references/builder.md +2 -2
- package/plugins/sp/skills/spur-cli/references/features.md +7 -0
- package/plugins/sp/skills/spur-cli/references/tasks.md +1 -1
- package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +2 -1
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +10 -10
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +9 -10
- package/plugins/sp/skills/spur-dev/references/execution-worktree-landing.md +1 -2
- package/plugins/sp/skills/spur-dev/references/execution-worktree-setup.md +4 -4
- package/plugins/sp/skills/spur-dev/references/planning-workflow.md +7 -6
- package/plugins/sp/skills/wayfinder/SKILL.md +11 -1
- package/spur.js +800 -799
- package/config/workflows/feature-verification.yaml +0 -98
- package/config/workflows/pr-review.yaml +0 -209
- package/config/workflows/wayfinder-resolution.yaml +0 -302
- package/plugins/sp/skills/wayfinder/references/pipeline-resolution.md +0 -30
package/spur.js
CHANGED
|
@@ -59,7 +59,7 @@ var __esm = (fn, res, err) => () => {
|
|
|
59
59
|
};
|
|
60
60
|
var __require = import.meta.require;
|
|
61
61
|
|
|
62
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
62
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.30/node_modules/@gobing-ai/ts-utils/dist/errors.js
|
|
63
63
|
var ErrorCode, AppError, ValidationError;
|
|
64
64
|
var init_errors = __esm(() => {
|
|
65
65
|
ErrorCode = {
|
|
@@ -84,7 +84,7 @@ var init_errors = __esm(() => {
|
|
|
84
84
|
};
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
87
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.30/node_modules/@gobing-ai/ts-utils/dist/api-response.js
|
|
88
88
|
var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
|
|
89
89
|
var init_api_response = __esm(() => {
|
|
90
90
|
init_errors();
|
|
@@ -107,10 +107,10 @@ var init_api_response = __esm(() => {
|
|
|
107
107
|
CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
110
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.30/node_modules/@gobing-ai/ts-utils/dist/cursor.js
|
|
111
111
|
var init_cursor = () => {};
|
|
112
112
|
|
|
113
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
113
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.30/node_modules/@gobing-ai/ts-utils/dist/env.js
|
|
114
114
|
function getEnvVar(name, fallback) {
|
|
115
115
|
const raw = process.env[name];
|
|
116
116
|
return raw === undefined ? fallback : raw;
|
|
@@ -132,10 +132,10 @@ function getAppOptions(config, key, fallback) {
|
|
|
132
132
|
return value === undefined || value === null ? fallback : value;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
135
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.30/node_modules/@gobing-ai/ts-utils/dist/event-severity.js
|
|
136
136
|
var init_event_severity = () => {};
|
|
137
137
|
|
|
138
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
138
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.30/node_modules/@gobing-ai/ts-utils/dist/object.js
|
|
139
139
|
function isPlainObject(value) {
|
|
140
140
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
141
141
|
}
|
|
@@ -153,7 +153,7 @@ function deepMerge(target, source) {
|
|
|
153
153
|
return result;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
156
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.30/node_modules/@gobing-ai/ts-utils/dist/output.js
|
|
157
157
|
function processStream(name) {
|
|
158
158
|
const proc = globalThis.process;
|
|
159
159
|
const stream = proc?.[name];
|
|
@@ -174,7 +174,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
|
|
|
174
174
|
}
|
|
175
175
|
var defaultStdoutTarget, defaultStderrTarget;
|
|
176
176
|
|
|
177
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
177
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.30/node_modules/@gobing-ai/ts-utils/dist/index.js
|
|
178
178
|
var init_dist = __esm(() => {
|
|
179
179
|
init_api_response();
|
|
180
180
|
init_cursor();
|
|
@@ -22600,7 +22600,7 @@ var init_dist2 = __esm(() => {
|
|
|
22600
22600
|
$visitAsync = visit.visitAsync;
|
|
22601
22601
|
});
|
|
22602
22602
|
|
|
22603
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
22603
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+4bbef1a3d28d9ec1/node_modules/@gobing-ai/ts-runtime/dist/config.js
|
|
22604
22604
|
var configSchema2;
|
|
22605
22605
|
var init_config = __esm(() => {
|
|
22606
22606
|
init_dist2();
|
|
@@ -29825,10 +29825,10 @@ var init_execa = __esm(() => {
|
|
|
29825
29825
|
} = getIpcExport());
|
|
29826
29826
|
});
|
|
29827
29827
|
|
|
29828
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
29828
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+4bbef1a3d28d9ec1/node_modules/@gobing-ai/ts-runtime/dist/context.js
|
|
29829
29829
|
var init_context = () => {};
|
|
29830
29830
|
|
|
29831
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
29831
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+4bbef1a3d28d9ec1/node_modules/@gobing-ai/ts-runtime/dist/path.js
|
|
29832
29832
|
function normalizeSeparators(path) {
|
|
29833
29833
|
return path.replaceAll("\\", "/");
|
|
29834
29834
|
}
|
|
@@ -29889,17 +29889,17 @@ var init_path = __esm(() => {
|
|
|
29889
29889
|
SEP = globalThis.process?.platform === "win32" ? "\\" : "/";
|
|
29890
29890
|
});
|
|
29891
29891
|
|
|
29892
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
29892
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+4bbef1a3d28d9ec1/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
|
|
29893
29893
|
var REMOTE_SCHEMA_MAX_BYTES;
|
|
29894
29894
|
var init_schema_validation = __esm(() => {
|
|
29895
29895
|
init_dist2();
|
|
29896
29896
|
REMOTE_SCHEMA_MAX_BYTES = 5 * 1024 * 1024;
|
|
29897
29897
|
});
|
|
29898
29898
|
|
|
29899
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
29899
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+4bbef1a3d28d9ec1/node_modules/@gobing-ai/ts-runtime/dist/types.js
|
|
29900
29900
|
var init_types = () => {};
|
|
29901
29901
|
|
|
29902
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
29902
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+4bbef1a3d28d9ec1/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
29903
29903
|
var init_dist3 = __esm(() => {
|
|
29904
29904
|
init_config();
|
|
29905
29905
|
init_context();
|
|
@@ -29908,7 +29908,7 @@ var init_dist3 = __esm(() => {
|
|
|
29908
29908
|
init_types();
|
|
29909
29909
|
});
|
|
29910
29910
|
|
|
29911
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
29911
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+4bbef1a3d28d9ec1/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
|
|
29912
29912
|
import { Database } from "bun:sqlite";
|
|
29913
29913
|
var init_bun_sqlite = () => {};
|
|
29914
29914
|
|
|
@@ -34250,7 +34250,7 @@ var init_bun_sqlite2 = __esm(() => {
|
|
|
34250
34250
|
init_session2();
|
|
34251
34251
|
});
|
|
34252
34252
|
|
|
34253
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34253
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
|
|
34254
34254
|
var inboxMessages;
|
|
34255
34255
|
var init_inbox_messages = __esm(() => {
|
|
34256
34256
|
init_sqlite_core();
|
|
@@ -34270,7 +34270,7 @@ var init_inbox_messages = __esm(() => {
|
|
|
34270
34270
|
}, (table) => [index("idx_inbox_messages_to_status").on(table.toId, table.status)]);
|
|
34271
34271
|
});
|
|
34272
34272
|
|
|
34273
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34273
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/schema/common.js
|
|
34274
34274
|
function nowTimestamp() {
|
|
34275
34275
|
return Date.now();
|
|
34276
34276
|
}
|
|
@@ -34299,7 +34299,7 @@ var init_common2 = __esm(() => {
|
|
|
34299
34299
|
appendOnlyColumns = buildAppendOnlyColumns();
|
|
34300
34300
|
});
|
|
34301
34301
|
|
|
34302
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34302
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
|
|
34303
34303
|
var queueJobs;
|
|
34304
34304
|
var init_queue_jobs = __esm(() => {
|
|
34305
34305
|
init_sqlite_core();
|
|
@@ -34323,7 +34323,7 @@ var init_queue_jobs = __esm(() => {
|
|
|
34323
34323
|
}, (table) => [index("queue_jobs_ready_idx").on(table.status, table.nextRetryAt, table.createdAt)]);
|
|
34324
34324
|
});
|
|
34325
34325
|
|
|
34326
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34326
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
|
|
34327
34327
|
var exports_runtime = {};
|
|
34328
34328
|
__export(exports_runtime, {
|
|
34329
34329
|
inboxMessages: () => inboxMessages,
|
|
@@ -34334,7 +34334,7 @@ var init_runtime = __esm(() => {
|
|
|
34334
34334
|
init_queue_jobs();
|
|
34335
34335
|
});
|
|
34336
34336
|
|
|
34337
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34337
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
|
|
34338
34338
|
class BunSqliteAdapter {
|
|
34339
34339
|
sqlite;
|
|
34340
34340
|
drizzleDb;
|
|
@@ -34640,7 +34640,7 @@ var init_d1 = __esm(() => {
|
|
|
34640
34640
|
init_session3();
|
|
34641
34641
|
});
|
|
34642
34642
|
|
|
34643
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34643
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
|
|
34644
34644
|
class D1Adapter {
|
|
34645
34645
|
binding;
|
|
34646
34646
|
drizzleDb;
|
|
@@ -34699,7 +34699,7 @@ var init_d12 = __esm(() => {
|
|
|
34699
34699
|
init_runtime();
|
|
34700
34700
|
});
|
|
34701
34701
|
|
|
34702
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34702
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/adapter.js
|
|
34703
34703
|
async function createDbAdapter(config) {
|
|
34704
34704
|
switch (config.driver) {
|
|
34705
34705
|
case "bun-sqlite": {
|
|
@@ -34733,7 +34733,7 @@ var init_drizzle_orm = __esm(() => {
|
|
|
34733
34733
|
init_view_common();
|
|
34734
34734
|
});
|
|
34735
34735
|
|
|
34736
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34736
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/query-spec.js
|
|
34737
34737
|
function compilePredicate(predicate) {
|
|
34738
34738
|
if ("and" in predicate) {
|
|
34739
34739
|
const parts = predicate.and.map(compilePredicate).filter((p) => p !== undefined);
|
|
@@ -34771,7 +34771,7 @@ var init_query_spec = __esm(() => {
|
|
|
34771
34771
|
};
|
|
34772
34772
|
});
|
|
34773
34773
|
|
|
34774
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34774
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/base-dao.js
|
|
34775
34775
|
function asSelectQuery(query) {
|
|
34776
34776
|
return query;
|
|
34777
34777
|
}
|
|
@@ -34813,7 +34813,7 @@ var init_base_dao = __esm(() => {
|
|
|
34813
34813
|
init_query_spec();
|
|
34814
34814
|
});
|
|
34815
34815
|
|
|
34816
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34816
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
|
|
34817
34817
|
var EntityDao;
|
|
34818
34818
|
var init_entity_dao = __esm(() => {
|
|
34819
34819
|
init_drizzle_orm();
|
|
@@ -34975,7 +34975,7 @@ var init_entity_dao = __esm(() => {
|
|
|
34975
34975
|
};
|
|
34976
34976
|
});
|
|
34977
34977
|
|
|
34978
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
34978
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
|
|
34979
34979
|
function isPromiseLike(value) {
|
|
34980
34980
|
return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
34981
34981
|
}
|
|
@@ -35171,7 +35171,7 @@ var init_inbox_message_dao = __esm(() => {
|
|
|
35171
35171
|
};
|
|
35172
35172
|
});
|
|
35173
35173
|
|
|
35174
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
35174
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
|
|
35175
35175
|
function assertValidTimeoutMs(value) {
|
|
35176
35176
|
if (value === undefined || value === null)
|
|
35177
35177
|
return;
|
|
@@ -35394,7 +35394,7 @@ var init_queue_job_dao = __esm(() => {
|
|
|
35394
35394
|
};
|
|
35395
35395
|
});
|
|
35396
35396
|
|
|
35397
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
35397
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/index.js
|
|
35398
35398
|
var init_dist4 = __esm(() => {
|
|
35399
35399
|
init_entity_dao();
|
|
35400
35400
|
init_inbox_message_dao();
|
|
@@ -41559,7 +41559,7 @@ END`;
|
|
|
41559
41559
|
];
|
|
41560
41560
|
});
|
|
41561
41561
|
|
|
41562
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
41562
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/config.js
|
|
41563
41563
|
function parseYamlObject(text) {
|
|
41564
41564
|
let parsed;
|
|
41565
41565
|
try {
|
|
@@ -41665,7 +41665,7 @@ var init_config2 = __esm(() => {
|
|
|
41665
41665
|
};
|
|
41666
41666
|
});
|
|
41667
41667
|
|
|
41668
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
41668
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
|
|
41669
41669
|
import { appendFileSync as appendFileSync2, cpSync, createReadStream as createReadStream2, createWriteStream as createWriteStream2, existsSync, mkdirSync, readdirSync, readFileSync as readFileSync3, realpathSync, renameSync, rmSync, statSync as statSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
41670
41670
|
import { dirname, resolve as resolvePath2 } from "path";
|
|
41671
41671
|
function createNodeFileSystem2(root, paths) {
|
|
@@ -41683,11 +41683,11 @@ function createNodeFileSystem2(root, paths) {
|
|
|
41683
41683
|
const lines = buffer.split(/\r?\n/);
|
|
41684
41684
|
buffer = lines.pop() ?? "";
|
|
41685
41685
|
for (const line of lines) {
|
|
41686
|
-
yield line;
|
|
41686
|
+
yield { text: line, terminated: true };
|
|
41687
41687
|
}
|
|
41688
41688
|
}
|
|
41689
41689
|
if (buffer.length > 0)
|
|
41690
|
-
yield buffer;
|
|
41690
|
+
yield { text: buffer, terminated: false };
|
|
41691
41691
|
},
|
|
41692
41692
|
writeFile: (path, content) => {
|
|
41693
41693
|
ensureParentDir(path);
|
|
@@ -41752,7 +41752,7 @@ function findProjectRoot2(startDir) {
|
|
|
41752
41752
|
}
|
|
41753
41753
|
var init_file_system_node = () => {};
|
|
41754
41754
|
|
|
41755
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
41755
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
|
|
41756
41756
|
var D1NotConfiguredError2, DbModuleNotInstalledError2;
|
|
41757
41757
|
var init_db_errors = __esm(() => {
|
|
41758
41758
|
D1NotConfiguredError2 = class D1NotConfiguredError2 extends Error {
|
|
@@ -41769,7 +41769,7 @@ var init_db_errors = __esm(() => {
|
|
|
41769
41769
|
};
|
|
41770
41770
|
});
|
|
41771
41771
|
|
|
41772
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
41772
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
|
|
41773
41773
|
function createCfFileSystem2() {
|
|
41774
41774
|
return {
|
|
41775
41775
|
getProjectRoot: () => "/bundle",
|
|
@@ -41808,7 +41808,7 @@ function createCfFileSystem2() {
|
|
|
41808
41808
|
}
|
|
41809
41809
|
var UNSUPPORTED = "FileSystem is not available on Cloudflare Workers. Use D1, KV, or R2 for persistent storage.";
|
|
41810
41810
|
|
|
41811
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
41811
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
|
|
41812
41812
|
var CONFIG_YAML_BINDING = "CONFIG_YAML", cloudflareWorkersFactory2;
|
|
41813
41813
|
var init_runtime_cf = __esm(() => {
|
|
41814
41814
|
init_dist2();
|
|
@@ -41842,7 +41842,7 @@ var init_runtime_cf = __esm(() => {
|
|
|
41842
41842
|
};
|
|
41843
41843
|
});
|
|
41844
41844
|
|
|
41845
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
41845
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/process-group.js
|
|
41846
41846
|
function resolveDeadline(optionTimeout, defaultTimeout) {
|
|
41847
41847
|
if (optionTimeout === null)
|
|
41848
41848
|
return null;
|
|
@@ -41934,7 +41934,7 @@ function ownProcessGroupLifecycle(ownership) {
|
|
|
41934
41934
|
}
|
|
41935
41935
|
var MAX_TIMEOUT_MS = 2147483647, DEFAULT_KILL_GRACE_MS = 5000, GROUP_POLL_INTERVAL_MS = 25, GROUP_KILL_PATIENCE_MS = 2000;
|
|
41936
41936
|
|
|
41937
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
41937
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
|
|
41938
41938
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
41939
41939
|
import { isatty } from "tty";
|
|
41940
41940
|
function processEventSeverity(reason, exitCode) {
|
|
@@ -42362,7 +42362,7 @@ var init_process_executor = __esm(() => {
|
|
|
42362
42362
|
init_config2();
|
|
42363
42363
|
});
|
|
42364
42364
|
|
|
42365
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
42365
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
|
|
42366
42366
|
function getNodeFileSystem() {
|
|
42367
42367
|
if (!_nodeFileSystem)
|
|
42368
42368
|
_nodeFileSystem = createNodeFileSystem2();
|
|
@@ -42422,7 +42422,7 @@ var init_runtime_node_bun = __esm(() => {
|
|
|
42422
42422
|
};
|
|
42423
42423
|
});
|
|
42424
42424
|
|
|
42425
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
42425
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/platform.js
|
|
42426
42426
|
function isCloudflareWorkerRuntime2() {
|
|
42427
42427
|
return globalThis.navigator?.userAgent?.startsWith("Cloudflare-Workers") ?? false;
|
|
42428
42428
|
}
|
|
@@ -42448,10 +42448,10 @@ function getRuntimeName() {
|
|
|
42448
42448
|
}
|
|
42449
42449
|
var _factory, _runtimeName;
|
|
42450
42450
|
|
|
42451
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
42451
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/context.js
|
|
42452
42452
|
var init_context2 = () => {};
|
|
42453
42453
|
|
|
42454
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
42454
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/path.js
|
|
42455
42455
|
function normalizeSeparators2(path) {
|
|
42456
42456
|
return path.replaceAll("\\", "/");
|
|
42457
42457
|
}
|
|
@@ -42559,7 +42559,7 @@ var init_path2 = __esm(() => {
|
|
|
42559
42559
|
SEP2 = globalThis.process?.platform === "win32" ? "\\" : "/";
|
|
42560
42560
|
});
|
|
42561
42561
|
|
|
42562
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
42562
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/fs.js
|
|
42563
42563
|
async function walkDir2(path, fs = createNodeFileSystem2(), exclude) {
|
|
42564
42564
|
const startReal = fs.realPath?.(path) ?? path;
|
|
42565
42565
|
const visited = new Set([startReal]);
|
|
@@ -42593,7 +42593,7 @@ var init_fs = __esm(() => {
|
|
|
42593
42593
|
init_path2();
|
|
42594
42594
|
});
|
|
42595
42595
|
|
|
42596
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
42596
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
|
|
42597
42597
|
function allocateId() {
|
|
42598
42598
|
nextIdSeq += 1;
|
|
42599
42599
|
return `pe_${Date.now().toString(36)}_${nextIdSeq.toString(36)}`;
|
|
@@ -42717,7 +42717,7 @@ function createInMemoryProcessRegistry2(options) {
|
|
|
42717
42717
|
}
|
|
42718
42718
|
var nextIdSeq = 0;
|
|
42719
42719
|
|
|
42720
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
42720
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
|
|
42721
42721
|
function ambientRuntimePaths2() {
|
|
42722
42722
|
const cwd = getProcessCwd2();
|
|
42723
42723
|
return { cwd, home: getHomeDir() ?? cwd };
|
|
@@ -42727,7 +42727,7 @@ var init_runtime_paths = __esm(() => {
|
|
|
42727
42727
|
init_path2();
|
|
42728
42728
|
});
|
|
42729
42729
|
|
|
42730
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
42730
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
|
|
42731
42731
|
async function loadStructuredConfig(path, options = {}) {
|
|
42732
42732
|
const content = await (options.fileSystem ?? createNodeFileSystem2()).readFile(path);
|
|
42733
42733
|
return await parseStructuredConfig(content, path, options);
|
|
@@ -43010,10 +43010,10 @@ var init_schema_validation2 = __esm(() => {
|
|
|
43010
43010
|
defaultResolve = typeof Bun !== "undefined" ? (specifier, from) => Bun.resolveSync(specifier, from) : undefined;
|
|
43011
43011
|
});
|
|
43012
43012
|
|
|
43013
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
43013
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/types.js
|
|
43014
43014
|
var init_types2 = () => {};
|
|
43015
43015
|
|
|
43016
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
43016
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
43017
43017
|
var init_dist5 = __esm(() => {
|
|
43018
43018
|
init_file_system_node();
|
|
43019
43019
|
init_fs();
|
|
@@ -43028,7 +43028,7 @@ var init_dist5 = __esm(() => {
|
|
|
43028
43028
|
init_types2();
|
|
43029
43029
|
});
|
|
43030
43030
|
|
|
43031
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
43031
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
|
|
43032
43032
|
var HistoryImportError, ImportCancelledError;
|
|
43033
43033
|
var init_errors5 = __esm(() => {
|
|
43034
43034
|
HistoryImportError = class HistoryImportError extends Error {
|
|
@@ -43049,7 +43049,7 @@ var init_errors5 = __esm(() => {
|
|
|
43049
43049
|
};
|
|
43050
43050
|
});
|
|
43051
43051
|
|
|
43052
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
43052
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/cancellation.js
|
|
43053
43053
|
function throwIfImportAborted(signal) {
|
|
43054
43054
|
if (signal?.aborted) {
|
|
43055
43055
|
throw new ImportCancelledError("Import cancelled by abort signal", signal.reason);
|
|
@@ -43059,7 +43059,7 @@ var init_cancellation = __esm(() => {
|
|
|
43059
43059
|
init_errors5();
|
|
43060
43060
|
});
|
|
43061
43061
|
|
|
43062
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
43062
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
|
|
43063
43063
|
import { createHash as createHash3 } from "crypto";
|
|
43064
43064
|
function stableJson(value) {
|
|
43065
43065
|
if (Array.isArray(value)) {
|
|
@@ -43079,7 +43079,7 @@ function sha256Text(text) {
|
|
|
43079
43079
|
}
|
|
43080
43080
|
var init_hash = () => {};
|
|
43081
43081
|
|
|
43082
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
43082
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/capability.js
|
|
43083
43083
|
function validateCapabilityOrigins(input) {
|
|
43084
43084
|
if (input === undefined)
|
|
43085
43085
|
return [];
|
|
@@ -43388,7 +43388,7 @@ var init_capability = __esm(() => {
|
|
|
43388
43388
|
DIGEST_PATTERN = /^[0-9a-f]{64}$/;
|
|
43389
43389
|
});
|
|
43390
43390
|
|
|
43391
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
43391
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
|
|
43392
43392
|
var HISTORY_IMPORT_SCHEMA_SQL;
|
|
43393
43393
|
var init_schema_sql = __esm(() => {
|
|
43394
43394
|
HISTORY_IMPORT_SCHEMA_SQL = `
|
|
@@ -43518,7 +43518,7 @@ CREATE INDEX IF NOT EXISTS idx_history_skill_call_invocation_kind
|
|
|
43518
43518
|
`.trim();
|
|
43519
43519
|
});
|
|
43520
43520
|
|
|
43521
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
43521
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
|
|
43522
43522
|
function applyRules(value, rules = DEFAULT_REDACTION_RULES) {
|
|
43523
43523
|
return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
|
|
43524
43524
|
}
|
|
@@ -43582,7 +43582,7 @@ var init_redaction = __esm(() => {
|
|
|
43582
43582
|
SECRET_KEY = /^(?:api[_-]?key|apikey|api[_-]?secret|token|access[_-]?token|refresh[_-]?token|auth[_-]?token|secret|secret[_-]?key|client[_-]?secret|private[_-]?key|session[_-]?token|password|passwd|authorization)$/i;
|
|
43583
43583
|
});
|
|
43584
43584
|
|
|
43585
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
43585
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
|
|
43586
43586
|
function identityFieldMap(keys) {
|
|
43587
43587
|
const map = {};
|
|
43588
43588
|
for (const key of keys) {
|
|
@@ -45752,7 +45752,7 @@ var init_mappers = __esm(() => {
|
|
|
45752
45752
|
DSH_SCHEMA = passthroughSchema;
|
|
45753
45753
|
});
|
|
45754
45754
|
|
|
45755
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
45755
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
|
|
45756
45756
|
function firstString(...values) {
|
|
45757
45757
|
for (const value of values) {
|
|
45758
45758
|
if (typeof value === "string" && value.length > 0)
|
|
@@ -45913,7 +45913,7 @@ var init_sources = __esm(() => {
|
|
|
45913
45913
|
};
|
|
45914
45914
|
});
|
|
45915
45915
|
|
|
45916
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
45916
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
|
|
45917
45917
|
function targetTableFor(table) {
|
|
45918
45918
|
if (!VALID_TABLE_NAME.test(table)) {
|
|
45919
45919
|
throw new HistoryImportError(`Invalid history ETL target table: ${table}`, { table });
|
|
@@ -46436,7 +46436,7 @@ var init_jsonl_importer_dao = __esm(() => {
|
|
|
46436
46436
|
TYPED_TABLE_COLUMNS_SOURCE_FILE = ["history_message", "history_tool_call", "history_skill_call"];
|
|
46437
46437
|
});
|
|
46438
46438
|
|
|
46439
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
46439
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/zstd.js
|
|
46440
46440
|
async function zstdDecompress(file, env) {
|
|
46441
46441
|
const result = await new NodeProcessExecutor2().run({
|
|
46442
46442
|
command: "zstd",
|
|
@@ -46456,7 +46456,7 @@ var init_zstd = __esm(() => {
|
|
|
46456
46456
|
init_errors5();
|
|
46457
46457
|
});
|
|
46458
46458
|
|
|
46459
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
46459
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
|
|
46460
46460
|
function toolCallKey(source, sessionId, callId) {
|
|
46461
46461
|
return `${source}${TOOL_CALL_KEY_SEP}${sessionId}${TOOL_CALL_KEY_SEP}${callId}`;
|
|
46462
46462
|
}
|
|
@@ -46585,16 +46585,21 @@ async function runJsonlImport(source, options) {
|
|
|
46585
46585
|
}
|
|
46586
46586
|
}
|
|
46587
46587
|
let lineNumber = 0;
|
|
46588
|
-
|
|
46588
|
+
let terminatedLineNumber = 0;
|
|
46589
|
+
let lastWritePhaseLineNumber = 0;
|
|
46590
|
+
for await (const { text: rawLine, terminated } of readLines(fileSystem, file)) {
|
|
46589
46591
|
throwIfImportAborted(options.signal);
|
|
46590
46592
|
lineNumber += 1;
|
|
46593
|
+
if (terminated)
|
|
46594
|
+
terminatedLineNumber = lineNumber;
|
|
46591
46595
|
const line = rawLine.trim();
|
|
46592
46596
|
if (line.length === 0 || lineNumber <= checkpoint)
|
|
46593
46597
|
continue;
|
|
46594
46598
|
processedLines += 1;
|
|
46595
|
-
const
|
|
46599
|
+
const incompleteTail = !terminated;
|
|
46600
|
+
const raw = parseJsonLine(line, file, lineNumber, incompleteTail ? [] : parseErrors, definition.corruptLinePolicy);
|
|
46596
46601
|
if (raw === undefined) {
|
|
46597
|
-
if (definition.corruptLinePolicy === "skip")
|
|
46602
|
+
if (!incompleteTail && definition.corruptLinePolicy === "skip")
|
|
46598
46603
|
skippedCorruptLines += 1;
|
|
46599
46604
|
continue;
|
|
46600
46605
|
}
|
|
@@ -46621,11 +46626,13 @@ async function runJsonlImport(source, options) {
|
|
|
46621
46626
|
});
|
|
46622
46627
|
const parsed = definition.schema.safeParse(normalized);
|
|
46623
46628
|
if (!parsed.success) {
|
|
46624
|
-
|
|
46625
|
-
|
|
46626
|
-
|
|
46627
|
-
|
|
46628
|
-
|
|
46629
|
+
if (!incompleteTail) {
|
|
46630
|
+
validationErrors.push({
|
|
46631
|
+
sourceFile: file,
|
|
46632
|
+
sourceLine: lineNumber,
|
|
46633
|
+
reason: parsed.error.issues.map((issue) => issue.message).join("; ")
|
|
46634
|
+
});
|
|
46635
|
+
}
|
|
46629
46636
|
lineRejected = true;
|
|
46630
46637
|
continue;
|
|
46631
46638
|
}
|
|
@@ -46643,6 +46650,7 @@ async function runJsonlImport(source, options) {
|
|
|
46643
46650
|
}
|
|
46644
46651
|
if (lineRejected)
|
|
46645
46652
|
continue;
|
|
46653
|
+
lastWritePhaseLineNumber = lineNumber;
|
|
46646
46654
|
for (const entry of prepared) {
|
|
46647
46655
|
if (entry.split.targetTable !== "history_skill_call")
|
|
46648
46656
|
continue;
|
|
@@ -46798,7 +46806,7 @@ async function runJsonlImport(source, options) {
|
|
|
46798
46806
|
const identityChanged = entry !== undefined && (entry.size !== (statAfter?.size ?? null) || entry.mtimeMs !== (statAfter?.mtimeMs ?? null));
|
|
46799
46807
|
if (statAfter !== null && !identityDegraded && (entry === undefined || identityChanged)) {
|
|
46800
46808
|
await options.db.batch([
|
|
46801
|
-
checkpointUpsertOp(resolvedSource, file, Math.max(
|
|
46809
|
+
checkpointUpsertOp(resolvedSource, file, Math.max(terminatedLineNumber, checkpoint, lastWritePhaseLineNumber), options.now, {
|
|
46802
46810
|
size: statAfter.size,
|
|
46803
46811
|
mtimeMs: statAfter.mtimeMs
|
|
46804
46812
|
})
|
|
@@ -46951,12 +46959,24 @@ async function safeStat(fileSystem, file) {
|
|
|
46951
46959
|
return null;
|
|
46952
46960
|
}
|
|
46953
46961
|
}
|
|
46962
|
+
function* splitTerminated(content) {
|
|
46963
|
+
const lines = content.split(/\r?\n/);
|
|
46964
|
+
let allTerminated = false;
|
|
46965
|
+
if (lines.length > 0 && lines[lines.length - 1] === "") {
|
|
46966
|
+
lines.pop();
|
|
46967
|
+
allTerminated = true;
|
|
46968
|
+
}
|
|
46969
|
+
for (let i = 0;i < lines.length; i += 1) {
|
|
46970
|
+
const text = lines[i];
|
|
46971
|
+
if (text === undefined)
|
|
46972
|
+
continue;
|
|
46973
|
+
yield { text, terminated: allTerminated || i < lines.length - 1 };
|
|
46974
|
+
}
|
|
46975
|
+
}
|
|
46954
46976
|
async function* readLines(fileSystem, file) {
|
|
46955
46977
|
if (file.endsWith(".jsonl.zstd")) {
|
|
46956
46978
|
const decompressed = await zstdDecompress(file);
|
|
46957
|
-
|
|
46958
|
-
yield line;
|
|
46959
|
-
}
|
|
46979
|
+
yield* splitTerminated(decompressed);
|
|
46960
46980
|
return;
|
|
46961
46981
|
}
|
|
46962
46982
|
if (fileSystem.readFileStream) {
|
|
@@ -46964,9 +46984,7 @@ async function* readLines(fileSystem, file) {
|
|
|
46964
46984
|
return;
|
|
46965
46985
|
}
|
|
46966
46986
|
const content = await fileSystem.readFile(file);
|
|
46967
|
-
|
|
46968
|
-
yield line;
|
|
46969
|
-
}
|
|
46987
|
+
yield* splitTerminated(content);
|
|
46970
46988
|
}
|
|
46971
46989
|
var TOOL_CALL_KEY_SEP = "\x00";
|
|
46972
46990
|
var init_importer = __esm(() => {
|
|
@@ -46981,7 +46999,7 @@ var init_importer = __esm(() => {
|
|
|
46981
46999
|
init_zstd();
|
|
46982
47000
|
});
|
|
46983
47001
|
|
|
46984
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
47002
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/opencode-importer.js
|
|
46985
47003
|
async function runOpenCodeImport(options) {
|
|
46986
47004
|
throwIfImportAborted(options.signal);
|
|
46987
47005
|
const paths = options.paths ?? ambientRuntimePaths2();
|
|
@@ -47273,7 +47291,7 @@ var init_opencode_importer = __esm(() => {
|
|
|
47273
47291
|
init_redaction();
|
|
47274
47292
|
});
|
|
47275
47293
|
|
|
47276
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
47294
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/tables.js
|
|
47277
47295
|
var BOOKKEEPING_HISTORY_TABLES, IMPORTER_OWNED_TABLES;
|
|
47278
47296
|
var init_tables = __esm(() => {
|
|
47279
47297
|
init_jsonl_importer_dao();
|
|
@@ -47286,7 +47304,7 @@ var init_tables = __esm(() => {
|
|
|
47286
47304
|
];
|
|
47287
47305
|
});
|
|
47288
47306
|
|
|
47289
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.
|
|
47307
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.30+6ca8e4a743b850c5/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
|
|
47290
47308
|
var init_dist6 = __esm(() => {
|
|
47291
47309
|
init_importer();
|
|
47292
47310
|
init_jsonl_importer_dao();
|
|
@@ -50505,7 +50523,7 @@ var init_drizzle_zod = __esm(() => {
|
|
|
50505
50523
|
};
|
|
50506
50524
|
});
|
|
50507
50525
|
|
|
50508
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
50526
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
|
|
50509
50527
|
function sqlExpressionToText(value) {
|
|
50510
50528
|
if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
|
|
50511
50529
|
return;
|
|
@@ -50528,7 +50546,7 @@ function getDrizzleTableName(table) {
|
|
|
50528
50546
|
return String(table[nameSym]);
|
|
50529
50547
|
}
|
|
50530
50548
|
|
|
50531
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
50549
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
|
|
50532
50550
|
function quoteIdent(name) {
|
|
50533
50551
|
return `"${name.replace(/"/g, '""')}"`;
|
|
50534
50552
|
}
|
|
@@ -50622,7 +50640,7 @@ var init_ddl = __esm(() => {
|
|
|
50622
50640
|
init_sqlite_core();
|
|
50623
50641
|
});
|
|
50624
50642
|
|
|
50625
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
50643
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
|
|
50626
50644
|
function defineTable(name, columns) {
|
|
50627
50645
|
const table = sqliteTable(name, columns);
|
|
50628
50646
|
let insert;
|
|
@@ -50656,7 +50674,7 @@ var init_define_table = __esm(() => {
|
|
|
50656
50674
|
init_ddl();
|
|
50657
50675
|
});
|
|
50658
50676
|
|
|
50659
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.
|
|
50677
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.5.30+063649613cc5fbc9/node_modules/@gobing-ai/ts-db/dist/schema/index.js
|
|
50660
50678
|
var init_schema = __esm(() => {
|
|
50661
50679
|
init_sqlite_core();
|
|
50662
50680
|
init_define_table();
|
|
@@ -52171,7 +52189,7 @@ var init_dao = __esm(() => {
|
|
|
52171
52189
|
init_workspace_dao();
|
|
52172
52190
|
});
|
|
52173
52191
|
|
|
52174
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
52192
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
|
|
52175
52193
|
var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
|
|
52176
52194
|
var init_errors6 = __esm(() => {
|
|
52177
52195
|
WorkflowValidationError = class WorkflowValidationError extends Error {
|
|
@@ -57043,7 +57061,7 @@ var init_mod = __esm(() => {
|
|
|
57043
57061
|
init_config3();
|
|
57044
57062
|
});
|
|
57045
57063
|
|
|
57046
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57064
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/logger.js
|
|
57047
57065
|
function toLogTapeLevel(level) {
|
|
57048
57066
|
return level === "warn" ? "warning" : level;
|
|
57049
57067
|
}
|
|
@@ -57116,7 +57134,7 @@ var init_logger3 = __esm(() => {
|
|
|
57116
57134
|
init_mod();
|
|
57117
57135
|
});
|
|
57118
57136
|
|
|
57119
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57137
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
|
|
57120
57138
|
function getTelemetryConfig(configPartial = {}) {
|
|
57121
57139
|
return {
|
|
57122
57140
|
enabled: configPartial.enabled ?? CONFIG_DEFAULTS.enabled,
|
|
@@ -57152,7 +57170,7 @@ var init_sdk = __esm(() => {
|
|
|
57152
57170
|
resolvedConfig = getTelemetryConfig();
|
|
57153
57171
|
});
|
|
57154
57172
|
|
|
57155
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57173
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
|
|
57156
57174
|
function isSuppressed(tracer) {
|
|
57157
57175
|
return tracer === undefined && !getResolvedConfig().enabled;
|
|
57158
57176
|
}
|
|
@@ -57192,7 +57210,7 @@ var init_tracing2 = __esm(() => {
|
|
|
57192
57210
|
import_api2 = __toESM(require_src(), 1);
|
|
57193
57211
|
});
|
|
57194
57212
|
|
|
57195
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57213
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
|
|
57196
57214
|
function getMeter() {
|
|
57197
57215
|
return import_api3.metrics.getMeter(METER_NAME, METER_VERSION);
|
|
57198
57216
|
}
|
|
@@ -57289,7 +57307,7 @@ var init_metrics = __esm(() => {
|
|
|
57289
57307
|
instruments = {};
|
|
57290
57308
|
});
|
|
57291
57309
|
|
|
57292
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57310
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
|
|
57293
57311
|
function busLogger() {
|
|
57294
57312
|
if (!_busLogger)
|
|
57295
57313
|
_busLogger = getLogger2("event-bus");
|
|
@@ -57542,7 +57560,7 @@ var init_event_bus = __esm(() => {
|
|
|
57542
57560
|
init_metrics();
|
|
57543
57561
|
});
|
|
57544
57562
|
|
|
57545
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57563
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
|
|
57546
57564
|
function obsLogger() {
|
|
57547
57565
|
if (!_obsLogger)
|
|
57548
57566
|
_obsLogger = getLogger2("event-bus.observers");
|
|
@@ -57606,7 +57624,7 @@ var init_default_observers = __esm(() => {
|
|
|
57606
57624
|
init_event_bus();
|
|
57607
57625
|
});
|
|
57608
57626
|
|
|
57609
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57627
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
|
|
57610
57628
|
function parentDir(filePath) {
|
|
57611
57629
|
const sep = filePath.includes("\\") ? "\\" : "/";
|
|
57612
57630
|
const idx = filePath.lastIndexOf(sep);
|
|
@@ -57705,12 +57723,12 @@ var init_file_observer = __esm(() => {
|
|
|
57705
57723
|
init_logger3();
|
|
57706
57724
|
});
|
|
57707
57725
|
|
|
57708
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57726
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
|
|
57709
57727
|
var init_event_bus2 = __esm(() => {
|
|
57710
57728
|
init_event_bus();
|
|
57711
57729
|
});
|
|
57712
57730
|
|
|
57713
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57731
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/api-client.js
|
|
57714
57732
|
function truncateBody(text) {
|
|
57715
57733
|
return text.length <= MAX_ERROR_BODY ? text : `${text.slice(0, MAX_ERROR_BODY)}\u2026[truncated ${text.length - MAX_ERROR_BODY} chars]`;
|
|
57716
57734
|
}
|
|
@@ -57944,12 +57962,12 @@ var init_api_client = __esm(() => {
|
|
|
57944
57962
|
};
|
|
57945
57963
|
});
|
|
57946
57964
|
|
|
57947
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57965
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
|
|
57948
57966
|
var init_telemetry = __esm(() => {
|
|
57949
57967
|
init_tracing2();
|
|
57950
57968
|
});
|
|
57951
57969
|
|
|
57952
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
57970
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/index.js
|
|
57953
57971
|
var init_dist7 = __esm(() => {
|
|
57954
57972
|
init_api_client();
|
|
57955
57973
|
init_event_bus2();
|
|
@@ -57957,7 +57975,7 @@ var init_dist7 = __esm(() => {
|
|
|
57957
57975
|
init_telemetry();
|
|
57958
57976
|
});
|
|
57959
57977
|
|
|
57960
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
57978
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
|
|
57961
57979
|
function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
|
|
57962
57980
|
return {
|
|
57963
57981
|
workflow: workflowName,
|
|
@@ -58358,7 +58376,7 @@ var init_run_lifecycle = __esm(() => {
|
|
|
58358
58376
|
];
|
|
58359
58377
|
});
|
|
58360
58378
|
|
|
58361
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
58379
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
|
|
58362
58380
|
class CapabilityRegistry {
|
|
58363
58381
|
kind;
|
|
58364
58382
|
capabilities = new Map;
|
|
@@ -58389,7 +58407,7 @@ class CapabilityRegistry {
|
|
|
58389
58407
|
}
|
|
58390
58408
|
}
|
|
58391
58409
|
|
|
58392
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
58410
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
|
|
58393
58411
|
function assertRelativeExtensionPath(path, options = {}) {
|
|
58394
58412
|
const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
|
|
58395
58413
|
if (/^([/\\]|[A-Za-z]:[/\\])/.test(path)) {
|
|
@@ -58400,7 +58418,7 @@ function assertRelativeExtensionPath(path, options = {}) {
|
|
|
58400
58418
|
}
|
|
58401
58419
|
}
|
|
58402
58420
|
|
|
58403
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
58421
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
|
|
58404
58422
|
import { isAbsolute, resolve } from "path";
|
|
58405
58423
|
async function loadExtensionModules(refs, options, register) {
|
|
58406
58424
|
if (refs.length === 0)
|
|
@@ -58439,17 +58457,17 @@ async function loadExtensionModules(refs, options, register) {
|
|
|
58439
58457
|
}
|
|
58440
58458
|
var init_extension_loader = () => {};
|
|
58441
58459
|
|
|
58442
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
58460
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
|
|
58443
58461
|
var init_extension = __esm(() => {
|
|
58444
58462
|
init_extension_loader();
|
|
58445
58463
|
});
|
|
58446
58464
|
|
|
58447
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
58465
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.30+8eab9648383b615a/node_modules/@gobing-ai/ts-runtime/dist/extension.js
|
|
58448
58466
|
var init_extension2 = __esm(() => {
|
|
58449
58467
|
init_extension();
|
|
58450
58468
|
});
|
|
58451
58469
|
|
|
58452
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
58470
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
|
|
58453
58471
|
var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, relativeExtensionPath, WorkflowExtensionsSchema, ActionDefSchema, GuardDefSchema, StateDisplaySchema, StateMachineWorkflowDefSchema, FlowParallelBranchDefSchema, FlowNodeDefSchema, TransitionFlowWorkflowDefSchema, DagNodeDefSchema, DagWorkflowDefSchema, WorkflowDefSchema;
|
|
58454
58472
|
var init_schema2 = __esm(() => {
|
|
58455
58473
|
init_extension2();
|
|
@@ -58633,7 +58651,7 @@ var init_schema2 = __esm(() => {
|
|
|
58633
58651
|
]);
|
|
58634
58652
|
});
|
|
58635
58653
|
|
|
58636
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
58654
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
|
|
58637
58655
|
async function loadWorkflowDef(path, options = {}) {
|
|
58638
58656
|
return parseWorkflowDef(await loadStructuredConfig(path, options), path);
|
|
58639
58657
|
}
|
|
@@ -58937,7 +58955,7 @@ var init_config4 = __esm(() => {
|
|
|
58937
58955
|
RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
|
|
58938
58956
|
});
|
|
58939
58957
|
|
|
58940
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
58958
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/extensions.js
|
|
58941
58959
|
function collectWorkflowExtensions(sourceName, sourceDir, extensions) {
|
|
58942
58960
|
if (extensions === undefined)
|
|
58943
58961
|
return [];
|
|
@@ -59001,7 +59019,7 @@ var init_extensions = __esm(() => {
|
|
|
59001
59019
|
init_errors6();
|
|
59002
59020
|
});
|
|
59003
59021
|
|
|
59004
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
59022
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
|
|
59005
59023
|
function mergeVars(workflowVars = {}, overrideVars = {}) {
|
|
59006
59024
|
return { ...workflowVars, ...overrideVars };
|
|
59007
59025
|
}
|
|
@@ -59100,7 +59118,7 @@ var init_variables = __esm(() => {
|
|
|
59100
59118
|
SHELL_BINDING_ANY = /\$\{__WF_\d+\}|\$__WF_\d+\b/;
|
|
59101
59119
|
});
|
|
59102
59120
|
|
|
59103
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
59121
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
|
|
59104
59122
|
class WorkflowEngineHost {
|
|
59105
59123
|
lifecycleBus;
|
|
59106
59124
|
actions = new CapabilityRegistry("workflow action");
|
|
@@ -59298,7 +59316,7 @@ var init_host = __esm(() => {
|
|
|
59298
59316
|
init_variables();
|
|
59299
59317
|
});
|
|
59300
59318
|
|
|
59301
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
59319
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
|
|
59302
59320
|
var WORKFLOW_ENGINE_SCHEMA_SQL, WORKFLOW_ENGINE_MIGRATIONS_SQL;
|
|
59303
59321
|
var init_schema_sql2 = __esm(() => {
|
|
59304
59322
|
WORKFLOW_ENGINE_SCHEMA_SQL = `
|
|
@@ -59401,7 +59419,7 @@ ALTER TABLE runs ADD COLUMN terminal_reason TEXT;
|
|
|
59401
59419
|
`.trim();
|
|
59402
59420
|
});
|
|
59403
59421
|
|
|
59404
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
59422
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
|
|
59405
59423
|
async function applyWorkflowEngineSchema(db) {
|
|
59406
59424
|
for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
|
|
59407
59425
|
const sql = statement.trim();
|
|
@@ -59713,7 +59731,7 @@ var init_persistence = __esm(() => {
|
|
|
59713
59731
|
init_schema_sql2();
|
|
59714
59732
|
});
|
|
59715
59733
|
|
|
59716
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
59734
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
|
|
59717
59735
|
async function runActionStep(action, vars, deps) {
|
|
59718
59736
|
const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
|
|
59719
59737
|
const templateContext = {
|
|
@@ -59782,7 +59800,7 @@ var init_action_step = __esm(() => {
|
|
|
59782
59800
|
init_variables();
|
|
59783
59801
|
});
|
|
59784
59802
|
|
|
59785
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
59803
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/dag.js
|
|
59786
59804
|
function dagTopoOrder(nodes) {
|
|
59787
59805
|
const placed = [];
|
|
59788
59806
|
const placedIds = new Set;
|
|
@@ -60163,7 +60181,7 @@ var init_dag = __esm(() => {
|
|
|
60163
60181
|
init_variables();
|
|
60164
60182
|
});
|
|
60165
60183
|
|
|
60166
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
60184
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
|
|
60167
60185
|
class StateMachineDriver {
|
|
60168
60186
|
options;
|
|
60169
60187
|
constructor(options) {
|
|
@@ -60344,7 +60362,7 @@ var init_state_machine = __esm(() => {
|
|
|
60344
60362
|
EMPTY_OUTCOME = { outcome: "completed", result: undefined, setVars: undefined };
|
|
60345
60363
|
});
|
|
60346
60364
|
|
|
60347
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
60365
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
|
|
60348
60366
|
class TransitionFlowDriver {
|
|
60349
60367
|
options;
|
|
60350
60368
|
constructor(options) {
|
|
@@ -60729,7 +60747,7 @@ var init_transition_flow = __esm(() => {
|
|
|
60729
60747
|
init_variables();
|
|
60730
60748
|
});
|
|
60731
60749
|
|
|
60732
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
60750
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
|
|
60733
60751
|
class WorkflowService {
|
|
60734
60752
|
host;
|
|
60735
60753
|
persistence;
|
|
@@ -61043,7 +61061,7 @@ var init_service = __esm(() => {
|
|
|
61043
61061
|
init_variables();
|
|
61044
61062
|
});
|
|
61045
61063
|
|
|
61046
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.
|
|
61064
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
|
|
61047
61065
|
var init_dist8 = __esm(() => {
|
|
61048
61066
|
init_config4();
|
|
61049
61067
|
init_extensions();
|
|
@@ -61051,9 +61069,10 @@ var init_dist8 = __esm(() => {
|
|
|
61051
61069
|
init_persistence();
|
|
61052
61070
|
init_schema_sql2();
|
|
61053
61071
|
init_service();
|
|
61072
|
+
init_variables();
|
|
61054
61073
|
});
|
|
61055
61074
|
|
|
61056
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
61075
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
|
|
61057
61076
|
function collectExtensions(sourceName, sourceDir, extensions) {
|
|
61058
61077
|
if (extensions === undefined)
|
|
61059
61078
|
return [];
|
|
@@ -61067,7 +61086,7 @@ function collectExtensions(sourceName, sourceDir, extensions) {
|
|
|
61067
61086
|
}
|
|
61068
61087
|
var init_extensions2 = () => {};
|
|
61069
61088
|
|
|
61070
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
61089
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
|
|
61071
61090
|
function createFinding(rule, message, filePath, extras = {}) {
|
|
61072
61091
|
return {
|
|
61073
61092
|
ruleId: rule.id,
|
|
@@ -61138,7 +61157,7 @@ var init_types3 = __esm(() => {
|
|
|
61138
61157
|
});
|
|
61139
61158
|
});
|
|
61140
61159
|
|
|
61141
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
61160
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
|
|
61142
61161
|
async function loadPreset(name, options) {
|
|
61143
61162
|
const merged = await buildMergedRoots(options.roots.map((root) => resolvePath3(root)), options.fileSystem);
|
|
61144
61163
|
const presetPath = findMergedPreset(merged, name);
|
|
@@ -61353,7 +61372,7 @@ var init_loader = __esm(() => {
|
|
|
61353
61372
|
FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
|
|
61354
61373
|
});
|
|
61355
61374
|
|
|
61356
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
61375
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
|
|
61357
61376
|
function normalizeFindingPath(filePath) {
|
|
61358
61377
|
if (!filePath || isAbsolutePath2(filePath))
|
|
61359
61378
|
return null;
|
|
@@ -61418,7 +61437,7 @@ var init_test_stub_fixer = __esm(() => {
|
|
|
61418
61437
|
realFileSystem = createNodeFileSystem2();
|
|
61419
61438
|
});
|
|
61420
61439
|
|
|
61421
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
61440
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
|
|
61422
61441
|
function registerBuiltinFixers(host, exec) {
|
|
61423
61442
|
const regexFixer = new RegexFixerProvider;
|
|
61424
61443
|
const pathFixer = new PathFixerProvider;
|
|
@@ -61637,7 +61656,7 @@ var init_fixers = __esm(() => {
|
|
|
61637
61656
|
};
|
|
61638
61657
|
});
|
|
61639
61658
|
|
|
61640
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
61659
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
|
|
61641
61660
|
function validateAgentId(id) {
|
|
61642
61661
|
if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
|
|
61643
61662
|
throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
|
|
@@ -61738,7 +61757,7 @@ var init_agent_spec = __esm(() => {
|
|
|
61738
61757
|
};
|
|
61739
61758
|
});
|
|
61740
61759
|
|
|
61741
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
61760
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
|
|
61742
61761
|
function getAgentSessionCapability(agent) {
|
|
61743
61762
|
return AGENT_SESSION_CAPABILITY[agent];
|
|
61744
61763
|
}
|
|
@@ -61891,7 +61910,7 @@ var init_shims = __esm(() => {
|
|
|
61891
61910
|
getHelpCommand: () => ({ command: "opencode", args: ["--help"] }),
|
|
61892
61911
|
getVersionCommand: () => ({ command: "opencode", args: ["--version"] }),
|
|
61893
61912
|
getPromptCommand: (options) => {
|
|
61894
|
-
const args = ["run", options.input ?? ""];
|
|
61913
|
+
const args = ["run", options.input ?? "", "--auto"];
|
|
61895
61914
|
if (options.continue === true)
|
|
61896
61915
|
args.push("-c");
|
|
61897
61916
|
if (options.model !== undefined)
|
|
@@ -62178,7 +62197,7 @@ var init_shims = __esm(() => {
|
|
|
62178
62197
|
ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias) => [alias, shim.name])));
|
|
62179
62198
|
});
|
|
62180
62199
|
|
|
62181
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
62200
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
|
|
62182
62201
|
function buildIdentityPreamble(ctx) {
|
|
62183
62202
|
const sections = [
|
|
62184
62203
|
`You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
|
|
@@ -62220,7 +62239,7 @@ function buildIdentityPreamble(ctx) {
|
|
|
62220
62239
|
}
|
|
62221
62240
|
var init_identity = () => {};
|
|
62222
62241
|
|
|
62223
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
62242
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/quota.js
|
|
62224
62243
|
import { createHash as createHash5 } from "crypto";
|
|
62225
62244
|
function classifyQuotaErrorRecord(record) {
|
|
62226
62245
|
const bounded = record.length > MAX_QUOTA_EVIDENCE_BYTES ? record.slice(-MAX_QUOTA_EVIDENCE_BYTES) : record;
|
|
@@ -62331,7 +62350,7 @@ var init_quota = __esm(() => {
|
|
|
62331
62350
|
PROVIDER_QUOTA_CODES = new Map([["1310", "usage_limit_reached"]]);
|
|
62332
62351
|
});
|
|
62333
62352
|
|
|
62334
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
62353
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
|
|
62335
62354
|
function isClaudeStyleSlashCommand(input) {
|
|
62336
62355
|
return SLASH_COMMAND_RE2.test(input);
|
|
62337
62356
|
}
|
|
@@ -62359,7 +62378,7 @@ var init_slash_command = __esm(() => {
|
|
|
62359
62378
|
SLASH_COMMAND_RE2 = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
|
|
62360
62379
|
});
|
|
62361
62380
|
|
|
62362
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
62381
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
|
|
62363
62382
|
function buildCorrelationEnv(correlation) {
|
|
62364
62383
|
return {
|
|
62365
62384
|
[AGENT_RUN_ID_ENV]: correlation.runId,
|
|
@@ -62519,7 +62538,7 @@ var init_ai_runner = __esm(() => {
|
|
|
62519
62538
|
init_slash_command();
|
|
62520
62539
|
});
|
|
62521
62540
|
|
|
62522
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
62541
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
|
|
62523
62542
|
class AgentDetector {
|
|
62524
62543
|
runner;
|
|
62525
62544
|
timeout;
|
|
@@ -62595,7 +62614,7 @@ var init_agent_detector = __esm(() => {
|
|
|
62595
62614
|
VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
|
|
62596
62615
|
});
|
|
62597
62616
|
|
|
62598
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
62617
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
|
|
62599
62618
|
function isNonEmpty(value) {
|
|
62600
62619
|
return value !== undefined && value.trim().length > 0;
|
|
62601
62620
|
}
|
|
@@ -62724,7 +62743,7 @@ var init_auth_shims = __esm(() => {
|
|
|
62724
62743
|
};
|
|
62725
62744
|
});
|
|
62726
62745
|
|
|
62727
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
62746
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/decision/errors.js
|
|
62728
62747
|
var DecisionError, DecisionConfigError, DecisionAuthError, DecisionRateLimitError, DecisionTimeoutError, DecisionConnectionError, DecisionRequestError, DecisionBackendError;
|
|
62729
62748
|
var init_errors7 = __esm(() => {
|
|
62730
62749
|
DecisionError = class DecisionError extends Error {
|
|
@@ -62786,7 +62805,7 @@ var init_errors7 = __esm(() => {
|
|
|
62786
62805
|
};
|
|
62787
62806
|
});
|
|
62788
62807
|
|
|
62789
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
62808
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/decision/types.js
|
|
62790
62809
|
var q;
|
|
62791
62810
|
var init_types4 = __esm(() => {
|
|
62792
62811
|
q = {
|
|
@@ -63376,7 +63395,7 @@ var init_dist9 = __esm(() => {
|
|
|
63376
63395
|
RUNTIME = describeRuntime();
|
|
63377
63396
|
});
|
|
63378
63397
|
|
|
63379
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
63398
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/decision/validation.js
|
|
63380
63399
|
function record2(value) {
|
|
63381
63400
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
63382
63401
|
}
|
|
@@ -63464,7 +63483,7 @@ var init_validation2 = __esm(() => {
|
|
|
63464
63483
|
init_errors7();
|
|
63465
63484
|
});
|
|
63466
63485
|
|
|
63467
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
63486
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/decision/typesafe-driver.js
|
|
63468
63487
|
function createTypesafeDriver(config) {
|
|
63469
63488
|
let client;
|
|
63470
63489
|
try {
|
|
@@ -63568,7 +63587,7 @@ var init_typesafe_driver = __esm(() => {
|
|
|
63568
63587
|
init_validation2();
|
|
63569
63588
|
});
|
|
63570
63589
|
|
|
63571
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
63590
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/decision/decision-maker.js
|
|
63572
63591
|
function resolveApiKey(options) {
|
|
63573
63592
|
const env = options.env ?? getProcessEnv();
|
|
63574
63593
|
const apiKey = options.apiKey ?? env.TYPESAFE_API_KEY;
|
|
@@ -63657,7 +63676,7 @@ var init_decision_maker = __esm(() => {
|
|
|
63657
63676
|
init_validation2();
|
|
63658
63677
|
});
|
|
63659
63678
|
|
|
63660
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
63679
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
|
|
63661
63680
|
class ModelHealthProbeRegistry {
|
|
63662
63681
|
probes = new Map;
|
|
63663
63682
|
register(providerPrefix, probe) {
|
|
@@ -63761,7 +63780,7 @@ var init_model_health_probe = __esm(() => {
|
|
|
63761
63780
|
};
|
|
63762
63781
|
});
|
|
63763
63782
|
|
|
63764
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
63783
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
|
|
63765
63784
|
class DoctorRunner {
|
|
63766
63785
|
detector;
|
|
63767
63786
|
runner;
|
|
@@ -63901,10 +63920,10 @@ var init_doctor_runner = __esm(() => {
|
|
|
63901
63920
|
init_model_health_probe();
|
|
63902
63921
|
});
|
|
63903
63922
|
|
|
63904
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
63923
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
|
|
63905
63924
|
var init_events = () => {};
|
|
63906
63925
|
|
|
63907
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
63926
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
|
|
63908
63927
|
import { Buffer as Buffer5 } from "buffer";
|
|
63909
63928
|
|
|
63910
63929
|
class TeamAgentProcess {
|
|
@@ -64071,10 +64090,10 @@ var init_team_agent_process = __esm(() => {
|
|
|
64071
64090
|
init_quota();
|
|
64072
64091
|
});
|
|
64073
64092
|
|
|
64074
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
64093
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
|
|
64075
64094
|
var init_team_orchestrator = () => {};
|
|
64076
64095
|
|
|
64077
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.
|
|
64096
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
|
|
64078
64097
|
var init_dist10 = __esm(() => {
|
|
64079
64098
|
init_agent_detector();
|
|
64080
64099
|
init_agent_spec();
|
|
@@ -64095,7 +64114,7 @@ var init_dist10 = __esm(() => {
|
|
|
64095
64114
|
init_team_orchestrator();
|
|
64096
64115
|
});
|
|
64097
64116
|
|
|
64098
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64117
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
|
|
64099
64118
|
function stringArray(value) {
|
|
64100
64119
|
return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
|
|
64101
64120
|
}
|
|
@@ -64133,7 +64152,7 @@ function parseInlineFlags(source) {
|
|
|
64133
64152
|
return { flags, rest: source.slice(match[0].length) };
|
|
64134
64153
|
}
|
|
64135
64154
|
|
|
64136
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64155
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
|
|
64137
64156
|
function matchesAny(path, patterns) {
|
|
64138
64157
|
if (patterns === undefined || patterns.length === 0)
|
|
64139
64158
|
return true;
|
|
@@ -64181,7 +64200,7 @@ function escapeRegExp(value) {
|
|
|
64181
64200
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
64182
64201
|
}
|
|
64183
64202
|
|
|
64184
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64203
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
|
|
64185
64204
|
async function discoverFiles2(options) {
|
|
64186
64205
|
const fs = options.fs ?? createNodeFileSystem2();
|
|
64187
64206
|
const allFiles = await walkDir2(options.workdir, fs, DEFAULT_EXCLUDES);
|
|
@@ -64212,12 +64231,12 @@ var init_file_discovery = __esm(() => {
|
|
|
64212
64231
|
DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
|
|
64213
64232
|
});
|
|
64214
64233
|
|
|
64215
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64234
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
|
|
64216
64235
|
var init_file_utils = __esm(() => {
|
|
64217
64236
|
init_file_discovery();
|
|
64218
64237
|
});
|
|
64219
64238
|
|
|
64220
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64239
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
|
|
64221
64240
|
class AgentDetectionEvaluator {
|
|
64222
64241
|
detector;
|
|
64223
64242
|
constructor(detector = new AgentDetector) {
|
|
@@ -64245,7 +64264,7 @@ var init_agent_detection_evaluator = __esm(() => {
|
|
|
64245
64264
|
init_file_utils();
|
|
64246
64265
|
});
|
|
64247
64266
|
|
|
64248
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64267
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
|
|
64249
64268
|
class CoverageGateEvaluator {
|
|
64250
64269
|
constructor() {}
|
|
64251
64270
|
async evaluate(rule, context) {
|
|
@@ -64329,7 +64348,7 @@ var init_coverage_gate_evaluator = __esm(() => {
|
|
|
64329
64348
|
init_file_utils();
|
|
64330
64349
|
});
|
|
64331
64350
|
|
|
64332
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64351
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
|
|
64333
64352
|
class ExitCodeEvaluator {
|
|
64334
64353
|
executor;
|
|
64335
64354
|
constructor(executor = nodeBunFactory2.createProcessExecutor()) {
|
|
@@ -64365,7 +64384,7 @@ var init_exit_code_evaluator = __esm(() => {
|
|
|
64365
64384
|
init_file_utils();
|
|
64366
64385
|
});
|
|
64367
64386
|
|
|
64368
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64387
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
|
|
64369
64388
|
class ForbiddenImportEvaluator {
|
|
64370
64389
|
constructor() {}
|
|
64371
64390
|
async evaluate(rule, context) {
|
|
@@ -64446,7 +64465,7 @@ var init_forbidden_import_evaluator = __esm(() => {
|
|
|
64446
64465
|
init_file_utils();
|
|
64447
64466
|
});
|
|
64448
64467
|
|
|
64449
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64468
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
|
|
64450
64469
|
class ImportBoundaryEvaluator {
|
|
64451
64470
|
async evaluate(rule, context) {
|
|
64452
64471
|
const config = rule.evaluator.config ?? {};
|
|
@@ -64539,7 +64558,7 @@ var init_import_boundary_evaluator = __esm(() => {
|
|
|
64539
64558
|
init_file_utils();
|
|
64540
64559
|
});
|
|
64541
64560
|
|
|
64542
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64561
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
|
|
64543
64562
|
class PathEvaluator {
|
|
64544
64563
|
constructor() {}
|
|
64545
64564
|
async evaluate(rule, context) {
|
|
@@ -64600,7 +64619,7 @@ var init_path_evaluator = __esm(() => {
|
|
|
64600
64619
|
init_file_utils();
|
|
64601
64620
|
});
|
|
64602
64621
|
|
|
64603
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64622
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
|
|
64604
64623
|
class RegexEvaluator {
|
|
64605
64624
|
constructor() {}
|
|
64606
64625
|
async evaluate(rule, context) {
|
|
@@ -64678,7 +64697,7 @@ var init_regex_evaluator = __esm(() => {
|
|
|
64678
64697
|
init_file_utils();
|
|
64679
64698
|
});
|
|
64680
64699
|
|
|
64681
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64700
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
|
|
64682
64701
|
class RipgrepEvaluator {
|
|
64683
64702
|
executor;
|
|
64684
64703
|
constructor(executor = nodeBunFactory2.createProcessExecutor()) {
|
|
@@ -64771,7 +64790,7 @@ var init_ripgrep_evaluator = __esm(() => {
|
|
|
64771
64790
|
init_file_utils();
|
|
64772
64791
|
});
|
|
64773
64792
|
|
|
64774
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64793
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
|
|
64775
64794
|
class SchemaArtifactEvaluator {
|
|
64776
64795
|
constructor() {}
|
|
64777
64796
|
async evaluate(rule, context) {
|
|
@@ -64849,7 +64868,7 @@ var init_schema_artifact_evaluator = __esm(() => {
|
|
|
64849
64868
|
init_file_utils();
|
|
64850
64869
|
});
|
|
64851
64870
|
|
|
64852
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64871
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
|
|
64853
64872
|
class SecretsScannerEvaluator {
|
|
64854
64873
|
constructor() {}
|
|
64855
64874
|
async evaluate(rule, context) {
|
|
@@ -64917,7 +64936,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
|
|
|
64917
64936
|
ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
|
|
64918
64937
|
});
|
|
64919
64938
|
|
|
64920
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
64939
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
|
|
64921
64940
|
class SgEvaluator {
|
|
64922
64941
|
executor;
|
|
64923
64942
|
constructor(executor = nodeBunFactory2.createProcessExecutor()) {
|
|
@@ -65014,7 +65033,7 @@ var init_sg_evaluator = __esm(() => {
|
|
|
65014
65033
|
init_file_utils();
|
|
65015
65034
|
});
|
|
65016
65035
|
|
|
65017
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65036
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
|
|
65018
65037
|
class TypeScriptTestPathResolver {
|
|
65019
65038
|
name = "typescript";
|
|
65020
65039
|
constructor() {}
|
|
@@ -65097,7 +65116,7 @@ function testify(rel) {
|
|
|
65097
65116
|
return `${dir}test_${base}`;
|
|
65098
65117
|
}
|
|
65099
65118
|
|
|
65100
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65119
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
|
|
65101
65120
|
class TestLocationEvaluator {
|
|
65102
65121
|
resolvers;
|
|
65103
65122
|
constructor(resolvers) {
|
|
@@ -65172,7 +65191,7 @@ var init_test_location_evaluator = __esm(() => {
|
|
|
65172
65191
|
TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
|
|
65173
65192
|
});
|
|
65174
65193
|
|
|
65175
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65194
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
|
|
65176
65195
|
class TsdocExportEvaluator {
|
|
65177
65196
|
constructor() {}
|
|
65178
65197
|
async evaluate(rule, context) {
|
|
@@ -65257,7 +65276,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
|
|
|
65257
65276
|
};
|
|
65258
65277
|
});
|
|
65259
65278
|
|
|
65260
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65279
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
|
|
65261
65280
|
class JsonFormatter {
|
|
65262
65281
|
constructor() {}
|
|
65263
65282
|
format(result) {
|
|
@@ -65265,7 +65284,7 @@ class JsonFormatter {
|
|
|
65265
65284
|
}
|
|
65266
65285
|
}
|
|
65267
65286
|
|
|
65268
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65287
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
|
|
65269
65288
|
class TextFormatter {
|
|
65270
65289
|
constructor() {}
|
|
65271
65290
|
format(result) {
|
|
@@ -65279,7 +65298,7 @@ class TextFormatter {
|
|
|
65279
65298
|
}
|
|
65280
65299
|
}
|
|
65281
65300
|
|
|
65282
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65301
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
|
|
65283
65302
|
function registerBuiltins(host, executor) {
|
|
65284
65303
|
const path = new PathEvaluator;
|
|
65285
65304
|
host.evaluators.register("regex", new RegexEvaluator, "builtin");
|
|
@@ -65319,7 +65338,7 @@ var init_builtins = __esm(() => {
|
|
|
65319
65338
|
init_tsdoc_export_evaluator();
|
|
65320
65339
|
});
|
|
65321
65340
|
|
|
65322
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65341
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
|
|
65323
65342
|
class RuleEngineHost {
|
|
65324
65343
|
evaluators;
|
|
65325
65344
|
formatters;
|
|
@@ -65336,7 +65355,7 @@ var init_rule_engine_host = __esm(() => {
|
|
|
65336
65355
|
init_extension2();
|
|
65337
65356
|
});
|
|
65338
65357
|
|
|
65339
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65358
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
|
|
65340
65359
|
class RuleEngine {
|
|
65341
65360
|
host;
|
|
65342
65361
|
events;
|
|
@@ -65522,10 +65541,10 @@ var init_engine = __esm(() => {
|
|
|
65522
65541
|
init_types3();
|
|
65523
65542
|
});
|
|
65524
65543
|
|
|
65525
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65544
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/fixture-verifier.js
|
|
65526
65545
|
var init_fixture_verifier = () => {};
|
|
65527
65546
|
|
|
65528
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65547
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
|
|
65529
65548
|
async function bundledRulesRoot() {
|
|
65530
65549
|
if (cachedRoot !== undefined)
|
|
65531
65550
|
return cachedRoot;
|
|
@@ -65576,7 +65595,7 @@ var init_bundled_rules = __esm(() => {
|
|
|
65576
65595
|
init_dist5();
|
|
65577
65596
|
});
|
|
65578
65597
|
|
|
65579
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65598
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
|
|
65580
65599
|
class DbRulePersistenceAdapter {
|
|
65581
65600
|
db;
|
|
65582
65601
|
constructor(db) {
|
|
@@ -65610,7 +65629,7 @@ class DbRulePersistenceAdapter {
|
|
|
65610
65629
|
}
|
|
65611
65630
|
}
|
|
65612
65631
|
|
|
65613
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65632
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
|
|
65614
65633
|
var RULE_ENGINE_SCHEMA_SQL = `
|
|
65615
65634
|
CREATE TABLE IF NOT EXISTS rule_runs (
|
|
65616
65635
|
id TEXT PRIMARY KEY,
|
|
@@ -65656,10 +65675,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
|
|
|
65656
65675
|
CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
|
|
65657
65676
|
`;
|
|
65658
65677
|
|
|
65659
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65678
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
|
|
65660
65679
|
var init_persistence2 = () => {};
|
|
65661
65680
|
|
|
65662
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.
|
|
65681
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.30+473ffacabfa9a78c/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
|
|
65663
65682
|
var init_dist11 = __esm(() => {
|
|
65664
65683
|
init_extensions2();
|
|
65665
65684
|
init_loader();
|
|
@@ -66877,7 +66896,7 @@ ${HISTORY_TASK_SESSION_SCHEMA_SQL}
|
|
|
66877
66896
|
];
|
|
66878
66897
|
});
|
|
66879
66898
|
|
|
66880
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
66899
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/execution-policy.js
|
|
66881
66900
|
function resolveExecutionTimeoutMs2(scope, value, inherited) {
|
|
66882
66901
|
if (value === undefined) {
|
|
66883
66902
|
return inherited ?? null;
|
|
@@ -66955,7 +66974,7 @@ async function runWithExecutionDeadline2(action, options) {
|
|
|
66955
66974
|
return { outcome: "completed", result, elapsedMs, timedOut };
|
|
66956
66975
|
}
|
|
66957
66976
|
|
|
66958
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
66977
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
|
|
66959
66978
|
function settleWithin(promise, deadline) {
|
|
66960
66979
|
const remaining = deadline - Date.now();
|
|
66961
66980
|
if (remaining <= 0)
|
|
@@ -66970,7 +66989,7 @@ function settleWithin(promise, deadline) {
|
|
|
66970
66989
|
return settled;
|
|
66971
66990
|
}
|
|
66972
66991
|
|
|
66973
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
66992
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
|
|
66974
66993
|
function queueLogger() {
|
|
66975
66994
|
if (!_queueLogger)
|
|
66976
66995
|
_queueLogger = getLogger2("job-queue");
|
|
@@ -67392,7 +67411,7 @@ var init_db_job_queue = __esm(() => {
|
|
|
67392
67411
|
init_tracing2();
|
|
67393
67412
|
});
|
|
67394
67413
|
|
|
67395
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
67414
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
|
|
67396
67415
|
var init_job_queue_db = __esm(() => {
|
|
67397
67416
|
init_db_job_queue();
|
|
67398
67417
|
});
|
|
@@ -69291,7 +69310,7 @@ var init_src2 = __esm(() => {
|
|
|
69291
69310
|
init_stage_registry();
|
|
69292
69311
|
});
|
|
69293
69312
|
|
|
69294
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.
|
|
69313
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.30+56ead4096f0fc755/node_modules/@gobing-ai/ts-ai-decision/dist/errors.js
|
|
69295
69314
|
var DecisionCatalogError, DecisionRegistryError, UnknownDecisionMakerError, UnknownDecisionError, DecisionInputError;
|
|
69296
69315
|
var init_errors8 = __esm(() => {
|
|
69297
69316
|
DecisionCatalogError = class DecisionCatalogError extends Error {
|
|
@@ -69339,7 +69358,7 @@ var init_errors8 = __esm(() => {
|
|
|
69339
69358
|
};
|
|
69340
69359
|
});
|
|
69341
69360
|
|
|
69342
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.
|
|
69361
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.30+56ead4096f0fc755/node_modules/@gobing-ai/ts-ai-decision/dist/params.js
|
|
69343
69362
|
function implicitInstructionsParam() {
|
|
69344
69363
|
return { name: INSTRUCTIONS_PARAM, type: "string", required: false, default: "" };
|
|
69345
69364
|
}
|
|
@@ -69463,7 +69482,7 @@ var init_params = __esm(() => {
|
|
|
69463
69482
|
TEMPLATE_REF2 = /\$\{([^}]+)\}/g;
|
|
69464
69483
|
});
|
|
69465
69484
|
|
|
69466
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.
|
|
69485
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.30+56ead4096f0fc755/node_modules/@gobing-ai/ts-ai-decision/dist/schema.js
|
|
69467
69486
|
var DECISION_ID_PATTERN, PARAM_NAME_PATTERN, MAKER_NAME_PATTERN, JsonValueSchema, JevEntrySchema, ParamTypeSchema, FullParamSchema, ParamSchema, NoulCriteriaSchema, ChoiceCriteriaSchema, ScoreCriteriaSchema, DecisionSchema, DecisionCatalogSchema;
|
|
69468
69487
|
var init_schema7 = __esm(() => {
|
|
69469
69488
|
init_zod();
|
|
@@ -69515,7 +69534,7 @@ var init_schema7 = __esm(() => {
|
|
|
69515
69534
|
});
|
|
69516
69535
|
});
|
|
69517
69536
|
|
|
69518
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.
|
|
69537
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.30+56ead4096f0fc755/node_modules/@gobing-ai/ts-ai-decision/dist/catalog.js
|
|
69519
69538
|
function assertYamlSource(source) {
|
|
69520
69539
|
if (!YAML_SOURCE_PATTERN.test(source)) {
|
|
69521
69540
|
throw new DecisionCatalogError(`Decision catalogs are YAML only; source "${source}" does not end in .yaml or .yml`, source);
|
|
@@ -69741,7 +69760,7 @@ var init_catalog = __esm(() => {
|
|
|
69741
69760
|
YAML_SOURCE_PATTERN = /\.(yaml|yml)$/;
|
|
69742
69761
|
});
|
|
69743
69762
|
|
|
69744
|
-
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.
|
|
69763
|
+
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-decision-fm/dist/estimate.js
|
|
69745
69764
|
function entropyConfidence(probabilities) {
|
|
69746
69765
|
const n = probabilities.length;
|
|
69747
69766
|
if (n <= 1)
|
|
@@ -69817,7 +69836,7 @@ function estimateNoul(samples) {
|
|
|
69817
69836
|
return { kind: "noul", probability: yes / samples.length };
|
|
69818
69837
|
}
|
|
69819
69838
|
|
|
69820
|
-
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.
|
|
69839
|
+
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-decision-fm/dist/fm-process.js
|
|
69821
69840
|
function countTokensArgv(instructions, prompt) {
|
|
69822
69841
|
return ["count-tokens", "-q", `--instructions=${instructions}`, "--", prompt];
|
|
69823
69842
|
}
|
|
@@ -69930,7 +69949,7 @@ var init_fm_process = __esm(() => {
|
|
|
69930
69949
|
init_dist10();
|
|
69931
69950
|
});
|
|
69932
69951
|
|
|
69933
|
-
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.
|
|
69952
|
+
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-decision-fm/dist/schema.js
|
|
69934
69953
|
function buildFmSchema(questions) {
|
|
69935
69954
|
const properties = {};
|
|
69936
69955
|
for (const [key, question] of Object.entries(questions)) {
|
|
@@ -70016,7 +70035,7 @@ var init_schema8 = __esm(() => {
|
|
|
70016
70035
|
FM_INSTRUCTIONS = "You are a decision engine. Answer every question below using only the supplied state. " + "For each question choose exactly one of the listed options. " + "Reply with the JSON object the schema requires.";
|
|
70017
70036
|
});
|
|
70018
70037
|
|
|
70019
|
-
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.
|
|
70038
|
+
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-decision-fm/dist/driver.js
|
|
70020
70039
|
function createFmDriver(options = {}) {
|
|
70021
70040
|
const { samples = 5, deterministic = false, maxPromptTokens = 6000, requestTimeoutMs = 30000, guardrails, fmPath = "fm", executor = nodeBunFactory2.createProcessExecutor(), platform = process.platform, arch = process.arch } = options;
|
|
70022
70041
|
if (!Number.isInteger(samples) || samples < 1) {
|
|
@@ -70099,12 +70118,12 @@ var init_driver3 = __esm(() => {
|
|
|
70099
70118
|
init_schema8();
|
|
70100
70119
|
});
|
|
70101
70120
|
|
|
70102
|
-
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.
|
|
70121
|
+
// ../../node_modules/.bun/@gobing-ai+ts-decision-fm@0.5.30+47932b68218ad3e3/node_modules/@gobing-ai/ts-decision-fm/dist/index.js
|
|
70103
70122
|
var init_dist12 = __esm(() => {
|
|
70104
70123
|
init_driver3();
|
|
70105
70124
|
});
|
|
70106
70125
|
|
|
70107
|
-
// ../../node_modules/.bun/@gobing-ai+ts-laya-mlx@0.5.
|
|
70126
|
+
// ../../node_modules/.bun/@gobing-ai+ts-laya-mlx@0.5.30+b7baab32eccd37ef/node_modules/@gobing-ai/ts-laya-mlx/dist/worker-client.js
|
|
70108
70127
|
function resolveForwardedEnv(env) {
|
|
70109
70128
|
const forwarded = {};
|
|
70110
70129
|
if (!env)
|
|
@@ -80593,7 +80612,7 @@ var init_dist25 = __esm(() => {
|
|
|
80593
80612
|
init_load();
|
|
80594
80613
|
});
|
|
80595
80614
|
|
|
80596
|
-
// ../../node_modules/.bun/@gobing-ai+ts-laya-mlx@0.5.
|
|
80615
|
+
// ../../node_modules/.bun/@gobing-ai+ts-laya-mlx@0.5.30+b7baab32eccd37ef/node_modules/@gobing-ai/ts-laya-mlx/dist/native-client.js
|
|
80597
80616
|
class LayaNativeClient {
|
|
80598
80617
|
agent = null;
|
|
80599
80618
|
loading = null;
|
|
@@ -80687,7 +80706,7 @@ var init_native_client = __esm(() => {
|
|
|
80687
80706
|
init_worker_client();
|
|
80688
80707
|
});
|
|
80689
80708
|
|
|
80690
|
-
// ../../node_modules/.bun/@gobing-ai+ts-laya-mlx@0.5.
|
|
80709
|
+
// ../../node_modules/.bun/@gobing-ai+ts-laya-mlx@0.5.30+b7baab32eccd37ef/node_modules/@gobing-ai/ts-laya-mlx/dist/driver.js
|
|
80691
80710
|
function resolveLayaCore(options = {}) {
|
|
80692
80711
|
const raw = options.core ?? (options.env?.LAYA_CORE || undefined) ?? "mlx-python";
|
|
80693
80712
|
if (!LAYA_CORES.includes(raw)) {
|
|
@@ -80888,12 +80907,12 @@ var init_driver4 = __esm(() => {
|
|
|
80888
80907
|
LAYA_CORES = ["mlx-python", "mlx-native", "auto"];
|
|
80889
80908
|
});
|
|
80890
80909
|
|
|
80891
|
-
// ../../node_modules/.bun/@gobing-ai+ts-laya-mlx@0.5.
|
|
80910
|
+
// ../../node_modules/.bun/@gobing-ai+ts-laya-mlx@0.5.30+b7baab32eccd37ef/node_modules/@gobing-ai/ts-laya-mlx/dist/index.js
|
|
80892
80911
|
var init_dist26 = __esm(() => {
|
|
80893
80912
|
init_driver4();
|
|
80894
80913
|
});
|
|
80895
80914
|
|
|
80896
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.
|
|
80915
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.30+56ead4096f0fc755/node_modules/@gobing-ai/ts-ai-decision/dist/registry.js
|
|
80897
80916
|
class DecisionMakerRegistry {
|
|
80898
80917
|
entries = new Map;
|
|
80899
80918
|
constructor(options) {
|
|
@@ -80976,7 +80995,7 @@ var init_registry = __esm(() => {
|
|
|
80976
80995
|
NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
80977
80996
|
});
|
|
80978
80997
|
|
|
80979
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.
|
|
80998
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.30+56ead4096f0fc755/node_modules/@gobing-ai/ts-ai-decision/dist/hub.js
|
|
80980
80999
|
function effectiveMinConfidence(definition, defaults) {
|
|
80981
81000
|
return definition.minConfidence ?? defaults.minConfidence ?? DEFAULT_MIN_CONFIDENCE;
|
|
80982
81001
|
}
|
|
@@ -81164,10 +81183,10 @@ var init_hub = __esm(() => {
|
|
|
81164
81183
|
init_registry();
|
|
81165
81184
|
});
|
|
81166
81185
|
|
|
81167
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.
|
|
81186
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.30+56ead4096f0fc755/node_modules/@gobing-ai/ts-ai-decision/dist/types.js
|
|
81168
81187
|
var init_types6 = () => {};
|
|
81169
81188
|
|
|
81170
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.
|
|
81189
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-decision@0.5.30+56ead4096f0fc755/node_modules/@gobing-ai/ts-ai-decision/dist/index.js
|
|
81171
81190
|
var init_dist27 = __esm(() => {
|
|
81172
81191
|
init_catalog();
|
|
81173
81192
|
init_errors8();
|
|
@@ -82742,18 +82761,316 @@ var init_decision_evidence = __esm(() => {
|
|
|
82742
82761
|
MAX_SUMMARY_BYTES = 8 * 1024;
|
|
82743
82762
|
});
|
|
82744
82763
|
|
|
82764
|
+
// ../../packages/app/src/workflow/receipt.ts
|
|
82765
|
+
import { isAbsolute as isAbsolute3, join as join14 } from "path";
|
|
82766
|
+
function declaredStrings(raw) {
|
|
82767
|
+
return stringList(raw);
|
|
82768
|
+
}
|
|
82769
|
+
function declaredInputs(raw) {
|
|
82770
|
+
if (!Array.isArray(raw))
|
|
82771
|
+
return [];
|
|
82772
|
+
return raw.map(parseInput).filter((input) => input !== null);
|
|
82773
|
+
}
|
|
82774
|
+
function segment(value, label) {
|
|
82775
|
+
if (value === "" || value.includes("/") || value.includes("\\") || value.includes("..")) {
|
|
82776
|
+
throw new Error(`refusing a ${label} path for '${value}': expected a single path segment`);
|
|
82777
|
+
}
|
|
82778
|
+
return value;
|
|
82779
|
+
}
|
|
82780
|
+
function workItemPath(workdir, runId) {
|
|
82781
|
+
return join14(workdir, ".spur", "run", segment(runId, "work item"), "work-item.json");
|
|
82782
|
+
}
|
|
82783
|
+
function receiptPath(workdir, runId, state) {
|
|
82784
|
+
return join14(workdir, ".spur", "run", segment(runId, "receipt"), "receipts", `${segment(state, "receipt")}.json`);
|
|
82785
|
+
}
|
|
82786
|
+
async function writeWorkItem(fs, workdir, workItem) {
|
|
82787
|
+
const target = workItemPath(workdir, workItem.runId);
|
|
82788
|
+
await fs.writeFile(target, `${JSON.stringify(workItem, null, 2)}
|
|
82789
|
+
`);
|
|
82790
|
+
return target;
|
|
82791
|
+
}
|
|
82792
|
+
async function readWorkItem(fs, workdir, runId) {
|
|
82793
|
+
const target = workItemPath(workdir, runId);
|
|
82794
|
+
if (!await fs.exists(target))
|
|
82795
|
+
return null;
|
|
82796
|
+
try {
|
|
82797
|
+
return parseWorkItem(JSON.parse(await fs.readFile(target)));
|
|
82798
|
+
} catch {
|
|
82799
|
+
return null;
|
|
82800
|
+
}
|
|
82801
|
+
}
|
|
82802
|
+
async function writeReceipt(fs, workdir, receipt) {
|
|
82803
|
+
const target = receiptPath(workdir, receipt.runId, receipt.state);
|
|
82804
|
+
await fs.writeFile(target, `${JSON.stringify(receipt, null, 2)}
|
|
82805
|
+
`);
|
|
82806
|
+
return target;
|
|
82807
|
+
}
|
|
82808
|
+
async function readReceipt(fs, workdir, path) {
|
|
82809
|
+
const target = isAbsolute3(path) ? path : join14(workdir, path);
|
|
82810
|
+
if (!await fs.exists(target))
|
|
82811
|
+
return null;
|
|
82812
|
+
try {
|
|
82813
|
+
return parseReceipt(JSON.parse(await fs.readFile(target)));
|
|
82814
|
+
} catch {
|
|
82815
|
+
return null;
|
|
82816
|
+
}
|
|
82817
|
+
}
|
|
82818
|
+
function parseWorkItem(raw) {
|
|
82819
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
82820
|
+
return null;
|
|
82821
|
+
const value = raw;
|
|
82822
|
+
if (typeof value.runId !== "string" || value.runId === "")
|
|
82823
|
+
return null;
|
|
82824
|
+
if (typeof value.state !== "string" || value.state === "")
|
|
82825
|
+
return null;
|
|
82826
|
+
if (typeof value.prompt !== "string")
|
|
82827
|
+
return null;
|
|
82828
|
+
return {
|
|
82829
|
+
runId: value.runId,
|
|
82830
|
+
state: value.state,
|
|
82831
|
+
skill: typeof value.skill === "string" ? value.skill : null,
|
|
82832
|
+
prompt: value.prompt,
|
|
82833
|
+
inputs: declaredInputs(value.inputs),
|
|
82834
|
+
expectFiles: stringList(value.expectFiles),
|
|
82835
|
+
ownedSections: stringList(value.ownedSections)
|
|
82836
|
+
};
|
|
82837
|
+
}
|
|
82838
|
+
function parseReceipt(raw) {
|
|
82839
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
82840
|
+
return null;
|
|
82841
|
+
const value = raw;
|
|
82842
|
+
if (typeof value.runId !== "string" || value.runId === "")
|
|
82843
|
+
return null;
|
|
82844
|
+
if (typeof value.state !== "string" || value.state === "")
|
|
82845
|
+
return null;
|
|
82846
|
+
if (!RECEIPT_EXECUTORS.includes(value.executor))
|
|
82847
|
+
return null;
|
|
82848
|
+
if (!RECEIPT_OUTCOMES.includes(value.outcome))
|
|
82849
|
+
return null;
|
|
82850
|
+
return {
|
|
82851
|
+
runId: value.runId,
|
|
82852
|
+
state: value.state,
|
|
82853
|
+
executor: value.executor,
|
|
82854
|
+
outcome: value.outcome,
|
|
82855
|
+
startedAt: typeof value.startedAt === "string" ? value.startedAt : "",
|
|
82856
|
+
finishedAt: typeof value.finishedAt === "string" ? value.finishedAt : null,
|
|
82857
|
+
files: stringList(value.files),
|
|
82858
|
+
reason: typeof value.reason === "string" ? value.reason : null,
|
|
82859
|
+
...typeof value.contract === "string" ? { contract: value.contract } : {}
|
|
82860
|
+
};
|
|
82861
|
+
}
|
|
82862
|
+
async function validateWorkItemReceipt(fs, workdir, workItem, receipt) {
|
|
82863
|
+
if (receipt === null)
|
|
82864
|
+
return { ok: false, error: "work-item receipt could not be read (missing or malformed)" };
|
|
82865
|
+
if (receipt.runId !== workItem.runId) {
|
|
82866
|
+
return { ok: false, error: `receipt runId '${receipt.runId}' does not match run '${workItem.runId}'` };
|
|
82867
|
+
}
|
|
82868
|
+
if (receipt.state !== workItem.state) {
|
|
82869
|
+
return {
|
|
82870
|
+
ok: false,
|
|
82871
|
+
error: `receipt state '${receipt.state}' does not match paused state '${workItem.state}'`
|
|
82872
|
+
};
|
|
82873
|
+
}
|
|
82874
|
+
if (receipt.outcome !== "done") {
|
|
82875
|
+
return {
|
|
82876
|
+
ok: false,
|
|
82877
|
+
error: `receipt outcome '${receipt.outcome}' does not complete this work item (only 'done' resumes the run; ADR-126 A4)`
|
|
82878
|
+
};
|
|
82879
|
+
}
|
|
82880
|
+
const missing = [];
|
|
82881
|
+
for (const path of workItem.expectFiles) {
|
|
82882
|
+
if (!await fs.exists(isAbsolute3(path) ? path : join14(workdir, path)))
|
|
82883
|
+
missing.push(path);
|
|
82884
|
+
}
|
|
82885
|
+
if (missing.length > 0) {
|
|
82886
|
+
return { ok: false, error: `expected file(s) missing after the host run: ${missing.join(", ")}` };
|
|
82887
|
+
}
|
|
82888
|
+
if (workItem.ownedSections.length === 0)
|
|
82889
|
+
return { ok: true };
|
|
82890
|
+
const taskInputs = workItem.inputs.filter((input) => input.kind === "task");
|
|
82891
|
+
if (taskInputs.length === 0) {
|
|
82892
|
+
return {
|
|
82893
|
+
ok: false,
|
|
82894
|
+
error: `no 'task' input is declared for owned section(s): ${workItem.ownedSections.join(", ")}`
|
|
82895
|
+
};
|
|
82896
|
+
}
|
|
82897
|
+
const empty = [];
|
|
82898
|
+
for (const input of taskInputs) {
|
|
82899
|
+
const target = isAbsolute3(input.path) ? input.path : join14(workdir, input.path);
|
|
82900
|
+
let body;
|
|
82901
|
+
try {
|
|
82902
|
+
body = await fs.readFile(target);
|
|
82903
|
+
} catch {
|
|
82904
|
+
return { ok: false, error: `owned section(s) cannot be verified: task input ${input.path} is unreadable` };
|
|
82905
|
+
}
|
|
82906
|
+
for (const section of workItem.ownedSections) {
|
|
82907
|
+
if (isEmptySection(body, section))
|
|
82908
|
+
empty.push(`${input.path}: ${section}`);
|
|
82909
|
+
}
|
|
82910
|
+
}
|
|
82911
|
+
if (empty.length > 0) {
|
|
82912
|
+
return { ok: false, error: `owned section(s) empty in ${empty.join(", ")}` };
|
|
82913
|
+
}
|
|
82914
|
+
return { ok: true };
|
|
82915
|
+
}
|
|
82916
|
+
function isEmptySection(markdown, section) {
|
|
82917
|
+
const lines = markdown.split(/\r?\n/);
|
|
82918
|
+
const wanted = section.trim().toLowerCase();
|
|
82919
|
+
let start = -1;
|
|
82920
|
+
let level = 0;
|
|
82921
|
+
for (let index = 0;index < lines.length; index += 1) {
|
|
82922
|
+
const heading = /^(#{2,4})\s+(.*?)\s*$/.exec(lines[index] ?? "");
|
|
82923
|
+
if (heading === null)
|
|
82924
|
+
continue;
|
|
82925
|
+
if (start < 0) {
|
|
82926
|
+
if ((heading[2] ?? "").toLowerCase() === wanted) {
|
|
82927
|
+
start = index;
|
|
82928
|
+
level = (heading[1] ?? "").length;
|
|
82929
|
+
}
|
|
82930
|
+
continue;
|
|
82931
|
+
}
|
|
82932
|
+
if ((heading[1] ?? "").length <= level) {
|
|
82933
|
+
return bodyIsEmpty(lines.slice(start + 1, index).join(`
|
|
82934
|
+
`));
|
|
82935
|
+
}
|
|
82936
|
+
}
|
|
82937
|
+
return start < 0 || bodyIsEmpty(lines.slice(start + 1).join(`
|
|
82938
|
+
`));
|
|
82939
|
+
}
|
|
82940
|
+
function bodyIsEmpty(body) {
|
|
82941
|
+
return body.replace(/<!--[\s\S]*?-->/g, "").trim() === "";
|
|
82942
|
+
}
|
|
82943
|
+
function parseInput(raw) {
|
|
82944
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
82945
|
+
return null;
|
|
82946
|
+
const value = raw;
|
|
82947
|
+
if (typeof value.path !== "string" || value.path === "")
|
|
82948
|
+
return null;
|
|
82949
|
+
const kind = INPUT_KINDS.includes(value.kind) ? value.kind : "artifact";
|
|
82950
|
+
return { path: value.path, kind };
|
|
82951
|
+
}
|
|
82952
|
+
function stringList(raw) {
|
|
82953
|
+
if (!Array.isArray(raw))
|
|
82954
|
+
return [];
|
|
82955
|
+
return raw.filter((entry) => typeof entry === "string" && entry !== "");
|
|
82956
|
+
}
|
|
82957
|
+
var INPUT_KINDS, RECEIPT_OUTCOMES, RECEIPT_EXECUTORS;
|
|
82958
|
+
var init_receipt = __esm(() => {
|
|
82959
|
+
INPUT_KINDS = ["task", "feature", "artifact", "var"];
|
|
82960
|
+
RECEIPT_OUTCOMES = [
|
|
82961
|
+
"done",
|
|
82962
|
+
"failed",
|
|
82963
|
+
"not-started",
|
|
82964
|
+
"outcome-unknown",
|
|
82965
|
+
"contract-violation"
|
|
82966
|
+
];
|
|
82967
|
+
RECEIPT_EXECUTORS = ["host", "subprocess", "fleet"];
|
|
82968
|
+
});
|
|
82969
|
+
|
|
82970
|
+
// ../../packages/app/src/workflow/host-executor.ts
|
|
82971
|
+
function selectsHostExecutor(vars) {
|
|
82972
|
+
return vars?.executor === HOST_EXECUTOR;
|
|
82973
|
+
}
|
|
82974
|
+
function withHostExecutorPause(workflow) {
|
|
82975
|
+
const runsAgentRun = (actions) => actions?.some((action) => action.kind === "agent.run") === true;
|
|
82976
|
+
if (workflow.kind === "transition-flow") {
|
|
82977
|
+
let changed = false;
|
|
82978
|
+
const nodes = workflow.nodes.map((node) => {
|
|
82979
|
+
if (node.pause === true || !runsAgentRun(node.action !== undefined ? [node.action] : undefined)) {
|
|
82980
|
+
return node;
|
|
82981
|
+
}
|
|
82982
|
+
changed = true;
|
|
82983
|
+
return { ...node, pause: true };
|
|
82984
|
+
});
|
|
82985
|
+
return changed ? { ...workflow, nodes } : workflow;
|
|
82986
|
+
}
|
|
82987
|
+
if (workflow.kind === "dag") {
|
|
82988
|
+
let changed = false;
|
|
82989
|
+
const nodes = workflow.nodes.map((node) => {
|
|
82990
|
+
if (node.pause === true || !runsAgentRun(node.action !== undefined ? [node.action] : undefined)) {
|
|
82991
|
+
return node;
|
|
82992
|
+
}
|
|
82993
|
+
changed = true;
|
|
82994
|
+
return { ...node, pause: true };
|
|
82995
|
+
});
|
|
82996
|
+
return changed ? { ...workflow, nodes } : workflow;
|
|
82997
|
+
}
|
|
82998
|
+
return workflow;
|
|
82999
|
+
}
|
|
83000
|
+
async function hostExecutorPersisted(db, runId) {
|
|
83001
|
+
const snapshot = await new DbWorkflowPersistenceAdapter(db).loadLatestStateSnapshot(runId);
|
|
83002
|
+
const raw = snapshot?.data?.effectiveVars;
|
|
83003
|
+
if (raw === null || typeof raw !== "object")
|
|
83004
|
+
return false;
|
|
83005
|
+
return raw.executor === HOST_EXECUTOR;
|
|
83006
|
+
}
|
|
83007
|
+
function operatorPauseAt(workflow, stateOrNodeId, data) {
|
|
83008
|
+
if (data === undefined)
|
|
83009
|
+
return null;
|
|
83010
|
+
let action;
|
|
83011
|
+
if (workflow.kind === "transition-flow" || workflow.kind === undefined) {
|
|
83012
|
+
action = actionsAt(workflow, stateOrNodeId, undefined)[0];
|
|
83013
|
+
} else {
|
|
83014
|
+
const cursor = data.actionResume;
|
|
83015
|
+
const nextAction = cursor?.nextAction;
|
|
83016
|
+
if (!Number.isInteger(nextAction) || nextAction < 1)
|
|
83017
|
+
return null;
|
|
83018
|
+
action = actionsAt(workflow, stateOrNodeId, cursor?.phase)[nextAction - 1];
|
|
83019
|
+
}
|
|
83020
|
+
if (action === undefined || !OPERATOR_PAUSE_KINDS.has(action.kind))
|
|
83021
|
+
return null;
|
|
83022
|
+
const vars = data?.effectiveVars ?? {};
|
|
83023
|
+
const rawPrompt = action.options?.prompt;
|
|
83024
|
+
return {
|
|
83025
|
+
kind: action.kind,
|
|
83026
|
+
options: action.options,
|
|
83027
|
+
prompt: typeof rawPrompt === "string" ? resolveTemplateString(rawPrompt, { vars, env: {} }) : ""
|
|
83028
|
+
};
|
|
83029
|
+
}
|
|
83030
|
+
function actionsAt(workflow, stateOrNodeId, phase) {
|
|
83031
|
+
const def = workflow;
|
|
83032
|
+
const state = def.states?.find((candidate) => candidate.id === stateOrNodeId);
|
|
83033
|
+
if (state !== undefined)
|
|
83034
|
+
return (phase === "exit" ? state.onExit : state.onEnter) ?? [];
|
|
83035
|
+
const node = def.nodes?.find((candidate) => candidate.id === stateOrNodeId);
|
|
83036
|
+
return node?.action !== undefined ? [node.action] : [];
|
|
83037
|
+
}
|
|
83038
|
+
async function attachHostPause(fs, workdir, result, db, workflow) {
|
|
83039
|
+
if (result.status !== "paused")
|
|
83040
|
+
return;
|
|
83041
|
+
const snapshot = db !== undefined ? await new DbWorkflowPersistenceAdapter(db).loadLatestStateSnapshot(result.runId) : undefined;
|
|
83042
|
+
const vars = snapshot?.data.effectiveVars;
|
|
83043
|
+
const gate = workflow !== undefined && selectsHostExecutor(vars) ? operatorPauseAt(workflow, result.finalState, snapshot?.data) : null;
|
|
83044
|
+
if (gate !== null) {
|
|
83045
|
+
result.pause = { reason: "hitl-pause", kind: gate.kind, prompt: gate.prompt };
|
|
83046
|
+
return;
|
|
83047
|
+
}
|
|
83048
|
+
if (db !== undefined && result.mode === "state-machine" && snapshot?.data.actionResume === undefined)
|
|
83049
|
+
return;
|
|
83050
|
+
const workItem = await readWorkItem(fs, workdir, result.runId);
|
|
83051
|
+
if (workItem === null || workItem.state !== result.finalState)
|
|
83052
|
+
return;
|
|
83053
|
+
result.pause = { kind: "input", workItem };
|
|
83054
|
+
}
|
|
83055
|
+
var HOST_EXECUTOR = "host", OPERATOR_PAUSE_KINDS;
|
|
83056
|
+
var init_host_executor = __esm(() => {
|
|
83057
|
+
init_dist8();
|
|
83058
|
+
init_receipt();
|
|
83059
|
+
OPERATOR_PAUSE_KINDS = new Set(["hitl.confirm", "hitl.select", "hitl.input"]);
|
|
83060
|
+
});
|
|
83061
|
+
|
|
82745
83062
|
// ../../packages/app/src/workflow/decision-hitl-responder.ts
|
|
82746
|
-
async function resolveDecision(responder, evaluator, request, config, profile) {
|
|
83063
|
+
async function resolveDecision(responder, evaluator, request, config, profile, hostPause) {
|
|
83064
|
+
const ask = async (provenance) => hostPause === true ? { answer: { value: "" }, operatorPending: true, ...provenance !== undefined ? { provenance } : {} } : { answer: await responder.respond(request), ...provenance !== undefined ? { provenance } : {} };
|
|
82747
83065
|
if (evaluator === undefined) {
|
|
82748
|
-
return
|
|
83066
|
+
return ask();
|
|
82749
83067
|
}
|
|
82750
83068
|
if (profile !== "auto") {
|
|
82751
|
-
|
|
82752
|
-
return { answer: await responder.respond(request), provenance };
|
|
83069
|
+
return ask(baseProvenance(config.mode, "fallback", config.mode === "never" ? "policy-never" : "operator", 0));
|
|
82753
83070
|
}
|
|
82754
83071
|
const result = await evaluator.evaluate(request, config);
|
|
82755
83072
|
if (result.kind === "delegate") {
|
|
82756
|
-
return
|
|
83073
|
+
return ask(result.provenance);
|
|
82757
83074
|
}
|
|
82758
83075
|
if (result.kind === "accepted") {
|
|
82759
83076
|
const resolved = { answer: { value: result.value }, provenance: result.provenance };
|
|
@@ -82764,12 +83081,24 @@ async function resolveDecision(responder, evaluator, request, config, profile) {
|
|
|
82764
83081
|
return resolved;
|
|
82765
83082
|
}
|
|
82766
83083
|
const resolved = { answer: { value: "" }, provenance: result.provenance };
|
|
83084
|
+
if (hostPause === true)
|
|
83085
|
+
resolved.operatorPending = true;
|
|
82767
83086
|
if (config.mode === "evidence") {
|
|
82768
83087
|
resolved.statusVar = config.statusVar;
|
|
82769
83088
|
resolved.statusValue = "deferred";
|
|
82770
83089
|
}
|
|
82771
83090
|
return resolved;
|
|
82772
83091
|
}
|
|
83092
|
+
function hostHitlPause(context, resolved, gate) {
|
|
83093
|
+
if (!selectsHostExecutor(context.vars) || resolved.operatorPending !== true)
|
|
83094
|
+
return null;
|
|
83095
|
+
return {
|
|
83096
|
+
ok: true,
|
|
83097
|
+
pause: true,
|
|
83098
|
+
data: { surface: "host", reason: "hitl-pause", kind: gate.kind, prompt: gate.prompt },
|
|
83099
|
+
...resolved.statusVar !== undefined && resolved.statusValue !== undefined ? { setVars: { [resolved.statusVar]: resolved.statusValue } } : {}
|
|
83100
|
+
};
|
|
83101
|
+
}
|
|
82773
83102
|
function parseDecisionConfig(options, answerVarName, kind) {
|
|
82774
83103
|
const raw = options.decision;
|
|
82775
83104
|
if (raw === undefined)
|
|
@@ -83111,6 +83440,7 @@ var GATE_EVIDENCE_DECISION_ID = "gate-evidence", IDENTIFIER2, DECISION_KEYS;
|
|
|
83111
83440
|
var init_decision_hitl_responder = __esm(() => {
|
|
83112
83441
|
init_agent_execution();
|
|
83113
83442
|
init_decision_evidence();
|
|
83443
|
+
init_host_executor();
|
|
83114
83444
|
IDENTIFIER2 = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
83115
83445
|
DECISION_KEYS = ["mode", "statusVar", "evidenceNodes", "summaryArtifact"];
|
|
83116
83446
|
});
|
|
@@ -83392,7 +83722,7 @@ function nearestRank(values, percentile) {
|
|
|
83392
83722
|
return value === undefined ? null : value;
|
|
83393
83723
|
}
|
|
83394
83724
|
|
|
83395
|
-
// ../../node_modules/.bun/@gobing-ai+ts-decision-clef@0.5.
|
|
83725
|
+
// ../../node_modules/.bun/@gobing-ai+ts-decision-clef@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-decision-clef/dist/driver.js
|
|
83396
83726
|
function isRecord4(value) {
|
|
83397
83727
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
83398
83728
|
}
|
|
@@ -83715,13 +84045,13 @@ var init_driver5 = __esm(() => {
|
|
|
83715
84045
|
MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
|
|
83716
84046
|
});
|
|
83717
84047
|
|
|
83718
|
-
// ../../node_modules/.bun/@gobing-ai+ts-decision-clef@0.5.
|
|
84048
|
+
// ../../node_modules/.bun/@gobing-ai+ts-decision-clef@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-decision-clef/dist/index.js
|
|
83719
84049
|
var init_dist28 = __esm(() => {
|
|
83720
84050
|
init_driver5();
|
|
83721
84051
|
});
|
|
83722
84052
|
|
|
83723
84053
|
// ../../packages/app/src/decision/decision-catalog-resolver.ts
|
|
83724
|
-
import { join as
|
|
84054
|
+
import { join as join15, resolve as resolve4 } from "path";
|
|
83725
84055
|
function registeredDecisionPaths(config) {
|
|
83726
84056
|
const paths = config?.decisions?.paths ?? [];
|
|
83727
84057
|
const bundledRoot = bundledConfigRoot();
|
|
@@ -83729,7 +84059,7 @@ function registeredDecisionPaths(config) {
|
|
|
83729
84059
|
for (const path of paths) {
|
|
83730
84060
|
if (path.startsWith(BUNDLED_DECISIONS_PREFIX)) {
|
|
83731
84061
|
if (bundledRoot !== null)
|
|
83732
|
-
expanded.push(
|
|
84062
|
+
expanded.push(join15(bundledRoot, path.slice(BUNDLED_DECISIONS_PREFIX.length)));
|
|
83733
84063
|
} else {
|
|
83734
84064
|
expanded.push(path);
|
|
83735
84065
|
}
|
|
@@ -83738,7 +84068,7 @@ function registeredDecisionPaths(config) {
|
|
|
83738
84068
|
}
|
|
83739
84069
|
function decisionLayers(opts) {
|
|
83740
84070
|
const sharedRoot = opts.sharedRoot !== undefined ? opts.sharedRoot : bundledConfigRoot();
|
|
83741
|
-
const sharedPath = sharedRoot !== null ? resolve4(opts.cwd,
|
|
84071
|
+
const sharedPath = sharedRoot !== null ? resolve4(opts.cwd, join15(sharedRoot, "decisions")) : null;
|
|
83742
84072
|
const layers = [];
|
|
83743
84073
|
const seen = new Set;
|
|
83744
84074
|
const add = (id, path) => {
|
|
@@ -83747,7 +84077,7 @@ function decisionLayers(opts) {
|
|
|
83747
84077
|
seen.add(path);
|
|
83748
84078
|
layers.push({ id, path });
|
|
83749
84079
|
};
|
|
83750
|
-
add("project", resolve4(opts.cwd,
|
|
84080
|
+
add("project", resolve4(opts.cwd, join15(opts.cwd, ".spur", "decisions")));
|
|
83751
84081
|
for (const entry of opts.registered) {
|
|
83752
84082
|
if (sharedPath !== null && resolve4(opts.cwd, entry) === sharedPath)
|
|
83753
84083
|
continue;
|
|
@@ -83769,7 +84099,7 @@ async function resolveDecisionCatalogs(opts) {
|
|
|
83769
84099
|
}
|
|
83770
84100
|
for (const name of names.sort()) {
|
|
83771
84101
|
if (!winners.has(name))
|
|
83772
|
-
winners.set(name, { layer: layer.id, path:
|
|
84102
|
+
winners.set(name, { layer: layer.id, path: join15(layer.path, name) });
|
|
83773
84103
|
}
|
|
83774
84104
|
}
|
|
83775
84105
|
const files = [];
|
|
@@ -84685,7 +85015,7 @@ var init_escalation_packet = __esm(() => {
|
|
|
84685
85015
|
|
|
84686
85016
|
// ../../packages/app/src/observability/escalation-packet-sink.ts
|
|
84687
85017
|
import { randomUUID } from "crypto";
|
|
84688
|
-
import { join as
|
|
85018
|
+
import { join as join16 } from "path";
|
|
84689
85019
|
function parseDryRunProbeMetadata(metadataJson) {
|
|
84690
85020
|
if (metadataJson === "")
|
|
84691
85021
|
return false;
|
|
@@ -84732,7 +85062,7 @@ class EscalationPacketSink {
|
|
|
84732
85062
|
}
|
|
84733
85063
|
}
|
|
84734
85064
|
async readPacket(runId) {
|
|
84735
|
-
const path =
|
|
85065
|
+
const path = join16(this.options.cwd, ".spur", "run", `${runId}-escalation.json`);
|
|
84736
85066
|
if (!await this.options.fs.exists(path))
|
|
84737
85067
|
return;
|
|
84738
85068
|
return JSON.parse(await this.options.fs.readFile(path));
|
|
@@ -84800,7 +85130,7 @@ class EscalationPacketSink {
|
|
|
84800
85130
|
const identity = await this.resolveIdentity(wbs);
|
|
84801
85131
|
const now = (this.options.now ?? (() => new Date().toISOString()))();
|
|
84802
85132
|
const packet = buildEscalationPacket({ ...packetInput, identity, now });
|
|
84803
|
-
const path =
|
|
85133
|
+
const path = join16(this.options.cwd, ".spur", "run", `${input.runId}-escalation.json`);
|
|
84804
85134
|
if (!await this.options.fs.exists(path)) {
|
|
84805
85135
|
await this.options.fs.writeFile(path, `${JSON.stringify(packet, null, 2)}
|
|
84806
85136
|
`);
|
|
@@ -85154,7 +85484,7 @@ import {
|
|
|
85154
85484
|
writeFileSync as writeFileSync3,
|
|
85155
85485
|
writeSync as writeSync2
|
|
85156
85486
|
} from "fs";
|
|
85157
|
-
import { dirname as dirname8, join as
|
|
85487
|
+
import { dirname as dirname8, join as join17 } from "path";
|
|
85158
85488
|
|
|
85159
85489
|
class WorkflowRunLogSink {
|
|
85160
85490
|
filePath;
|
|
@@ -85177,8 +85507,8 @@ class WorkflowRunLogSink {
|
|
|
85177
85507
|
bus;
|
|
85178
85508
|
handlers;
|
|
85179
85509
|
constructor(options) {
|
|
85180
|
-
this.filePath =
|
|
85181
|
-
this.statePath =
|
|
85510
|
+
this.filePath = join17(options.dir, `${options.runId}.md`);
|
|
85511
|
+
this.statePath = join17(options.dir, `${options.runId}.state.json`);
|
|
85182
85512
|
this.maxBytes = options.maxBytes ?? DEFAULT_RUN_LOG_MAX_BYTES;
|
|
85183
85513
|
this.maxLines = options.maxLines;
|
|
85184
85514
|
this.planPreview = options.planPreview;
|
|
@@ -85525,7 +85855,7 @@ var init_executor_tier = __esm(() => {
|
|
|
85525
85855
|
import { existsSync as existsSync7, realpathSync as realpathSync2 } from "fs";
|
|
85526
85856
|
import { connect, createServer } from "net";
|
|
85527
85857
|
import { homedir as homedir6 } from "os";
|
|
85528
|
-
import { join as
|
|
85858
|
+
import { join as join18, resolve as resolve5 } from "path";
|
|
85529
85859
|
async function findListeningPid(port, executor = new NodeProcessExecutor2, platform = process.platform) {
|
|
85530
85860
|
if (testPidFinder) {
|
|
85531
85861
|
return testPidFinder(port);
|
|
@@ -85616,7 +85946,7 @@ function normalizeProjectPath(pathInput) {
|
|
|
85616
85946
|
if (trimmed === "~") {
|
|
85617
85947
|
expanded = homedir6();
|
|
85618
85948
|
} else if (trimmed.startsWith("~/")) {
|
|
85619
|
-
expanded =
|
|
85949
|
+
expanded = join18(homedir6(), trimmed.slice(2));
|
|
85620
85950
|
} else {
|
|
85621
85951
|
expanded = resolve5(trimmed);
|
|
85622
85952
|
}
|
|
@@ -85833,7 +86163,7 @@ import {
|
|
|
85833
86163
|
unlinkSync as unlinkSync3,
|
|
85834
86164
|
writeFileSync as writeFileSync4
|
|
85835
86165
|
} from "fs";
|
|
85836
|
-
import { dirname as dirname9, join as
|
|
86166
|
+
import { dirname as dirname9, join as join19 } from "path";
|
|
85837
86167
|
|
|
85838
86168
|
class ProjectRegistry {
|
|
85839
86169
|
filePath;
|
|
@@ -85880,7 +86210,7 @@ class ProjectRegistry {
|
|
|
85880
86210
|
throw new Error(`Failed to acquire lock for project registry: ${this.lockDir}`);
|
|
85881
86211
|
}
|
|
85882
86212
|
const marker = `${process.pid}-${crypto.randomUUID()}`;
|
|
85883
|
-
markerPath =
|
|
86213
|
+
markerPath = join19(this.lockDir, marker);
|
|
85884
86214
|
try {
|
|
85885
86215
|
writeFileSync4(markerPath, "", { flag: "wx" });
|
|
85886
86216
|
} catch (err) {
|
|
@@ -86166,7 +86496,7 @@ var init_project_registry = __esm(() => {
|
|
|
86166
86496
|
});
|
|
86167
86497
|
|
|
86168
86498
|
// ../../packages/app/src/services/fleet-service.ts
|
|
86169
|
-
import { basename as basename2, dirname as dirname10, join as
|
|
86499
|
+
import { basename as basename2, dirname as dirname10, join as join20 } from "path";
|
|
86170
86500
|
function resolveMemberExecutor(params) {
|
|
86171
86501
|
const { member, index, label, agentConfig, roles, roster } = params;
|
|
86172
86502
|
if (member.executor !== undefined) {
|
|
@@ -86450,7 +86780,7 @@ class FleetService {
|
|
|
86450
86780
|
}
|
|
86451
86781
|
async assertLaunchGroundTruth(projectPath) {
|
|
86452
86782
|
const expected = normalizeProjectPath(projectPath);
|
|
86453
|
-
const expectedStorageRoot =
|
|
86783
|
+
const expectedStorageRoot = join20(expected, ".spur");
|
|
86454
86784
|
const cwd = normalizeProjectPath(process.cwd());
|
|
86455
86785
|
const storageRoot = normalizeProjectPath(this.fs.resolve(".spur"));
|
|
86456
86786
|
const databasePath = this.ctx.openDb ? await new ProjectClaimDao(await this.ctx.openDb(expected)).databasePath() : "";
|
|
@@ -86470,14 +86800,14 @@ var init_fleet_service = __esm(() => {
|
|
|
86470
86800
|
});
|
|
86471
86801
|
|
|
86472
86802
|
// ../../packages/app/src/services/agent-coordination-service.ts
|
|
86473
|
-
import { join as
|
|
86803
|
+
import { join as join21 } from "path";
|
|
86474
86804
|
|
|
86475
86805
|
class AgentCoordinationService {
|
|
86476
86806
|
ctx;
|
|
86477
86807
|
configDir;
|
|
86478
86808
|
constructor(ctx) {
|
|
86479
86809
|
this.ctx = ctx;
|
|
86480
|
-
this.configDir =
|
|
86810
|
+
this.configDir = join21(ctx.cwd, ".spur", "agents");
|
|
86481
86811
|
}
|
|
86482
86812
|
async sendMessage(fromId, toId, body, replyTo, requestKey) {
|
|
86483
86813
|
validateAgentId(toId);
|
|
@@ -86999,7 +87329,7 @@ var init_review_independence = __esm(() => {
|
|
|
86999
87329
|
});
|
|
87000
87330
|
|
|
87001
87331
|
// ../../packages/app/src/workflow/actions/run-path.ts
|
|
87002
|
-
import { dirname as dirname11, join as
|
|
87332
|
+
import { dirname as dirname11, join as join22, normalize as normalize2, relative as relative2, resolve as resolve6, sep } from "path";
|
|
87003
87333
|
function within(child, ancestor) {
|
|
87004
87334
|
return child === ancestor || child.startsWith(`${ancestor}${sep}`);
|
|
87005
87335
|
}
|
|
@@ -87021,15 +87351,15 @@ async function resolveConfinedArtifactPath(fileSystem, workdir, pathRaw, root) {
|
|
|
87021
87351
|
throw new RunArtifactPathError(`project workdir could not be canonicalized: ${error.message}`);
|
|
87022
87352
|
}
|
|
87023
87353
|
let lexicalTarget = normalize2(resolve6(workdir, pathRaw));
|
|
87024
|
-
const lexicalRunRoot = normalize2(
|
|
87025
|
-
const canonicalAlias =
|
|
87354
|
+
const lexicalRunRoot = normalize2(join22(resolve6(workdir), root));
|
|
87355
|
+
const canonicalAlias = join22(canonicalWorkdir, root);
|
|
87026
87356
|
if (lexicalTarget.startsWith(`${canonicalAlias}${sep}`)) {
|
|
87027
|
-
lexicalTarget =
|
|
87357
|
+
lexicalTarget = join22(lexicalRunRoot, relative2(canonicalAlias, lexicalTarget));
|
|
87028
87358
|
}
|
|
87029
87359
|
if (!lexicalTarget.startsWith(`${lexicalRunRoot}${sep}`)) {
|
|
87030
87360
|
throw new RunArtifactPathError(`must resolve beneath ${root}/ (got ${pathRaw})`);
|
|
87031
87361
|
}
|
|
87032
|
-
const canonicalRunRootCandidate =
|
|
87362
|
+
const canonicalRunRootCandidate = join22(canonicalWorkdir, root);
|
|
87033
87363
|
let canonicalRunRoot = canonicalRunRootCandidate;
|
|
87034
87364
|
const rootStat = await fileSystem.stat(canonicalRunRootCandidate);
|
|
87035
87365
|
if (rootStat !== null) {
|
|
@@ -87077,7 +87407,7 @@ async function resolveConfinedArtifactPath(fileSystem, workdir, pathRaw, root) {
|
|
|
87077
87407
|
if (!within(anchor, canonicalWorkdir)) {
|
|
87078
87408
|
throw new RunArtifactPathError(`ancestor ${probe} escapes the project workdir through a symlink`);
|
|
87079
87409
|
}
|
|
87080
|
-
const reconstructed = normalize2(
|
|
87410
|
+
const reconstructed = normalize2(join22(anchor, relative2(probe, lexicalTarget)));
|
|
87081
87411
|
if (!reconstructed.startsWith(`${canonicalRunRoot}${sep}`)) {
|
|
87082
87412
|
throw new RunArtifactPathError(`path escapes ${root}/ through a symlink (got ${pathRaw})`);
|
|
87083
87413
|
}
|
|
@@ -87095,20 +87425,20 @@ var init_run_path = __esm(() => {
|
|
|
87095
87425
|
|
|
87096
87426
|
// ../../packages/app/src/services/durable-plane-ignore.ts
|
|
87097
87427
|
import { appendFileSync as appendFileSync3, existsSync as existsSync9, mkdirSync as mkdirSync5, readFileSync as readFileSync7, statSync as statSync8 } from "fs";
|
|
87098
|
-
import { dirname as dirname12, isAbsolute as
|
|
87428
|
+
import { dirname as dirname12, isAbsolute as isAbsolute4, join as join23, resolve as resolve7 } from "path";
|
|
87099
87429
|
function ensureDurablePlaneIgnored(workdir) {
|
|
87100
87430
|
try {
|
|
87101
|
-
const gitPath =
|
|
87431
|
+
const gitPath = join23(workdir, ".git");
|
|
87102
87432
|
if (!existsSync9(gitPath))
|
|
87103
87433
|
return;
|
|
87104
|
-
let excludePath =
|
|
87434
|
+
let excludePath = join23(gitPath, "info", "exclude");
|
|
87105
87435
|
try {
|
|
87106
87436
|
if (statSync8(gitPath).isFile()) {
|
|
87107
87437
|
const gitdir = readFileSync7(gitPath, "utf8").split(/\r?\n/).find((line) => line.startsWith("gitdir:"))?.slice("gitdir:".length).trim();
|
|
87108
87438
|
if (gitdir) {
|
|
87109
|
-
const resolved =
|
|
87439
|
+
const resolved = isAbsolute4(gitdir) ? gitdir : resolve7(workdir, gitdir);
|
|
87110
87440
|
const common = /[/\\]worktrees[/\\][^/\\]+$/.test(resolved) ? resolve7(resolved, "..", "..") : resolved;
|
|
87111
|
-
excludePath =
|
|
87441
|
+
excludePath = join23(common, "info", "exclude");
|
|
87112
87442
|
}
|
|
87113
87443
|
}
|
|
87114
87444
|
} catch {}
|
|
@@ -87135,7 +87465,7 @@ var init_durable_plane_ignore = () => {};
|
|
|
87135
87465
|
// ../../packages/app/src/workflow/proof-input-fingerprint.ts
|
|
87136
87466
|
import crypto3 from "crypto";
|
|
87137
87467
|
import { tmpdir } from "os";
|
|
87138
|
-
import { dirname as dirname13, join as
|
|
87468
|
+
import { dirname as dirname13, join as join24, resolve as resolve8, sep as sep2 } from "path";
|
|
87139
87469
|
function taskDocumentShapeError(content) {
|
|
87140
87470
|
const doc = MarkdownDocument.parse(content, "task");
|
|
87141
87471
|
const heading = CANONICAL_TASK_HEADING_RE.exec(doc.bodyWithoutFrontmatter);
|
|
@@ -87210,7 +87540,7 @@ async function readProofInputContents(fileSystem = createNodeFileSystem2(), work
|
|
|
87210
87540
|
};
|
|
87211
87541
|
}
|
|
87212
87542
|
async function createGitAlternateTree(cwd, excludeGlobs = DEFAULT_EXCLUDE_GLOBS, executor = new NodeProcessExecutor2, fs = createNodeFileSystem2()) {
|
|
87213
|
-
const indexFile =
|
|
87543
|
+
const indexFile = join24(tmpdir(), `spur-proof-fingerprint-${crypto3.randomUUID()}.index`);
|
|
87214
87544
|
try {
|
|
87215
87545
|
await fs.ensureDir(dirname13(indexFile));
|
|
87216
87546
|
const env = Object.fromEntries(Object.entries(getEnvVars()).filter((entry) => entry[1] !== undefined));
|
|
@@ -87345,7 +87675,7 @@ var init_proof_input_fingerprint = __esm(() => {
|
|
|
87345
87675
|
});
|
|
87346
87676
|
|
|
87347
87677
|
// ../../packages/app/src/workflow/feature-verification-receipt.ts
|
|
87348
|
-
import { basename as basename3, dirname as dirname14, join as
|
|
87678
|
+
import { basename as basename3, dirname as dirname14, join as join25 } from "path";
|
|
87349
87679
|
function assertReceiptId(kind, id) {
|
|
87350
87680
|
if (!RECEIPT_ID_PATTERN.test(id) || id.includes("..")) {
|
|
87351
87681
|
throw new Error(`invalid ${kind} for receipt path: ${JSON.stringify(id)}`);
|
|
@@ -87355,10 +87685,10 @@ function featureReceiptPaths(runDir, featureId, runId) {
|
|
|
87355
87685
|
assertReceiptId("featureId", featureId);
|
|
87356
87686
|
assertReceiptId("runId", runId);
|
|
87357
87687
|
return {
|
|
87358
|
-
runScoped:
|
|
87359
|
-
featureScoped:
|
|
87360
|
-
log:
|
|
87361
|
-
status:
|
|
87688
|
+
runScoped: join25(dirname14(runDir), "memory", "evidence", `${runId}-feature-verification.json`),
|
|
87689
|
+
featureScoped: join25(dirname14(runDir), "memory", "evidence", `${featureId}-feature-verification.json`),
|
|
87690
|
+
log: join25(runDir, `${runId}-feature-verification.log`),
|
|
87691
|
+
status: join25(runDir, `${runId}-feature-verification.status`)
|
|
87362
87692
|
};
|
|
87363
87693
|
}
|
|
87364
87694
|
async function atomicWriteReceipt(fs, path, receipt) {
|
|
@@ -87492,6 +87822,13 @@ async function validateFeatureVerificationReceipt(fs, options) {
|
|
|
87492
87822
|
detail: `verification pass is still RUNNING (started ${latest.startedAt}); no completion evidence exists`
|
|
87493
87823
|
};
|
|
87494
87824
|
}
|
|
87825
|
+
if (latest.verifier.name !== FEATURE_VERIFIER_DEFINITION) {
|
|
87826
|
+
return {
|
|
87827
|
+
ok: false,
|
|
87828
|
+
reason: "stale",
|
|
87829
|
+
detail: `receipt was recorded by verifier "${latest.verifier.name}", which ${FEATURE_VERIFIER_DEFINITION} replaced \u2014 re-run \`spur feature verify ${options.featureId}\` to record current evidence`
|
|
87830
|
+
};
|
|
87831
|
+
}
|
|
87495
87832
|
if (options.runPort?.readRunRow) {
|
|
87496
87833
|
const row = await options.runPort.readRunRow(latest.runId);
|
|
87497
87834
|
if (!row) {
|
|
@@ -87571,7 +87908,7 @@ async function captureFeatureReceiptDigest(repoRoot, featureContent, learningsCo
|
|
|
87571
87908
|
function isProofCaptureError(err) {
|
|
87572
87909
|
return err instanceof ProofCaptureError;
|
|
87573
87910
|
}
|
|
87574
|
-
var FEATURE_RECEIPT_SCHEMA_VERSION = 1, DEFAULT_FEATURE_VERIFICATION_CMD = "spur self exec check-feature", RECEIPT_ID_PATTERN;
|
|
87911
|
+
var FEATURE_RECEIPT_SCHEMA_VERSION = 1, DEFAULT_FEATURE_VERIFICATION_CMD = "spur self exec check-feature", FEATURE_VERIFIER_DEFINITION = "feature-lifecycle", RECEIPT_ID_PATTERN;
|
|
87575
87912
|
var init_feature_verification_receipt = __esm(() => {
|
|
87576
87913
|
init_durable_plane_ignore();
|
|
87577
87914
|
init_run_path();
|
|
@@ -87581,7 +87918,7 @@ var init_feature_verification_receipt = __esm(() => {
|
|
|
87581
87918
|
|
|
87582
87919
|
// ../../packages/app/src/workflow/run-record.ts
|
|
87583
87920
|
import { closeSync as closeSync3, constants as constants4, existsSync as existsSync10, fstatSync, openSync as openSync3, readFileSync as readFileSync8, realpathSync as realpathSync3, statSync as statSync9 } from "fs";
|
|
87584
|
-
import { join as
|
|
87921
|
+
import { join as join26, sep as sep3 } from "path";
|
|
87585
87922
|
function resolveWorkflowLogRetentionDays(config) {
|
|
87586
87923
|
return config?.workflows?.logRetentionDays ?? 30;
|
|
87587
87924
|
}
|
|
@@ -87598,8 +87935,8 @@ function readWorkflowRunRecord(runDir, runId) {
|
|
|
87598
87935
|
if (runId.includes("/") || runId.includes("\\") || runId.includes("..")) {
|
|
87599
87936
|
throw new InvalidWorkflowRunIdError(runId);
|
|
87600
87937
|
}
|
|
87601
|
-
const markdownPath =
|
|
87602
|
-
const statePath =
|
|
87938
|
+
const markdownPath = join26(runDir, `${runId}.md`);
|
|
87939
|
+
const statePath = join26(runDir, `${runId}.state.json`);
|
|
87603
87940
|
if (existsSync10(markdownPath)) {
|
|
87604
87941
|
let raw;
|
|
87605
87942
|
try {
|
|
@@ -87616,7 +87953,7 @@ function readWorkflowRunRecord(runDir, runId) {
|
|
|
87616
87953
|
} catch {}
|
|
87617
87954
|
return { kind: "incomplete", markdownPath, statePath, reason: "state-invalid" };
|
|
87618
87955
|
}
|
|
87619
|
-
const legacyLogPath =
|
|
87956
|
+
const legacyLogPath = join26(runDir, `${runId}.log`);
|
|
87620
87957
|
if (existsSync10(legacyLogPath))
|
|
87621
87958
|
return { kind: "legacy-log", logPath: legacyLogPath };
|
|
87622
87959
|
return { kind: "missing" };
|
|
@@ -87866,14 +88203,14 @@ import {
|
|
|
87866
88203
|
writeFileSync as writeFileSync5
|
|
87867
88204
|
} from "fs";
|
|
87868
88205
|
import { tmpdir as tmpdir2 } from "os";
|
|
87869
|
-
import { basename as basename4, dirname as dirname15, join as
|
|
88206
|
+
import { basename as basename4, dirname as dirname15, join as join27, relative as relative3, resolve as resolve9, sep as sep4 } from "path";
|
|
87870
88207
|
function runStoragePaths(cwd) {
|
|
87871
88208
|
const projectRoot = resolveRunStorageRoot(cwd);
|
|
87872
88209
|
return {
|
|
87873
88210
|
projectRoot,
|
|
87874
|
-
scratchDir:
|
|
87875
|
-
evidenceDir:
|
|
87876
|
-
recordsDir:
|
|
88211
|
+
scratchDir: join27(projectRoot, ".spur", "run"),
|
|
88212
|
+
evidenceDir: join27(projectRoot, ".spur", "memory", "evidence"),
|
|
88213
|
+
recordsDir: join27(projectRoot, ".spur", "memory", "runs")
|
|
87877
88214
|
};
|
|
87878
88215
|
}
|
|
87879
88216
|
function resolveRunStorageRoot(cwd) {
|
|
@@ -87881,7 +88218,7 @@ function resolveRunStorageRoot(cwd) {
|
|
|
87881
88218
|
const sharedTmp = new Set([resolve9(tmpdir2()), realpathSync4(tmpdir2()), "/tmp", "/private/tmp"]);
|
|
87882
88219
|
let current = start;
|
|
87883
88220
|
for (;; ) {
|
|
87884
|
-
if (!sharedTmp.has(current) && (existsSync11(
|
|
88221
|
+
if (!sharedTmp.has(current) && (existsSync11(join27(current, ".spur")) || existsSync11(join27(current, "package.json")))) {
|
|
87885
88222
|
return current;
|
|
87886
88223
|
}
|
|
87887
88224
|
const parent = resolve9(current, "..");
|
|
@@ -87945,7 +88282,7 @@ function runRecordUnit(recordId, files, missing) {
|
|
|
87945
88282
|
};
|
|
87946
88283
|
}
|
|
87947
88284
|
function classify(name, scratchDir, files) {
|
|
87948
|
-
const source =
|
|
88285
|
+
const source = join27(scratchDir, name);
|
|
87949
88286
|
if (name.includes(sep4)) {
|
|
87950
88287
|
const identity = name.slice(0, name.indexOf(sep4));
|
|
87951
88288
|
return {
|
|
@@ -88006,17 +88343,17 @@ function classify(name, scratchDir, files) {
|
|
|
88006
88343
|
if (files.has(`${recordId}.md`))
|
|
88007
88344
|
return {};
|
|
88008
88345
|
return {
|
|
88009
|
-
unit: runRecordUnit(recordId, [source],
|
|
88346
|
+
unit: runRecordUnit(recordId, [source], join27(scratchDir, `${recordId}.md`))
|
|
88010
88347
|
};
|
|
88011
88348
|
}
|
|
88012
88349
|
if (name.endsWith(".md")) {
|
|
88013
88350
|
const recordId = name.slice(0, -".md".length);
|
|
88014
88351
|
if (files.has(`${recordId}.state.json`)) {
|
|
88015
88352
|
return {
|
|
88016
|
-
unit: runRecordUnit(recordId, [source,
|
|
88353
|
+
unit: runRecordUnit(recordId, [source, join27(scratchDir, `${recordId}.state.json`)])
|
|
88017
88354
|
};
|
|
88018
88355
|
}
|
|
88019
|
-
return { unit: runRecordUnit(recordId, [source],
|
|
88356
|
+
return { unit: runRecordUnit(recordId, [source], join27(scratchDir, `${recordId}.state.json`)) };
|
|
88020
88357
|
}
|
|
88021
88358
|
if (name.endsWith(".log")) {
|
|
88022
88359
|
const recordId = name.slice(0, -".log".length);
|
|
@@ -88046,9 +88383,9 @@ async function ownerPreserved(readRunStatus, runId) {
|
|
|
88046
88383
|
return status === null || status === undefined || LIVE_RUN_STATUSES.has(status) || !["done", "failed", "cancelled"].includes(status);
|
|
88047
88384
|
}
|
|
88048
88385
|
function writeManifest(dirs, entries, now, failures) {
|
|
88049
|
-
const manifestPath =
|
|
88386
|
+
const manifestPath = join27(dirs.projectRoot, ".spur", "memory", "run-storage-migration.json");
|
|
88050
88387
|
try {
|
|
88051
|
-
mkdirSync6(
|
|
88388
|
+
mkdirSync6(join27(dirs.projectRoot, ".spur", "memory"), { recursive: true });
|
|
88052
88389
|
const body = `${JSON.stringify({
|
|
88053
88390
|
version: 1,
|
|
88054
88391
|
updatedAt: now(),
|
|
@@ -88113,25 +88450,25 @@ async function migrateRunStorage(input) {
|
|
|
88113
88450
|
const fs = createNodeFileSystem2(dirs.projectRoot);
|
|
88114
88451
|
let names;
|
|
88115
88452
|
try {
|
|
88116
|
-
await resolveRunArtifactPath(fs, dirs.projectRoot,
|
|
88453
|
+
await resolveRunArtifactPath(fs, dirs.projectRoot, join27(dirs.scratchDir, "migration-probe"));
|
|
88117
88454
|
const dirents = readdirSync5(dirs.scratchDir, { withFileTypes: true });
|
|
88118
88455
|
names = dirents.filter((item) => item.isFile()).map((item) => item.name);
|
|
88119
88456
|
for (const item of dirents) {
|
|
88120
88457
|
if (!item.isDirectory())
|
|
88121
88458
|
continue;
|
|
88122
|
-
const subtree =
|
|
88123
|
-
if (!existsSync11(
|
|
88459
|
+
const subtree = join27(dirs.scratchDir, item.name);
|
|
88460
|
+
if (!existsSync11(join27(subtree, "agent-sessions")) && !existsSync11(join27(subtree, "artifacts")))
|
|
88124
88461
|
continue;
|
|
88125
88462
|
const walk = (dir) => {
|
|
88126
88463
|
for (const entry of readdirSync5(dir, { withFileTypes: true })) {
|
|
88127
88464
|
if (entry.isDirectory())
|
|
88128
|
-
walk(
|
|
88465
|
+
walk(join27(dir, entry.name));
|
|
88129
88466
|
else if (entry.isFile())
|
|
88130
|
-
names.push(relative3(dirs.scratchDir,
|
|
88467
|
+
names.push(relative3(dirs.scratchDir, join27(dir, entry.name)));
|
|
88131
88468
|
}
|
|
88132
88469
|
};
|
|
88133
88470
|
for (const family of ["agent-sessions", "artifacts"]) {
|
|
88134
|
-
const owned =
|
|
88471
|
+
const owned = join27(subtree, family);
|
|
88135
88472
|
if (!existsSync11(owned))
|
|
88136
88473
|
continue;
|
|
88137
88474
|
if (lstatSync(owned).isSymbolicLink()) {
|
|
@@ -88161,7 +88498,7 @@ async function migrateRunStorage(input) {
|
|
|
88161
88498
|
for (const name of names) {
|
|
88162
88499
|
if (logsOnly && (name.includes(sep4) || !name.endsWith(".log")))
|
|
88163
88500
|
continue;
|
|
88164
|
-
const sourcePath =
|
|
88501
|
+
const sourcePath = join27(dirs.scratchDir, name);
|
|
88165
88502
|
try {
|
|
88166
88503
|
await resolveRunArtifactPath(fs, dirs.projectRoot, sourcePath);
|
|
88167
88504
|
} catch (error) {
|
|
@@ -88210,8 +88547,8 @@ async function migrateRunStorage(input) {
|
|
|
88210
88547
|
identity: unit.identity
|
|
88211
88548
|
};
|
|
88212
88549
|
const targetDir = unit.family === "run-record" ? dirs.recordsDir : dirs.evidenceDir;
|
|
88213
|
-
const unitRoot =
|
|
88214
|
-
const targets = unit.files.map((file) => unit.registeredArtifact ?
|
|
88550
|
+
const unitRoot = join27(dirs.scratchDir, unit.identity);
|
|
88551
|
+
const targets = unit.files.map((file) => unit.registeredArtifact ? join27(dirs.recordsDir, unit.identity, "artifacts", basename4(file)) : file.startsWith(`${unitRoot}${sep4}`) ? join27(targetDir, unit.identity, relative3(unitRoot, file)) : join27(targetDir, basename4(file)));
|
|
88215
88552
|
const targetFor = (index) => targets[index];
|
|
88216
88553
|
try {
|
|
88217
88554
|
for (const [index, file] of unit.files.entries()) {
|
|
@@ -88281,13 +88618,13 @@ async function migrateRunStorage(input) {
|
|
|
88281
88618
|
continue;
|
|
88282
88619
|
}
|
|
88283
88620
|
if (unit.missingRequiredItem !== undefined) {
|
|
88284
|
-
const mdDurable =
|
|
88285
|
-
const stateDurable =
|
|
88621
|
+
const mdDurable = join27(dirs.recordsDir, `${unit.identity}.md`);
|
|
88622
|
+
const stateDurable = join27(dirs.recordsDir, `${unit.identity}.state.json`);
|
|
88286
88623
|
if (existsSync11(mdDurable) && existsSync11(stateDurable)) {
|
|
88287
88624
|
result.entries.push({
|
|
88288
88625
|
...baseEntry,
|
|
88289
88626
|
source,
|
|
88290
|
-
target:
|
|
88627
|
+
target: join27(dirs.recordsDir, basename4(source)),
|
|
88291
88628
|
contentDigest: fileDigest(source),
|
|
88292
88629
|
outcome: "already-present"
|
|
88293
88630
|
});
|
|
@@ -88510,7 +88847,7 @@ async function migrateRunStorage(input) {
|
|
|
88510
88847
|
result.failures.push({ source: dirs.scratchDir, reason, remedy: failureRemedy(reason) });
|
|
88511
88848
|
}
|
|
88512
88849
|
try {
|
|
88513
|
-
await resolveDurableArtifactPath(fs, dirs.projectRoot,
|
|
88850
|
+
await resolveDurableArtifactPath(fs, dirs.projectRoot, join27(dirs.projectRoot, ".spur", "memory", "run-storage-migration.json"), "memory");
|
|
88514
88851
|
} catch (error) {
|
|
88515
88852
|
const reason = `manifest-confinement: ${String(error)}`;
|
|
88516
88853
|
result.failures.push({ source: dirs.projectRoot, reason, remedy: failureRemedy(reason) });
|
|
@@ -88525,11 +88862,11 @@ async function migrateRunStorage(input) {
|
|
|
88525
88862
|
}
|
|
88526
88863
|
function runSessionsDir(cwd, runId) {
|
|
88527
88864
|
assertRunId(runId);
|
|
88528
|
-
return
|
|
88865
|
+
return join27(runStoragePaths(cwd).recordsDir, runId, "agent-sessions");
|
|
88529
88866
|
}
|
|
88530
88867
|
function runArtifactsDir(cwd, runId) {
|
|
88531
88868
|
assertRunId(runId);
|
|
88532
|
-
return
|
|
88869
|
+
return join27(runStoragePaths(cwd).recordsDir, runId, "artifacts");
|
|
88533
88870
|
}
|
|
88534
88871
|
function assertRunId(runId) {
|
|
88535
88872
|
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(runId) || runId.includes("..")) {
|
|
@@ -88540,7 +88877,7 @@ function resolveRunRecordDir(cwd, runId) {
|
|
|
88540
88877
|
const dirs = runStoragePaths(cwd);
|
|
88541
88878
|
if (runId === "" || runId !== basename4(runId) || runId.startsWith("."))
|
|
88542
88879
|
return dirs.scratchDir;
|
|
88543
|
-
const durable = [`${runId}.md`, `${runId}.state.json`, `${runId}.log`].some((name) => existsSync11(
|
|
88880
|
+
const durable = [`${runId}.md`, `${runId}.state.json`, `${runId}.log`].some((name) => existsSync11(join27(dirs.recordsDir, name)));
|
|
88544
88881
|
return durable ? dirs.recordsDir : dirs.scratchDir;
|
|
88545
88882
|
}
|
|
88546
88883
|
var LIVE_RUN_STATUSES;
|
|
@@ -88789,268 +89126,6 @@ var init_fleet_dispatch = __esm(() => {
|
|
|
88789
89126
|
FRESH_SESSION_ROLES = ["reviewer"];
|
|
88790
89127
|
});
|
|
88791
89128
|
|
|
88792
|
-
// ../../packages/app/src/workflow/receipt.ts
|
|
88793
|
-
import { isAbsolute as isAbsolute4, join as join27 } from "path";
|
|
88794
|
-
function declaredStrings(raw) {
|
|
88795
|
-
return stringList(raw);
|
|
88796
|
-
}
|
|
88797
|
-
function declaredInputs(raw) {
|
|
88798
|
-
if (!Array.isArray(raw))
|
|
88799
|
-
return [];
|
|
88800
|
-
return raw.map(parseInput).filter((input) => input !== null);
|
|
88801
|
-
}
|
|
88802
|
-
function segment(value, label) {
|
|
88803
|
-
if (value === "" || value.includes("/") || value.includes("\\") || value.includes("..")) {
|
|
88804
|
-
throw new Error(`refusing a ${label} path for '${value}': expected a single path segment`);
|
|
88805
|
-
}
|
|
88806
|
-
return value;
|
|
88807
|
-
}
|
|
88808
|
-
function workItemPath(workdir, runId) {
|
|
88809
|
-
return join27(workdir, ".spur", "run", segment(runId, "work item"), "work-item.json");
|
|
88810
|
-
}
|
|
88811
|
-
function receiptPath(workdir, runId, state) {
|
|
88812
|
-
return join27(workdir, ".spur", "run", segment(runId, "receipt"), "receipts", `${segment(state, "receipt")}.json`);
|
|
88813
|
-
}
|
|
88814
|
-
async function writeWorkItem(fs, workdir, workItem) {
|
|
88815
|
-
const target = workItemPath(workdir, workItem.runId);
|
|
88816
|
-
await fs.writeFile(target, `${JSON.stringify(workItem, null, 2)}
|
|
88817
|
-
`);
|
|
88818
|
-
return target;
|
|
88819
|
-
}
|
|
88820
|
-
async function readWorkItem(fs, workdir, runId) {
|
|
88821
|
-
const target = workItemPath(workdir, runId);
|
|
88822
|
-
if (!await fs.exists(target))
|
|
88823
|
-
return null;
|
|
88824
|
-
try {
|
|
88825
|
-
return parseWorkItem(JSON.parse(await fs.readFile(target)));
|
|
88826
|
-
} catch {
|
|
88827
|
-
return null;
|
|
88828
|
-
}
|
|
88829
|
-
}
|
|
88830
|
-
async function writeReceipt(fs, workdir, receipt) {
|
|
88831
|
-
const target = receiptPath(workdir, receipt.runId, receipt.state);
|
|
88832
|
-
await fs.writeFile(target, `${JSON.stringify(receipt, null, 2)}
|
|
88833
|
-
`);
|
|
88834
|
-
return target;
|
|
88835
|
-
}
|
|
88836
|
-
async function readReceipt(fs, workdir, path) {
|
|
88837
|
-
const target = isAbsolute4(path) ? path : join27(workdir, path);
|
|
88838
|
-
if (!await fs.exists(target))
|
|
88839
|
-
return null;
|
|
88840
|
-
try {
|
|
88841
|
-
return parseReceipt(JSON.parse(await fs.readFile(target)));
|
|
88842
|
-
} catch {
|
|
88843
|
-
return null;
|
|
88844
|
-
}
|
|
88845
|
-
}
|
|
88846
|
-
function parseWorkItem(raw) {
|
|
88847
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
88848
|
-
return null;
|
|
88849
|
-
const value = raw;
|
|
88850
|
-
if (typeof value.runId !== "string" || value.runId === "")
|
|
88851
|
-
return null;
|
|
88852
|
-
if (typeof value.state !== "string" || value.state === "")
|
|
88853
|
-
return null;
|
|
88854
|
-
if (typeof value.prompt !== "string")
|
|
88855
|
-
return null;
|
|
88856
|
-
return {
|
|
88857
|
-
runId: value.runId,
|
|
88858
|
-
state: value.state,
|
|
88859
|
-
skill: typeof value.skill === "string" ? value.skill : null,
|
|
88860
|
-
prompt: value.prompt,
|
|
88861
|
-
inputs: declaredInputs(value.inputs),
|
|
88862
|
-
expectFiles: stringList(value.expectFiles),
|
|
88863
|
-
ownedSections: stringList(value.ownedSections)
|
|
88864
|
-
};
|
|
88865
|
-
}
|
|
88866
|
-
function parseReceipt(raw) {
|
|
88867
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
88868
|
-
return null;
|
|
88869
|
-
const value = raw;
|
|
88870
|
-
if (typeof value.runId !== "string" || value.runId === "")
|
|
88871
|
-
return null;
|
|
88872
|
-
if (typeof value.state !== "string" || value.state === "")
|
|
88873
|
-
return null;
|
|
88874
|
-
if (!RECEIPT_EXECUTORS.includes(value.executor))
|
|
88875
|
-
return null;
|
|
88876
|
-
if (!RECEIPT_OUTCOMES.includes(value.outcome))
|
|
88877
|
-
return null;
|
|
88878
|
-
return {
|
|
88879
|
-
runId: value.runId,
|
|
88880
|
-
state: value.state,
|
|
88881
|
-
executor: value.executor,
|
|
88882
|
-
outcome: value.outcome,
|
|
88883
|
-
startedAt: typeof value.startedAt === "string" ? value.startedAt : "",
|
|
88884
|
-
finishedAt: typeof value.finishedAt === "string" ? value.finishedAt : null,
|
|
88885
|
-
files: stringList(value.files),
|
|
88886
|
-
reason: typeof value.reason === "string" ? value.reason : null,
|
|
88887
|
-
...typeof value.contract === "string" ? { contract: value.contract } : {}
|
|
88888
|
-
};
|
|
88889
|
-
}
|
|
88890
|
-
async function validateWorkItemReceipt(fs, workdir, workItem, receipt) {
|
|
88891
|
-
if (receipt === null)
|
|
88892
|
-
return { ok: false, error: "work-item receipt could not be read (missing or malformed)" };
|
|
88893
|
-
if (receipt.runId !== workItem.runId) {
|
|
88894
|
-
return { ok: false, error: `receipt runId '${receipt.runId}' does not match run '${workItem.runId}'` };
|
|
88895
|
-
}
|
|
88896
|
-
if (receipt.state !== workItem.state) {
|
|
88897
|
-
return {
|
|
88898
|
-
ok: false,
|
|
88899
|
-
error: `receipt state '${receipt.state}' does not match paused state '${workItem.state}'`
|
|
88900
|
-
};
|
|
88901
|
-
}
|
|
88902
|
-
if (receipt.outcome !== "done") {
|
|
88903
|
-
return {
|
|
88904
|
-
ok: false,
|
|
88905
|
-
error: `receipt outcome '${receipt.outcome}' does not complete this work item (only 'done' resumes the run; ADR-126 A4)`
|
|
88906
|
-
};
|
|
88907
|
-
}
|
|
88908
|
-
const missing = [];
|
|
88909
|
-
for (const path of workItem.expectFiles) {
|
|
88910
|
-
if (!await fs.exists(isAbsolute4(path) ? path : join27(workdir, path)))
|
|
88911
|
-
missing.push(path);
|
|
88912
|
-
}
|
|
88913
|
-
if (missing.length > 0) {
|
|
88914
|
-
return { ok: false, error: `expected file(s) missing after the host run: ${missing.join(", ")}` };
|
|
88915
|
-
}
|
|
88916
|
-
if (workItem.ownedSections.length === 0)
|
|
88917
|
-
return { ok: true };
|
|
88918
|
-
const taskInputs = workItem.inputs.filter((input) => input.kind === "task");
|
|
88919
|
-
if (taskInputs.length === 0) {
|
|
88920
|
-
return {
|
|
88921
|
-
ok: false,
|
|
88922
|
-
error: `no 'task' input is declared for owned section(s): ${workItem.ownedSections.join(", ")}`
|
|
88923
|
-
};
|
|
88924
|
-
}
|
|
88925
|
-
const empty = [];
|
|
88926
|
-
for (const input of taskInputs) {
|
|
88927
|
-
const target = isAbsolute4(input.path) ? input.path : join27(workdir, input.path);
|
|
88928
|
-
let body;
|
|
88929
|
-
try {
|
|
88930
|
-
body = await fs.readFile(target);
|
|
88931
|
-
} catch {
|
|
88932
|
-
return { ok: false, error: `owned section(s) cannot be verified: task input ${input.path} is unreadable` };
|
|
88933
|
-
}
|
|
88934
|
-
for (const section of workItem.ownedSections) {
|
|
88935
|
-
if (isEmptySection(body, section))
|
|
88936
|
-
empty.push(`${input.path}: ${section}`);
|
|
88937
|
-
}
|
|
88938
|
-
}
|
|
88939
|
-
if (empty.length > 0) {
|
|
88940
|
-
return { ok: false, error: `owned section(s) empty in ${empty.join(", ")}` };
|
|
88941
|
-
}
|
|
88942
|
-
return { ok: true };
|
|
88943
|
-
}
|
|
88944
|
-
function isEmptySection(markdown, section) {
|
|
88945
|
-
const lines = markdown.split(/\r?\n/);
|
|
88946
|
-
const wanted = section.trim().toLowerCase();
|
|
88947
|
-
let start = -1;
|
|
88948
|
-
let level = 0;
|
|
88949
|
-
for (let index = 0;index < lines.length; index += 1) {
|
|
88950
|
-
const heading = /^(#{2,4})\s+(.*?)\s*$/.exec(lines[index] ?? "");
|
|
88951
|
-
if (heading === null)
|
|
88952
|
-
continue;
|
|
88953
|
-
if (start < 0) {
|
|
88954
|
-
if ((heading[2] ?? "").toLowerCase() === wanted) {
|
|
88955
|
-
start = index;
|
|
88956
|
-
level = (heading[1] ?? "").length;
|
|
88957
|
-
}
|
|
88958
|
-
continue;
|
|
88959
|
-
}
|
|
88960
|
-
if ((heading[1] ?? "").length <= level) {
|
|
88961
|
-
return bodyIsEmpty(lines.slice(start + 1, index).join(`
|
|
88962
|
-
`));
|
|
88963
|
-
}
|
|
88964
|
-
}
|
|
88965
|
-
return start < 0 || bodyIsEmpty(lines.slice(start + 1).join(`
|
|
88966
|
-
`));
|
|
88967
|
-
}
|
|
88968
|
-
function bodyIsEmpty(body) {
|
|
88969
|
-
return body.replace(/<!--[\s\S]*?-->/g, "").trim() === "";
|
|
88970
|
-
}
|
|
88971
|
-
function parseInput(raw) {
|
|
88972
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
88973
|
-
return null;
|
|
88974
|
-
const value = raw;
|
|
88975
|
-
if (typeof value.path !== "string" || value.path === "")
|
|
88976
|
-
return null;
|
|
88977
|
-
const kind = INPUT_KINDS.includes(value.kind) ? value.kind : "artifact";
|
|
88978
|
-
return { path: value.path, kind };
|
|
88979
|
-
}
|
|
88980
|
-
function stringList(raw) {
|
|
88981
|
-
if (!Array.isArray(raw))
|
|
88982
|
-
return [];
|
|
88983
|
-
return raw.filter((entry) => typeof entry === "string" && entry !== "");
|
|
88984
|
-
}
|
|
88985
|
-
var INPUT_KINDS, RECEIPT_OUTCOMES, RECEIPT_EXECUTORS;
|
|
88986
|
-
var init_receipt = __esm(() => {
|
|
88987
|
-
INPUT_KINDS = ["task", "feature", "artifact", "var"];
|
|
88988
|
-
RECEIPT_OUTCOMES = [
|
|
88989
|
-
"done",
|
|
88990
|
-
"failed",
|
|
88991
|
-
"not-started",
|
|
88992
|
-
"outcome-unknown",
|
|
88993
|
-
"contract-violation"
|
|
88994
|
-
];
|
|
88995
|
-
RECEIPT_EXECUTORS = ["host", "subprocess", "fleet"];
|
|
88996
|
-
});
|
|
88997
|
-
|
|
88998
|
-
// ../../packages/app/src/workflow/host-executor.ts
|
|
88999
|
-
function selectsHostExecutor(vars) {
|
|
89000
|
-
return vars?.executor === HOST_EXECUTOR;
|
|
89001
|
-
}
|
|
89002
|
-
function withHostExecutorPause(workflow) {
|
|
89003
|
-
const runsAgentRun = (actions) => actions?.some((action) => action.kind === "agent.run") === true;
|
|
89004
|
-
if (workflow.kind === "transition-flow") {
|
|
89005
|
-
let changed = false;
|
|
89006
|
-
const nodes = workflow.nodes.map((node) => {
|
|
89007
|
-
if (node.pause === true || !runsAgentRun(node.action !== undefined ? [node.action] : undefined)) {
|
|
89008
|
-
return node;
|
|
89009
|
-
}
|
|
89010
|
-
changed = true;
|
|
89011
|
-
return { ...node, pause: true };
|
|
89012
|
-
});
|
|
89013
|
-
return changed ? { ...workflow, nodes } : workflow;
|
|
89014
|
-
}
|
|
89015
|
-
if (workflow.kind === "dag") {
|
|
89016
|
-
let changed = false;
|
|
89017
|
-
const nodes = workflow.nodes.map((node) => {
|
|
89018
|
-
if (node.pause === true || !runsAgentRun(node.action !== undefined ? [node.action] : undefined)) {
|
|
89019
|
-
return node;
|
|
89020
|
-
}
|
|
89021
|
-
changed = true;
|
|
89022
|
-
return { ...node, pause: true };
|
|
89023
|
-
});
|
|
89024
|
-
return changed ? { ...workflow, nodes } : workflow;
|
|
89025
|
-
}
|
|
89026
|
-
return workflow;
|
|
89027
|
-
}
|
|
89028
|
-
async function hostExecutorPersisted(db, runId) {
|
|
89029
|
-
const snapshot = await new DbWorkflowPersistenceAdapter(db).loadLatestStateSnapshot(runId);
|
|
89030
|
-
const raw = snapshot?.data?.effectiveVars;
|
|
89031
|
-
if (raw === null || typeof raw !== "object")
|
|
89032
|
-
return false;
|
|
89033
|
-
return raw.executor === HOST_EXECUTOR;
|
|
89034
|
-
}
|
|
89035
|
-
async function attachHostPause(fs, workdir, result, db) {
|
|
89036
|
-
if (result.status !== "paused")
|
|
89037
|
-
return;
|
|
89038
|
-
if (db !== undefined && result.mode === "state-machine") {
|
|
89039
|
-
const snapshot = await new DbWorkflowPersistenceAdapter(db).loadLatestStateSnapshot(result.runId);
|
|
89040
|
-
if (snapshot?.data.actionResume === undefined)
|
|
89041
|
-
return;
|
|
89042
|
-
}
|
|
89043
|
-
const workItem = await readWorkItem(fs, workdir, result.runId);
|
|
89044
|
-
if (workItem === null || workItem.state !== result.finalState)
|
|
89045
|
-
return;
|
|
89046
|
-
result.pause = { kind: "input", workItem };
|
|
89047
|
-
}
|
|
89048
|
-
var HOST_EXECUTOR = "host";
|
|
89049
|
-
var init_host_executor = __esm(() => {
|
|
89050
|
-
init_dist8();
|
|
89051
|
-
init_receipt();
|
|
89052
|
-
});
|
|
89053
|
-
|
|
89054
89129
|
// ../../packages/app/src/workflow/split-launch-command.ts
|
|
89055
89130
|
function splitLaunchCommand(value, label) {
|
|
89056
89131
|
if (SHELL_METACHARACTERS.test(value)) {
|
|
@@ -95915,11 +95990,14 @@ function prefixId(id) {
|
|
|
95915
95990
|
function acRowProves(rowId, items, scenarioTitles) {
|
|
95916
95991
|
const ordinal = /^AC-(\d+)$/.exec(rowId.trim());
|
|
95917
95992
|
const key = normalizeKey2(ordinal ? scenarioTitles[Number(ordinal[1]) - 1] ?? "" : rowId);
|
|
95993
|
+
const bare = key.replace(/^r\d+\s*\u2014\s*/, "");
|
|
95918
95994
|
for (const item of items) {
|
|
95919
95995
|
if (!item.requirementId?.startsWith("AC"))
|
|
95920
95996
|
continue;
|
|
95921
95997
|
const alias = normalizeKey2(item.text.replace(/\s*\(req:[^)]*\)\s*$/, ""));
|
|
95922
|
-
if (alias
|
|
95998
|
+
if (alias === "")
|
|
95999
|
+
continue;
|
|
96000
|
+
if (key !== "" && (alias === key || alias.endsWith(`\u2014 ${key}`) || bare !== "" && (alias === bare || alias.endsWith(`\u2014 ${bare}`))))
|
|
95923
96001
|
return item.requirementId;
|
|
95924
96002
|
}
|
|
95925
96003
|
if (ordinal || /^R\d+\s*[\u2014-]\s*\S/.test(rowId.trim()))
|
|
@@ -97320,22 +97398,21 @@ var init_feature_check = __esm(() => {
|
|
|
97320
97398
|
let verifier;
|
|
97321
97399
|
let configuredCmd;
|
|
97322
97400
|
try {
|
|
97323
|
-
const selected = await resolveWorkflowDefinition(this.projectRoot,
|
|
97401
|
+
const selected = await resolveWorkflowDefinition(this.projectRoot, FEATURE_VERIFIER_DEFINITION);
|
|
97324
97402
|
verifier = {
|
|
97325
|
-
name:
|
|
97403
|
+
name: FEATURE_VERIFIER_DEFINITION,
|
|
97326
97404
|
sourcePath: selected.path,
|
|
97327
97405
|
layer: selected.layer,
|
|
97328
97406
|
definitionDigest: selected.digest
|
|
97329
97407
|
};
|
|
97330
|
-
|
|
97331
|
-
configuredCmd = typeof vars?.verificationCmd === "string" && vars.verificationCmd.length > 0 ? vars.verificationCmd : DEFAULT_FEATURE_VERIFICATION_CMD;
|
|
97408
|
+
configuredCmd = DEFAULT_FEATURE_VERIFICATION_CMD;
|
|
97332
97409
|
} catch (err) {
|
|
97333
97410
|
findings.push({
|
|
97334
97411
|
layer: "L4",
|
|
97335
97412
|
code: FINDING_CODES.L4_FEATURE_RECEIPT_CONTRACT,
|
|
97336
97413
|
severity: "error",
|
|
97337
97414
|
section: "",
|
|
97338
|
-
message: `Feature "${featureId}" completion evidence could not be evaluated against the selected
|
|
97415
|
+
message: `Feature "${featureId}" completion evidence could not be evaluated against the selected ${FEATURE_VERIFIER_DEFINITION} definition (fail-closed): ${String(err)}`
|
|
97339
97416
|
});
|
|
97340
97417
|
return;
|
|
97341
97418
|
}
|
|
@@ -98044,7 +98121,7 @@ var init_task_check = __esm(() => {
|
|
|
98044
98121
|
TESTING_VERDICT_STUB_RE = /^\|\s*[\u2014\u2013-]+\s*\|\s*[\u2014\u2013-]+\s*\|\s*No requirements recorded; verify verdict\s+\S+\s*\|/m;
|
|
98045
98122
|
EXTERNAL_EVIDENCE_RE = /`([^`\n]+?)`\s+(?:line|lines?)\s+(\d+)(?:-(\d+))?/g;
|
|
98046
98123
|
GATE_LANGUAGE_SECTIONS = ["Background", "Requirements", "Design", "Acceptance Criteria", "Plan"];
|
|
98047
|
-
GATE_TOKENS = /(?<![\w
|
|
98124
|
+
GATE_TOKENS = /(?<![\w.-])(HITL|human[- ]in[- ]the-loop|merge event|content-gate|GATED|capstone)(?![\w-]|\.\w)/i;
|
|
98048
98125
|
AMBIGUOUS_GATE_TOKENS = /(?<![\w-])(approval|approved|merged)(?![\w-])/i;
|
|
98049
98126
|
GATE_CUES = /\b(until|after|once|before|pending|blocked|wait(?:ing)? for|requires?)\b/i;
|
|
98050
98127
|
TaskCheckService = class TaskCheckService extends PlanningCheckService {
|
|
@@ -100353,6 +100430,7 @@ class FeatureService {
|
|
|
100353
100430
|
return { proposal, applied: false, appliedHops: [] };
|
|
100354
100431
|
}
|
|
100355
100432
|
const appliedHops = [];
|
|
100433
|
+
let appliedProposal = proposal;
|
|
100356
100434
|
try {
|
|
100357
100435
|
for (const hop of hops) {
|
|
100358
100436
|
if (hop === "active") {
|
|
@@ -100372,12 +100450,28 @@ class FeatureService {
|
|
|
100372
100450
|
await this.transition(featureId, hop);
|
|
100373
100451
|
appliedHops.push(hop);
|
|
100374
100452
|
}
|
|
100453
|
+
if (proposal.receiptPending === true && appliedHops.at(-1) === "verifying") {
|
|
100454
|
+
const next = await this.deriveFeatureStatus(featureId, options);
|
|
100455
|
+
if (next.to === "done" && next.hops?.length === 1 && next.hops[0] === "done") {
|
|
100456
|
+
await this.transition(featureId, "done");
|
|
100457
|
+
appliedHops.push("done");
|
|
100458
|
+
appliedProposal = { ...next, from: proposal.from };
|
|
100459
|
+
} else {
|
|
100460
|
+
const findings = next.gateFindings ?? proposal.gateFindings ?? [];
|
|
100461
|
+
const codes = findings.map((f) => f.code).join(", ");
|
|
100462
|
+
appliedProposal = {
|
|
100463
|
+
...proposal,
|
|
100464
|
+
reason: `${proposal.reason}${codes.length > 0 ? ` (${codes})` : ""}; ` + `rework with \`spur feature update ${featureId} active\``,
|
|
100465
|
+
...findings.length > 0 ? { gateFindings: findings } : {}
|
|
100466
|
+
};
|
|
100467
|
+
}
|
|
100468
|
+
}
|
|
100375
100469
|
} finally {
|
|
100376
100470
|
if (appliedHops.length > 0) {
|
|
100377
100471
|
await this.refresh({ featureId });
|
|
100378
100472
|
}
|
|
100379
100473
|
}
|
|
100380
|
-
return { proposal, applied: true, appliedHops };
|
|
100474
|
+
return { proposal: appliedProposal, applied: true, appliedHops };
|
|
100381
100475
|
}
|
|
100382
100476
|
async replaySuppressedBlocked(featureId) {
|
|
100383
100477
|
const statePath = blockedStateFile(featureId, defaultVerdictRunDir(this.ctx.tasksDir));
|
|
@@ -114310,12 +114404,14 @@ class DoctorProbeActionRunner {
|
|
|
114310
114404
|
fileSystem;
|
|
114311
114405
|
observabilityBus;
|
|
114312
114406
|
agentService;
|
|
114407
|
+
fleetDispatchDeps;
|
|
114313
114408
|
kind = KIND5;
|
|
114314
|
-
constructor(processExecutor = new NodeProcessExecutor2, fileSystem = createNodeFileSystem2(), observabilityBus, agentService) {
|
|
114409
|
+
constructor(processExecutor = new NodeProcessExecutor2, fileSystem = createNodeFileSystem2(), observabilityBus, agentService, fleetDispatchDeps) {
|
|
114315
114410
|
this.processExecutor = processExecutor;
|
|
114316
114411
|
this.fileSystem = fileSystem;
|
|
114317
114412
|
this.observabilityBus = observabilityBus;
|
|
114318
114413
|
this.agentService = agentService;
|
|
114414
|
+
this.fleetDispatchDeps = fleetDispatchDeps;
|
|
114319
114415
|
}
|
|
114320
114416
|
async execute(options, context) {
|
|
114321
114417
|
const resultFileRaw = options.resultFile;
|
|
@@ -114368,6 +114464,19 @@ class DoctorProbeActionRunner {
|
|
|
114368
114464
|
this.observabilityBus.emit("workflow.action.output", event);
|
|
114369
114465
|
};
|
|
114370
114466
|
await this.fileSystem.ensureDir(allowedDir);
|
|
114467
|
+
const executor = typeof context.vars?.executor === "string" ? context.vars.executor : "";
|
|
114468
|
+
if (executor === "host" || executor === "fleet") {
|
|
114469
|
+
const wired = executor === "host" || this.fleetDispatchDeps !== undefined;
|
|
114470
|
+
const reason = executor === "host" ? "precheck: executor=host \u2014 subprocess doctor skipped" : wired ? "precheck: executor=fleet \u2014 fleet dispatch wired" : "precheck: FAIL - executor fleet is selected but this host wired no fleet dispatch (ADR-126)";
|
|
114471
|
+
emit(reason);
|
|
114472
|
+
await this.fileSystem.writeFile(normalized, wired ? `PASS
|
|
114473
|
+
` : `FAIL: executor fleet is not wired (ADR-126)
|
|
114474
|
+
`);
|
|
114475
|
+
return {
|
|
114476
|
+
ok: true,
|
|
114477
|
+
data: { status: wired ? "PASS" : "FAIL", resultFile: normalized, output: [reason] }
|
|
114478
|
+
};
|
|
114479
|
+
}
|
|
114371
114480
|
if (rolesMode) {
|
|
114372
114481
|
return this.resolvePins(rolesOption, normalized, stringOption4(options, "resolvedAgentVar", ""), emit);
|
|
114373
114482
|
}
|
|
@@ -114628,7 +114737,10 @@ class HitlConfirmActionRunner {
|
|
|
114628
114737
|
message: prompt,
|
|
114629
114738
|
severity: "info"
|
|
114630
114739
|
});
|
|
114631
|
-
const resolved = await resolveDecision(this.responder, this.evaluator, { kind: "confirm", prompt, runId: context.runId, node: context.stateOrNodeId }, parsed.config, context.vars.profile);
|
|
114740
|
+
const resolved = await resolveDecision(this.responder, this.evaluator, { kind: "confirm", prompt, runId: context.runId, node: context.stateOrNodeId }, parsed.config, context.vars.profile, selectsHostExecutor(context.vars));
|
|
114741
|
+
const pause = hostHitlPause(context, resolved, { kind: "confirm", prompt });
|
|
114742
|
+
if (pause !== null)
|
|
114743
|
+
return pause;
|
|
114632
114744
|
const { answer } = resolved;
|
|
114633
114745
|
context.events?.emit("workflow.hitl.response", {
|
|
114634
114746
|
runId: context.runId,
|
|
@@ -114659,6 +114771,7 @@ function asString2(value) {
|
|
|
114659
114771
|
var KIND9 = "hitl.confirm";
|
|
114660
114772
|
var init_hitl_confirm = __esm(() => {
|
|
114661
114773
|
init_decision_hitl_responder();
|
|
114774
|
+
init_host_executor();
|
|
114662
114775
|
});
|
|
114663
114776
|
|
|
114664
114777
|
// ../../packages/app/src/workflow/actions/hitl-input.ts
|
|
@@ -114685,6 +114798,9 @@ class HitlInputActionRunner {
|
|
|
114685
114798
|
message: prompt,
|
|
114686
114799
|
severity: "info"
|
|
114687
114800
|
});
|
|
114801
|
+
const pause = hostHitlPause(context, { answer: { value: "" }, operatorPending: true }, { kind: "input", prompt });
|
|
114802
|
+
if (pause !== null)
|
|
114803
|
+
return pause;
|
|
114688
114804
|
const answer = await this.responder.respond({
|
|
114689
114805
|
kind: "input",
|
|
114690
114806
|
prompt,
|
|
@@ -114753,7 +114869,10 @@ class HitlSelectActionRunner {
|
|
|
114753
114869
|
message: prompt,
|
|
114754
114870
|
severity: "info"
|
|
114755
114871
|
});
|
|
114756
|
-
const resolved = await resolveDecision(this.responder, this.evaluator, { kind: "select", prompt, options: choiceList, runId: context.runId, node: context.stateOrNodeId }, parsed.config, context.vars.profile);
|
|
114872
|
+
const resolved = await resolveDecision(this.responder, this.evaluator, { kind: "select", prompt, options: choiceList, runId: context.runId, node: context.stateOrNodeId }, parsed.config, context.vars.profile, selectsHostExecutor(context.vars));
|
|
114873
|
+
const pause = hostHitlPause(context, resolved, { kind: "select", prompt });
|
|
114874
|
+
if (pause !== null)
|
|
114875
|
+
return pause;
|
|
114757
114876
|
const { answer } = resolved;
|
|
114758
114877
|
context.events?.emit("workflow.hitl.response", {
|
|
114759
114878
|
runId: context.runId,
|
|
@@ -114802,6 +114921,7 @@ function asStringArray(value) {
|
|
|
114802
114921
|
var KIND11 = "hitl.select";
|
|
114803
114922
|
var init_hitl_select = __esm(() => {
|
|
114804
114923
|
init_decision_hitl_responder();
|
|
114924
|
+
init_host_executor();
|
|
114805
114925
|
});
|
|
114806
114926
|
|
|
114807
114927
|
// ../../packages/app/src/workflow/actions/http-request.ts
|
|
@@ -115687,7 +115807,7 @@ function registerSpurBuiltins(host, options) {
|
|
|
115687
115807
|
...options.decisionLog !== undefined ? { decisionLog: options.decisionLog } : {}
|
|
115688
115808
|
}), "builtin");
|
|
115689
115809
|
host.registerAction(new CommandGateActionRunner(options.processExecutor ?? new NodeProcessExecutor2, fileSystem), "builtin");
|
|
115690
|
-
host.registerAction(new DoctorProbeActionRunner(options.processExecutor ?? new NodeProcessExecutor2, fileSystem, options.observabilityBus, options.agentService), "builtin");
|
|
115810
|
+
host.registerAction(new DoctorProbeActionRunner(options.processExecutor ?? new NodeProcessExecutor2, fileSystem, options.observabilityBus, options.agentService, options.fleetDispatchDeps), "builtin");
|
|
115691
115811
|
host.registerAction(new RunArtifactActionRunner(options.getDb, fileSystem, options.artifactDao, options.processExecutor), "builtin");
|
|
115692
115812
|
host.registerAction(new ProofFingerprintActionRunner(fileSystem, options.processExecutor, options.observabilityBus), "builtin");
|
|
115693
115813
|
if (options.httpRequester) {
|
|
@@ -118511,7 +118631,7 @@ class WorkflowResumeOps {
|
|
|
118511
118631
|
throw new Error(`Cannot resume run "${runId}": workflow definition drift detected (identity-stamped run has no recorded definition digest, currently ${resolved.digest}). Resume refused.`);
|
|
118512
118632
|
}
|
|
118513
118633
|
const resumeVars = await this.resolveResumeAnswerVars(runId, opts);
|
|
118514
|
-
const hostPause = await this.resolveHostPauseReceipt(runId, launchWorkdir, opts
|
|
118634
|
+
const hostPause = await this.resolveHostPauseReceipt(runId, launchWorkdir, opts, resolved.workflow);
|
|
118515
118635
|
if (persistedDigest !== null && persistedDigest !== resolved.digest) {
|
|
118516
118636
|
if (opts?.allowDigestMismatch !== true && opts?.force !== true) {
|
|
118517
118637
|
const prompt = `Workflow definition drift detected for run "${runId}": launched with ${persistedDigest}, currently ${resolved.digest}. Continue with modified definition?`;
|
|
@@ -118565,20 +118685,27 @@ class WorkflowResumeOps {
|
|
|
118565
118685
|
runResult.definitionDigest = persistedDigest;
|
|
118566
118686
|
if (persistedVersion !== undefined)
|
|
118567
118687
|
runResult.version = persistedVersion;
|
|
118568
|
-
await attachHostPause(createNodeFileSystem2(launchWorkdir), launchWorkdir, runResult, await this.ctx.getDb());
|
|
118688
|
+
await attachHostPause(createNodeFileSystem2(launchWorkdir), launchWorkdir, runResult, await this.ctx.getDb(), resolved.workflow);
|
|
118569
118689
|
if (warnings.length > 0)
|
|
118570
118690
|
runResult.warnings = warnings;
|
|
118571
118691
|
return runResult;
|
|
118572
118692
|
}
|
|
118573
|
-
async resolveHostPauseReceipt(runId, workdir,
|
|
118693
|
+
async resolveHostPauseReceipt(runId, workdir, opts, workflow) {
|
|
118574
118694
|
const db = await this.ctx.getDb();
|
|
118575
118695
|
if (!await hostExecutorPersisted(db, runId))
|
|
118576
118696
|
return { hostExecutor: false };
|
|
118577
|
-
|
|
118578
|
-
|
|
118579
|
-
|
|
118580
|
-
|
|
118697
|
+
const snapshot = await new DbWorkflowPersistenceAdapter(db).loadLatestStateSnapshot(runId);
|
|
118698
|
+
const gate = snapshot !== undefined ? operatorPauseAt(workflow, snapshot.state, snapshot.data) : null;
|
|
118699
|
+
if (gate !== null) {
|
|
118700
|
+
const answer = gate.kind === "hitl.input" ? opts?.answerText : opts?.hitlAnswer;
|
|
118701
|
+
if (answer === undefined || answer === "") {
|
|
118702
|
+
const flag = gate.kind === "hitl.input" ? "--answer-text <text>" : "--answer yes|no|cancel";
|
|
118703
|
+
throw new ValidationError(`Cannot resume run "${runId}": state '${snapshot?.state}' waits on a ${gate.kind} gate; use ${flag}. Resume refused; nothing was mutated.`);
|
|
118704
|
+
}
|
|
118705
|
+
return { hostExecutor: true };
|
|
118581
118706
|
}
|
|
118707
|
+
if (workflow.kind === "state-machine" && snapshot?.data.actionResume === undefined)
|
|
118708
|
+
return { hostExecutor: true };
|
|
118582
118709
|
const fs = createNodeFileSystem2(workdir);
|
|
118583
118710
|
const workItem = await readWorkItem(fs, workdir, runId);
|
|
118584
118711
|
if (workItem === null)
|
|
@@ -118586,6 +118713,7 @@ class WorkflowResumeOps {
|
|
|
118586
118713
|
const currentState = await new DbWorkflowPersistenceAdapter(db).loadCurrentState(runId);
|
|
118587
118714
|
if (currentState !== workItem.state)
|
|
118588
118715
|
return { hostExecutor: true };
|
|
118716
|
+
const answerText = opts?.answerText;
|
|
118589
118717
|
if (answerText === undefined) {
|
|
118590
118718
|
throw new ValidationError(`Cannot resume run "${runId}": state '${workItem.state}' paused on a host work item, so --answer-text must name its receipt path.`);
|
|
118591
118719
|
}
|
|
@@ -118619,6 +118747,14 @@ class WorkflowResumeOps {
|
|
|
118619
118747
|
const stateId = snapshot?.state ?? projection.currentState;
|
|
118620
118748
|
if (stateId === null)
|
|
118621
118749
|
return null;
|
|
118750
|
+
const operatorGate = operatorPauseAt(resolved.workflow, stateId, snapshot?.data);
|
|
118751
|
+
if (operatorGate !== null) {
|
|
118752
|
+
return {
|
|
118753
|
+
stateId,
|
|
118754
|
+
kind: operatorGate.kind,
|
|
118755
|
+
answerVar: hitlAnswerVar(operatorGate.kind, operatorGate.options)
|
|
118756
|
+
};
|
|
118757
|
+
}
|
|
118622
118758
|
if (snapshot?.data.actionResume !== undefined && await hostExecutorPersisted(db, runId)) {
|
|
118623
118759
|
return { stateId, kind: "hitl.input", answerVar: "__hostReceipt" };
|
|
118624
118760
|
}
|
|
@@ -118978,7 +119114,7 @@ class WorkflowRunOps {
|
|
|
118978
119114
|
await this.stampFailureReason(runId, result);
|
|
118979
119115
|
await this.maybeLinkPipelineRun(file, runId, opts);
|
|
118980
119116
|
const runResult = result;
|
|
118981
|
-
await attachHostPause(createNodeFileSystem2(this.ctx.cwd), this.ctx.cwd, runResult, await this.ctx.getDb());
|
|
119117
|
+
await attachHostPause(createNodeFileSystem2(this.ctx.cwd), this.ctx.cwd, runResult, await this.ctx.getDb(), workflow);
|
|
118982
119118
|
runResult.definitionDigest = resolved.digest;
|
|
118983
119119
|
runResult.version = workflowVersionLiteral(workflow);
|
|
118984
119120
|
if (warnings.length > 0) {
|
|
@@ -119589,7 +119725,7 @@ function computeDecisionReadiness(enabled, hasKey) {
|
|
|
119589
119725
|
// ../../packages/app/src/workflow/feature-verification-run.ts
|
|
119590
119726
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
119591
119727
|
import { closeSync as closeSync7, mkdirSync as mkdirSync14, openSync as openSync7 } from "fs";
|
|
119592
|
-
import { isAbsolute as isAbsolute14, join as join67 } from "path";
|
|
119728
|
+
import { isAbsolute as isAbsolute14, join as join67, resolve as resolve27 } from "path";
|
|
119593
119729
|
function assertSafeReceiptId(kind, id) {
|
|
119594
119730
|
if (!SAFE_RECEIPT_ID_RE.test(id) || id.includes("..")) {
|
|
119595
119731
|
throw new Error(`refusing unsafe ${kind}: ${id}`);
|
|
@@ -119617,15 +119753,66 @@ async function defaultRegisterArtifact(workdir, artifact) {
|
|
|
119617
119753
|
db.close();
|
|
119618
119754
|
}
|
|
119619
119755
|
}
|
|
119756
|
+
function defaultPassRun(workdir) {
|
|
119757
|
+
return {
|
|
119758
|
+
open: async (selected) => {
|
|
119759
|
+
const runId = createId("run");
|
|
119760
|
+
const db = await openInlineRunProjectDb(workdir);
|
|
119761
|
+
try {
|
|
119762
|
+
const persistence = withRunIdentityRecording(new DbWorkflowPersistenceAdapter(db.adapter), db.adapter, {
|
|
119763
|
+
definitionDigest: selected.digest,
|
|
119764
|
+
workflowVersion: workflowVersionLiteral(selected.workflow),
|
|
119765
|
+
source: { path: selected.path, layer: selected.layer, workdir: resolve27(workdir) }
|
|
119766
|
+
});
|
|
119767
|
+
await persistence.createRun({
|
|
119768
|
+
id: runId,
|
|
119769
|
+
workflow_name: FEATURE_VERIFIER_DEFINITION,
|
|
119770
|
+
mode: "state-machine",
|
|
119771
|
+
status: "running",
|
|
119772
|
+
started_at: new Date().toISOString(),
|
|
119773
|
+
completed_at: null,
|
|
119774
|
+
metadata_json: "{}"
|
|
119775
|
+
});
|
|
119776
|
+
} finally {
|
|
119777
|
+
db.close();
|
|
119778
|
+
}
|
|
119779
|
+
return runId;
|
|
119780
|
+
},
|
|
119781
|
+
finalize: async (runId, status) => {
|
|
119782
|
+
const db = await openInlineRunProjectDb(workdir);
|
|
119783
|
+
try {
|
|
119784
|
+
await new DbWorkflowPersistenceAdapter(db.adapter).finalizeRun(runId, status, new Date().toISOString(), undefined, status);
|
|
119785
|
+
} finally {
|
|
119786
|
+
db.close();
|
|
119787
|
+
}
|
|
119788
|
+
}
|
|
119789
|
+
};
|
|
119790
|
+
}
|
|
119620
119791
|
async function defaultReadLearnings(fileSystem, workdir) {
|
|
119621
119792
|
const path = join67(workdir, ".spur", "context", "learnings.md");
|
|
119622
119793
|
return await fileSystem.exists(path) ? fileSystem.readFile(path) : undefined;
|
|
119623
119794
|
}
|
|
119624
119795
|
async function runFeatureVerification(input) {
|
|
119796
|
+
const resolveDefinition = input.resolveDefinition ?? resolveWorkflowDefinition;
|
|
119797
|
+
const selected = await resolveDefinition(input.workdir, FEATURE_VERIFIER_DEFINITION);
|
|
119798
|
+
if (input.runId !== "") {
|
|
119799
|
+
try {
|
|
119800
|
+
return await runFeatureVerificationPass(input, selected);
|
|
119801
|
+
} catch (error) {
|
|
119802
|
+
await writeFailedStatus(input);
|
|
119803
|
+
throw error;
|
|
119804
|
+
}
|
|
119805
|
+
}
|
|
119806
|
+
const passRun = input.passRun ?? defaultPassRun(input.workdir);
|
|
119807
|
+
const runId = await passRun.open(selected);
|
|
119808
|
+
const owned = { ...input, runId };
|
|
119625
119809
|
try {
|
|
119626
|
-
|
|
119810
|
+
const result = await runFeatureVerificationPass(owned, selected);
|
|
119811
|
+
await passRun.finalize(runId, "done");
|
|
119812
|
+
return result;
|
|
119627
119813
|
} catch (error) {
|
|
119628
|
-
await writeFailedStatus(
|
|
119814
|
+
await writeFailedStatus(owned);
|
|
119815
|
+
await passRun.finalize(runId, "failed");
|
|
119629
119816
|
throw error;
|
|
119630
119817
|
}
|
|
119631
119818
|
}
|
|
@@ -119638,14 +119825,13 @@ async function writeFailedStatus(input) {
|
|
|
119638
119825
|
`);
|
|
119639
119826
|
} catch {}
|
|
119640
119827
|
}
|
|
119641
|
-
async function runFeatureVerificationPass(input) {
|
|
119828
|
+
async function runFeatureVerificationPass(input, selected) {
|
|
119642
119829
|
assertSafeReceiptId("feature id", input.featureId);
|
|
119643
119830
|
assertSafeReceiptId("run id", input.runId);
|
|
119644
119831
|
const fileSystem = input.fileSystem ?? createNodeFileSystem2();
|
|
119645
119832
|
const launch = input.launch ?? ((command, args, options) => spawnSync3(command, args, options));
|
|
119646
119833
|
const openLog = input.openLog ?? ((path) => openSync7(path, "a"));
|
|
119647
119834
|
const closeLog = input.closeLog ?? ((fd) => closeSync7(fd));
|
|
119648
|
-
const resolveDefinition = input.resolveDefinition ?? resolveWorkflowDefinition;
|
|
119649
119835
|
const split = input.splitCommand ?? splitLaunchCommand;
|
|
119650
119836
|
const receipts = input.receipts ?? {
|
|
119651
119837
|
start: startFeatureVerificationReceipt,
|
|
@@ -119657,10 +119843,7 @@ async function runFeatureVerificationPass(input) {
|
|
|
119657
119843
|
const readLearnings = input.readLearnings ?? ((workdir) => defaultReadLearnings(fileSystem, workdir));
|
|
119658
119844
|
const runDir = join67(input.workdir, ".spur", "run");
|
|
119659
119845
|
mkdirSync14(runDir, { recursive: true });
|
|
119660
|
-
const
|
|
119661
|
-
const vars = selected.workflow.vars;
|
|
119662
|
-
const configuredCmd = typeof vars?.verificationCmd === "string" && vars.verificationCmd.length > 0 ? vars.verificationCmd : "spur self exec check-feature";
|
|
119663
|
-
const effectiveCmd = input.cmdOverride !== undefined && input.cmdOverride !== "" ? input.cmdOverride : configuredCmd;
|
|
119846
|
+
const effectiveCmd = input.cmdOverride !== undefined && input.cmdOverride !== "" ? input.cmdOverride : DEFAULT_FEATURE_VERIFICATION_CMD;
|
|
119664
119847
|
const spec = await lookup(input.featureId);
|
|
119665
119848
|
if (spec === null) {
|
|
119666
119849
|
throw new Error(`feature ${input.featureId} not found in the configured features directory`);
|
|
@@ -119672,7 +119855,7 @@ async function runFeatureVerificationPass(input) {
|
|
|
119672
119855
|
runId: input.runId,
|
|
119673
119856
|
workdir: input.workdir,
|
|
119674
119857
|
verifier: {
|
|
119675
|
-
name:
|
|
119858
|
+
name: FEATURE_VERIFIER_DEFINITION,
|
|
119676
119859
|
sourcePath: selected.path,
|
|
119677
119860
|
layer: selected.layer,
|
|
119678
119861
|
definitionDigest: selected.digest
|
|
@@ -119684,7 +119867,7 @@ async function runFeatureVerificationPass(input) {
|
|
|
119684
119867
|
await registerArtifact({ runId: input.runId, path: runScoped, kind: "feature-verification" });
|
|
119685
119868
|
const logPath = join67(runDir, `${input.runId}-feature-verification.log`);
|
|
119686
119869
|
const base = { featureId: input.featureId, runId: input.runId, effectiveCmd, logPath, receiptPath: runScoped };
|
|
119687
|
-
const launchSplit = split(effectiveCmd, "feature
|
|
119870
|
+
const launchSplit = split(effectiveCmd, "feature verification command");
|
|
119688
119871
|
if ("error" in launchSplit) {
|
|
119689
119872
|
await receipts.complete(fileSystem, runDir, receipt, {
|
|
119690
119873
|
status: "FAIL",
|
|
@@ -119722,9 +119905,11 @@ async function runFeatureVerificationPass(input) {
|
|
|
119722
119905
|
var SAFE_RECEIPT_ID_RE, FEATURE_VERIFICATION_TIMEOUT_MS;
|
|
119723
119906
|
var init_feature_verification_run = __esm(() => {
|
|
119724
119907
|
init_src2();
|
|
119908
|
+
init_dist8();
|
|
119725
119909
|
init_dist5();
|
|
119726
119910
|
init_planning_folders();
|
|
119727
119911
|
init_inline_run_attribution();
|
|
119912
|
+
init_workflow_run_recording();
|
|
119728
119913
|
init_feature_verification_receipt();
|
|
119729
119914
|
init_split_launch_command();
|
|
119730
119915
|
init_workflow_resolver();
|
|
@@ -119733,7 +119918,7 @@ var init_feature_verification_run = __esm(() => {
|
|
|
119733
119918
|
});
|
|
119734
119919
|
|
|
119735
119920
|
// ../../packages/app/src/workflow/idea-handoff.ts
|
|
119736
|
-
import { resolve as
|
|
119921
|
+
import { resolve as resolve28 } from "path";
|
|
119737
119922
|
function processEvidence(r) {
|
|
119738
119923
|
return `exit=${r.exitCode ?? "null"}${r.signal ? ` signal=${r.signal}` : ""}: ${r.stderr.trim() || "no stderr"}`;
|
|
119739
119924
|
}
|
|
@@ -119744,10 +119929,10 @@ function taskFrontmatterFeatureId(raw) {
|
|
|
119744
119929
|
}
|
|
119745
119930
|
function premiseLintIo(root, fs) {
|
|
119746
119931
|
return {
|
|
119747
|
-
fileExists: async (p) => fs.exists(
|
|
119932
|
+
fileExists: async (p) => fs.exists(resolve28(root, p)),
|
|
119748
119933
|
lineCount: async (p) => {
|
|
119749
119934
|
try {
|
|
119750
|
-
const lines = (await fs.readFile(
|
|
119935
|
+
const lines = (await fs.readFile(resolve28(root, p))).split(`
|
|
119751
119936
|
`);
|
|
119752
119937
|
return lines[lines.length - 1] === "" ? lines.length - 1 : lines.length;
|
|
119753
119938
|
} catch {
|
|
@@ -119762,12 +119947,12 @@ async function finalizeIdeaHandoff(options) {
|
|
|
119762
119947
|
const executor = options.processExecutor ?? new NodeProcessExecutor2;
|
|
119763
119948
|
const spurBin = options.spurBin ?? "spur";
|
|
119764
119949
|
const { runId, featureId } = options;
|
|
119765
|
-
const runDir =
|
|
119766
|
-
const batchPath =
|
|
119767
|
-
const resultPath =
|
|
119768
|
-
const orderPath =
|
|
119769
|
-
const readyPath =
|
|
119770
|
-
const reportPath =
|
|
119950
|
+
const runDir = resolve28(root, ".spur", "run");
|
|
119951
|
+
const batchPath = resolve28(runDir, `${runId}-idea-task-batch.json`);
|
|
119952
|
+
const resultPath = resolve28(runDir, `${runId}-idea-batch-create-result.json`);
|
|
119953
|
+
const orderPath = resolve28(runDir, `${runId}-idea-task-order.json`);
|
|
119954
|
+
const readyPath = resolve28(runDir, `${runId}-idea-ready.json`);
|
|
119955
|
+
const reportPath = resolve28(runDir, `${runId}-idea-handoff.md`);
|
|
119771
119956
|
const spurSplit = options.spurArgv?.length ? { command: options.spurArgv[0], leadingArgs: options.spurArgv.slice(1) } : splitLaunchCommand(spurBin, 'idea-handoff "spurBin"');
|
|
119772
119957
|
if ("error" in spurSplit) {
|
|
119773
119958
|
return {
|
|
@@ -125743,7 +125928,7 @@ function resolveTasks(env, options = {}) {
|
|
|
125743
125928
|
writeFileSync12(abs(relReasonFile), reason);
|
|
125744
125929
|
writeFileSync12(abs(relStatusFile), `FAIL
|
|
125745
125930
|
`);
|
|
125746
|
-
return { status: "FAIL", statusFile: relStatusFile, tasksFile: relTasksFile, exitCode:
|
|
125931
|
+
return { status: "FAIL", statusFile: relStatusFile, tasksFile: relTasksFile, exitCode: 1 };
|
|
125747
125932
|
};
|
|
125748
125933
|
let parsedTasks;
|
|
125749
125934
|
try {
|
|
@@ -125775,68 +125960,10 @@ function resolveTasks(env, options = {}) {
|
|
|
125775
125960
|
if (unresolved) {
|
|
125776
125961
|
return writeFail(`failed:unresolved or non-completed task (see ${relTasksFile})`);
|
|
125777
125962
|
}
|
|
125778
|
-
if ((env.feature ?? "") !== "") {
|
|
125779
|
-
const pf = preflightFeature(env, cwd, options.spurArgv);
|
|
125780
|
-
if (pf)
|
|
125781
|
-
return writeFail(pf);
|
|
125782
|
-
}
|
|
125783
125963
|
writeFileSync12(abs(relStatusFile), `PASS
|
|
125784
125964
|
`);
|
|
125785
125965
|
return { status: "PASS", statusFile: relStatusFile, tasksFile: relTasksFile, exitCode: 0 };
|
|
125786
125966
|
}
|
|
125787
|
-
function isFindingList(value) {
|
|
125788
|
-
return Array.isArray(value) && value.every((f) => f !== null && typeof f === "object" && typeof f.severity === "string" && typeof f.code === "string" && f.code.length > 0);
|
|
125789
|
-
}
|
|
125790
|
-
function sortedUniqueCodes(findings) {
|
|
125791
|
-
const codes = findings.filter((f) => f.severity === "error").map((f) => String(f.code ?? "")).filter((c) => c.length > 0);
|
|
125792
|
-
return [...new Set(codes)].sort();
|
|
125793
|
-
}
|
|
125794
|
-
function preflightFeature(env, cwd, spurArgv) {
|
|
125795
|
-
const feature = env.feature ?? "";
|
|
125796
|
-
const abs = (p) => cwd ? join75(cwd, p) : p;
|
|
125797
|
-
const syncOut = spur(env, ["feature", "sync", feature, "--dry-run", "--json"], { cwd, spurArgv });
|
|
125798
|
-
let sync;
|
|
125799
|
-
if (syncOut.status === 0) {
|
|
125800
|
-
try {
|
|
125801
|
-
const parsed = JSON.parse(syncOut.stdout);
|
|
125802
|
-
if (parsed !== null && typeof parsed === "object")
|
|
125803
|
-
sync = parsed;
|
|
125804
|
-
} catch {}
|
|
125805
|
-
}
|
|
125806
|
-
if (sync === undefined)
|
|
125807
|
-
return "failed:preflight:sync-unreadable";
|
|
125808
|
-
const proposal = sync.proposal;
|
|
125809
|
-
if (proposal === null || typeof proposal !== "object" || Array.isArray(proposal) || proposal.gateBlocked !== undefined && typeof proposal.gateBlocked !== "boolean" || proposal.gateFindings !== undefined && !isFindingList(proposal.gateFindings) || proposal.hops !== undefined && (!Array.isArray(proposal.hops) || !proposal.hops.every((hop) => typeof hop === "string")) || proposal.gateBlocked !== true && (typeof proposal.from !== "string" || typeof proposal.to !== "string")) {
|
|
125810
|
-
return "failed:preflight:sync-unreadable";
|
|
125811
|
-
}
|
|
125812
|
-
if (proposal.gateBlocked === true) {
|
|
125813
|
-
return `failed:preflight:gate-blocked ${sortedUniqueCodes(proposal.gateFindings ?? []).join(",")}`;
|
|
125814
|
-
}
|
|
125815
|
-
const reachesDone = proposal.to === "done" || (proposal.hops ?? []).includes("done");
|
|
125816
|
-
if (!reachesDone)
|
|
125817
|
-
return null;
|
|
125818
|
-
const checkOut = spur(env, ["feature", "check", feature, "--strict", "--as", "done", "--json"], { cwd, spurArgv });
|
|
125819
|
-
let check;
|
|
125820
|
-
try {
|
|
125821
|
-
check = JSON.parse(checkOut.stdout);
|
|
125822
|
-
} catch {
|
|
125823
|
-
return "failed:preflight:check-unreadable";
|
|
125824
|
-
}
|
|
125825
|
-
const payload = Array.isArray(check) && check.length === 1 ? check[0] : check;
|
|
125826
|
-
const findings = payload !== null && typeof payload === "object" ? payload.findings : undefined;
|
|
125827
|
-
if (!isFindingList(findings) || checkOut.status !== 0 && (checkOut.status !== 1 || !findings.some((f) => f.severity === "error"))) {
|
|
125828
|
-
return "failed:preflight:check-unreadable";
|
|
125829
|
-
}
|
|
125830
|
-
const eligible = proposal.from === "verifying" ? findings : findings.filter((f) => !String(f.code ?? "").startsWith("L4.feature-receipt-"));
|
|
125831
|
-
const runId = env.__runId ?? "";
|
|
125832
|
-
if (runId.length > 0) {
|
|
125833
|
-
mkdirSync17(abs(join75(".spur", "run")), { recursive: true });
|
|
125834
|
-
writeFileSync12(abs(join75(".spur", "run", `${runId}-wrapup-preflight.json`)), `${JSON.stringify(check)}
|
|
125835
|
-
`);
|
|
125836
|
-
}
|
|
125837
|
-
const codes = sortedUniqueCodes(eligible);
|
|
125838
|
-
return codes.length > 0 ? `failed:preflight:done-gate ${codes.join(",")}` : null;
|
|
125839
|
-
}
|
|
125840
125967
|
function writeRouteReason(env, options = {}) {
|
|
125841
125968
|
const cwd = options.cwd;
|
|
125842
125969
|
const runId = env.__runId ?? "";
|
|
@@ -125972,125 +126099,6 @@ function runMetrics(env, options = {}) {
|
|
|
125972
126099
|
`);
|
|
125973
126100
|
return { status, statusFile: relStatusFile };
|
|
125974
126101
|
}
|
|
125975
|
-
function classifySync(syncOutput, syncRc, feature, observed) {
|
|
125976
|
-
if (syncRc !== 0) {
|
|
125977
|
-
return { reason: `sync exited nonzero (rc=${syncRc})`, applied: "unreadable", syncOk: false };
|
|
125978
|
-
}
|
|
125979
|
-
let parsed;
|
|
125980
|
-
try {
|
|
125981
|
-
parsed = JSON.parse(syncOutput);
|
|
125982
|
-
} catch {
|
|
125983
|
-
parsed = undefined;
|
|
125984
|
-
}
|
|
125985
|
-
const obj = parsed !== null && typeof parsed === "object" ? parsed : undefined;
|
|
125986
|
-
const proposal = obj?.proposal !== null && typeof obj?.proposal === "object" ? obj.proposal : undefined;
|
|
125987
|
-
const shapeOk = obj !== undefined && proposal !== undefined && typeof proposal.featureId === "string" && typeof proposal.from === "string" && typeof proposal.to === "string" && typeof obj.applied === "boolean";
|
|
125988
|
-
if (!shapeOk) {
|
|
125989
|
-
return { reason: "malformed or unreadable sync result", applied: "unreadable", syncOk: false };
|
|
125990
|
-
}
|
|
125991
|
-
const applied = obj.applied === true ? "true" : "false";
|
|
125992
|
-
const pFrom = String(jqPick(proposal.from, ""));
|
|
125993
|
-
const pTo = String(jqPick(proposal.to, ""));
|
|
125994
|
-
if (String(jqPick(proposal.featureId, "")) !== feature) {
|
|
125995
|
-
return { reason: `sync proposal does not match feature ${feature}`, applied, syncOk: false };
|
|
125996
|
-
}
|
|
125997
|
-
if (proposal.gateBlocked === true) {
|
|
125998
|
-
return {
|
|
125999
|
-
reason: "sync proposal is gate-blocked \u2014 a blocked sync is not a no-change success",
|
|
126000
|
-
applied,
|
|
126001
|
-
syncOk: false
|
|
126002
|
-
};
|
|
126003
|
-
}
|
|
126004
|
-
if (proposal.requiresConfirm === true) {
|
|
126005
|
-
return { reason: "sync proposal requires operator confirmation", applied, syncOk: false };
|
|
126006
|
-
}
|
|
126007
|
-
if (applied === "true" && observed !== pTo) {
|
|
126008
|
-
return {
|
|
126009
|
-
reason: `applied sync did not land on the proposal target (observed=${observed}, to=${pTo})`,
|
|
126010
|
-
applied,
|
|
126011
|
-
syncOk: false
|
|
126012
|
-
};
|
|
126013
|
-
}
|
|
126014
|
-
if (applied === "false" && (pFrom !== pTo || observed !== pTo)) {
|
|
126015
|
-
return {
|
|
126016
|
-
reason: `sync applied nothing without a from==to observed no-op (from=${pFrom}, to=${pTo}, observed=${observed})`,
|
|
126017
|
-
applied,
|
|
126018
|
-
syncOk: false
|
|
126019
|
-
};
|
|
126020
|
-
}
|
|
126021
|
-
return { reason: "", applied, syncOk: true };
|
|
126022
|
-
}
|
|
126023
|
-
function runFeatureTransition(env, options = {}) {
|
|
126024
|
-
const cwd = options.cwd;
|
|
126025
|
-
const runId = env.__runId ?? "";
|
|
126026
|
-
const feature = env.feature ?? "";
|
|
126027
|
-
mkdirSync17(cwd ? join75(cwd, ".spur", "run") : join75(".spur", "run"), { recursive: true });
|
|
126028
|
-
const relStatusFile = join75(".spur", "run", `${runId}-wrapup-sync.status`);
|
|
126029
|
-
const abs = (p) => cwd ? join75(cwd, p) : p;
|
|
126030
|
-
if (feature.length === 0) {
|
|
126031
|
-
echoError("feature-transition: vars.feature is empty \u2014 refusing no-op feature sync (mis-invocation, not a blocked sync)");
|
|
126032
|
-
return { status: "FAIL", statusFile: relStatusFile, exitCode: 1 };
|
|
126033
|
-
}
|
|
126034
|
-
let syncOutput = "";
|
|
126035
|
-
let syncRc = 1;
|
|
126036
|
-
const sync = spur(env, ["feature", "sync", feature, "--json"], {
|
|
126037
|
-
cwd,
|
|
126038
|
-
spurArgv: options.spurArgv,
|
|
126039
|
-
stderr: "inherit"
|
|
126040
|
-
});
|
|
126041
|
-
syncOutput = sync.stdout;
|
|
126042
|
-
syncRc = sync.status;
|
|
126043
|
-
echo(`${syncOutput}`);
|
|
126044
|
-
const shown = spur(env, ["feature", "show", feature, "--json"], { cwd, spurArgv: options.spurArgv });
|
|
126045
|
-
let observed = "";
|
|
126046
|
-
if (shown.status === 0) {
|
|
126047
|
-
try {
|
|
126048
|
-
const parsed = JSON.parse(shown.stdout);
|
|
126049
|
-
const frontmatter = parsed.frontmatter !== null && typeof parsed.frontmatter === "object" ? parsed.frontmatter : {};
|
|
126050
|
-
const picked = jqPick(parsed.status, frontmatter.status, "");
|
|
126051
|
-
observed = picked === "" ? "" : jqText(picked);
|
|
126052
|
-
} catch {
|
|
126053
|
-
observed = "";
|
|
126054
|
-
}
|
|
126055
|
-
}
|
|
126056
|
-
if (observed.length === 0)
|
|
126057
|
-
observed = "unreadable";
|
|
126058
|
-
const classified = classifySync(syncOutput, syncRc, feature, observed);
|
|
126059
|
-
const { reason, applied } = classified;
|
|
126060
|
-
const syncOk = classified.syncOk;
|
|
126061
|
-
let gate = "skipped";
|
|
126062
|
-
if (applied === "true" || syncRc !== 0) {
|
|
126063
|
-
echo(`feature-transition: sync applied or failed after a possible partial transition for ${feature} \u2014 running feature gate: ${env.featureGateCmd ?? ""}`);
|
|
126064
|
-
const gateResult = spawnSync5("sh", ["-c", env.featureGateCmd ?? ""], {
|
|
126065
|
-
cwd,
|
|
126066
|
-
env: childEnv(env),
|
|
126067
|
-
stdio: "inherit"
|
|
126068
|
-
});
|
|
126069
|
-
if ((gateResult.status ?? 1) === 0) {
|
|
126070
|
-
gate = "PASS";
|
|
126071
|
-
echo(`feature-transition: feature gate PASS for feature ${feature}`);
|
|
126072
|
-
} else {
|
|
126073
|
-
gate = "FAIL";
|
|
126074
|
-
echoError(`feature-transition: feature gate FAIL for feature ${feature} \u2014 inspect findings before reporting the transition complete`);
|
|
126075
|
-
}
|
|
126076
|
-
} else {
|
|
126077
|
-
echo(`feature-transition: sync did not apply a transition (rc=${syncRc}, applied=${applied}) \u2014 feature gate skipped`);
|
|
126078
|
-
}
|
|
126079
|
-
let syncStatus;
|
|
126080
|
-
if (!syncOk || gate === "FAIL") {
|
|
126081
|
-
syncStatus = "FAIL";
|
|
126082
|
-
echoError(`feature-transition: required synchronization failed for ${feature} \u2014 ${reason}; gate=${gate}`);
|
|
126083
|
-
} else if (applied === "false") {
|
|
126084
|
-
syncStatus = "PASS";
|
|
126085
|
-
echo(`feature-transition: feature sync verified for ${feature} (from==to observed at ${observed}, gate=${gate}) \u2014 explicit no-change`);
|
|
126086
|
-
} else {
|
|
126087
|
-
syncStatus = "PASS";
|
|
126088
|
-
echo(`feature-transition: feature sync verified for ${feature} (applied, observed=${observed}, gate=${gate})`);
|
|
126089
|
-
}
|
|
126090
|
-
writeFileSync12(abs(relStatusFile), `${syncStatus}
|
|
126091
|
-
`);
|
|
126092
|
-
return { status: syncStatus, statusFile: relStatusFile, exitCode: 0 };
|
|
126093
|
-
}
|
|
126094
126102
|
function porcelainPath(line) {
|
|
126095
126103
|
const body = line.length >= 3 ? line.slice(3) : line;
|
|
126096
126104
|
const arrow = body.indexOf(" -> ");
|
|
@@ -126223,8 +126231,6 @@ function runWrapupStep(op, env, options = {}) {
|
|
|
126223
126231
|
case "metrics":
|
|
126224
126232
|
runMetrics(env, options);
|
|
126225
126233
|
return 0;
|
|
126226
|
-
case "feature-transition":
|
|
126227
|
-
return runFeatureTransition(env, options).exitCode;
|
|
126228
126234
|
case "doc-sync-snapshot":
|
|
126229
126235
|
return runDocSyncSnapshot(env, options).exitCode;
|
|
126230
126236
|
case "doc-sync-scope":
|
|
@@ -126249,7 +126255,6 @@ var init_steps = __esm(() => {
|
|
|
126249
126255
|
"resolve",
|
|
126250
126256
|
"route-reason",
|
|
126251
126257
|
"metrics",
|
|
126252
|
-
"feature-transition",
|
|
126253
126258
|
"doc-sync-snapshot",
|
|
126254
126259
|
"doc-sync-scope",
|
|
126255
126260
|
"doc-supersession"
|
|
@@ -128862,7 +128867,7 @@ var init_history_anatomy_cli = __esm(() => {
|
|
|
128862
128867
|
|
|
128863
128868
|
// ../../packages/app/src/services/daily-summary.ts
|
|
128864
128869
|
import { existsSync as existsSync30, mkdirSync as mkdirSync22, readlinkSync as readlinkSync2, writeFileSync as writeFileSync19 } from "fs";
|
|
128865
|
-
import { dirname as dirname40, isAbsolute as isAbsolute15, join as join87, resolve as
|
|
128870
|
+
import { dirname as dirname40, isAbsolute as isAbsolute15, join as join87, resolve as resolve32 } from "path";
|
|
128866
128871
|
function parseArgs2(argv) {
|
|
128867
128872
|
const args = argv;
|
|
128868
128873
|
const options = {
|
|
@@ -128996,7 +129001,7 @@ function composeHistoryHealth(reading) {
|
|
|
128996
129001
|
}
|
|
128997
129002
|
async function getSpurHistoryHealth(date, dbPath = ".spur/spur.db") {
|
|
128998
129003
|
try {
|
|
128999
|
-
const resolvedPath =
|
|
129004
|
+
const resolvedPath = resolve32(process.cwd(), dbPath);
|
|
129000
129005
|
const reading = await readHistoryHealth({ date, dbPath: resolvedPath });
|
|
129001
129006
|
return reading === null ? null : composeHistoryHealth(reading);
|
|
129002
129007
|
} catch {
|
|
@@ -129255,13 +129260,13 @@ function writeSummary(markdown, options) {
|
|
|
129255
129260
|
return outputPath;
|
|
129256
129261
|
}
|
|
129257
129262
|
function resolveHistoryReportPath() {
|
|
129258
|
-
const pointer =
|
|
129263
|
+
const pointer = resolve32(process.cwd(), ".spur", "reports", "history", "latest.json");
|
|
129259
129264
|
if (!existsSync30(pointer)) {
|
|
129260
129265
|
return;
|
|
129261
129266
|
}
|
|
129262
129267
|
try {
|
|
129263
129268
|
const target = readlinkSync2(pointer);
|
|
129264
|
-
const resolved = isAbsolute15(target) ? target :
|
|
129269
|
+
const resolved = isAbsolute15(target) ? target : resolve32(dirname40(pointer), target);
|
|
129265
129270
|
return existsSync30(resolved) ? resolved : undefined;
|
|
129266
129271
|
} catch {
|
|
129267
129272
|
return;
|
|
@@ -130176,19 +130181,19 @@ init_src3();
|
|
|
130176
130181
|
init_src();
|
|
130177
130182
|
init_loader2();
|
|
130178
130183
|
|
|
130179
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130184
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
130180
130185
|
init_dist4();
|
|
130181
130186
|
init_dist5();
|
|
130182
130187
|
import { appendFileSync as appendFileSync5, mkdirSync as mkdirSync15, readFileSync as readFileSync15, statSync as statSync13 } from "fs";
|
|
130183
130188
|
import { dirname as dirname35, join as join69 } from "path";
|
|
130184
130189
|
|
|
130185
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130190
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/application/index.js
|
|
130186
130191
|
init_default_observers();
|
|
130187
130192
|
init_event_bus();
|
|
130188
130193
|
init_file_observer();
|
|
130189
130194
|
init_logger3();
|
|
130190
130195
|
|
|
130191
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130196
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
|
|
130192
130197
|
class NoopSchedulerAdapter2 {
|
|
130193
130198
|
constructor() {}
|
|
130194
130199
|
register(_cron, _action) {}
|
|
@@ -130196,7 +130201,7 @@ class NoopSchedulerAdapter2 {
|
|
|
130196
130201
|
async stop() {}
|
|
130197
130202
|
}
|
|
130198
130203
|
|
|
130199
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130204
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
|
|
130200
130205
|
function initScheduler2(adapter, cronEntries) {
|
|
130201
130206
|
const resolved = adapter ?? new NoopSchedulerAdapter2;
|
|
130202
130207
|
if (cronEntries) {
|
|
@@ -130207,7 +130212,7 @@ function initScheduler2(adapter, cronEntries) {
|
|
|
130207
130212
|
return resolved;
|
|
130208
130213
|
}
|
|
130209
130214
|
|
|
130210
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130215
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
|
|
130211
130216
|
init_logger3();
|
|
130212
130217
|
init_metrics();
|
|
130213
130218
|
init_sdk();
|
|
@@ -130300,7 +130305,7 @@ function dbPlugin(db) {
|
|
|
130300
130305
|
};
|
|
130301
130306
|
}
|
|
130302
130307
|
|
|
130303
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130308
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
|
|
130304
130309
|
init_logger3();
|
|
130305
130310
|
|
|
130306
130311
|
class PluginHost {
|
|
@@ -130388,7 +130393,7 @@ class PluginHost {
|
|
|
130388
130393
|
}
|
|
130389
130394
|
}
|
|
130390
130395
|
|
|
130391
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130396
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/application/index.js
|
|
130392
130397
|
async function performShutdown(state, reason) {
|
|
130393
130398
|
if (state.stopped)
|
|
130394
130399
|
return;
|
|
@@ -130500,7 +130505,7 @@ async function runApplication(options) {
|
|
|
130500
130505
|
throw error;
|
|
130501
130506
|
}
|
|
130502
130507
|
}
|
|
130503
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130508
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/scheduler/cron.js
|
|
130504
130509
|
var MAX_SCAN_MINUTES = 8 * 366 * 24 * 60;
|
|
130505
130510
|
var DAYS_OF_WEEK = 7;
|
|
130506
130511
|
function parseField(raw, min, max) {
|
|
@@ -130614,7 +130619,7 @@ function nextCronTime(expr, nowMs) {
|
|
|
130614
130619
|
throw new RangeError(`unsupported cron expression "${expr.source}": no matching time within 8 years`);
|
|
130615
130620
|
}
|
|
130616
130621
|
|
|
130617
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130622
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
|
|
130618
130623
|
init_logger3();
|
|
130619
130624
|
init_metrics();
|
|
130620
130625
|
var MAX_TIMEOUT = 2147483647;
|
|
@@ -130768,7 +130773,7 @@ class NodeSchedulerAdapter {
|
|
|
130768
130773
|
}
|
|
130769
130774
|
}
|
|
130770
130775
|
}
|
|
130771
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
130776
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
|
|
130772
130777
|
var import_api15 = __toESM(require_src(), 1);
|
|
130773
130778
|
|
|
130774
130779
|
// ../../node_modules/.bun/@opentelemetry+exporter-metrics-otlp-http@0.218.0+e40b0dfdd726a224/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/esm/OTLPMetricExporterBase.js
|
|
@@ -133784,7 +133789,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
|
|
|
133784
133789
|
}), JsonTraceSerializer));
|
|
133785
133790
|
}
|
|
133786
133791
|
}
|
|
133787
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
133792
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
|
|
133788
133793
|
var import_resources2 = __toESM(require_src4(), 1);
|
|
133789
133794
|
var import_sdk_trace_node = __toESM(require_src8(), 1);
|
|
133790
133795
|
var import_semantic_conventions2 = __toESM(require_src2(), 1);
|
|
@@ -133835,7 +133840,7 @@ async function shutdownNodeTelemetry() {
|
|
|
133835
133840
|
await Promise.all(pending);
|
|
133836
133841
|
}
|
|
133837
133842
|
|
|
133838
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.
|
|
133843
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.30+966af4215b55df09/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
133839
133844
|
class ConfigValidationError extends Error {
|
|
133840
133845
|
constructor(message) {
|
|
133841
133846
|
super(message);
|
|
@@ -138374,7 +138379,7 @@ init_src3();
|
|
|
138374
138379
|
init_src();
|
|
138375
138380
|
init_src2();
|
|
138376
138381
|
init_dist10();
|
|
138377
|
-
import { dirname as dirname39, resolve as
|
|
138382
|
+
import { dirname as dirname39, resolve as resolve29 } from "path";
|
|
138378
138383
|
|
|
138379
138384
|
// src/system-event-ledger.ts
|
|
138380
138385
|
init_src3();
|
|
@@ -141077,36 +141082,31 @@ var WRAPUP_OPS = [
|
|
|
141077
141082
|
"resolve",
|
|
141078
141083
|
"route-reason",
|
|
141079
141084
|
"metrics",
|
|
141080
|
-
"feature-transition",
|
|
141081
141085
|
"doc-sync-snapshot",
|
|
141082
141086
|
"doc-sync-scope",
|
|
141083
141087
|
"doc-supersession",
|
|
141084
141088
|
"drift-probe"
|
|
141085
141089
|
];
|
|
141086
141090
|
function registerTaskWrapupCommand(task, context) {
|
|
141087
|
-
task.command("wrapup").summary("Run one deterministic wrapup-pipeline step (resolve, metrics,
|
|
141088
|
-
"Deterministic wrapup-pipeline steps; each writes its .spur/run/<runId>-* artifact
|
|
141089
|
-
"
|
|
141090
|
-
"
|
|
141091
|
-
" resolve validate + dedupe the task list, resolve each task, feature pre-flight",
|
|
141091
|
+
task.command("wrapup").summary("Run one deterministic wrapup-pipeline step (resolve, metrics, doc-sync guards, drift probe).").description([
|
|
141092
|
+
"Deterministic wrapup-pipeline steps; each writes its .spur/run/<runId>-* artifact.",
|
|
141093
|
+
"Exit 1 = validation failure or mis-invocation (empty run id), 2 = unknown op.",
|
|
141094
|
+
" resolve validate + dedupe the task list and resolve each task",
|
|
141092
141095
|
" route-reason write the route reason from the capture, mode and drift probe",
|
|
141093
141096
|
" metrics append one .spur/memory/wrapup-metrics.jsonl row per task",
|
|
141094
|
-
" feature-transition required feature sync, observation and the feature gate",
|
|
141095
141097
|
" doc-sync-snapshot record the working listing at doc-sync entry",
|
|
141096
141098
|
" doc-sync-scope fail on doc-sync writes outside docs/** (minus the corpus)",
|
|
141097
141099
|
" doc-supersession re-run the supersession pin after doc-sync",
|
|
141098
141100
|
" drift-probe classify doc-ownership drift and project mode=fast when clean",
|
|
141099
|
-
"Flags override the workflow env names: __runId, tasks, mode,
|
|
141101
|
+
"Flags override the workflow env names: __runId, tasks, mode, spurBin."
|
|
141100
141102
|
].join(`
|
|
141101
|
-
`)).argument("<op>", `step: ${WRAPUP_OPS.join(" | ")}`).option("--run-id <id>", "workflow run id (env: __runId)").option("--tasks <json>", "JSON array of four-digit WBS strings (env: tasks)").option("--mode <mode>", "projected wrapup mode for route-reason (env: mode)").option("--
|
|
141103
|
+
`)).argument("<op>", `step: ${WRAPUP_OPS.join(" | ")}`).option("--run-id <id>", "workflow run id (env: __runId)").option("--tasks <json>", "JSON array of four-digit WBS strings (env: tasks)").option("--mode <mode>", "projected wrapup mode for route-reason (env: mode)").option("--spur-bin <cmd>", "spur invocation for nested lookups (env: spurBin; default: this spur)").action(async (op, options) => {
|
|
141102
141104
|
await Promise.resolve().then(() => init_pipeline_steps());
|
|
141103
141105
|
const env = { ...context.env };
|
|
141104
141106
|
const overrides = [
|
|
141105
141107
|
["__runId", options.runId],
|
|
141106
141108
|
["tasks", options.tasks],
|
|
141107
141109
|
["mode", options.mode],
|
|
141108
|
-
["feature", options.feature],
|
|
141109
|
-
["featureGateCmd", options.featureGateCmd],
|
|
141110
141110
|
["spurBin", options.spurBin]
|
|
141111
141111
|
];
|
|
141112
141112
|
for (const [key, value] of overrides)
|
|
@@ -141122,7 +141122,7 @@ function registerTaskWrapupCommand(task, context) {
|
|
|
141122
141122
|
return;
|
|
141123
141123
|
}
|
|
141124
141124
|
if (!isWrapupStepOp(op)) {
|
|
141125
|
-
context.output.error(`usage: spur task wrapup <${[...WRAPUP_STEP_OPS, "drift-probe"].join("|")}> (env: __runId, tasks, mode,
|
|
141125
|
+
context.output.error(`usage: spur task wrapup <${[...WRAPUP_STEP_OPS, "drift-probe"].join("|")}> (env: __runId, tasks, mode, spurBin)`);
|
|
141126
141126
|
context.setExitCode(2);
|
|
141127
141127
|
return;
|
|
141128
141128
|
}
|
|
@@ -141191,7 +141191,7 @@ async function resolveAgentServer(cwd, explicit, deps = {}) {
|
|
|
141191
141191
|
}
|
|
141192
141192
|
function ancestorDirs(cwd) {
|
|
141193
141193
|
const dirs = [];
|
|
141194
|
-
let current =
|
|
141194
|
+
let current = resolve29(cwd);
|
|
141195
141195
|
for (;; ) {
|
|
141196
141196
|
dirs.push(current);
|
|
141197
141197
|
const parent = dirname39(current);
|
|
@@ -143066,7 +143066,7 @@ async function publishPackage(target, opts = {}) {
|
|
|
143066
143066
|
init_src();
|
|
143067
143067
|
import { spawnSync as spawnSync7 } from "child_process";
|
|
143068
143068
|
import { existsSync as existsSync27, readFileSync as readFileSync24, writeFileSync as writeFileSync16 } from "fs";
|
|
143069
|
-
import { join as join84, resolve as
|
|
143069
|
+
import { join as join84, resolve as resolve30 } from "path";
|
|
143070
143070
|
function createSpawnRunner(context = {}) {
|
|
143071
143071
|
return (cmd) => {
|
|
143072
143072
|
const proc = spawnSync7(cmd[0] ?? "", [...cmd.slice(1)], {
|
|
@@ -143088,7 +143088,7 @@ function createRuntime(context) {
|
|
|
143088
143088
|
const baseDir = context.cwd ?? process.cwd();
|
|
143089
143089
|
return {
|
|
143090
143090
|
run: injectedRunner ?? createSpawnRunner(context),
|
|
143091
|
-
writeStatus: (file, content) => writeFileSync16(
|
|
143091
|
+
writeStatus: (file, content) => writeFileSync16(resolve30(baseDir, file), content)
|
|
143092
143092
|
};
|
|
143093
143093
|
}
|
|
143094
143094
|
function run3(rt, cmd) {
|
|
@@ -144780,7 +144780,7 @@ init_src3();
|
|
|
144780
144780
|
init_src();
|
|
144781
144781
|
init_src2();
|
|
144782
144782
|
init_dist7();
|
|
144783
|
-
import { resolve as
|
|
144783
|
+
import { resolve as resolve31 } from "path";
|
|
144784
144784
|
function registerDecisionCommand(program, context) {
|
|
144785
144785
|
const noun = program.command("decision").summary("decision catalog and maker surface (list, show, run, status)").description([
|
|
144786
144786
|
"Inspect and serve decision-catalog decisions across the three config",
|
|
@@ -144875,7 +144875,7 @@ function registerDecisionCommand(program, context) {
|
|
|
144875
144875
|
let evidence;
|
|
144876
144876
|
try {
|
|
144877
144877
|
if (options.evidence !== undefined && options.evidence.length > 0) {
|
|
144878
|
-
evidence = await readDecisionEvidence(options.evidence.map((file) =>
|
|
144878
|
+
evidence = await readDecisionEvidence(options.evidence.map((file) => resolve31(context.cwd, file)), async (path) => await context.fs.readFile(path));
|
|
144879
144879
|
}
|
|
144880
144880
|
if (prelude !== undefined) {
|
|
144881
144881
|
prelude.phases.push({
|
|
@@ -145159,7 +145159,8 @@ function registerFeatureVerifyCommand(feature, context) {
|
|
|
145159
145159
|
"Runs the selected feature-verification definition\u2019s command once (or --cmd) and writes the",
|
|
145160
145160
|
"run-scoped + feature-latest receipts and .spur/run/<runId>-feature-verification.status.",
|
|
145161
145161
|
"Exit: 0 after a completed pass (PASS or FAIL); 1 when the pass could not run.",
|
|
145162
|
-
"
|
|
145162
|
+
"Without --run-id the pass opens and finalizes its own feature-lifecycle run row.",
|
|
145163
|
+
"Flags fall back to the workflow env names: featureId, __runId."
|
|
145163
145164
|
].join(`
|
|
145164
145165
|
`)).argument("[id]", "Feature ID (env: featureId)").option("--run-id <id>", "workflow run id the receipt binds to (env: __runId)").option("--cmd <command>", "verification command override (env: verificationCmd)").action(async (id, options) => {
|
|
145165
145166
|
await Promise.resolve().then(() => init_src3());
|
|
@@ -145617,7 +145618,7 @@ import { createRequire as createRequire3 } from "module";
|
|
|
145617
145618
|
var CLI_CONFIG = {
|
|
145618
145619
|
binaryName: "spur",
|
|
145619
145620
|
binaryLabel: "spur",
|
|
145620
|
-
binaryVersion: "0.4.
|
|
145621
|
+
binaryVersion: "0.4.15",
|
|
145621
145622
|
configDir: ".spur",
|
|
145622
145623
|
configFile: ".spur/config.yaml",
|
|
145623
145624
|
databaseFile: ".spur/spur.db"
|
|
@@ -146161,7 +146162,7 @@ init_loader2();
|
|
|
146161
146162
|
init_src2();
|
|
146162
146163
|
init_dist11();
|
|
146163
146164
|
import { homedir as homedir16 } from "os";
|
|
146164
|
-
import { join as join89, resolve as
|
|
146165
|
+
import { join as join89, resolve as resolve33 } from "path";
|
|
146165
146166
|
|
|
146166
146167
|
// src/config/scaffold-manifest.ts
|
|
146167
146168
|
var SCAFFOLD_MANIFEST = [
|
|
@@ -146240,7 +146241,7 @@ If \`.spur/context/\` is absent, proceed normally. Never block work on its absen
|
|
|
146240
146241
|
`;
|
|
146241
146242
|
function globalRulesRoot(context) {
|
|
146242
146243
|
const override = context.env.SPUR_GLOBAL_RULES_DIR;
|
|
146243
|
-
return override !== undefined && override.length > 0 ?
|
|
146244
|
+
return override !== undefined && override.length > 0 ? resolve33(context.cwd, override) : join89(homedir16(), GLOBAL_RULES_DIR2);
|
|
146244
146245
|
}
|
|
146245
146246
|
async function writeIfNew(context, path, content, force, result) {
|
|
146246
146247
|
if (!force && await context.fs.exists(path)) {
|
|
@@ -146268,7 +146269,7 @@ async function seedGlobalRules(context) {
|
|
|
146268
146269
|
}
|
|
146269
146270
|
function resolveGlobalConfigDir(context) {
|
|
146270
146271
|
const globalOverride = context.env.SPUR_GLOBAL_RULES_DIR;
|
|
146271
|
-
return globalOverride !== undefined && globalOverride.length > 0 ?
|
|
146272
|
+
return globalOverride !== undefined && globalOverride.length > 0 ? resolve33(context.cwd, globalOverride) : join89(homedir16(), GLOBAL_CONFIG_DIR);
|
|
146272
146273
|
}
|
|
146273
146274
|
async function seedGlobalConfig(context) {
|
|
146274
146275
|
const source = bundledConfigRoot();
|
|
@@ -146954,7 +146955,7 @@ init_src3();
|
|
|
146954
146955
|
init_src();
|
|
146955
146956
|
init_src2();
|
|
146956
146957
|
init_dist5();
|
|
146957
|
-
import { dirname as dirname41, join as join91, resolve as
|
|
146958
|
+
import { dirname as dirname41, join as join91, resolve as resolve34 } from "path";
|
|
146958
146959
|
import { isatty as isatty4 } from "tty";
|
|
146959
146960
|
|
|
146960
146961
|
// ../../node_modules/.bun/@clack+core@1.4.1/node_modules/@clack/core/dist/index.mjs
|
|
@@ -147887,7 +147888,7 @@ class DefaultHitlResponder {
|
|
|
147887
147888
|
// src/context.ts
|
|
147888
147889
|
init_src3();
|
|
147889
147890
|
function createCliContext(options) {
|
|
147890
|
-
const cwd =
|
|
147891
|
+
const cwd = resolve34(options.cwd ?? process.cwd());
|
|
147891
147892
|
const env = options.env ?? getEnvVars();
|
|
147892
147893
|
const fs = createNodeFileSystem2(cwd);
|
|
147893
147894
|
const agentConfig = options.agentConfig ?? options.spurConfig?.agent;
|
|
@@ -148017,7 +148018,7 @@ function registerMigrateCommand(program, context, options = {}) {
|
|
|
148017
148018
|
init_src3();
|
|
148018
148019
|
init_src2();
|
|
148019
148020
|
init_dist5();
|
|
148020
|
-
import { basename as basename19, dirname as dirname42, join as join93, resolve as
|
|
148021
|
+
import { basename as basename19, dirname as dirname42, join as join93, resolve as resolve35 } from "path";
|
|
148021
148022
|
function registerProjectsCommand(program, context) {
|
|
148022
148023
|
const projectsCmd = program.command("projects").summary("manage the Spur multi-project registry");
|
|
148023
148024
|
projectsCmd.command("add").argument("<path>", "Project root directory path").option("--host <host>", 'Host for local or remote project (default: "localhost")').option(...SHARED_OPTIONS.nameProjectDisplay).option(...SHARED_OPTIONS.jsonProjectsResponse).option(...SHARED_OPTIONS.jsonEnvelope).action(async (pathArg, options) => {
|
|
@@ -148026,7 +148027,7 @@ function registerProjectsCommand(program, context) {
|
|
|
148026
148027
|
const isLocal = isLocalHost(host);
|
|
148027
148028
|
let absolutePath = pathArg;
|
|
148028
148029
|
if (isLocal) {
|
|
148029
|
-
absolutePath =
|
|
148030
|
+
absolutePath = resolve35(context.cwd, pathArg);
|
|
148030
148031
|
if (!await context.fs.exists(absolutePath)) {
|
|
148031
148032
|
throw new Error(`Directory does not exist: ${absolutePath}`);
|
|
148032
148033
|
}
|
|
@@ -148558,7 +148559,7 @@ function formatTraceDetail(detail) {
|
|
|
148558
148559
|
// src/commands/serve.ts
|
|
148559
148560
|
init_src();
|
|
148560
148561
|
import { statSync as statSync18 } from "fs";
|
|
148561
|
-
import { join as join98, resolve as
|
|
148562
|
+
import { join as join98, resolve as resolve38 } from "path";
|
|
148562
148563
|
|
|
148563
148564
|
// ../server/src/index.ts
|
|
148564
148565
|
init_src();
|
|
@@ -154855,7 +154856,7 @@ function mountMiddleware(app, appRt) {
|
|
|
154855
154856
|
|
|
154856
154857
|
// ../server/src/modules/board/index.ts
|
|
154857
154858
|
init_src3();
|
|
154858
|
-
import { resolve as
|
|
154859
|
+
import { resolve as resolve36 } from "path";
|
|
154859
154860
|
function resolvedOrUndefined(fs, path) {
|
|
154860
154861
|
try {
|
|
154861
154862
|
return fs.realPath?.(path);
|
|
@@ -154904,7 +154905,7 @@ async function serveModuleAsset(c, modules, fs) {
|
|
|
154904
154905
|
const declared = modules.roots.find((entry) => entry.id === split.id);
|
|
154905
154906
|
if (!declared)
|
|
154906
154907
|
return refusal(404, "Not Found");
|
|
154907
|
-
const target =
|
|
154908
|
+
const target = resolve36(declared.root, relative);
|
|
154908
154909
|
if (!isInsideRoot(declared.root, target))
|
|
154909
154910
|
return refusal(403, "Forbidden path");
|
|
154910
154911
|
if (!(await fs.stat(target))?.isFile())
|
|
@@ -155426,9 +155427,9 @@ init_loader2();
|
|
|
155426
155427
|
init_src2();
|
|
155427
155428
|
init_dist5();
|
|
155428
155429
|
import { homedir as homedir17 } from "os";
|
|
155429
|
-
import { basename as basename20, join as join94, relative as relative19, resolve as
|
|
155430
|
+
import { basename as basename20, join as join94, relative as relative19, resolve as resolve37 } from "path";
|
|
155430
155431
|
// ../server/package.json
|
|
155431
|
-
var version3 = "0.4.
|
|
155432
|
+
var version3 = "0.4.15";
|
|
155432
155433
|
|
|
155433
155434
|
// ../server/src/modules/health/index.ts
|
|
155434
155435
|
var startedAt = Date.now();
|
|
@@ -155966,7 +155967,7 @@ var healthModule = {
|
|
|
155966
155967
|
const fs = ctx.fs ?? createNodeFileSystem2(ctx.cwd);
|
|
155967
155968
|
for (const entry of listResult.entries) {
|
|
155968
155969
|
const layer = listResult.layers.find((l) => l.id === entry.source);
|
|
155969
|
-
const fullPath = layer ?
|
|
155970
|
+
const fullPath = layer ? resolve37(layer.path, entry.path) : entry.path;
|
|
155970
155971
|
let rawYaml = "";
|
|
155971
155972
|
let mermaidDiagram = "";
|
|
155972
155973
|
let isValid = entry.valid;
|
|
@@ -159962,7 +159963,7 @@ function resolveServeDbUrl(cwd, env, configuredUrl) {
|
|
|
159962
159963
|
return env.DATABASE_URL === undefined ? join98(cwd, DEFAULT_DATABASE_URL) : configuredUrl;
|
|
159963
159964
|
}
|
|
159964
159965
|
function resolveServeCwd(cwd) {
|
|
159965
|
-
const resolved =
|
|
159966
|
+
const resolved = resolve38(cwd);
|
|
159966
159967
|
let isDirectory = false;
|
|
159967
159968
|
try {
|
|
159968
159969
|
isDirectory = statSync18(resolved).isDirectory();
|
|
@@ -161311,7 +161312,7 @@ init_src3();
|
|
|
161311
161312
|
// ../../packages/app/src/workflow/persist-check.ts
|
|
161312
161313
|
init_dist5();
|
|
161313
161314
|
import { existsSync as existsSync32, readdirSync as readdirSync16, readFileSync as readFileSync29, statSync as statSync19 } from "fs";
|
|
161314
|
-
import { basename as basename22, dirname as dirname45, isAbsolute as isAbsolute17, join as join103, relative as relative20, resolve as
|
|
161315
|
+
import { basename as basename22, dirname as dirname45, isAbsolute as isAbsolute17, join as join103, relative as relative20, resolve as resolve39 } from "path";
|
|
161315
161316
|
var EVIDENCE_DIR = join103(".spur", "memory", "evidence");
|
|
161316
161317
|
var RUN_DIR = join103(".spur", "run");
|
|
161317
161318
|
var NAMED_CAP = 32;
|
|
@@ -161437,13 +161438,13 @@ function runPersistCheck(input) {
|
|
|
161437
161438
|
const runIds = (input.runIds ?? []).filter(Boolean);
|
|
161438
161439
|
if (wbsList.length === 0 && runIds.length === 0)
|
|
161439
161440
|
return usage("at least one --task-file or --run-id required");
|
|
161440
|
-
const wtRoot = input.from === "" ? "" :
|
|
161441
|
+
const wtRoot = input.from === "" ? "" : resolve39(input.cwd, input.from);
|
|
161441
161442
|
if (!wtRoot || !existsSync32(wtRoot) || !statSync19(wtRoot).isDirectory()) {
|
|
161442
161443
|
return usage("--from must be an existing directory");
|
|
161443
161444
|
}
|
|
161444
|
-
const invokeRoot = input.root === undefined ? defaultInvokeRoot(input.cwd) :
|
|
161445
|
+
const invokeRoot = input.root === undefined ? defaultInvokeRoot(input.cwd) : resolve39(input.cwd, input.root);
|
|
161445
161446
|
const { foreignDivergent, skips } = readPersistOutSkips([
|
|
161446
|
-
input.successJson === undefined || input.successJson === "" ? "" :
|
|
161447
|
+
input.successJson === undefined || input.successJson === "" ? "" : resolve39(input.cwd, input.successJson),
|
|
161447
161448
|
join103(invokeRoot, ".spur", "run", "persist-out.json"),
|
|
161448
161449
|
join103(wtRoot, ".spur", "run", "persist-out.json")
|
|
161449
161450
|
].filter(Boolean));
|