shakers-cli-beta 0.8.0-beta.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/LICENSE +59 -0
- package/README.md +1175 -0
- package/bin/add-agent.js +88 -0
- package/bin/add-project.js +88 -0
- package/bin/add-role.js +61 -0
- package/bin/add-skill.js +88 -0
- package/bin/ai-usage.js +81 -0
- package/bin/alma.js +99 -0
- package/bin/applications.js +69 -0
- package/bin/availability.js +70 -0
- package/bin/certifications.js +69 -0
- package/bin/certify.js +73 -0
- package/bin/change-role.js +61 -0
- package/bin/config.js +120 -0
- package/bin/experiences.js +69 -0
- package/bin/find-projects.js +89 -0
- package/bin/invitations.js +69 -0
- package/bin/lang.js +70 -0
- package/bin/login.js +283 -0
- package/bin/mcp.js +98 -0
- package/bin/me.js +69 -0
- package/bin/onboarding.js +134 -0
- package/bin/portfolios.js +69 -0
- package/bin/rate.js +70 -0
- package/bin/register.js +325 -0
- package/bin/report-html.js +134 -0
- package/bin/save.js +77 -0
- package/bin/shakers.js +344 -0
- package/bin/share.js +72 -0
- package/bin/show-project.js +72 -0
- package/bin/socials.js +70 -0
- package/bin/superadmin.js +351 -0
- package/package.json +40 -0
- package/src/agent-category.js +13 -0
- package/src/agent-evaluation.js +177 -0
- package/src/agent-org-chart.js +355 -0
- package/src/agent-synthesis.js +132 -0
- package/src/agent-usage.js +118 -0
- package/src/agents-client.js +165 -0
- package/src/ai-fluency-cell.js +72 -0
- package/src/ai-profile-client.js +45 -0
- package/src/ai-profile-preview.js +154 -0
- package/src/ai.js +66 -0
- package/src/alma-client.js +123 -0
- package/src/alma-flow.js +32 -0
- package/src/alma-repo-context.js +47 -0
- package/src/alma-shell.js +161 -0
- package/src/ansi.js +62 -0
- package/src/applications-client.js +79 -0
- package/src/applications-flow.js +58 -0
- package/src/auth-client.js +144 -0
- package/src/auth-device-client.js +118 -0
- package/src/auth-method-picker.js +44 -0
- package/src/auth-methods.js +35 -0
- package/src/auth-session-store.js +214 -0
- package/src/authorship.js +203 -0
- package/src/automations-detector.js +170 -0
- package/src/availability-client.js +92 -0
- package/src/availability-flow.js +105 -0
- package/src/backend-request.js +170 -0
- package/src/blind-approval-extract.js +48 -0
- package/src/brand-ansi.js +14 -0
- package/src/brand-svg.js +9 -0
- package/src/browser-tools-detector.js +21 -0
- package/src/build-next-level.js +56 -0
- package/src/certifications-client.js +89 -0
- package/src/certifications-flow.js +75 -0
- package/src/certify-dimension-client.js +217 -0
- package/src/certify-dimension-flow.js +193 -0
- package/src/certify-disclaimer.js +51 -0
- package/src/certify-remediation-prompt.js +23 -0
- package/src/cli-args.js +83 -0
- package/src/config-dir.js +120 -0
- package/src/config.js +778 -0
- package/src/consent-flow.js +115 -0
- package/src/consent-skip.js +27 -0
- package/src/decisions-extract.js +43 -0
- package/src/detect-repos.js +145 -0
- package/src/detected-tools.js +15 -0
- package/src/detection-evidence.js +105 -0
- package/src/detection-noise.js +132 -0
- package/src/detectors.js +221 -0
- package/src/device-auth-store.js +100 -0
- package/src/device-login.js +118 -0
- package/src/email-verification.js +152 -0
- package/src/env-paths.js +16 -0
- package/src/find-projects-cache.js +89 -0
- package/src/find-projects-client.js +138 -0
- package/src/find-projects-flow.js +164 -0
- package/src/git-activity.js +123 -0
- package/src/graph-certs.js +58 -0
- package/src/graph-generator.js +230 -0
- package/src/graph-scan.js +239 -0
- package/src/i18n.js +3264 -0
- package/src/inter-fonts.js +6 -0
- package/src/interactive-select.js +183 -0
- package/src/interview-client.js +226 -0
- package/src/interview-transcript.js +56 -0
- package/src/inventory-client.js +90 -0
- package/src/invitations-client.js +66 -0
- package/src/invitations-flow.js +50 -0
- package/src/lang-client.js +147 -0
- package/src/lang-codes.js +14 -0
- package/src/lang-flow.js +85 -0
- package/src/legal-notice.js +53 -0
- package/src/locale.js +51 -0
- package/src/markdown-ansi.js +50 -0
- package/src/maturity.js +111 -0
- package/src/mcp-ai-usage-result-tool.js +109 -0
- package/src/mcp-ai-usage-tool.js +333 -0
- package/src/mcp-alma-tools.js +91 -0
- package/src/mcp-applications-tools.js +42 -0
- package/src/mcp-ask-tools.js +50 -0
- package/src/mcp-auth-form.js +282 -0
- package/src/mcp-availability-tools.js +43 -0
- package/src/mcp-certifications-tools.js +42 -0
- package/src/mcp-certify-dimension-tools.js +58 -0
- package/src/mcp-detector.js +223 -0
- package/src/mcp-device-login-tools.js +173 -0
- package/src/mcp-find-projects-tools.js +67 -0
- package/src/mcp-install.js +245 -0
- package/src/mcp-invitations-tools.js +42 -0
- package/src/mcp-lang-tools.js +39 -0
- package/src/mcp-onboarding-tools.js +388 -0
- package/src/mcp-portfolios-tools.js +46 -0
- package/src/mcp-profile-tools.js +46 -0
- package/src/mcp-rate-tools.js +42 -0
- package/src/mcp-register-tools.js +517 -0
- package/src/mcp-report-tools.js +101 -0
- package/src/mcp-role-tools.js +112 -0
- package/src/mcp-saved-positions-tools.js +55 -0
- package/src/mcp-server.js +170 -0
- package/src/mcp-show-project-tools.js +50 -0
- package/src/mcp-socials-tools.js +39 -0
- package/src/memory-structure-detector.js +108 -0
- package/src/model-call-record.js +198 -0
- package/src/onboarding-availability.js +26 -0
- package/src/onboarding-client.js +364 -0
- package/src/onboarding-flow.js +1078 -0
- package/src/onboarding-livekit-client.js +102 -0
- package/src/onboarding-status-client.js +42 -0
- package/src/open-file.js +32 -0
- package/src/osc-link.js +16 -0
- package/src/portfolio-client.js +164 -0
- package/src/portfolio-git-info.js +61 -0
- package/src/portfolios-client.js +85 -0
- package/src/portfolios-flow.js +79 -0
- package/src/profile-client.js +125 -0
- package/src/profile-flow.js +115 -0
- package/src/profile-switch.js +46 -0
- package/src/prompt-select.js +29 -0
- package/src/rate-client.js +82 -0
- package/src/rate-flow.js +137 -0
- package/src/render-ai-fluency.js +266 -0
- package/src/render-certification.js +177 -0
- package/src/render-html.js +140 -0
- package/src/render-report-text.js +27 -0
- package/src/render-sheet.js +261 -0
- package/src/render-terminal.js +109 -0
- package/src/render-usage-report-text.js +155 -0
- package/src/repo-context.js +215 -0
- package/src/report-gating.js +49 -0
- package/src/report-store.js +226 -0
- package/src/report-theme.js +177 -0
- package/src/report-view-client.js +50 -0
- package/src/reveal-output.js +29 -0
- package/src/roadmap-content.js +453 -0
- package/src/roadmap-personalization.js +132 -0
- package/src/roadmap-prompt.js +154 -0
- package/src/roles-client.js +114 -0
- package/src/roles-flow.js +192 -0
- package/src/sanitize-network-text.js +36 -0
- package/src/saved-positions-client.js +71 -0
- package/src/saved-positions-flow.js +50 -0
- package/src/scan-exclusions.js +50 -0
- package/src/scanner.js +612 -0
- package/src/scope-signals.js +148 -0
- package/src/secret-prompt.js +72 -0
- package/src/session-gate.js +30 -0
- package/src/session-refresh.js +51 -0
- package/src/session-scan.js +336 -0
- package/src/session-signals.js +36 -0
- package/src/shakers-wordmark.js +17 -0
- package/src/share-card.js +362 -0
- package/src/share-certification.js +111 -0
- package/src/share-consent-state.js +157 -0
- package/src/share-payload.js +300 -0
- package/src/share.js +184 -0
- package/src/show-project-client.js +58 -0
- package/src/show-project-flow.js +119 -0
- package/src/signup-client.js +91 -0
- package/src/skills-client.js +102 -0
- package/src/socials-client.js +91 -0
- package/src/socials-flow.js +83 -0
- package/src/specificity-extract.js +41 -0
- package/src/start-add-agents.js +306 -0
- package/src/start-add-portfolio.js +388 -0
- package/src/start-add-skills.js +260 -0
- package/src/stdin-ask.js +129 -0
- package/src/steering-extract.js +43 -0
- package/src/strip-internal-comments.js +45 -0
- package/src/tech-detector.js +295 -0
- package/src/templates/report-sheet.html +572 -0
- package/src/terminal-agents.js +199 -0
- package/src/terminal-format.js +85 -0
- package/src/terminal-progress.js +106 -0
- package/src/terminal-sections.js +219 -0
- package/src/tier-analysis.js +126 -0
- package/src/tier-engine.js +114 -0
- package/src/tier-projection.js +117 -0
- package/src/transcript-turns.js +49 -0
- package/src/translations-client.js +84 -0
- package/src/typewriter.js +154 -0
- package/src/usage-model-calls.js +119 -0
- package/src/usage-oneshot-commands.js +180 -0
- package/src/usage-repo-scope.js +162 -0
- package/src/usage-run-steps.js +338 -0
- package/src/work-streams.js +74 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const { getHomeDir, readEnv } = require('./env-paths');
|
|
6
|
+
|
|
7
|
+
// Single source of truth for the CLI's config directory (ADR-045).
|
|
8
|
+
|
|
9
|
+
const DIR_NAME = 'shakers';
|
|
10
|
+
const LEGACY_DIR_NAME = 'ai-footprint';
|
|
11
|
+
|
|
12
|
+
// Only config.json holds persisted endpoint URLs that must follow the endpoint
|
|
13
|
+
// rename; every other file is copied byte-for-byte.
|
|
14
|
+
const CONFIG_FILE = 'config.json';
|
|
15
|
+
|
|
16
|
+
// One-time marker dropped in the NEW dir once migration has run.
|
|
17
|
+
const MIGRATION_MARKER = '.migrated-from-ai-footprint';
|
|
18
|
+
|
|
19
|
+
function overrideDir(env) {
|
|
20
|
+
return readEnv(env, 'CONFIG_DIR') || null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function defaultConfigDir(env) {
|
|
24
|
+
return path.join(getHomeDir(env), '.config', DIR_NAME);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function legacyConfigDir(env) {
|
|
28
|
+
return path.join(getHomeDir(env), '.config', LEGACY_DIR_NAME);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getConfigDir(env = process.env) {
|
|
32
|
+
return overrideDir(env) || defaultConfigDir(env);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Rewrites the endpoint rename inside any persisted string value.
|
|
36
|
+
function rewriteConfigEndpoints(text) {
|
|
37
|
+
let parsed;
|
|
38
|
+
try {
|
|
39
|
+
parsed = JSON.parse(text);
|
|
40
|
+
} catch {
|
|
41
|
+
return text;
|
|
42
|
+
}
|
|
43
|
+
const walk = (v) => {
|
|
44
|
+
if (typeof v === 'string') return v.includes('ai-footprint') ? v.split('ai-footprint').join('usage') : v;
|
|
45
|
+
if (Array.isArray(v)) return v.map(walk);
|
|
46
|
+
if (v && typeof v === 'object') {
|
|
47
|
+
const out = {};
|
|
48
|
+
for (const k of Object.keys(v)) out[k] = walk(v[k]);
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
return v;
|
|
52
|
+
};
|
|
53
|
+
return `${JSON.stringify(walk(parsed), null, 2)}\n`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Atomic write preserving `mode`: temp-in-same-dir + fsync + rename.
|
|
57
|
+
function writeFilePreservingMode(dest, buf, mode, overwrite) {
|
|
58
|
+
if (!overwrite && fs.existsSync(dest)) return false;
|
|
59
|
+
const dir = path.dirname(dest);
|
|
60
|
+
const tmp = path.join(dir, `.${path.basename(dest)}.${process.pid}.${Date.now()}.tmp`);
|
|
61
|
+
const fd = fs.openSync(tmp, 'wx', mode);
|
|
62
|
+
try {
|
|
63
|
+
fs.writeSync(fd, buf);
|
|
64
|
+
fs.fsyncSync(fd);
|
|
65
|
+
} finally {
|
|
66
|
+
fs.closeSync(fd);
|
|
67
|
+
}
|
|
68
|
+
fs.renameSync(tmp, dest); // atomic replace within the same directory
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Migrates the legacy config dir to the new one exactly once (guarded by MIGRATION_MARKER).
|
|
73
|
+
function migrateLegacyConfigDir(env = process.env) {
|
|
74
|
+
// Explicit override: the caller chose the location, nothing to migrate.
|
|
75
|
+
if (overrideDir(env)) return { migrated: false, reason: 'override' };
|
|
76
|
+
|
|
77
|
+
const to = defaultConfigDir(env);
|
|
78
|
+
const from = legacyConfigDir(env);
|
|
79
|
+
const marker = path.join(to, MIGRATION_MARKER);
|
|
80
|
+
try {
|
|
81
|
+
if (fs.existsSync(marker)) return { migrated: false, reason: 'already-migrated', to };
|
|
82
|
+
if (!fs.existsSync(from) || !fs.statSync(from).isDirectory()) {
|
|
83
|
+
return { migrated: false, reason: 'no-legacy', from, to };
|
|
84
|
+
}
|
|
85
|
+
fs.mkdirSync(to, { recursive: true });
|
|
86
|
+
const brought = [];
|
|
87
|
+
for (const name of fs.readdirSync(from)) {
|
|
88
|
+
if (name === MIGRATION_MARKER) continue;
|
|
89
|
+
const src = path.join(from, name);
|
|
90
|
+
let st;
|
|
91
|
+
try {
|
|
92
|
+
st = fs.statSync(src);
|
|
93
|
+
} catch {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (!st.isFile()) continue; // the config dir is flat; skip anything odd
|
|
97
|
+
const dest = path.join(to, name);
|
|
98
|
+
const isConfig = name === CONFIG_FILE;
|
|
99
|
+
const buf = isConfig
|
|
100
|
+
? Buffer.from(rewriteConfigEndpoints(fs.readFileSync(src, 'utf8')), 'utf8')
|
|
101
|
+
: fs.readFileSync(src);
|
|
102
|
+
// config.json overwrites install's default; everything else is copy-if-missing.
|
|
103
|
+
if (writeFilePreservingMode(dest, buf, st.mode & 0o777, isConfig)) brought.push(name);
|
|
104
|
+
}
|
|
105
|
+
// Strictly once: drop the marker so a later boot never re-runs (and never
|
|
106
|
+
// re-overwrites a config the Talent has since edited in the new dir).
|
|
107
|
+
fs.writeFileSync(marker, `${new Date().toISOString()}\n`);
|
|
108
|
+
return { migrated: true, from, to, brought };
|
|
109
|
+
} catch (err) {
|
|
110
|
+
return { migrated: false, reason: 'error', error: err && err.message, from, to };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
module.exports = {
|
|
115
|
+
getConfigDir,
|
|
116
|
+
legacyConfigDir,
|
|
117
|
+
defaultConfigDir,
|
|
118
|
+
migrateLegacyConfigDir,
|
|
119
|
+
rewriteConfigEndpoints,
|
|
120
|
+
};
|