@tacitai/mcp-server 0.7.0 → 0.8.1

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 (73) hide show
  1. package/dist/api-errors.d.ts +102 -0
  2. package/dist/api-errors.js +165 -0
  3. package/dist/autonomy.d.ts +46 -0
  4. package/dist/autonomy.js +118 -0
  5. package/dist/claude-config.d.ts +139 -0
  6. package/dist/claude-config.js +339 -0
  7. package/dist/cli-launch.d.ts +33 -0
  8. package/dist/cli-launch.js +178 -0
  9. package/dist/cli-login.d.ts +34 -0
  10. package/dist/cli-login.js +200 -0
  11. package/dist/cli-mode.d.ts +47 -0
  12. package/dist/cli-mode.js +170 -0
  13. package/dist/cli-profiles.d.ts +37 -0
  14. package/dist/cli-profiles.js +344 -0
  15. package/dist/cli.d.ts +9 -0
  16. package/dist/cli.js +59 -458
  17. package/dist/client.d.ts +90 -52
  18. package/dist/client.js +198 -296
  19. package/dist/credentials.d.ts +81 -0
  20. package/dist/credentials.js +291 -0
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js +37 -89
  23. package/dist/oauth.d.ts +1 -1
  24. package/dist/oauth.js +5 -5
  25. package/dist/profile-store.d.ts +96 -0
  26. package/dist/profile-store.js +382 -0
  27. package/dist/prompt.d.ts +32 -0
  28. package/dist/prompt.js +99 -0
  29. package/dist/prompts.d.ts +2 -2
  30. package/dist/prompts.js +3 -3
  31. package/dist/server-mode.d.ts +65 -0
  32. package/dist/server-mode.js +99 -0
  33. package/dist/setup-migrate.d.ts +35 -0
  34. package/dist/setup-migrate.js +204 -0
  35. package/dist/setup.d.ts +41 -66
  36. package/dist/setup.js +361 -531
  37. package/dist/signin.d.ts +108 -0
  38. package/dist/signin.js +595 -0
  39. package/dist/tools/agents.d.ts +6 -4
  40. package/dist/tools/agents.js +15 -4
  41. package/dist/tools/artifacts.d.ts +2 -0
  42. package/dist/tools/artifacts.js +8 -1
  43. package/dist/tools/capture.js +2 -2
  44. package/dist/tools/career.js +2 -2
  45. package/dist/tools/chronicle.js +7 -7
  46. package/dist/tools/crews.js +8 -8
  47. package/dist/tools/errors.d.ts +18 -0
  48. package/dist/tools/errors.js +73 -1
  49. package/dist/tools/exec-route.d.ts +34 -0
  50. package/dist/tools/exec-route.js +101 -27
  51. package/dist/tools/github.js +2 -2
  52. package/dist/tools/gm.js +2 -2
  53. package/dist/tools/iam.js +2 -3
  54. package/dist/tools/kb.js +2 -2
  55. package/dist/tools/lake-structure.js +8 -8
  56. package/dist/tools/lake.js +2 -2
  57. package/dist/tools/onboarding.js +2 -2
  58. package/dist/tools/people.js +7 -7
  59. package/dist/tools/pyramid.js +2 -2
  60. package/dist/tools/recall.js +2 -2
  61. package/dist/tools/secretary.d.ts +1 -0
  62. package/dist/tools/secretary.js +2 -1
  63. package/dist/tools/synthesize.d.ts +37 -0
  64. package/dist/tools/synthesize.js +128 -9
  65. package/dist/tools/voice.d.ts +3 -2
  66. package/dist/tools/voice.js +70 -18
  67. package/dist/tools/wiki.js +2 -2
  68. package/dist/tools/workspaces.js +20 -6
  69. package/dist/version.d.ts +6 -0
  70. package/dist/version.js +18 -0
  71. package/dist/workflow-registry.d.ts +1 -0
  72. package/dist/workflow-registry.js +21 -0
  73. package/package.json +4 -1
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { TacitApiError } from '../client.js';
3
- import { success, error, featureDisabledResult } from './errors.js';
2
+ import { SwitchNotSupportedError, TacitApiError, TokenExpiredError } from '../client.js';
3
+ import { success, error, featureDisabledResult, apiErrorResult } from './errors.js';
4
4
  export function registerWorkspaceTools(server, getClient) {
5
5
  server.tool('tacit_list_workspaces', 'List all workspaces accessible to the authenticated user.', {}, async () => {
6
6
  try {
@@ -9,8 +9,9 @@ export function registerWorkspaceTools(server, getClient) {
9
9
  return success(data);
10
10
  }
11
11
  catch (e) {
12
- if (e instanceof TacitApiError)
13
- return featureDisabledResult(e) ?? error(e.message);
12
+ if (e instanceof TacitApiError || e instanceof TokenExpiredError) {
13
+ return featureDisabledResult(e) ?? apiErrorResult(e, '/api/v1/workspaces/mine');
14
+ }
14
15
  return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
15
16
  }
16
17
  });
@@ -27,14 +28,27 @@ export function registerWorkspaceTools(server, getClient) {
27
28
  });
28
29
  }
