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.
Files changed (218) hide show
  1. package/LICENSE +59 -0
  2. package/README.md +1175 -0
  3. package/bin/add-agent.js +88 -0
  4. package/bin/add-project.js +88 -0
  5. package/bin/add-role.js +61 -0
  6. package/bin/add-skill.js +88 -0
  7. package/bin/ai-usage.js +81 -0
  8. package/bin/alma.js +99 -0
  9. package/bin/applications.js +69 -0
  10. package/bin/availability.js +70 -0
  11. package/bin/certifications.js +69 -0
  12. package/bin/certify.js +73 -0
  13. package/bin/change-role.js +61 -0
  14. package/bin/config.js +120 -0
  15. package/bin/experiences.js +69 -0
  16. package/bin/find-projects.js +89 -0
  17. package/bin/invitations.js +69 -0
  18. package/bin/lang.js +70 -0
  19. package/bin/login.js +283 -0
  20. package/bin/mcp.js +98 -0
  21. package/bin/me.js +69 -0
  22. package/bin/onboarding.js +134 -0
  23. package/bin/portfolios.js +69 -0
  24. package/bin/rate.js +70 -0
  25. package/bin/register.js +325 -0
  26. package/bin/report-html.js +134 -0
  27. package/bin/save.js +77 -0
  28. package/bin/shakers.js +344 -0
  29. package/bin/share.js +72 -0
  30. package/bin/show-project.js +72 -0
  31. package/bin/socials.js +70 -0
  32. package/bin/superadmin.js +351 -0
  33. package/package.json +40 -0
  34. package/src/agent-category.js +13 -0
  35. package/src/agent-evaluation.js +177 -0
  36. package/src/agent-org-chart.js +355 -0
  37. package/src/agent-synthesis.js +132 -0
  38. package/src/agent-usage.js +118 -0
  39. package/src/agents-client.js +165 -0
  40. package/src/ai-fluency-cell.js +72 -0
  41. package/src/ai-profile-client.js +45 -0
  42. package/src/ai-profile-preview.js +154 -0
  43. package/src/ai.js +66 -0
  44. package/src/alma-client.js +123 -0
  45. package/src/alma-flow.js +32 -0
  46. package/src/alma-repo-context.js +47 -0
  47. package/src/alma-shell.js +161 -0
  48. package/src/ansi.js +62 -0
  49. package/src/applications-client.js +79 -0
  50. package/src/applications-flow.js +58 -0
  51. package/src/auth-client.js +144 -0
  52. package/src/auth-device-client.js +118 -0
  53. package/src/auth-method-picker.js +44 -0
  54. package/src/auth-methods.js +35 -0
  55. package/src/auth-session-store.js +214 -0
  56. package/src/authorship.js +203 -0
  57. package/src/automations-detector.js +170 -0
  58. package/src/availability-client.js +92 -0
  59. package/src/availability-flow.js +105 -0
  60. package/src/backend-request.js +170 -0
  61. package/src/blind-approval-extract.js +48 -0
  62. package/src/brand-ansi.js +14 -0
  63. package/src/brand-svg.js +9 -0
  64. package/src/browser-tools-detector.js +21 -0
  65. package/src/build-next-level.js +56 -0
  66. package/src/certifications-client.js +89 -0
  67. package/src/certifications-flow.js +75 -0
  68. package/src/certify-dimension-client.js +217 -0
  69. package/src/certify-dimension-flow.js +193 -0
  70. package/src/certify-disclaimer.js +51 -0
  71. package/src/certify-remediation-prompt.js +23 -0
  72. package/src/cli-args.js +83 -0
  73. package/src/config-dir.js +120 -0
  74. package/src/config.js +778 -0
  75. package/src/consent-flow.js +115 -0
  76. package/src/consent-skip.js +27 -0
  77. package/src/decisions-extract.js +43 -0
  78. package/src/detect-repos.js +145 -0
  79. package/src/detected-tools.js +15 -0
  80. package/src/detection-evidence.js +105 -0
  81. package/src/detection-noise.js +132 -0
  82. package/src/detectors.js +221 -0
  83. package/src/device-auth-store.js +100 -0
  84. package/src/device-login.js +118 -0
  85. package/src/email-verification.js +152 -0
  86. package/src/env-paths.js +16 -0
  87. package/src/find-projects-cache.js +89 -0
  88. package/src/find-projects-client.js +138 -0
  89. package/src/find-projects-flow.js +164 -0
  90. package/src/git-activity.js +123 -0
  91. package/src/graph-certs.js +58 -0
  92. package/src/graph-generator.js +230 -0
  93. package/src/graph-scan.js +239 -0
  94. package/src/i18n.js +3264 -0
  95. package/src/inter-fonts.js +6 -0
  96. package/src/interactive-select.js +183 -0
  97. package/src/interview-client.js +226 -0
  98. package/src/interview-transcript.js +56 -0
  99. package/src/inventory-client.js +90 -0
  100. package/src/invitations-client.js +66 -0
  101. package/src/invitations-flow.js +50 -0
  102. package/src/lang-client.js +147 -0
  103. package/src/lang-codes.js +14 -0
  104. package/src/lang-flow.js +85 -0
  105. package/src/legal-notice.js +53 -0
  106. package/src/locale.js +51 -0
  107. package/src/markdown-ansi.js +50 -0
  108. package/src/maturity.js +111 -0
  109. package/src/mcp-ai-usage-result-tool.js +109 -0
  110. package/src/mcp-ai-usage-tool.js +333 -0
  111. package/src/mcp-alma-tools.js +91 -0
  112. package/src/mcp-applications-tools.js +42 -0
  113. package/src/mcp-ask-tools.js +50 -0
  114. package/src/mcp-auth-form.js +282 -0
  115. package/src/mcp-availability-tools.js +43 -0
  116. package/src/mcp-certifications-tools.js +42 -0
  117. package/src/mcp-certify-dimension-tools.js +58 -0
  118. package/src/mcp-detector.js +223 -0
  119. package/src/mcp-device-login-tools.js +173 -0
  120. package/src/mcp-find-projects-tools.js +67 -0
  121. package/src/mcp-install.js +245 -0
  122. package/src/mcp-invitations-tools.js +42 -0
  123. package/src/mcp-lang-tools.js +39 -0
  124. package/src/mcp-onboarding-tools.js +388 -0
  125. package/src/mcp-portfolios-tools.js +46 -0
  126. package/src/mcp-profile-tools.js +46 -0
  127. package/src/mcp-rate-tools.js +42 -0
  128. package/src/mcp-register-tools.js +517 -0
  129. package/src/mcp-report-tools.js +101 -0
  130. package/src/mcp-role-tools.js +112 -0
  131. package/src/mcp-saved-positions-tools.js +55 -0
  132. package/src/mcp-server.js +170 -0
  133. package/src/mcp-show-project-tools.js +50 -0
  134. package/src/mcp-socials-tools.js +39 -0
  135. package/src/memory-structure-detector.js +108 -0
  136. package/src/model-call-record.js +198 -0
  137. package/src/onboarding-availability.js +26 -0
  138. package/src/onboarding-client.js +364 -0
  139. package/src/onboarding-flow.js +1078 -0
  140. package/src/onboarding-livekit-client.js +102 -0
  141. package/src/onboarding-status-client.js +42 -0
  142. package/src/open-file.js +32 -0
  143. package/src/osc-link.js +16 -0
  144. package/src/portfolio-client.js +164 -0
  145. package/src/portfolio-git-info.js +61 -0
  146. package/src/portfolios-client.js +85 -0
  147. package/src/portfolios-flow.js +79 -0
  148. package/src/profile-client.js +125 -0
  149. package/src/profile-flow.js +115 -0
  150. package/src/profile-switch.js +46 -0
  151. package/src/prompt-select.js +29 -0
  152. package/src/rate-client.js +82 -0
  153. package/src/rate-flow.js +137 -0
  154. package/src/render-ai-fluency.js +266 -0
  155. package/src/render-certification.js +177 -0
  156. package/src/render-html.js +140 -0
  157. package/src/render-report-text.js +27 -0
  158. package/src/render-sheet.js +261 -0
  159. package/src/render-terminal.js +109 -0
  160. package/src/render-usage-report-text.js +155 -0
  161. package/src/repo-context.js +215 -0
  162. package/src/report-gating.js +49 -0
  163. package/src/report-store.js +226 -0
  164. package/src/report-theme.js +177 -0
  165. package/src/report-view-client.js +50 -0
  166. package/src/reveal-output.js +29 -0
  167. package/src/roadmap-content.js +453 -0
  168. package/src/roadmap-personalization.js +132 -0
  169. package/src/roadmap-prompt.js +154 -0
  170. package/src/roles-client.js +114 -0
  171. package/src/roles-flow.js +192 -0
  172. package/src/sanitize-network-text.js +36 -0
  173. package/src/saved-positions-client.js +71 -0
  174. package/src/saved-positions-flow.js +50 -0
  175. package/src/scan-exclusions.js +50 -0
  176. package/src/scanner.js +612 -0
  177. package/src/scope-signals.js +148 -0
  178. package/src/secret-prompt.js +72 -0
  179. package/src/session-gate.js +30 -0
  180. package/src/session-refresh.js +51 -0
  181. package/src/session-scan.js +336 -0
  182. package/src/session-signals.js +36 -0
  183. package/src/shakers-wordmark.js +17 -0
  184. package/src/share-card.js +362 -0
  185. package/src/share-certification.js +111 -0
  186. package/src/share-consent-state.js +157 -0
  187. package/src/share-payload.js +300 -0
  188. package/src/share.js +184 -0
  189. package/src/show-project-client.js +58 -0
  190. package/src/show-project-flow.js +119 -0
  191. package/src/signup-client.js +91 -0
  192. package/src/skills-client.js +102 -0
  193. package/src/socials-client.js +91 -0
  194. package/src/socials-flow.js +83 -0
  195. package/src/specificity-extract.js +41 -0
  196. package/src/start-add-agents.js +306 -0
  197. package/src/start-add-portfolio.js +388 -0
  198. package/src/start-add-skills.js +260 -0
  199. package/src/stdin-ask.js +129 -0
  200. package/src/steering-extract.js +43 -0
  201. package/src/strip-internal-comments.js +45 -0
  202. package/src/tech-detector.js +295 -0
  203. package/src/templates/report-sheet.html +572 -0
  204. package/src/terminal-agents.js +199 -0
  205. package/src/terminal-format.js +85 -0
  206. package/src/terminal-progress.js +106 -0
  207. package/src/terminal-sections.js +219 -0
  208. package/src/tier-analysis.js +126 -0
  209. package/src/tier-engine.js +114 -0
  210. package/src/tier-projection.js +117 -0
  211. package/src/transcript-turns.js +49 -0
  212. package/src/translations-client.js +84 -0
  213. package/src/typewriter.js +154 -0
  214. package/src/usage-model-calls.js +119 -0
  215. package/src/usage-oneshot-commands.js +180 -0
  216. package/src/usage-repo-scope.js +162 -0
  217. package/src/usage-run-steps.js +338 -0
  218. package/src/work-streams.js +74 -0
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+
3
+ // Saved-positions client (hub `works/saved-positions`, talent Bearer). Both
4
+ // operations are idempotent server-side, so no read-before-write is needed.
5
+
6
+ const { postJsonWithTimeout } = require('./backend-request');
7
+ const { reasonForError } = require('./onboarding-client');
8
+
9
+ const DEFAULT_TIMEOUT_MS = 20000;
10
+
11
+ function bearerHeaders(accessToken) {
12
+ const headers = {};
13
+ if (typeof accessToken === 'string' && accessToken) headers.Authorization = `Bearer ${accessToken}`;
14
+ return headers;
15
+ }
16
+
17
+ async function requestSavePosition({ hubAccessToken } = {}, { positionId, endpoint, timeoutMs = DEFAULT_TIMEOUT_MS } = {}) {
18
+ if (!endpoint) return { ok: false, reason: 'no-endpoint' };
19
+ if (!positionId) return { ok: false, reason: 'no-id' };
20
+ if (!hubAccessToken) return { ok: false, reason: 'no-hub-token' };
21
+ let res;
22
+ try {
23
+ res = await postJsonWithTimeout(endpoint, { positionId }, timeoutMs, 'POST', null, bearerHeaders(hubAccessToken));
24
+ } catch (e) {
25
+ return { ok: false, reason: (e && e.kind) || 'network-error' };
26
+ }
27
+ if (res.status === 404) return { ok: false, reason: 'not-found' };
28
+ if (res.status < 200 || res.status >= 300) return { ok: false, reason: reasonForError(res.status, res.raw) };
29
+ return { ok: true };
30
+ }
31
+
32
+ async function requestUnsavePosition({ hubAccessToken } = {}, { positionId, endpoint, timeoutMs = DEFAULT_TIMEOUT_MS } = {}) {
33
+ if (!endpoint) return { ok: false, reason: 'no-endpoint' };
34
+ if (!positionId) return { ok: false, reason: 'no-id' };
35
+ if (!hubAccessToken) return { ok: false, reason: 'no-hub-token' };
36
+ let res;
37
+ try {
38
+ res = await postJsonWithTimeout(endpoint, null, timeoutMs, 'DELETE', null, bearerHeaders(hubAccessToken));
39
+ } catch (e) {
40
+ return { ok: false, reason: (e && e.kind) || 'network-error' };
41
+ }
42
+ if (res.status < 200 || res.status >= 300) return { ok: false, reason: reasonForError(res.status, res.raw) };
43
+ return { ok: true };
44
+ }
45
+
46
+ async function savePosition(deps = {}, { hubAccessToken, positionId, timeoutMs = DEFAULT_TIMEOUT_MS } = {}) {
47
+ const {
48
+ getSavePositionEndpoint = require('./config').getSavePositionEndpoint,
49
+ requestSavePosition: request = requestSavePosition,
50
+ } = deps;
51
+ const endpoint = getSavePositionEndpoint();
52
+ if (!endpoint) return { ok: false, reason: 'no-endpoint' };
53
+ return request({ hubAccessToken }, { positionId, endpoint, timeoutMs });
54
+ }
55
+
56
+ async function unsavePosition(deps = {}, { hubAccessToken, positionId, timeoutMs = DEFAULT_TIMEOUT_MS } = {}) {
57
+ const {
58
+ getUnsavePositionEndpoint = require('./config').getUnsavePositionEndpoint,
59
+ requestUnsavePosition: request = requestUnsavePosition,
60
+ } = deps;
61
+ const endpoint = getUnsavePositionEndpoint(positionId);
62
+ if (!endpoint) return { ok: false, reason: positionId ? 'no-endpoint' : 'no-id' };
63
+ return request({ hubAccessToken }, { positionId, endpoint, timeoutMs });
64
+ }
65
+
66
+ module.exports = {
67
+ requestSavePosition,
68
+ requestUnsavePosition,
69
+ savePosition,
70
+ unsavePosition,
71
+ };
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ // `save` / `unsave` flows: bookmark a Position. Reversible + idempotent, so no
4
+ // confirmation (owner: low risk). Talent Bearer.
5
+
6
+ function makeSavedPositionsDeps(overrides = {}) {
7
+ const client = require('./saved-positions-client');
8
+ return {
9
+ savePosition: (opts) => client.savePosition({}, opts),
10
+ unsavePosition: (opts) => client.unsavePosition({}, opts),
11
+ resolveRef: (raw) => require('./find-projects-cache').resolvePositionRef(raw),
12
+ ...overrides,
13
+ };
14
+ }
15
+
16
+ async function runToggleSave({ io, rawOut, session, catalog, mode, opts = {}, deps = makeSavedPositionsDeps() }) {
17
+ const fp = catalog.savedPositions;
18
+ const hubAccessToken = session ? session.hubAccessToken : null;
19
+ // A pure integer resolves against the last `find-projects` listing; a UUID/Mongo id passes through.
20
+ const resolved = deps.resolveRef(opts.id);
21
+ if (!resolved.ok) {
22
+ const idRequired = mode === 'save' ? fp.saveIdRequired : fp.unsaveIdRequired;
23
+ io.error(resolved.reason === 'no-cache' ? fp.refNoCache
24
+ : resolved.reason === 'out-of-range' ? fp.refOutOfRange(resolved.count)
25
+ : idRequired);
26
+ return { ok: false, reason: resolved.reason };
27
+ }
28
+ const positionId = resolved.id;
29
+
30
+ const label = mode === 'save' ? fp.saving : fp.unsaving;
31
+ const res = await io.withProgress(label, () => (mode === 'save'
32
+ ? deps.savePosition({ hubAccessToken, positionId })
33
+ : deps.unsavePosition({ hubAccessToken, positionId })));
34
+ if (!res.ok) {
35
+ io.error(res.reason === 'not-found' ? fp.notFound : fp.failed(res.reason));
36
+ return { ok: false, reason: res.reason };
37
+ }
38
+
39
+ if (opts.json) {
40
+ (rawOut || ((s) => process.stdout.write(s)))(`${JSON.stringify({ ok: true, mode, positionId }, null, 2)}\n`);
41
+ return { ok: true };
42
+ }
43
+ io.success(mode === 'save' ? fp.saved : fp.unsaved);
44
+ return { ok: true };
45
+ }
46
+
47
+ module.exports = {
48
+ makeSavedPositionsDeps,
49
+ runToggleSave,
50
+ };
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+
5
+ // Directory names never descended into when walking a project tree (skill-code-certification, issue 008).
6
+ const EXCLUDED_DIRS = new Set([
7
+ 'node_modules', 'dist', 'build', '.git', 'vendor', 'coverage', '.next', 'out',
8
+ // Python
9
+ '__pycache__', '.venv', 'venv', '.tox', '.mypy_cache', '.pytest_cache', '.eggs',
10
+ // Ruby
11
+ '.bundle',
12
+ // Java / JVM (Gradle/Maven build output)
13
+ 'target', '.gradle',
14
+ ]);
15
+
16
+ const MAX_WALK_DEPTH = 8;
17
+
18
+ const SYSTEM_ROOT_PATHS = new Set([
19
+ '/System', '/Library', '/Volumes', '/private', '/dev', '/proc',
20
+ '/opt', '/Applications', '/usr', '/bin', '/sbin', '/etc', '/var',
21
+ '/cores', '/Network',
22
+ ]);
23
+
24
+ function normalizeWalkRoot(root) {
25
+ const resolved = path.resolve(root);
26
+ return resolved.length > 1 ? resolved.replace(/\/+$/, '') : resolved;
27
+ }
28
+
29
+ function isRefusedWalkRoot(root) {
30
+ if (typeof root !== 'string' || !root) return true;
31
+ let norm;
32
+ try {
33
+ norm = normalizeWalkRoot(root);
34
+ } catch {
35
+ return true;
36
+ }
37
+ return norm === '/' || SYSTEM_ROOT_PATHS.has(norm);
38
+ }
39
+
40
+ function isExcludedWalkPath(absDir) {
41
+ return SYSTEM_ROOT_PATHS.has(absDir);
42
+ }
43
+
44
+ module.exports = {
45
+ EXCLUDED_DIRS,
46
+ MAX_WALK_DEPTH,
47
+ SYSTEM_ROOT_PATHS,
48
+ isRefusedWalkRoot,
49
+ isExcludedWalkPath,
50
+ };