ai-agentmanager 1.62.0 → 1.64.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/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.64.0 (2026-11-22)
4
+
5
+ - **Proof: what the agent ran, kept so you can check it.** Next to its brief each agent keeps `PROOF.md`: for every check it ticked and every agreed point of what done means, the exact command, its exit code and the last lines of real output. The agent's Results show a **Proof** row; **Open** lists each check with its command and output. `agentmgr proof <agent>` prints it.
6
+ - **Run it again.** **Run these again here**, or `agentmgr proof <agent> --run`, runs the recorded commands in the agent's folder and marks each "Same result" or "Different result" by its exit code (the command exits with 1 when one differs). Only you can ask for it; an agent's own call is refused. A command that changes things (deleting, committing, pushing, installing, publishing, deploying, reaching the network, writing to a file) is not run and is listed with the reason.
7
+ - **Not done: what the agent left out.** Under Results the agent lists what the request asked or implied that it skipped, stubbed, left untested or only assumed, or says there is nothing. It is shown above what was delivered.
8
+ - **Reviews use it.** The scorecard and the review when an agent finishes are given the proof and what the app saw when it ran the commands again. A command that gave a different result caps the tests score at 40. A merge without you (Run to merge, autopilot) is left to you when something is listed as not done or a recorded command gave a different result.
9
+ - **Limits.** The record is the agent's own until you run it again. Running again uses your rights on your computer, without the agent's permission prompts; the list of what is not run is a filter on the command's text, not a sandbox. `"proof": false` in config.json turns the instructions off.
10
+
11
+ Found by running real agents at "Agree, then run":
12
+
13
+ - **A message sent while the agent shows a question menu is no longer lost.** Claude Code's current question menu was not recognised as a prompt, so text sent to the agent (your agreement on what done means, an answer, a nudge) was typed into the menu and Enter picked its highlighted option. The menu now counts as **Needs input**: the inbox shows the question with its options as buttons, and messages wait until it is answered.
14
+ - **Without you: a menu question is answered by picking an option.** For an agent that runs without you, the option is chosen from what is already decided and picked with its key. A menu where several can be ticked, or where no option is right, is left for you.
15
+ - **Without you: a permission prompt is never sent to a model.** When the screen reader took a permission prompt for a question, the answering model was asked about it (it left it for you, but that was its judgment). The app now recognises these itself and leaves them for you without asking.
16
+ - **Without you: nothing is answered while your agreement is pending.** While what done means or a plan waited for you, the agent's "do these look right?" was looked at by a model twice and listed as "left for you". It is now skipped.
17
+ - **Without you: permission prompts still stop it, and the app says so.** New agent shows a hint with **Use Auto** when a level past "Ask me" is chosen in a mode that asks for each command; the agent's "Without you" dialog and `agentmgr add --autonomy` say the same.
18
+ - **`agentmgr restart` with a second daemon.** For a daemon on another home or port than the login service's (a trial, a test), restart asked the login service to start it and then reported "Daemon did not come back". It now starts that daemon itself.
19
+ - **`agentmgr inbox`** labels answers given for you as "done for you" with the answer and the commands to accept or change it (it printed "undefined"), and shows a menu's question instead of the word "Question".
20
+ - **Open Terminal on a phone: a swipe scrolls.** The terminal on this computer (Open Terminal) and the terminals in groups did not move under a finger, so what had scrolled off could not be read from a phone or tablet. They now scroll like an agent's terminal: a swipe moves through what was printed, a flick keeps going, and in a full-screen program the swipe scrolls the program.
21
+
22
+ ## 1.63.0 (2026-11-21)
23
+
24
+ - **Acceptance: agree on what done means.** Tick **Agree on what done means first** in New agent or the backlog (or `agentmgr add --acceptance`). The agent reads the code, writes three to six points you could check, and stops before changing anything. The points wait in the inbox as **Done means**, with a notification.
25
+ - **You change them and agree.** **Change points** opens the list to reword, remove or add your own, sized for a phone; **Agree as written** takes the agent's list; **Skip** stops waiting. After that the points are kept by the app, not in a file the agent can edit, and the agent's own calls to agree or skip are refused. The agent is told them word for word, and the agreement goes into the decision log.
26
+ - **Each point is checked.** The review scorecard now reports every agreed point as Met, Not met or Not verified with the evidence, in your wording and order. A point the model skips counts as not verified. One point not met makes the work "Not ready". The agent's Brief panel shows the count, for example "2 of 3 met, 1 not met".
27
+ - **Also without asking first.** Any agent with a spec has **What done means** in its Brief panel, with the points it wrote for itself. You can change and agree on them at any time; a running agent is told, and work already scored is scored again (for a running agent, when it next says it is done).
28
+ - **From a terminal:** `agentmgr acceptance <agent>` with `--agree`, `--set n=text`, `--remove n`, `--add text`, `--check`, `--skip` and `--json`. It exits with 1 when an agreed point is not met. `"acceptance": true` in config.json asks for it on every new agent.
29
+ - **Limits.** The verdict on each point is a model's reading of the changes, not a test the app ran. The agent waiting is an instruction it follows, as with plan review, not a lock on the repository.
30
+ - **Without you: how far an agent goes on its own.** Each agent has a level: **Ask me** (the default, nothing changes), **Agree, then run**, **Run to pull request**, **Run to merge**. Choose it in New agent, on a running agent's Brief panel, with `agentmgr add --autonomy <level>`, or as the default in Settings. Past "Ask me", what done means is agreed first.
31
+ - **What is handled for you.** A question the agent asks without stopping, or a plan waiting for review, is decided by Decide at its "Most things; ask when unsure" level whatever the project's level is. A question it stopped on in its terminal is answered from what is already decided (your request, the agreed points, your ground rules, the repository's lessons, your earlier answers). A stuck agent gets the judge's nudge, and a quiet one is told to carry on. At "Run to merge" the pull request is merged when checks pass, the review rounds approved, the scorecard says ready, no high-risk path is touched and the agent's own confidence is not low; otherwise it is held and the inbox says why.
32
+ - **You see all of it.** Each answer given for you is in the inbox as **Done for you**, with what it was based on: **OK**, or **Change answer…** to give your own. The agent's **Without you** dialog and `agentmgr autonomy <agent>` list everything answered, sent, merged or left for you.
33
+ - **Never done for you:** answering a permission prompt, or a question about deleting, rewriting history, publishing or merging, credentials, money, personal data, messages to others or the scope of the task. An agent cannot set its own level.
34
+ - **Models in order.** What is decided in your place runs on `fable`, then `opus`, then `sonnet`: the next one is used when a call fails. Change the list in Settings or with `agentmgr autonomy --models`.
35
+ - **Ground rules.** **Settings → Ground rules** (or `agentmgr ground-rules`): your own rules for every agent in every repository, one per line, given with each agent's instructions next to the repository's memory. Only you set them. **Also tell the agents running now** sends a change to open sessions.
36
+ - **Confidence.** Every agent now states its own confidence in what it built (`Confidence: 85% - why`) in its Results, shown in the Brief panel beside the scorecard. Under 70%, "Run to merge" and autopilot's Merge level leave the merge to you.
37
+ - **Drop to start.** Drag tickets, requirements, designs and files onto the page: New agents opens filled in. Issue links become the request, document and design links its context, a repository link the repository, files the attachments. The form has a drop box that says what was added, with **Paste what you copied** and **Choose files** for a phone.
38
+ - **Changed for everyone:** agents are now asked for a confidence line in their brief. Decide's recommendations are given the agreed points, your ground rules and the repository's lessons.
39
+ - **Fixed:** on a narrow phone the buttons at the bottom of New agents no longer push the form wider than the screen.
40
+ - **Limits.** An answer given for you is a model's reading of what you decided before, and can be wrong. Autonomy needs the AI judge and Decide on, and does not change the permission mode. Ground rules and the confidence line are instructions and the agent's own statement, not checks. A phone has no drag and drop; use paste or the file picker there.
41
+ - **Tried:** unit, end-to-end and browser tests with stand-in models, and the views at phone width in desktop Chrome. The prompt that answers for you was tried on the real `fable` model with three made-up questions (a routine detail, one decided by an agreed point, one that changes the database): it answered the first two and left the third for the person. Not yet with a real agent or on a phone.
42
+
3
43
  ## 1.62.0 (2026-11-19)
