@munitoai/cli 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,106 @@
1
+ import {
2
+ AGENTS,
3
+ AGENT_TEMPLATE,
4
+ ApiError,
5
+ BAKED,
6
+ CLAUDE_MODEL,
7
+ Client,
8
+ DEFAULT_BASE_URL,
9
+ DEFAULT_MODEL,
10
+ DEFAULT_SMALL_MODEL,
11
+ GUEST_HOME,
12
+ MANAGED_ENV,
13
+ PACKAGES,
14
+ PLUGINS,
15
+ PROVIDERS,
16
+ REGIONS,
17
+ WORKDIR,
18
+ WiringError,
19
+ claudeGates,
20
+ createAgentSandbox,
21
+ drop,
22
+ findBase,
23
+ headlessArgv,
24
+ job,
25
+ resolveHost,
26
+ runAgent,
27
+ shellArgv,
28
+ unwrap,
29
+ warm,
30
+ wire
31
+ } from "./chunk-WSY6HMNS.js";
32
+
33
+ // src/index.ts
34
+ var Munito = class {
35
+ client;
36
+ constructor(options) {
37
+ const baseUrl = options.baseUrl ?? (options.region ? resolveHost(options.region) : DEFAULT_BASE_URL);
38
+ this.client = new Client({ ...options, baseUrl });
39
+ }
40
+ get agent() {
41
+ return {
42
+ run: (options) => runAgent(this.client, options)
43
+ };
44
+ }
45
+ get ci() {
46
+ const client = this.client;
47
+ return {
48
+ warm: (options) => warm(client, options),
49
+ job: (options) => job(client, options),
50
+ find: (name) => findBase(client, name),
51
+ drop: (name) => drop(client, name)
52
+ };
53
+ }
54
+ get sandboxes() {
55
+ const client = this.client;
56
+ return {
57
+ // The API configures the agent. Supply its default key without changing the caller's sandbox options.
58
+ create: (spec) => client.createSandbox(
59
+ spec.agent && (spec.provider ?? "munito") === "munito" && (spec.auth ?? "token") === "token" ? { ...spec, env: { MUNITO_API_KEY: client.token, ...spec.env } } : spec
60
+ ),
61
+ get: (id) => client.getSandbox(id),
62
+ list: () => client.listSandboxes(),
63
+ delete: (id) => client.deleteSandbox(id),
64
+ pause: (id) => client.pauseSandbox(id),
65
+ resume: (id) => client.resumeSandbox(id),
66
+ exec: client.exec.bind(client),
67
+ execStream: client.execStream.bind(client),
68
+ readFile: client.readFile.bind(client),
69
+ writeFile: client.writeFile.bind(client),
70
+ signPortUrl: client.signPortUrl.bind(client)
71
+ };
72
+ }
73
+ };
74
+ export {
75
+ AGENTS,
76
+ AGENT_TEMPLATE,
77
+ ApiError,
78
+ BAKED,
79
+ CLAUDE_MODEL,
80
+ Client,
81
+ DEFAULT_BASE_URL,
82
+ DEFAULT_MODEL,
83
+ DEFAULT_SMALL_MODEL,
84
+ GUEST_HOME,
85
+ MANAGED_ENV,
86
+ Munito,
87
+ PACKAGES,
88
+ PLUGINS,
89
+ PROVIDERS,
90
+ REGIONS,
91
+ WORKDIR,
92
+ WiringError,
93
+ claudeGates,
94
+ createAgentSandbox,
95
+ drop as dropCiBase,
96
+ findBase as findCiBase,
97
+ headlessArgv,
98
+ REGIONS as regions,
99
+ runAgent,
100
+ job as runCiJob,
101
+ shellArgv,
102
+ unwrap,
103
+ warm as warmCiBase,
104
+ wire
105
+ };
106
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/** The SDK. `npx @munitoai/cli` and `import { Munito } from \"@munitoai/cli\"` run the same code.\n\n```ts\nimport { Munito } from \"@munitoai/cli\";\n\nconst munito = new Munito({ apiKey: process.env.MUNITO_API_KEY! });\nconst run = await munito.agent.run({ agent: \"claude\", prompt: \"fix the failing test\" });\nconsole.log(run.result);\n```\n*/\n\nimport { Client, DEFAULT_BASE_URL, REGIONS, type ClientOptions } from \"./api/client.ts\";\nimport { runAgent, type AgentRun, type RunAgentOptions } from \"./core/agents.ts\";\nimport { drop as dropCi, findBase as findCi, job as jobCi, warm as warmCi } from \"./core/ci.ts\";\nimport type { CreateSandbox, Sandbox } from \"./api/types.ts\";\nimport { resolveHost } from \"./core/keys.ts\";\n\nexport { ApiError, Client, DEFAULT_BASE_URL, REGIONS } from \"./api/client.ts\";\nexport type { ClientOptions } from \"./api/client.ts\";\nexport * from \"./api/types.ts\";\nexport { AGENT_TEMPLATE, WORKDIR, createAgentSandbox, runAgent, unwrap } from \"./core/agents.ts\";\nexport type { AgentEvent, AgentRun, CreateAgentSandboxOptions, RunAgentOptions, UploadFile } from \"./core/agents.ts\";\nexport * from \"./core/providers.ts\";\nexport { drop as dropCiBase, findBase as findCiBase, job as runCiJob, warm as warmCiBase } from \"./core/ci.ts\";\nexport type { CiEvent, JobOptions, WarmOptions, WarmResult } from \"./core/ci.ts\";\n\nexport interface MunitoOptions extends Omit<ClientOptions, \"baseUrl\"> {\n /** `global`, `eu`, `us`, or a full URL. */\n region?: string;\n baseUrl?: string;\n}\n\n/** One object for the whole product, in the shape a reader expects from an SDK. */\nexport class Munito {\n readonly client: Client;\n\n constructor(options: MunitoOptions) {\n const baseUrl = options.baseUrl ?? (options.region ? resolveHost(options.region) : DEFAULT_BASE_URL);\n this.client = new Client({ ...options, baseUrl });\n }\n\n get agent() {\n return {\n run: (options: RunAgentOptions): Promise<AgentRun> => runAgent(this.client, options),\n };\n }\n\n get ci() {\n const client = this.client;\n return {\n warm: (options: Parameters<typeof warmCi>[1]) => warmCi(client, options),\n job: (options: Parameters<typeof jobCi>[1]) => jobCi(client, options),\n find: (name: string) => findCi(client, name),\n drop: (name: string) => dropCi(client, name),\n };\n }\n\n get sandboxes() {\n const client = this.client;\n return {\n // The API configures the agent. Supply its default key without changing the caller's sandbox options.\n create: (spec: CreateSandbox): Promise<Sandbox> =>\n client.createSandbox(\n spec.agent && (spec.provider ?? \"munito\") === \"munito\" && (spec.auth ?? \"token\") === \"token\"\n ? { ...spec, env: { MUNITO_API_KEY: client.token, ...spec.env } }\n : spec,\n ),\n get: (id: string): Promise<Sandbox> => client.getSandbox(id),\n list: (): Promise<Sandbox[]> => client.listSandboxes(),\n delete: (id: string): Promise<void> => client.deleteSandbox(id),\n pause: (id: string): Promise<Sandbox> => client.pauseSandbox(id),\n resume: (id: string): Promise<Sandbox> => client.resumeSandbox(id),\n exec: client.exec.bind(client),\n execStream: client.execStream.bind(client),\n readFile: client.readFile.bind(client),\n writeFile: client.writeFile.bind(client),\n signPortUrl: client.signPortUrl.bind(client),\n };\n }\n}\n\nexport { REGIONS as regions };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,IAAM,SAAN,MAAa;AAAA,EACT;AAAA,EAET,YAAY,SAAwB;AAClC,UAAM,UAAU,QAAQ,YAAY,QAAQ,SAAS,YAAY,QAAQ,MAAM,IAAI;AACnF,SAAK,SAAS,IAAI,OAAO,EAAE,GAAG,SAAS,QAAQ,CAAC;AAAA,EAClD;AAAA,EAEA,IAAI,QAAQ;AACV,WAAO;AAAA,MACL,KAAK,CAAC,YAAgD,SAAS,KAAK,QAAQ,OAAO;AAAA,IACrF;AAAA,EACF;AAAA,EAEA,IAAI,KAAK;AACP,UAAM,SAAS,KAAK;AACpB,WAAO;AAAA,MACL,MAAM,CAAC,YAA0C,KAAO,QAAQ,OAAO;AAAA,MACvE,KAAK,CAAC,YAAyC,IAAM,QAAQ,OAAO;AAAA,MACpE,MAAM,CAAC,SAAiB,SAAO,QAAQ,IAAI;AAAA,MAC3C,MAAM,CAAC,SAAiB,KAAO,QAAQ,IAAI;AAAA,IAC7C;AAAA,EACF;AAAA,EAEA,IAAI,YAAY;AACd,UAAM,SAAS,KAAK;AACpB,WAAO;AAAA;AAAA,MAEL,QAAQ,CAAC,SACP,OAAO;AAAA,QACL,KAAK,UAAU,KAAK,YAAY,cAAc,aAAa,KAAK,QAAQ,aAAa,UACjF,EAAE,GAAG,MAAM,KAAK,EAAE,gBAAgB,OAAO,OAAO,GAAG,KAAK,IAAI,EAAE,IAC9D;AAAA,MACN;AAAA,MACF,KAAK,CAAC,OAAiC,OAAO,WAAW,EAAE;AAAA,MAC3D,MAAM,MAA0B,OAAO,cAAc;AAAA,MACrD,QAAQ,CAAC,OAA8B,OAAO,cAAc,EAAE;AAAA,MAC9D,OAAO,CAAC,OAAiC,OAAO,aAAa,EAAE;AAAA,MAC/D,QAAQ,CAAC,OAAiC,OAAO,cAAc,EAAE;AAAA,MACjE,MAAM,OAAO,KAAK,KAAK,MAAM;AAAA,MAC7B,YAAY,OAAO,WAAW,KAAK,MAAM;AAAA,MACzC,UAAU,OAAO,SAAS,KAAK,MAAM;AAAA,MACrC,WAAW,OAAO,UAAU,KAAK,MAAM;AAAA,MACvC,aAAa,OAAO,YAAY,KAAK,MAAM;AAAA,IAC7C;AAAA,EACF;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,63 @@
1
1
  {
2
2
  "name": "@munitoai/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "description": "The Munito AI command line tool and SDK: run a coding agent in a sandbox with one command.",
6
+ "comment": "Three layers, and the rule is one way: cli/ imports core/, core/ imports api/, and nothing imports back. core/ never writes to a terminal, so the same code serves `npx munito` and `import { Munito } from \"munito\"`.",
7
+ "license": "Apache-2.0",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/munitoai/monorepo.git",
11
+ "directory": "typescript/apps/cli"
12
+ },
13
+ "homepage": "https://docs.munito.ai/reference/cli",
14
+ "keywords": [
15
+ "munito",
16
+ "sandbox",
17
+ "agent",
18
+ "claude-code",
19
+ "codex",
20
+ "opencode",
21
+ "cli"
22
+ ],
23
+ "bin": {
24
+ "munito": "dist/cli.js"
25
+ },
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
+ }
31
+ },
32
+ "main": "./dist/index.js",
33
+ "types": "./dist/index.d.ts",
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "engines": {
38
+ "node": ">=22.12"
39
+ },
40
+ "scripts": {
41
+ "build": "tsup && tsc -p tsconfig.build.json",
42
+ "dev": "tsx src/cli.ts",
43
+ "test": "node --test --experimental-strip-types src/**/*.test.ts",
44
+ "typecheck": "tsc -p tsconfig.json"
45
+ },
46
+ "dependencies": {
47
+ "@clack/prompts": "^1.8.1",
48
+ "@modelcontextprotocol/sdk": "^1.32.2",
49
+ "citty": "^0.2.2",
50
+ "picocolors": "^1.1.1",
51
+ "zod": "^4.6.6"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^26.6.6",
55
+ "tsup": "^9.0.0",
56
+ "tsx": "^4.20.0",
57
+ "typescript": "^7.0.2"
58
+ },
59
+ "optionalDependencies": {
60
+ "ink": "^8.0.0",
61
+ "react": "^19.3.0"
62
+ }
63
+ }