29
30
  catch (e) {
30
- if (e instanceof TacitApiError)
31
- return featureDisabledResult(e) ?? error(e.message);
31
+ if (e instanceof SwitchNotSupportedError)
32
+ return error(e.message);
33
+ if (e instanceof TacitApiError || e instanceof TokenExpiredError) {
34
+ return featureDisabledResult(e) ?? apiErrorResult(e, '/api/v1/auth/switch-workspace');
35
+ }
32
36
  return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
33
37
  }
34
38
  });
35
39
  server.tool('tacit_current_workspace', 'Get the currently active workspace ID and name.', {}, async () => {
36
40
  try {
37
41
  const client = await getClient();
42
+ // One whoami call confirms the login still works (a removed member must not get a cached answer).
43
+ try {
44
+ await client.whoami();
45
+ }
46
+ catch (e) {
47
+ if (e instanceof TokenExpiredError || (e instanceof TacitApiError && (e.statusCode === 401 || e.statusCode === 403))) {
48
+ return apiErrorResult(e, '/api/v1/auth/whoami');
49
+ }
50
+ // Old server (404/405), network trouble or 5xx: answer from local state.
51
+ }
38
52
  return success({
39
53
  workspace_id: client.workspaceId,
40
54
  name: client.workspaceName,
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Version of the running package, read from the package.json that ships next to `dist/`
3
+ * (and sits one level above `src/` when run from source). One source of truth: nothing
4
+ * in the code hard-codes a version.
5
+ */
6
+ export declare function readPackageVersion(): string;
@@ -0,0 +1,18 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ /**
5
+ * Version of the running package, read from the package.json that ships next to `dist/`
6
+ * (and sits one level above `src/` when run from source). One source of truth: nothing
7
+ * in the code hard-codes a version.
8
+ */
9
+ export function readPackageVersion() {
10
+ try {
11
+ const here = path.dirname(fileURLToPath(import.meta.url));
12
+ const pkg = JSON.parse(fs.readFileSync(path.join(here, '..', 'package.json'), 'utf-8'));
13
+ return typeof pkg.version === 'string' && pkg.version ? pkg.version : 'unknown';
14
+ }
15
+ catch {
16
+ return 'unknown';
17
+ }
18
+ }
@@ -84,4 +84,5 @@ export declare const IAM_ACCESS_REVIEW_TYPE_DEF: WorkflowTypeDef;
84
84
  export declare const SECURITY_AUDIT_TYPE_DEF: WorkflowTypeDef;
85
85
  export declare const SECRET_ROTATION_TYPE_DEF: WorkflowTypeDef;
86
86
  export declare const CAREER_APPLICATION_TYPE_DEF: WorkflowTypeDef;
87
+ export declare const VOICE_COMPOSE_TYPE_DEF: WorkflowTypeDef;
87
88
  export declare function createDefaultRegistry(): WorkflowRegistry;
@@ -439,6 +439,26 @@ export const CAREER_APPLICATION_TYPE_DEF = {
439
439
  guidance: 'CAREER_APPLICATION',
440
440
  maxInstances: 3,
441
441
  };
442
+ // ─── Voice Compose type definition (BUG-418) ───────────────────────────────
443
+ // tacit_compose_in_voice is in requiredTools, never gatedTools: gating would block every direct caller.
444
+ export const VOICE_COMPOSE_TYPE_DEF = {
445
+ name: 'voice_compose',
446
+ entryTool: null,
447
+ prereqs: {
448
+ kind: 'phased',
449
+ phases: [
450
+ { name: 'resolve_profile', requiredTools: ['tacit_voice_list_profiles'], gatedTools: [], approvalGate: false, guidance: 'VOICE_RESOLVE' },
451
+ { name: 'ground', requiredTools: [], gatedTools: [], approvalGate: false, guidance: 'VOICE_GROUND' },
452
+ { name: 'compose', requiredTools: ['tacit_compose_in_voice'], gatedTools: [], approvalGate: false, guidance: 'VOICE_COMPOSE_STEP' },
453
+ { name: 'verify', requiredTools: [], gatedTools: [], approvalGate: false, guidance: 'VOICE_VERIFY' },
454
+ ],
455
+ },
456
+ persistent: false,
457
+ failDirection: 'open',
458
+ sharedToolPolicy: 'passthrough',
459
+ guidance: 'VOICE_COMPOSE',
460
+ maxInstances: 3,
461
+ };
442
462
  // ─── Factory ────────────────────────────────────────────────────────────────
443
463
  export function createDefaultRegistry() {
444
464
  const registry = new WorkflowRegistry();
@@ -459,5 +479,6 @@ export function createDefaultRegistry() {
459
479
  registry.register(SECURITY_AUDIT_TYPE_DEF);
460
480
  registry.register(SECRET_ROTATION_TYPE_DEF);
461
481
  registry.register(CAREER_APPLICATION_TYPE_DEF);
482
+ registry.register(VOICE_COMPOSE_TYPE_DEF);
462
483
  return registry;
463
484
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tacitai/mcp-server",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "stdio MCP server wrapping Tacit /api/v1 REST/SSE API",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -42,5 +42,8 @@
42
42
  "@types/semver": "^7.5.0",
43
43
  "typescript": "^5.4.0",
44
44
  "vitest": "^4.1.7"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
45
48
  }
46
49
  }