shakers-cli-beta 0.8.0-beta.5 → 0.10.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 (45) hide show
  1. package/README.md +39 -9
  2. package/bin/ai-usage.js +37 -19
  3. package/bin/login.js +1 -1
  4. package/bin/mcp.js +25 -21
  5. package/bin/mcpb.js +5 -0
  6. package/package.json +3 -2
  7. package/src/auth-session-store.js +1 -0
  8. package/src/authorship.js +7 -6
  9. package/src/backend-request.js +2 -2
  10. package/src/certify-dimension-client.js +0 -54
  11. package/src/certify-dimension-flow.js +20 -81
  12. package/src/config.js +29 -8
  13. package/src/cv-file.js +62 -0
  14. package/src/device-login.js +5 -3
  15. package/src/find-projects-client.js +16 -6
  16. package/src/git-activity.js +8 -7
  17. package/src/git-log-prefetch.js +53 -0
  18. package/src/i18n.js +33 -58
  19. package/src/mcp-ai-usage-tool.js +150 -65
  20. package/src/mcp-auth-form.js +213 -44
  21. package/src/mcp-certify-dimension-tools.js +2 -2
  22. package/src/mcp-choice.js +47 -0
  23. package/src/mcp-install.js +32 -3
  24. package/src/mcp-instructions.js +27 -0
  25. package/src/mcp-onboarding-tools.js +3 -3
  26. package/src/mcp-prompts.js +73 -0
  27. package/src/mcp-rate-tools.js +2 -2
  28. package/src/mcp-register-tools.js +89 -313
  29. package/src/mcp-role-tools.js +177 -16
  30. package/src/mcp-server.js +108 -4
  31. package/src/mcp-signup-client.js +118 -0
  32. package/src/mcp-signup-tools.js +818 -0
  33. package/src/onboarding-client.js +28 -52
  34. package/src/onboarding-flow.js +3 -147
  35. package/src/onboarding-status-client.js +16 -1
  36. package/src/register-context.js +1 -17
  37. package/src/roles-client.js +3 -1
  38. package/src/scanner.js +13 -1
  39. package/src/session-normalizers.js +174 -0
  40. package/src/session-scan.js +149 -10
  41. package/src/signup-client.js +33 -21
  42. package/src/signup-copy.js +338 -0
  43. package/src/signup-language.js +21 -0
  44. package/src/usage-run-steps.js +3 -2
  45. package/src/work-streams.js +7 -2
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ const { toSignupLanguage } = require('./signup-copy');
4
+
5
+ // The talent's language: the welcome fixes it from their first message and every later sign-up text keeps it.
6
+ let fixed = null;
7
+
8
+ function fixSignupLanguage(code) {
9
+ fixed = toSignupLanguage(code);
10
+ return fixed;
11
+ }
12
+
13
+ function signupLanguage(fallback = 'en') {
14
+ return fixed || toSignupLanguage(fallback) || 'en';
15
+ }
16
+
17
+ function resetSignupLanguage() {
18
+ fixed = null;
19
+ }
20
+
21
+ module.exports = { fixSignupLanguage, signupLanguage, resetSignupLanguage };
@@ -95,11 +95,12 @@ function performScan({ opts, catalog }) {
95
95
  }
96
96
 
97
97
  // The identity gate + local (no-network, no-LLM) agent-usage signal.
98
- function prepareIdentityAndUsage({ report, catalog }) {
98
+ function prepareIdentityAndUsage({ report, catalog, quiet = false }) {
99
99
  const hasAgents = Array.isArray(report.agents) && report.agents.length > 0;
100
100
  const gate = reportGateForIdentity();
101
101
 
102
- if (gate.showFrameworkIntro) process.stdout.write(`\n ${catalog.cli.frameworkIntroUsage}\n`);
102
+ // --json owns stdout: one parseable document, and the MCP's JSON-RPC channel.
103
+ if (gate.showFrameworkIntro && !quiet) process.stdout.write(`\n ${catalog.cli.frameworkIntroUsage}\n`);
103
104
 
104
105
  // Local, no network, no LLM: how often each detected agent was invoked in the local Claude Code history.
105
106
  if (hasAgents) report.agentUsage = collectAgentUsage(report.agents);
@@ -2,6 +2,7 @@
2
2
 
3
3
  const { execFileSync } = require('child_process');
4
4
  const { isGitRepo } = require('./git-activity');
5
+ const { takePrefetchedGitLog } = require('./git-log-prefetch');
5
6
 
6
7
  // Deterministic WORK-STREAM structure for the project where `shakers ai-usage` runs (hybrid evaluation, Slice 2).
7
8
 
@@ -9,11 +10,15 @@ const GIT_TIMEOUT_MS = 15000;
9
10
  const SESSION_GAP_SECONDS = 4 * 3600;
10
11
  const SECONDS_PER_DAY = 86400;
11
12
 
13
+ const WORK_STREAMS_LOG_ARGS = ['log', '--no-merges', '--pretty=format:%at'];
14
+
12
15
  function runGitTimestamps(root) {
16
+ const prefetched = takePrefetchedGitLog(root, WORK_STREAMS_LOG_ARGS);
17
+ if (prefetched !== undefined) return prefetched;
13
18
  try {
14
19
  return execFileSync(
15
20
  'git',
16
- ['-C', root, 'log', '--no-merges', '--pretty=format:%at'],
21
+ ['-C', root, ...WORK_STREAMS_LOG_ARGS],
17
22
  {
18
23
  encoding: 'utf8',
19
24
  timeout: GIT_TIMEOUT_MS,
@@ -71,4 +76,4 @@ function collectWorkStreams(root) {
71
76
  };
72
77
  }
73
78
 
74
- module.exports = { collectWorkStreams, SESSION_GAP_SECONDS };
79
+ module.exports = { collectWorkStreams, SESSION_GAP_SECONDS, WORK_STREAMS_LOG_ARGS };