gsd-pi 2.69.0 → 2.70.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/resources/extensions/gsd/bootstrap/system-context.js +6 -2
- package/dist/resources/extensions/gsd/commands-cmux.js +30 -1
- package/dist/resources/extensions/gsd/workflow-mcp.js +53 -6
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +12 -12
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +12 -12
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/package.json +1 -1
- package/packages/daemon/src/orchestrator.ts +9 -84
- package/packages/mcp-server/README.md +25 -3
- package/packages/mcp-server/dist/cli.d.ts +0 -1
- package/packages/mcp-server/dist/cli.d.ts.map +1 -1
- package/packages/mcp-server/dist/cli.js +4 -2
- package/packages/mcp-server/dist/cli.js.map +1 -1
- package/packages/mcp-server/dist/server.d.ts +32 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +118 -1
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/tool-credentials.d.ts +6 -0
- package/packages/mcp-server/dist/tool-credentials.d.ts.map +1 -0
- package/packages/mcp-server/dist/tool-credentials.js +90 -0
- package/packages/mcp-server/dist/tool-credentials.js.map +1 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts +1 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +274 -2
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/cli.ts +5 -3
- package/packages/mcp-server/src/mcp-server.test.ts +85 -1
- package/packages/mcp-server/src/server.ts +188 -1
- package/packages/mcp-server/src/tool-credentials.test.ts +95 -0
- package/packages/mcp-server/src/tool-credentials.ts +97 -0
- package/packages/mcp-server/src/workflow-tools.test.ts +32 -25
- package/packages/mcp-server/src/workflow-tools.ts +365 -2
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +1 -23
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/index.d.ts +3 -2
- package/packages/pi-ai/dist/utils/oauth/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/index.js +3 -5
- package/packages/pi-ai/dist/utils/oauth/index.js.map +1 -1
- package/packages/pi-ai/src/providers/anthropic.ts +1 -31
- package/packages/pi-ai/src/utils/oauth/index.ts +3 -5
- package/packages/pi-coding-agent/package.json +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +9 -5
- package/src/resources/extensions/gsd/commands-cmux.ts +32 -1
- package/src/resources/extensions/gsd/tests/cmux.test.ts +67 -1
- package/src/resources/extensions/gsd/tests/mcp-project-config.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +23 -7
- package/src/resources/extensions/gsd/workflow-mcp.ts +59 -5
- package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts +0 -17
- package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts.map +0 -1
- package/packages/pi-ai/dist/utils/oauth/anthropic.js +0 -106
- package/packages/pi-ai/dist/utils/oauth/anthropic.js.map +0 -1
- package/packages/pi-ai/src/utils/oauth/anthropic.ts +0 -140
- /package/dist/web/standalone/.next/static/{DrWdzskk28E5Qz-Wjw1mj → Nl6lg7zP5dNgNBV1107v1}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{DrWdzskk28E5Qz-Wjw1mj → Nl6lg7zP5dNgNBV1107v1}/_ssgManifest.js +0 -0
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Anthropic OAuth flow (Claude Pro/Max)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { generatePKCE } from "./pkce.js";
|
|
6
|
-
import type { OAuthCredentials, OAuthLoginCallbacks, OAuthProviderInterface } from "./types.js";
|
|
7
|
-
|
|
8
|
-
const decode = (s: string) => atob(s);
|
|
9
|
-
const CLIENT_ID = decode("OWQxYzI1MGEtZTYxYi00NGQ5LTg4ZWQtNTk0NGQxOTYyZjVl");
|
|
10
|
-
const AUTHORIZE_URL = "https://claude.ai/oauth/authorize";
|
|
11
|
-
const TOKEN_URL = "https://platform.claude.com/v1/oauth/token";
|
|
12
|
-
const REDIRECT_URI = "https://platform.claude.com/oauth/code/callback";
|
|
13
|
-
const SCOPES = "org:create_api_key user:profile user:inference";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Login with Anthropic OAuth (device code flow)
|
|
17
|
-
*
|
|
18
|
-
* @param onAuthUrl - Callback to handle the authorization URL (e.g., open browser)
|
|
19
|
-
* @param onPromptCode - Callback to prompt user for the authorization code
|
|
20
|
-
*/
|
|
21
|
-
export async function loginAnthropic(
|
|
22
|
-
onAuthUrl: (url: string) => void,
|
|
23
|
-
onPromptCode: () => Promise<string>,
|
|
24
|
-
): Promise<OAuthCredentials> {
|
|
25
|
-
const { verifier, challenge } = await generatePKCE();
|
|
26
|
-
|
|
27
|
-
// Build authorization URL
|
|
28
|
-
const authParams = new URLSearchParams({
|
|
29
|
-
code: "true",
|
|
30
|
-
client_id: CLIENT_ID,
|
|
31
|
-
response_type: "code",
|
|
32
|
-
redirect_uri: REDIRECT_URI,
|
|
33
|
-
scope: SCOPES,
|
|
34
|
-
code_challenge: challenge,
|
|
35
|
-
code_challenge_method: "S256",
|
|
36
|
-
state: verifier,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const authUrl = `${AUTHORIZE_URL}?${authParams.toString()}`;
|
|
40
|
-
|
|
41
|
-
// Notify caller with URL to open
|
|
42
|
-
onAuthUrl(authUrl);
|
|
43
|
-
|
|
44
|
-
// Wait for user to paste authorization code (format: code#state)
|
|
45
|
-
const authCode = await onPromptCode();
|
|
46
|
-
const splits = authCode.split("#");
|
|
47
|
-
const code = splits[0];
|
|
48
|
-
const state = splits[1];
|
|
49
|
-
|
|
50
|
-
// Exchange code for tokens
|
|
51
|
-
const tokenResponse = await fetch(TOKEN_URL, {
|
|
52
|
-
method: "POST",
|
|
53
|
-
headers: {
|
|
54
|
-
"Content-Type": "application/json",
|
|
55
|
-
},
|
|
56
|
-
body: JSON.stringify({
|
|
57
|
-
grant_type: "authorization_code",
|
|
58
|
-
client_id: CLIENT_ID,
|
|
59
|
-
code: code,
|
|
60
|
-
state: state,
|
|
61
|
-
redirect_uri: REDIRECT_URI,
|
|
62
|
-
code_verifier: verifier,
|
|
63
|
-
}),
|
|
64
|
-
signal: AbortSignal.timeout(30_000),
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
if (!tokenResponse.ok) {
|
|
68
|
-
const error = await tokenResponse.text();
|
|
69
|
-
throw new Error(`Token exchange failed: ${error}`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const tokenData = (await tokenResponse.json()) as {
|
|
73
|
-
access_token: string;
|
|
74
|
-
refresh_token: string;
|
|
75
|
-
expires_in: number;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// Calculate expiry time (current time + expires_in seconds - 5 min buffer)
|
|
79
|
-
const expiresAt = Date.now() + tokenData.expires_in * 1000 - 5 * 60 * 1000;
|
|
80
|
-
|
|
81
|
-
// Save credentials
|
|
82
|
-
return {
|
|
83
|
-
refresh: tokenData.refresh_token,
|
|
84
|
-
access: tokenData.access_token,
|
|
85
|
-
expires: expiresAt,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Refresh Anthropic OAuth token
|
|
91
|
-
*/
|
|
92
|
-
export async function refreshAnthropicToken(refreshToken: string): Promise<OAuthCredentials> {
|
|
93
|
-
const response = await fetch(TOKEN_URL, {
|
|
94
|
-
method: "POST",
|
|
95
|
-
headers: { "Content-Type": "application/json" },
|
|
96
|
-
body: JSON.stringify({
|
|
97
|
-
grant_type: "refresh_token",
|
|
98
|
-
client_id: CLIENT_ID,
|
|
99
|
-
refresh_token: refreshToken,
|
|
100
|
-
}),
|
|
101
|
-
signal: AbortSignal.timeout(30_000),
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
if (!response.ok) {
|
|
105
|
-
const error = await response.text();
|
|
106
|
-
throw new Error(`Anthropic token refresh failed: ${error}`);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const data = (await response.json()) as {
|
|
110
|
-
access_token: string;
|
|
111
|
-
refresh_token: string;
|
|
112
|
-
expires_in: number;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return {
|
|
116
|
-
refresh: data.refresh_token,
|
|
117
|
-
access: data.access_token,
|
|
118
|
-
expires: Date.now() + data.expires_in * 1000 - 5 * 60 * 1000,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export const anthropicOAuthProvider: OAuthProviderInterface = {
|
|
123
|
-
id: "anthropic",
|
|
124
|
-
name: "Anthropic (Claude Pro/Max)",
|
|
125
|
-
|
|
126
|
-
async login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials> {
|
|
127
|
-
return loginAnthropic(
|
|
128
|
-
(url) => callbacks.onAuth({ url }),
|
|
129
|
-
() => callbacks.onPrompt({ message: "Paste the authorization code:" }),
|
|
130
|
-
);
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
async refreshToken(credentials: OAuthCredentials): Promise<OAuthCredentials> {
|
|
134
|
-
return refreshAnthropicToken(credentials.refresh);
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
getApiKey(credentials: OAuthCredentials): string {
|
|
138
|
-
return credentials.access;
|
|
139
|
-
},
|
|
140
|
-
};
|
|
File without changes
|
|
File without changes
|