receipt-agent-cli 0.1.0 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +13 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -96140,8 +96140,13 @@ var looksLikeDefineAgentSpec = (value) => {
96140
96140
  var loadAgentDefault = async (agentId) => {
96141
96141
  const srcFile = path18.join(ROOT, "src", "agents", `${agentId}.agent.ts`);
96142
96142
  if (fs19.existsSync(srcFile)) {
96143
- const mod = await import(pathToFileURL(srcFile).href);
96144
- return mod.default;
96143
+ try {
96144
+ const mod = await import(pathToFileURL(srcFile).href);
96145
+ return mod.default;
96146
+ } catch (error48) {
96147
+ const err = error48 instanceof Error ? error48 : new Error(String(error48));
96148
+ throw err;
96149
+ }
96145
96150
  }
96146
96151
  return void 0;
96147
96152
  };
@@ -96203,9 +96208,12 @@ var commandNew = async (id, template) => {
96203
96208
  emit("task.completed", { output: prompt });
96204
96209
  },
96205
96210
  })`;
96206
- const body = `import { defineAgent, receipt, action, assistant, human } from "../sdk/index";
96211
+ const body = `const receipt = <T = unknown>() => ({} as T);
96212
+ const action = <T extends Record<string, unknown>>(id: string, config: T) => ({ id, kind: "action", ...config });
96213
+ const assistant = <T extends Record<string, unknown>>(id: string, config: T) => ({ id, kind: "assistant", ...config });
96214
+ const human = <T extends Record<string, unknown>>(id: string, config: T) => ({ id, kind: "human", ...config });
96207
96215
 
96208
- export default defineAgent({
96216
+ export default {
96209
96217
  id: "${id}",
96210
96218
  version: "1.0.0",${receiptDecl}
96211
96219
 
@@ -96219,7 +96227,7 @@ export default defineAgent({
96219
96227
  ],
96220
96228
 
96221
96229
  goal: ({ view }) => Boolean((view as { done?: boolean }).done),
96222
- });
96230
+ };
96223
96231
  `;
96224
96232
  await fs19.promises.mkdir(path18.dirname(target), { recursive: true });
96225
96233
  await fs19.promises.writeFile(target, body, "utf-8");
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "receipt-agent-cli",
3
3
  "private": false,
4
4
  "type": "module",
5
- "version": "0.1.0",
5
+ "version": "0.1.1",
6
6
  "description": "Immutable, replayable chains for agent runs",
7
7
  "author": "Receipt contributors",
8
8
  "license": "MIT",