@cleanslop/cli 0.1.0-beta.19 → 0.1.0-beta.20
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/assets/skill-core.md +4 -4
- package/dist/config.d.ts +2 -2
- package/dist/config.js +1 -1
- package/dist/connect.d.ts +1 -1
- package/dist/connect.js +27 -14
- package/dist/connect.js.map +1 -1
- package/package.json +1 -1
package/assets/skill-core.md
CHANGED
|
@@ -4,7 +4,7 @@ Run a CleanSlop readiness scan at milestones (before claiming work is done, befo
|
|
|
4
4
|
|
|
5
5
|
## Git preconditions
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Just run `cleanslop scan`. Do not check git state first or tell the human a commit or push may be needed: the CLI picks the source and asks when the human must choose. A clean pushed github.com commit is scanned from GitHub. Otherwise, when `/me` reports `uploads: true` (Link) or `uploadFallback: true` (GitHub), it uploads the local files: a folder with no commits or no GitHub origin uploads at once, and uncommitted or unpushed changes ask `push_or_upload` ("Scan local files" reruns with `--upload`; "I pushed" reruns as is). A `github_install` question also offers "Scan local files". Do not commit, push, stash, or rewrite history yourself.
|
|
8
8
|
|
|
9
9
|
## Transport
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ Use MCP if it is registered (`<origin>/mcp`); otherwise the CLI. Run it as `npx
|
|
|
12
12
|
|
|
13
13
|
## Connect
|
|
14
14
|
|
|
15
|
-
If the human already said how to connect (Link or GitHub), use that. Otherwise, when a command says this machine is not connected and asks how to connect (`connect_method`), ask the human with exactly its options
|
|
15
|
+
If the human already said how to connect (Link or GitHub), use that. Otherwise, when a command says this machine is not connected and asks how to connect (`connect_method`), ask the human with exactly its options (Stripe Link, recommended, or GitHub).
|
|
16
16
|
|
|
17
17
|
Run Link and login commands in the foreground with `--no-wait`. When one prints an `approve` block, ask its Done / Not now question (it repeats the link and code). On Done, rerun the same command with `--resume` instead of `--no-wait`; on Not now, stop. Never ask the human to type “done”.
|
|
18
18
|
|
|
@@ -61,11 +61,11 @@ When `review` is `unavailable`, the findings are unreviewed first-pass results (
|
|
|
61
61
|
|
|
62
62
|
## Fix loop
|
|
63
63
|
|
|
64
|
-
Fix by priority, run the repo’s tests, ask the human about `needs_input`,
|
|
64
|
+
Fix by priority, run the repo’s tests, ask the human about `needs_input`, rescan **once** (the CLI asks whether to upload the local files or have the human push first), and compare the delta (`new` / `still_open` / `resolved` / `no_longer_listed`). `no_longer_listed` means the review stopped listing the finding — it is not a confirmed fix.
|
|
65
65
|
|
|
66
66
|
## Stop conditions
|
|
67
67
|
|
|
68
|
-
Stop when all listed issues are resolved; the same fingerprints are still open after one rescan; the account is out of scans and the human does not buy more (or none can be bought); the human declines; or the
|
|
68
|
+
Stop when all listed issues are resolved; the same fingerprints are still open after one rescan; the account is out of scans and the human does not buy more (or none can be bought); the human declines; or the code has not changed.
|
|
69
69
|
|
|
70
70
|
## Report back
|
|
71
71
|
|
package/dist/config.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const PACKAGE_NAME = "@cleanslop/cli";
|
|
2
|
-
export declare const PACKAGE_VERSION = "0.1.0-beta.
|
|
2
|
+
export declare const PACKAGE_VERSION = "0.1.0-beta.20";
|
|
3
3
|
export declare const CLIENT_ID = "cleanslop-cli";
|
|
4
4
|
export declare const DEFAULT_ORIGIN = "https://cleanslop.com";
|
|
5
5
|
export declare const DEFAULT_WAIT_MS: number;
|
|
6
6
|
export declare const MIN_POLL_MS = 3000;
|
|
7
7
|
export declare const LONGPOLL_MAX_SEC = 45;
|
|
8
8
|
export declare const DEVICE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
9
|
-
export declare const USER_AGENT = "cleanslop-cli/0.1.0-beta.
|
|
9
|
+
export declare const USER_AGENT = "cleanslop-cli/0.1.0-beta.20";
|
|
10
10
|
export declare const CREDENTIALS_FILE = "credentials.json";
|
|
11
11
|
export declare const PENDING_LOGIN_FILE = "pending-login.json";
|
|
12
12
|
export declare const PENDING_SPEND_FILE = "pending-spend-request.json";
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const PACKAGE_NAME = "@cleanslop/cli";
|
|
2
|
-
export const PACKAGE_VERSION = "0.1.0-beta.
|
|
2
|
+
export const PACKAGE_VERSION = "0.1.0-beta.20";
|
|
3
3
|
export const CLIENT_ID = "cleanslop-cli";
|
|
4
4
|
export const DEFAULT_ORIGIN = "https://cleanslop.com";
|
|
5
5
|
export const DEFAULT_WAIT_MS = 8 * 60 * 1000;
|
package/dist/connect.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { CliDeps } from "./deps.js";
|
|
|
2
2
|
import { CliError, type ActionQuestion, type NotConnectedError } from "./exit.js";
|
|
3
3
|
export declare const LINK_LOGIN_COMMAND = "cleanslop login --link --no-wait";
|
|
4
4
|
export declare const GITHUB_LOGIN_COMMAND = "cleanslop login --no-wait";
|
|
5
|
-
export declare function connectQuestion(github: boolean): ActionQuestion;
|
|
5
|
+
export declare function connectQuestion(github: boolean, githubUploads?: boolean): ActionQuestion;
|
|
6
6
|
/**
|
|
7
7
|
* Not connected: ask Link (recommended) or GitHub when the server offers
|
|
8
8
|
* both; otherwise, or if the server cannot say, keep the plain login block.
|
package/dist/connect.js
CHANGED
|
@@ -4,25 +4,39 @@ import { asRecord, httpRequest } from "./http.js";
|
|
|
4
4
|
export const LINK_LOGIN_COMMAND = "cleanslop login --link --no-wait";
|
|
5
5
|
export const GITHUB_LOGIN_COMMAND = "cleanslop login --no-wait";
|
|
6
6
|
const LINK_DESCRIPTION = "Scan this folder as is, no GitHub needed. Needs a Link account; US and Canada only.";
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The server lists both methods only while `AGENT_CONNECT_CHOICE=ask` and Link
|
|
9
|
+
* sign-up is public. `githubUploads`: a GitHub sign-in can also upload local files.
|
|
10
|
+
*/
|
|
11
|
+
async function offeredMethods(deps, origin) {
|
|
9
12
|
try {
|
|
10
13
|
const result = await httpRequest(deps, origin, "GET", "/api/agent/v1/connect");
|
|
11
14
|
if (result.status !== 200)
|
|
12
|
-
return false;
|
|
15
|
+
return { both: false, githubUploads: false };
|
|
13
16
|
const methods = asRecord(result.json)?.methods;
|
|
14
|
-
const
|
|
15
|
-
|
|
17
|
+
const list = Array.isArray(methods) ? methods.map((m) => asRecord(m)) : [];
|
|
18
|
+
const github = list.find((m) => m?.kind === "github");
|
|
19
|
+
return {
|
|
20
|
+
both: Boolean(github) && list.some((m) => m?.kind === "stripe_link"),
|
|
21
|
+
githubUploads: github?.uploads === true,
|
|
22
|
+
};
|
|
16
23
|
}
|
|
17
24
|
catch {
|
|
18
|
-
return false;
|
|
25
|
+
return { both: false, githubUploads: false };
|
|
19
26
|
}
|
|
20
27
|
}
|
|
21
28
|
async function onGithub(deps) {
|
|
22
29
|
const remote = await deps.git(["remote", "get-url", "origin"], deps.env.cwd());
|
|
23
30
|
return remote.ok && parseGithubRemote(remote.stdout.trim()) !== null;
|
|
24
31
|
}
|
|
25
|
-
|
|
32
|
+
function githubDescription(onGithub, uploads) {
|
|
33
|
+
if (onGithub)
|
|
34
|
+
return "Your code is on GitHub. Sign in with GitHub.";
|
|
35
|
+
return uploads
|
|
36
|
+
? "Sign in with GitHub. This folder isn't on GitHub, so CleanSlop uploads its files."
|
|
37
|
+
: "This folder isn't on GitHub yet; you'd need to push it first.";
|
|
38
|
+
}
|
|
39
|
+
export function connectQuestion(github, githubUploads = false) {
|
|
26
40
|
return {
|
|
27
41
|
id: "connect_method",
|
|
28
42
|
header: "Connect",
|
|
@@ -37,9 +51,7 @@ export function connectQuestion(github) {
|
|
|
37
51
|
{
|
|
38
52
|
value: "github",
|
|
39
53
|
label: "GitHub",
|
|
40
|
-
description: github
|
|
41
|
-
? "Your code is on GitHub. Sign in with GitHub."
|
|
42
|
-
: "This folder isn't on GitHub yet; you'd need to push it first.",
|
|
54
|
+
description: githubDescription(github, githubUploads),
|
|
43
55
|
run: GITHUB_LOGIN_COMMAND,
|
|
44
56
|
},
|
|
45
57
|
],
|
|
@@ -50,12 +62,13 @@ export function connectQuestion(github) {
|
|
|
50
62
|
* both; otherwise, or if the server cannot say, keep the plain login block.
|
|
51
63
|
*/
|
|
52
64
|
export async function withConnectChoice(deps, err) {
|
|
53
|
-
|
|
65
|
+
const offered = await offeredMethods(deps, err.origin);
|
|
66
|
+
if (!offered.both)
|
|
54
67
|
return err;
|
|
55
68
|
return new CliError(err.message, EXIT_ACTION, {
|
|
56
69
|
kind: "ask_human",
|
|
57
70
|
humanPrompt: `This machine isn't connected to CleanSlop yet. Ask the human how to connect: Stripe Link (recommended; ${LINK_DESCRIPTION}) runs \`${LINK_LOGIN_COMMAND}\`; GitHub runs \`${GITHUB_LOGIN_COMMAND}\`. If they already said which, use that without asking.`,
|
|
58
|
-
question: connectQuestion(await onGithub(deps)),
|
|
71
|
+
question: connectQuestion(await onGithub(deps), offered.githubUploads),
|
|
59
72
|
});
|
|
60
73
|
}
|
|
61
74
|
/**
|
|
@@ -67,7 +80,7 @@ export function offerGithubAfterLinkFailure(err) {
|
|
|
67
80
|
throw err;
|
|
68
81
|
throw new CliError(err.message, err.exitCode, {
|
|
69
82
|
kind: "ask_human",
|
|
70
|
-
humanPrompt: `Link sign-in failed (the error is below). If Link isn't available to the human (Link sign-up is US and Canada only), connect with GitHub instead: run \`${GITHUB_LOGIN_COMMAND}
|
|
83
|
+
humanPrompt: `Link sign-in failed (the error is below). If Link isn't available to the human (Link sign-up is US and Canada only), connect with GitHub instead: run \`${GITHUB_LOGIN_COMMAND}\`.`,
|
|
71
84
|
question: {
|
|
72
85
|
id: "link_failed",
|
|
73
86
|
header: "Connect",
|
|
@@ -76,7 +89,7 @@ export function offerGithubAfterLinkFailure(err) {
|
|
|
76
89
|
{
|
|
77
90
|
value: "github",
|
|
78
91
|
label: "Use GitHub",
|
|
79
|
-
description: "
|
|
92
|
+
description: "Sign in with GitHub instead",
|
|
80
93
|
run: GITHUB_LOGIN_COMMAND,
|
|
81
94
|
},
|
|
82
95
|
{ value: "retry", label: "Try Link again", run: LINK_LOGIN_COMMAND },
|
package/dist/connect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAA+C,MAAM,WAAW,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAG,kCAAkC,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAEhE,MAAM,gBAAgB,GACpB,qFAAqF,CAAC;AAExF
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAA+C,MAAM,WAAW,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAG,kCAAkC,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAEhE,MAAM,gBAAgB,GACpB,qFAAqF,CAAC;AAExF;;;GAGG;AACH,KAAK,UAAU,cAAc,CAC3B,IAAa,EACb,MAAc;IAEd,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC;QAC/E,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG;YAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QACxE,MAAM,OAAO,GAAG,QAAQ,CA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