@agentic-surfaces/cli 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +19 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import { readFileSync, readdirSync } from "node:fs";
|
|
2
|
-
import { join, dirname } from "node:path";
|
|
2
|
+
import { join, dirname, resolve } from "node:path";
|
|
3
3
|
import { loadWorkflow, runWorkflowOnce, Scheduler, loadProjectConfig, buildWorkflowRunner, defaultRegistry } from "@agentic-surfaces/core";
|
|
4
4
|
import { buildServices } from "./services.js";
|
|
5
|
+
// Walk up from a starting dir to find agentic-surfaces.config.yaml. run-once
|
|
6
|
+
// is pointed at a workflow file (e.g. <proj>/workflows/foo.yaml), but the
|
|
7
|
+
// project config — including the dryRun safety flag — lives at the project
|
|
8
|
+
// root (<proj>/). Without this, dryRun would default to false and a one-shot
|
|
9
|
+
// run could perform live writes. SAFETY-CRITICAL: do not remove.
|
|
10
|
+
function findProjectConfig(startDir) {
|
|
11
|
+
let dir = resolve(startDir);
|
|
12
|
+
for (;;) {
|
|
13
|
+
const pc = loadProjectConfig(dir);
|
|
14
|
+
if (pc)
|
|
15
|
+
return pc;
|
|
16
|
+
const parent = dirname(dir);
|
|
17
|
+
if (parent === dir)
|
|
18
|
+
return undefined;
|
|
19
|
+
dir = parent;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
5
22
|
export async function run(argv) {
|
|
6
23
|
const [cmd, ...rest] = argv;
|
|
7
24
|
try {
|
|
@@ -17,7 +34,7 @@ export async function run(argv) {
|
|
|
17
34
|
return 1;
|
|
18
35
|
}
|
|
19
36
|
const fake = rest.includes("--fake");
|
|
20
|
-
const pc =
|
|
37
|
+
const pc = findProjectConfig(dirname(file));
|
|
21
38
|
const wf = loadWorkflow(readFileSync(file, "utf8"));
|
|
22
39
|
const services = buildServices(fake ? { fakeAgent: [{ text: "fake reply" }], projectConfig: pc } : { projectConfig: pc });
|
|
23
40
|
const dir = dirname(file);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentic-surfaces/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@agentic-surfaces/
|
|
25
|
-
"@agentic-surfaces/
|
|
24
|
+
"@agentic-surfaces/agent": "0.1.3",
|
|
25
|
+
"@agentic-surfaces/core": "0.1.3"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsc -b",
|