@acsetra/runner 0.1.71 → 0.1.73
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/bin/runner.js +12 -5
- package/lib/config.js +8 -0
- package/lib/help.js +6 -2
- package/package.json +1 -1
package/bin/runner.js
CHANGED
|
@@ -56,8 +56,11 @@ async function signin(rest) {
|
|
|
56
56
|
const cred = config.loadUser();
|
|
57
57
|
Object.assign(cred, { api_base: base, token: body.token, workspace: body.workspace, scope_root: body.scope_root });
|
|
58
58
|
config.saveUser(cred);
|
|
59
|
-
config
|
|
60
|
-
|
|
59
|
+
// The project config records only the API base — it never points at an org
|
|
60
|
+
// or an app. The token's home workspace lives in the user store (bare-leaf
|
|
61
|
+
// default); every command names its target by full scope path <org>.<app>.
|
|
62
|
+
config.setProject({ api_base: base });
|
|
63
|
+
console.error(`\n✓ Signed in (home org: ${body.workspace}). Work in any org you can edit — address apps as <org>.<app>; \`r whoami\` lists your orgs.`);
|
|
61
64
|
return 0;
|
|
62
65
|
}
|
|
63
66
|
if (body.status === "denied") { console.error("\n✗ Sign-in denied."); return 1; }
|
|
@@ -83,7 +86,10 @@ async function docsPull(rest) {
|
|
|
83
86
|
}
|
|
84
87
|
const removed = removeManagedDocs(pack);
|
|
85
88
|
for (const rel of removed) console.error(" removed " + rel);
|
|
86
|
-
|
|
89
|
+
// Only the pack version is recorded: the pack points at no org/app, and neither does this
|
|
90
|
+
// project — an older signin's `default_scope` (the "current app" pointer) is scrubbed.
|
|
91
|
+
config.setProject({ context_version: pack.version });
|
|
92
|
+
if (config.clearProject("default_scope").length) console.error(" cleared default_scope from .runner/config.json — name every target as <org>.<app>");
|
|
87
93
|
console.error(`docs: wrote ${n} files, removed ${removed.length} stale files (version ${pack.version})`);
|
|
88
94
|
return 0;
|
|
89
95
|
}
|
|
@@ -154,7 +160,7 @@ async function main() {
|
|
|
154
160
|
const argv = process.argv.slice(2);
|
|
155
161
|
if (!argv.length || ["-h", "--help"].includes(argv[0])) { console.log(renderTop()); return 0; }
|
|
156
162
|
const [cmd, ...rest] = argv;
|
|
157
|
-
if (["version", "--version", "-V"].includes(cmd)) { console.log("runner (@acsetra/runner) 0.1.
|
|
163
|
+
if (["version", "--version", "-V"].includes(cmd)) { console.log("runner (@acsetra/runner) 0.1.73"); return 0; }
|
|
158
164
|
|
|
159
165
|
// help — top-level, `help <topic>`, and per-verb `<cmd> … --help` (lexical, before toOp)
|
|
160
166
|
if (cmd === "help") {
|
|
@@ -167,7 +173,8 @@ async function main() {
|
|
|
167
173
|
}
|
|
168
174
|
if (cmd === "signin" || cmd === "login") return signin(rest);
|
|
169
175
|
if (cmd === "logout" || cmd === "signout") { const c = config.loadUser(); delete c.token; config.saveUser(c); console.error("logged out"); return 0; }
|
|
170
|
-
|
|
176
|
+
// Optional: the HOME org bare-leaf scopes resolve against; full <org>.<app> paths route to their own org regardless.
|
|
177
|
+
if (cmd === "use") { if (!rest[0]) return fail("usage: runner use <org-slug> (home org for bare-leaf scopes; full <org>.<app> paths need no `use`)"); config.setProject({ workspace: rest[0] }); console.error("home org -> " + rest[0] + " (bare-leaf default only)"); return 0; }
|
|
171
178
|
if (cmd === "dev") return dev(rest);
|
|
172
179
|
if (cmd === "docs") { if (rest[0] === "pull") return docsPull(rest); return fail("usage: runner docs pull [-S scope]"); }
|
|
173
180
|
if (cmd === "checkout" || cmd === "co") return checkout(rest);
|
package/lib/config.js
CHANGED
|
@@ -33,6 +33,14 @@ export function setProject(kv) {
|
|
|
33
33
|
return cfg;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
// Drop keys from the project config; returns the keys that were present.
|
|
37
|
+
export function clearProject(...keys) {
|
|
38
|
+
const cfg = loadProject();
|
|
39
|
+
const gone = keys.filter((k) => k in cfg);
|
|
40
|
+
if (gone.length) { for (const k of gone) delete cfg[k]; saveProject(cfg); }
|
|
41
|
+
return gone;
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
export const apiBase = () =>
|
|
37
45
|
(process.env.ACSETRA_API_BASE || loadProject().api_base || loadUser().api_base || DEFAULT_API_BASE).replace(/\/$/, "");
|
|
38
46
|
export const token = () => process.env.ACSETRA_TOKEN || loadUser().token;
|
package/lib/help.js
CHANGED
|
@@ -98,9 +98,13 @@ export function renderVerb(verb) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
export function renderTop() {
|
|
101
|
-
const out = [`${PROG} — author and run hosted Runner apps. (also installed as \`runner\`, \`acsetra\`)`, ""
|
|
101
|
+
const out = [`${PROG} — author and run hosted Runner apps. (also installed as \`runner\`, \`acsetra\`)`, "",
|
|
102
|
+
"Address every app by its full scope path <org>.<app>: the first segment names the org",
|
|
103
|
+
"and routes the command there. You may author in any org you hold EDIT share access",
|
|
104
|
+
"to (Runner Command → Share); `r whoami` lists your orgs and access.", ""];
|
|
102
105
|
out.push("Session",
|
|
103
|
-
" r signin / whoami / workspaces /
|
|
106
|
+
" r signin / whoami / workspaces / logout / usage / tokens",
|
|
107
|
+
" r use <slug> optional home org for bare-leaf scopes (full paths need none)",
|
|
104
108
|
" r docs pull refresh CLAUDE.md + .runner/docs/*",
|
|
105
109
|
" r dev <app> open your app's hosted surface in the browser",
|
|
106
110
|
" r open / focus <scope> paired Chrome scope navigation",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acsetra/runner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.73",
|
|
4
4
|
"description": "Runner CLI — author and run hosted Runner apps from your terminal (the `runner` command).",
|
|
5
5
|
"keywords": ["runner", "acsetra", "cli", "agent", "low-code"],
|
|
6
6
|
"license": "MIT",
|