eve 0.36.0 → 0.37.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/CHANGELOG.md +13 -0
- package/README.md +1 -0
- package/dist/src/cli/commands/agent-instructions.d.ts +4 -4
- package/dist/src/cli/commands/init-confirm.d.ts +12 -0
- package/dist/src/cli/commands/init-confirm.js +1 -0
- package/dist/src/cli/commands/init.d.ts +6 -5
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/run.d.ts +1 -0
- package/dist/src/cli/run.js +3 -3
- package/dist/src/compiled/.vendor-stamp.json +2 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +339 -0
- package/dist/src/compiled/@vercel/sandbox/api-client/index.d.ts +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +25 -1
- package/dist/src/compiled/@vercel/sandbox/drive.d.ts +140 -0
- package/dist/src/compiled/@vercel/sandbox/index.d.ts +3 -2
- package/dist/src/compiled/@vercel/sandbox/index.js +13 -13
- package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +55 -18
- package/dist/src/compiled/@vercel/sandbox-stable/LICENSE +201 -0
- package/dist/src/compiled/@vercel/sandbox-stable/_async-retry.d.ts +8 -0
- package/dist/src/compiled/@vercel/sandbox-stable/_workflow-serde.d.ts +5 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-client.d.ts +1456 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-error.d.ts +29 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/base-client.d.ts +39 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/file-writer.d.ts +66 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/index.d.ts +2 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/validators.d.ts +899 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/with-retry.d.ts +10 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/error.d.ts +15 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/file.d.ts +18 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/index.d.ts +6 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/oauth.d.ts +111 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/poll-for-token.d.ts +28 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/project.d.ts +40 -0
- package/dist/src/compiled/@vercel/sandbox-stable/command.d.ts +292 -0
- package/dist/src/compiled/@vercel/sandbox-stable/constants.d.ts +5 -0
- package/dist/src/compiled/@vercel/sandbox-stable/execution-context.d.ts +116 -0
- package/dist/src/compiled/@vercel/sandbox-stable/filesystem.d.ts +258 -0
- package/dist/src/compiled/@vercel/sandbox-stable/index.d.ts +12 -0
- package/dist/src/compiled/@vercel/sandbox-stable/index.js +1 -0
- package/dist/src/compiled/@vercel/sandbox-stable/network-policy.d.ts +169 -0
- package/dist/src/compiled/@vercel/sandbox-stable/proxy.d.ts +55 -0
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox-user.d.ts +212 -0
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox.d.ts +1216 -0
- package/dist/src/compiled/@vercel/sandbox-stable/session.d.ts +433 -0
- package/dist/src/compiled/@vercel/sandbox-stable/snapshot.d.ts +229 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/get-credentials.d.ts +21 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/paginator.d.ts +16 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/resolveSignal.d.ts +15 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/sandbox-snapshot.d.ts +11 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/types.d.ts +11 -0
- package/dist/src/compiled/_chunks/node/{auth-BS3UoyvT.js → auth-BaNbsImr.js} +1 -1
- package/dist/src/compiled/_chunks/node/version-BYHw-SDY.js +1 -0
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +2 -1
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts +5 -4
- package/dist/src/public/sandbox/backends/vercel.js +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +25 -1
- package/dist/src/public/sandbox/vercel.d.ts +2 -1
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +0 -1
- package/dist/src/shared/sandbox-network-policy.d.ts +1 -1
- package/docs/reference/cli.md +10 -6
- package/package.json +2 -1
- package/dist/src/compiled/_chunks/node/version-Cztrk7z6.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.37.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fe691aa: Expose Vercel Sandbox Drives and allow authors to mount them when creating live session sandboxes.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- d0bb6af: Fix Sign in with Vercel Web Chat projects failing to load user-scoped Vercel Connect tools because the generated channel used a reserved issuer.
|
|
12
|
+
- 7ab7d97: Running eve without a command now initializes the current directory when no eve project is present, and starts development when one is detected.
|
|
13
|
+
- c77c661: `eve init` now asks whether to scaffold a non-empty current directory in place or create a named subdirectory. In-place scaffolds preserve unrelated files and overwrite generated paths; coding-agent and non-interactive launches must pass an explicit directory name.
|
|
14
|
+
- 456c0a5: `eve init` now scaffolds the current directory when no target is provided, including when launched by a coding agent.
|
|
15
|
+
|
|
3
16
|
## 0.36.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -133,6 +133,7 @@ project or deploy the agent.
|
|
|
133
133
|
|
|
134
134
|
CLI commands:
|
|
135
135
|
|
|
136
|
+
- `eve` (including `npx eve`) — initialize the current directory, or start development in an eve project
|
|
136
137
|
- `eve init <name>` — create a new agent
|
|
137
138
|
- `eve info` — discovery results and compiled artifacts
|
|
138
139
|
- `eve build` — compile `.eve/` and build the host output
|
|
@@ -3,12 +3,12 @@ export declare const SETUP_SECTIONS: readonly ["intro-setup.md", "collect-intent
|
|
|
3
3
|
/** Ordered `agent-prompt/` sections composed into the post-scaffold handoff. */
|
|
4
4
|
export declare const HANDOFF_SECTIONS: readonly ["intro-handoff.md", "collect-intent.md", "vercel-connect.md", "build-and-verify.md"];
|
|
5
5
|
/**
|
|
6
|
-
* The pre-scaffold setup guide
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The pre-scaffold setup guide shown after malformed coding-agent input. It
|
|
7
|
+
* scaffolds from scratch, so it renders with the universal `npx eve dev` rather
|
|
8
|
+
* than a launcher-specific command.
|
|
9
9
|
*/
|
|
10
10
|
export declare function initAgentInstructions(): string;
|
|
11
|
-
/** The post-scaffold handoff printed after a coding agent runs `eve init
|
|
11
|
+
/** The post-scaffold handoff printed after a coding agent runs `eve init`. */
|
|
12
12
|
export declare function initAgentDevHandoff(options: {
|
|
13
13
|
projectPath: string;
|
|
14
14
|
devCommand: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Prompter } from "#setup/prompter.js";
|
|
2
|
+
export interface InitConfirmDependencies {
|
|
3
|
+
createPrompter(): Prompter;
|
|
4
|
+
hasInteractiveTerminal(): boolean;
|
|
5
|
+
}
|
|
6
|
+
export type InitNonEmptyDirectoryTarget = {
|
|
7
|
+
kind: "current-directory";
|
|
8
|
+
} | {
|
|
9
|
+
kind: "subdirectory";
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function confirmInitInNonEmptyDirectory(entries: readonly string[], dependencies?: InitConfirmDependencies): Promise<InitNonEmptyDirectoryTarget>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hasInteractiveTerminal}from"./preconditions.js";import{createPrompter}from"#setup/prompter.js";import{parseProjectName,validateProjectName}from"#setup/project-name.js";const defaultDependencies={createPrompter,hasInteractiveTerminal};function formatEntries(e){return`${e.slice(0,5).join(`, `)}${e.length>5?`, and ${e.length-5} more`:``}`}async function confirmInitInNonEmptyDirectory(e,t=defaultDependencies){let n=formatEntries(e);if(!t.hasInteractiveTerminal())throw Error(`Cannot choose where to initialize the non-empty current directory without an interactive terminal. Found: ${n}. Pass a new directory name, for example: eve init my-agent.`);let r=t.createPrompter();return await r.select({message:`Where should eve initialize the project?`,description:`The current directory isn't empty. Found: ${n}.`,options:[{value:`subdirectory`,label:`Create a new subdirectory`,hint:`Keep the current directory unchanged`},{value:`current-directory`,label:`Use the current directory`,hint:`Overwrite files at generated paths`,accent:`warning`}],initialValue:`subdirectory`})===`current-directory`?{kind:`current-directory`}:{kind:`subdirectory`,name:parseProjectName(await r.text({message:`Subdirectory name`,defaultValue:`my-agent`,validate:validateProjectName}))}}export{confirmInitInNonEmptyDirectory};
|
|
@@ -5,6 +5,7 @@ import { runPackageManagerInstall, spawnPackageManager } from "#setup/primitives
|
|
|
5
5
|
import { addAgentToProject } from "#setup/scaffold/create/add-to-project.js";
|
|
6
6
|
import { ensureChannel, scaffoldBaseProject } from "#setup/scaffold/index.js";
|
|
7
7
|
import { validateModelSlug } from "#setup/flows/model-source-change.js";
|
|
8
|
+
import { confirmInitInNonEmptyDirectory } from "./init-confirm.js";
|
|
8
9
|
import { tryInitializeGit } from "./init-git.js";
|
|
9
10
|
import { selectInitHandoff, spawnCodingAgentRepl } from "./init-repl.js";
|
|
10
11
|
export interface InitCliLogger {
|
|
@@ -21,6 +22,7 @@ export interface InitCommandOptions {
|
|
|
21
22
|
}
|
|
22
23
|
export interface InitCommandDependencies {
|
|
23
24
|
addAgentToProject: typeof addAgentToProject;
|
|
25
|
+
confirmInitInNonEmptyDirectory: typeof confirmInitInNonEmptyDirectory;
|
|
24
26
|
detectInvokingPackageManager: typeof detectInvokingPackageManager;
|
|
25
27
|
detectPackageManager: typeof detectPackageManager;
|
|
26
28
|
ensureChannel: typeof ensureChannel;
|
|
@@ -37,14 +39,13 @@ export interface InitCommandDependencies {
|
|
|
37
39
|
export declare const EVE_INIT_PACKAGE_SPEC_ENV = "EVE_INIT_PACKAGE_SPEC";
|
|
38
40
|
/**
|
|
39
41
|
* Creates a new eve agent (`target` is a project name), or adds one to an
|
|
40
|
-
* existing project (`target` is a directory), without
|
|
41
|
-
*
|
|
42
|
+
* existing project (`target` is a directory), without external provisioning.
|
|
43
|
+
* A fresh in-place scaffold asks whether to use the current directory or a new
|
|
44
|
+
* subdirectory when the current directory is not empty. Coding-agent launches
|
|
45
|
+
* must pass an explicit subdirectory instead.
|
|
42
46
|
*
|
|
43
47
|
* Runs launched by a coding agent get the dev command printed instead of
|
|
44
48
|
* spawned after scaffolding, since the dev TUI would wedge the launching agent.
|
|
45
|
-
* A coding agent that omits the target entirely gets the setup guide printed and
|
|
46
|
-
* nothing scaffolded, since a bare `eve init` means it has not yet chosen what to
|
|
47
|
-
* build.
|
|
48
49
|
*
|
|
49
50
|
* For extension packages, use `eve extension init` instead.
|
|
50
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{initAgentDevHandoff,initAgentInstructions,initAgentReplPrompt}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{selectInitHandoff,spawnCodingAgentRepl}from"./init-repl.js";import{mkdtemp,readdir,rename,rm,stat}from"node:fs/promises";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import{ensureChannel,scaffoldBaseProject}from"#setup/scaffold/index.js";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{parseProjectName}from"#setup/project-name.js";import{eveDevArguments,runPackageManagerInstall,spawnPackageManager}from"#setup/primitives/index.js";import{blockingCreateInPlaceEntries}from"#setup/scaffold/create-in-place.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";import{WizardCancelledError}from"#setup/step.js";import{validateModelSlug}from"#setup/flows/model-source-change.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={addAgentToProject,detectInvokingPackageManager,detectPackageManager,ensureChannel,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldBaseProject,selectInitHandoff,spawnCodingAgentRepl,spawnPackageManager,tryInitializeGit,validateModelSlug},EVE_INIT_PACKAGE_SPEC_ENV=`EVE_INIT_PACKAGE_SPEC`,initLog=createLogger(`init`);async function resolveTargetDirectory(e,t){let n=resolve(e,t);return(await stat(n).catch(()=>void 0))?.isDirectory()?n:void 0}function isCurrentDirectoryTarget(e){return/^\.(?:[/\\]+\.?)*$/u.test(e.trim())}async function assertCanScaffoldInPlace(e){let t=blockingCreateInPlaceEntries(await readdir(e));if(t.length===0)return;let n=t.slice(0,5).join(`, `),r=t.length>5?`, and ${t.length-5} more`:``;throw Error(`Cannot create project in current directory because it is not empty. Found: ${n}${r}. Use an empty directory.`)}async function moveDirectoryContents(e,t){for(let n of await readdir(e))await rename(join(e,n),join(t,n))}function uniqueWorkspaceRootMutations(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.path}`,r=t.get(e);t.set(e,{...n,nodeEngineOverride:n.nodeEngineOverride??r?.nodeEngineOverride})}return[...t.values()]}function formatWorkspaceRootMutationWarning(e){let t=e.kind===`package-json`?`package.json`:`configuration`,n=e.nodeEngineOverride===void 0?``:` (${formatNodeEngineOverrideWarning(e.nodeEngineOverride)})`;return`Updated workspace root ${t} at ${e.path}${n}`}async function addToExistingProject(e,t,n,r){if(t.channelWebNextjs===!0)throw Error("`--channel-web-nextjs` is not supported when adding an agent to an existing project. Run `eve add channel/web` from the project afterwards instead.");if(t.model!==void 0){let r=await n.validateModelSlug(e,t.model);if(r!==null)throw Error(r)}let i=await n.detectPackageManager(e),a=await n.addAgentToProject({projectRoot:e,model:t.model??DEFAULT_AGENT_MODEL_ID,reasoning:t.reasoning,packageManager:i.kind,evePackage:r});return{packageManager:i.kind,nodeEngineOverride:a.nodeEngineOverride}}async function resolveScaffoldPackageManager(e,t){let n=await t.detectPackageManager(e);return n.source==="default"?t.detectInvokingPackageManager()??`pnpm`:n.kind}async function scaffoldProject(e,t,n,r,i,a){let o=resolve(e),s=t===`.`,l=s?o:join(o,t);if(s)await assertCanScaffoldInPlace(l);else if(await pathExists(l))throw Error(`Cannot create project because "${l}" already exists.`);let f=await mkdtemp(join(o,`.eve-init-`)),p=[];try{if(r.model!==void 0){let e=await i.validateModelSlug(f,r.model);if(e!==null)throw Error(e)}let e={projectName:s?basename(l):t,model:r.model??DEFAULT_AGENT_MODEL_ID,reasoning:r.reasoning,evePackage:a,targetDirectory:f,workspaceProbeDirectory:l,packageManager:n,onWorkspaceRootMutation:e=>{p.push(e)}},o=await i.scaffoldBaseProject(e);return r.channelWebNextjs===!0&&await i.ensureChannel({projectRoot:o,kind:`web`,packageManager:n,workspaceProbeDirectory:l,configureVercelServices:!1,onWorkspaceRootMutation:e=>{p.push(e)}}),s?await moveDirectoryContents(o,l):await rename(o,l),{projectPath:l,workspaceRootMutations:uniqueWorkspaceRootMutations(p)}}finally{await rm(f,{recursive:!0,force:!0})}}function installProgressDetail(e,t){let n=t.text.trim();if(n===``||e!==`npm`)return n||void 0;let r=/^npm silly fetch manifest (.+)$/u.exec(n);if(r!==null)return`Resolving ${r[1]}`;let i=/^npm http fetch \S+ \S+ attempt (\d+) failed with (\S+)$/u.exec(n);if(i!==null)return`npm registry · attempt ${i[1]} failed: ${i[2]}`;if(t.stream===`stdout`||/^npm (?:error|warn)\b/u.test(n))return n}const NPM_NOISE_LINE=/^\s*npm (?:silly|verbose|http|timing)\b/u;async function runInitSteps(e){let{dependencies:t,logger:n,options:r,parentDirectory:i,target:a}=e,o=isLogLevelEnabled(`debug`),s=startCliLiveRow(n);s.update(`Preparing project`);try{let e=await t.isCodingAgentLaunch(),c=a??`.`,l=isCurrentDirectoryTarget(c),u=l?await pathExists(join(resolve(i),`package.json`))?resolve(i):void 0:await resolveTargetDirectory(i,c),d=resolveInitEvePackageOverride(),f=u===void 0?`creating agent`:`adding agent`;s.update(u===void 0?`Creating agent`:`Adding agent`),initLog.debug(f);let p=t.now(),m;if(u===void 0){let e=l?`.`:parseProjectName(c),n=resolve(i),a=await resolveScaffoldPackageManager(e===`.`?n:join(n,e),t),o=await scaffoldProject(i,e,a,r,t,d);m={kind:`created`,packageManager:a,projectPath:o.projectPath,workspaceRootMutations:o.workspaceRootMutations}}else{let e=await addToExistingProject(u,r,t,d);m=e.nodeEngineOverride===void 0?{kind:`added`,packageManager:e.packageManager,projectPath:u}:{kind:`added`,nodeEngineOverride:e.nodeEngineOverride,packageManager:e.packageManager,projectPath:u}}let h=t.now()-p;initLog.debug(`${f} done`,{ms:h}),s.update(`Installing dependencies`,`${m.packageManager} install`),initLog.debug(`installing dependencies with ${m.packageManager}`);let g=t.now(),_=[],v=[],y=await t.runPackageManagerInstall(m.packageManager,m.projectPath,{bypassMinimumReleaseAge:!0,progressDetails:process.stdout.isTTY===!0&&!o,onOutput:e=>{e.text.trim()!==``&&(v.push(e.text),v.length>20&&v.shift(),NPM_NOISE_LINE.test(e.text)||_.push(e.text)),o&&initLog.debug(e.text);let t=installProgressDetail(m.packageManager,e);t!==void 0&&s.update(`Installing dependencies`,t)}}),b=t.now()-g;if(!y){initLog.debug(`dependency installation failed`,{ms:b}),s.stop();let e=_.length>0?_:v;for(let t of e)n.error(t);throw Error(`Failed to install dependencies in "${m.projectPath}".`)}return initLog.debug(`dependencies installed`,{ms:b}),m.kind===`created`?(s.update(`Initializing Git repository`),initLog.debug(`initializing git repository`),{...m,agentElapsedMs:h,agentLaunched:e,gitResult:await t.tryInitializeGit(m.projectPath),installElapsedMs:b}):{...m,agentElapsedMs:h,agentLaunched:e,installElapsedMs:b}}finally{s.stop()}}async function runInitCommand(e,t,a,o,s=defaultDependencies){if(a===void 0&&await s.isCodingAgentLaunch()){e.log(initAgentInstructions());return}let c=await runInitSteps({dependencies:s,logger:e,options:o,parentDirectory:t,target:a});if(c.kind===`created`){e.log(`${import_picocolors.default.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${import_picocolors.default.bold(c.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(c.agentElapsedMs)}`)}`);for(let t of c.workspaceRootMutations)e.log(import_picocolors.default.yellow(`⚠ ${formatWorkspaceRootMutationWarning(t)}`))}else e.log(`${import_picocolors.default.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${import_picocolors.default.bold(c.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(c.agentElapsedMs)}`)}`),c.nodeEngineOverride!==void 0&&e.log(import_picocolors.default.yellow(`⚠ ${formatNodeEngineOverrideWarning(c.nodeEngineOverride)}`));e.log(`${import_picocolors.default.green(`✓`)} Installed dependencies ${import_picocolors.default.dim(`in ${formatElapsed(c.installElapsedMs)}`)}`),c.kind===`created`&&c.gitResult.kind===`failed`&&e.error(import_picocolors.default.yellow(`Git initialization failed: ${c.gitResult.reason}`));let l=[c.packageManager,...eveDevArguments(c.packageManager)].join(` `),u=initAgentDevHandoff({projectPath:c.projectPath,devCommand:l});if(c.agentLaunched){e.log(u);return}let d;try{d=await s.selectInitHandoff({agentName:basename(c.projectPath)})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(d===`exit`)return;if(d!==`eve-dev`){if(e.log(import_picocolors.default.dim(`$ ${d}`)),!await s.spawnCodingAgentRepl({command:d,cwd:c.projectPath,prompt:initAgentReplPrompt({devCommand:l}),onPromptUnseeded:t=>{e.log(import_picocolors.default.yellow(`Could not seed ${d} automatically. Paste this prompt into it:`)),e.log(t)}}))throw Error(`Coding-agent REPL exited unsuccessfully in "${c.projectPath}".`);return}let f=c.kind===`created`,p=f?[...eveDevArguments(c.packageManager),`--input`,`/model`]:eveDevArguments(c.packageManager);if(e.log(import_picocolors.default.dim(f?`$ eve dev --input /model`:`$ eve dev`)),!await s.spawnPackageManager(c.packageManager,c.projectPath,p))throw Error(`Development server exited unsuccessfully in "${c.projectPath}".`)}function resolveInitEvePackageOverride(){let e=process.env[EVE_INIT_PACKAGE_SPEC_ENV]?.trim();if(!(e===void 0||e.length===0))return{nodeEngine:DEFAULT_EVE_PACKAGE_CONTRACT.nodeEngine,version:e}}export{EVE_INIT_PACKAGE_SPEC_ENV,runInitCommand};
|
|
1
|
+
import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{initAgentDevHandoff,initAgentReplPrompt}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{confirmInitInNonEmptyDirectory}from"./init-confirm.js";import{selectInitHandoff,spawnCodingAgentRepl}from"./init-repl.js";import{mkdtemp,readdir,rename,rm,stat}from"node:fs/promises";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import{ensureChannel,scaffoldBaseProject}from"#setup/scaffold/index.js";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{parseProjectName}from"#setup/project-name.js";import{eveDevArguments,runPackageManagerInstall,spawnPackageManager}from"#setup/primitives/index.js";import{blockingCreateInPlaceEntries}from"#setup/scaffold/create-in-place.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";import{WizardCancelledError}from"#setup/step.js";import{validateModelSlug}from"#setup/flows/model-source-change.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={addAgentToProject,confirmInitInNonEmptyDirectory,detectInvokingPackageManager,detectPackageManager,ensureChannel,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldBaseProject,selectInitHandoff,spawnCodingAgentRepl,spawnPackageManager,tryInitializeGit,validateModelSlug},EVE_INIT_PACKAGE_SPEC_ENV=`EVE_INIT_PACKAGE_SPEC`,initLog=createLogger(`init`);async function resolveTargetDirectory(e,t){let n=resolve(e,t);return(await stat(n).catch(()=>void 0))?.isDirectory()?n:void 0}function isCurrentDirectoryTarget(e){return/^\.(?:[/\\]+\.?)*$/u.test(e.trim())}async function moveDirectoryContents(e,t){for(let n of await readdir(e))await rename(join(e,n),join(t,n))}function uniqueWorkspaceRootMutations(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.path}`,r=t.get(e);t.set(e,{...n,nodeEngineOverride:n.nodeEngineOverride??r?.nodeEngineOverride})}return[...t.values()]}function formatWorkspaceRootMutationWarning(e){let t=e.kind===`package-json`?`package.json`:`configuration`,n=e.nodeEngineOverride===void 0?``:` (${formatNodeEngineOverrideWarning(e.nodeEngineOverride)})`;return`Updated workspace root ${t} at ${e.path}${n}`}async function addToExistingProject(e,t,n,r){if(t.channelWebNextjs===!0)throw Error("`--channel-web-nextjs` is not supported when adding an agent to an existing project. Run `eve add channel/web` from the project afterwards instead.");if(t.model!==void 0){let r=await n.validateModelSlug(e,t.model);if(r!==null)throw Error(r)}let i=await n.detectPackageManager(e),a=await n.addAgentToProject({projectRoot:e,model:t.model??DEFAULT_AGENT_MODEL_ID,reasoning:t.reasoning,packageManager:i.kind,evePackage:r});return{packageManager:i.kind,nodeEngineOverride:a.nodeEngineOverride}}async function resolveScaffoldPackageManager(e,t){let n=await t.detectPackageManager(e);return n.source==="default"?t.detectInvokingPackageManager()??`pnpm`:n.kind}async function scaffoldProject(e,t,n,r,i,a,o){let s=resolve(e),l=t===`.`,f=l?s:join(s,t);if(!l&&await pathExists(f))throw Error(`Cannot create project because "${f}" already exists.`);let p=l&&o?void 0:await mkdtemp(join(s,`.eve-init-`)),m=[];try{let e=p??f;if(r.model!==void 0){let t=await i.validateModelSlug(e,r.model);if(t!==null)throw Error(t)}let s={projectName:p===void 0?`.`:l?basename(f):t,model:r.model??DEFAULT_AGENT_MODEL_ID,reasoning:r.reasoning,evePackage:a,targetDirectory:e,overwriteExisting:o,workspaceProbeDirectory:f,packageManager:n,onWorkspaceRootMutation:e=>{m.push(e)}},c=await i.scaffoldBaseProject(s);return r.channelWebNextjs===!0&&await i.ensureChannel({projectRoot:c,kind:`web`,packageManager:n,force:o,workspaceProbeDirectory:f,configureVercelServices:!1,onWorkspaceRootMutation:e=>{m.push(e)}}),p!==void 0&&(l?await moveDirectoryContents(c,f):await rename(c,f)),{projectPath:f,workspaceRootMutations:uniqueWorkspaceRootMutations(m)}}finally{p!==void 0&&await rm(p,{recursive:!0,force:!0})}}function installProgressDetail(e,t){let n=t.text.trim();if(n===``||e!==`npm`)return n||void 0;let r=/^npm silly fetch manifest (.+)$/u.exec(n);if(r!==null)return`Resolving ${r[1]}`;let i=/^npm http fetch \S+ \S+ attempt (\d+) failed with (\S+)$/u.exec(n);if(i!==null)return`npm registry · attempt ${i[1]} failed: ${i[2]}`;if(t.stream===`stdout`||/^npm (?:error|warn)\b/u.test(n))return n}const NPM_NOISE_LINE=/^\s*npm (?:silly|verbose|http|timing)\b/u;async function runInitSteps(e){let{dependencies:t,logger:n,options:r,parentDirectory:i,target:a}=e,o=isLogLevelEnabled(`debug`),s=await t.isCodingAgentLaunch(),c=a??`.`,u=isCurrentDirectoryTarget(c),d=resolve(i),f=u?await pathExists(join(d,`package.json`))?d:void 0:await resolveTargetDirectory(i,c),p=resolveInitEvePackageOverride(),h=!1;if(u&&f===void 0){let e=blockingCreateInPlaceEntries(await readdir(d));if(e.length>0){if(s)throw Error(`Coding-agent launches cannot choose where to initialize a non-empty current directory. Pass a new directory name, for example: eve init my-agent.`);let n=await t.confirmInitInNonEmptyDirectory(e);n.kind===`current-directory`?h=!0:(c=n.name,u=!1)}}let g=startCliLiveRow(n);g.update(`Preparing project`);try{let e=f===void 0?`creating agent`:`adding agent`;g.update(f===void 0?`Creating agent`:`Adding agent`),initLog.debug(e);let a=t.now(),l;if(f===void 0){let e=u?`.`:parseProjectName(c),n=resolve(i),a=await resolveScaffoldPackageManager(e===`.`?n:join(n,e),t),o=await scaffoldProject(i,e,a,r,t,p,h);l={kind:`created`,packageManager:a,projectPath:o.projectPath,workspaceRootMutations:o.workspaceRootMutations}}else{let e=await addToExistingProject(f,r,t,p);l=e.nodeEngineOverride===void 0?{kind:`added`,packageManager:e.packageManager,projectPath:f}:{kind:`added`,nodeEngineOverride:e.nodeEngineOverride,packageManager:e.packageManager,projectPath:f}}let d=t.now()-a;initLog.debug(`${e} done`,{ms:d}),g.update(`Installing dependencies`,`${l.packageManager} install`),initLog.debug(`installing dependencies with ${l.packageManager}`);let m=t.now(),_=[],v=[],y=await t.runPackageManagerInstall(l.packageManager,l.projectPath,{bypassMinimumReleaseAge:!0,progressDetails:process.stdout.isTTY===!0&&!o,onOutput:e=>{e.text.trim()!==``&&(v.push(e.text),v.length>20&&v.shift(),NPM_NOISE_LINE.test(e.text)||_.push(e.text)),o&&initLog.debug(e.text);let t=installProgressDetail(l.packageManager,e);t!==void 0&&g.update(`Installing dependencies`,t)}}),b=t.now()-m;if(!y){initLog.debug(`dependency installation failed`,{ms:b}),g.stop();let e=_.length>0?_:v;for(let t of e)n.error(t);throw Error(`Failed to install dependencies in "${l.projectPath}".`)}return initLog.debug(`dependencies installed`,{ms:b}),l.kind===`created`?(g.update(`Initializing Git repository`),initLog.debug(`initializing git repository`),{...l,agentElapsedMs:d,agentLaunched:s,gitResult:await t.tryInitializeGit(l.projectPath),installElapsedMs:b}):{...l,agentElapsedMs:d,agentLaunched:s,installElapsedMs:b}}finally{g.stop()}}async function runInitCommand(e,t,i,a,o=defaultDependencies){let s;try{s=await runInitSteps({dependencies:o,logger:e,options:a,parentDirectory:t,target:i})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(s.kind===`created`){e.log(`${import_picocolors.default.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${import_picocolors.default.bold(s.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(s.agentElapsedMs)}`)}`);for(let t of s.workspaceRootMutations)e.log(import_picocolors.default.yellow(`⚠ ${formatWorkspaceRootMutationWarning(t)}`))}else e.log(`${import_picocolors.default.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${import_picocolors.default.bold(s.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(s.agentElapsedMs)}`)}`),s.nodeEngineOverride!==void 0&&e.log(import_picocolors.default.yellow(`⚠ ${formatNodeEngineOverrideWarning(s.nodeEngineOverride)}`));e.log(`${import_picocolors.default.green(`✓`)} Installed dependencies ${import_picocolors.default.dim(`in ${formatElapsed(s.installElapsedMs)}`)}`),s.kind===`created`&&s.gitResult.kind===`failed`&&e.error(import_picocolors.default.yellow(`Git initialization failed: ${s.gitResult.reason}`));let c=[s.packageManager,...eveDevArguments(s.packageManager)].join(` `),l=initAgentDevHandoff({projectPath:s.projectPath,devCommand:c});if(s.agentLaunched){e.log(l);return}let u;try{u=await o.selectInitHandoff({agentName:basename(s.projectPath)})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(u===`exit`)return;if(u!==`eve-dev`){if(e.log(import_picocolors.default.dim(`$ ${u}`)),!await o.spawnCodingAgentRepl({command:u,cwd:s.projectPath,prompt:initAgentReplPrompt({devCommand:c}),onPromptUnseeded:t=>{e.log(import_picocolors.default.yellow(`Could not seed ${u} automatically. Paste this prompt into it:`)),e.log(t)}}))throw Error(`Coding-agent REPL exited unsuccessfully in "${s.projectPath}".`);return}let d=s.kind===`created`,f=d?[...eveDevArguments(s.packageManager),`--input`,`/model`]:eveDevArguments(s.packageManager);if(e.log(import_picocolors.default.dim(d?`$ eve dev --input /model`:`$ eve dev`)),!await o.spawnPackageManager(s.packageManager,s.projectPath,f))throw Error(`Development server exited unsuccessfully in "${s.projectPath}".`)}function resolveInitEvePackageOverride(){let e=process.env[EVE_INIT_PACKAGE_SPEC_ENV]?.trim();if(!(e===void 0||e.length===0))return{nodeEngine:DEFAULT_EVE_PACKAGE_CONTRACT.nodeEngine,version:e}}export{EVE_INIT_PACKAGE_SPEC_ENV,runInitCommand};
|
package/dist/src/cli/run.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ interface CliLogger {
|
|
|
12
12
|
}
|
|
13
13
|
interface CliRuntimeDependencies {
|
|
14
14
|
isCodingAgentLaunch(): Promise<boolean>;
|
|
15
|
+
isEveProject(appRoot: string): Promise<boolean>;
|
|
15
16
|
isActiveDevelopmentServerForApp(input: {
|
|
16
17
|
readonly appRoot: string;
|
|
17
18
|
readonly serverUrl: string;
|
package/dist/src/cli/run.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{Command,CommanderError,InvalidArgumentError}from"#compiled/commander/index.js";import{parseDevelopmentHeaderOption,resolveDevelopmentUrlTarget}from"#cli/dev/url-target.js";import{parseDevelopmentServerUrl}from"#cli/dev/url.js";import{FORCED_EXIT_BACKSTOP_MS,installShutdownSignal,waitForShutdownSignal}from"#cli/shutdown.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{eveCliBanner}from"#cli/banner.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{devBootPhase}from"#internal/dev-boot-progress.js";import{registerBuildCommand}from"#cli/commands/build.js";import{resolveApplicationRoot}from"#internal/application/paths.js";import{registerIntegrationCommands}from"#cli/commands/register-integration-commands.js";import{registerProjectCommands}from"#cli/commands/register-project-commands.js";import{registerRegistryCommands}from"#cli/commands/register-registry-commands.js";import{resolveDevUiMode,resolveTuiDisplayOptions}from"#cli/dev/ui-options.js";import{registerAcpCommand}from"#cli/acp/command.js";import{waitForServerOrStop,waitForUiOrServer}from"#cli/dev/wait-for-ui.js";import{registerRuntimeInvokeCommand}from"#cli/invoke/command.js";import{parseContextSizeOption,parseDisplayMode,parseLogsMode,parsePortOption,parseReasoningOption,parseStatsMode}from"#cli/option-parsers.js";import{resolveTuiTitle}from"#cli/dev/tui/target.js";import{resumeDevelopmentRuntimeArtifacts,suspendDevelopmentRuntimeArtifacts}from"#services/dev-client/runtime-artifacts.js";const devBootLog=createLogger(`dev.boot`);function createDevBootProgressReporter(e){return t=>{switch(t.type){case`phase-started`:e?.update(`Building your agent`,t.phase),devBootLog.debug(t.phase);return;case`phase-finished`:devBootLog.debug(`${t.phase} finished`,{ms:t.elapsedMs});return;case`before-first-paint`:e?.stop();return;default:return t}}}async function loadPrintApplicationInfo(){return(await import(`#cli/commands/info.js`)).printApplicationInfo}async function loadRunDevelopmentTui(){return(await import(`#cli/dev/tui/tui.js`)).runDevelopmentTui}async function loadRunEvalCommand(){return(await import(`#evals/cli/eval.js`)).runEvalCommand}async function loadStartHost(){return(await import(`#cli/dev/local-server-process.js`)).createDevelopmentServer}const loadIsActiveDevelopmentServerForApp=async()=>(await import(`#internal/nitro/host.js`)).isActiveDevelopmentServerForApp;async function loadStartProductionHost(){return(await import(`#internal/nitro/host.js`)).startProductionServer}function hasInteractiveTerminal(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}function createCliProgram(e,n){let
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{Command,CommanderError,InvalidArgumentError}from"#compiled/commander/index.js";import{parseDevelopmentHeaderOption,resolveDevelopmentUrlTarget}from"#cli/dev/url-target.js";import{parseDevelopmentServerUrl}from"#cli/dev/url.js";import{FORCED_EXIT_BACKSTOP_MS,installShutdownSignal,waitForShutdownSignal}from"#cli/shutdown.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{eveCliBanner}from"#cli/banner.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{devBootPhase}from"#internal/dev-boot-progress.js";import{registerBuildCommand}from"#cli/commands/build.js";import{resolveApplicationRoot}from"#internal/application/paths.js";import{registerIntegrationCommands}from"#cli/commands/register-integration-commands.js";import{registerProjectCommands}from"#cli/commands/register-project-commands.js";import{registerRegistryCommands}from"#cli/commands/register-registry-commands.js";import{resolveDevUiMode,resolveTuiDisplayOptions}from"#cli/dev/ui-options.js";import{registerAcpCommand}from"#cli/acp/command.js";import{waitForServerOrStop,waitForUiOrServer}from"#cli/dev/wait-for-ui.js";import{registerRuntimeInvokeCommand}from"#cli/invoke/command.js";import{parseContextSizeOption,parseDisplayMode,parseLogsMode,parsePortOption,parseReasoningOption,parseStatsMode}from"#cli/option-parsers.js";import{resolveTuiTitle}from"#cli/dev/tui/target.js";import{resumeDevelopmentRuntimeArtifacts,suspendDevelopmentRuntimeArtifacts}from"#services/dev-client/runtime-artifacts.js";const devBootLog=createLogger(`dev.boot`);function createDevBootProgressReporter(e){return t=>{switch(t.type){case`phase-started`:e?.update(`Building your agent`,t.phase),devBootLog.debug(t.phase);return;case`phase-finished`:devBootLog.debug(`${t.phase} finished`,{ms:t.elapsedMs});return;case`before-first-paint`:e?.stop();return;default:return t}}}async function loadPrintApplicationInfo(){return(await import(`#cli/commands/info.js`)).printApplicationInfo}async function loadRunDevelopmentTui(){return(await import(`#cli/dev/tui/tui.js`)).runDevelopmentTui}async function loadRunEvalCommand(){return(await import(`#evals/cli/eval.js`)).runEvalCommand}async function loadStartHost(){return(await import(`#cli/dev/local-server-process.js`)).createDevelopmentServer}async function loadIsEveProject(){return(await import(`#setup/scaffold/index.js`)).isEveProject}const loadIsActiveDevelopmentServerForApp=async()=>(await import(`#internal/nitro/host.js`)).isActiveDevelopmentServerForApp;async function loadStartProductionHost(){return(await import(`#internal/nitro/host.js`)).startProductionServer}function hasInteractiveTerminal(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}function createCliProgram(e,n,f){let h=resolveInstalledPackageInfo().version,y=new Command,b=createCliTheme();y.name(`eve`).description(`Build and run an eve application.`).version(h).showHelpAfterError().exitOverride().hook(`preAction`,(t,n)=>{[`info`,`dev`,`init`].includes(n.name())&&e.log(eveCliBanner())}).configureOutput({writeErr:t=>{e.error(t.trimEnd())},writeOut:t=>{e.log(t.trimEnd())}}),y.command(`channels`).description(`Manage user-authored channels in the current project.`).command(`list`).description(`List user-authored channels in the current project.`).option(`--json`,`Output as JSON`).action(async t=>{let{runChannelsListCommand:n}=await import(`#cli/commands/channels.js`);await n(e,f,t)}),registerIntegrationCommands({program:y,logger:e,appRoot:f});let x=y.command(`extension`).description(`Create and build reusable eve extension packages.`);x.command(`init [target]`).description(`Create a new eve extension package.`).option(`-y, --yes`,`Accepted for compatibility; has no effect`).action(async(t,n)=>{n.yes&&e.error(`warning: --yes has no effect for eve extension init.`);let{runExtensionInitCommand:r}=await import(`#cli/commands/extension-init.js`);await r(e,f,t)}),x.command(`build`).description(`Build the current package as an eve extension.`).action(async()=>{let{loadDevelopmentEnvironmentFiles:t}=await import(`#cli/dev/environment.js`);t(f);let{runExtensionBuildCommand:n}=await import(`#cli/commands/extension-build.js`);await n(e,f)}),registerRegistryCommands({program:y,logger:e,appRoot:f}),y.command(`init [target]`).description(`Create a new eve agent, or add one to an existing project directory.`).option(`--channel-web-nextjs`,`Add the Web Chat application (Next.js)`).option(`--model <model>`,`Set the agent model (provider/model-id)`).option(`--reasoning <effort>`,`Set reasoning (provider-default|none|minimal|low|medium|high|xhigh)`,parseReasoningOption).option(`-y, --yes`,`Accepted for compatibility; has no effect`).action(async(t,n)=>{n.yes&&e.error(`warning: --yes has no effect for eve init.`);let{runInitCommand:r}=await import(`#cli/commands/init.js`);await r(e,f,t,{channelWebNextjs:n.channelWebNextjs,model:n.model,reasoning:n.reasoning})}),y.command(`set`).description(`Change root agent model settings.`).option(`--model <model>`,`Set the agent model (provider/model-id)`).option(`--reasoning <effort>`,`Set reasoning (provider-default|none|minimal|low|medium|high|xhigh)`,parseReasoningOption).action(async t=>{let{runSetCommand:n}=await import(`#cli/commands/set.js`);await n(e,f,t)}),registerProjectCommands({program:y,logger:e,appRoot:f}),registerBuildCommand({appRoot:f,buildHost:n.buildHost,logger:e,program:y}),y.command(`start`).description(`Start a built eve application.`).option(`--host <host>`,`Host interface to bind`).option(`--port <port>`,`Port to listen on (defaults to $PORT, then 3000)`,parsePortOption).action(async t=>{let{loadDevelopmentEnvironmentFiles:r}=await import(`#cli/dev/environment.js`);r(f);let i=await(n.startProductionHost??await loadStartProductionHost())(f,{host:t.host,port:t.port});e.log(renderCliTaggedLine(b,{message:`server listening at ${i.url}`,tag:`start`,tone:`success`})),await waitForShutdownSignal({close:()=>i.close(),wait:()=>i.wait()})}),registerRuntimeInvokeCommand({appRoot:f,logger:e,program:y,runtime:n}),registerAcpCommand({appRoot:f,eveVersion:h,program:y,resolveVerifiedRemoteDevelopmentClient:n.resolveVerifiedRemoteDevelopmentClient,runAcpServer:n.runAcpServer,startHost:n.startHost}),y.command(`dev`).description(`Start the eve development server or connect to an existing URL.`).argument(`[url]`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`--host <host>`,`Host interface to bind`).option(`--port <port>`,`Port to listen on (defaults to $PORT, then 2000)`,parsePortOption).option(`-u, --url <url>`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`-H, --header <header>`,`Request header for a URL target, in "Name: value" form (repeatable)`,parseDevelopmentHeaderOption).option(`--no-ui`,`Start the server without an interactive UI`).option(`--name <name>`,`Title shown in the terminal UI (defaults to the app folder name)`).option(`--input <text>`,`Pre-fill the prompt input, or start onboarding with /model`).option(`--tools <mode>`,`How tool calls render: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--reasoning <mode>`,`How reasoning renders: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--subagents <mode>`,`How subagent sections render: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--connection-auth <mode>`,`How connection authorization renders: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--assistant-response-stats <mode>`,`Assistant header statistic: tokens | tokensPerSecond`,parseStatsMode).option(`--context-size <tokens>`,`Model context window size, shown as a usage percentage`,parseContextSizeOption).option(`--logs <mode>`,`Which server/agent logs to show: all | stderr | sandbox | none`,parseLogsMode).addHelpText(`after`,`
|
|
2
2
|
You can also pass a bare URL, for example: eve dev https://example.com
|
|
3
|
-
`).action(async(t,i)=>{let o=resolveDevelopmentUrlTarget(i,t),l=o?.serverUrl,u=hasInteractiveTerminal(),d=resolveDevUiMode({options:i,interactive:u});if(i.input!==void 0&&d===`headless`)throw new InvalidArgumentError(`--input requires the interactive UI.`);let p=!1;l!==void 0&&(p=await(n.isActiveDevelopmentServerForApp??await loadIsActiveDevelopmentServerForApp())({appRoot:f,serverUrl:l}));let runInteractiveUi=async(e,t,r)=>{let a=await devBootPhase(`loading interactive UI`,async()=>n.runDevelopmentTui??await loadRunDevelopmentTui(),t),s=resolveTuiDisplayOptions(i),c=l===void 0||p?{kind:`local`,serverUrl:e.serverUrl,workspaceRoot:e.appRoot??f}:{kind:`remote`,serverUrl:e.serverUrl,workspaceRoot:f},u=resolveTuiTitle({name:i.name,target:c});u!==void 0&&(s.name=u);let d={target:c,initialInput:i.input,onBootProgress:t,lifecycle:r,...s};c.kind===`local`&&(d.withExclusiveTerminal=async t=>await(async()=>{if(!await suspendDevelopmentRuntimeArtifacts({serverUrl:e.serverUrl}))throw Error(`Could not pause the development server for integration setup.`);try{return await t()}finally{await resumeDevelopmentRuntimeArtifacts({serverUrl:e.serverUrl,silent:!0})}})()),o?.headers===void 0?await a(d):await a({...d,headers:o.headers})};if(l){let{loadDevelopmentEnvironmentFiles:t}=await import(`#cli/dev/environment.js`);if(t(f),e.log(`↗ ${p?`local`:`remote`} mode targeting ${
|
|
4
|
-
eve traces ls [options]`).description("Show a local `eve dev` trace (the most recent when trace is omitted).").option(`--verbose`,`Expand every span with all attributes and events`).option(`--json`,`Output as JSON`).action(async(t,n)=>{let{runTraceShowCommand:r}=await import(`#cli/commands/trace.js`);await r(e,f,t,n)}).command(`ls`).description(`List local traces, most recent first.`).option(`--json`,`Output as JSON`).action(async t=>{let{runTraceListCommand:n}=await import(`#cli/commands/trace.js`);await n(e,f,t)}),
|
|
3
|
+
`).action(async(t,i)=>{let o=resolveDevelopmentUrlTarget(i,t),l=o?.serverUrl,u=hasInteractiveTerminal(),d=resolveDevUiMode({options:i,interactive:u});if(i.input!==void 0&&d===`headless`)throw new InvalidArgumentError(`--input requires the interactive UI.`);let p=!1;l!==void 0&&(p=await(n.isActiveDevelopmentServerForApp??await loadIsActiveDevelopmentServerForApp())({appRoot:f,serverUrl:l}));let runInteractiveUi=async(e,t,r)=>{let a=await devBootPhase(`loading interactive UI`,async()=>n.runDevelopmentTui??await loadRunDevelopmentTui(),t),s=resolveTuiDisplayOptions(i),c=l===void 0||p?{kind:`local`,serverUrl:e.serverUrl,workspaceRoot:e.appRoot??f}:{kind:`remote`,serverUrl:e.serverUrl,workspaceRoot:f},u=resolveTuiTitle({name:i.name,target:c});u!==void 0&&(s.name=u);let d={target:c,initialInput:i.input,onBootProgress:t,lifecycle:r,...s};c.kind===`local`&&(d.withExclusiveTerminal=async t=>await(async()=>{if(!await suspendDevelopmentRuntimeArtifacts({serverUrl:e.serverUrl}))throw Error(`Could not pause the development server for integration setup.`);try{return await t()}finally{await resumeDevelopmentRuntimeArtifacts({serverUrl:e.serverUrl,silent:!0})}})()),o?.headers===void 0?await a(d):await a({...d,headers:o.headers})};if(l){let{loadDevelopmentEnvironmentFiles:t}=await import(`#cli/dev/environment.js`);if(t(f),e.log(`↗ ${p?`local`:`remote`} mode targeting ${b.info(new URL(l).host)}`),d===`headless`){e.log(renderCliTaggedLine(b,{message:`Interactive UI disabled because the current terminal is not a TTY.`,tag:`dev`,tone:`warning`}));return}e.log(``);let n=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS});try{await runInteractiveUi({serverUrl:l},void 0,n)}finally{n.dispose()}return}d===`tui`&&e.log(``);let m=d===`tui`?startCliLiveRow(e):void 0,h=createDevBootProgressReporter(m);m?.update(`Building your agent`);let g,_,closeServer=()=>g===void 0?Promise.resolve():(_??=g.close(),_.catch(()=>void 0),_),v=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS,onStop:()=>{closeServer()}});try{g=(n.startHost??await loadStartHost())(f,{existing:d===`tui`?`attach-if-unconfigured`:`reject`,host:i.host,onBootProgress:h,port:i.port});let t=(await Promise.race([g.start().then(e=>({handle:e})),v.stopped.then(()=>({handle:void 0}))])).handle;if(t===void 0)return;if(d!==`tui`&&e.log(renderCliTaggedLine(b,{message:`server listening at ${t.url}`,tag:`dev`,tone:`success`})),d===`headless`){i.ui!==!1&&!u&&e.log(renderCliTaggedLine(b,{message:`Interactive UI disabled because the current terminal is not a TTY.`,tag:`dev`,tone:`warning`})),await waitForServerOrStop(g,v);return}await waitForUiOrServer({handle:t,lifecycle:v,server:g,runUi:async()=>await runInteractiveUi({appRoot:t.appRoot,serverUrl:t.url},h,v)})}finally{m?.stop(),await closeServer(),v.dispose()}});let S=y.command(`logs`).description("Inspect local `eve dev` diagnostic logs (.eve/logs).");return S.command(`show [logid]`,{isDefault:!0}).description(`Print a diagnostic log (the most recent when logid is omitted).`).option(`--dump`,`Prepend the log's environment dump (.dump sibling)`).option(`--events`,`Interleave session events from the local workflow store`).action(async(t,n)=>{let{runLogsShowCommand:r}=await import(`#cli/commands/logs.js`);await r(e,f,t,n)}),S.command(`ls`).description(`List diagnostic logs, most recent first.`).option(`--json`,`Output as JSON`).action(async t=>{let{runLogsListCommand:n}=await import(`#cli/commands/logs.js`);await n(e,f,t)}),y.command(`traces [trace]`).usage(`[options] [trace]
|
|
4
|
+
eve traces ls [options]`).description("Show a local `eve dev` trace (the most recent when trace is omitted).").option(`--verbose`,`Expand every span with all attributes and events`).option(`--json`,`Output as JSON`).action(async(t,n)=>{let{runTraceShowCommand:r}=await import(`#cli/commands/trace.js`);await r(e,f,t,n)}).command(`ls`).description(`List local traces, most recent first.`).option(`--json`,`Output as JSON`).action(async t=>{let{runTraceListCommand:n}=await import(`#cli/commands/trace.js`);await n(e,f,t)}),y.command(`info`).description(`Print resolved application information.`).option(`--json`,`Output as JSON`).action(async t=>{await(n.printApplicationInfo??await loadPrintApplicationInfo())(e,f,t)}),y.command(`eval`).description(`Run evals against an eve agent.`).argument(`[evalIds...]`,`Eval ids (or directory prefixes) to run (all discovered evals when omitted)`).option(`--url <url>`,`Remote agent URL (skip local host startup)`,parseDevelopmentServerUrl).option(`--tag <tag...>`,`Run only evals carrying a tag`).option(`--exclude-tag <tag...>`,`Skip evals carrying a tag`).option(`--strict`,`Fail the exit code when any score falls below its threshold`).option(`--list`,`Print discovered evals without running them`).option(`--timeout <ms>`,`Per-eval timeout in milliseconds`).option(`--max-concurrency <n>`,`Max concurrent eval executions`).option(`--json`,`Output results as JSON`).option(`--junit <path>`,`Write JUnit XML results to a file`).option(`--skip-report`,`Skip eval-defined reporters (e.g. Braintrust)`).option(`--verbose`,`Stream per-eval t.log lines to stdout`).action(async(t,r)=>{await(n.runEvalCommand??await loadRunEvalCommand())(t,r,e)}),y}async function runCli(e=process.argv.slice(2),t=console,r={}){let i=resolveApplicationRoot(),a=createCliProgram(t,r,i),o=e;o.length===0&&(o=[await(r.isEveProject??await loadIsEveProject())(i)?`dev`:`init`]);try{await a.parseAsync(o,{from:`user`})}catch(e){if(e instanceof CommanderError){if(e.exitCode===0)return;let n=await(r.isCodingAgentLaunch??isCodingAgentLaunch)();if(o[0]===`init`&&n){let{initAgentInstructions:e}=await import(`#cli/commands/agent-instructions.js`);t.log(e())}throw Error(e.message)}throw e}}export{resolveDevUiMode,resolveTuiDisplayOptions,runCli};
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@vercel/detect-agent": "1.2.3",
|
|
34
34
|
"@vercel/oidc": "3.8.0",
|
|
35
35
|
"@vercel/otel": "2.1.3",
|
|
36
|
+
"@vercel/sandbox-drives": "2.10.0-beta.0",
|
|
36
37
|
"@vercel/sandbox": "2.8.0",
|
|
37
38
|
"@workflow/core": "5.0.0-beta.41",
|
|
38
39
|
"@workflow/errors": "5.0.0-beta.16",
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"zod": "4.4.3",
|
|
44
45
|
"zod-validation-error": "5.0.0"
|
|
45
46
|
},
|
|
46
|
-
"scriptHash": "
|
|
47
|
+
"scriptHash": "d687f51a324a012e639ff22d5f4ab77097037ec7ccc7e7817507c0f5a8e7d630"
|
|
47
48
|
}
|
|
@@ -4,6 +4,7 @@ import { FileWriter } from "./file-writer.js";
|
|
|
4
4
|
import { NetworkPolicy } from "../network-policy.js";
|
|
5
5
|
import { WithPrivate } from "../utils/types.js";
|
|
6
6
|
import { RUNTIMES } from "../constants.js";
|
|
7
|
+
import { BaseCreateSandboxParams } from "../sandbox.js";
|
|
7
8
|
import { z } from "#compiled/zod/index.js";
|
|
8
9
|
import { Readable } from "stream";
|
|
9
10
|
|
|
@@ -180,6 +181,7 @@ declare class APIClient extends BaseClient {
|
|
|
180
181
|
expiration?: number;
|
|
181
182
|
deleteEvicted?: boolean;
|
|
182
183
|
};
|
|
184
|
+
mounts?: BaseCreateSandboxParams["mounts"];
|
|
183
185
|
signal?: AbortSignal;
|
|
184
186
|
}>): Promise<Parsed<{
|
|
185
187
|
sandbox: {
|
|
@@ -290,6 +292,271 @@ declare class APIClient extends BaseClient {
|
|
|
290
292
|
statusUpdatedAt?: number | undefined;
|
|
291
293
|
cwd?: string | undefined;
|
|
292
294
|
tags?: Record<string, string> | undefined;
|
|
295
|
+
mounts?: Record<string, {
|
|
296
|
+
drive: string;
|
|
297
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
298
|
+
}> | undefined;
|
|
299
|
+
snapshotExpiration?: number | undefined;
|
|
300
|
+
keepLastSnapshots?: {
|
|
301
|
+
count: number;
|
|
302
|
+
expiration?: number | undefined;
|
|
303
|
+
deleteEvicted?: boolean | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
};
|
|
306
|
+
session: {
|
|
307
|
+
[x: string]: unknown;
|
|
308
|
+
id: string;
|
|
309
|
+
memory: number;
|
|
310
|
+
vcpus: number;
|
|
311
|
+
region: string;
|
|
312
|
+
runtime: string;
|
|
313
|
+
timeout: number;
|
|
314
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
315
|
+
requestedAt: number;
|
|
316
|
+
createdAt: number;
|
|
317
|
+
cwd: string;
|
|
318
|
+
updatedAt: number;
|
|
319
|
+
startedAt?: number | undefined;
|
|
320
|
+
requestedStopAt?: number | undefined;
|
|
321
|
+
stoppedAt?: number | undefined;
|
|
322
|
+
abortedAt?: number | undefined;
|
|
323
|
+
duration?: number | undefined;
|
|
324
|
+
sourceSnapshotId?: string | undefined;
|
|
325
|
+
snapshottedAt?: number | undefined;
|
|
326
|
+
interactivePort?: number | undefined;
|
|
327
|
+
networkPolicy?: {
|
|
328
|
+
[x: string]: unknown;
|
|
329
|
+
mode: "allow-all";
|
|
330
|
+
} | {
|
|
331
|
+
[x: string]: unknown;
|
|
332
|
+
mode: "deny-all";
|
|
333
|
+
} | {
|
|
334
|
+
[x: string]: unknown;
|
|
335
|
+
mode: "custom";
|
|
336
|
+
allowedDomains?: string[] | undefined;
|
|
337
|
+
allowedCIDRs?: string[] | undefined;
|
|
338
|
+
deniedCIDRs?: string[] | undefined;
|
|
339
|
+
injectionRules?: {
|
|
340
|
+
domain: string;
|
|
341
|
+
headers?: Record<string, string> | undefined;
|
|
342
|
+
headerNames?: string[] | undefined;
|
|
343
|
+
match?: {
|
|
344
|
+
path?: {
|
|
345
|
+
exact?: string | undefined;
|
|
346
|
+
startsWith?: string | undefined;
|
|
347
|
+
regex?: string | undefined;
|
|
348
|
+
} | undefined;
|
|
349
|
+
method?: string[] | undefined;
|
|
350
|
+
queryString?: {
|
|
351
|
+
key?: {
|
|
352
|
+
exact?: string | undefined;
|
|
353
|
+
startsWith?: string | undefined;
|
|
354
|
+
regex?: string | undefined;
|
|
355
|
+
} | undefined;
|
|
356
|
+
value?: {
|
|
357
|
+
exact?: string | undefined;
|
|
358
|
+
startsWith?: string | undefined;
|
|
359
|
+
regex?: string | undefined;
|
|
360
|
+
} | undefined;
|
|
361
|
+
}[] | undefined;
|
|
362
|
+
headers?: {
|
|
363
|
+
key?: {
|
|
364
|
+
exact?: string | undefined;
|
|
365
|
+
startsWith?: string | undefined;
|
|
366
|
+
regex?: string | undefined;
|
|
367
|
+
} | undefined;
|
|
368
|
+
value?: {
|
|
369
|
+
exact?: string | undefined;
|
|
370
|
+
startsWith?: string | undefined;
|
|
371
|
+
regex?: string | undefined;
|
|
372
|
+
} | undefined;
|
|
373
|
+
}[] | undefined;
|
|
374
|
+
} | undefined;
|
|
375
|
+
}[] | undefined;
|
|
376
|
+
forwardRules?: {
|
|
377
|
+
domain: string;
|
|
378
|
+
forwardURL: string;
|
|
379
|
+
match?: {
|
|
380
|
+
path?: {
|
|
381
|
+
exact?: string | undefined;
|
|
382
|
+
startsWith?: string | undefined;
|
|
383
|
+
regex?: string | undefined;
|
|
384
|
+
} | undefined;
|
|
385
|
+
method?: string[] | undefined;
|
|
386
|
+
queryString?: {
|
|
387
|
+
key?: {
|
|
388
|
+
exact?: string | undefined;
|
|
389
|
+
startsWith?: string | undefined;
|
|
390
|
+
regex?: string | undefined;
|
|
391
|
+
} | undefined;
|
|
392
|
+
value?: {
|
|
393
|
+
exact?: string | undefined;
|
|
394
|
+
startsWith?: string | undefined;
|
|
395
|
+
regex?: string | undefined;
|
|
396
|
+
} | undefined;
|
|
397
|
+
}[] | undefined;
|
|
398
|
+
headers?: {
|
|
399
|
+
key?: {
|
|
400
|
+
exact?: string | undefined;
|
|
401
|
+
startsWith?: string | undefined;
|
|
402
|
+
regex?: string | undefined;
|
|
403
|
+
} | undefined;
|
|
404
|
+
value?: {
|
|
405
|
+
exact?: string | undefined;
|
|
406
|
+
startsWith?: string | undefined;
|
|
407
|
+
regex?: string | undefined;
|
|
408
|
+
} | undefined;
|
|
409
|
+
}[] | undefined;
|
|
410
|
+
} | undefined;
|
|
411
|
+
}[] | undefined;
|
|
412
|
+
} | undefined;
|
|
413
|
+
activeCpuDurationMs?: number | undefined;
|
|
414
|
+
networkTransfer?: {
|
|
415
|
+
ingress: number;
|
|
416
|
+
egress: number;
|
|
417
|
+
} | undefined;
|
|
418
|
+
};
|
|
419
|
+
routes: {
|
|
420
|
+
url: string;
|
|
421
|
+
subdomain: string;
|
|
422
|
+
port: number;
|
|
423
|
+
}[];
|
|
424
|
+
resumed?: boolean | undefined;
|
|
425
|
+
}>>;
|
|
426
|
+
forkSandbox(params: WithPrivate<{
|
|
427
|
+
sourceSandbox: string;
|
|
428
|
+
projectId: string;
|
|
429
|
+
name?: string;
|
|
430
|
+
ports?: number[];
|
|
431
|
+
timeout?: number;
|
|
432
|
+
resources?: {
|
|
433
|
+
vcpus: number;
|
|
434
|
+
};
|
|
435
|
+
persistent?: boolean;
|
|
436
|
+
image?: string;
|
|
437
|
+
networkPolicy?: NetworkPolicy;
|
|
438
|
+
env?: Record<string, string>;
|
|
439
|
+
tags?: Record<string, string>;
|
|
440
|
+
snapshotExpiration?: number;
|
|
441
|
+
keepLastSnapshots?: {
|
|
442
|
+
count: number;
|
|
443
|
+
expiration?: number;
|
|
444
|
+
deleteEvicted?: boolean;
|
|
445
|
+
};
|
|
446
|
+
signal?: AbortSignal;
|
|
447
|
+
}>): Promise<Parsed<{
|
|
448
|
+
sandbox: {
|
|
449
|
+
name: string;
|
|
450
|
+
persistent: boolean;
|
|
451
|
+
createdAt: number;
|
|
452
|
+
updatedAt: number;
|
|
453
|
+
currentSessionId: string;
|
|
454
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
455
|
+
region?: string | undefined;
|
|
456
|
+
vcpus?: number | undefined;
|
|
457
|
+
memory?: number | undefined;
|
|
458
|
+
runtime?: string | undefined;
|
|
459
|
+
image?: string | undefined;
|
|
460
|
+
timeout?: number | undefined;
|
|
461
|
+
networkPolicy?: {
|
|
462
|
+
[x: string]: unknown;
|
|
463
|
+
mode: "allow-all";
|
|
464
|
+
} | {
|
|
465
|
+
[x: string]: unknown;
|
|
466
|
+
mode: "deny-all";
|
|
467
|
+
} | {
|
|
468
|
+
[x: string]: unknown;
|
|
469
|
+
mode: "custom";
|
|
470
|
+
allowedDomains?: string[] | undefined;
|
|
471
|
+
allowedCIDRs?: string[] | undefined;
|
|
472
|
+
deniedCIDRs?: string[] | undefined;
|
|
473
|
+
injectionRules?: {
|
|
474
|
+
domain: string;
|
|
475
|
+
headers?: Record<string, string> | undefined;
|
|
476
|
+
headerNames?: string[] | undefined;
|
|
477
|
+
match?: {
|
|
478
|
+
path?: {
|
|
479
|
+
exact?: string | undefined;
|
|
480
|
+
startsWith?: string | undefined;
|
|
481
|
+
regex?: string | undefined;
|
|
482
|
+
} | undefined;
|
|
483
|
+
method?: string[] | undefined;
|
|
484
|
+
queryString?: {
|
|
485
|
+
key?: {
|
|
486
|
+
exact?: string | undefined;
|
|
487
|
+
startsWith?: string | undefined;
|
|
488
|
+
regex?: string | undefined;
|
|
489
|
+
} | undefined;
|
|
490
|
+
value?: {
|
|
491
|
+
exact?: string | undefined;
|
|
492
|
+
startsWith?: string | undefined;
|
|
493
|
+
regex?: string | undefined;
|
|
494
|
+
} | undefined;
|
|
495
|
+
}[] | undefined;
|
|
496
|
+
headers?: {
|
|
497
|
+
key?: {
|
|
498
|
+
exact?: string | undefined;
|
|
499
|
+
startsWith?: string | undefined;
|
|
500
|
+
regex?: string | undefined;
|
|
501
|
+
} | undefined;
|
|
502
|
+
value?: {
|
|
503
|
+
exact?: string | undefined;
|
|
504
|
+
startsWith?: string | undefined;
|
|
505
|
+
regex?: string | undefined;
|
|
506
|
+
} | undefined;
|
|
507
|
+
}[] | undefined;
|
|
508
|
+
} | undefined;
|
|
509
|
+
}[] | undefined;
|
|
510
|
+
forwardRules?: {
|
|
511
|
+
domain: string;
|
|
512
|
+
forwardURL: string;
|
|
513
|
+
match?: {
|
|
514
|
+
path?: {
|
|
515
|
+
exact?: string | undefined;
|
|
516
|
+
startsWith?: string | undefined;
|
|
517
|
+
regex?: string | undefined;
|
|
518
|
+
} | undefined;
|
|
519
|
+
method?: string[] | undefined;
|
|
520
|
+
queryString?: {
|
|
521
|
+
key?: {
|
|
522
|
+
exact?: string | undefined;
|
|
523
|
+
startsWith?: string | undefined;
|
|
524
|
+
regex?: string | undefined;
|
|
525
|
+
} | undefined;
|
|
526
|
+
value?: {
|
|
527
|
+
exact?: string | undefined;
|
|
528
|
+
startsWith?: string | undefined;
|
|
529
|
+
regex?: string | undefined;
|
|
530
|
+
} | undefined;
|
|
531
|
+
}[] | undefined;
|
|
532
|
+
headers?: {
|
|
533
|
+
key?: {
|
|
534
|
+
exact?: string | undefined;
|
|
535
|
+
startsWith?: string | undefined;
|
|
536
|
+
regex?: string | undefined;
|
|
537
|
+
} | undefined;
|
|
538
|
+
value?: {
|
|
539
|
+
exact?: string | undefined;
|
|
540
|
+
startsWith?: string | undefined;
|
|
541
|
+
regex?: string | undefined;
|
|
542
|
+
} | undefined;
|
|
543
|
+
}[] | undefined;
|
|
544
|
+
} | undefined;
|
|
545
|
+
}[] | undefined;
|
|
546
|
+
} | undefined;
|
|
547
|
+
totalEgressBytes?: number | undefined;
|
|
548
|
+
totalIngressBytes?: number | undefined;
|
|
549
|
+
totalActiveCpuDurationMs?: number | undefined;
|
|
550
|
+
totalDurationMs?: number | undefined;
|
|
551
|
+
expiresAt?: number | undefined;
|
|
552
|
+
currentSnapshotId?: string | undefined;
|
|
553
|
+
statusUpdatedAt?: number | undefined;
|
|
554
|
+
cwd?: string | undefined;
|
|
555
|
+
tags?: Record<string, string> | undefined;
|
|
556
|
+
mounts?: Record<string, {
|
|
557
|
+
drive: string;
|
|
558
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
559
|
+
}> | undefined;
|
|
293
560
|
snapshotExpiration?: number | undefined;
|
|
294
561
|
keepLastSnapshots?: {
|
|
295
562
|
count: number;
|
|
@@ -742,6 +1009,47 @@ declare class APIClient extends BaseClient {
|
|
|
742
1009
|
count: string;
|
|
743
1010
|
} | undefined;
|
|
744
1011
|
}>>;
|
|
1012
|
+
listDrives(params: {
|
|
1013
|
+
projectId: string;
|
|
1014
|
+
limit?: number;
|
|
1015
|
+
cursor?: string | number;
|
|
1016
|
+
since?: number | string;
|
|
1017
|
+
until?: number | string;
|
|
1018
|
+
sortBy?: "createdAt" | "updatedAt" | "name";
|
|
1019
|
+
sortOrder?: "asc" | "desc";
|
|
1020
|
+
namePrefix?: string;
|
|
1021
|
+
signal?: AbortSignal;
|
|
1022
|
+
}): Promise<Parsed<{
|
|
1023
|
+
drives: {
|
|
1024
|
+
name: string;
|
|
1025
|
+
projectId: string;
|
|
1026
|
+
maxSizeBytes: number;
|
|
1027
|
+
createdAt: number;
|
|
1028
|
+
updatedAt: number;
|
|
1029
|
+
currentSessionId?: string | undefined;
|
|
1030
|
+
currentSandboxName?: string | undefined;
|
|
1031
|
+
}[];
|
|
1032
|
+
pagination: {
|
|
1033
|
+
count: number;
|
|
1034
|
+
next: string | null;
|
|
1035
|
+
};
|
|
1036
|
+
}>>;
|
|
1037
|
+
getOrCreateDrive(params: {
|
|
1038
|
+
projectId: string;
|
|
1039
|
+
name: string;
|
|
1040
|
+
maxSizeBytes?: number;
|
|
1041
|
+
signal?: AbortSignal;
|
|
1042
|
+
}): Promise<Parsed<{
|
|
1043
|
+
drive: {
|
|
1044
|
+
name: string;
|
|
1045
|
+
projectId: string;
|
|
1046
|
+
maxSizeBytes: number;
|
|
1047
|
+
createdAt: number;
|
|
1048
|
+
updatedAt: number;
|
|
1049
|
+
currentSessionId?: string | undefined;
|
|
1050
|
+
currentSandboxName?: string | undefined;
|
|
1051
|
+
};
|
|
1052
|
+
}>>;
|
|
745
1053
|
writeFiles(params: {
|
|
746
1054
|
sessionId: string;
|
|
747
1055
|
cwd: string;
|
|
@@ -924,6 +1232,10 @@ declare class APIClient extends BaseClient {
|
|
|
924
1232
|
statusUpdatedAt?: number | undefined;
|
|
925
1233
|
cwd?: string | undefined;
|
|
926
1234
|
tags?: Record<string, string> | undefined;
|
|
1235
|
+
mounts?: Record<string, {
|
|
1236
|
+
drive: string;
|
|
1237
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
1238
|
+
}> | undefined;
|
|
927
1239
|
snapshotExpiration?: number | undefined;
|
|
928
1240
|
keepLastSnapshots?: {
|
|
929
1241
|
count: number;
|
|
@@ -1169,6 +1481,10 @@ declare class APIClient extends BaseClient {
|
|
|
1169
1481
|
statusUpdatedAt?: number | undefined;
|
|
1170
1482
|
cwd?: string | undefined;
|
|
1171
1483
|
tags?: Record<string, string> | undefined;
|
|
1484
|
+
mounts?: Record<string, {
|
|
1485
|
+
drive: string;
|
|
1486
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
1487
|
+
}> | undefined;
|
|
1172
1488
|
snapshotExpiration?: number | undefined;
|
|
1173
1489
|
keepLastSnapshots?: {
|
|
1174
1490
|
count: number;
|
|
@@ -1181,6 +1497,21 @@ declare class APIClient extends BaseClient {
|
|
|
1181
1497
|
next: string | null;
|
|
1182
1498
|
};
|
|
1183
1499
|
}>>;
|
|
1500
|
+
deleteDrive(params: {
|
|
1501
|
+
projectId: string;
|
|
1502
|
+
name: string;
|
|
1503
|
+
signal?: AbortSignal;
|
|
1504
|
+
}): Promise<Parsed<{
|
|
1505
|
+
drive: {
|
|
1506
|
+
name: string;
|
|
1507
|
+
projectId: string;
|
|
1508
|
+
maxSizeBytes: number;
|
|
1509
|
+
createdAt: number;
|
|
1510
|
+
updatedAt: number;
|
|
1511
|
+
currentSessionId?: string | undefined;
|
|
1512
|
+
currentSandboxName?: string | undefined;
|
|
1513
|
+
};
|
|
1514
|
+
}>>;
|
|
1184
1515
|
updateSandbox(params: {
|
|
1185
1516
|
name: string;
|
|
1186
1517
|
projectId: string;
|
|
@@ -1311,6 +1642,10 @@ declare class APIClient extends BaseClient {
|
|
|
1311
1642
|
statusUpdatedAt?: number | undefined;
|
|
1312
1643
|
cwd?: string | undefined;
|
|
1313
1644
|
tags?: Record<string, string> | undefined;
|
|
1645
|
+
mounts?: Record<string, {
|
|
1646
|
+
drive: string;
|
|
1647
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
1648
|
+
}> | undefined;
|
|
1314
1649
|
snapshotExpiration?: number | undefined;
|
|
1315
1650
|
keepLastSnapshots?: {
|
|
1316
1651
|
count: number;
|
|
@@ -1437,6 +1772,10 @@ declare class APIClient extends BaseClient {
|
|
|
1437
1772
|
statusUpdatedAt?: number | undefined;
|
|
1438
1773
|
cwd?: string | undefined;
|
|
1439
1774
|
tags?: Record<string, string> | undefined;
|
|
1775
|
+
mounts?: Record<string, {
|
|
1776
|
+
drive: string;
|
|
1777
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
1778
|
+
}> | undefined;
|
|
1440
1779
|
snapshotExpiration?: number | undefined;
|
|
1441
1780
|
keepLastSnapshots?: {
|
|
1442
1781
|
count: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Command, CommandData, CommandFinishedData, CommandFinishedResponse, CommandResponse, CreateSnapshotResponse, InteractiveSessionResponse, LogError, LogLine, LogLineData, LogOutputLine, Sandbox, SandboxMetaData, SandboxRoute, SandboxRouteData, Session, SessionMetaData, SessionResponse, Snapshot, SnapshotMetadata, SnapshotResponse, SnapshotTreeNode, SnapshotTreeNodeData, StopSessionResponse } from "./validators.js";
|
|
1
|
+
import { Command, CommandData, CommandFinishedData, CommandFinishedResponse, CommandResponse, CreateSnapshotResponse, Drive, DriveMetadata, InteractiveSessionResponse, LogError, LogLine, LogLineData, LogOutputLine, Sandbox, SandboxMetaData, SandboxRoute, SandboxRouteData, Session, SessionMetaData, SessionResponse, Snapshot, SnapshotMetadata, SnapshotResponse, SnapshotTreeNode, SnapshotTreeNodeData, StopSessionResponse } from "./validators.js";
|
|
2
2
|
import { APIClient } from "./api-client.js";
|