shakers-cli 0.16.0 → 0.18.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 +21 -6
- package/bin/ai-usage.js +31 -12
- package/bin/command-audit-worker.js +19 -0
- package/bin/login.js +4 -8
- package/bin/mcp.js +32 -21
- package/bin/register.js +12 -30
- package/bin/shakers-cli.js +15 -10
- package/package.json +1 -1
- package/src/account-marker.js +40 -0
- package/src/account-trace.js +23 -0
- package/src/agents-client.js +1 -0
- package/src/ai-usage-review.js +103 -0
- package/src/auth-client.js +7 -107
- package/src/auth-session-store.js +12 -11
- package/src/backend-request.js +3 -24
- package/src/cli-skill.js +77 -0
- package/src/command-audit.js +47 -4
- package/src/config.js +2 -16
- package/src/consent-flow.js +9 -3
- package/src/detect-repos.js +4 -8
- package/src/detectors.js +23 -0
- package/src/device-auth-store.js +2 -2
- package/src/device-login.js +11 -9
- package/src/env-paths.js +9 -1
- package/src/i18n.js +186 -102
- package/src/mcp-ai-usage-result-tool.js +38 -14
- package/src/mcp-ai-usage-tool.js +317 -172
- package/src/mcp-choice.js +171 -34
- package/src/mcp-detector.js +26 -2
- package/src/mcp-device-login-tools.js +40 -8
- package/src/mcp-install.js +292 -53
- package/src/mcp-instructions.js +43 -17
- package/src/mcp-onboarding-tools.js +1 -3
- package/src/mcp-prompts.js +8 -6
- package/src/mcp-register-tools.js +25 -14
- package/src/mcp-role-tools.js +59 -18
- package/src/mcp-server-name.js +7 -0
- package/src/mcp-server.js +35 -7
- package/src/mcp-signup-client.js +3 -6
- package/src/mcp-signup-flow.js +389 -0
- package/src/mcp-signup-tools.js +250 -133
- package/src/onboarding-flow.js +72 -146
- package/src/onboarding-funnel.js +46 -6
- package/src/opencode-sessions.js +92 -0
- package/src/profile-agents.js +26 -0
- package/src/render-report-text.js +1 -1
- package/src/report-gating.js +4 -2
- package/src/report-store.js +7 -2
- package/src/roles-flow.js +8 -5
- package/src/saved-positions-flow.js +3 -3
- package/src/scanner.js +104 -12
- package/src/session-gate.js +1 -4
- package/src/session-normalizers.js +114 -8
- package/src/session-refresh.js +5 -16
- package/src/session-scan.js +167 -22
- package/src/share-consent-state.js +2 -2
- package/src/share-payload.js +4 -1
- package/src/share.js +2 -2
- package/src/signup-client.js +12 -39
- package/src/signup-copy.js +545 -58
- package/src/skill-install.js +102 -0
- package/src/stdin-ask.js +13 -1
- package/src/tier-engine.js +14 -2
- package/src/trust-narration.js +32 -0
- package/src/usage-run-steps.js +68 -6
- package/src/usage-scan.js +11 -8
- package/src/brand-svg.js +0 -9
- package/src/inter-fonts.js +0 -6
- package/src/mcp-auth-form.js +0 -480
package/src/device-login.js
CHANGED
|
@@ -10,15 +10,16 @@ function defaultSleep(ms) {
|
|
|
10
10
|
return new Promise((resolve) => { setTimeout(resolve, ms); });
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (!url || !
|
|
13
|
+
function withDeviceParams(url, params = {}) {
|
|
14
|
+
const entries = Object.entries(params).filter(([, v]) => typeof v === 'string' && v);
|
|
15
|
+
if (!url || !entries.length) return url;
|
|
16
16
|
try {
|
|
17
17
|
const u = new URL(url);
|
|
18
|
-
u.searchParams.set(
|
|
18
|
+
for (const [k, v] of entries) u.searchParams.set(k, v);
|
|
19
19
|
return u.href;
|
|
20
20
|
} catch {
|
|
21
|
-
|
|
21
|
+
const query = entries.map(([k, v]) => `${k}=${encodeURIComponent(v)}`).join('&');
|
|
22
|
+
return `${url}${url.includes('?') ? '&' : '?'}${query}`;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -32,7 +33,7 @@ async function pollDeviceToken({ deviceCode, tokenEndpoint, clientId, timeoutMs
|
|
|
32
33
|
|
|
33
34
|
// ORDER: a NEW user needs complete-registration BEFORE GET /auth/token (else the Hub 500s: no domain user).
|
|
34
35
|
async function finalizeDeviceSession(
|
|
35
|
-
{ sessionToken, isNewUser, authTokenEndpoint, completeRegistrationEndpoint = null, registrationContext = null, claimCode = null, timeoutMs } = {},
|
|
36
|
+
{ sessionToken, isNewUser, authTokenEndpoint, completeRegistrationEndpoint = null, registrationContext = null, consent = null, claimCode = null, timeoutMs } = {},
|
|
36
37
|
{
|
|
37
38
|
requestCompleteRegistration = require('./signup-client').requestCompleteRegistration,
|
|
38
39
|
requestApiToken: apiToken = requestApiToken,
|
|
@@ -42,7 +43,7 @@ async function finalizeDeviceSession(
|
|
|
42
43
|
|
|
43
44
|
let claimed = false;
|
|
44
45
|
if (isNewUser && completeRegistrationEndpoint) {
|
|
45
|
-
const done = await requestCompleteRegistration(registrationContext || {}, { endpoint: completeRegistrationEndpoint, bearerToken: sessionToken, claimCode, timeoutMs });
|
|
46
|
+
const done = await requestCompleteRegistration(registrationContext || {}, { endpoint: completeRegistrationEndpoint, bearerToken: sessionToken, claimCode, consent, timeoutMs });
|
|
46
47
|
if (!done.ok) return { ok: false, reason: done.reason || 'complete-registration-failed' };
|
|
47
48
|
claimed = done.claimed === true;
|
|
48
49
|
}
|
|
@@ -53,7 +54,7 @@ async function finalizeDeviceSession(
|
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
async function runDeviceLogin(
|
|
56
|
-
{ authorizeEndpoint, tokenEndpoint, authTokenEndpoint, completeRegistrationEndpoint = null, registrationContext = null, clientId, scope, timeoutMs } = {},
|
|
57
|
+
{ authorizeEndpoint, tokenEndpoint, authTokenEndpoint, completeRegistrationEndpoint = null, registrationContext = null, consent = null, clientId, scope, timeoutMs } = {},
|
|
57
58
|
{
|
|
58
59
|
onPrompt = null,
|
|
59
60
|
onWaiting = null,
|
|
@@ -92,6 +93,7 @@ async function runDeviceLogin(
|
|
|
92
93
|
authTokenEndpoint,
|
|
93
94
|
completeRegistrationEndpoint,
|
|
94
95
|
registrationContext,
|
|
96
|
+
consent,
|
|
95
97
|
timeoutMs,
|
|
96
98
|
});
|
|
97
99
|
if (!fin.ok) return { ok: false, reason: fin.reason };
|
|
@@ -124,7 +126,7 @@ module.exports = {
|
|
|
124
126
|
pollDeviceToken,
|
|
125
127
|
finalizeDeviceSession,
|
|
126
128
|
runDeviceLogin,
|
|
127
|
-
|
|
129
|
+
withDeviceParams,
|
|
128
130
|
defaultSleep,
|
|
129
131
|
SLOW_DOWN_STEP_SECONDS,
|
|
130
132
|
DEFAULT_MAX_WAIT_MS,
|
package/src/env-paths.js
CHANGED
|
@@ -13,6 +13,14 @@ function getHomeDir(env = process.env) {
|
|
|
13
13
|
return readEnv(env, 'HOME_DIR') || os.homedir();
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
function codexHome(env = process.env) {
|
|
17
|
+
return env.CODEX_HOME || require('path').join(getHomeDir(env), '.codex');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function piAgentDir(env = process.env) {
|
|
21
|
+
return env.PI_CODING_AGENT_DIR ? expandHome(env.PI_CODING_AGENT_DIR, env) : require('path').join(getHomeDir(env), '.pi', 'agent');
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
// `~/Documents/cv.pdf` -> absolute, so a model can pass the short form it was shown.
|
|
17
25
|
function expandHome(file, env = process.env) {
|
|
18
26
|
if (typeof file !== 'string') return file;
|
|
@@ -27,4 +35,4 @@ function tildify(file, env = process.env) {
|
|
|
27
35
|
return typeof file === 'string' && file.startsWith(`${home}/`) ? `~/${file.slice(home.length + 1)}` : file;
|
|
28
36
|
}
|
|
29
37
|
|
|
30
|
-
module.exports = { getHomeDir, readEnv, expandHome, tildify };
|
|
38
|
+
module.exports = { getHomeDir, codexHome, piAgentDir, readEnv, expandHome, tildify };
|