4
44
 
5
45
  - **Claims check: what the documents say, against the work.** A new document on every agent, **Claims** (or `agentmgr claims <agent>`), checks the statements of fact in the agent's brief and in what was written about its work (the update for the people who asked, Explanation, Insights, Analysis, Documentation) and shows each with what backs it: Contradicted, Not backed, Only the agent says so, Backed.
package/README.md CHANGED
@@ -76,6 +76,7 @@ Run one background [Claude Code](https://claude.com/claude-code) agent per inten
76
76
  - **As an app.** In Chrome or Edge, click the install icon in the address bar (or ⋮ → Cast, save and share → Install page as app). AI Agent Manager then opens in its own window with its own Dock or taskbar icon, and the daemon keeps running as before.
77
77
  - **About.** The version next to the title opens the About box: release date, author, license, links, and how this daemon runs (data folder, port, Node.js, which `claude`). **Check for updates** asks npm for the newest version. In a terminal: `agentmgr about` (`--check` for updates).
78
78
  - **General sessions.** **Ask Agent** starts a session with no repo, folder or intent, for questions, on Claude Code or any other engine you have (Codex, Antigravity, Muse Code). It is tracked and resumable like any other agent.
79
+ - **Drop to start.** Drag tickets, requirements and designs onto the page: a frame says **Drop to start a new agent**, and New agents opens filled in. A Jira, GitHub or Linear issue link becomes the request (the agent is named after the issue and tracks it); a link to a document (Google Docs, Confluence, Notion, a PDF) is listed under it as **Requirements** and a design link (Figma, Miro, an image) as **Design**; a repository link fills the repository; text becomes the request; files are attached. Several tickets give one agent each. The box at the top of the form takes the same drops and says what was added; nothing starts until you press the button. Without a mouse, **Paste what you copied** reads links from the clipboard and **Choose files** opens the picker.
79
80
  - **Attachments.** **📎 Attach files** in New agents and Ask Agent (or drop files on the dialog, or paste a screenshot into the text box) adds a screenshot, a log or a document to the request. Each agent gets its own copy in `~/.agentmanager/uploads/<agent>/`, listed in its request, and Claude Code and Codex can read that folder without asking. From the CLI: `agentmgr add … --file-attach error.log` and `agentmgr ask … --file-attach shot.png`.
80
81
 
81
82
  New in 0.2, for running many agents at once:
@@ -441,6 +442,114 @@ Tick **Review the implementation plan first** in New agent (or the backlog), or
441
442
  - **After approval**, edits to the plan count as progress updates and don't ask again. A restarted agent is told its plan was approved.
442
443
  - **Default.** Set `"planReview": true` in config.json to turn it on for every new agent.
443
444
 
445
+ ## Acceptance: agree on what done means
446
+
447
+ An agent can finish a correct change to the wrong target. Acceptance settles the target first: a short list of points you would check when the work is done, agreed between you and the agent, and then checked one by one.
448
+
449
+ - **Ask for it.** Tick **Agree on what done means first** in New agent (or the backlog), or start with `agentmgr add --acceptance`. The agent reads the code, writes three to six points under "Acceptance criteria" in its `SPEC.md`, and stops. It changes nothing in the repository until you agree.
450
+ - **Where it shows.** In the inbox as **Done means**, with the points, a notification, and a row in the agent's Brief panel.
451
+ - **Change points** opens them to reword, remove or add your own. **Agree and start** sends the agent ahead with the list as you left it; **Agree as written** takes the agent's list. **Skip** stops waiting and keeps nothing.
452
+ - **From then on the points are yours.** They are kept by the app, not in a file the agent can edit, and an agent's own calls to agree or skip are refused. The agent is told them word for word, a restarted agent is told them again, and the agreement is in the decision log (Plan, Decisions).
453
+ - **Checked one by one.** The [review scorecard](#review-changes) reports each agreed point as **Met**, **Not met** or **Not verified**, with the evidence, in your wording and your order. A point the model does not answer counts as not verified. One point not met makes the work **Not ready**, so autopilot sends it back and does not ship it.
454
+ - **Without asking first.** Every agent with a spec has **What done means** in its Brief panel: the points it wrote for itself. Change them and agree at any time, also after the work is done; a running agent is told to check its work against them, and work already scored is scored again (for a running agent, when it next says it is done).
455
+ - **With plan review.** The points come first, then the plan.
456
+ - **Default.** Set `"acceptance": true` in config.json to ask for it on every new agent.
457
+
458
+ ```bash
459
+ agentmgr add "Add a CSV export" --repo <url> --acceptance
460
+ agentmgr acceptance add-a-csv-export # the points, and what was found for each
461
+ agentmgr acceptance add-a-csv-export --agree # as the agent wrote them
462
+ agentmgr acceptance add-a-csv-export --set "2=The first row is the header" --remove 3 --add "Dates are ISO 8601"
463
+ agentmgr acceptance add-a-csv-export --check # score the work against them now
464
+ agentmgr acceptance add-a-csv-export --skip
465
+ ```
466
+
467
+ Changing points with `--set`, `--remove` or `--add` agrees on the result. The command exits with 1 when an agreed point is not met.
468
+
469
+ **Limits.** Met, not met and not verified are a model's reading of the changes, not a test run by the app; the evidence it names is there to check. The agent waiting is an instruction it follows, as with plan review, not a lock on the repository. At most 12 points of 300 characters.
470
+
471
+ ## Without you: how far an agent goes on its own
472
+
473
+ Each agent has a level for how far it goes before it needs you. Choose it in New agent (**Without you**), on a running agent (**Run without me…** in its Brief panel), with `agentmgr add --autonomy <level>`, or set the default for new agents in Settings.
474
+
475
+ | Level | What happens without you |
476
+ | --- | --- |
477
+ | **Ask me** (`ask`, the default) | Nothing: questions, stuck findings and follow-ups wait in the inbox, as before. |
478
+ | **Agree, then run** (`run`) | You [agree on what done means](#acceptance-agree-on-what-done-means) first. After that the middle is handled for you (below). |
479
+ | **Run to pull request** (`pr`) | The same, and its pull request is opened when the [review rounds](#review-rounds-before-a-pull-request) approve the work, also when "Open the pull request when the critics approve" is turned off. Review rounds themselves have to be on (the default). |
480
+ | **Run to merge** (`merge`) | The same, and the pull request is merged when its checks pass and everything else says ready (below). |
481
+
482
+ **What is handled for you, from "Agree, then run" up:**
483
+
484
+ - **A question it asks without stopping, or a plan waiting for review**, is decided by [Decide](#decide) at its "Most things; ask when unsure" level, whatever the project's own level is: carried out when the recommendation is at least 70% sure and easy to undo. Its recommendation now also knows the agreed points, your ground rules and the repository's lessons.
485
+ - **A question it stopped on in its terminal** (read from its screen by the AI judge) is answered from what is already decided: your request, the agreed points, your ground rules, the repository's lessons and your earlier answers, or the agent's own default when it is a routine detail that is cheap to change. The agent is told the answer came from the app while you were away, and to note it as an assumption.
486
+ - **A question it shows as a menu** (Claude Code's own question menu) is answered the same way, by picking one of its options with its key. A menu where several options can be ticked, and one where none of the options is right, is left for you.
487
+ - **A stuck agent** gets the judge's nudge when the judge is at least 70% sure, three times at most.
488
+ - **A quiet, unfinished agent** is told to carry on, twice at most, unless it is blocked on you.
489
+ - **At "Run to merge"**, its pull request is merged when the checks pass, the review rounds (when they ran) approved it, the scorecard says "Ready to approve", no high-risk path is touched, and the agent's own confidence is not low. Otherwise it is held, and the inbox says why. (A backlog item is shipped by [autopilot](#autopilot) at the item's level.)
490
+
491
+ **You see all of it.** An answer given for you is in the inbox as **Done for you**, with the question, the answer, what it was based on and how sure the model was: **OK**, or **Change answer…** to give your own, which the agent is told to apply. The agent's **Without you** dialog lists everything that was answered, sent, decided, merged or left for you, and `agentmgr autonomy <agent>` prints it.
492
+
493
+ **Never done for you:**
494
+
495
+ - A permission prompt is never answered by a model (your [approval rules](#decision-inbox) still apply). This is checked by the app, not left to the model: a prompt the screen reader took for a question is left for you without asking one.
496
+ - While what done means, or a plan, waits for your agreement, nothing is answered or nudged for you.
497
+ - A choice your request says to ask you about: the answering model is told to leave it for you (in the trial it did, each time).
498
+ - A question about deleting or overwriting, rewriting history, publishing, deploying or merging, credentials, money or licences, personal data, messages to other people, or the scope of the task is left for you whatever a model would say.
499
+ - An agent cannot set or raise its own level, and cannot change your ground rules: its own calls are refused.
500
+
501
+ **The models.** What is decided in your place runs on a list of models, best first: `fable`, then `opus`, then `sonnet`. The first one answers; when a call on it fails (the model is not on your plan, a limit, a timeout), the next one is used, and the one that failed is skipped for 15 minutes. Change the list in Settings or with `agentmgr autonomy --models opus,sonnet`. The AI judge's other calls (reading a screen, alerts) stay on its own fast model.
502
+
503
+ ```bash
504
+ agentmgr add "Add a CSV export" --repo <url> --autonomy pr
505
+ agentmgr autonomy # the default level, the models, today's calls
506
+ agentmgr autonomy --default run --models fable,opus,sonnet
507
+ agentmgr autonomy add-a-csv-export # its level and what was done for you
508
+ agentmgr autonomy add-a-csv-export merge # set its level
509
+ agentmgr autonomy add-a-csv-export --change 3fa2c1d0="Use Postgres"
510
+ ```
511
+
512
+ In config.json: `"autonomy": { "level": "ask", "models": ["fable", "opus", "sonnet"], "answers": true, "nudges": true, "followUps": true, "minConfidence": 0.7, "minBuildConfidence": 70, "maxAnswers": 12, "maxNudges": 3, "maxFollowUps": 2, "dailyCalls": 80 }`.
513
+
514
+ **Limits.** It needs the AI judge on (it reads the screen and finds stuck agents) and Decide on (for questions and plans). An answer is a model's reading of what you decided before, and can be wrong: that is why each one is shown to you. The level does not change the permission mode, so in the default mode an agent stops at each permission prompt (running a command, reading outside the project) and waits for you. New agent says so and offers Permission mode **Auto**, where Claude Code approves what it judges safe; `agentmgr add --autonomy run -p auto` does the same. Each answer, nudge and judgment is a model call on your own plan.
515
+
516
+ ## Ground rules: your own rules for every agent
517
+
518
+ **Settings → Ground rules** (or `agentmgr ground-rules`) holds your own rules for how agents work: one per line, for every agent, in every repository and on every engine. "Ask before adding a dependency." "Never force-push or rewrite history." "Say what you did not do."
519
+
520
+ - **Next to memory, not instead of it.** [Repo memory](#repo-memory) is what agents learned in one repository, and [Standards](#standards-what-every-change-in-a-repository-has-to-meet) are lessons per repository. Ground rules are yours and apply everywhere; agents are told they come before what the memory suggests.
521
+ - **How agents get them.** With their instructions at every start. They are told to stop and say which rule is in the way when a task cannot be done without breaking one. Tick **Also tell the agents running now** (or `--tell`) to send a change to the sessions that are open.
522
+ - **Only you set them.** An agent's own calls to change them are refused. They are in `~/.agentmanager/ground-rules.md`, which you can also edit by hand.
523
+ - **Used when deciding for you.** Answers given for an agent that runs [without you](#without-you-how-far-an-agent-goes-on-its-own), and Decide's recommendations for it, are given the rules.
524
+
525
+ ```bash
526
+ agentmgr ground-rules # show them
527
+ agentmgr ground-rules --add "Ask before adding a dependency" --tell
528
+ agentmgr ground-rules --remove 2
529
+ ```
530
+
531
+ At most 40 rules of 400 characters. A rule is an instruction the agent follows, not a lock: the review scorecard does not check ground rules (it checks a repository's lessons).
532
+
533
+ ## Confidence: how sure the agent is of what it built
534
+
535
+ Every agent now ends its Results with its own confidence: `Confidence: 85% - what it verified, and the one thing it is least sure about`. It is asked to count only what it ran and saw working, and to lower the number for anything it did not do. The Brief panel shows it beside the results (high from 85%, medium from 65%, low under that), next to the review scorecard, which is the separate check by another model. At "Run to merge" and on autopilot's Merge level, work whose agent is under 70% sure of it is not merged without you.
536
+
537
+ The number is the agent's own statement, not a measurement.
538
+
539
+ ## Proof: what it ran, and what it did not do
540
+
541
+ "All checks pass" in a brief is the agent's word. With proof, you can check it.
542
+
543
+ - **What it ran.** Next to its brief the agent keeps `PROOF.md`: for each check it ticked, and each agreed point of [what done means](#acceptance-agree-on-what-done-means), the exact command, its exit code and the last lines of real output. A check it made by reading says so.
544
+ - **What it did not do.** Under Results the agent lists each thing the request asked or implied that it skipped, stubbed, left untested or only assumed, as **Not done**, or says there is nothing. A finished agent that has not said is shown as such.
545
+ - **Where you see it.** The agent's Results show **Not done** and a **Proof** row ("3 recorded runs, 1 by reading"). **Open** lists each check with its command and output. `agentmgr proof <agent>` prints the same.
546
+ - **Run it again.** **Run these again here** (or `agentmgr proof <agent> --run`) runs the recorded commands in the agent's folder, one after the other, and marks each **Same result** or **Different result** by its exit code. The command exits with 1 when one differs. If the agent changes its proof afterwards, the earlier run no longer counts.
547
+ - **What it feeds.** The review scorecard and the review when an agent finishes are given the proof as the agent's own record, and what the app saw when it ran the commands. A command that gave a different result caps the scorecard's tests score at 40. At "Run to merge" and on autopilot, a merge is left to you when the agent lists something as not done, or a recorded command gave a different result.
548
+
549
+ **What is not run again:** a command that changes things: deleting or moving files, committing or pushing, installing or publishing, deploying, reaching the network, writing to a file, or running as administrator. It is listed as "Not run again" with the reason. At most 12 commands are run, each for two minutes at most.
550
+
551
+ **Limits.** The record is written by the agent: until you run the commands again, it is still its word, now in a form you can check. Running them again happens on your computer with your rights and without the agent's permission prompts, which is why only you can ask for it (an agent's own call is refused) and why the commands are shown first; the list of what is not run is a filter on the command's text, not a sandbox, so read the commands. The same exit code does not prove the same output (durations and dates differ between runs; the page says when the last recorded line was not printed). An agent in a container cannot be run again from here. `"proof": false` in `config.json` stops asking agents for it.
552
+
444
553
  ## Insights
445
554
 
446
555
  **Insights** in the Brief panel, or `agentmgr insights <agent>`, shows the agent's work as four cards built from its ask and live context:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agentmanager",
3
- "version": "1.62.0",
3
+ "version": "1.64.0",
4
4
  "description": "Run background coding agents (Claude Code, Codex) per intent, and keep track of them from a web UI, your phone or the CLI",
5
5
  "keywords": [
6
6
  "claude",
@@ -0,0 +1,194 @@
1
+ // Acceptance on the page: what "done" means for an agent, as points. The agent drafts them; here
2
+ // you reword, remove or add points and agree; after that each point shows what the review
3
+ // scorecard found (met, not met, not verified) with its evidence.
4
+
5
+ const LABEL = { met: 'Met', not_met: 'Not met', unverified: 'Not verified', unchecked: 'Not checked yet' };
6
+ const ROW_LABEL = { writing: 'being written', review: 'waiting for you', agreed: 'agreed' };
7
+ const MAX_POINTS = 12;
8
+
9
+ /** Whether the agent is stopped until its points are agreed. */
10
+ export const acceptanceWaits = (a) => Boolean(a.acceptance?.wait) && a.acceptance.status === 'review';
11
+
12
+ /** "3 of 5 met, 1 not met", from the scorecard the agent has (null when it was scored against other points). */
13
+ export function acceptanceSummary(a) {
14
+ const acc = a.acceptance;
15
+ if (acc?.status !== 'agreed') return null;
16
+ const sc = a.docs?.scorecard;
17
+ if (!sc?.data || sc.acceptanceAt !== acc.agreedAt) return { text: `${acc.points.length} point${acc.points.length === 1 ? '' : 's'}, not checked yet`, notMet: 0, checked: false };
18
+ const st = (s) => sc.data.criteria.filter((c) => c.status === s).length;
19
+ const notMet = st('not_met');
20
+ const unverified = st('unverified');
21
+ return { text: [`${st('met')} of ${acc.points.length} met`, notMet ? `${notMet} not met` : '', unverified ? `${unverified} not verified` : ''].filter(Boolean).join(', '), notMet, checked: true };
22
+ }
23
+
24
+ /** The row in the brief card: where the points stand, and the way in. */
25
+ export function acceptanceRow(a, esc) {
26
+ const acc = a.acceptance;
27
+ if (!acc) {
28
+ // Not asked for: offered once the agent has a spec to take the points from.
29
+ return a.specDocs?.spec ? `<div class="plan-row"><button class="small ghost" data-act="accept-open" title="The points the agent wrote for what done means: change them and agree, and its work is checked against them">What done means</button></div>` : '';
30
+ }
31
+ const sum = acceptanceSummary(a);
32
+ const waiting = acc.wait && acc.status !== 'agreed';
33
+ return `<div class="plan-row acc-row ${acc.status}"><b>Done means</b> <span class="tag acc-${acc.status}${sum?.notMet ? ' acc-bad' : ''}">${esc(sum?.text ?? ROW_LABEL[acc.status])}</span>
34
+ <button class="small ${acc.status === 'review' ? 'primary' : ''}" data-act="accept-open" ${acc.status === 'writing' ? 'disabled' : ''}>${acc.status === 'review' ? 'Review points' : 'Open'}</button>
35
+ ${waiting ? '<button class="small ghost" data-act="accept-skip" title="Stop waiting; the agent goes ahead with the criteria in its own spec">Skip</button>' : ''}</div>`;
36
+ }
37
+
38
+ export function initAcceptance({ dialog, api, esc, toast, ago, agentOf, upsert }) {
39
+ // view: what the server says; edit: the texts being edited (null when only showing results).
40
+ let st = null;
41
+
42
+ const editing = () => Boolean(st?.edit);
43
+
44
+ function render() {
45
+ if (!st) return;
46
+ const { view: v } = st;
47
+ const a = agentOf(st.id);
48
+ dialog.querySelector('#acc-title').textContent = `What done means: ${a?.name ?? v?.name ?? ''}`;
49
+ const body = dialog.querySelector('#acc-body');
50
+ const actions = dialog.querySelector('#acc-actions');
51
+ if (!v) {
52
+ body.innerHTML = `<p class="hint">${st.error ? esc(st.error) : 'Loading…'}</p>`;
53
+ actions.innerHTML = '<button type="button" class="small" data-acc="close">Close</button>';
54
+ return;
55
+ }
56
+ if (st.edit) {
57
+ const lead =
58
+ v.status === 'agreed'
59
+ ? 'Change the points. The agent is told, and its work is checked against the new ones.'
60
+ : v.wait
61
+ ? 'The agent wrote these and changes nothing until you agree. Reword, remove or add points: they should be things you would check.'
62
+ : st.edit.length
63
+ ? 'The agent wrote these in its spec. Reword, remove or add points and agree: from then on they are yours, and its work is checked against them.'
64
+ : 'The agent has written no points. Add your own: each one a thing you would check when the work is done.';
65
+ body.innerHTML = `<p class="hint">${lead}</p>
66
+ <ol class="acc-edit">${st.edit
67
+ .map((t, i) => `<li><textarea data-acc-point="${i}" rows="2" maxlength="300" aria-label="Point ${i + 1}">${esc(t)}</textarea><button type="button" class="link" data-acc-remove="${i}" title="Take this point out" aria-label="Remove point ${i + 1}">×</button></li>`)
68
+ .join('')}</ol>
69
+ <button type="button" class="small" data-acc="add" ${st.edit.length >= MAX_POINTS ? 'disabled' : ''}>+ Add a point</button>`;
70
+ actions.innerHTML = `${v.wait ? '<button type="button" class="small ghost" data-acc="skip" title="Stop waiting; the agent goes ahead with the criteria in its own spec">Skip</button>' : ''}
71
+ <button type="button" class="small" data-acc="${v.status === 'agreed' ? 'cancel' : 'close'}">${v.status === 'agreed' ? 'Cancel' : 'Close'}</button>
72
+ <button type="button" class="small primary" data-acc="agree" ${st.busy ? 'disabled' : ''}>${v.status === 'agreed' ? 'Agree on these' : v.wait ? 'Agree and start' : 'Agree'}</button>`;
73
+ return;
74
+ }
75
+ if (v.status === 'writing') {
76
+ body.innerHTML = '<p class="hint">The agent is reading the code and writing its points. It changes nothing until you agree on them; they appear here and in the inbox.</p>';
77
+ actions.innerHTML = '<button type="button" class="small ghost" data-acc="skip">Skip</button><button type="button" class="small" data-acc="close">Close</button>';
78
+ return;
79
+ }
80
+ // Agreed: each point with what was found.
81
+ const c = v.counts;
82
+ const head = c.unchecked === c.total ? (v.scoring ? 'Being checked now…' : 'Not checked yet: the work is scored against these when the agent says it is done.') : `Checked ${ago(v.checkedAt)}${v.stale ? ' · the work or the points changed since' : ''}`;
83
+ body.innerHTML = `<p class="hint">Agreed ${ago(v.agreedAt)}. ${esc(head)}</p>
84
+ <ol class="acc-list">${v.results
85
+ .map((r) => `<li><span class="cl-chip acc-chip acc-${r.status}">${LABEL[r.status]}</span> ${esc(r.text)}${r.from === 'you' ? ' <span class="hint">(yours)</span>' : ''}${r.evidence ? `<div class="hint acc-evidence">${esc(r.evidence)}</div>` : ''}</li>`)
86
+ .join('')}</ol>
87
+ <p class="hint">Met, not met and not verified are another model's reading of the changes, with the evidence it gave. A point that is not met holds the work back from “Ready to approve”.</p>`;
88
+ actions.innerHTML = `<button type="button" class="small ghost" data-acc="edit">Change points</button>
89
+ <button type="button" class="small" data-acc="check" ${st.busy || v.scoring ? 'disabled' : ''} title="Score the work against these points now (a separate model call)">${st.busy || v.scoring ? 'Checking…' : c.unchecked === c.total || v.stale ? 'Check now' : 'Check again'}</button>
90
+ <button type="button" class="small primary" data-acc="close">Close</button>`;
91
+ }
92
+
93
+ /** Keep what is typed: the list is drawn again on add and remove. */
94
+ function readEdits() {
95
+ if (!st?.edit) return;
96
+ for (const el of dialog.querySelectorAll('[data-acc-point]')) st.edit[Number(el.dataset.accPoint)] = el.value;
97
+ }
98
+
99
+ async function load() {
100
+ const id = st.id;
101
+ try {
102
+ const view = await api('GET', `/agents/${id}/acceptance`);
103
+ if (st?.id !== id) return;
104
+ st.view = view;
105
+ st.error = null;
106
+ // Not agreed yet: straight to the points, to edit. (Typing in progress is kept.)
107
+ if (view.status !== 'agreed' && view.status !== 'writing' && !st.edit) st.edit = view.draft.slice();
108
+ if (view.status === 'none' && !st.edit) st.edit = [];
109
+ if (view.status === 'writing') st.edit = null;
110
+ } catch (e) {
111
+ if (st?.id !== id) return;
112
+ st.error = e.message;
113
+ }
114
+ render();
115
+ }
116
+
117
+ async function run(fn, ok) {
118
+ st.busy = true;
119
+ render();
120
+ try {
121
+ const a = await fn();
122
+ if (a?.id) upsert(a);
123
+ if (ok) toast(ok);
124
+ return true;
125
+ } catch (e) {
126
+ toast(`Error: ${e.message}`, 5000);
127
+ return false;
128
+ } finally {
129
+ if (st) st.busy = false;
130
+ }
131
+ }
132
+
133
+ dialog.addEventListener('click', async (e) => {
134
+ const rm = e.target.closest('[data-acc-remove]');
135
+ if (rm) {
136
+ readEdits();
137
+ st.edit.splice(Number(rm.dataset.accRemove), 1);
138
+ return render();
139
+ }
140
+ const act = e.target.closest('[data-acc]')?.dataset.acc;
141
+ if (!act || !st) return;
142
+ const id = st.id;
143
+ if (act === 'close') return dialog.close();
144
+ if (act === 'add') {
145
+ readEdits();
146
+ st.edit.push('');
147
+ render();
148
+ return dialog.querySelector(`[data-acc-point="${st.edit.length - 1}"]`)?.focus();
149
+ }
150
+ if (act === 'edit') {
151
+ st.edit = st.view.points.map((p) => p.text);
152
+ return render();
153
+ }
154
+ if (act === 'cancel') {
155
+ st.edit = null;
156
+ return render();
157
+ }
158
+ if (act === 'agree') {
159
+ readEdits();
160
+ const points = st.edit.map((t) => t.trim()).filter(Boolean);
161
+ if (!points.length) return toast('Add at least one point', 4000);
162
+ const waited = st.view.wait;
163
+ if (await run(() => api('POST', `/agents/${id}/acceptance/agree`, { points }), waited ? 'Agreed; the agent goes ahead' : 'Agreed; the work is checked against these')) {
164
+ if (st?.id !== id) return;
165
+ st.edit = null;
166
+ await load();
167
+ } else render();
168
+ return;
169
+ }
170
+ if (act === 'skip') {
171
+ if (await run(() => api('POST', `/agents/${id}/acceptance/skip`), 'Not waiting; the agent goes ahead with its own criteria')) dialog.close();
172
+ else render();
173
+ return;
174
+ }
175
+ if (act === 'check') {
176
+ await run(() => api('POST', `/agents/${id}/docs/scorecard`));
177
+ if (st?.id === id) await load();
178
+ }
179
+ });
180
+ dialog.addEventListener('close', () => (st = null));
181
+
182
+ return {
183
+ open(id) {
184
+ st = { id, view: null, edit: null, busy: false, error: null };
185
+ render();
186
+ if (!dialog.open) dialog.showModal();
187
+ return load();
188
+ },
189
+ /** The agent changed (new points from it, a new score): show it, unless the person is typing. */
190
+ agentChanged(a) {
191
+ if (st?.id === a.id && !editing() && !st.busy) load();
192
+ },
193
+ };
194
+ }
package/public/app.js CHANGED
@@ -5,6 +5,7 @@ import DOMPurify from '/vendor/dompurify/purify.es.mjs';
5
5
  import { touchScroll } from '/touchscroll.js';
6
6
  import { openStream, post, REMOTE } from '/transport.js';
7
7
  import { attachBox } from '/attach.js';
8
+ import { initDropZone } from '/dropzone.js';
8
9
  import { initSide } from '/side.js';
9
10
  import { openCopy, pasteInto } from '/termclip.js';
10
11
  import { initBuilt } from '/built.js';
@@ -56,6 +57,9 @@ import { initPalette } from '/palette.js';
56
57
  import { initFiles } from '/files.js';
57
58
  import { initUpdateView, updateHtml, updateWaits } from '/announce.js';
58
59
  import { morph } from '/morph.js';
60
+ import { acceptanceRow, acceptanceWaits, initAcceptance } from '/acceptance.js';
61
+ import { autoNeedHtml, autonomyNeeds, autonomyRow, initAutonomy, needsPermissionHint } from '/autonomy.js';
62
+ import { initProof, proofRows } from '/proof.js';
59
63
 
60
64
  const $ = (sel) => document.querySelector(sel);
61
65
  const agents = new Map();
@@ -189,6 +193,29 @@ async function act(fn, okMsg) {
189
193
  }
190
194
 
191
195
  const reviewUi = initReview({ api, esc, toast, agents, $ });
196
+ const acceptUi = initAcceptance({ dialog: $('#accept-dialog'), api, esc, toast, ago, agentOf: (id) => agents.get(id), upsert: (a) => upsert(a) });
197
+ const proofUi = initProof({ dialog: $('#proof-dialog'), api, esc, toast, ago, agentOf: (id) => agents.get(id) });
198
+ const autoUi = initAutonomy({ dialog: $('#auto-dialog'), api, esc, toast, ago, agentOf: (id) => agents.get(id), upsert: (a) => upsert(a) });
199
+ // Past "Ask me", what done means is agreed first: that is what the answers given for you are checked against.
200
+ // And a permission prompt is never answered for you: say so where the mode would stop it at each one.
201
+ function syncAutonomyPerm() {
202
+ const f = $('#new-autonomy')?.form;
203
+ const hint = $('#new-autonomy-perm');
204
+ if (!f || !hint) return;
205
+ hint.hidden = !needsPermissionHint(f.autonomy.value, f.permissionMode?.value);
206
+ }
207
+ $('#new-autonomy')?.addEventListener('change', (e) => {
208
+ if (['run', 'pr', 'merge'].includes(e.target.value) && e.target.form?.acceptance) e.target.form.acceptance.checked = true;
209
+ syncAutonomyPerm();
210
+ });
211
+ $('#new-autonomy')?.form?.permissionMode?.addEventListener('change', syncAutonomyPerm);
212
+ $('#new-autonomy')?.form?.addEventListener('reset', () => setTimeout(syncAutonomyPerm));
213
+ $('#new-autonomy-auto')?.addEventListener('click', () => {
214
+ const f = $('#new-autonomy').form;
215
+ f.permissionMode.value = 'auto';
216
+ syncAutonomyPerm();
217
+ toast('Permission mode: Auto');
218
+ });
192
219
  const triggersUi = initTriggers({ api, esc, toast, $ });
193
220
  initSpend({ api, esc, toast, $ });
194
221
  const goalsUi = initGoals({ api, esc, toast, $, ago: (t) => ago(t), getProjects: () => projectsState, rerender: () => renderBacklog() });
@@ -1074,7 +1101,9 @@ function resultsCard(a) {
1074
1101
  return `<div class="results ${r.outcome.replace(' ', '-')}">
1075
1102
  <h4>Results <span class="outcome">${icon} ${label}</span>${r.fromAgent ? '' : ' <span class="hint">(from what AI Agent Manager can see; the agent adds its own when it next updates its brief)</span>'}</h4>
1076
1103
  ${scoreStrip(a)}
1104
+ ${r.confidence ? `<p class="own-conf"><span class="tag conf-${esc(r.confidence.level)}" title="The agent's own confidence in what it built, as it wrote it in its brief. The review scorecard is the separate check.">Its own confidence: ${r.confidence.percent}%</span> ${esc(r.confidence.why)}</p>` : r.fromAgent && ['done', 'partial'].includes(r.outcome) ? '<p class="hint own-conf">The agent has not said how confident it is in this.</p>' : ''}
1077
1105
  ${r.blockers.length ? `<ul class="blockers">${r.blockers.map((x) => item(x, 'blocker')).join('')}</ul>` : ''}
1106
+ ${proofRows(a, esc)}
1078
1107
  ${r.delivered.length ? `<ul class="delivered">${r.delivered.map((x) => item(x, 'delivered')).join('')}</ul>` : '<p class="hint">Nothing delivered yet.</p>'}
1079
1108
  ${r.notes ? `<div class="md">${md(r.notes)}</div>` : ''}
1080
1109
  </div>`;
@@ -1089,6 +1118,8 @@ function briefPanel(a) {
1089
1118
  if (!b) {
1090
1119
  return `<div class="card brief">
1091
1120
  <h3>Brief <span class="brief-actions">${ins.button} ${ex.button} ${rv.button}</span></h3>
1121
+ ${noRepo(a) ? '' : acceptanceRow(a, esc)}
1122
+ ${noRepo(a) ? '' : autonomyRow(a, esc)}
1092
1123
  ${planRow(a)}
1093
1124
  <div class="share-row"><span class="hint">Share for review:</span> ${docButtons(a)}</div>
1094
1125
  ${resultsCard(a)}
@@ -1107,6 +1138,8 @@ function briefPanel(a) {
1107
1138
  : '<p class="hint">No checks yet.</p>';
1108
1139
  return `<div class="card brief">
1109
1140
  <h3>Brief <span class="brief-actions"><span title="${esc(b.updatedAt)}">updated ${ago(b.updatedAt)}</span> ${ins.button} ${ex.button} ${rv.button}</span></h3>
1141
+ ${noRepo(a) ? '' : acceptanceRow(a, esc)}
1142
+ ${noRepo(a) ? '' : autonomyRow(a, esc)}
1110
1143
  ${planRow(a)}
1111
1144
  <div class="share-row"><span class="hint">Share for review:</span> ${docButtons(a)}</div>
1112
1145
  ${resultsCard(a)}
@@ -1568,17 +1601,19 @@ function loadLimitEngines() {
1568
1601
  })
1569
1602
  .catch(() => (limitEngines = null));
1570
1603
  }
1571
- const NEED_ORDER = { approval: 0, prompt: 0, limit: 1, waiting: 1, plan: 1, question: 1, team: 1, rule: 2, review: 2, prereview: 2, autopilot: 2, stuck: 3, conflict: 4, reminder: 5, close: 5, repeat: 5, update: 4 };
1604
+ const NEED_ORDER = { approval: 0, prompt: 0, limit: 1, waiting: 1, plan: 1, acceptance: 1, question: 1, team: 1, rule: 2, auto: 2, review: 2, prereview: 2, autopilot: 2, stuck: 3, conflict: 4, reminder: 5, close: 5, repeat: 5, update: 4 };
1572
1605
  /** What an agent needs from the user. `both`: overlaps on both agents (detail), else only the one that should rebase (inbox). */
1573
1606
  function needsFor(a, { both = false } = {}) {
1574
1607
  const items = [];
1575
1608
  if (a.runtime.attention) items.push({ a, kind: 'prompt', key: `prompt:${a.id}` });
1576
1609
  if (a.runtime.limited) items.push({ a, kind: 'limit', key: `limit:${a.id}` });
1577
1610
  if (a.runtime.waiting) items.push({ a, kind: 'waiting', key: `waiting:${a.id}` });
1611
+ if (acceptanceWaits(a)) items.push({ a, kind: 'acceptance', key: `acceptance:${a.id}` });
1578
1612
  if (a.planReview?.status === 'review') items.push({ a, kind: 'plan', key: `plan:${a.id}` });
1579
1613
  if (a.aiReview?.verdict && !a.aiReview.seen) items.push({ a, kind: 'review', key: `review:${a.id}` });
1580
1614
  if (['stalled', 'error'].includes(a.preReview?.status)) items.push({ a, kind: 'prereview', key: `prereview:${a.id}` });
1581
1615
  for (const q of a.questions ?? []) if (!q.answer) items.push({ a, kind: 'question', key: `q:${a.id}:${q.id}`, q });
1616
+ items.push(...autonomyNeeds(a));
1582
1617
  for (const f of a.stuck ?? []) items.push({ a, kind: 'stuck', key: `stuck:${a.id}:${f.key}`, f });
1583
1618
  if (updateWaits(a)) items.push({ a, kind: 'update', key: `update:${a.id}` });
1584
1619
  if (a.followUp) items.push({ a, kind: a.followUp.kind === 'close' ? 'close' : 'reminder', key: `reminder:${a.id}`, r: a.followUp });
@@ -1617,7 +1652,7 @@ function inboxItems() {
1617
1652
  .sort((x, y) => NEED_ORDER[x.kind] - NEED_ORDER[y.kind] || (x.a.priority ?? 2) - (y.a.priority ?? 2));
1618
1653
  }
1619
1654
 
1620
- const NEED_LABEL = { update: 'Update to send', limit: 'Limit', reminder: 'Follow up', close: 'Close session?', repeat: 'Make it a playbook?', autopilot: 'Autopilot held', rule: 'Always allow?', approval: 'Approval', team: 'Team', prompt: 'Needs input', waiting: 'Waiting on you', plan: 'Plan review', question: 'Question', review: 'AI review', prereview: 'Not approved', stuck: 'Stuck?', conflict: 'Overlap' };
1655
+ const NEED_LABEL = { update: 'Update to send', limit: 'Limit', reminder: 'Follow up', close: 'Close session?', repeat: 'Make it a playbook?', autopilot: 'Autopilot held', rule: 'Always allow?', approval: 'Approval', team: 'Team', prompt: 'Needs input', waiting: 'Waiting on you', acceptance: 'Done means', auto: 'Done for you', plan: 'Plan review', question: 'Question', review: 'AI review', prereview: 'Not approved', stuck: 'Stuck?', conflict: 'Overlap' };
1621
1656
  /** Why the AI judge thinks so, as a small tag. */
1622
1657
  const aiTag = (confidence, what = 'AI') => `<span class="tag ai" title="Judged by a model from the agent's activity; your reactions tune later calls">🤖 ${what}${confidence != null ? ` ${Math.round(confidence * 100)}%` : ''}</span>`;
1623
1658
  /** What a permission prompt asks about: the command, file or tool. */
@@ -1682,7 +1717,7 @@ function needCard(it, { inDetail = false } = {}) {
1682
1717
  const p = a.runtime.prompt;
1683
1718
  body = `${p?.tool ? `<p class="need-title">${toolLine(p.tool)}</p><p class="hint">${esc(p.question || a.runtime.attention)}</p>` : `<p class="need-title">${esc(p?.question || a.runtime.attention)}</p>`}
1684
1719
  <div class="need-actions">
1685
- ${(p?.choices ?? []).map((c) => `<button class="small ${c.key === '1' ? 'primary' : ''}" data-ib="key" data-key="${c.key}">${c.key}. ${esc(c.label)}</button>`).join('')}
1720
+ ${(p?.choices ?? []).map((c) => `<button class="small ${c.key === '1' ? 'primary' : ''}" data-ib="key" data-key="${c.key}"${c.hint ? ` title="${esc(c.hint)}"` : ''}>${c.key}. ${esc(c.label)}</button>`).join('')}
1686
1721
  <button class="small" data-ib="key" data-key="esc" title="Escape">Esc</button>
1687
1722
  <button class="small ghost" data-ib="terminal">Open terminal</button>
1688
1723
  </div>`;
@@ -1730,6 +1765,14 @@ function needCard(it, { inDetail = false } = {}) {
1730
1765
  body = `<p class="need-title">${t.stage === 'ready' ? `✓ The reviewer approved <b>${esc(t.name)}</b>${t.gaps ? ', with parts still missing: run a gap round?' : ''}` : `<b>${esc(t.name)}</b> needs a decision: ${esc(t.blocked?.reason ?? '')}`}</p>
1731
1766
  <p class="hint">${esc(t.intent.split('\n')[0].slice(0, 140))}</p>
1732
1767
  <div class="need-actions"><button class="small primary" data-ib="team-open" data-team="${t.id}">${t.stage !== 'ready' ? 'Decide' : t.gaps ? 'See the gaps' : 'Review and finalize'}</button></div>`;
1768
+ } else if (it.kind === 'auto') {
1769
+ body = autoNeedHtml(it, { esc, ago });
1770
+ } else if (it.kind === 'acceptance') {
1771
+ const pts = a.acceptance.points;
1772
+ body = `<p class="need-title">What done means: ${pts.length} point${pts.length === 1 ? '' : 's'}</p>
1773
+ <ol class="acc-need">${pts.map((p) => `<li>${esc(p.text)}</li>`).join('')}</ol>
1774
+ <p class="hint">Written ${ago(a.acceptance.updatedAt)}. The agent changes nothing until you agree; its work is then checked against these.</p>
1775
+ <div class="need-actions"><button class="small primary" data-ib="accept-open">Change points</button><button class="small" data-ib="accept-agree">Agree as written</button></div>`;
1733
1776
  } else if (it.kind === 'plan') {
1734
1777
  const title = a.planReview.markdown?.match(/^#\s+(.+)$/m)?.[1] ?? 'Implementation plan';
1735
1778
  body = `<p class="need-title">${esc(title)}</p>
@@ -1987,6 +2030,14 @@ async function onNeed(e) {
1987
2030
  return openTeam(el.dataset.team);
1988
2031
  case 'plan-open':
1989
2032
  return openPlan(id);
2033
+ case 'accept-open':
2034
+ return acceptUi.open(id);
2035
+ case 'auto-ok':
2036
+ return autoUi.ok(id, el.dataset.entry);
2037
+ case 'auto-change':
2038
+ return autoUi.change(id, el.dataset.entry);
2039
+ case 'accept-agree':
2040
+ return act(async () => upsert(await api('POST', `/agents/${id}/acceptance/agree`, {})), 'Agreed; the agent goes ahead');
1990
2041
  case 'plan-approve':
1991
2042
  return act(async () => upsert(await api('POST', `/agents/${id}/plan/approve`, {})), 'Approved; the agent is implementing it');
1992
2043
  case 'clash-dismiss':
@@ -3952,6 +4003,9 @@ function agentChanged(a) {
3952
4003
  loadSpec(a.id, docView.kind).then(renderDocDialog);
3953
4004
  }
3954
4005
  reviewUi.agentChanged(a);
4006
+ acceptUi.agentChanged(a);
4007
+ autoUi.agentChanged(a);
4008
+ proofUi.agentChanged(a);
3955
4009
  sidePane?.agentChanged(a);
3956
4010
  }
3957
4011
 
@@ -4143,6 +4197,14 @@ $('#detail-body').addEventListener('click', async (e) => {
4143
4197
  return openEdit(a);
4144
4198
  case 'plan-open':
4145
4199
  return openPlan(a.id);
4200
+ case 'accept-open':
4201
+ return acceptUi.open(a.id);
4202
+ case 'proof-open':
4203
+ return proofUi.open(a.id);
4204
+ case 'auto-open':
4205
+ return autoUi.open(a.id);
4206
+ case 'accept-skip':
4207
+ return act(async () => upsert(await api('POST', `/agents/${a.id}/acceptance/skip`)), 'Not waiting; the agent goes ahead with its own criteria');
4146
4208
  case 'plan-on':
4147
4209
  return act(async () => upsert(await api('POST', `/agents/${a.id}/plan/review`, { on: true })), 'The agent will write a plan and wait for your review');
4148
4210
  case 'plan-skip':
@@ -4335,6 +4397,7 @@ function renderProjectOptions() {
4335
4397
 
4336
4398
  function openNewDialog(mode = 'now') {
4337
4399
  renderProjectOptions();
4400
+ newDrop.reset();
4338
4401
  $('#new-error').hidden = true;
4339
4402
  dialog.querySelector(`input[name="when"][value="${mode}"]`).checked = true;
4340
4403
  restoreIntentSplit();
@@ -4399,6 +4462,20 @@ function syncIntentPlaceholder() {
4399
4462
  form.intents.placeholder = form.split.value === 'one' || ['race', 'team'].includes(form.when.value) ? WHOLE_PLACEHOLDER : LINES_PLACEHOLDER;
4400
4463
  }
4401
4464
  for (const r of dialog.querySelectorAll('input[name="when"]')) r.addEventListener('change', syncWhen);
4465
+ // Tickets, requirements, designs and files dropped on the page or on the form fill it in (dropzone.js).
4466
+ const newDrop = initDropZone({
4467
+ form: $('#new-form'),
4468
+ zone: $('#new-drop'),
4469
+ overlay: $('#drop-overlay'),
4470
+ attach: newFiles,
4471
+ open: () => openNewDialog('now'),
4472
+ isOpen: () => dialog.open,
4473
+ sync: () => {
4474
+ syncIntentPlaceholder();
4475
+ syncIntentCount();
4476
+ },
4477
+ toast,
4478
+ });
4402
4479
  $('#new-btn').onclick = () => openNewDialog('now');
4403
4480
  $('#new-cancel').onclick = () => dialog.close();
4404
4481
  $('#new-form').addEventListener('submit', async (e) => {
@@ -4504,6 +4581,8 @@ $('#new-form').addEventListener('submit', async (e) => {
4504
4581
  ...containerChoice(e.target),
4505
4582
  plan: Boolean(f.get('plan')),
4506
4583
  planReview: Boolean(f.get('planReview')),
4584
+ acceptance: Boolean(f.get('acceptance')),
4585
+ autonomy: f.get('autonomy') || undefined,
4507
4586
  designDoc: Boolean(f.get('designDoc')),
4508
4587
  demoPage: Boolean(f.get('demoPage')),
4509
4588
  benchmarks: Boolean(f.get('benchmarks')),
@@ -4537,6 +4616,8 @@ $('#new-form').addEventListener('submit', async (e) => {
4537
4616
  project: f.get('project') || undefined,
4538
4617
  plan: Boolean(f.get('plan')),
4539
4618
  planReview: Boolean(f.get('planReview')),
4619
+ acceptance: Boolean(f.get('acceptance')),
4620
+ autonomy: f.get('autonomy') || undefined,
4540
4621
  designDoc: Boolean(f.get('designDoc')),
4541
4622
  start: Boolean(f.get('start')),
4542
4623
  ...containerChoice(e.target),
package/public/attach.js CHANGED
@@ -90,6 +90,10 @@ export function attachBox({ slot, form, paste, esc, toast }) {
90
90
  });
91
91
 
92
92
  return {
93
+ /** Attach these files (dropped somewhere else on the page). */
94
+ add,
95
+ /** Open the file picker. */
96
+ pick: () => input.click(),
93
97
  paths: () => items.filter((it) => it.path).map((it) => it.path),
94
98
  pending: () => items.some((it) => it.uploading),
95
99
  clear() {