ai-agentmanager 1.62.0 → 1.63.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 +21 -0
- package/README.md +92 -0
- package/package.json +1 -1
- package/public/acceptance.js +194 -0
- package/public/app.js +61 -2
- package/public/attach.js +4 -0
- package/public/autonomy.js +140 -0
- package/public/boardcols.js +1 -0
- package/public/dropzone.js +203 -0
- package/public/index.html +56 -0
- package/public/menu.js +20 -0
- package/public/scorecard.js +1 -1
- package/public/standup.js +1 -0
- package/public/style.css +47 -1
- package/src/acceptance.js +123 -0
- package/src/advisor.js +30 -8
- package/src/autonomy.js +624 -0
- package/src/autopilot.js +7 -1
- package/src/backlog.js +16 -3
- package/src/brief.js +21 -3
- package/src/bughunt.js +1 -0
- package/src/cli.js +132 -0
- package/src/config.js +3 -0
- package/src/decisions.js +5 -1
- package/src/groundrules.js +97 -0
- package/src/judge.js +1 -1
- package/src/manager.js +174 -5
- package/src/notify.js +16 -0
- package/src/prereview.js +7 -2
- package/src/scorecard.js +26 -9
- package/src/server.js +53 -3
- package/src/standup.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.63.0 (2026-11-21)
|
|
4
|
+
|
|
5
|
+
- **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.
|
|
6
|
+
- **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.
|
|
7
|
+
- **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".
|
|
8
|
+
- **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).
|
|
9
|
+
- **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.
|
|
10
|
+
- **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.
|
|
11
|
+
- **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.
|
|
12
|
+
- **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.
|
|
13
|
+
- **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.
|
|
14
|
+
- **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.
|
|
15
|
+
- **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`.
|
|
16
|
+
- **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.
|
|
17
|
+
- **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.
|
|
18
|
+
- **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.
|
|
19
|
+
- **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.
|
|
20
|
+
- **Fixed:** on a narrow phone the buttons at the bottom of New agents no longer push the form wider than the screen.
|
|
21
|
+
- **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.
|
|
22
|
+
- **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.
|
|
23
|
+
|
|
3
24
|
## 1.62.0 (2026-11-19)
|
|
4
25
|
|
|
5
26
|
- **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,97 @@ 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 stuck agent** gets the judge's nudge when the judge is at least 70% sure, three times at most.
|
|
487
|
+
- **A quiet, unfinished agent** is told to carry on, twice at most, unless it is blocked on you.
|
|
488
|
+
- **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.)
|
|
489
|
+
|
|
490
|
+
**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.
|
|
491
|
+
|
|
492
|
+
**Never done for you:**
|
|
493
|
+
|
|
494
|
+
- A permission prompt is never answered by a model (your [approval rules](#decision-inbox) still apply).
|
|
495
|
+
- 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.
|
|
496
|
+
- An agent cannot set or raise its own level, and cannot change your ground rules: its own calls are refused.
|
|
497
|
+
|
|
498
|
+
**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.
|
|
499
|
+
|
|
500
|
+
```bash
|
|
501
|
+
agentmgr add "Add a CSV export" --repo <url> --autonomy pr
|
|
502
|
+
agentmgr autonomy # the default level, the models, today's calls
|
|
503
|
+
agentmgr autonomy --default run --models fable,opus,sonnet
|
|
504
|
+
agentmgr autonomy add-a-csv-export # its level and what was done for you
|
|
505
|
+
agentmgr autonomy add-a-csv-export merge # set its level
|
|
506
|
+
agentmgr autonomy add-a-csv-export --change 3fa2c1d0="Use Postgres"
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
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 }`.
|
|
510
|
+
|
|
511
|
+
**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 an agent can still stop at a permission prompt. Each answer, nudge and judgment is a model call on your own plan.
|
|
512
|
+
|
|
513
|
+
## Ground rules: your own rules for every agent
|
|
514
|
+
|
|
515
|
+
**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."
|
|
516
|
+
|
|
517
|
+
- **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.
|
|
518
|
+
- **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.
|
|
519
|
+
- **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.
|
|
520
|
+
- **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.
|
|
521
|
+
|
|
522
|
+
```bash
|
|
523
|
+
agentmgr ground-rules # show them
|
|
524
|
+
agentmgr ground-rules --add "Ask before adding a dependency" --tell
|
|
525
|
+
agentmgr ground-rules --remove 2
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
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).
|
|
529
|
+
|
|
530
|
+
## Confidence: how sure the agent is of what it built
|
|
531
|
+
|
|
532
|
+
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.
|
|
533
|
+
|
|
534
|
+
The number is the agent's own statement, not a measurement.
|
|
535
|
+
|
|
444
536
|
## Insights
|
|
445
537
|
|
|
446
538
|
**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
|
@@ -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,8 @@ 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 } from '/autonomy.js';
|
|
59
62
|
|
|
60
63
|
const $ = (sel) => document.querySelector(sel);
|
|
61
64
|
const agents = new Map();
|
|
@@ -189,6 +192,12 @@ async function act(fn, okMsg) {
|
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
const reviewUi = initReview({ api, esc, toast, agents, $ });
|
|
195
|
+
const acceptUi = initAcceptance({ dialog: $('#accept-dialog'), api, esc, toast, ago, agentOf: (id) => agents.get(id), upsert: (a) => upsert(a) });
|
|
196
|
+
const autoUi = initAutonomy({ dialog: $('#auto-dialog'), api, esc, toast, ago, agentOf: (id) => agents.get(id), upsert: (a) => upsert(a) });
|
|
197
|
+
// Past "Ask me", what done means is agreed first: that is what the answers given for you are checked against.
|
|
198
|
+
$('#new-autonomy')?.addEventListener('change', (e) => {
|
|
199
|
+
if (['run', 'pr', 'merge'].includes(e.target.value) && e.target.form?.acceptance) e.target.form.acceptance.checked = true;
|
|
200
|
+
});
|
|
192
201
|
const triggersUi = initTriggers({ api, esc, toast, $ });
|
|
193
202
|
initSpend({ api, esc, toast, $ });
|
|
194
203
|
const goalsUi = initGoals({ api, esc, toast, $, ago: (t) => ago(t), getProjects: () => projectsState, rerender: () => renderBacklog() });
|
|
@@ -1074,6 +1083,7 @@ function resultsCard(a) {
|
|
|
1074
1083
|
return `<div class="results ${r.outcome.replace(' ', '-')}">
|
|
1075
1084
|
<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
1085
|
${scoreStrip(a)}
|
|
1086
|
+
${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
1087
|
${r.blockers.length ? `<ul class="blockers">${r.blockers.map((x) => item(x, 'blocker')).join('')}</ul>` : ''}
|
|
1078
1088
|
${r.delivered.length ? `<ul class="delivered">${r.delivered.map((x) => item(x, 'delivered')).join('')}</ul>` : '<p class="hint">Nothing delivered yet.</p>'}
|
|
1079
1089
|
${r.notes ? `<div class="md">${md(r.notes)}</div>` : ''}
|
|
@@ -1089,6 +1099,8 @@ function briefPanel(a) {
|
|
|
1089
1099
|
if (!b) {
|
|
1090
1100
|
return `<div class="card brief">
|
|
1091
1101
|
<h3>Brief <span class="brief-actions">${ins.button} ${ex.button} ${rv.button}</span></h3>
|
|
1102
|
+
${noRepo(a) ? '' : acceptanceRow(a, esc)}
|
|
1103
|
+
${noRepo(a) ? '' : autonomyRow(a, esc)}
|
|
1092
1104
|
${planRow(a)}
|
|
1093
1105
|
<div class="share-row"><span class="hint">Share for review:</span> ${docButtons(a)}</div>
|
|
1094
1106
|
${resultsCard(a)}
|
|
@@ -1107,6 +1119,8 @@ function briefPanel(a) {
|
|
|
1107
1119
|
: '<p class="hint">No checks yet.</p>';
|
|
1108
1120
|
return `<div class="card brief">
|
|
1109
1121
|
<h3>Brief <span class="brief-actions"><span title="${esc(b.updatedAt)}">updated ${ago(b.updatedAt)}</span> ${ins.button} ${ex.button} ${rv.button}</span></h3>
|
|
1122
|
+
${noRepo(a) ? '' : acceptanceRow(a, esc)}
|
|
1123
|
+
${noRepo(a) ? '' : autonomyRow(a, esc)}
|
|
1110
1124
|
${planRow(a)}
|
|
1111
1125
|
<div class="share-row"><span class="hint">Share for review:</span> ${docButtons(a)}</div>
|
|
1112
1126
|
${resultsCard(a)}
|
|
@@ -1568,17 +1582,19 @@ function loadLimitEngines() {
|
|
|
1568
1582
|
})
|
|
1569
1583
|
.catch(() => (limitEngines = null));
|
|
1570
1584
|
}
|
|
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 };
|
|
1585
|
+
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
1586
|
/** What an agent needs from the user. `both`: overlaps on both agents (detail), else only the one that should rebase (inbox). */
|
|
1573
1587
|
function needsFor(a, { both = false } = {}) {
|
|
1574
1588
|
const items = [];
|
|
1575
1589
|
if (a.runtime.attention) items.push({ a, kind: 'prompt', key: `prompt:${a.id}` });
|
|
1576
1590
|
if (a.runtime.limited) items.push({ a, kind: 'limit', key: `limit:${a.id}` });
|
|
1577
1591
|
if (a.runtime.waiting) items.push({ a, kind: 'waiting', key: `waiting:${a.id}` });
|
|
1592
|
+
if (acceptanceWaits(a)) items.push({ a, kind: 'acceptance', key: `acceptance:${a.id}` });
|
|
1578
1593
|
if (a.planReview?.status === 'review') items.push({ a, kind: 'plan', key: `plan:${a.id}` });
|
|
1579
1594
|
if (a.aiReview?.verdict && !a.aiReview.seen) items.push({ a, kind: 'review', key: `review:${a.id}` });
|
|
1580
1595
|
if (['stalled', 'error'].includes(a.preReview?.status)) items.push({ a, kind: 'prereview', key: `prereview:${a.id}` });
|
|
1581
1596
|
for (const q of a.questions ?? []) if (!q.answer) items.push({ a, kind: 'question', key: `q:${a.id}:${q.id}`, q });
|
|
1597
|
+
items.push(...autonomyNeeds(a));
|
|
1582
1598
|
for (const f of a.stuck ?? []) items.push({ a, kind: 'stuck', key: `stuck:${a.id}:${f.key}`, f });
|
|
1583
1599
|
if (updateWaits(a)) items.push({ a, kind: 'update', key: `update:${a.id}` });
|
|
1584
1600
|
if (a.followUp) items.push({ a, kind: a.followUp.kind === 'close' ? 'close' : 'reminder', key: `reminder:${a.id}`, r: a.followUp });
|
|
@@ -1617,7 +1633,7 @@ function inboxItems() {
|
|
|
1617
1633
|
.sort((x, y) => NEED_ORDER[x.kind] - NEED_ORDER[y.kind] || (x.a.priority ?? 2) - (y.a.priority ?? 2));
|
|
1618
1634
|
}
|
|
1619
1635
|
|
|
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' };
|
|
1636
|
+
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
1637
|
/** Why the AI judge thinks so, as a small tag. */
|
|
1622
1638
|
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
1639
|
/** What a permission prompt asks about: the command, file or tool. */
|
|
@@ -1730,6 +1746,14 @@ function needCard(it, { inDetail = false } = {}) {
|
|
|
1730
1746
|
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
1747
|
<p class="hint">${esc(t.intent.split('\n')[0].slice(0, 140))}</p>
|
|
1732
1748
|
<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>`;
|
|
1749
|
+
} else if (it.kind === 'auto') {
|
|
1750
|
+
body = autoNeedHtml(it, { esc, ago });
|
|
1751
|
+
} else if (it.kind === 'acceptance') {
|
|
1752
|
+
const pts = a.acceptance.points;
|
|
1753
|
+
body = `<p class="need-title">What done means: ${pts.length} point${pts.length === 1 ? '' : 's'}</p>
|
|
1754
|
+
<ol class="acc-need">${pts.map((p) => `<li>${esc(p.text)}</li>`).join('')}</ol>
|
|
1755
|
+
<p class="hint">Written ${ago(a.acceptance.updatedAt)}. The agent changes nothing until you agree; its work is then checked against these.</p>
|
|
1756
|
+
<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
1757
|
} else if (it.kind === 'plan') {
|
|
1734
1758
|
const title = a.planReview.markdown?.match(/^#\s+(.+)$/m)?.[1] ?? 'Implementation plan';
|
|
1735
1759
|
body = `<p class="need-title">${esc(title)}</p>
|
|
@@ -1987,6 +2011,14 @@ async function onNeed(e) {
|
|
|
1987
2011
|
return openTeam(el.dataset.team);
|
|
1988
2012
|
case 'plan-open':
|
|
1989
2013
|
return openPlan(id);
|
|
2014
|
+
case 'accept-open':
|
|
2015
|
+
return acceptUi.open(id);
|
|
2016
|
+
case 'auto-ok':
|
|
2017
|
+
return autoUi.ok(id, el.dataset.entry);
|
|
2018
|
+
case 'auto-change':
|
|
2019
|
+
return autoUi.change(id, el.dataset.entry);
|
|
2020
|
+
case 'accept-agree':
|
|
2021
|
+
return act(async () => upsert(await api('POST', `/agents/${id}/acceptance/agree`, {})), 'Agreed; the agent goes ahead');
|
|
1990
2022
|
case 'plan-approve':
|
|
1991
2023
|
return act(async () => upsert(await api('POST', `/agents/${id}/plan/approve`, {})), 'Approved; the agent is implementing it');
|
|
1992
2024
|
case 'clash-dismiss':
|
|
@@ -3952,6 +3984,8 @@ function agentChanged(a) {
|
|
|
3952
3984
|
loadSpec(a.id, docView.kind).then(renderDocDialog);
|
|
3953
3985
|
}
|
|
3954
3986
|
reviewUi.agentChanged(a);
|
|
3987
|
+
acceptUi.agentChanged(a);
|
|
3988
|
+
autoUi.agentChanged(a);
|
|
3955
3989
|
sidePane?.agentChanged(a);
|
|
3956
3990
|
}
|
|
3957
3991
|
|
|
@@ -4143,6 +4177,12 @@ $('#detail-body').addEventListener('click', async (e) => {
|
|
|
4143
4177
|
return openEdit(a);
|
|
4144
4178
|
case 'plan-open':
|
|
4145
4179
|
return openPlan(a.id);
|
|
4180
|
+
case 'accept-open':
|
|
4181
|
+
return acceptUi.open(a.id);
|
|
4182
|
+
case 'auto-open':
|
|
4183
|
+
return autoUi.open(a.id);
|
|
4184
|
+
case 'accept-skip':
|
|
4185
|
+
return act(async () => upsert(await api('POST', `/agents/${a.id}/acceptance/skip`)), 'Not waiting; the agent goes ahead with its own criteria');
|
|
4146
4186
|
case 'plan-on':
|
|
4147
4187
|
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
4188
|
case 'plan-skip':
|
|
@@ -4335,6 +4375,7 @@ function renderProjectOptions() {
|
|
|
4335
4375
|
|
|
4336
4376
|
function openNewDialog(mode = 'now') {
|
|
4337
4377
|
renderProjectOptions();
|
|
4378
|
+
newDrop.reset();
|
|
4338
4379
|
$('#new-error').hidden = true;
|
|
4339
4380
|
dialog.querySelector(`input[name="when"][value="${mode}"]`).checked = true;
|
|
4340
4381
|
restoreIntentSplit();
|
|
@@ -4399,6 +4440,20 @@ function syncIntentPlaceholder() {
|
|
|
4399
4440
|
form.intents.placeholder = form.split.value === 'one' || ['race', 'team'].includes(form.when.value) ? WHOLE_PLACEHOLDER : LINES_PLACEHOLDER;
|
|
4400
4441
|
}
|
|
4401
4442
|
for (const r of dialog.querySelectorAll('input[name="when"]')) r.addEventListener('change', syncWhen);
|
|
4443
|
+
// Tickets, requirements, designs and files dropped on the page or on the form fill it in (dropzone.js).
|
|
4444
|
+
const newDrop = initDropZone({
|
|
4445
|
+
form: $('#new-form'),
|
|
4446
|
+
zone: $('#new-drop'),
|
|
4447
|
+
overlay: $('#drop-overlay'),
|
|
4448
|
+
attach: newFiles,
|
|
4449
|
+
open: () => openNewDialog('now'),
|
|
4450
|
+
isOpen: () => dialog.open,
|
|
4451
|
+
sync: () => {
|
|
4452
|
+
syncIntentPlaceholder();
|
|
4453
|
+
syncIntentCount();
|
|
4454
|
+
},
|
|
4455
|
+
toast,
|
|
4456
|
+
});
|
|
4402
4457
|
$('#new-btn').onclick = () => openNewDialog('now');
|
|
4403
4458
|
$('#new-cancel').onclick = () => dialog.close();
|
|
4404
4459
|
$('#new-form').addEventListener('submit', async (e) => {
|
|
@@ -4504,6 +4559,8 @@ $('#new-form').addEventListener('submit', async (e) => {
|
|
|
4504
4559
|
...containerChoice(e.target),
|
|
4505
4560
|
plan: Boolean(f.get('plan')),
|
|
4506
4561
|
planReview: Boolean(f.get('planReview')),
|
|
4562
|
+
acceptance: Boolean(f.get('acceptance')),
|
|
4563
|
+
autonomy: f.get('autonomy') || undefined,
|
|
4507
4564
|
designDoc: Boolean(f.get('designDoc')),
|
|
4508
4565
|
demoPage: Boolean(f.get('demoPage')),
|
|
4509
4566
|
benchmarks: Boolean(f.get('benchmarks')),
|
|
@@ -4537,6 +4594,8 @@ $('#new-form').addEventListener('submit', async (e) => {
|
|
|
4537
4594
|
project: f.get('project') || undefined,
|
|
4538
4595
|
plan: Boolean(f.get('plan')),
|
|
4539
4596
|
planReview: Boolean(f.get('planReview')),
|
|
4597
|
+
acceptance: Boolean(f.get('acceptance')),
|
|
4598
|
+
autonomy: f.get('autonomy') || undefined,
|
|
4540
4599
|
designDoc: Boolean(f.get('designDoc')),
|
|
4541
4600
|
start: Boolean(f.get('start')),
|
|
4542
4601
|
...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() {
|