@zvirb/pinup-canvas 0.0.0-stage → 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.
Files changed (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -2
  3. package/dist/agent/acp.d.ts +21 -0
  4. package/dist/agent/acp.d.ts.map +1 -0
  5. package/dist/agent/acp.js +248 -0
  6. package/dist/agent/acp.js.map +1 -0
  7. package/dist/agent/backend.d.ts +70 -0
  8. package/dist/agent/backend.d.ts.map +1 -0
  9. package/dist/agent/backend.js +112 -0
  10. package/dist/agent/backend.js.map +1 -0
  11. package/dist/agent/brief.d.ts +12 -0
  12. package/dist/agent/brief.d.ts.map +1 -0
  13. package/dist/agent/brief.js +35 -0
  14. package/dist/agent/brief.js.map +1 -0
  15. package/dist/agent/claude.d.ts +6 -0
  16. package/dist/agent/claude.d.ts.map +1 -0
  17. package/dist/agent/claude.js +104 -0
  18. package/dist/agent/claude.js.map +1 -0
  19. package/dist/agent/codex.d.ts +5 -0
  20. package/dist/agent/codex.d.ts.map +1 -0
  21. package/dist/agent/codex.js +127 -0
  22. package/dist/agent/codex.js.map +1 -0
  23. package/dist/agent/copies.d.ts +47 -0
  24. package/dist/agent/copies.d.ts.map +1 -0
  25. package/dist/agent/copies.js +229 -0
  26. package/dist/agent/copies.js.map +1 -0
  27. package/dist/agent/gemini.d.ts +5 -0
  28. package/dist/agent/gemini.d.ts.map +1 -0
  29. package/dist/agent/gemini.js +116 -0
  30. package/dist/agent/gemini.js.map +1 -0
  31. package/dist/agent/http.d.ts +4 -0
  32. package/dist/agent/http.d.ts.map +1 -0
  33. package/dist/agent/http.js +20 -0
  34. package/dist/agent/http.js.map +1 -0
  35. package/dist/agent/registry.d.ts +9 -0
  36. package/dist/agent/registry.d.ts.map +1 -0
  37. package/dist/agent/registry.js +43 -0
  38. package/dist/agent/registry.js.map +1 -0
  39. package/dist/agent/runner.d.ts +33 -0
  40. package/dist/agent/runner.d.ts.map +1 -0
  41. package/dist/agent/runner.js +377 -0
  42. package/dist/agent/runner.js.map +1 -0
  43. package/dist/agent/steps.d.ts +13 -0
  44. package/dist/agent/steps.d.ts.map +1 -0
  45. package/dist/agent/steps.js +88 -0
  46. package/dist/agent/steps.js.map +1 -0
  47. package/dist/agents.d.ts +5 -0
  48. package/dist/agents.d.ts.map +1 -0
  49. package/dist/agents.js +4 -0
  50. package/dist/agents.js.map +1 -0
  51. package/dist/branch-css.d.ts +7 -0
  52. package/dist/branch-css.d.ts.map +1 -0
  53. package/dist/branch-css.js +69 -0
  54. package/dist/branch-css.js.map +1 -0
  55. package/dist/branch-graph.d.ts +14 -0
  56. package/dist/branch-graph.d.ts.map +1 -0
  57. package/dist/branch-graph.js +83 -0
  58. package/dist/branch-graph.js.map +1 -0
  59. package/dist/branches.d.ts +29 -0
  60. package/dist/branches.d.ts.map +1 -0
  61. package/dist/branches.js +115 -0
  62. package/dist/branches.js.map +1 -0
  63. package/dist/client.css +1741 -0
  64. package/dist/client.js +12153 -0
  65. package/dist/client.js.map +1 -0
  66. package/dist/server.d.ts +10 -0
  67. package/dist/server.d.ts.map +1 -0
  68. package/dist/server.js +66 -0
  69. package/dist/server.js.map +1 -0
  70. package/dist/vite.d.ts +29 -0
  71. package/dist/vite.d.ts.map +1 -0
  72. package/dist/vite.js +286 -0
  73. package/dist/vite.js.map +1 -0
  74. package/package.json +53 -3
  75. package/src/agent/acp.ts +299 -0
  76. package/src/agent/backend.ts +168 -0
  77. package/src/agent/brief.ts +43 -0
  78. package/src/agent/claude.ts +142 -0
  79. package/src/agent/codex.ts +156 -0
  80. package/src/agent/copies.ts +272 -0
  81. package/src/agent/gemini.ts +150 -0
  82. package/src/agent/http.ts +26 -0
  83. package/src/agent/registry.ts +60 -0
  84. package/src/agent/runner.ts +423 -0
  85. package/src/agent/steps.ts +107 -0
  86. package/src/agents.ts +5 -0
  87. package/src/branch-css.ts +70 -0
  88. package/src/branch-graph.ts +100 -0
  89. package/src/branches.ts +132 -0
  90. package/src/canvas.css +110 -0
  91. package/src/server.ts +86 -0
  92. package/src/vite.ts +339 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Toms Zvirbulis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,10 @@
1
- # Temporary Holding Version
1
+ # @zvirb/pinup-canvas
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Pinup's canvas: the board page, its comment layer, and the Vite plugin that serves them.
4
+
5
+ Part of [Pinup](https://github.com/tomszir/pinup#readme): a design canvas for the UI you actually
6
+ ship, where agents take the review comments. Start with the
7
+ [README](https://github.com/tomszir/pinup#readme) and
8
+ [installing](https://github.com/tomszir/pinup/blob/main/docs/install.md).
9
+
10
+ MIT
@@ -0,0 +1,21 @@
1
+ import type { BackendOptions } from '@zvirb/pinup-core';
2
+ import { type AgentBackend } from './backend.ts';
3
+ interface ToolCall {
4
+ toolCallId?: string;
5
+ title?: string;
6
+ kind?: string;
7
+ rawInput?: Record<string, unknown>;
8
+ locations?: {
9
+ path?: string;
10
+ }[];
11
+ }
12
+ /** Pinup's answer to "may I?": the same for every ACP agent. */
13
+ export declare function permits(call: ToolCall, cwd: string, writable: string[], commands: string[]): boolean;
14
+ export declare function acp(options: BackendOptions, commands: string[] | undefined): AgentBackend;
15
+ /**
16
+ * Google Antigravity's CLI (`agy`): an ACP agent of its own (`agy acp`), so Pinup drives it like
17
+ * any other and answers its permission requests. `model` takes its ids: `gemini-4-neon-medium`.
18
+ */
19
+ export declare function antigravity(options: BackendOptions, commands: string[] | undefined): AgentBackend;
20
+ export {};
21
+ //# sourceMappingURL=acp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp.d.ts","sourceRoot":"","sources":["../../src/agent/acp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EACL,KAAK,YAAY,EAUlB,MAAM,cAAc,CAAA;AAKrB,UAAU,QAAQ;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,SAAS,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAChC;AAkBD,gEAAgE;AAChE,wBAAgB,OAAO,CACrB,IAAI,EAAE,QAAQ,EACd,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAwBT;AAgBD,wBAAgB,GAAG,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,YAAY,CAwBzF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,YAAY,CAQjG"}
@@ -0,0 +1,248 @@
1
+ // The Agent Client Protocol (agentclientprotocol.com): JSON-RPC over stdio, spoken natively by
2
+ // Gemini CLI (`gemini --experimental-acp`) and by adapters for Claude Code and Codex. Pinup is the
3
+ // client, so it answers every permission request itself: reads and searches pass, edits pass
4
+ // inside the working folder, commands pass only when listed. The same rules for every agent.
5
+ import { isAbsolute, resolve, sep } from 'node:path';
6
+ import { allCommands, allowedCommand, parseLine, probeVersion, run, } from "./backend.js";
7
+ import { clip, commandStep, fromRoot } from "./steps.js";
8
+ const PROTOCOL_VERSION = 1;
9
+ const inside = (dir, path) => {
10
+ const full = resolve(dir, path);
11
+ return full === dir || full.startsWith(dir + sep);
12
+ };
13
+ const commandOf = (call) => {
14
+ const raw = call.rawInput?.['command'];
15
+ if (Array.isArray(raw))
16
+ return raw.map(String).join(' ');
17
+ return typeof raw === 'string' ? raw : (call.title ?? '');
18
+ };
19
+ /** Pinup's answer to "may I?": the same for every ACP agent. */
20
+ export function permits(call, cwd, writable, commands) {
21
+ switch (call.kind) {
22
+ case 'read':
23
+ case 'search':
24
+ case 'think':
25
+ return true;
26
+ case 'edit':
27
+ case 'delete':
28
+ case 'move': {
29
+ const paths = (call.locations ?? []).map((l) => l.path ?? '');
30
+ const roots = [cwd, ...writable];
31
+ return (paths.length > 0 &&
32
+ paths.every((p) => p !== '' && roots.some((root) => inside(root, isAbsolute(p) ? p : resolve(cwd, p)))));
33
+ }
34
+ case 'execute':
35
+ return allowedCommand(commandOf(call), commands);
36
+ default:
37
+ return false;
38
+ }
39
+ }
40
+ function describeCall(cwd, call) {
41
+ const path = call.locations?.[0]?.path;
42
+ switch (call.kind) {
43
+ case 'execute':
44
+ return commandStep(cwd, commandOf(call));
45
+ case 'edit':
46
+ return path ? `Edit ${fromRoot(cwd, path)}` : clip(call.title ?? 'Edit', 80);
47
+ case 'read':
48
+ return path ? `Read ${fromRoot(cwd, path)}` : clip(call.title ?? 'Read', 80);
49
+ default:
50
+ return clip(call.title ?? call.kind ?? 'tool', 80);
51
+ }
52
+ }
53
+ export function acp(options, commands) {
54
+ const allowed = allCommands(commands);
55
+ const command = options.command;
56
+ return {
57
+ name: 'acp',
58
+ label: options.model === undefined
59
+ ? `ACP · ${command?.[0] ?? '?'}`
60
+ : `ACP · ${command?.[0] ?? '?'} · ${options.model}`,
61
+ guard: `Pinup approves each action: edits in its folder, runs only ${allowed.join(', ')}`,
62
+ tools: 'Read and search with your own file tools. Pinup approves each action you take.',
63
+ check: async () => command === undefined
64
+ ? {
65
+ ok: false,
66
+ problem: "set agent.backends.acp.command, e.g. ['gemini', '--experimental-acp'] or an ACP adapter",
67
+ }
68
+ : probeVersion(command),
69
+ open: (session) => {
70
+ if (command === undefined)
71
+ throw new Error('agent.backends.acp.command is not set');
72
+ return acpSession([...command, ...(options.args ?? [])], options, allowed, session);
73
+ },
74
+ };
75
+ }
76
+ /**
77
+ * Google Antigravity's CLI (`agy`): an ACP agent of its own (`agy acp`), so Pinup drives it like
78
+ * any other and answers its permission requests. `model` takes its ids: `gemini-4-neon-medium`.
79
+ */
80
+ export function antigravity(options, commands) {
81
+ const backend = acp({ ...options, command: options.command ?? ['agy', 'acp'] }, commands);
82
+ return {
83
+ ...backend,
84
+ name: 'antigravity',
85
+ label: options.model === undefined ? 'Antigravity' : `Antigravity · ${options.model}`,
86
+ check: () => probeVersion(options.command?.slice(0, 1) ?? ['agy']),
87
+ };
88
+ }
89
+ function acpSession(command, options, commands, session) {
90
+ let nextId = 1;
91
+ const pending = new Map();
92
+ let sessionId;
93
+ let ready;
94
+ let onStep = () => { };
95
+ let message = '';
96
+ let last = '';
97
+ let finish;
98
+ let stopped = false;
99
+ const child = run(command, { cwd: session.cwd, env: session.env, stdin: 'pipe' }, (line) => receive(line));
100
+ const send = (value) => child.proc.stdin?.write(`${JSON.stringify({ jsonrpc: '2.0', ...value })}\n`);
101
+ const request = (method, params) => new Promise((done) => {
102
+ const id = nextId++;
103
+ pending.set(id, done);
104
+ send({ id, method, params });
105
+ });
106
+ const flush = () => {
107
+ if (message.trim() === '')
108
+ return;
109
+ last = message.trim();
110
+ onStep({ kind: 'text', text: clip(last, 280) });
111
+ message = '';
112
+ };
113
+ function receive(line) {
114
+ const data = parseLine(line);
115
+ if (data === undefined)
116
+ return;
117
+ const id = data['id'];
118
+ const method = data['method'];
119
+ if (typeof method !== 'string') {
120
+ if (typeof id === 'number') {
121
+ pending.get(id)?.(data);
122
+ pending.delete(id);
123
+ }
124
+ return;
125
+ }
126
+ const params = (data['params'] ?? {});
127
+ if (method === 'session/update') {
128
+ const update = (params['update'] ?? {});
129
+ const kind = update['sessionUpdate'];
130
+ if (kind === 'agent_message_chunk') {
131
+ const content = update['content'];
132
+ if (content?.type === 'text')
133
+ message += content.text ?? '';
134
+ }
135
+ else if (kind === 'tool_call') {
136
+ flush();
137
+ onStep({ kind: 'tool', text: describeCall(session.cwd, update) });
138
+ }
139
+ return;
140
+ }
141
+ if (method === 'session/request_permission' && id !== undefined) {
142
+ const call = (params['toolCall'] ?? {});
143
+ const choices = (params['options'] ?? []);
144
+ const yes = permits(call, session.cwd, session.writable, commands);
145
+ const pick = choices.find((o) => o.kind === (yes ? 'allow_once' : 'reject_once')) ??
146
+ choices.find((o) => o.kind.startsWith(yes ? 'allow' : 'reject'));
147
+ if (!yes)
148
+ onStep({ kind: 'tool', text: `Refused: ${describeCall(session.cwd, call)}` });
149
+ send({
150
+ id,
151
+ result: {
152
+ outcome: pick === undefined
153
+ ? { outcome: 'cancelled' }
154
+ : { outcome: 'selected', optionId: pick.optionId },
155
+ },
156
+ });
157
+ return;
158
+ }
159
+ // Anything else asked of a client (files, terminals) wasn't offered: say so.
160
+ if (id !== undefined)
161
+ send({ id, error: { code: -32601, message: `${method} not supported` } });
162
+ }
163
+ child.proc.on('error', (failure) => {
164
+ finish?.({ text: '', error: `${command[0]}: ${failure.message}` });
165
+ });
166
+ child.proc.on('exit', (code, signal) => {
167
+ for (const done of pending.values())
168
+ done({ error: { message: 'agent exited' } });
169
+ pending.clear();
170
+ finish?.(stopped || signal === 'SIGTERM'
171
+ ? { text: last, stopped: true }
172
+ : { text: last, error: `${command[0]} exited (${code ?? signal}): ${child.stderr()}` });
173
+ });
174
+ const start = async () => {
175
+ const init = await request('initialize', {
176
+ protocolVersion: PROTOCOL_VERSION,
177
+ clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false },
178
+ });
179
+ if (init.error !== undefined)
180
+ return undefined;
181
+ const caps = init.result
182
+ ?.agentCapabilities;
183
+ const base = { cwd: session.cwd, mcpServers: [] };
184
+ if (session.resume !== undefined && caps?.loadSession === true) {
185
+ const loaded = await request('session/load', { ...base, sessionId: session.resume });
186
+ if (loaded.error === undefined)
187
+ return session.resume;
188
+ }
189
+ const created = await request('session/new', base);
190
+ const fresh = created.result?.sessionId;
191
+ // Choosing a model is still an unstable part of ACP: an agent may not answer, so don't wait long.
192
+ if (fresh !== undefined && options.model !== undefined)
193
+ await Promise.race([
194
+ request('session/set_model', { sessionId: fresh, modelId: options.model }),
195
+ new Promise((done) => setTimeout(done, 3000).unref()),
196
+ ]);
197
+ return fresh;
198
+ };
199
+ let briefed = session.resume !== undefined;
200
+ return {
201
+ turn(prompt, step) {
202
+ onStep = step;
203
+ message = '';
204
+ return new Promise((resolve) => {
205
+ let settled = false;
206
+ finish = (result) => {
207
+ if (settled)
208
+ return;
209
+ settled = true;
210
+ flush();
211
+ finish = undefined;
212
+ resolve(result);
213
+ };
214
+ ready ??= start();
215
+ void ready.then(async (id) => {
216
+ sessionId = id;
217
+ if (id === undefined)
218
+ return finish?.({ text: '', error: `${command[0]}: no ACP session` });
219
+ const text = briefed ? prompt : `${session.brief}\n\n${prompt}`;
220
+ briefed = true;
221
+ const answer = await request('session/prompt', {
222
+ sessionId: id,
223
+ prompt: [{ type: 'text', text }],
224
+ });
225
+ flush();
226
+ if (answer.error !== undefined) {
227
+ const why = answer.error.message ?? 'prompt failed';
228
+ return finish?.({ text: last, error: clip(why, 300) });
229
+ }
230
+ const reason = answer.result?.stopReason;
231
+ finish?.(reason === 'cancelled' ? { text: last, stopped: true } : { text: last });
232
+ });
233
+ });
234
+ },
235
+ id: () => sessionId,
236
+ stop() {
237
+ stopped = true;
238
+ if (sessionId !== undefined)
239
+ send({ method: 'session/cancel', params: { sessionId } });
240
+ setTimeout(() => child.proc.kill('SIGTERM'), 1500).unref();
241
+ },
242
+ close() {
243
+ child.proc.stdin?.end();
244
+ setTimeout(() => child.proc.kill('SIGTERM'), 1500).unref();
245
+ },
246
+ };
247
+ }
248
+ //# sourceMappingURL=acp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp.js","sourceRoot":"","sources":["../../src/agent/acp.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,mGAAmG;AACnG,6FAA6F;AAC7F,6FAA6F;AAC7F,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAEpD,OAAO,EAGL,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,GAAG,GAIJ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAExD,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAe1B,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,IAAY,EAAE,EAAE;IAC3C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/B,OAAO,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;AACnD,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,IAAc,EAAU,EAAE;IAC3C,MAAM,GAAG,GAAG,IAAI,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E,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;oBACxD,CAAC;oBACD,MAAM,MAAM,GAAI,MAAM,CAAC,MAA8C,EAAE,UAAU,CAAA;oBACjF,MAAM,EAAE,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;gBACnF,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,EAAE,EAAE,GAAG,EAAE,CAAC,SAAS;QACnB,IAAI;YACF,OAAO,GAAG,IAAI,CAAA;YACd,IAAI,SAAS,KAAK,SAAS;gBAAE,IAAI,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAA;YACtF,UAAU,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAA;QAC5D,CAAC;QACD,KAAK;YACH,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAA;YACvB,UAAU,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAA;QAC5D,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { type ChildProcess } from 'node:child_process';
2
+ import type { AgentStep, BackendInfo } from '@zvirb/pinup-core';
3
+ export type Step = Omit<AgentStep, 'at'>;
4
+ export interface TurnResult {
5
+ /** The agent's last words: posted as its reply when it didn't answer on the thread itself. */
6
+ text: string;
7
+ /** Set when the turn failed or was stopped. */
8
+ error?: string;
9
+ stopped?: boolean;
10
+ }
11
+ export interface SessionOptions {
12
+ /** Where it works: the project, or the comment's copy of it. */
13
+ cwd: string;
14
+ /** Pinup's instructions: given once per session, as the backend allows. */
15
+ brief: string;
16
+ /** A session id from an earlier turn, to carry on where it left off. */
17
+ resume?: string;
18
+ /** For `pinup reply` inside the agent: the comments file and the name to sign with. */
19
+ env: Record<string, string>;
20
+ /** Folders outside `cwd` it must be able to write: the comments file's, in a copy. */
21
+ writable: string[];
22
+ }
23
+ export interface AgentSession {
24
+ /** One comment's worth of work: streams steps, settles with its answer. Never rejects. */
25
+ turn(prompt: string, onStep: (step: Step) => void): Promise<TurnResult>;
26
+ /** The id to resume this session with, once the CLI has said it. */
27
+ id(): string | undefined;
28
+ /** Stops the turn in progress. The session is over after it. */
29
+ stop(): void;
30
+ /** Ends the session between turns. */
31
+ close(): void;
32
+ }
33
+ export interface AgentBackend {
34
+ name: string;
35
+ /** For people: `Claude`, `Codex · gpt-5.5`. */
36
+ label: string;
37
+ /** What it may do without asking, as the canvas shows it. */
38
+ guard: string;
39
+ /** Which tools to tell it to read and search with: they differ per CLI. */
40
+ tools: string;
41
+ /** Installed, signed in, configured? Cheap: run at startup. */
42
+ check(): Promise<Omit<BackendInfo, 'name' | 'label' | 'guard'>>;
43
+ open(options: SessionOptions): AgentSession;
44
+ }
45
+ /** Pinup's own commands, always allowed. `pinup` is the project's install (on the agent's PATH). */
46
+ export declare const BASE_COMMANDS: string[];
47
+ export declare const allCommands: (commands: string[] | undefined) => string[];
48
+ /** Whether a command line starts with one of the allowed prefixes, as a whole word. */
49
+ export declare function allowedCommand(command: string, allowed: string[]): boolean;
50
+ /** A child process with its stdout as lines and the tail of its stderr kept for errors. */
51
+ export declare function run(command: string[], options: {
52
+ cwd: string;
53
+ env: Record<string, string>;
54
+ stdin: 'pipe' | 'ignore';
55
+ }, onLine: (line: string) => void): {
56
+ proc: ChildProcess;
57
+ stderr: () => string;
58
+ };
59
+ export declare function parseLine(line: string): Record<string, unknown> | undefined;
60
+ /** `<bin> --version`, and the first line it prints. */
61
+ export declare function probeVersion(command: string[]): Promise<{
62
+ ok: boolean;
63
+ version?: string;
64
+ problem?: string;
65
+ }>;
66
+ /** Runs a command and reports whether it exited 0: for `codex login status` and the like. */
67
+ export declare function succeeds(command: string[], cwd?: string): Promise<boolean>;
68
+ /** Settles a turn once, whichever of result, exit or stop comes first. */
69
+ export declare function once(done: (result: TurnResult) => void): (result: TurnResult) => void;
70
+ //# sourceMappingURL=backend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/agent/backend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAA;AAE7D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG/D,MAAM,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;AAExC,MAAM,WAAW,UAAU;IACzB,8FAA8F;IAC9F,IAAI,EAAE,MAAM,CAAA;IACZ,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAA;IACX,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3B,sFAAsF;IACtF,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,0FAA0F;IAC1F,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACvE,oEAAoE;IACpE,EAAE,IAAI,MAAM,GA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OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA6B9D;AAED,6FAA6F;AAC7F,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAkB1E;AAED,0EAA0E;AAC1E,wBAAgB,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAOrF"}
@@ -0,0 +1,112 @@
1
+ // The contract every agent CLI is driven through. The runner (./runner.ts) knows comments, queues
2
+ // and copies of the project; a backend knows one CLI: how to start it, what its events mean, and
3
+ // how to tell it what it may do. Adding a CLI is one file with an `AgentBackend`.
4
+ import { spawn } from 'node:child_process';
5
+ import { createInterface } from 'node:readline';
6
+ import { clip } from "./steps.js";
7
+ /** Pinup's own commands, always allowed. `pinup` is the project's install (on the agent's PATH). */
8
+ export const BASE_COMMANDS = ['pinup', 'git status', 'git diff', 'git log', 'ls'];
9
+ export const allCommands = (commands) => [
10
+ ...new Set([...BASE_COMMANDS, ...(commands ?? [])]),
11
+ ];
12
+ /** Whether a command line starts with one of the allowed prefixes, as a whole word. */
13
+ export function allowedCommand(command, allowed) {
14
+ const line = command.trim();
15
+ if (/[;&|`$<>]|\n/.test(line.replace(/\s2>&1$/, '')))
16
+ return false;
17
+ return allowed.some((prefix) => line === prefix || line.startsWith(`${prefix} `));
18
+ }
19
+ /** A child process with its stdout as lines and the tail of its stderr kept for errors. */
20
+ export function run(command, options, onLine) {
21
+ const [bin = '', ...args] = command;
22
+ const env = { ...process.env, ...options.env };
23
+ // Started from inside an agent's own shell, a child would think it is nested.
24
+ delete env['CLAUDECODE'];
25
+ const proc = spawn(bin, args, {
26
+ cwd: options.cwd,
27
+ env,
28
+ stdio: [options.stdin, 'pipe', 'pipe'],
29
+ });
30
+ const tail = [];
31
+ proc.stderr?.on('data', (chunk) => {
32
+ tail.push(chunk.toString('utf8'));
33
+ if (tail.length > 20)
34
+ tail.shift();
35
+ });
36
+ if (proc.stdout !== null)
37
+ createInterface({ input: proc.stdout }).on('line', onLine);
38
+ return { proc, stderr: () => clip(tail.join(''), 300) };
39
+ }
40
+ export function parseLine(line) {
41
+ try {
42
+ const value = JSON.parse(line);
43
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
44
+ ? value
45
+ : undefined;
46
+ }
47
+ catch {
48
+ return undefined;
49
+ }
50
+ }
51
+ /** `<bin> --version`, and the first line it prints. */
52
+ export function probeVersion(command) {
53
+ const [bin = ''] = command;
54
+ return new Promise((done) => {
55
+ let out = '';
56
+ let proc;
57
+ try {
58
+ proc = spawn(bin, ['--version'], { stdio: ['ignore', 'pipe', 'ignore'] });
59
+ }
60
+ catch (error) {
61
+ done({ ok: false, problem: `${bin}: ${error.message}` });
62
+ return;
63
+ }
64
+ const timer = setTimeout(() => proc.kill('SIGKILL'), 5000);
65
+ proc.stdout?.on('data', (chunk) => {
66
+ out += chunk.toString('utf8');
67
+ });
68
+ proc.on('error', () => {
69
+ clearTimeout(timer);
70
+ done({ ok: false, problem: `${bin} is not installed (or not on PATH)` });
71
+ });
72
+ proc.on('exit', (code) => {
73
+ clearTimeout(timer);
74
+ const version = out.trim().split('\n')[0];
75
+ done(code === 0
76
+ ? { ok: true, ...(version ? { version } : {}) }
77
+ : { ok: false, problem: `${bin} --version exited ${code}` });
78
+ });
79
+ });
80
+ }
81
+ /** Runs a command and reports whether it exited 0: for `codex login status` and the like. */
82
+ export function succeeds(command, cwd) {
83
+ const [bin = '', ...args] = command;
84
+ return new Promise((done) => {
85
+ try {
86
+ const proc = spawn(bin, args, { cwd, stdio: 'ignore' });
87
+ const timer = setTimeout(() => proc.kill('SIGKILL'), 5000);
88
+ proc.on('error', () => {
89
+ clearTimeout(timer);
90
+ done(false);
91
+ });
92
+ proc.on('exit', (code) => {
93
+ clearTimeout(timer);
94
+ done(code === 0);
95
+ });
96
+ }
97
+ catch {
98
+ done(false);
99
+ }
100
+ });
101
+ }
102
+ /** Settles a turn once, whichever of result, exit or stop comes first. */
103
+ export function once(done) {
104
+ let settled = false;
105
+ return (result) => {
106
+ if (settled)
107
+ return;
108
+ settled = true;
109
+ done(result);
110
+ };
111
+ }
112
+ //# sourceMappingURL=backend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend.js","sourceRoot":"","sources":["../../src/agent/backend.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,iGAAiG;AACjG,kFAAkF;AAClF,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAiDjC,oGAAoG;AACpG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;AAEjF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAA8B,EAAY,EAAE,CAAC;IACvE,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,aAAa,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;CACpD,CAAA;AAED,uFAAuF;AACvF,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,OAAiB;IAC/D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAA;IAC3B,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAClE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,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,IAAI,CAAC,KAAK,CAAC,CAAA;YACb,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACvB,YAAY,CAAC,KAAK,CAAC,CAAA;gBACnB,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAA;YAClB,CAAC,CAAC,CAAA;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC,KAAK,CAAC,CAAA;QACb,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,IAAI,CAAC,IAAkC;IACrD,IAAI,OAAO,GAAG,KAAK,CAAA;IACnB,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,IAAI,OAAO;YAAE,OAAM;QACnB,OAAO,GAAG,IAAI,CAAA;QACd,IAAI,CAAC,MAAM,CAAC,CAAA;IACd,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type DesignComment } from '@zvirb/pinup-core';
2
+ export declare function brief(options: {
3
+ tools: string;
4
+ commands: string[];
5
+ /** Working in a copy of the project made for one comment (worktree isolation). */
6
+ copy?: {
7
+ dir: string;
8
+ };
9
+ }): string;
10
+ /** One comment's message: new, a reply, or a change that no longer applies cleanly. */
11
+ export declare function prompt(comment: DesignComment, seen: number, note?: string): string;
12
+ //# sourceMappingURL=brief.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief.d.ts","sourceRoot":"","sources":["../../src/agent/brief.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAY,MAAM,mBAAmB,CAAA;AAEhE,wBAAgB,KAAK,CAAC,OAAO,EAAE;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,kFAAkF;IAClF,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACvB,GAAG,MAAM,CAgBT;AAED,uFAAuF;AACvF,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAclF"}
@@ -0,0 +1,35 @@
1
+ // What every canvas agent is told, once per session, and what it gets per comment. The rules are
2
+ // the same for every CLI; only the tool hint and the commands differ.
3
+ import { describe } from '@zvirb/pinup-core';
4
+ export function brief(options) {
5
+ const where = options.copy === undefined
6
+ ? 'The reviewer is watching the canvas while you work: every file you save hot-reloads there.'
7
+ : `You work in a copy of the project made for this comment (${options.copy.dir}). The reviewer sees your change on the canvas as a proposal next to the current design, and copies it into the project with Approve. Only edit files in this folder.`;
8
+ return `You are a canvas agent for this Pinup project. A design reviewer pins comments to artboards on the Pinup canvas, and you get them one at a time. ${where}
9
+
10
+ For each comment:
11
+ - Find the code: the comment names its board file and the data-ui chain down to the element. The project's AGENTS.md (or CLAUDE.md) says where things live and what the design rules are: read it once, before the first change.
12
+ - Make the smallest change that answers the comment, inside the UI packages, keeping to those rules.
13
+ - Run the project's checks (AGENTS.md says which; else \`pinup check\`) and fix what fails.
14
+ - Then answer on the thread: \`pinup reply <id> "what you changed and why, in a sentence or two"\`.
15
+
16
+ ${options.tools} Commands you may run: ${options.commands.map((c) => `\`${c}\``).join(', ')}. You are already in the working folder, so never \`cd\`. \`pinup\` is the project's own CLI, already on your PATH: never run it through npx, which would fetch an unrelated package of the same name.
17
+
18
+ Never run \`pinup resolve\`: the reviewer approves your change on the canvas. If a comment is unclear, or asks a question rather than for a change, answer it with \`pinup reply\` and change nothing. Never commit, push or install packages.`;
19
+ }
20
+ /** One comment's message: new, a reply, or a change that no longer applies cleanly. */
21
+ export function prompt(comment, seen, note) {
22
+ const lead = note !== undefined
23
+ ? `Approving your change to ${comment.id} failed. ${note}`
24
+ : seen > 0
25
+ ? `The reviewer replied on ${comment.id}. Their latest message is the last line below.`
26
+ : `New comment ${comment.id}.`;
27
+ return [
28
+ lead,
29
+ '',
30
+ describe(comment),
31
+ '',
32
+ `Answer it, then \`pinup reply ${comment.id} "…"\`. Don't resolve it.`,
33
+ ].join('\n');
34
+ }
35
+ //# sourceMappingURL=brief.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief.js","sourceRoot":"","sources":["../../src/agent/brief.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,sEAAsE;AACtE,OAAO,EAAsB,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEhE,MAAM,UAAU,KAAK,CAAC,OAKrB;IACC,MAAM,KAAK,GACT,OAAO,CAAC,IAAI,KAAK,SAAS;QACxB,CAAC,CAAC,4FAA4F;QAC9F,CAAC,CAAC,4DAA4D,OAAO,CAAC,IAAI,CAAC,GAAG,uKAAuK,CAAA;IACzP,OAAO,oJAAoJ,KAAK;;;;;;;;EAQhK,OAAO,CAAC,KAAK,0BAA0B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;+OAEoJ,CAAA;AAC/O,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,MAAM,CAAC,OAAsB,EAAE,IAAY,EAAE,IAAa;IACxE,MAAM,IAAI,GACR,IAAI,KAAK,SAAS;QAChB,CAAC,CAAC,4BAA4B,OAAO,CAAC,EAAE,YAAY,IAAI,EAAE;QAC1D,CAAC,CAAC,IAAI,GAAG,CAAC;YACR,CAAC,CAAC,2BAA2B,OAAO,CAAC,EAAE,gDAAgD;YACvF,CAAC,CAAC,eAAe,OAAO,CAAC,EAAE,GAAG,CAAA;IACpC,OAAO;QACL,IAAI;QACJ,EAAE;QACF,QAAQ,CAAC,OAAO,CAAC;QACjB,EAAE;QACF,iCAAiC,OAAO,CAAC,EAAE,2BAA2B;KACvE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { BackendOptions } from '@zvirb/pinup-core';
2
+ import { type AgentBackend, type SessionOptions } from './backend.ts';
3
+ export declare function claudeAllow(commands: string[], options: BackendOptions): string[];
4
+ export declare function claudeCommand(options: BackendOptions, commands: string[], session: Pick<SessionOptions, 'brief' | 'resume' | 'writable'>): string[];
5
+ export declare function claude(options: BackendOptions, commands: string[] | undefined): AgentBackend;
6
+ //# sourceMappingURL=claude.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/agent/claude.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EACL,KAAK,YAAY,EAOjB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAA;AAKrB,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,EAAE,CAEjF;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC,GAC7D,MAAM,EAAE,CAsBV;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,YAAY,CAW5F"}