@edgedive/cli 0.2.1 → 0.3.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/client.d.ts +12 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +40 -0
- package/dist/api/client.js.map +1 -1
- package/dist/commands/local.d.ts +3 -1
- package/dist/commands/local.d.ts.map +1 -1
- package/dist/commands/local.js +31 -3
- package/dist/commands/local.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/.env +0 -2
- package/.env.local +0 -2
- package/.turbo/turbo-build.log +0 -4
- package/.turbo/turbo-dev.log +0 -8
- package/.turbo/turbo-typecheck.log +0 -4
- package/AGENTS.md +0 -135
- package/CLAUDE.md +0 -3
- package/src/api/client.ts +0 -202
- package/src/auth/oauth-flow.ts +0 -278
- package/src/auth/pkce.ts +0 -27
- package/src/commands/local.ts +0 -286
- package/src/commands/login.ts +0 -48
- package/src/commands/logout.ts +0 -29
- package/src/config/config-manager.ts +0 -120
- package/src/constants.ts +0 -34
- package/src/index.ts +0 -62
- package/src/utils/claude-launcher.ts +0 -94
- package/src/utils/git-utils.ts +0 -179
- package/src/utils/session-downloader.ts +0 -56
- package/tsconfig.json +0 -20
package/dist/api/client.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export interface TakeoverResponse {
|
|
|
22
22
|
identifier: string;
|
|
23
23
|
url: string;
|
|
24
24
|
};
|
|
25
|
+
asana_task?: {
|
|
26
|
+
gid: string;
|
|
27
|
+
url: string;
|
|
28
|
+
};
|
|
25
29
|
status: string;
|
|
26
30
|
agent_type: string;
|
|
27
31
|
download_urls: {
|
|
@@ -48,6 +52,14 @@ export declare class EdgediveApiClient {
|
|
|
48
52
|
* Get session takeover information by Slack thread URL
|
|
49
53
|
*/
|
|
50
54
|
getTakeoverBySlackThreadUrl(slackThreadUrl: string): Promise<TakeoverResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Get session takeover information by Asana task URL
|
|
57
|
+
*/
|
|
58
|
+
getTakeoverByAsanaTaskUrl(asanaTaskUrl: string): Promise<TakeoverResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* Get session takeover information by session URL (share link)
|
|
61
|
+
*/
|
|
62
|
+
getTakeoverBySessionUrl(sessionUrl: string): Promise<TakeoverResponse>;
|
|
51
63
|
/**
|
|
52
64
|
* Upload Claude session file for an agent session
|
|
53
65
|
*/
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,YAAY,CAAC,EAAE;QACb,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,MAAM,CAAC;QACnB,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE;QACb,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,UAAU,EAA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
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Get session takeover information by Asana task URL
|
|
103
|
+
*/
|
|
104
|
+
async getTakeoverByAsanaTaskUrl(asanaTaskUrl) {
|
|
105
|
+
try {
|
|
106
|
+
const response = await this.client.get(API_CONFIG.TAKEOVER_PATH, {
|
|
107
|
+
params: {
|
|
108
|
+
asana_task_url: asanaTaskUrl,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
return response.data;
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (error.response) {
|
|
115
|
+
const errorData = error.response.data;
|
|
116
|
+
throw new Error(errorData?.error || `API request failed: ${error.response.status}`);
|
|
117
|
+
}
|
|
118
|
+
throw new Error(`API request failed: ${error.message}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get session takeover information by session URL (share link)
|
|
123
|
+
*/
|
|
124
|
+
async getTakeoverBySessionUrl(sessionUrl) {
|
|
125
|
+
try {
|
|
126
|
+
const response = await this.client.get(API_CONFIG.TAKEOVER_PATH, {
|
|
127
|
+
params: {
|
|
128
|
+
session_url: sessionUrl,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
return response.data;
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
if (error.response) {
|
|
135
|
+
const errorData = error.response.data;
|
|
136
|
+
throw new Error(errorData?.error || `API request failed: ${error.response.status}`);
|
|
137
|
+
}
|
|
138
|
+
throw new Error(`API request failed: ${error.message}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
101
141
|
/**
|
|
102
142
|
* Upload Claude session file for an agent session
|
|
103
143
|
*/
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,UAAU,EA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C1D,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CAAC,SAAiB,EAAE,WAAmB;QAC9D,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,8BAA8B,SAAS,iBAAiB,CAAC;YAC5E,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE;gBAC7C,OAAO,EAAE;oBACP,cAAc,EAAE,0BAA0B;iBAC3C;aACF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACnB,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACtC,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE,KAAK,IAAI,kBAAkB,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;YACjF,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;CACF"}
|
package/dist/commands/local.d.ts
CHANGED
|
@@ -5,8 +5,10 @@ interface LocalOptions {
|
|
|
5
5
|
prUrl?: string;
|
|
6
6
|
issueUrl?: string;
|
|
7
7
|
threadUrl?: string;
|
|
8
|
+
taskUrl?: string;
|
|
9
|
+
sessionUrl?: string;
|
|
8
10
|
worktree?: boolean;
|
|
9
11
|
}
|
|
10
|
-
export declare function localCommand({ prUrl, issueUrl, threadUrl, worktree, }: LocalOptions): Promise<void>;
|
|
12
|
+
export declare function localCommand({ prUrl, issueUrl, threadUrl, taskUrl, sessionUrl, worktree, }: LocalOptions): Promise<void>;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=local.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/commands/local.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,YAAY,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/commands/local.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,YAAY,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,GACT,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAmN9B"}
|
package/dist/commands/local.js
CHANGED
|
@@ -7,7 +7,7 @@ import { EdgediveApiClient } from '../api/client.js';
|
|
|
7
7
|
import { SessionDownloader } from '../utils/session-downloader.js';
|
|
8
8
|
import { GitUtils } from '../utils/git-utils.js';
|
|
9
9
|
import { launchClaudeSession } from '../utils/claude-launcher.js';
|
|
10
|
-
export async function localCommand({ prUrl, issueUrl, threadUrl, worktree, }) {
|
|
10
|
+
export async function localCommand({ prUrl, issueUrl, threadUrl, taskUrl, sessionUrl, worktree, }) {
|
|
11
11
|
const configManager = new ConfigManager();
|
|
12
12
|
const apiClient = new EdgediveApiClient(configManager);
|
|
13
13
|
const downloader = new SessionDownloader();
|
|
@@ -25,12 +25,14 @@ export async function localCommand({ prUrl, issueUrl, threadUrl, worktree, }) {
|
|
|
25
25
|
console.log(chalk.yellow('Please run: edgedive login\n'));
|
|
26
26
|
process.exit(1);
|
|
27
27
|
}
|
|
28
|
-
if (!prUrl && !issueUrl && !threadUrl) {
|
|
28
|
+
if (!prUrl && !issueUrl && !threadUrl && !taskUrl && !sessionUrl) {
|
|
29
29
|
console.log(chalk.red('❌ Missing session identifier.\n'));
|
|
30
30
|
console.log(chalk.yellow('Provide one of:\n' +
|
|
31
31
|
' --pr-url https://github.com/owner/repo/pull/123\n' +
|
|
32
32
|
' --issue-url https://linear.app/...\n' +
|
|
33
|
-
' --thread-url https://workspace.slack.com/archives/C12345/p1234567890123456\n'
|
|
33
|
+
' --thread-url https://workspace.slack.com/archives/C12345/p1234567890123456\n' +
|
|
34
|
+
' --task-url https://app.asana.com/0/PROJECT_ID/TASK_ID\n' +
|
|
35
|
+
' --session-url https://app.edgedive.com/agent-sessions?session={session_id}\n'));
|
|
34
36
|
process.exit(1);
|
|
35
37
|
}
|
|
36
38
|
let sessionData;
|
|
@@ -51,6 +53,29 @@ export async function localCommand({ prUrl, issueUrl, threadUrl, worktree, }) {
|
|
|
51
53
|
console.log('🔍 Fetching session information...\n');
|
|
52
54
|
sessionData = await apiClient.getTakeoverByLinearIssueUrl(issueUrl);
|
|
53
55
|
}
|
|
56
|
+
else if (taskUrl) {
|
|
57
|
+
// Validate it's an Asana URL — let the server handle detailed format parsing
|
|
58
|
+
const asanaTaskPattern = /^https?:\/\/app\.asana\.com\//;
|
|
59
|
+
if (!asanaTaskPattern.test(taskUrl)) {
|
|
60
|
+
console.log(chalk.red('❌ Invalid Asana task URL. Expected a URL starting with https://app.asana.com/\n'));
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
console.log(chalk.dim(`Asana Task URL: ${taskUrl}\n`));
|
|
64
|
+
console.log('🔍 Fetching session information...\n');
|
|
65
|
+
sessionData = await apiClient.getTakeoverByAsanaTaskUrl(taskUrl);
|
|
66
|
+
}
|
|
67
|
+
else if (sessionUrl) {
|
|
68
|
+
// Validate session URL format
|
|
69
|
+
const sessionUrlPattern = /^https?:\/\/[^\/]+\/agent-sessions\?session=([a-f0-9-]+)/i;
|
|
70
|
+
if (!sessionUrlPattern.test(sessionUrl)) {
|
|
71
|
+
console.log(chalk.red('❌ Invalid session URL format.\n'));
|
|
72
|
+
console.log(chalk.yellow('Expected format: https://app.edgedive.com/agent-sessions?session={session_id}\n'));
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
console.log(chalk.dim(`Session URL: ${sessionUrl}\n`));
|
|
76
|
+
console.log('🔍 Fetching session information...\n');
|
|
77
|
+
sessionData = await apiClient.getTakeoverBySessionUrl(sessionUrl);
|
|
78
|
+
}
|
|
54
79
|
else {
|
|
55
80
|
// Validate Slack thread URL format
|
|
56
81
|
const slackThreadPattern = /^https?:\/\/[^\/]+\.slack\.com\/archives\/([A-Z0-9]+)\/p(\d{16})/;
|
|
@@ -77,6 +102,9 @@ export async function localCommand({ prUrl, issueUrl, threadUrl, worktree, }) {
|
|
|
77
102
|
console.log(chalk.dim(` Linear Issue: ${sessionData.linear_issue.identifier}`));
|
|
78
103
|
console.log(chalk.dim(` Linear URL: ${sessionData.linear_issue.url}`));
|
|
79
104
|
}
|
|
105
|
+
if (sessionData.asana_task) {
|
|
106
|
+
console.log(chalk.dim(` Asana Task: ${sessionData.asana_task.url}`));
|
|
107
|
+
}
|
|
80
108
|
// Verify current repository matches PR source
|
|
81
109
|
const cwd = process.cwd();
|
|
82
110
|
let repoInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/commands/local.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAyB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,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KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,wCAAwC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACrF,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,MAAM,CAAC,sEAAsE,CAAC,CACrF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -10,7 +10,7 @@ export const OAUTH_CONFIG = {
|
|
|
10
10
|
};
|
|
11
11
|
// API configuration
|
|
12
12
|
export const API_CONFIG = {
|
|
13
|
-
BASE_URL: 'https://api.edgedive.com',
|
|
13
|
+
BASE_URL: process.env.EDGEDIVE_API_URL || 'https://api.edgedive.com',
|
|
14
14
|
AUTHORIZE_PATH: '/api/oauth/authorize',
|
|
15
15
|
TOKEN_PATH: '/api/oauth/token',
|
|
16
16
|
TAKEOVER_PATH: '/api/agents/agent-sessions/takeover',
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB;;GAEG;AAEH,sBAAsB;AACtB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,cAAc;IACzB,YAAY,EAAE,gCAAgC;IAC9C,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,oBAAoB;AACpB,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE,0BAA0B;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB;;GAEG;AAEH,sBAAsB;AACtB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,cAAc;IACzB,YAAY,EAAE,gCAAgC;IAC9C,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,oBAAoB;AACpB,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,0BAA0B;IACpE,cAAc,EAAE,sBAAsB;IACtC,UAAU,EAAE,kBAAkB;IAC9B,aAAa,EAAE,qCAAqC;CACrD,CAAC;AAEF,sBAAsB;AACtB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE,WAAW;IACvB,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,SAAS;IACrB,mBAAmB,EAAE,UAAU;CAChC,CAAC;AAEF,gBAAgB;AAChB,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,kBAAkB,EAAE,KAAK;IACzB,kBAAkB,EAAE,MAAM,EAAE,2BAA2B;CACxD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,8 @@ program
|
|
|
34
34
|
.option('--pr-url <prUrl>', 'GitHub PR URL to load locally')
|
|
35
35
|
.option('--issue-url <issueUrl>', 'Linear issue URL to load locally')
|
|
36
36
|
.option('--thread-url <threadUrl>', 'Slack thread URL to load locally')
|
|
37
|
+
.option('--task-url <taskUrl>', 'Asana task URL to load locally')
|
|
38
|
+
.option('--session-url <sessionUrl>', 'Session share URL to load locally')
|
|
37
39
|
.option('--worktree', 'Create branch in a worktree instead of checking out')
|
|
38
40
|
.action(async (options) => {
|
|
39
41
|
await localCommand(options);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,CAA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C;AAC9B,CAAC,CACF,CAAC;AAEJ,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
package/.env
DELETED
package/.env.local
DELETED
package/.turbo/turbo-build.log
DELETED
package/.turbo/turbo-dev.log
DELETED
package/AGENTS.md
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
# Edgedive CLI
|
|
2
|
-
|
|
3
|
-
Command-line tool for working on Edgedive agent sessions locally and continuing development with Claude Code.
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
The CLI enables developers to:
|
|
8
|
-
- Authenticate with Edgedive using OAuth
|
|
9
|
-
- Pull down agent sessions from Edgedive
|
|
10
|
-
- Restore Claude Code session files locally
|
|
11
|
-
- Check out PR branches for continued development
|
|
12
|
-
- Resume Claude Code sessions from where the agent left off
|
|
13
|
-
|
|
14
|
-
## Available Commands
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
# Authenticate with Edgedive
|
|
18
|
-
dive login --pr-url <github-pr-url>
|
|
19
|
-
dive login --issue-url <linear-issue-url>
|
|
20
|
-
|
|
21
|
-
# Prepare agent session locally
|
|
22
|
-
dive local --pr-url <github-pr-url>
|
|
23
|
-
dive local --issue-url <linear-issue-url>
|
|
24
|
-
|
|
25
|
-
# Remove stored credentials
|
|
26
|
-
dive logout
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Both `dive` and `edgedive` commands are available.
|
|
30
|
-
|
|
31
|
-
## Development Commands
|
|
32
|
-
|
|
33
|
-
From the monorepo root:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
# Build the CLI
|
|
37
|
-
pnpm --filter edgedive-cli run build
|
|
38
|
-
|
|
39
|
-
# Clean build artifacts
|
|
40
|
-
pnpm --filter edgedive-cli run clean
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
From this directory:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
# Link for local testing
|
|
47
|
-
npm link
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Project Structure
|
|
51
|
-
|
|
52
|
-
- `src/` - TypeScript source code
|
|
53
|
-
- `commands/` - Command implementations (login, local, logout)
|
|
54
|
-
- `services/` - OAuth, API client, session management
|
|
55
|
-
- `utils/` - Helper utilities
|
|
56
|
-
- `index.ts` - CLI entry point
|
|
57
|
-
- `dist/` - Compiled JavaScript (gitignored)
|
|
58
|
-
|
|
59
|
-
## Development Guidelines
|
|
60
|
-
|
|
61
|
-
### Authentication
|
|
62
|
-
|
|
63
|
-
The CLI uses OAuth 2.0 with PKCE for secure authentication:
|
|
64
|
-
- Tokens are stored in `~/.edgedive/config.json` with restricted permissions (0600)
|
|
65
|
-
- Tokens are valid for 30 days
|
|
66
|
-
- Uses authorization code flow with PKCE for security
|
|
67
|
-
|
|
68
|
-
### Session Management
|
|
69
|
-
|
|
70
|
-
The `dive local` command:
|
|
71
|
-
1. Validates you're in the correct repository
|
|
72
|
-
2. Fetches session info from Edgedive API
|
|
73
|
-
3. Downloads and restores Claude session file
|
|
74
|
-
4. Checks out the PR branch
|
|
75
|
-
5. Launches Claude CLI with the resumed session
|
|
76
|
-
|
|
77
|
-
### Configuration
|
|
78
|
-
|
|
79
|
-
Configuration is stored in `~/.edgedive/config.json`:
|
|
80
|
-
- OAuth access token
|
|
81
|
-
- Token expiration time
|
|
82
|
-
- OAuth scope
|
|
83
|
-
|
|
84
|
-
### Environment Variables
|
|
85
|
-
|
|
86
|
-
Override defaults with:
|
|
87
|
-
- `EDGEDIVE_API_URL` - API base URL (default: `https://api.edgedive.com`)
|
|
88
|
-
- `EDGEDIVE_CLIENT_ID` - OAuth client ID
|
|
89
|
-
|
|
90
|
-
## Building for Distribution
|
|
91
|
-
|
|
92
|
-
To build the CLI for npm:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
pnpm build
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
This compiles TypeScript to JavaScript in the `dist/` directory.
|
|
99
|
-
|
|
100
|
-
## Testing
|
|
101
|
-
|
|
102
|
-
For local testing:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
# Link the CLI globally
|
|
106
|
-
npm link
|
|
107
|
-
|
|
108
|
-
# Test commands
|
|
109
|
-
dive login --pr-url https://github.com/owner/repo/pull/123
|
|
110
|
-
dive local --pr-url https://github.com/owner/repo/pull/123
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Security
|
|
114
|
-
|
|
115
|
-
- OAuth tokens stored with restricted file permissions
|
|
116
|
-
- PKCE prevents authorization code interception
|
|
117
|
-
- Presigned S3 URLs expire after 1 hour
|
|
118
|
-
- Local callback server only accepts localhost connections
|
|
119
|
-
|
|
120
|
-
## Troubleshooting
|
|
121
|
-
|
|
122
|
-
Common issues:
|
|
123
|
-
- **Not logged in**: Run `dive login` first
|
|
124
|
-
- **Session expired**: Tokens expire after 30 days, run `dive login` again
|
|
125
|
-
- **No agent session found**: PR may not be from an Edgedive agent
|
|
126
|
-
- **Failed to download file**: Presigned URLs expire after 1 hour, run command again
|
|
127
|
-
|
|
128
|
-
## Documentation
|
|
129
|
-
|
|
130
|
-
For comprehensive usage documentation, see [README.md](./README.md).
|
|
131
|
-
|
|
132
|
-
## Related Documentation
|
|
133
|
-
|
|
134
|
-
- [edgedive-server](../../apps/edgedive-server/CLAUDE.md) - API backend that CLI connects to
|
|
135
|
-
- [Root monorepo documentation](../../CLAUDE.md) - Monorepo overview
|
package/CLAUDE.md
DELETED
package/src/api/client.ts
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Edgedive API client for making authenticated requests
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import axios, { AxiosInstance } from 'axios';
|
|
6
|
-
import { API_CONFIG, TIMEOUTS } from '../constants.js';
|
|
7
|
-
import { ConfigManager } from '../config/config-manager.js';
|
|
8
|
-
import { OAuthFlow } from '../auth/oauth-flow.js';
|
|
9
|
-
|
|
10
|
-
export interface TakeoverResponse {
|
|
11
|
-
session_id: string;
|
|
12
|
-
tenant_id: string;
|
|
13
|
-
repository: {
|
|
14
|
-
owner: string;
|
|
15
|
-
name: string;
|
|
16
|
-
branch: string;
|
|
17
|
-
base_branch: string;
|
|
18
|
-
};
|
|
19
|
-
github_pr: {
|
|
20
|
-
owner: string;
|
|
21
|
-
name: string;
|
|
22
|
-
number: number;
|
|
23
|
-
url: string;
|
|
24
|
-
};
|
|
25
|
-
linear_issue?: {
|
|
26
|
-
id: string;
|
|
27
|
-
identifier: string;
|
|
28
|
-
url: string;
|
|
29
|
-
};
|
|
30
|
-
asana_task?: {
|
|
31
|
-
gid: string;
|
|
32
|
-
url: string;
|
|
33
|
-
};
|
|
34
|
-
status: string;
|
|
35
|
-
agent_type: string;
|
|
36
|
-
download_urls: {
|
|
37
|
-
claude_session?: string;
|
|
38
|
-
session_metadata?: string;
|
|
39
|
-
messages?: string;
|
|
40
|
-
};
|
|
41
|
-
expires_in: number;
|
|
42
|
-
created_at: string;
|
|
43
|
-
updated_at: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export class EdgediveApiClient {
|
|
47
|
-
private client: AxiosInstance;
|
|
48
|
-
private configManager: ConfigManager;
|
|
49
|
-
private oauthFlow: OAuthFlow;
|
|
50
|
-
private isRefreshing: boolean = false;
|
|
51
|
-
|
|
52
|
-
constructor(configManager: ConfigManager) {
|
|
53
|
-
this.configManager = configManager;
|
|
54
|
-
this.oauthFlow = new OAuthFlow(configManager);
|
|
55
|
-
this.client = axios.create({
|
|
56
|
-
baseURL: API_CONFIG.BASE_URL,
|
|
57
|
-
timeout: TIMEOUTS.DEFAULT_REQUEST_MS,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// Add request interceptor to inject auth token and handle refresh
|
|
61
|
-
this.client.interceptors.request.use(async (config) => {
|
|
62
|
-
// Check if token needs refresh
|
|
63
|
-
const currentConfig = await this.configManager.load();
|
|
64
|
-
|
|
65
|
-
if (this.configManager.isTokenExpiringSoon(currentConfig) && !this.isRefreshing) {
|
|
66
|
-
this.isRefreshing = true;
|
|
67
|
-
try {
|
|
68
|
-
console.log('🔄 Access token expiring soon, refreshing...');
|
|
69
|
-
await this.oauthFlow.refreshAccessToken();
|
|
70
|
-
console.log('✅ Token refreshed successfully');
|
|
71
|
-
} catch (error: any) {
|
|
72
|
-
console.error('❌ Failed to refresh token:', error.message);
|
|
73
|
-
console.log('Please run "dive login" to re-authenticate');
|
|
74
|
-
throw error;
|
|
75
|
-
} finally {
|
|
76
|
-
this.isRefreshing = false;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const token = await this.configManager.getAccessToken();
|
|
81
|
-
if (token) {
|
|
82
|
-
config.headers.Authorization = `Bearer ${token}`;
|
|
83
|
-
}
|
|
84
|
-
return config;
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Get session takeover information by PR URL
|
|
90
|
-
*/
|
|
91
|
-
async getTakeoverByPrUrl(prUrl: string): Promise<TakeoverResponse> {
|
|
92
|
-
try {
|
|
93
|
-
const response = await this.client.get<TakeoverResponse>(API_CONFIG.TAKEOVER_PATH, {
|
|
94
|
-
params: { pr_url: prUrl },
|
|
95
|
-
});
|
|
96
|
-
return response.data;
|
|
97
|
-
} catch (error: any) {
|
|
98
|
-
if (error.response) {
|
|
99
|
-
const errorData = error.response.data;
|
|
100
|
-
throw new Error(errorData?.error || `API request failed: ${error.response.status}`);
|
|
101
|
-
}
|
|
102
|
-
throw new Error(`API request failed: ${error.message}`);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
async getTakeoverByLinearIssueUrl(linearIssueUrl: string): Promise<TakeoverResponse> {
|
|
107
|
-
try {
|
|
108
|
-
const response = await this.client.get<TakeoverResponse>(API_CONFIG.TAKEOVER_PATH, {
|
|
109
|
-
params: {
|
|
110
|
-
linear_issue_url: linearIssueUrl,
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
return response.data;
|
|
114
|
-
} catch (error: any) {
|
|
115
|
-
if (error.response) {
|
|
116
|
-
const errorData = error.response.data;
|
|
117
|
-
throw new Error(errorData?.error || `API request failed: ${error.response.status}`);
|
|
118
|
-
}
|
|
119
|
-
throw new Error(`API request failed: ${error.message}`);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Get session takeover information by Slack thread URL
|
|
125
|
-
*/
|
|
126
|
-
async getTakeoverBySlackThreadUrl(slackThreadUrl: string): Promise<TakeoverResponse> {
|
|
127
|
-
try {
|
|
128
|
-
const response = await this.client.get<TakeoverResponse>(API_CONFIG.TAKEOVER_PATH, {
|
|
129
|
-
params: {
|
|
130
|
-
slack_thread_url: slackThreadUrl,
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
return response.data;
|
|
134
|
-
} catch (error: any) {
|
|
135
|
-
if (error.response) {
|
|
136
|
-
const errorData = error.response.data;
|
|
137
|
-
throw new Error(errorData?.error || `API request failed: ${error.response.status}`);
|
|
138
|
-
}
|
|
139
|
-
throw new Error(`API request failed: ${error.message}`);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Get session takeover information by Asana task URL
|
|
145
|
-
*/
|
|
146
|
-
async getTakeoverByAsanaTaskUrl(asanaTaskUrl: string): Promise<TakeoverResponse> {
|
|
147
|
-
try {
|
|
148
|
-
const response = await this.client.get<TakeoverResponse>(API_CONFIG.TAKEOVER_PATH, {
|
|
149
|
-
params: {
|
|
150
|
-
asana_task_url: asanaTaskUrl,
|
|
151
|
-
},
|
|
152
|
-
});
|
|
153
|
-
return response.data;
|
|
154
|
-
} catch (error: any) {
|
|
155
|
-
if (error.response) {
|
|
156
|
-
const errorData = error.response.data;
|
|
157
|
-
throw new Error(errorData?.error || `API request failed: ${error.response.status}`);
|
|
158
|
-
}
|
|
159
|
-
throw new Error(`API request failed: ${error.message}`);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Get session takeover information by session URL (share link)
|
|
165
|
-
*/
|
|
166
|
-
async getTakeoverBySessionUrl(sessionUrl: string): Promise<TakeoverResponse> {
|
|
167
|
-
try {
|
|
168
|
-
const response = await this.client.get<TakeoverResponse>(API_CONFIG.TAKEOVER_PATH, {
|
|
169
|
-
params: {
|
|
170
|
-
session_url: sessionUrl,
|
|
171
|
-
},
|
|
172
|
-
});
|
|
173
|
-
return response.data;
|
|
174
|
-
} catch (error: any) {
|
|
175
|
-
if (error.response) {
|
|
176
|
-
const errorData = error.response.data;
|
|
177
|
-
throw new Error(errorData?.error || `API request failed: ${error.response.status}`);
|
|
178
|
-
}
|
|
179
|
-
throw new Error(`API request failed: ${error.message}`);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Upload Claude session file for an agent session
|
|
185
|
-
*/
|
|
186
|
-
async uploadClaudeSession(sessionId: string, fileContent: Buffer): Promise<void> {
|
|
187
|
-
try {
|
|
188
|
-
const uploadPath = `/api/agents/agent-sessions/${sessionId}/claude-session`;
|
|
189
|
-
await this.client.put(uploadPath, fileContent, {
|
|
190
|
-
headers: {
|
|
191
|
-
'Content-Type': 'application/octet-stream',
|
|
192
|
-
},
|
|
193
|
-
});
|
|
194
|
-
} catch (error: any) {
|
|
195
|
-
if (error.response) {
|
|
196
|
-
const errorData = error.response.data;
|
|
197
|
-
throw new Error(errorData?.error || `Upload failed: ${error.response.status}`);
|
|
198
|
-
}
|
|
199
|
-
throw new Error(`Upload failed: ${error.message}`);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|