@tacitai/mcp-server 0.7.0 → 0.8.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/dist/api-errors.d.ts +102 -0
- package/dist/api-errors.js +165 -0
- package/dist/autonomy.d.ts +46 -0
- package/dist/autonomy.js +118 -0
- package/dist/claude-config.d.ts +139 -0
- package/dist/claude-config.js +339 -0
- package/dist/cli-launch.d.ts +33 -0
- package/dist/cli-launch.js +178 -0
- package/dist/cli-login.d.ts +34 -0
- package/dist/cli-login.js +200 -0
- package/dist/cli-mode.d.ts +47 -0
- package/dist/cli-mode.js +170 -0
- package/dist/cli-profiles.d.ts +37 -0
- package/dist/cli-profiles.js +344 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +59 -458
- package/dist/client.d.ts +88 -52
- package/dist/client.js +195 -295
- package/dist/credentials.d.ts +81 -0
- package/dist/credentials.js +291 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +37 -89
- package/dist/oauth.d.ts +1 -1
- package/dist/oauth.js +5 -5
- package/dist/profile-store.d.ts +96 -0
- package/dist/profile-store.js +382 -0
- package/dist/prompt.d.ts +32 -0
- package/dist/prompt.js +99 -0
- package/dist/prompts.d.ts +2 -2
- package/dist/prompts.js +3 -3
- package/dist/server-mode.d.ts +65 -0
- package/dist/server-mode.js +99 -0
- package/dist/setup-migrate.d.ts +35 -0
- package/dist/setup-migrate.js +204 -0
- package/dist/setup.d.ts +41 -66
- package/dist/setup.js +361 -531
- package/dist/signin.d.ts +108 -0
- package/dist/signin.js +595 -0
- package/dist/tools/agents.d.ts +4 -4
- package/dist/tools/artifacts.d.ts +2 -0
- package/dist/tools/artifacts.js +8 -1
- package/dist/tools/errors.d.ts +12 -0
- package/dist/tools/errors.js +65 -0
- package/dist/tools/exec-route.d.ts +34 -0
- package/dist/tools/exec-route.js +101 -27
- package/dist/tools/iam.js +2 -3
- package/dist/tools/secretary.d.ts +1 -0
- package/dist/tools/secretary.js +2 -1
- package/dist/tools/synthesize.d.ts +37 -0
- package/dist/tools/synthesize.js +126 -7
- package/dist/tools/voice.d.ts +3 -2
- package/dist/tools/voice.js +70 -18
- package/dist/tools/workspaces.js +7 -4
- package/dist/version.d.ts +6 -0
- package/dist/version.js +18 -0
- package/dist/workflow-registry.d.ts +1 -0
- package/dist/workflow-registry.js +21 -0
- package/package.json +4 -1
package/dist/signin.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one shared CLI sign-in flow (MV-1542c step 1.2).
|
|
3
|
+
*
|
|
4
|
+
* device (S-1): status check -> 5 s preflight -> PKCE -> loopback listener -> browser -> exchange
|
|
5
|
+
* password (S-2): status check -> email + hidden password -> login -> workspace picker -> self-issue
|
|
6
|
+
*
|
|
7
|
+
* Every path ends in `validateIssued` then a confirming `whoami`. This module
|
|
8
|
+
* never touches the file system: writing the profile is the caller's job
|
|
9
|
+
* (setup.ts, cli-login.ts). The password-path session JWT lives in one local
|
|
10
|
+
* variable, is only ever sent in an Authorization header, and is cleared in a
|
|
11
|
+
* `finally`. It is never written to disk, never passed to `execFile`, never
|
|
12
|
+
* logged.
|
|
13
|
+
*/
|
|
14
|
+
export interface SignInIo {
|
|
15
|
+
isTTY: boolean;
|
|
16
|
+
/** stderr line. Never receives a token or a session JWT. */
|
|
17
|
+
log(line: string): void;
|
|
18
|
+
promptLine(question: string): Promise<string>;
|
|
19
|
+
/** Hidden input (see prompt.ts). */
|
|
20
|
+
promptHidden(question: string): Promise<string>;
|
|
21
|
+
choose(question: string, items: string[], defaultIdx: number): Promise<number>;
|
|
22
|
+
/** The question text already carries its own "(y/N)" hint; do not add another. */
|
|
23
|
+
confirm(question: string, defaultYes: boolean): Promise<boolean>;
|
|
24
|
+
/** Test seam. Absent: the built-in opener (`openBrowser`, honours `BROWSER`). */
|
|
25
|
+
openBrowser?(url: string): Promise<'opened' | 'failed'>;
|
|
26
|
+
}
|
|
27
|
+
export interface SignInOptions {
|
|
28
|
+
/** Normalised, no trailing slash. */
|
|
29
|
+
apiUrl: string;
|
|
30
|
+
appUrl: string;
|
|
31
|
+
/** 'pin' when --no-browser. */
|
|
32
|
+
mode: 'auto' | 'pin';
|
|
33
|
+
deviceLabel: string;
|
|
34
|
+
/** Default 9123. 0 picks a free port (tests). */
|
|
35
|
+
callbackPort?: number;
|
|
36
|
+
/** Default 180_000 (D-10; the approval code itself lives 120 s). */
|
|
37
|
+
approvalTimeoutMs?: number;
|
|
38
|
+
/** password re-login of a known profile (S-4): the old IAM row to supersede. */
|
|
39
|
+
rotateTokenId?: string;
|
|
40
|
+
io: SignInIo;
|
|
41
|
+
fetchFn?: typeof fetch;
|
|
42
|
+
/** Tests. Defaults: process.env / process.platform. */
|
|
43
|
+
env?: NodeJS.ProcessEnv;
|
|
44
|
+
platform?: NodeJS.Platform;
|
|
45
|
+
/** Preflight timeout, default 5000. */
|
|
46
|
+
preflightTimeoutMs?: number;
|
|
47
|
+
/** Per-request timeout for API calls, default 30000. */
|
|
48
|
+
requestTimeoutMs?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface IssuedCredential {
|
|
51
|
+
token: string;
|
|
52
|
+
tokenId: string;
|
|
53
|
+
expiresAt: string;
|
|
54
|
+
workspaceId: string;
|
|
55
|
+
workspaceName: string;
|
|
56
|
+
identityEmail: string;
|
|
57
|
+
deviceLabel: string;
|
|
58
|
+
channel: 'device' | 'pin';
|
|
59
|
+
}
|
|
60
|
+
export type SignInErrorCode = 'STATE_MISMATCH' | 'DENIED' | 'CALLBACK_ERROR' | 'SIGNIN_DISABLED' | 'CODE_INVALID' | 'PKCE_MISMATCH' | 'NOT_A_MEMBER' | 'WORKSPACE_INACTIVE' | 'MEMBERSHIP_INACTIVE' | 'RATE_LIMITED' | 'SERVER_TOO_OLD' | 'BAD_ISSUE_RESPONSE' | 'MUST_CHANGE_PIN' | 'TOKEN_NOT_OWNED' | 'LOGIN_FAILED' | 'NO_TTY' | 'CANCELLED' | 'NETWORK' | 'TIMEOUT' | 'PORT_BUSY' | 'NO_BROWSER' | 'APP_UNREACHABLE';
|
|
61
|
+
export declare class SignInError extends Error {
|
|
62
|
+
readonly code: SignInErrorCode;
|
|
63
|
+
readonly exitCode: 1 | 2;
|
|
64
|
+
/**
|
|
65
|
+
* true when `message` was already written through `io.log` (a declined password
|
|
66
|
+
* offer): the caller should only set the exit code, not print it again.
|
|
67
|
+
*/
|
|
68
|
+
reported: boolean;
|
|
69
|
+
constructor(code: SignInErrorCode, message: string, exitCode?: 1 | 2);
|
|
70
|
+
}
|
|
71
|
+
export interface CliSigninStatus {
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
cli_login_ttl_days: number;
|
|
74
|
+
}
|
|
75
|
+
export declare const SIGNIN_DISABLED_MESSAGE = "TACIT CLI sign-in is turned off on this server. Ask your workspace owner.";
|
|
76
|
+
export declare const PIN_OFFER_QUESTION = "Sign in with your email and password instead? (y/N) ";
|
|
77
|
+
export declare const NO_TTY_HINT = "Use --no-browser from a terminal to sign in with email and password";
|
|
78
|
+
/** RFC 7636 §4.2, S256. */
|
|
79
|
+
export declare function s256Challenge(verifier: string): string;
|
|
80
|
+
/** verifier = 32 random bytes, base64url (43 chars). */
|
|
81
|
+
export declare function newPkcePair(): {
|
|
82
|
+
verifier: string;
|
|
83
|
+
challenge: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* First call of every sign-in. Returns only when sign-in is enabled.
|
|
87
|
+
* `enabled:false` throws SIGNIN_DISABLED (exit 1, no browser, no password offer);
|
|
88
|
+
* a 404 (server older than this mission) throws SERVER_TOO_OLD.
|
|
89
|
+
*/
|
|
90
|
+
export declare function checkCliSigninStatus(apiUrl: string, fetchFn?: typeof fetch): Promise<CliSigninStatus>;
|
|
91
|
+
/**
|
|
92
|
+
* `now` is epoch ms and should come from the response `Date` header, not the
|
|
93
|
+
* local clock (AR-17); the server decides real expiry.
|
|
94
|
+
*/
|
|
95
|
+
export declare function validateIssued(resp: unknown, now: number): Omit<IssuedCredential, 'channel'>;
|
|
96
|
+
/**
|
|
97
|
+
* Honours the standard `BROWSER` env: the command is run with execFile and the
|
|
98
|
+
* URL as its only argument, never through a shell. Unset = platform default.
|
|
99
|
+
* Only http(s) URLs are ever passed.
|
|
100
|
+
*/
|
|
101
|
+
export declare function openBrowser(url: string, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): Promise<'opened' | 'failed'>;
|
|
102
|
+
/** Rows 2-5 of P1.2 are the only paths to a password offer (D-96: default N). */
|
|
103
|
+
export declare function deviceFailureAction(e: SignInError): 'offer-pin-default-no' | 'abort';
|
|
104
|
+
/**
|
|
105
|
+
* Throws SignInError. Order: cli-signin-status, then device or password.
|
|
106
|
+
* Success logs `Signed in as <email> to <workspace> (expires <date>).`
|
|
107
|
+
*/
|
|
108
|
+
export declare function signIn(opts: SignInOptions): Promise<IssuedCredential>;
|