edge-pi-cli 0.1.1 → 0.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"print-mode.js","sourceRoot":"","sources":["../../src/modes/print-mode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAkB,EAAE,OAAyB,EAAiB;IAChG,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IAEnE,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,IAAI,cAAc,EAAE,CAAC;QACpB,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAClC,CAAC;IACD,WAAW,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;IAE9B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,WAAW,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QAEvD,2BAA2B;QAC3B,IAAI,cAAc,EAAE,CAAC;YACpB,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC;YACtC,KAAK,MAAM,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;gBACrF,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YACnC,CAAC;QACF,CAAC;QAED,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CACV,IAAI,CAAC,SAAS,CAAC;gBACd,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,KAAK,EAAE,MAAM,CAAC,UAAU;aACxB,CAAC,CACF,CAAC;QACH,CAAC;aAAM,CAAC;YACP,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC;QACF,CAAC;IACF,CAAC;IAED,eAAe;IACf,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;QAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;YACjC,IAAI,GAAG;gBAAE,MAAM,CAAC,GAAG,CAAC,CAAC;;gBAChB,OAAO,EAAE,CAAC;QAAA,CACf,CAAC,CAAC;IAAA,CACH,CAAC,CAAC;AAAA,CACH","sourcesContent":["/**\n * Print mode (single-shot): Send prompts, output result, exit.\n *\n * Used for:\n * - `epi -p \"prompt\"` - text output\n * - `epi --mode json \"prompt\"` - JSON event stream\n */\n\nimport type { CodingAgent, SessionManager } from \"edge-pi\";\n\nexport interface PrintModeOptions {\n\tmode: \"text\" | \"json\";\n\tmessages: string[];\n\tinitialMessage?: string;\n\tsessionManager?: SessionManager;\n}\n\n/**\n * Run in print (single-shot) mode.\n * Sends prompts to the agent and outputs the result.\n */\nexport async function runPrintMode(agent: CodingAgent, options: PrintModeOptions): Promise<void> {\n\tconst { mode, messages, initialMessage, sessionManager } = options;\n\n\tconst allMessages: string[] = [];\n\tif (initialMessage) {\n\t\tallMessages.push(initialMessage);\n\t}\n\tallMessages.push(...messages);\n\n\tif (allMessages.length === 0) {\n\t\tconsole.error(\"No prompt provided. Use -p with a message.\");\n\t\tprocess.exit(1);\n\t}\n\n\tfor (const message of allMessages) {\n\t\tconst result = await agent.prompt({ prompt: message });\n\n\t\t// Save messages to session\n\t\tif (sessionManager) {\n\t\t\tconst agentMessages = result.messages;\n\t\t\tfor (const msg of agentMessages.slice(agent.messages.length - agentMessages.length)) {\n\t\t\t\tsessionManager.appendMessage(msg);\n\t\t\t}\n\t\t}\n\n\t\tif (mode === \"json\") {\n\t\t\tconsole.log(\n\t\t\t\tJSON.stringify({\n\t\t\t\t\ttype: \"result\",\n\t\t\t\t\ttext: result.text,\n\t\t\t\t\tstepCount: result.stepCount,\n\t\t\t\t\tusage: result.totalUsage,\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\tif (result.text) {\n\t\t\t\tconsole.log(result.text);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Flush stdout\n\tawait new Promise<void>((resolve, reject) => {\n\t\tprocess.stdout.write(\"\", (err) => {\n\t\t\tif (err) reject(err);\n\t\t\telse resolve();\n\t\t});\n\t});\n}\n"]}
1
+ {"version":3,"file":"print-mode.js","sourceRoot":"","sources":["../../src/modes/print-mode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAkB,EAAE,OAAyB,EAAiB;IAChG,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IAEnD,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,IAAI,cAAc,EAAE,CAAC;QACpB,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAClC,CAAC;IACD,WAAW,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;IAE9B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,WAAW,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QAEzD,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CACV,IAAI,CAAC,SAAS,CAAC;gBACd,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;gBAC9B,KAAK,EAAE,MAAM,CAAC,UAAU;aACxB,CAAC,CACF,CAAC;QACH,CAAC;aAAM,CAAC;YACP,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC;QACF,CAAC;IACF,CAAC;IAED,eAAe;IACf,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;QAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;YACjC,IAAI,GAAG;gBAAE,MAAM,CAAC,GAAG,CAAC,CAAC;;gBAChB,OAAO,EAAE,CAAC;QAAA,CACf,CAAC,CAAC;IAAA,CACH,CAAC,CAAC;AAAA,CACH","sourcesContent":["/**\n * Print mode (single-shot): Send prompts, output result, exit.\n *\n * Used for:\n * - `epi -p \"prompt\"` - text output\n * - `epi --mode json \"prompt\"` - JSON event stream\n */\n\nimport type { CodingAgent } from \"edge-pi\";\n\nexport interface PrintModeOptions {\n\tmode: \"text\" | \"json\";\n\tmessages: string[];\n\tinitialMessage?: string;\n}\n\n/**\n * Run in print (single-shot) mode.\n * Sends prompts to the agent and outputs the result.\n * Session persistence is handled automatically by the agent.\n */\nexport async function runPrintMode(agent: CodingAgent, options: PrintModeOptions): Promise<void> {\n\tconst { mode, messages, initialMessage } = options;\n\n\tconst allMessages: string[] = [];\n\tif (initialMessage) {\n\t\tallMessages.push(initialMessage);\n\t}\n\tallMessages.push(...messages);\n\n\tif (allMessages.length === 0) {\n\t\tconsole.error(\"No prompt provided. Use -p with a message.\");\n\t\tprocess.exit(1);\n\t}\n\n\tfor (const message of allMessages) {\n\t\tconst result = await agent.generate({ prompt: message });\n\n\t\tif (mode === \"json\") {\n\t\t\tconsole.log(\n\t\t\t\tJSON.stringify({\n\t\t\t\t\ttype: \"result\",\n\t\t\t\t\ttext: result.text,\n\t\t\t\t\tstepCount: result.steps.length,\n\t\t\t\t\tusage: result.totalUsage,\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\tif (result.text) {\n\t\t\t\tconsole.log(result.text);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Flush stdout\n\tawait new Promise<void>((resolve, reject) => {\n\t\tprocess.stdout.write(\"\", (err) => {\n\t\t\tif (err) reject(err);\n\t\t\telse resolve();\n\t\t});\n\t});\n}\n"]}
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "edge-pi-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CLI for the edge-pi coding agent SDK",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "epi": "dist/cli.js"
8
8
  },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/marcusschiesser/edge-pi"
12
+ },
9
13
  "main": "./dist/main.js",
10
14
  "types": "./dist/main.d.ts",
11
15
  "files": [
@@ -23,7 +27,7 @@
23
27
  "@ai-sdk/openai": "^3.0.26",
24
28
  "@mariozechner/pi-tui": "^0.50.9",
25
29
  "chalk": "^5.5.0",
26
- "edge-pi": "^0.1.1",
30
+ "edge-pi": "^0.1.3",
27
31
  "proper-lockfile": "^4.1.2",
28
32
  "yaml": "^2.7.1"
29
33
  },