@fre4x/jules 1.0.1 → 1.0.4
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/LICENSE +21 -21
- package/README.md +71 -71
- package/dist/__tests__/julesApiClient.test.js +12 -8
- package/dist/__tests__/julesApiClient.test.js.map +1 -1
- package/dist/__tests__/toolRegistration.test.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/mock.d.ts.map +1 -1
- package/dist/mock.js +26 -26
- package/dist/mock.js.map +1 -1
- package/dist/schemas/julesSchemas.d.ts +55 -79
- package/dist/schemas/julesSchemas.d.ts.map +1 -1
- package/dist/schemas/julesSchemas.js +40 -12
- package/dist/schemas/julesSchemas.js.map +1 -1
- package/dist/services/julesApiClient.d.ts +2 -2
- package/dist/services/julesApiClient.d.ts.map +1 -1
- package/dist/services/julesApiClient.js +27 -19
- package/dist/services/julesApiClient.js.map +1 -1
- package/dist/tools/approvePlan.d.ts +1 -1
- package/dist/tools/approvePlan.d.ts.map +1 -1
- package/dist/tools/approvePlan.js +20 -17
- package/dist/tools/approvePlan.js.map +1 -1
- package/dist/tools/createSession.d.ts +1 -1
- package/dist/tools/createSession.d.ts.map +1 -1
- package/dist/tools/createSession.js +35 -30
- package/dist/tools/createSession.js.map +1 -1
- package/dist/tools/listSessions.d.ts +1 -1
- package/dist/tools/listSessions.d.ts.map +1 -1
- package/dist/tools/listSessions.js +37 -36
- package/dist/tools/listSessions.js.map +1 -1
- package/dist/tools/listSources.d.ts +1 -1
- package/dist/tools/listSources.d.ts.map +1 -1
- package/dist/tools/listSources.js +31 -20
- package/dist/tools/listSources.js.map +1 -1
- package/package.json +8 -8
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 fritzprix
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 fritzprix
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
# Jules MCP Server
|
|
2
|
-
|
|
3
|
-
An MCP server implementation for [Jules API](https://developers.google.com/jules/api), allowing LLMs to interact directly with your automated Jules workflows.
|
|
4
|
-
|
|
5
|
-
## Prerequisites
|
|
6
|
-
|
|
7
|
-
1. **Jules API Key**: Get your API Key from the Jules [Settings page](https://jules.google.com/settings#api).
|
|
8
|
-
* *Note: Currently, Jules is migrating its authentication methods. If you receive a `401 Unauthorized` indicating "API keys are not supported by this API," you may need to wait for further updates from the Jules platform or supply an OAuth2 Token in place of the API key if supported.*
|
|
9
|
-
|
|
10
|
-
## Installation & Usage
|
|
11
|
-
|
|
12
|
-
You can use the server directly via `npx` without installing it globally:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npx jules-mcp
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### Environment Variables
|
|
19
|
-
|
|
20
|
-
The server requires the following environment variables:
|
|
21
|
-
|
|
22
|
-
- `JULES_API_KEY`: Your Jules API Key or Authentication Token.
|
|
23
|
-
|
|
24
|
-
## Configuration for Claude Desktop
|
|
25
|
-
|
|
26
|
-
To use this server with the Claude Desktop app, you need to add it to your configuration file.
|
|
27
|
-
|
|
28
|
-
**Config file locations:**
|
|
29
|
-
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
30
|
-
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
31
|
-
|
|
32
|
-
Add the following to your configuration, replacing `<YOUR_API_KEY>` with your actual Jules API key:
|
|
33
|
-
|
|
34
|
-
```json
|
|
35
|
-
{
|
|
36
|
-
"mcpServers": {
|
|
37
|
-
"jules": {
|
|
38
|
-
"command": "npx",
|
|
39
|
-
"args": [
|
|
40
|
-
"-y",
|
|
41
|
-
"jules-mcp"
|
|
42
|
-
],
|
|
43
|
-
"env": {
|
|
44
|
-
"JULES_API_KEY": "<YOUR_API_KEY>"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Available Tools
|
|
52
|
-
|
|
53
|
-
The server implements the following tools:
|
|
54
|
-
|
|
55
|
-
- `jules_list_sources`: Find the IDs of sources (e.g., connected GitHub repos) you can interact with.
|
|
56
|
-
- `jules_create_session`: Start a new Jules coding session with a specific prompt and source context.
|
|
57
|
-
- `jules_list_sessions`: Check the status and output links (e.g., Pull Requests) of your sessions.
|
|
58
|
-
- `jules_approve_plan`: Approve a session's execution plan (if it was created with `requirePlanApproval=true`).
|
|
59
|
-
|
|
60
|
-
## Development
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# Install dependencies
|
|
64
|
-
npm install
|
|
65
|
-
|
|
66
|
-
# Build the project
|
|
67
|
-
npm run build
|
|
68
|
-
|
|
69
|
-
# Run via MCP Inspector for testing
|
|
70
|
-
npm run inspector
|
|
71
|
-
```
|
|
1
|
+
# Jules MCP Server
|
|
2
|
+
|
|
3
|
+
An MCP server implementation for [Jules API](https://developers.google.com/jules/api), allowing LLMs to interact directly with your automated Jules workflows.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
1. **Jules API Key**: Get your API Key from the Jules [Settings page](https://jules.google.com/settings#api).
|
|
8
|
+
* *Note: Currently, Jules is migrating its authentication methods. If you receive a `401 Unauthorized` indicating "API keys are not supported by this API," you may need to wait for further updates from the Jules platform or supply an OAuth2 Token in place of the API key if supported.*
|
|
9
|
+
|
|
10
|
+
## Installation & Usage
|
|
11
|
+
|
|
12
|
+
You can use the server directly via `npx` without installing it globally:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx jules-mcp
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Environment Variables
|
|
19
|
+
|
|
20
|
+
The server requires the following environment variables:
|
|
21
|
+
|
|
22
|
+
- `JULES_API_KEY`: Your Jules API Key or Authentication Token.
|
|
23
|
+
|
|
24
|
+
## Configuration for Claude Desktop
|
|
25
|
+
|
|
26
|
+
To use this server with the Claude Desktop app, you need to add it to your configuration file.
|
|
27
|
+
|
|
28
|
+
**Config file locations:**
|
|
29
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
30
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
31
|
+
|
|
32
|
+
Add the following to your configuration, replacing `<YOUR_API_KEY>` with your actual Jules API key:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"jules": {
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": [
|
|
40
|
+
"-y",
|
|
41
|
+
"jules-mcp"
|
|
42
|
+
],
|
|
43
|
+
"env": {
|
|
44
|
+
"JULES_API_KEY": "<YOUR_API_KEY>"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Available Tools
|
|
52
|
+
|
|
53
|
+
The server implements the following tools:
|
|
54
|
+
|
|
55
|
+
- `jules_list_sources`: Find the IDs of sources (e.g., connected GitHub repos) you can interact with.
|
|
56
|
+
- `jules_create_session`: Start a new Jules coding session with a specific prompt and source context.
|
|
57
|
+
- `jules_list_sessions`: Check the status and output links (e.g., Pull Requests) of your sessions.
|
|
58
|
+
- `jules_approve_plan`: Approve a session's execution plan (if it was created with `requirePlanApproval=true`).
|
|
59
|
+
|
|
60
|
+
## Development
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Install dependencies
|
|
64
|
+
npm install
|
|
65
|
+
|
|
66
|
+
# Build the project
|
|
67
|
+
npm run build
|
|
68
|
+
|
|
69
|
+
# Run via MCP Inspector for testing
|
|
70
|
+
npm run inspector
|
|
71
|
+
```
|
|
@@ -3,6 +3,7 @@ import axios from 'axios';
|
|
|
3
3
|
import MockAdapter from 'axios-mock-adapter';
|
|
4
4
|
import { julesApiRequest, handleApiError } from '../services/julesApiClient.js';
|
|
5
5
|
import { API_BASE_URL } from '../constants.js';
|
|
6
|
+
// biome-ignore lint/suspicious/noExplicitAny: Axios type mismatch between static and instance in this environment
|
|
6
7
|
const mock = new MockAdapter(axios);
|
|
7
8
|
describe('julesApiClient', () => {
|
|
8
9
|
beforeEach(() => {
|
|
@@ -11,9 +12,9 @@ describe('julesApiClient', () => {
|
|
|
11
12
|
});
|
|
12
13
|
it('should make an authenticated GET request', async () => {
|
|
13
14
|
mock.onGet(`${API_BASE_URL}/v1alpha/sources`).reply(200, {
|
|
14
|
-
sources: [{ name: 'test-source' }]
|
|
15
|
+
sources: [{ name: 'test-source' }],
|
|
15
16
|
});
|
|
16
|
-
const result = await julesApiRequest('/v1alpha/sources');
|
|
17
|
+
const result = (await julesApiRequest('/v1alpha/sources'));
|
|
17
18
|
expect(result.sources[0].name).toBe('test-source');
|
|
18
19
|
expect(mock.history.get[0].headers?.['X-Goog-Api-Key']).toBe('test-api-key');
|
|
19
20
|
});
|
|
@@ -24,25 +25,28 @@ describe('julesApiClient', () => {
|
|
|
24
25
|
it('should handle API errors correctly', async () => {
|
|
25
26
|
// Simulate a network call that fails with 401
|
|
26
27
|
mock.onGet(`${API_BASE_URL}/v1alpha/sources`).reply(401, {
|
|
27
|
-
error: { message: 'Unauthorized' }
|
|
28
|
+
error: { message: 'Unauthorized' },
|
|
28
29
|
});
|
|
30
|
+
await expect(julesApiRequest('/v1alpha/sources')).rejects.toThrow();
|
|
29
31
|
try {
|
|
30
32
|
await julesApiRequest('/v1alpha/sources');
|
|
31
33
|
}
|
|
32
34
|
catch (error) {
|
|
33
|
-
const
|
|
34
|
-
expect(
|
|
35
|
-
expect(
|
|
35
|
+
const result = handleApiError(error);
|
|
36
|
+
expect(result.content[0].text).toContain('Unauthorized (401)');
|
|
37
|
+
expect(result.isError).toBe(true);
|
|
36
38
|
}
|
|
37
39
|
});
|
|
38
40
|
it('should handle timeout errors correctly', async () => {
|
|
39
41
|
mock.onGet(`${API_BASE_URL}/v1alpha/sources`).timeout();
|
|
42
|
+
await expect(julesApiRequest('/v1alpha/sources')).rejects.toThrow();
|
|
40
43
|
try {
|
|
41
44
|
await julesApiRequest('/v1alpha/sources');
|
|
42
45
|
}
|
|
43
46
|
catch (error) {
|
|
44
|
-
const
|
|
45
|
-
expect(
|
|
47
|
+
const result = handleApiError(error);
|
|
48
|
+
expect(result.content[0].text).toContain('Request timed out');
|
|
49
|
+
expect(result.isError).toBe(true);
|
|
46
50
|
}
|
|
47
51
|
});
|
|
48
52
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"julesApiClient.test.js","sourceRoot":"","sources":["../../src/__tests__/julesApiClient.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,KAAY,CAAC,CAAC;AAE3C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IA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,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACpD,IAAI,CAAC,KAAK,CAAC,GAAG,YAAY,kBAAkB,CAAC,CAAC,OAAO,EAAE,CAAC;QAExD,MAAM,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAEpE,IAAI,CAAC;YACD,MAAM,eAAe,CAAC,kBAAkB,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;YACrC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;YAC9D,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { McpServer } from
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { registerListSourcesTool } from '../tools/listSources.js';
|
|
4
4
|
import { registerCreateSessionTool } from '../tools/createSession.js';
|
|
5
5
|
import { registerListSessionsTool } from '../tools/listSessions.js';
|
package/dist/constants.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { McpServer } from
|
|
3
|
-
import { StdioServerTransport } from
|
|
4
|
-
import { IS_MOCK } from
|
|
5
|
-
import { registerListSourcesTool } from
|
|
6
|
-
import { registerCreateSessionTool } from
|
|
7
|
-
import { registerListSessionsTool } from
|
|
8
|
-
import { registerApprovePlanTool } from
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { IS_MOCK } from './mock.js';
|
|
5
|
+
import { registerListSourcesTool } from './tools/listSources.js';
|
|
6
|
+
import { registerCreateSessionTool } from './tools/createSession.js';
|
|
7
|
+
import { registerListSessionsTool } from './tools/listSessions.js';
|
|
8
|
+
import { registerApprovePlanTool } from './tools/approvePlan.js';
|
|
9
9
|
const server = new McpServer({
|
|
10
|
-
name:
|
|
11
|
-
version:
|
|
10
|
+
name: '@fre4x/jules',
|
|
11
|
+
version: '1.0.4',
|
|
12
12
|
});
|
|
13
13
|
registerListSourcesTool(server);
|
|
14
14
|
registerCreateSessionTool(server);
|
|
@@ -16,19 +16,19 @@ registerListSessionsTool(server);
|
|
|
16
16
|
registerApprovePlanTool(server);
|
|
17
17
|
async function main() {
|
|
18
18
|
if (!IS_MOCK && !process.env.JULES_API_KEY) {
|
|
19
|
-
console.error(
|
|
20
|
-
console.error(
|
|
19
|
+
console.error('ERROR: JULES_API_KEY environment variable is required.');
|
|
20
|
+
console.error('Tip: Set MOCK=true to run in mock mode without an API key.');
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
23
23
|
if (IS_MOCK) {
|
|
24
|
-
console.error(
|
|
24
|
+
console.error('[jules] Running in MOCK mode — no API key required.');
|
|
25
25
|
}
|
|
26
26
|
const transport = new StdioServerTransport();
|
|
27
27
|
await server.connect(transport);
|
|
28
|
-
console.error(
|
|
28
|
+
console.error('[jules] MCP server running via stdio');
|
|
29
29
|
}
|
|
30
30
|
main().catch((error) => {
|
|
31
|
-
console.error(
|
|
31
|
+
console.error('Server error:', error);
|
|
32
32
|
process.exit(1);
|
|
33
33
|
});
|
|
34
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IACzB,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;CACnB,CAAC,CAAC;AAEH,uBAAuB,CAAC,MAAM,CAAC,CAAC;AAChC,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAClC,wBAAwB,CAAC,MAAM,CAAC,CAAC;AACjC,uBAAuB,CAAC,MAAM,CAAC,CAAC;AAEhC,KAAK,UAAU,IAAI;IACf,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QACzC,OAAO,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACxE,OAAO,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IACzB,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;CACnB,CAAC,CAAC;AAEH,uBAAuB,CAAC,MAAM,CAAC,CAAC;AAChC,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAClC,wBAAwB,CAAC,MAAM,CAAC,CAAC;AACjC,uBAAuB,CAAC,MAAM,CAAC,CAAC;AAEhC,KAAK,UAAU,IAAI;IACf,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QACzC,OAAO,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACxE,OAAO,CAAC,KAAK,CACT,4DAA4D,CAC/D,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACV,OAAO,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC1D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
package/dist/mock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../src/mock.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../src/mock.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,SACgD,CAAC;AAErE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDzB,CAAC"}
|
package/dist/mock.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export const IS_MOCK = process.env.MOCK ===
|
|
1
|
+
export const IS_MOCK = process.env.MOCK === 'true' || process.env.JULES_MOCK === 'true';
|
|
2
2
|
export const MOCK_FIXTURES = {
|
|
3
3
|
listSources: {
|
|
4
4
|
sources: [
|
|
5
5
|
{
|
|
6
|
-
name:
|
|
7
|
-
id:
|
|
8
|
-
githubRepo: { owner:
|
|
6
|
+
name: 'sources/github/fritzprix/b1te',
|
|
7
|
+
id: 'src-001',
|
|
8
|
+
githubRepo: { owner: 'fritzprix', repo: 'b1te' },
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
name:
|
|
12
|
-
id:
|
|
13
|
-
githubRepo: { owner:
|
|
11
|
+
name: 'sources/github/fritzprix/demo-repo',
|
|
12
|
+
id: 'src-002',
|
|
13
|
+
githubRepo: { owner: 'fritzprix', repo: 'demo-repo' },
|
|
14
14
|
},
|
|
15
15
|
],
|
|
16
16
|
nextPageToken: undefined,
|
|
@@ -18,27 +18,27 @@ export const MOCK_FIXTURES = {
|
|
|
18
18
|
listSessions: {
|
|
19
19
|
sessions: [
|
|
20
20
|
{
|
|
21
|
-
name:
|
|
22
|
-
id:
|
|
23
|
-
title:
|
|
24
|
-
prompt:
|
|
25
|
-
state:
|
|
21
|
+
name: 'sessions/12345',
|
|
22
|
+
id: '12345',
|
|
23
|
+
title: 'Add pagination to HN server',
|
|
24
|
+
prompt: 'Add limit/offset pagination to all list tools in the HN MCP server.',
|
|
25
|
+
state: 'SUCCEEDED',
|
|
26
26
|
pendingPlanApproval: false,
|
|
27
27
|
outputs: [
|
|
28
28
|
{
|
|
29
29
|
pullRequest: {
|
|
30
|
-
title:
|
|
31
|
-
url:
|
|
30
|
+
title: 'feat: add pagination to HN list tools',
|
|
31
|
+
url: 'https://github.com/fritzprix/b1te/pull/42',
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
],
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
name:
|
|
38
|
-
id:
|
|
39
|
-
title:
|
|
40
|
-
prompt:
|
|
41
|
-
state:
|
|
37
|
+
name: 'sessions/67890',
|
|
38
|
+
id: '67890',
|
|
39
|
+
title: 'Fix type errors in fred server',
|
|
40
|
+
prompt: 'Remove all any types from the FRED MCP server implementation.',
|
|
41
|
+
state: 'AWAITING_PLAN_APPROVAL',
|
|
42
42
|
pendingPlanApproval: true,
|
|
43
43
|
outputs: [],
|
|
44
44
|
},
|
|
@@ -46,15 +46,15 @@ export const MOCK_FIXTURES = {
|
|
|
46
46
|
nextPageToken: undefined,
|
|
47
47
|
},
|
|
48
48
|
createSession: {
|
|
49
|
-
name:
|
|
50
|
-
id:
|
|
51
|
-
title:
|
|
52
|
-
prompt:
|
|
53
|
-
state:
|
|
49
|
+
name: 'sessions/99999',
|
|
50
|
+
id: '99999',
|
|
51
|
+
title: 'Mock Session',
|
|
52
|
+
prompt: 'This is a mock session created without a real API call.',
|
|
53
|
+
state: 'PENDING',
|
|
54
54
|
},
|
|
55
55
|
approvePlan: {
|
|
56
|
-
name:
|
|
57
|
-
state:
|
|
56
|
+
name: 'sessions/67890',
|
|
57
|
+
state: 'IN_PROGRESS',
|
|
58
58
|
},
|
|
59
59
|
};
|
|
60
60
|
//# sourceMappingURL=mock.js.map
|
package/dist/mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../src/mock.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../src/mock.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAChB,OAAO,CAA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AAa;KACvB;CACJ,CAAC"}
|
|
@@ -1,84 +1,60 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as zod from 'zod';
|
|
2
2
|
export declare enum ResponseFormat {
|
|
3
3
|
MARKDOWN = "markdown",
|
|
4
4
|
JSON = "json"
|
|
5
5
|
}
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
pageSize:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export
|
|
60
|
-
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
61
|
-
pageToken: z.ZodOptional<z.ZodString>;
|
|
62
|
-
response_format: z.ZodDefault<z.ZodEnum<["markdown", "json"]>>;
|
|
63
|
-
}, "strip", z.ZodTypeAny, {
|
|
64
|
-
pageSize: number;
|
|
65
|
-
response_format: "markdown" | "json";
|
|
66
|
-
pageToken?: string | undefined;
|
|
67
|
-
}, {
|
|
68
|
-
pageSize?: number | undefined;
|
|
69
|
-
pageToken?: string | undefined;
|
|
70
|
-
response_format?: "markdown" | "json" | undefined;
|
|
71
|
-
}>;
|
|
72
|
-
export type ListSessionsInput = z.infer<typeof ListSessionsInputSchema>;
|
|
73
|
-
export declare const ApprovePlanInputSchema: z.ZodObject<{
|
|
74
|
-
sessionId: z.ZodString;
|
|
75
|
-
response_format: z.ZodDefault<z.ZodEnum<["markdown", "json"]>>;
|
|
76
|
-
}, "strip", z.ZodTypeAny, {
|
|
77
|
-
response_format: "markdown" | "json";
|
|
78
|
-
sessionId: string;
|
|
79
|
-
}, {
|
|
80
|
-
sessionId: string;
|
|
81
|
-
response_format?: "markdown" | "json" | undefined;
|
|
82
|
-
}>;
|
|
83
|
-
export type ApprovePlanInput = z.infer<typeof ApprovePlanInputSchema>;
|
|
6
|
+
export declare const ResponseFormatSchema: zod.ZodOptional<zod.ZodEnum<{
|
|
7
|
+
markdown: "markdown";
|
|
8
|
+
json: "json";
|
|
9
|
+
}>>;
|
|
10
|
+
export declare const PaginationSchema: zod.ZodObject<{
|
|
11
|
+
pageSize: zod.ZodDefault<zod.ZodNumber>;
|
|
12
|
+
pageToken: zod.ZodOptional<zod.ZodString>;
|
|
13
|
+
response_format: zod.ZodOptional<zod.ZodEnum<{
|
|
14
|
+
markdown: "markdown";
|
|
15
|
+
json: "json";
|
|
16
|
+
}>>;
|
|
17
|
+
}, zod.z.core.$strip>;
|
|
18
|
+
export declare const ListSourcesInputSchema: zod.ZodObject<{
|
|
19
|
+
pageSize: zod.ZodDefault<zod.ZodNumber>;
|
|
20
|
+
pageToken: zod.ZodOptional<zod.ZodString>;
|
|
21
|
+
response_format: zod.ZodOptional<zod.ZodEnum<{
|
|
22
|
+
markdown: "markdown";
|
|
23
|
+
json: "json";
|
|
24
|
+
}>>;
|
|
25
|
+
}, zod.z.core.$strip>;
|
|
26
|
+
export type ListSourcesInput = zod.z.infer<typeof ListSourcesInputSchema>;
|
|
27
|
+
export declare const CreateSessionInputSchema: zod.ZodObject<{
|
|
28
|
+
prompt: zod.ZodString;
|
|
29
|
+
source: zod.ZodString;
|
|
30
|
+
startingBranch: zod.ZodDefault<zod.ZodString>;
|
|
31
|
+
automationMode: zod.ZodOptional<zod.ZodEnum<{
|
|
32
|
+
AUTO_CREATE_PR: "AUTO_CREATE_PR";
|
|
33
|
+
NONE: "NONE";
|
|
34
|
+
}>>;
|
|
35
|
+
title: zod.ZodString;
|
|
36
|
+
requirePlanApproval: zod.ZodDefault<zod.ZodBoolean>;
|
|
37
|
+
response_format: zod.ZodOptional<zod.ZodEnum<{
|
|
38
|
+
markdown: "markdown";
|
|
39
|
+
json: "json";
|
|
40
|
+
}>>;
|
|
41
|
+
}, zod.z.core.$strip>;
|
|
42
|
+
export type CreateSessionInput = zod.z.infer<typeof CreateSessionInputSchema>;
|
|
43
|
+
export declare const ListSessionsInputSchema: zod.ZodObject<{
|
|
44
|
+
pageSize: zod.ZodDefault<zod.ZodNumber>;
|
|
45
|
+
pageToken: zod.ZodOptional<zod.ZodString>;
|
|
46
|
+
response_format: zod.ZodOptional<zod.ZodEnum<{
|
|
47
|
+
markdown: "markdown";
|
|
48
|
+
json: "json";
|
|
49
|
+
}>>;
|
|
50
|
+
}, zod.z.core.$strip>;
|
|
51
|
+
export type ListSessionsInput = zod.z.infer<typeof ListSessionsInputSchema>;
|
|
52
|
+
export declare const ApprovePlanInputSchema: zod.ZodObject<{
|
|
53
|
+
sessionId: zod.ZodString;
|
|
54
|
+
response_format: zod.ZodOptional<zod.ZodEnum<{
|
|
55
|
+
markdown: "markdown";
|
|
56
|
+
json: "json";
|
|
57
|
+
}>>;
|
|
58
|
+
}, zod.z.core.$strip>;
|
|
59
|
+
export type ApprovePlanInput = zod.z.infer<typeof ApprovePlanInputSchema>;
|
|
84
60
|
//# sourceMappingURL=julesSchemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"julesSchemas.d.ts","sourceRoot":"","sources":["../../src/schemas/julesSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"julesSchemas.d.ts","sourceRoot":"","sources":["../../src/schemas/julesSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAK3B,oBAAY,cAAc;IACtB,QAAQ,aAAa;IACrB,IAAI,SAAS;CAChB;AAGD,eAAO,MAAM,oBAAoB;;;GAGuC,CAAC;AAEzE,eAAO,MAAM,gBAAgB;;;;;;;qBAa3B,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;;;;qBAAmB,CAAC;AACvD,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAG1E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;qBAyBnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAG9E,eAAO,MAAM,uBAAuB;;;;;;;qBAAmB,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAG5E,eAAO,MAAM,sBAAsB;;;;;;qBAKjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|