dev3000 0.0.188 → 0.0.191
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/README.md +84 -12
- package/dist/cdp-monitor.d.ts +10 -0
- package/dist/cdp-monitor.d.ts.map +1 -1
- package/dist/cdp-monitor.js +28 -4
- package/dist/cdp-monitor.js.map +1 -1
- package/dist/runtime/bridge.d.ts +2 -0
- package/dist/runtime/bridge.d.ts.map +1 -1
- package/dist/runtime/bridge.js +74 -0
- package/dist/runtime/bridge.js.map +1 -1
- package/dist/runtime/browser-events.d.ts +3 -2
- package/dist/runtime/browser-events.d.ts.map +1 -1
- package/dist/runtime/browser-events.js +11 -53
- package/dist/runtime/browser-events.js.map +1 -1
- package/dist/runtime/browser-metrics.d.ts +147 -0
- package/dist/runtime/browser-metrics.d.ts.map +1 -0
- package/dist/runtime/browser-metrics.js +243 -0
- package/dist/runtime/browser-metrics.js.map +1 -0
- package/dist/runtime/chrome-isolation.d.ts +3 -2
- package/dist/runtime/chrome-isolation.d.ts.map +1 -1
- package/dist/runtime/chrome-isolation.js +23 -35
- package/dist/runtime/chrome-isolation.js.map +1 -1
- package/dist/runtime/cli.js +63 -2
- package/dist/runtime/cli.js.map +1 -1
- package/dist/runtime/desktop-mcp.d.ts +216 -0
- package/dist/runtime/desktop-mcp.d.ts.map +1 -0
- package/dist/runtime/desktop-mcp.js +258 -0
- package/dist/runtime/desktop-mcp.js.map +1 -0
- package/dist/runtime/git-identity.d.ts +17 -0
- package/dist/runtime/git-identity.d.ts.map +1 -0
- package/dist/runtime/git-identity.js +41 -0
- package/dist/runtime/git-identity.js.map +1 -0
- package/dist/runtime/github-publish.d.ts +31 -0
- package/dist/runtime/github-publish.d.ts.map +1 -0
- package/dist/runtime/github-publish.js +237 -0
- package/dist/runtime/github-publish.js.map +1 -0
- package/dist/runtime/harness.d.ts +14 -3
- package/dist/runtime/harness.d.ts.map +1 -1
- package/dist/runtime/harness.js +55 -7
- package/dist/runtime/harness.js.map +1 -1
- package/dist/runtime/mcp-stdio.d.ts +17 -0
- package/dist/runtime/mcp-stdio.d.ts.map +1 -0
- package/dist/runtime/mcp-stdio.js +99 -0
- package/dist/runtime/mcp-stdio.js.map +1 -0
- package/dist/runtime/network-evidence.d.ts +28 -0
- package/dist/runtime/network-evidence.d.ts.map +1 -0
- package/dist/runtime/network-evidence.js +291 -0
- package/dist/runtime/network-evidence.js.map +1 -0
- package/dist/runtime/runtime.d.ts +4 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +48 -17
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/sandbox-agent.d.ts +5 -0
- package/dist/runtime/sandbox-agent.d.ts.map +1 -1
- package/dist/runtime/sandbox-agent.js +32 -0
- package/dist/runtime/sandbox-agent.js.map +1 -1
- package/dist/runtime/sandbox-cleanup.d.ts +14 -0
- package/dist/runtime/sandbox-cleanup.d.ts.map +1 -0
- package/dist/runtime/sandbox-cleanup.js +49 -0
- package/dist/runtime/sandbox-cleanup.js.map +1 -0
- package/dist/runtime/sandbox-command.d.ts +1 -0
- package/dist/runtime/sandbox-command.d.ts.map +1 -1
- package/dist/runtime/sandbox-command.js +38 -8
- package/dist/runtime/sandbox-command.js.map +1 -1
- package/dist/runtime/sandbox-context.d.ts +5 -0
- package/dist/runtime/sandbox-context.d.ts.map +1 -0
- package/dist/runtime/sandbox-context.js +42 -0
- package/dist/runtime/sandbox-context.js.map +1 -0
- package/dist/runtime/sandbox-fx-resume.d.ts +11 -0
- package/dist/runtime/sandbox-fx-resume.d.ts.map +1 -0
- package/dist/runtime/sandbox-fx-resume.js +45 -0
- package/dist/runtime/sandbox-fx-resume.js.map +1 -0
- package/dist/runtime/sandbox-gateway.d.ts +17 -0
- package/dist/runtime/sandbox-gateway.d.ts.map +1 -0
- package/dist/runtime/sandbox-gateway.js +34 -0
- package/dist/runtime/sandbox-gateway.js.map +1 -0
- package/dist/runtime/sandbox-github.d.ts +10 -0
- package/dist/runtime/sandbox-github.d.ts.map +1 -0
- package/dist/runtime/sandbox-github.js +35 -0
- package/dist/runtime/sandbox-github.js.map +1 -0
- package/dist/runtime/sandbox-local-harness.d.ts +34 -0
- package/dist/runtime/sandbox-local-harness.d.ts.map +1 -0
- package/dist/runtime/sandbox-local-harness.js +138 -0
- package/dist/runtime/sandbox-local-harness.js.map +1 -0
- package/dist/runtime/sandbox-preview.d.ts +14 -0
- package/dist/runtime/sandbox-preview.d.ts.map +1 -0
- package/dist/runtime/sandbox-preview.js +96 -0
- package/dist/runtime/sandbox-preview.js.map +1 -0
- package/dist/runtime/sandbox-process.d.ts +11 -0
- package/dist/runtime/sandbox-process.d.ts.map +1 -0
- package/dist/runtime/sandbox-process.js +77 -0
- package/dist/runtime/sandbox-process.js.map +1 -0
- package/dist/runtime/sandbox-proxy.d.ts +2 -0
- package/dist/runtime/sandbox-proxy.d.ts.map +1 -1
- package/dist/runtime/sandbox-proxy.js +75 -20
- package/dist/runtime/sandbox-proxy.js.map +1 -1
- package/dist/runtime/sandbox-recovery.d.ts +4 -0
- package/dist/runtime/sandbox-recovery.d.ts.map +1 -0
- package/dist/runtime/sandbox-recovery.js +36 -0
- package/dist/runtime/sandbox-recovery.js.map +1 -0
- package/dist/runtime/sandbox-sessions.d.ts +8 -1
- package/dist/runtime/sandbox-sessions.d.ts.map +1 -1
- package/dist/runtime/sandbox-sessions.js +20 -2
- package/dist/runtime/sandbox-sessions.js.map +1 -1
- package/dist/runtime/sandbox-setup.d.ts +4 -0
- package/dist/runtime/sandbox-setup.d.ts.map +1 -0
- package/dist/runtime/sandbox-setup.js +56 -0
- package/dist/runtime/sandbox-setup.js.map +1 -0
- package/dist/runtime/sandbox-shell.d.ts +27 -0
- package/dist/runtime/sandbox-shell.d.ts.map +1 -0
- package/dist/runtime/sandbox-shell.js +169 -0
- package/dist/runtime/sandbox-shell.js.map +1 -0
- package/dist/runtime/sandbox-watch.d.ts +11 -0
- package/dist/runtime/sandbox-watch.d.ts.map +1 -0
- package/dist/runtime/sandbox-watch.js +30 -0
- package/dist/runtime/sandbox-watch.js.map +1 -0
- package/dist/runtime/sandbox-workspace.d.ts +125 -0
- package/dist/runtime/sandbox-workspace.d.ts.map +1 -0
- package/dist/runtime/sandbox-workspace.js +205 -0
- package/dist/runtime/sandbox-workspace.js.map +1 -0
- package/dist/runtime/sandbox.d.ts +21 -2
- package/dist/runtime/sandbox.d.ts.map +1 -1
- package/dist/runtime/sandbox.js +435 -198
- package/dist/runtime/sandbox.js.map +1 -1
- package/dist/runtime/session.d.ts +1 -1
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +3 -3
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/terminal.d.ts +19 -0
- package/dist/runtime/terminal.d.ts.map +1 -0
- package/dist/runtime/terminal.js +60 -0
- package/dist/runtime/terminal.js.map +1 -0
- package/dist/runtime/workspace-client.d.ts +2 -0
- package/dist/runtime/workspace-client.d.ts.map +1 -0
- package/dist/runtime/workspace-client.js +42 -0
- package/dist/runtime/workspace-client.js.map +1 -0
- package/package.json +2 -1
- package/scripts/eve/README.md +341 -0
- package/scripts/eve/agent/agent.ts +12 -0
- package/scripts/eve/agent/channels/eve.ts +23 -0
- package/scripts/eve/agent/instructions.md +53 -0
- package/scripts/eve/agent/sandbox.ts +34 -0
- package/scripts/eve/build-cache.mjs +18 -0
- package/scripts/eve/build-cache.test.mjs +32 -0
- package/scripts/eve/client.mjs +229 -0
- package/scripts/eve/connection.mjs +89 -0
- package/scripts/eve/conversation.mjs +91 -0
- package/scripts/eve/conversation.test.mjs +113 -0
- package/scripts/eve/fixture-agent.ts +101 -0
- package/scripts/eve/images.mjs +84 -0
- package/scripts/eve/launch.mjs +277 -0
- package/scripts/eve/model-command.mjs +21 -0
- package/scripts/eve/reconnect.mjs +22 -0
- package/scripts/eve/reconnect.test.mjs +41 -0
- package/scripts/eve/settings.mjs +33 -0
- package/scripts/eve/supervisor.mjs +41 -0
- package/scripts/eve/tui-client.mjs +234 -0
- package/scripts/eve/tui-input.mjs +114 -0
- package/scripts/eve/verify.mjs +575 -0
- package/skills/d3k/SKILL.md +48 -5
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { getPortlessProxyStatus } from "../portless.js";
|
|
2
|
+
import { launchSandbox } from "./sandbox.js";
|
|
3
|
+
import { listSandboxSessions } from "./sandbox-sessions.js";
|
|
4
|
+
import { type WorkspaceResult } from "./sandbox-workspace.js";
|
|
5
|
+
export declare const desktopInstructions = "d3k connects this desktop assistant to a REMOTE Vercel Sandbox and an existing LOCAL Chrome. Call sandbox_sessions first; use sandbox_start with project or a saved resume ID, then poll sandbox_status until phase=ready. Startup takes time; never treat starting as ready or start a second session. If Portless or Vercel login needs setup, report the exact prerequisite to the user.\nAn explicitly requested remote sandbox takes precedence over this chat's linked local repository. Start with project and the requested branch for a fresh remote checkout; use resume or attach only when the user requests reuse. A failed fresh start is not permission to attach to an unrelated old checkout or drop the requested branch. Report the actual startup error without guessing that the repository is private.\nProject files, app environment, installs, tests and Git edits stay REMOTE. Never clone or recreate the project locally. Use sandbox_exec, sandbox_read_file and sandbox_write_file for project work. Read the remote AGENTS.md and narrower instructions before editing. sandbox_exec runs in the remote project root and has a 60-second deadline; inspect remote state before retrying a timed-out mutation.\nUse sandbox_browser immediately for the already connected LOCAL Chrome, e.g. args=[\"snapshot\",\"-i\"]. CDP is managed: do not hunt for ports, install browsers, or start another runtime/browser. Use sandbox_runtime args=[\"status\"] before reproducing; retain sessionId/cursor, then read events --session ID --after CURSOR. Continue while hasMore; reset or dropped means an evidence gap.\nFor loading metrics, use sandbox_browser args=[\"metrics\",\"https://example.com/\",\"--new-tab\"]. This installs observers before navigation and returns Web Vitals, navigation timing, long tasks and resource summaries as JSON. Prefer it over custom eval scripts. Omit the URL for a current-page snapshot without reload; CLS and long tasks are then unavailable. Results use existing cache/throttling and provisional vitals; null means unavailable.\nAfter responsive/device testing, restore window-sized rendering with sandbox_browser args=[\"set\",\"viewport\",\"0\",\"0\",\"0\"]. Verify the page fills the headed window before handing it back. Do not restore to a guessed desktop size such as 1280x900; that leaves a fixed viewport when the user resizes the window.\nWhen the user is on a phone or asks for a phone preview, start with browser=\"link\" and present the ready status preview.url as a clickable link. This runs companion Chrome headlessly for agent testing; it does not control the phone's browser. Never give a phone the .localhost URL. Treat preview.url as a bearer credential: share only in this user's chat, never in a PR or public logs. It expires with the session and is regenerated on resume. Local stdio supplies no phone User-Agent, so select link mode only from explicit client/user context; do not guess from a mobile viewport. The laptop companion and a client that can reach its MCP tools are still required; this does not enable phone-only ChatGPT connectivity.\nFor requested PRs, commit intended files remotely on a feature branch, write the description remotely, then run /tmp/d3k-tools/node_modules/.bin/d3k-runtime publish --base <actual-base> --title <title> --body-file <remote-description-file> through sandbox_exec. The publisher handles exact Git objects, SHA verification, safe retries and draft PR creation with laptop authentication. Do not reconstruct Git Data requests manually. sandbox_github remains available for repository-scoped inspection. Do not send local GitHub/Vercel credentials into the VM.\nIf the dev runtime stops or returns 502, use sandbox_recover action=start, then poll action=status until recovered or failed. This preserves the current agent, browser and edits without cloning or installing. Reread sandbox_runtime status and reproduce after recovery; old in-memory evidence is lost.\nKeep the session alive while the user tests. sandbox_stop closes Chrome and stops d3k-owned compute while preserving remote files and a resume ID; externally attached sandboxes remain running. Disconnecting this MCP server also closes its session. No Gateway key or terminal harness is started; this desktop client provides the model. One active sandbox per MCP server. Tool results and desktop conversation history may contain source read remotely. Await the user's task before modifying code.";
|
|
6
|
+
export declare const desktopTools: readonly [{
|
|
7
|
+
readonly name: "sandbox_sessions";
|
|
8
|
+
readonly description: "List saved resumable d3k sandbox sessions and this desktop connection's current session.";
|
|
9
|
+
readonly inputSchema: {
|
|
10
|
+
type: string;
|
|
11
|
+
properties: {};
|
|
12
|
+
additionalProperties: boolean;
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
readonly name: "sandbox_start";
|
|
16
|
+
readonly description: "Start a remote project or resume a saved session with local Chrome, without a terminal harness or Gateway key. Returns starting immediately; poll sandbox_status for readiness. One session per server. Requires local Vercel login, macOS and canonical Portless setup.";
|
|
17
|
+
readonly inputSchema: {
|
|
18
|
+
readonly type: "object";
|
|
19
|
+
readonly properties: {
|
|
20
|
+
readonly project: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly description: "Vercel team/project or project ID. Omit when resuming.";
|
|
23
|
+
};
|
|
24
|
+
readonly resume: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly description: "Saved session ID from sandbox_sessions. Omit project.";
|
|
27
|
+
};
|
|
28
|
+
readonly scope: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
};
|
|
31
|
+
readonly branch: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
};
|
|
34
|
+
readonly attach: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly description: "Existing sandbox containing the remote checkout.";
|
|
37
|
+
};
|
|
38
|
+
readonly name: {
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
};
|
|
41
|
+
readonly hostname: {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
};
|
|
44
|
+
readonly region: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
};
|
|
47
|
+
readonly timeout: {
|
|
48
|
+
readonly type: "integer";
|
|
49
|
+
readonly minimum: 1;
|
|
50
|
+
readonly maximum: 1440;
|
|
51
|
+
readonly description: "Compute lifetime in minutes; default 60.";
|
|
52
|
+
};
|
|
53
|
+
readonly command: {
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
readonly description: "Remote dev command override.";
|
|
56
|
+
};
|
|
57
|
+
readonly installCommand: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly description: "Remote dependency install command override.";
|
|
60
|
+
};
|
|
61
|
+
readonly headless: {
|
|
62
|
+
readonly type: "boolean";
|
|
63
|
+
};
|
|
64
|
+
readonly browser: {
|
|
65
|
+
readonly type: "string";
|
|
66
|
+
readonly enum: readonly ["local", "link"];
|
|
67
|
+
readonly description: "Use link for phone testing: return a protected HTTPS preview and run companion Chrome headlessly. The laptop companion is still required. Defaults to local.";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
readonly additionalProperties: false;
|
|
71
|
+
};
|
|
72
|
+
}, {
|
|
73
|
+
readonly name: "sandbox_status";
|
|
74
|
+
readonly description: "Read desktop connection readiness and bounded startup progress. Wait for phase=ready before workspace tools; failed includes the error. For browser/server evidence use sandbox_runtime after readiness.";
|
|
75
|
+
readonly inputSchema: {
|
|
76
|
+
type: string;
|
|
77
|
+
properties: {};
|
|
78
|
+
additionalProperties: boolean;
|
|
79
|
+
};
|
|
80
|
+
}, {
|
|
81
|
+
readonly name: "sandbox_stop";
|
|
82
|
+
readonly description: "Close this desktop connection's browser and runtime, preserving remote code and resume metadata. Returns stopping; poll sandbox_status until stopped before starting/resuming another session. Does not delete the sandbox.";
|
|
83
|
+
readonly inputSchema: {
|
|
84
|
+
type: string;
|
|
85
|
+
properties: {};
|
|
86
|
+
additionalProperties: boolean;
|
|
87
|
+
};
|
|
88
|
+
}, {
|
|
89
|
+
readonly name: "sandbox_recover";
|
|
90
|
+
readonly description: "Recover a stopped or unhealthy dev runtime and browser bridge in the SAME sandbox, preserving files, the local browser, and the agent. No clone or dependency reinstall. Start returns immediately; poll with action status until recovered or failed, then reread sandbox_runtime status. A restarted runtime loses its old in-memory evidence. Does not replay agent commands, renew Gateway keys or extend compute lifetime.";
|
|
91
|
+
readonly inputSchema: {
|
|
92
|
+
readonly type: "object";
|
|
93
|
+
readonly properties: {
|
|
94
|
+
readonly action: {
|
|
95
|
+
readonly type: "string";
|
|
96
|
+
readonly enum: readonly ["start", "status"];
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
readonly additionalProperties: false;
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "sandbox_exec";
|
|
103
|
+
readonly description: "Run a shell command in the REMOTE project. Use for search, tests, dependencies, Git branches and commits. Nothing executes on the laptop.";
|
|
104
|
+
readonly inputSchema: {
|
|
105
|
+
readonly type: "object";
|
|
106
|
+
readonly properties: {
|
|
107
|
+
readonly command: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
readonly required: readonly ["command"];
|
|
112
|
+
readonly additionalProperties: false;
|
|
113
|
+
};
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "sandbox_read_file";
|
|
116
|
+
readonly description: "Read a UTF-8 project file inside the sandbox. Paths are relative to the remote project root.";
|
|
117
|
+
readonly inputSchema: {
|
|
118
|
+
readonly type: "object";
|
|
119
|
+
readonly properties: {
|
|
120
|
+
readonly path: {
|
|
121
|
+
readonly type: "string";
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
readonly required: readonly ["path"];
|
|
125
|
+
readonly additionalProperties: false;
|
|
126
|
+
};
|
|
127
|
+
}, {
|
|
128
|
+
readonly name: "sandbox_write_file";
|
|
129
|
+
readonly description: "Write a UTF-8 project file inside the sandbox. Read existing files first. Nothing is saved to the laptop.";
|
|
130
|
+
readonly inputSchema: {
|
|
131
|
+
readonly type: "object";
|
|
132
|
+
readonly properties: {
|
|
133
|
+
readonly path: {
|
|
134
|
+
readonly type: "string";
|
|
135
|
+
};
|
|
136
|
+
readonly content: {
|
|
137
|
+
readonly type: "string";
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
readonly required: readonly ["path", "content"];
|
|
141
|
+
readonly additionalProperties: false;
|
|
142
|
+
};
|
|
143
|
+
}, {
|
|
144
|
+
readonly name: "sandbox_runtime";
|
|
145
|
+
readonly description: "Read d3k status or the shared browser/server events inside the running sandbox. Use events --after CURSOR for logs. Do not start or stop the runtime.";
|
|
146
|
+
readonly inputSchema: {
|
|
147
|
+
readonly type: "object";
|
|
148
|
+
readonly properties: {
|
|
149
|
+
readonly args: {
|
|
150
|
+
readonly type: "array";
|
|
151
|
+
readonly items: {
|
|
152
|
+
readonly type: "string";
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
readonly required: readonly ["args"];
|
|
157
|
+
readonly additionalProperties: false;
|
|
158
|
+
};
|
|
159
|
+
}, {
|
|
160
|
+
readonly name: "sandbox_browser";
|
|
161
|
+
readonly description: "Control the user's existing local Chrome through d3k. agent-browser arguments, e.g. [snapshot,-i], [fill,@e2,text], [click,@e3]. For loading metrics use [metrics,https://example.com/,--new-tab]: Web Vitals, navigation timing, long tasks and resource summaries as JSON. Omit URL to inspect current page without reload (CLS/long tasks unavailable). Prefer metrics over custom eval scripts. CDP is already connected.";
|
|
162
|
+
readonly inputSchema: {
|
|
163
|
+
readonly type: "object";
|
|
164
|
+
readonly properties: {
|
|
165
|
+
readonly args: {
|
|
166
|
+
readonly type: "array";
|
|
167
|
+
readonly items: {
|
|
168
|
+
readonly type: "string";
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
readonly required: readonly ["args"];
|
|
173
|
+
readonly additionalProperties: false;
|
|
174
|
+
};
|
|
175
|
+
}, {
|
|
176
|
+
readonly name: "sandbox_github";
|
|
177
|
+
readonly description: "Publish branches/PRs for this sandbox's linked GitHub repository using LOCAL GitHub CLI authentication. GitHub credentials never enter the sandbox. Use Git Data APIs (blobs, trees, commits, refs) to publish remote Git objects, then /pulls to create a PR. No force pushes. Paths are repo-relative, e.g. /git/ref/heads/main or /pulls.";
|
|
178
|
+
readonly inputSchema: {
|
|
179
|
+
readonly type: "object";
|
|
180
|
+
readonly properties: {
|
|
181
|
+
readonly method: {
|
|
182
|
+
readonly type: "string";
|
|
183
|
+
readonly enum: readonly ["GET", "POST", "PATCH"];
|
|
184
|
+
};
|
|
185
|
+
readonly path: {
|
|
186
|
+
readonly type: "string";
|
|
187
|
+
};
|
|
188
|
+
readonly body: {
|
|
189
|
+
readonly type: "object";
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
readonly required: readonly ["method", "path"];
|
|
193
|
+
readonly additionalProperties: false;
|
|
194
|
+
};
|
|
195
|
+
}];
|
|
196
|
+
export declare function desktopMcpConfig(): {
|
|
197
|
+
mcpServers: {
|
|
198
|
+
d3k: {
|
|
199
|
+
command: string;
|
|
200
|
+
args: string[];
|
|
201
|
+
env: {
|
|
202
|
+
PATH: string;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
export declare function createDesktopWorkspace(dependencies?: {
|
|
208
|
+
launch: typeof launchSandbox;
|
|
209
|
+
list: typeof listSandboxSessions;
|
|
210
|
+
portless: typeof getPortlessProxyStatus;
|
|
211
|
+
}): {
|
|
212
|
+
call(name: string, args: Record<string, unknown>): Promise<WorkspaceResult>;
|
|
213
|
+
close(): Promise<void>;
|
|
214
|
+
};
|
|
215
|
+
export declare function runDesktopMcp(): Promise<void>;
|
|
216
|
+
//# sourceMappingURL=desktop-mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"desktop-mcp.d.ts","sourceRoot":"","sources":["../../src/runtime/desktop-mcp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,EAAE,aAAa,EAAuB,MAAM,cAAc,CAAA;AAEjE,OAAO,EAAE,mBAAmB,EAA6C,MAAM,uBAAuB,CAAA;AACtG,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,wBAAwB,CAAA;AAE7E,eAAO,MAAM,mBAAmB,o1IAS+c,CAAA;AAG/e,eAAO,MAAM,YAAY;mBAEf,kBAAkB;0BACX,0FAA0F;;;;;;;mBAIjG,eAAe;0BAEnB,0QAA0Q;;iBAE1Q,IAAI,EAAE,QAAQ;iBACd,UAAU;qBACR,OAAO;yBAAI,IAAI,EAAE,QAAQ;yBAAE,WAAW,EAAE,wDAAwD;;qBAChG,MAAM;yBAAI,IAAI,EAAE,QAAQ;yBAAE,WAAW,EAAE,uDAAuD;;qBAC9F,KAAK;yBAAI,IAAI,EAAE,QAAQ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
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { getPortlessProxyStatus } from "../portless.js";
|
|
3
|
+
import { serveMcp } from "./mcp-stdio.js";
|
|
4
|
+
import { launchSandbox } from "./sandbox.js";
|
|
5
|
+
import { resolveSandboxResume } from "./sandbox-command.js";
|
|
6
|
+
import { listSandboxSessions, sandboxLauncherAlive } from "./sandbox-sessions.js";
|
|
7
|
+
import { workspaceTools } from "./sandbox-workspace.js";
|
|
8
|
+
export const desktopInstructions = `d3k connects this desktop assistant to a REMOTE Vercel Sandbox and an existing LOCAL Chrome. Call sandbox_sessions first; use sandbox_start with project or a saved resume ID, then poll sandbox_status until phase=ready. Startup takes time; never treat starting as ready or start a second session. If Portless or Vercel login needs setup, report the exact prerequisite to the user.
|
|
9
|
+
An explicitly requested remote sandbox takes precedence over this chat's linked local repository. Start with project and the requested branch for a fresh remote checkout; use resume or attach only when the user requests reuse. A failed fresh start is not permission to attach to an unrelated old checkout or drop the requested branch. Report the actual startup error without guessing that the repository is private.
|
|
10
|
+
Project files, app environment, installs, tests and Git edits stay REMOTE. Never clone or recreate the project locally. Use sandbox_exec, sandbox_read_file and sandbox_write_file for project work. Read the remote AGENTS.md and narrower instructions before editing. sandbox_exec runs in the remote project root and has a 60-second deadline; inspect remote state before retrying a timed-out mutation.
|
|
11
|
+
Use sandbox_browser immediately for the already connected LOCAL Chrome, e.g. args=["snapshot","-i"]. CDP is managed: do not hunt for ports, install browsers, or start another runtime/browser. Use sandbox_runtime args=["status"] before reproducing; retain sessionId/cursor, then read events --session ID --after CURSOR. Continue while hasMore; reset or dropped means an evidence gap.
|
|
12
|
+
For loading metrics, use sandbox_browser args=["metrics","https://example.com/","--new-tab"]. This installs observers before navigation and returns Web Vitals, navigation timing, long tasks and resource summaries as JSON. Prefer it over custom eval scripts. Omit the URL for a current-page snapshot without reload; CLS and long tasks are then unavailable. Results use existing cache/throttling and provisional vitals; null means unavailable.
|
|
13
|
+
After responsive/device testing, restore window-sized rendering with sandbox_browser args=["set","viewport","0","0","0"]. Verify the page fills the headed window before handing it back. Do not restore to a guessed desktop size such as 1280x900; that leaves a fixed viewport when the user resizes the window.
|
|
14
|
+
When the user is on a phone or asks for a phone preview, start with browser="link" and present the ready status preview.url as a clickable link. This runs companion Chrome headlessly for agent testing; it does not control the phone's browser. Never give a phone the .localhost URL. Treat preview.url as a bearer credential: share only in this user's chat, never in a PR or public logs. It expires with the session and is regenerated on resume. Local stdio supplies no phone User-Agent, so select link mode only from explicit client/user context; do not guess from a mobile viewport. The laptop companion and a client that can reach its MCP tools are still required; this does not enable phone-only ChatGPT connectivity.
|
|
15
|
+
For requested PRs, commit intended files remotely on a feature branch, write the description remotely, then run /tmp/d3k-tools/node_modules/.bin/d3k-runtime publish --base <actual-base> --title <title> --body-file <remote-description-file> through sandbox_exec. The publisher handles exact Git objects, SHA verification, safe retries and draft PR creation with laptop authentication. Do not reconstruct Git Data requests manually. sandbox_github remains available for repository-scoped inspection. Do not send local GitHub/Vercel credentials into the VM.
|
|
16
|
+
If the dev runtime stops or returns 502, use sandbox_recover action=start, then poll action=status until recovered or failed. This preserves the current agent, browser and edits without cloning or installing. Reread sandbox_runtime status and reproduce after recovery; old in-memory evidence is lost.
|
|
17
|
+
Keep the session alive while the user tests. sandbox_stop closes Chrome and stops d3k-owned compute while preserving remote files and a resume ID; externally attached sandboxes remain running. Disconnecting this MCP server also closes its session. No Gateway key or terminal harness is started; this desktop client provides the model. One active sandbox per MCP server. Tool results and desktop conversation history may contain source read remotely. Await the user's task before modifying code.`;
|
|
18
|
+
const emptySchema = { type: "object", properties: {}, additionalProperties: false };
|
|
19
|
+
export const desktopTools = [
|
|
20
|
+
{
|
|
21
|
+
name: "sandbox_sessions",
|
|
22
|
+
description: "List saved resumable d3k sandbox sessions and this desktop connection's current session.",
|
|
23
|
+
inputSchema: emptySchema
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "sandbox_start",
|
|
27
|
+
description: "Start a remote project or resume a saved session with local Chrome, without a terminal harness or Gateway key. Returns starting immediately; poll sandbox_status for readiness. One session per server. Requires local Vercel login, macOS and canonical Portless setup.",
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
project: { type: "string", description: "Vercel team/project or project ID. Omit when resuming." },
|
|
32
|
+
resume: { type: "string", description: "Saved session ID from sandbox_sessions. Omit project." },
|
|
33
|
+
scope: { type: "string" },
|
|
34
|
+
branch: { type: "string" },
|
|
35
|
+
attach: { type: "string", description: "Existing sandbox containing the remote checkout." },
|
|
36
|
+
name: { type: "string" },
|
|
37
|
+
hostname: { type: "string" },
|
|
38
|
+
region: { type: "string" },
|
|
39
|
+
timeout: {
|
|
40
|
+
type: "integer",
|
|
41
|
+
minimum: 1,
|
|
42
|
+
maximum: 1440,
|
|
43
|
+
description: "Compute lifetime in minutes; default 60."
|
|
44
|
+
},
|
|
45
|
+
command: { type: "string", description: "Remote dev command override." },
|
|
46
|
+
installCommand: { type: "string", description: "Remote dependency install command override." },
|
|
47
|
+
headless: { type: "boolean" },
|
|
48
|
+
browser: {
|
|
49
|
+
type: "string",
|
|
50
|
+
enum: ["local", "link"],
|
|
51
|
+
description: "Use link for phone testing: return a protected HTTPS preview and run companion Chrome headlessly. The laptop companion is still required. Defaults to local."
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
additionalProperties: false
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "sandbox_status",
|
|
59
|
+
description: "Read desktop connection readiness and bounded startup progress. Wait for phase=ready before workspace tools; failed includes the error. For browser/server evidence use sandbox_runtime after readiness.",
|
|
60
|
+
inputSchema: emptySchema
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "sandbox_stop",
|
|
64
|
+
description: "Close this desktop connection's browser and runtime, preserving remote code and resume metadata. Returns stopping; poll sandbox_status until stopped before starting/resuming another session. Does not delete the sandbox.",
|
|
65
|
+
inputSchema: emptySchema
|
|
66
|
+
},
|
|
67
|
+
...workspaceTools
|
|
68
|
+
];
|
|
69
|
+
export function desktopMcpConfig() {
|
|
70
|
+
return {
|
|
71
|
+
mcpServers: {
|
|
72
|
+
d3k: {
|
|
73
|
+
command: process.execPath,
|
|
74
|
+
args: [fileURLToPath(new URL("./cli.js", import.meta.url)), "mcp"],
|
|
75
|
+
// GUI applications commonly start with a minimal PATH. No credentials in config.
|
|
76
|
+
env: { PATH: process.env.PATH || "" }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function startOptions(args) {
|
|
82
|
+
const allowed = new Set([
|
|
83
|
+
"project",
|
|
84
|
+
"resume",
|
|
85
|
+
"scope",
|
|
86
|
+
"branch",
|
|
87
|
+
"attach",
|
|
88
|
+
"name",
|
|
89
|
+
"hostname",
|
|
90
|
+
"region",
|
|
91
|
+
"timeout",
|
|
92
|
+
"command",
|
|
93
|
+
"installCommand",
|
|
94
|
+
"headless",
|
|
95
|
+
"browser"
|
|
96
|
+
]);
|
|
97
|
+
for (const [key, value] of Object.entries(args)) {
|
|
98
|
+
if (!allowed.has(key))
|
|
99
|
+
throw new Error(`Unknown sandbox_start option: ${key}`);
|
|
100
|
+
if (key === "browser") {
|
|
101
|
+
if (value !== "local" && value !== "link")
|
|
102
|
+
throw new Error("browser must be local or link");
|
|
103
|
+
}
|
|
104
|
+
else if (key === "headless") {
|
|
105
|
+
if (typeof value !== "boolean")
|
|
106
|
+
throw new Error("headless must be a boolean");
|
|
107
|
+
}
|
|
108
|
+
else if (key === "timeout") {
|
|
109
|
+
if (!Number.isInteger(value) || Number(value) < 1 || Number(value) > 1440)
|
|
110
|
+
throw new Error("timeout must be 1–1440 minutes");
|
|
111
|
+
}
|
|
112
|
+
else if (typeof value !== "string" || !value.trim())
|
|
113
|
+
throw new Error(`${key} must be a nonempty string`);
|
|
114
|
+
}
|
|
115
|
+
if (args.browser === "link" && args.headless === false)
|
|
116
|
+
throw new Error("Link mode requires headless Chrome");
|
|
117
|
+
const { browser, ...launchArgs } = args;
|
|
118
|
+
const options = resolveSandboxResume({
|
|
119
|
+
...launchArgs,
|
|
120
|
+
...(browser === "link" ? { preview: true, headless: true } : {}),
|
|
121
|
+
...(args.timeout === undefined ? {} : { timeout: String(args.timeout) }),
|
|
122
|
+
// Overrides saved terminal preferences on resume; desktop supplies its own model.
|
|
123
|
+
shell: false,
|
|
124
|
+
fx: false,
|
|
125
|
+
gateway: false,
|
|
126
|
+
harness: undefined,
|
|
127
|
+
harnessLocation: undefined
|
|
128
|
+
});
|
|
129
|
+
if (!options)
|
|
130
|
+
throw new Error("Specify project or a saved resume ID");
|
|
131
|
+
return options;
|
|
132
|
+
}
|
|
133
|
+
export function createDesktopWorkspace(dependencies = {
|
|
134
|
+
launch: launchSandbox,
|
|
135
|
+
list: listSandboxSessions,
|
|
136
|
+
portless: getPortlessProxyStatus
|
|
137
|
+
}) {
|
|
138
|
+
let phase = "idle";
|
|
139
|
+
let session;
|
|
140
|
+
let preview;
|
|
141
|
+
let error;
|
|
142
|
+
let progress = [];
|
|
143
|
+
let call;
|
|
144
|
+
let controller;
|
|
145
|
+
let running;
|
|
146
|
+
const status = () => ({
|
|
147
|
+
phase,
|
|
148
|
+
session,
|
|
149
|
+
...(phase === "ready" && preview ? { preview } : {}),
|
|
150
|
+
error,
|
|
151
|
+
progress: [...progress]
|
|
152
|
+
});
|
|
153
|
+
const result = (value) => ({ content: [{ type: "text", text: JSON.stringify(value) }] });
|
|
154
|
+
return {
|
|
155
|
+
async call(name, args) {
|
|
156
|
+
if (name === "sandbox_sessions")
|
|
157
|
+
return result({
|
|
158
|
+
...status(),
|
|
159
|
+
sessions: dependencies.list().map((item) => ({ ...item, companionRunning: sandboxLauncherAlive(item) }))
|
|
160
|
+
});
|
|
161
|
+
if (name === "sandbox_status")
|
|
162
|
+
return result(status());
|
|
163
|
+
if (name === "sandbox_stop") {
|
|
164
|
+
if (running) {
|
|
165
|
+
phase = "stopping";
|
|
166
|
+
call = undefined;
|
|
167
|
+
controller?.abort();
|
|
168
|
+
}
|
|
169
|
+
return result(status());
|
|
170
|
+
}
|
|
171
|
+
if (name === "sandbox_start") {
|
|
172
|
+
if (running)
|
|
173
|
+
throw new Error("This desktop connection already owns a session; stop it and wait for stopped first");
|
|
174
|
+
const options = startOptions(args);
|
|
175
|
+
const portless = dependencies.portless();
|
|
176
|
+
if (!portless.canonical || !portless.serviceInstalled || portless.setupRequired)
|
|
177
|
+
throw new Error("Canonical Portless is required. Run d3k portless setup in a terminal, authorize it, then retry.");
|
|
178
|
+
controller = new AbortController();
|
|
179
|
+
const signal = controller.signal;
|
|
180
|
+
phase = "starting";
|
|
181
|
+
session = undefined;
|
|
182
|
+
preview = undefined;
|
|
183
|
+
error = undefined;
|
|
184
|
+
progress = [];
|
|
185
|
+
running = Promise.resolve()
|
|
186
|
+
.then(() => dependencies.launch(options, {
|
|
187
|
+
signal,
|
|
188
|
+
log: (message) => {
|
|
189
|
+
progress = [...progress, message.slice(-2000)].slice(-20);
|
|
190
|
+
},
|
|
191
|
+
onClosing: () => {
|
|
192
|
+
phase = "stopping";
|
|
193
|
+
call = undefined;
|
|
194
|
+
},
|
|
195
|
+
onReady: (workspace) => {
|
|
196
|
+
if (signal.aborted)
|
|
197
|
+
return;
|
|
198
|
+
session = { ...workspace.session };
|
|
199
|
+
preview = workspace.preview;
|
|
200
|
+
call = workspace.call;
|
|
201
|
+
phase = "ready";
|
|
202
|
+
}
|
|
203
|
+
}))
|
|
204
|
+
.then(() => {
|
|
205
|
+
phase = "stopped";
|
|
206
|
+
}, (failure) => {
|
|
207
|
+
error = signal.aborted ? undefined : failure instanceof Error ? failure.message : "Sandbox startup failed";
|
|
208
|
+
phase = error ? "failed" : "stopped";
|
|
209
|
+
})
|
|
210
|
+
.finally(() => {
|
|
211
|
+
call = undefined;
|
|
212
|
+
running = undefined;
|
|
213
|
+
});
|
|
214
|
+
return result(status());
|
|
215
|
+
}
|
|
216
|
+
if (!workspaceTools.some((tool) => tool.name === name))
|
|
217
|
+
throw new Error("Unknown workspace tool");
|
|
218
|
+
if (phase !== "ready" || !call)
|
|
219
|
+
throw new Error("No ready sandbox. Use sandbox_start and poll sandbox_status first.");
|
|
220
|
+
return call(name, args);
|
|
221
|
+
},
|
|
222
|
+
async close() {
|
|
223
|
+
call = undefined;
|
|
224
|
+
if (running) {
|
|
225
|
+
phase = "stopping";
|
|
226
|
+
controller?.abort();
|
|
227
|
+
await running;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
export async function runDesktopMcp() {
|
|
233
|
+
const workspace = createDesktopWorkspace();
|
|
234
|
+
let stopping = false;
|
|
235
|
+
const stop = () => {
|
|
236
|
+
stopping = true;
|
|
237
|
+
void workspace.close();
|
|
238
|
+
process.stdin.destroy();
|
|
239
|
+
};
|
|
240
|
+
process.on("SIGINT", stop);
|
|
241
|
+
process.on("SIGTERM", stop);
|
|
242
|
+
// EOF means the desktop client disconnected. Begin cleanup before waiting on tool calls.
|
|
243
|
+
process.stdin.once("end", stop);
|
|
244
|
+
try {
|
|
245
|
+
await serveMcp({ name: "d3k", instructions: desktopInstructions, tools: desktopTools, call: workspace.call });
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
if (!stopping)
|
|
249
|
+
throw error;
|
|
250
|
+
}
|
|
251
|
+
finally {
|
|
252
|
+
await workspace.close();
|
|
253
|
+
process.off("SIGINT", stop);
|
|
254
|
+
process.off("SIGTERM", stop);
|
|
255
|
+
process.stdin.off("end", stop);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=desktop-mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"desktop-mcp.js","sourceRoot":"","sources":["../../src/runtime/desktop-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,sBAA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I,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAC/B,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,CAAA;IAC/G,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,QAAQ;YAAE,MAAM,KAAK,CAAA;IAC5B,CAAC;YAAS,CAAC;QACT,MAAM,SAAS,CAAC,KAAK,EAAE,CAAA;QACvB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;QAC3B,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;QAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAChC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { runSandboxCli } from "./sandbox-process.js";
|
|
2
|
+
/** Use the user's configured preference; never invent a sandbox identity. */
|
|
3
|
+
export declare function configuredGitIdentity(run?: typeof runSandboxCli, cwd?: string, signal?: AbortSignal): Promise<Record<string, string> | undefined>;
|
|
4
|
+
/** Make the effective identity discoverable to agents that inspect git config. */
|
|
5
|
+
export declare const sandboxGitIdentityScript = "\nconst {spawnSync} = require('node:child_process');\nconst [fallbackName, fallbackEmail] = process.argv.slice(1);\nfunction git(args, optional = false) {\n const result = spawnSync('git', args, {encoding:'utf8'});\n if (optional && result.status === 1) return '';\n if (result.status !== 0) throw new Error('Git identity configuration failed: ' + (result.stderr || result.error?.message || result.status));\n return result.stdout.trim();\n}\nconst name = git(['config','--get','user.name'], true) || fallbackName;\nconst email = git(['config','--get','user.email'], true) || fallbackEmail;\nif (!name || !email) console.log('null');\nelse {\n // Preserve an explicit checkout preference; fill missing fields from the laptop.\n git(['config','--local','user.name',name]);\n git(['config','--local','user.email',email]);\n console.log(JSON.stringify({GIT_AUTHOR_NAME:name,GIT_AUTHOR_EMAIL:email,GIT_COMMITTER_NAME:name,GIT_COMMITTER_EMAIL:email}));\n}\n";
|
|
6
|
+
export declare function configureSandboxGitIdentity(sandbox: {
|
|
7
|
+
runCommand(options: {
|
|
8
|
+
cmd: string;
|
|
9
|
+
args: string[];
|
|
10
|
+
cwd: string;
|
|
11
|
+
}): Promise<{
|
|
12
|
+
exitCode: number;
|
|
13
|
+
stdout(): Promise<string>;
|
|
14
|
+
stderr(): Promise<string>;
|
|
15
|
+
}>;
|
|
16
|
+
}, workdir: string, identity?: Record<string, string>): Promise<Record<string, string> | undefined>;
|
|
17
|
+
//# sourceMappingURL=git-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-identity.d.ts","sourceRoot":"","sources":["../../src/runtime/git-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,6EAA6E;AAC7E,wBAAsB,qBAAqB,CACzC,GAAG,GAAE,OAAO,aAA6B,EACzC,GAAG,SAAgB,EACnB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,CAU7C;AAED,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,q8BAkBpC,CAAA;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE;IACP,UAAU,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QACzE,QAAQ,EAAE,MAAM,CAAA;QAChB,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;QACzB,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;KAC1B,CAAC,CAAA;CACH,EACD,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,CAQ7C"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { runSandboxCli } from "./sandbox-process.js";
|
|
2
|
+
/** Use the user's configured preference; never invent a sandbox identity. */
|
|
3
|
+
export async function configuredGitIdentity(run = runSandboxCli, cwd = process.cwd(), signal) {
|
|
4
|
+
const [name, email] = await Promise.all(["user.name", "user.email"].map((key) => run("git", ["config", "--get", key], { cwd, signal, timeoutMs: 5000 })
|
|
5
|
+
.then((value) => value.trim())
|
|
6
|
+
.catch(() => "")));
|
|
7
|
+
if (!name || !email)
|
|
8
|
+
return undefined;
|
|
9
|
+
return { GIT_AUTHOR_NAME: name, GIT_AUTHOR_EMAIL: email, GIT_COMMITTER_NAME: name, GIT_COMMITTER_EMAIL: email };
|
|
10
|
+
}
|
|
11
|
+
/** Make the effective identity discoverable to agents that inspect git config. */
|
|
12
|
+
export const sandboxGitIdentityScript = `
|
|
13
|
+
const {spawnSync} = require('node:child_process');
|
|
14
|
+
const [fallbackName, fallbackEmail] = process.argv.slice(1);
|
|
15
|
+
function git(args, optional = false) {
|
|
16
|
+
const result = spawnSync('git', args, {encoding:'utf8'});
|
|
17
|
+
if (optional && result.status === 1) return '';
|
|
18
|
+
if (result.status !== 0) throw new Error('Git identity configuration failed: ' + (result.stderr || result.error?.message || result.status));
|
|
19
|
+
return result.stdout.trim();
|
|
20
|
+
}
|
|
21
|
+
const name = git(['config','--get','user.name'], true) || fallbackName;
|
|
22
|
+
const email = git(['config','--get','user.email'], true) || fallbackEmail;
|
|
23
|
+
if (!name || !email) console.log('null');
|
|
24
|
+
else {
|
|
25
|
+
// Preserve an explicit checkout preference; fill missing fields from the laptop.
|
|
26
|
+
git(['config','--local','user.name',name]);
|
|
27
|
+
git(['config','--local','user.email',email]);
|
|
28
|
+
console.log(JSON.stringify({GIT_AUTHOR_NAME:name,GIT_AUTHOR_EMAIL:email,GIT_COMMITTER_NAME:name,GIT_COMMITTER_EMAIL:email}));
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
export async function configureSandboxGitIdentity(sandbox, workdir, identity) {
|
|
32
|
+
const result = await sandbox.runCommand({
|
|
33
|
+
cmd: "node",
|
|
34
|
+
args: ["-e", sandboxGitIdentityScript, identity?.GIT_AUTHOR_NAME || "", identity?.GIT_AUTHOR_EMAIL || ""],
|
|
35
|
+
cwd: workdir
|
|
36
|
+
});
|
|
37
|
+
if (result.exitCode !== 0)
|
|
38
|
+
throw new Error(`Could not configure sandbox Git identity: ${await result.stderr()}`);
|
|
39
|
+
return JSON.parse(await result.stdout()) || undefined;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=git-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-identity.js","sourceRoot":"","sources":["../../src/runtime/git-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,6EAA6E;AAC7E,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,GAAG,GAAyB,aAAa,EACzC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EACnB,MAAoB;IAEpB,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CACrC,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACtC,GAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;SACnE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;SAC7B,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CACnB,CACF,CAAA;IACD,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IACrC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAA;AACjH,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;CAkBvC,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,OAMC,EACD,OAAe,EACf,QAAiC;IAEjC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC;QACtC,GAAG,EAAE,MAAM;QACX,IAAI,EAAE,CAAC,IAAI,EAAE,wBAAwB,EAAE,QAAQ,EAAE,eAAe,IAAI,EAAE,EAAE,QAAQ,EAAE,gBAAgB,IAAI,EAAE,CAAC;QACzG,GAAG,EAAE,OAAO;KACb,CAAC,CAAA;IACF,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,MAAM,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAChH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,SAAS,CAAA;AACvD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type GithubApi = (method: string, path: string, body?: Record<string, unknown>) => Promise<unknown>;
|
|
2
|
+
type Identity = {
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
date: string;
|
|
6
|
+
};
|
|
7
|
+
type Commit = {
|
|
8
|
+
message: string;
|
|
9
|
+
tree: string;
|
|
10
|
+
parents: string[];
|
|
11
|
+
author: Identity;
|
|
12
|
+
committer: Identity;
|
|
13
|
+
};
|
|
14
|
+
/** Read the raw object: trimming or shell substitution would change the commit's SHA. */
|
|
15
|
+
export declare function parsePublishCommit(bytes: Buffer): Commit;
|
|
16
|
+
/** Publish an already committed feature branch through the credential-free sandbox bridge. */
|
|
17
|
+
export declare function publishGithub(options: {
|
|
18
|
+
cwd: string;
|
|
19
|
+
base: string;
|
|
20
|
+
title: string;
|
|
21
|
+
body: string;
|
|
22
|
+
api: GithubApi;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
url: string;
|
|
25
|
+
number: number;
|
|
26
|
+
branch: string;
|
|
27
|
+
base: string;
|
|
28
|
+
sha: string;
|
|
29
|
+
}>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=github-publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-publish.d.ts","sourceRoot":"","sources":["../../src/runtime/github-publish.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAQ1G,KAAK,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAC7D,KAAK,MAAM,GAAG;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,QAAQ,CAAA;IAChB,SAAS,EAAE,QAAQ,CAAA;CACpB,CAAA;AAqBD,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA0BxD;AAaD,8FAA8F;AAC9F,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,SAAS,CAAA;CACf;;;;;;GAsKA"}
|