@shin1ohno/sage 0.2.4 → 0.5.3
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/cli/http-server-with-config.d.ts +38 -0
- package/dist/cli/http-server-with-config.d.ts.map +1 -0
- package/dist/cli/http-server-with-config.js +458 -0
- package/dist/cli/http-server-with-config.js.map +1 -0
- package/dist/cli/http-server.d.ts +74 -0
- package/dist/cli/http-server.d.ts.map +1 -0
- package/dist/cli/http-server.js +407 -0
- package/dist/cli/http-server.js.map +1 -0
- package/dist/cli/jwt-middleware.d.ts +36 -0
- package/dist/cli/jwt-middleware.d.ts.map +1 -0
- package/dist/cli/jwt-middleware.js +99 -0
- package/dist/cli/jwt-middleware.js.map +1 -0
- package/dist/cli/main-entry.d.ts +41 -0
- package/dist/cli/main-entry.d.ts.map +1 -0
- package/dist/cli/main-entry.js +80 -0
- package/dist/cli/main-entry.js.map +1 -0
- package/dist/cli/mcp-handler.d.ts +56 -0
- package/dist/cli/mcp-handler.d.ts.map +1 -0
- package/dist/cli/mcp-handler.js +2189 -0
- package/dist/cli/mcp-handler.js.map +1 -0
- package/dist/cli/parser.d.ts +43 -0
- package/dist/cli/parser.d.ts.map +1 -0
- package/dist/cli/parser.js +162 -0
- package/dist/cli/parser.js.map +1 -0
- package/dist/cli/remote-config-loader.d.ts +85 -0
- package/dist/cli/remote-config-loader.d.ts.map +1 -0
- package/dist/cli/remote-config-loader.js +129 -0
- package/dist/cli/remote-config-loader.js.map +1 -0
- package/dist/cli/secret-auth.d.ts +47 -0
- package/dist/cli/secret-auth.d.ts.map +1 -0
- package/dist/cli/secret-auth.js +165 -0
- package/dist/cli/secret-auth.js.map +1 -0
- package/dist/cli/sse-stream-handler.d.ts +45 -0
- package/dist/cli/sse-stream-handler.d.ts.map +1 -0
- package/dist/cli/sse-stream-handler.js +125 -0
- package/dist/cli/sse-stream-handler.js.map +1 -0
- package/dist/index.js +885 -209
- package/dist/index.js.map +1 -1
- package/dist/integrations/calendar-event-creator.d.ts +152 -0
- package/dist/integrations/calendar-event-creator.d.ts.map +1 -0
- package/dist/integrations/calendar-event-creator.js +507 -0
- package/dist/integrations/calendar-event-creator.js.map +1 -0
- package/dist/integrations/calendar-event-deleter.d.ts +137 -0
- package/dist/integrations/calendar-event-deleter.d.ts.map +1 -0
- package/dist/integrations/calendar-event-deleter.js +378 -0
- package/dist/integrations/calendar-event-deleter.js.map +1 -0
- package/dist/integrations/calendar-event-response.d.ts +213 -0
- package/dist/integrations/calendar-event-response.d.ts.map +1 -0
- package/dist/integrations/calendar-event-response.js +560 -0
- package/dist/integrations/calendar-event-response.js.map +1 -0
- package/dist/integrations/calendar-service.d.ts +85 -10
- package/dist/integrations/calendar-service.d.ts.map +1 -1
- package/dist/integrations/calendar-service.js +317 -35
- package/dist/integrations/calendar-service.js.map +1 -1
- package/dist/oauth/client-store.d.ts +36 -0
- package/dist/oauth/client-store.d.ts.map +1 -0
- package/dist/oauth/client-store.js +104 -0
- package/dist/oauth/client-store.js.map +1 -0
- package/dist/oauth/code-store.d.ts +48 -0
- package/dist/oauth/code-store.d.ts.map +1 -0
- package/dist/oauth/code-store.js +89 -0
- package/dist/oauth/code-store.js.map +1 -0
- package/dist/oauth/index.d.ts +13 -0
- package/dist/oauth/index.d.ts.map +1 -0
- package/dist/oauth/index.js +21 -0
- package/dist/oauth/index.js.map +1 -0
- package/dist/oauth/oauth-handler.d.ts +101 -0
- package/dist/oauth/oauth-handler.d.ts.map +1 -0
- package/dist/oauth/oauth-handler.js +577 -0
- package/dist/oauth/oauth-handler.js.map +1 -0
- package/dist/oauth/oauth-server.d.ts +165 -0
- package/dist/oauth/oauth-server.d.ts.map +1 -0
- package/dist/oauth/oauth-server.js +489 -0
- package/dist/oauth/oauth-server.js.map +1 -0
- package/dist/oauth/pkce.d.ts +48 -0
- package/dist/oauth/pkce.d.ts.map +1 -0
- package/dist/oauth/pkce.js +106 -0
- package/dist/oauth/pkce.js.map +1 -0
- package/dist/oauth/refresh-token-store.d.ts +45 -0
- package/dist/oauth/refresh-token-store.d.ts.map +1 -0
- package/dist/oauth/refresh-token-store.js +98 -0
- package/dist/oauth/refresh-token-store.js.map +1 -0
- package/dist/oauth/token-service.d.ts +46 -0
- package/dist/oauth/token-service.d.ts.map +1 -0
- package/dist/oauth/token-service.js +199 -0
- package/dist/oauth/token-service.js.map +1 -0
- package/dist/oauth/types.d.ts +264 -0
- package/dist/oauth/types.d.ts.map +1 -0
- package/dist/oauth/types.js +37 -0
- package/dist/oauth/types.js.map +1 -0
- package/dist/version.d.ts +9 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +11 -0
- package/dist/version.js.map +1 -0
- package/manifest.json +12 -20
- package/package.json +1 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth 2.1 Type Definitions
|
|
3
|
+
* Requirements: 21.1-21.6, 22.1-22.5, 23.1-23.9, 24.1-24.8, 25.1-25.10, 26.1-26.9
|
|
4
|
+
*
|
|
5
|
+
* Type definitions for OAuth 2.1 implementation based on:
|
|
6
|
+
* - OAuth 2.1 (draft-ietf-oauth-v2-1-13)
|
|
7
|
+
* - RFC 8414 (Authorization Server Metadata)
|
|
8
|
+
* - RFC 7591 (Dynamic Client Registration)
|
|
9
|
+
* - RFC 9728 (Protected Resource Metadata)
|
|
10
|
+
* - RFC 8707 (Resource Indicators)
|
|
11
|
+
* - RFC 7636 (PKCE)
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Supported OAuth scopes
|
|
15
|
+
* Requirement 22.2
|
|
16
|
+
*/
|
|
17
|
+
export type OAuthScope = 'mcp:read' | 'mcp:write' | 'mcp:admin';
|
|
18
|
+
/**
|
|
19
|
+
* Supported response types
|
|
20
|
+
* Requirement 23.6
|
|
21
|
+
*/
|
|
22
|
+
export type ResponseType = 'code';
|
|
23
|
+
/**
|
|
24
|
+
* Supported grant types
|
|
25
|
+
* Requirement 23.7
|
|
26
|
+
*/
|
|
27
|
+
export type GrantType = 'authorization_code' | 'refresh_token';
|
|
28
|
+
/**
|
|
29
|
+
* Supported code challenge methods
|
|
30
|
+
* Requirement 21.2, 23.8
|
|
31
|
+
*/
|
|
32
|
+
export type CodeChallengeMethod = 'S256';
|
|
33
|
+
/**
|
|
34
|
+
* Supported token endpoint auth methods
|
|
35
|
+
* Requirement 23.9
|
|
36
|
+
*/
|
|
37
|
+
export type TokenEndpointAuthMethod = 'none' | 'client_secret_post';
|
|
38
|
+
/**
|
|
39
|
+
* OAuth Client Registration Request (RFC 7591)
|
|
40
|
+
* Requirement 24.1-24.7
|
|
41
|
+
*/
|
|
42
|
+
export interface ClientRegistrationRequest {
|
|
43
|
+
client_name: string;
|
|
44
|
+
redirect_uris: string[];
|
|
45
|
+
response_types?: ResponseType[];
|
|
46
|
+
grant_types?: GrantType[];
|
|
47
|
+
token_endpoint_auth_method?: TokenEndpointAuthMethod;
|
|
48
|
+
scope?: string;
|
|
49
|
+
contacts?: string[];
|
|
50
|
+
logo_uri?: string;
|
|
51
|
+
client_uri?: string;
|
|
52
|
+
policy_uri?: string;
|
|
53
|
+
tos_uri?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* OAuth Client Metadata (RFC 7591)
|
|
57
|
+
* Requirement 24.6
|
|
58
|
+
*/
|
|
59
|
+
export interface OAuthClient {
|
|
60
|
+
client_id: string;
|
|
61
|
+
client_name: string;
|
|
62
|
+
redirect_uris: string[];
|
|
63
|
+
response_types: ResponseType[];
|
|
64
|
+
grant_types: GrantType[];
|
|
65
|
+
token_endpoint_auth_method: TokenEndpointAuthMethod;
|
|
66
|
+
client_id_issued_at: number;
|
|
67
|
+
client_secret?: string;
|
|
68
|
+
client_secret_expires_at?: number;
|
|
69
|
+
scope?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Authorization Request Parameters
|
|
73
|
+
* Requirement 25.1-25.10
|
|
74
|
+
*/
|
|
75
|
+
export interface AuthorizationRequest {
|
|
76
|
+
response_type: ResponseType;
|
|
77
|
+
client_id: string;
|
|
78
|
+
redirect_uri: string;
|
|
79
|
+
scope?: string;
|
|
80
|
+
state: string;
|
|
81
|
+
code_challenge: string;
|
|
82
|
+
code_challenge_method: CodeChallengeMethod;
|
|
83
|
+
resource?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Authorization Code Data (internal)
|
|
87
|
+
* Requirement 25.9, 25.10
|
|
88
|
+
*/
|
|
89
|
+
export interface AuthorizationCode {
|
|
90
|
+
code: string;
|
|
91
|
+
client_id: string;
|
|
92
|
+
redirect_uri: string;
|
|
93
|
+
scope: string;
|
|
94
|
+
code_challenge: string;
|
|
95
|
+
code_challenge_method: CodeChallengeMethod;
|
|
96
|
+
resource?: string;
|
|
97
|
+
user_id: string;
|
|
98
|
+
created_at: number;
|
|
99
|
+
expires_at: number;
|
|
100
|
+
used: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Token Request for authorization_code grant
|
|
104
|
+
* Requirement 26.1-26.5
|
|
105
|
+
*/
|
|
106
|
+
export interface TokenRequestAuthorizationCode {
|
|
107
|
+
grant_type: 'authorization_code';
|
|
108
|
+
code: string;
|
|
109
|
+
client_id: string;
|
|
110
|
+
redirect_uri: string;
|
|
111
|
+
code_verifier: string;
|
|
112
|
+
resource?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Token Request for refresh_token grant
|
|
116
|
+
* Requirement 26.3
|
|
117
|
+
*/
|
|
118
|
+
export interface TokenRequestRefreshToken {
|
|
119
|
+
grant_type: 'refresh_token';
|
|
120
|
+
refresh_token: string;
|
|
121
|
+
client_id: string;
|
|
122
|
+
scope?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Token Request (union type)
|
|
126
|
+
*/
|
|
127
|
+
export type TokenRequest = TokenRequestAuthorizationCode | TokenRequestRefreshToken;
|
|
128
|
+
/**
|
|
129
|
+
* Token Response
|
|
130
|
+
* Requirement 26.7
|
|
131
|
+
*/
|
|
132
|
+
export interface TokenResponse {
|
|
133
|
+
access_token: string;
|
|
134
|
+
token_type: 'Bearer';
|
|
135
|
+
expires_in: number;
|
|
136
|
+
refresh_token?: string;
|
|
137
|
+
scope?: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Access Token Claims (JWT payload)
|
|
141
|
+
* Requirement 26.6, 27.4
|
|
142
|
+
*/
|
|
143
|
+
export interface AccessTokenClaims {
|
|
144
|
+
iss: string;
|
|
145
|
+
sub: string;
|
|
146
|
+
aud: string;
|
|
147
|
+
exp: number;
|
|
148
|
+
iat: number;
|
|
149
|
+
jti: string;
|
|
150
|
+
client_id: string;
|
|
151
|
+
scope: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Refresh Token Data (internal)
|
|
155
|
+
* Requirement 21.6, 26.8
|
|
156
|
+
*/
|
|
157
|
+
export interface RefreshToken {
|
|
158
|
+
token: string;
|
|
159
|
+
client_id: string;
|
|
160
|
+
user_id: string;
|
|
161
|
+
scope: string;
|
|
162
|
+
created_at: number;
|
|
163
|
+
expires_at: number;
|
|
164
|
+
rotated: boolean;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Protected Resource Metadata (RFC 9728)
|
|
168
|
+
* Requirement 22.1-22.3
|
|
169
|
+
*/
|
|
170
|
+
export interface ProtectedResourceMetadata {
|
|
171
|
+
resource: string;
|
|
172
|
+
authorization_servers: string[];
|
|
173
|
+
scopes_supported?: string[];
|
|
174
|
+
bearer_methods_supported?: string[];
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Authorization Server Metadata (RFC 8414)
|
|
178
|
+
* Requirement 23.1-23.9
|
|
179
|
+
*/
|
|
180
|
+
export interface AuthorizationServerMetadata {
|
|
181
|
+
issuer: string;
|
|
182
|
+
authorization_endpoint: string;
|
|
183
|
+
token_endpoint: string;
|
|
184
|
+
registration_endpoint?: string;
|
|
185
|
+
scopes_supported?: string[];
|
|
186
|
+
response_types_supported: ResponseType[];
|
|
187
|
+
response_modes_supported?: string[];
|
|
188
|
+
grant_types_supported: GrantType[];
|
|
189
|
+
token_endpoint_auth_methods_supported: TokenEndpointAuthMethod[];
|
|
190
|
+
code_challenge_methods_supported: CodeChallengeMethod[];
|
|
191
|
+
service_documentation?: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* OAuth Error Response
|
|
195
|
+
*/
|
|
196
|
+
export interface OAuthError {
|
|
197
|
+
error: string;
|
|
198
|
+
error_description?: string;
|
|
199
|
+
error_uri?: string;
|
|
200
|
+
state?: string;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* OAuth Error Codes
|
|
204
|
+
*/
|
|
205
|
+
export type OAuthErrorCode = 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'invalid_client' | 'invalid_grant' | 'unsupported_grant_type' | 'invalid_token' | 'insufficient_scope';
|
|
206
|
+
/**
|
|
207
|
+
* User for authentication
|
|
208
|
+
* Requirement 29.1-29.4
|
|
209
|
+
*/
|
|
210
|
+
export interface OAuthUser {
|
|
211
|
+
id: string;
|
|
212
|
+
username: string;
|
|
213
|
+
passwordHash: string;
|
|
214
|
+
createdAt: number;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* User Session
|
|
218
|
+
*/
|
|
219
|
+
export interface UserSession {
|
|
220
|
+
sessionId: string;
|
|
221
|
+
userId: string;
|
|
222
|
+
createdAt: number;
|
|
223
|
+
expiresAt: number;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* OAuth Configuration
|
|
227
|
+
*/
|
|
228
|
+
export interface OAuthConfig {
|
|
229
|
+
issuer: string;
|
|
230
|
+
accessTokenExpiry: string;
|
|
231
|
+
refreshTokenExpiry: string;
|
|
232
|
+
authorizationCodeExpiry: string;
|
|
233
|
+
allowedRedirectUris: string[];
|
|
234
|
+
scopes: Record<OAuthScope, string>;
|
|
235
|
+
users: OAuthUser[];
|
|
236
|
+
privateKey?: string;
|
|
237
|
+
publicKey?: string;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Scope definitions with descriptions
|
|
241
|
+
*/
|
|
242
|
+
export declare const SCOPE_DEFINITIONS: Record<OAuthScope, string>;
|
|
243
|
+
/**
|
|
244
|
+
* Claude official callback URLs
|
|
245
|
+
* Requirement 24.4, 24.5, 31.1, 31.2
|
|
246
|
+
*/
|
|
247
|
+
export declare const CLAUDE_CALLBACK_URLS: string[];
|
|
248
|
+
/**
|
|
249
|
+
* Default token expiry durations
|
|
250
|
+
*/
|
|
251
|
+
export declare const DEFAULT_TOKEN_EXPIRY: {
|
|
252
|
+
accessToken: string;
|
|
253
|
+
refreshToken: string;
|
|
254
|
+
authorizationCode: string;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Verify Token Result
|
|
258
|
+
*/
|
|
259
|
+
export interface VerifyTokenResult {
|
|
260
|
+
valid: boolean;
|
|
261
|
+
claims?: AccessTokenClaims;
|
|
262
|
+
error?: string;
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/oauth/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,oBAAoB,GAAG,eAAe,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEzC;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,oBAAoB,CAAC;AAEpE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Definitions
|
|
3
|
+
* Requirements: 21.1-21.6, 22.1-22.5, 23.1-23.9, 24.1-24.8, 25.1-25.10, 26.1-26.9
|
|
4
|
+
*
|
|
5
|
+
* Type definitions for OAuth 2.1 implementation based on:
|
|
6
|
+
* - OAuth 2.1 (draft-ietf-oauth-v2-1-13)
|
|
7
|
+
* - RFC 8414 (Authorization Server Metadata)
|
|
8
|
+
* - RFC 7591 (Dynamic Client Registration)
|
|
9
|
+
* - RFC 9728 (Protected Resource Metadata)
|
|
10
|
+
* - RFC 8707 (Resource Indicators)
|
|
11
|
+
* - RFC 7636 (PKCE)
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Scope definitions with descriptions
|
|
15
|
+
*/
|
|
16
|
+
export const SCOPE_DEFINITIONS = {
|
|
17
|
+
'mcp:read': '読み取り専用アクセス',
|
|
18
|
+
'mcp:write': '読み書きアクセス',
|
|
19
|
+
'mcp:admin': '管理者アクセス',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Claude official callback URLs
|
|
23
|
+
* Requirement 24.4, 24.5, 31.1, 31.2
|
|
24
|
+
*/
|
|
25
|
+
export const CLAUDE_CALLBACK_URLS = [
|
|
26
|
+
'https://claude.ai/api/mcp/auth_callback',
|
|
27
|
+
'https://claude.com/api/mcp/auth_callback',
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* Default token expiry durations
|
|
31
|
+
*/
|
|
32
|
+
export const DEFAULT_TOKEN_EXPIRY = {
|
|
33
|
+
accessToken: '1h',
|
|
34
|
+
refreshToken: '30d',
|
|
35
|
+
authorizationCode: '10m',
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/oauth/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAsQH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA+B;IAC3D,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,yCAAyC;IACzC,0CAA0C;CAC3C,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,KAAK;IACnB,iBAAiB,EAAE,KAAK;CACzB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version information for sage
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for version number.
|
|
5
|
+
* Import this instead of hardcoding version strings.
|
|
6
|
+
*/
|
|
7
|
+
export declare const VERSION = "0.5.3";
|
|
8
|
+
export declare const SERVER_NAME = "sage";
|
|
9
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,WAAW,SAAS,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version information for sage
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for version number.
|
|
5
|
+
* Import this instead of hardcoding version strings.
|
|
6
|
+
*/
|
|
7
|
+
// Version is updated by npm version command and build process
|
|
8
|
+
// Keep in sync with package.json
|
|
9
|
+
export const VERSION = '0.5.3';
|
|
10
|
+
export const SERVER_NAME = 'sage';
|
|
11
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8DAA8D;AAC9D,iCAAiC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC"}
|
package/manifest.json
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": "0.2",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"name": "sage",
|
|
4
|
+
"display_name": "sage - AI Task Manager",
|
|
5
|
+
"version": "0.3.0",
|
|
5
6
|
"description": "AI Task Management Assistant for Claude. Analyze tasks, set priorities, manage reminders, and integrate with Apple Reminders, Notion, and Calendar.",
|
|
6
|
-
"version": "0.2.4",
|
|
7
7
|
"author": {
|
|
8
|
-
"name": "shin1ohno"
|
|
8
|
+
"name": "shin1ohno",
|
|
9
|
+
"url": "https://github.com/shin1ohno"
|
|
9
10
|
},
|
|
10
|
-
"website": "https://github.com/shin1ohno/sage",
|
|
11
11
|
"server": {
|
|
12
12
|
"type": "node",
|
|
13
|
-
"entry_point": "dist/index.js"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
"entry_point": "dist/index.js",
|
|
14
|
+
"mcp_config": {
|
|
15
|
+
"command": "node",
|
|
16
|
+
"args": ["${__dirname}/dist/index.js"],
|
|
17
|
+
"env": {}
|
|
18
|
+
}
|
|
19
19
|
},
|
|
20
|
-
"permissions": [
|
|
21
|
-
"filesystem.read",
|
|
22
|
-
"filesystem.write"
|
|
23
|
-
],
|
|
24
20
|
"tools": [
|
|
25
21
|
{
|
|
26
22
|
"name": "check_setup_status",
|
|
@@ -66,9 +62,5 @@
|
|
|
66
62
|
"name": "update_task_status",
|
|
67
63
|
"description": "Update the status of a task and optionally sync across sources."
|
|
68
64
|
}
|
|
69
|
-
]
|
|
70
|
-
"update": {
|
|
71
|
-
"type": "github_release",
|
|
72
|
-
"repo": "shin1ohno/sage"
|
|
73
|
-
}
|
|
65
|
+
]
|
|
74
66
|
}
|