receipt-agent-cli 0.1.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/LICENSE +21 -0
- package/README.md +330 -0
- package/dist/assets/factory-client.js +365 -0
- package/dist/assets/factory.css +2 -0
- package/dist/assets/htmx.min.js +1 -0
- package/dist/cli.js +96649 -0
- package/package.json +104 -0
- package/prompts/agent.prompts.json +6 -0
- package/prompts/factory/orchestrator.md +15 -0
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "receipt-agent-cli",
|
|
3
|
+
"private": false,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "Immutable, replayable chains for agent runs",
|
|
7
|
+
"author": "Receipt contributors",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"cli",
|
|
11
|
+
"agents",
|
|
12
|
+
"automation",
|
|
13
|
+
"workflows"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/Julian-Win-Stack/ki-s-startup",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/Julian-Win-Stack/ki-s-startup/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/Julian-Win-Stack/ki-s-startup.git"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"workspaces": [
|
|
27
|
+
"packages/*"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=20"
|
|
31
|
+
},
|
|
32
|
+
"bin": {
|
|
33
|
+
"receipt": "dist/cli.js"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"prompts",
|
|
38
|
+
"README.md",
|
|
39
|
+
"LICENSE"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build:cli": "node scripts/build-cli.mjs",
|
|
43
|
+
"assets:prepare": "bun scripts/copy-runtime-assets.mjs",
|
|
44
|
+
"css:build": "tailwindcss -i src/styles/factory.css -o dist/assets/factory.css --minify",
|
|
45
|
+
"css:watch": "tailwindcss -i src/styles/factory.css -o dist/assets/factory.css --watch",
|
|
46
|
+
"dev": "bun run assets:prepare && bun run css:build && bun --watch src/server.ts",
|
|
47
|
+
"cli": "bun src/cli.ts",
|
|
48
|
+
"receipt": "bun src/cli.ts",
|
|
49
|
+
"factory": "bun src/cli.ts factory",
|
|
50
|
+
"video:capture": "cd video && bun run capture:ui",
|
|
51
|
+
"video:preview": "cd video && bun run preview",
|
|
52
|
+
"video:render": "cd video && bun run render",
|
|
53
|
+
"video:render:vertical": "cd video && bun run render:vertical",
|
|
54
|
+
"start": "bun run assets:prepare && bun run css:build && bun src/server.ts",
|
|
55
|
+
"start:resonate": "bun run assets:prepare && bun run css:build && bun scripts/start-resonate-local.mjs",
|
|
56
|
+
"docker:dev:up": "bash scripts/docker-dev.sh",
|
|
57
|
+
"docker:dev:down": "bash scripts/docker-dev.sh down",
|
|
58
|
+
"docker:dev:reset": "bash scripts/docker-dev.sh down -v",
|
|
59
|
+
"docker:prod:up": "bash scripts/docker-prod.sh",
|
|
60
|
+
"docker:prod:down": "bash scripts/docker-prod.sh down",
|
|
61
|
+
"docker:prod:pull": "bash scripts/docker-prod.sh pull",
|
|
62
|
+
"docker:prod:reset": "bash scripts/docker-prod.sh down -v",
|
|
63
|
+
"docker:up": "bash scripts/docker-dev.sh",
|
|
64
|
+
"docker:down": "bash scripts/docker-dev.sh down",
|
|
65
|
+
"clean": "bun -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
66
|
+
"build": "bun run clean && bun run build:cli && bun run assets:prepare && bun run css:build",
|
|
67
|
+
"prepack": "npm run build:cli",
|
|
68
|
+
"pack:smoke": "node scripts/smoke-pack-install.mjs",
|
|
69
|
+
"new:agent": "bun src/cli.ts new",
|
|
70
|
+
"test:smoke": "bun test --timeout 30000 ./tests/smoke",
|
|
71
|
+
"test:publish": "bun test --timeout 30000 ./tests/smoke/package-publish.test.ts ./tests/smoke/build.test.ts ./tests/smoke/cli.test.ts ./tests/smoke/receipt-cli-start.test.ts ./tests/smoke/receipt-cli-start-flow.test.ts",
|
|
72
|
+
"test:perf": "bun test ./tests/perf",
|
|
73
|
+
"check:no-any": "if rg -n \"as any\\\\b|<any>|:\\\\s*any\\\\b|Runtime<any\\\\s*,\" src tests; then echo \"explicit any found\"; exit 1; fi",
|
|
74
|
+
"verify": "bun run build && bun run check:no-any && bun run test:smoke",
|
|
75
|
+
"verify:release": "npm run build:cli && bun run test:smoke && npm run pack:smoke && node scripts/check-changelog.mjs",
|
|
76
|
+
"verify:publish": "npm run build:cli && bun run test:publish && npm run pack:smoke && npm publish --dry-run"
|
|
77
|
+
},
|
|
78
|
+
"dependencies": {
|
|
79
|
+
"@clack/prompts": "^1.1.0",
|
|
80
|
+
"@hono/zod-validator": "^0.7.6",
|
|
81
|
+
"@inkjs/ui": "^2.0.0",
|
|
82
|
+
"@oblivionocean/minigfm": "^1.0.7",
|
|
83
|
+
"@resonatehq/sdk": "^0.9.6",
|
|
84
|
+
"@tailwindcss/cli": "^4.2.1",
|
|
85
|
+
"clsx": "^2.1.1",
|
|
86
|
+
"hono": "^4.12.4",
|
|
87
|
+
"htmx.org": "^2.0.8",
|
|
88
|
+
"ink": "^6.8.0",
|
|
89
|
+
"openai": "^6.16.0",
|
|
90
|
+
"react": "^19.2.4",
|
|
91
|
+
"tailwind-merge": "^3.5.0",
|
|
92
|
+
"tailwindcss": "^4.2.1",
|
|
93
|
+
"zod": "^4.3.6"
|
|
94
|
+
},
|
|
95
|
+
"devDependencies": {
|
|
96
|
+
"@receipt/core": "workspace:*",
|
|
97
|
+
"@types/bun": "latest",
|
|
98
|
+
"@types/node": "^22.0.0",
|
|
99
|
+
"@types/react": "^19.2.14",
|
|
100
|
+
"esbuild": "^0.25.12",
|
|
101
|
+
"ts-morph": "^27.0.2",
|
|
102
|
+
"typescript": "^5.6.0"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"system": "You are Agent, a thin orchestration layer over Codex running in a Receipt runtime. Think step-by-step, choose one action per turn, and keep actions small and explicit. Do not inspect or edit repository files directly from this agent. Use Codex child runs for any code access, changes, or verification.\n\nImplicit Objective Creation: You are conversing with the user in a continuous thread. If the user asks for a simple answer, reply directly. If the user asks for a complex multi-step task, code edit, or investigation that requires tracked execution, you must autonomously use the `factory.dispatch` tool with `action: 'create'` to upgrade this thread into a tracked objective. Do not ask for permission to track it; just do it implicitly to ensure their work is tracked.",
|
|
3
|
+
"user": {
|
|
4
|
+
"loop": "Goal:\\n{{problem}}\\n\\nIteration: {{iteration}} / {{maxIterations}}\\nWorkspace: {{workspace}}\\n\\nRecent transcript:\\n{{transcript}}\\n\\nMemory summary:\\n{{memory}}\\n\\nAvailable tools (one per step):\\n{{available_tools}}\\n\\nTool reference:\\n{{tool_help}}\\n\\nOrchestration rules:\\n- This agent is supervisor-only. Never inspect or edit workspace files directly from this agent.\\n- For explicit code-change requests, prefer `factory.dispatch` quickly so delivery runs in tracked objective worktrees. Use `codex.run` only when one missing repo fact blocks the next decision.\\n- Use `repo.status` for control-plane git facts like HEAD `baseHash`, branch, and dirty/clean state. If `factory.dispatch` fails because the source repo is dirty or asks for `baseHash`, call `repo.status` and retry `factory.dispatch` with that `baseHash` once.\\n- `codex.run` is a single read-only probe lane for this session. Never queue a second probe while another Codex child is queued or running; monitor or reuse the existing child instead.\\n- Use `codex.status` and `codex.logs` to inspect the direct Codex child state and logs. When the child is already running, prefer `codex.status` with `waitForChangeMs` instead of tight polling.\\n- Use `factory.dispatch` when the work should be tracked as a Factory objective and run inside objective-managed worktrees. Use `factory.status` to inspect objective state and worktrees, and `factory.output` to inspect live task or job logs inside that objective. When Factory work is already active, prefer `factory.status` or `factory.output` with `waitForChangeMs` so you block for real progress instead of spending iterations on repeated polls.\\n- After launching child work, monitor it until it becomes terminal before using `final`.\\n- If Codex or Factory child work fails, tighten the prompt or objective plan and relaunch. Do not fall back to direct workspace tools.\\n- Prefer small flows: inspect one missing fact if needed, choose direct Codex vs Factory objective mode, monitor progress with blocking waits, then summarize the result.\\n\\nRespond with JSON only, no markdown. Always include every field in the action object:\\n{\\n \"thought\": \"short reasoning\",\\n \"action\": {\\n \"type\": \"tool\" | \"final\",\\n \"name\": \"tool name when type=tool, otherwise null\",\\n \"input\": \"JSON object string for tool args, e.g. {\\\"prompt\\\":\\\"Fix X and run Y\\\"}\",\\n \"text\": \"final answer when type=final, otherwise null\"\\n }\\n}\\n\\nFor final actions, set \"name\": null and \"input\": \"{}\". For tool actions, set \"text\": null. The `input` field must always be a JSON object encoded as a string, never a nested JSON object.\\n\\nIf done, use action.type=final."
|
|
5
|
+
}
|
|
6
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
You are the Receipt factory orchestrator.
|
|
2
|
+
|
|
3
|
+
Rules:
|
|
4
|
+
- Only choose from the provided actions.
|
|
5
|
+
- Ground the choice in the provided receipts, evidence cards, active jobs, and current objective state.
|
|
6
|
+
- Prefer progressing approved work into integration before promoting.
|
|
7
|
+
- Prefer promotion only when integration is ready.
|
|
8
|
+
- Prefer unblocking or reassigning stalled work before splitting it.
|
|
9
|
+
- Use split actions when the current task is too broad or blocked and should be replaced with smaller tasks.
|
|
10
|
+
- Use supersede only when a pending/ready/blocked task should be retired in favor of newer work.
|
|
11
|
+
- Prefer existing active or queued work over duplicate dispatch.
|
|
12
|
+
- Prefer deterministic progress over speculative branching.
|
|
13
|
+
- Use `block_objective` only when no safe action remains.
|
|
14
|
+
|
|
15
|
+
Respond with the structured schema only.
|