foldrun 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/bin/foldrun.mjs +18 -4
- package/package.json +10 -4
- package/src/commands.mjs +731 -116
- package/src/credentials.mjs +137 -30
package/README.md
CHANGED
|
@@ -107,6 +107,7 @@ declared the same way.
|
|
|
107
107
|
| `foldrun open [page]` | the dashboard for this workspace, in the browser |
|
|
108
108
|
| `foldrun login` | sign this machine in from the browser — no key to copy |
|
|
109
109
|
| `foldrun whoami` | who you are on the platform: account, role, workspaces |
|
|
110
|
+
| `foldrun doctor` | check the path to the platform: node, CLI, account, DNS, a timed `/api/healthz` — exit 1 if any line fails |
|
|
110
111
|
| `foldrun keys ls` | the account's API keys — also `create <label>`, `revoke <id>` |
|
|
111
112
|
|
|
112
113
|
`foldrun --help` lists every flag.
|
package/bin/foldrun.mjs
CHANGED
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
// foldrun secrets <verb> set / ls / rm — the vault, from the terminal
|
|
16
16
|
// foldrun deploy [dir] push a workspace into an installation
|
|
17
17
|
// foldrun invoke <flow> start a flow on a running platform
|
|
18
|
+
// foldrun source <verb> ls / cat / put / mv / rm one workspace file on a platform
|
|
18
19
|
// foldrun open [page] the dashboard for this workspace
|
|
19
20
|
// foldrun login sign this machine in from the browser
|
|
20
21
|
// foldrun whoami who the platform thinks this terminal is
|
|
22
|
+
// foldrun doctor what is between this terminal and the platform, checked
|
|
23
|
+
// foldrun accounts every account signed in here; `use <name>` switches
|
|
21
24
|
// foldrun keys <verb> ls / create / revoke — the account's API keys
|
|
22
25
|
//
|
|
23
26
|
// `check` is the one to run in CI: it catches the mistakes that otherwise only
|
|
@@ -45,16 +48,20 @@ const HELP = `foldrun — agents are just folders
|
|
|
45
48
|
foldrun eval [name] run one eval, or all of them
|
|
46
49
|
foldrun probe <model> live check: can this model hold a tool loop here?
|
|
47
50
|
foldrun logs [run-id] recent runs, or one run's full event trail
|
|
48
|
-
foldrun secrets set NAME store a secret (prompted, never echoed) — also ls, rm
|
|
51
|
+
foldrun secrets set NAME store a secret (prompted, never echoed) — also ls, rm, status
|
|
49
52
|
foldrun connect NAME OAuth sign-in from the terminal, stored as an auto-refreshing secret
|
|
50
53
|
foldrun deploy [dir] push a workspace into an installation
|
|
51
54
|
foldrun invoke <flow> start a flow on a running platform (--to <workspace>)
|
|
55
|
+
foldrun source <verb> the files on a platform, one at a time: ls, cat <path>, put <path>, mv, rm (--to <workspace>)
|
|
52
56
|
foldrun open [page] the dashboard for this workspace, in the browser
|
|
53
57
|
|
|
54
58
|
Signing in
|
|
55
59
|
foldrun login sign this machine in from the browser (--token <key> to skip it)
|
|
56
60
|
foldrun logout forget this machine's key, and revoke it where allowed
|
|
57
61
|
foldrun whoami who you are on the platform: account, role, workspaces
|
|
62
|
+
foldrun doctor check the path to the platform: node, CLI, account, DNS, a timed /api/healthz
|
|
63
|
+
foldrun accounts every account signed in on this machine, and which one is active
|
|
64
|
+
foldrun use <name> act as one of them from here on
|
|
58
65
|
foldrun keys ls the account's API keys — also create <label>, revoke <id>
|
|
59
66
|
foldrun --help
|
|
60
67
|
|
|
@@ -62,8 +69,11 @@ Options
|
|
|
62
69
|
--workspace <dir> the workspace folder (default: .)
|
|
63
70
|
--from <template> start from a shipped template, e.g. templates/hello
|
|
64
71
|
--task "<text>" the instruction for a manual run
|
|
72
|
+
--test run, invoke: a test run — nothing outward, state/ untouched, receipts on the run page
|
|
65
73
|
--follow logs: keep tailing a live run (with --url: on the platform)
|
|
66
74
|
--value "<text>" secrets set: skip the prompt (careful with shell history)
|
|
75
|
+
--file <path> source put: the local file to send (default: stdin)
|
|
76
|
+
--message "<why>" source put: recorded on the file's revision
|
|
67
77
|
--account secrets: account scope instead of the workspace's
|
|
68
78
|
--wait invoke: hold on and print the result
|
|
69
79
|
--watch invoke: follow the run's trace here as it happens
|
|
@@ -84,6 +94,8 @@ Platform options (deploy, invoke, secrets, logs, keys)
|
|
|
84
94
|
--data <dir> the installation's data directory
|
|
85
95
|
--url <url> a running platform (or FOLDRUN_URL, or where you last signed in)
|
|
86
96
|
--token <key> API key for --url (or FOLDRUN_TOKEN, or the one from foldrun login)
|
|
97
|
+
FOLDRUN_TIMEOUT=<s> seconds one request to the platform may take (default 30)
|
|
98
|
+
--profile <name> act as one stored account for this command (see foldrun accounts)
|
|
87
99
|
--local deploy: into the installation on this machine, even when signed in
|
|
88
100
|
--commit <sha> deploy: record which commit this is
|
|
89
101
|
--dry-run deploy: check and report, change nothing
|
|
@@ -103,7 +115,7 @@ if (!command || command === "--help" || command === "-h") {
|
|
|
103
115
|
// `--value` as the account's argument and stored an empty secret; `--force
|
|
104
116
|
// ./dir` swallowed the directory. A flag followed by another flag is also
|
|
105
117
|
// boolean, so an unlisted switch at least does not eat its neighbour.
|
|
106
|
-
const BOOLEAN_FLAGS = new Set(["account", "follow", "force", "oauth2", "wait", "watch", "print", "dry-run", "help", "no-browser", "local"]);
|
|
118
|
+
const BOOLEAN_FLAGS = new Set(["account", "follow", "force", "oauth2", "wait", "watch", "print", "dry-run", "help", "no-browser", "local", "test"]);
|
|
107
119
|
const flags = {};
|
|
108
120
|
const positional = [];
|
|
109
121
|
for (let i = 0; i < rest.length; i++) {
|
|
@@ -154,12 +166,14 @@ if (isDeploy) {
|
|
|
154
166
|
process.env.FOLDRUN_DATA ??= installationRoot ?? path.join(workspace, ".foldrun");
|
|
155
167
|
}
|
|
156
168
|
|
|
157
|
-
const { run } = await import(path.join(HERE, "../src/commands.mjs"));
|
|
169
|
+
const { run, explain } = await import(path.join(HERE, "../src/commands.mjs"));
|
|
158
170
|
|
|
159
171
|
try {
|
|
160
172
|
const code = await run(command, positional, flags, workspace);
|
|
161
173
|
process.exit(code ?? 0);
|
|
162
174
|
} catch (err) {
|
|
163
|
-
|
|
175
|
+
// The whole chain, not the top: "fetch failed" is the top, and the
|
|
176
|
+
// ECONNREFUSED underneath it is the part that says what to do.
|
|
177
|
+
console.error(`\n ${explain(err)}\n`);
|
|
164
178
|
process.exit(1);
|
|
165
179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foldrun",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Agents are just folders. Write them, check them, run them — on your machine.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"node": ">=22"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@foldrun/core": "^0.
|
|
14
|
+
"@foldrun/core": "^0.4.0"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"bin",
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
22
|
"e2e": "FOLDRUN_E2E=1 FOLDRUN_DATA=$(mktemp -d /tmp/foldrun-e2e-XXXXXX) node --test --test-timeout=300000 tests/e2e.test.ts",
|
|
23
|
-
"test": "FOLDRUN_DATA=$(mktemp -d /tmp/foldrun-test-XXXXXX) node --test tests/cli-secrets.test.ts tests/cli-check-library.test.ts tests/cli-connect.test.ts",
|
|
24
|
-
"release": "node scripts/release.mjs"
|
|
23
|
+
"test": "FOLDRUN_DATA=$(mktemp -d /tmp/foldrun-test-XXXXXX) node --test tests/cli-secrets.test.ts tests/cli-check-library.test.ts tests/cli-connect.test.ts tests/cli-accounts.test.ts tests/cli-remote.test.ts tests/cli-stream.test.ts tests/cli-doctor.test.ts",
|
|
24
|
+
"release": "node scripts/release.mjs",
|
|
25
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
25
26
|
},
|
|
26
27
|
"repository": {
|
|
27
28
|
"type": "git",
|
|
@@ -40,5 +41,10 @@
|
|
|
40
41
|
],
|
|
41
42
|
"publishConfig": {
|
|
42
43
|
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^22.20.2",
|
|
47
|
+
"gray-matter": "^4.0.3",
|
|
48
|
+
"typescript": "^5.9.3"
|
|
43
49
|
}
|
|
44
50
|
}
|