@sjawhar/claude-envoy 2.12.0 → 2.13.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.
@@ -2,5 +2,5 @@
2
2
  "name": "claude-envoy",
3
3
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
4
4
  "mcpServers": "./.mcp.json",
5
- "version": "2.12.0"
5
+ "version": "2.13.0"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
5
5
  "mcpServers": {}
6
6
  }
package/dist/dispatch.js CHANGED
@@ -14791,7 +14791,6 @@ var ProjectSchema = strictObject({
14791
14791
  gated_steps: array(_enum2(GATED_STEPS)).optional(),
14792
14792
  created_at: string2()
14793
14793
  }).readonly();
14794
- var ProjectDefaultAssigneeSchema = strictObject({ project: string2(), assignee: string2().nullable() }).readonly();
14795
14794
  var RepoProjectSchema = strictObject({
14796
14795
  repo: string2(),
14797
14796
  project: string2(),
@@ -14813,6 +14812,11 @@ var ArchitectureSourceSchema = strictObject({
14813
14812
  components: number2().int()
14814
14813
  }).readonly();
14815
14814
  var RepoProjectUpdatedEventPayloadSchema = strictObject({ mapping: RepoProjectSchema, deleted: boolean2() }).readonly();
14815
+ var ProjectDefaultAssigneeUpdatedEventPayloadSchema = strictObject({
14816
+ project: string2(),
14817
+ assignee: string2().nullable(),
14818
+ thread_logins: array(string2()).optional()
14819
+ }).readonly();
14816
14820
  var ArchitectureSourceUpdatedEventPayloadSchema = strictObject({ source: ArchitectureSourceSchema, deleted: boolean2() }).readonly();
14817
14821
  var ArchitectureSyncedEventPayloadSchema = strictObject({
14818
14822
  repo: string2().optional(),
@@ -15030,7 +15034,7 @@ var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is
15030
15034
  var ASK_QUESTION_CONTRACT = "The question names the concrete case first: which machines, files, sessions or people, and the " + "numbers. It asks the choice in those terms, saying what happens to whom under each option " + '("Ship Friday and risk signing out 1,240 users, or hold to Monday?"), never "How should we ' + 'proceed?" or "Which option?", because a reader cannot work back from a general question to ' + "the case. It carries every fact the reader needs to decide and nothing " + "that does not change the decision. Generalize only after the specifics, if at all. Then give " + "your recommendation and its reason.";
15031
15035
  var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
15032
15036
  var ASK_IS_FOR_A_PERSON = "An ask is a question for a person, never a request to another agent. Ask an agent by envoy_send or a comment on the issue.";
15033
- var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on the issue's assignee until a person hands it on. No agent can hand one on.";
15037
+ var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on its asked-of person, else the issue's assignee, else the project's default assignee; no agent hands one on.";
15034
15038
  var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
15035
15039
  function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
15036
15040
  return {
@@ -15285,7 +15289,7 @@ var dispatchToolSpecs = [
15285
15289
  spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
15286
15290
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
15287
15291
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
15288
- assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee when it still names a person who has signed in, else unassigned. Set it only when a person said who owns the issue.").optional(),
15292
+ assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
15289
15293
  components: componentsArgument(z).optional(),
15290
15294
  repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; a child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
15291
15295
  })
@@ -15297,7 +15301,7 @@ var dispatchToolSpecs = [
15297
15301
  priority: 1,
15298
15302
  before: "DSP-2"
15299
15303
  },
15300
- description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue. Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
15304
+ description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue, and every ask on it then waits on the project's default " + "assignee: a question reaches the person it was handed to, else the issue's assignee, else " + "the project's default assignee, so every question reaches a person. " + "Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
15301
15305
  arguments: (z) => ({
15302
15306
  issue: z.string().describe(ISSUE_REFERENCE),
15303
15307
  status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
@@ -15305,7 +15309,7 @@ var dispatchToolSpecs = [
15305
15309
  title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
15306
15310
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Replacement label set, at most 20 labels of up to 40 characters; replaces every existing label.").optional(),
15307
15311
  priority: z.number({ int: true, min: 0, max: 3 }).nullable().optional().describe("Coarse priority: 0 is P0 (highest) through 3 is P3 (lowest); null clears it."),
15308
- assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
15312
+ assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
15309
15313
  external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
15310
15314
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
15311
15315
  parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
@@ -15561,7 +15565,7 @@ var dispatchToolSpecs = [
15561
15565
  {
15562
15566
  name: "dispatch_request_approval",
15563
15567
  example: { issue: "DSP-1", summary: "A live sync replaces the nightly export." },
15564
- description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
15568
+ description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. " + "The request reaches the person it was handed to, else the issue's assignee, else the " + "project's default assignee, so it always reaches a person, and this tool's answer names " + "that person. " + "An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
15565
15569
  arguments: (z) => ({
15566
15570
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
15567
15571
  project: z.string().describe("Project key owning the document.").optional(),
@@ -15720,10 +15724,11 @@ var dispatchToolSpecs = [
15720
15724
  {
15721
15725
  name: "dispatch_project",
15722
15726
  example: { key: "CORE", name: "Core" },
15723
- description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. When no person ` + "asked for a project and an existing project already covers the work, do not create a project. File an " + "issue in that project with dispatch issue.",
15727
+ description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. ` + "Every project names a default assignee, the person its unowned work lands on: the login " + "default_assignee names, else the person creating the project, else the person your " + "credential acts for. A call that names none under a credential acting for no person is " + "refused with 400 INVALID_PROJECT naming default_assignee, so ask a person who it should " + "be rather than choosing one. A login nobody has signed in with is refused with 400 " + "ASSIGNEE_NOT_ALLOWED. The answer names the default the project took. When no person " + "asked for a project and an existing project already covers the work, do not create a project. File an " + "issue in that project with dispatch issue.",
15724
15728
  arguments: (z) => ({
15725
15729
  key: z.string().describe("The new project's key, such as CORE."),
15726
- name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`)
15730
+ name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`),
15731
+ default_assignee: z.string().describe("Email of the person the project's unowned work lands on: a new issue with no assignee, and every question on an issue nobody holds. It must name a person who has signed in to Dispatch. Left out, it falls to the person creating the project, else the person your credential acts for; a credential that acts for nobody must name it.").optional()
15727
15732
  }),
15728
15733
  strict: true
15729
15734
  },
@@ -15770,7 +15775,7 @@ var dispatchToolSpecs = [
15770
15775
  {
15771
15776
  name: "dispatch_whoami",
15772
15777
  example: {},
15773
- description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
15778
+ description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
15774
15779
  arguments: () => ({}),
15775
15780
  strict: true
15776
15781
  },
@@ -22737,13 +22742,15 @@ function openAskAge(ageSeconds) {
22737
22742
  const days = Math.floor(hours / 24);
22738
22743
  return `${days}d${hours % 24 === 0 ? "" : ` ${hours % 24}h`}`;
22739
22744
  }
22740
- function openAskAskedOf(ask) {
22741
- const person = ask.waiting_on_person;
22742
- return person === undefined || person === "" ? "nobody" : person;
22745
+ function namedPerson(person) {
22746
+ return person === undefined || person === "" ? undefined : person;
22747
+ }
22748
+ function waitsOnPerson(ask) {
22749
+ return namedPerson(ask.waiting_on_person);
22743
22750
  }
22744
22751
  function openAskLine(ask, baseUrl) {
22745
22752
  const priority = ask.priority === null ? "" : `P${ask.priority} \xB7 `;
22746
- return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${openAskAskedOf(ask)} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
22753
+ return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${waitsOnPerson(ask) ?? "nobody"} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
22747
22754
  }
22748
22755
  function formatOpenAsksSummary(response, baseUrl) {
22749
22756
  const scope = "active open asks you authored on open issues and project documents";
@@ -23211,9 +23218,10 @@ async function askCommand(context) {
23211
23218
  });
23212
23219
  const declinedLines = ask.issue_key === null ? [] : declinedAskLines(ask.advice, ask.issue_key, linkBase);
23213
23220
  const adviceLines = await otherAdviceLines(() => renderAdvice(input.tool, askOwner.label, ask.advice, {}));
23221
+ const asked = waitsOnPerson(ask);
23214
23222
  return {
23215
23223
  text: [
23216
- `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency}): ${ask.question}`,
23224
+ `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency})${asked === undefined ? "" : `, waiting on ${asked}`}: ${ask.question}`,
23217
23225
  ...checkLines,
23218
23226
  ...declinedLines,
23219
23227
  await followsAsk(askOwner, input.subscriptions),
@@ -23799,9 +23807,10 @@ async function requestApprovalCommand(context) {
23799
23807
  }
23800
23808
  const details = await followedAskDetails(client, result.ask, resolved.artifact);
23801
23809
  const outcome = result.recorded ? `Approval requested for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}).` : `The approval request for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}) already waits on the human, so this call changed nothing: nothing since it last reached the human (a newer version, a human's reply in its thread, or your progress note) left it waiting on you.`;
23810
+ const waitsOn = waitsOnPerson(result.ask);
23802
23811
  return {
23803
23812
  text: [
23804
- `${outcome} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
23813
+ `${outcome}${waitsOn === undefined ? "" : ` It waits on ${waitsOn}.`} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
23805
23814
  ...coverageLines
23806
23815
  ].join(`
23807
23816
  `),
@@ -24844,15 +24853,23 @@ async function projectCommand(context) {
24844
24853
  project = await client.createProject({
24845
24854
  key: stringArg(args, "key"),
24846
24855
  name: stringArg(args, "name"),
24856
+ ...defined("default_assignee", optionalString(args, "default_assignee")),
24847
24857
  actor
24848
24858
  });
24849
24859
  } catch (error) {
24850
24860
  throw refusalWithCode(error);
24851
24861
  }
24852
24862
  const href = new URL(`/projects/${encodeURIComponent(project.key)}`, linkBase).toString();
24863
+ const projectDefault = namedPerson(project.default_assignee);
24853
24864
  return {
24854
- text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}`,
24855
- details: { project: project.key, name: project.name, created_at: project.created_at }
24865
+ text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}` + (projectDefault === undefined ? "" : `
24866
+ Its unowned work lands on ${projectDefault}: a question on an issue nobody holds reaches them.`),
24867
+ details: {
24868
+ project: project.key,
24869
+ name: project.name,
24870
+ created_at: project.created_at,
24871
+ ...defined("default_assignee", projectDefault)
24872
+ }
24856
24873
  };
24857
24874
  }
24858
24875
  async function projectsCommand(context) {
@@ -25445,7 +25462,7 @@ async function whoamiCommand(context) {
25445
25462
  const proved = identity.kind === "agent" ? identity.session ?? null : null;
25446
25463
  const project = identity.kind === "agent" ? identity.project ?? null : null;
25447
25464
  const session = proved ?? sessionId;
25448
- const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, else nobody.";
25465
+ const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
25449
25466
  const signInNeeded = owner === null && service !== null && proved !== null;
25450
25467
  const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
25451
25468
  const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";
@@ -36431,7 +36431,6 @@ var ProjectSchema = strictObject({
36431
36431
  gated_steps: array(_enum2(GATED_STEPS)).optional(),
36432
36432
  created_at: string2()
36433
36433
  }).readonly();
36434
- var ProjectDefaultAssigneeSchema = strictObject({ project: string2(), assignee: string2().nullable() }).readonly();
36435
36434
  var RepoProjectSchema = strictObject({
36436
36435
  repo: string2(),
36437
36436
  project: string2(),
@@ -36453,6 +36452,11 @@ var ArchitectureSourceSchema = strictObject({
36453
36452
  components: number2().int()
36454
36453
  }).readonly();
36455
36454
  var RepoProjectUpdatedEventPayloadSchema = strictObject({ mapping: RepoProjectSchema, deleted: boolean2() }).readonly();
36455
+ var ProjectDefaultAssigneeUpdatedEventPayloadSchema = strictObject({
36456
+ project: string2(),
36457
+ assignee: string2().nullable(),
36458
+ thread_logins: array(string2()).optional()
36459
+ }).readonly();
36456
36460
  var ArchitectureSourceUpdatedEventPayloadSchema = strictObject({ source: ArchitectureSourceSchema, deleted: boolean2() }).readonly();
36457
36461
  var ArchitectureSyncedEventPayloadSchema = strictObject({
36458
36462
  repo: string2().optional(),
@@ -36670,7 +36674,7 @@ var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is
36670
36674
  var ASK_QUESTION_CONTRACT = "The question names the concrete case first: which machines, files, sessions or people, and the " + "numbers. It asks the choice in those terms, saying what happens to whom under each option " + '("Ship Friday and risk signing out 1,240 users, or hold to Monday?"), never "How should we ' + 'proceed?" or "Which option?", because a reader cannot work back from a general question to ' + "the case. It carries every fact the reader needs to decide and nothing " + "that does not change the decision. Generalize only after the specifics, if at all. Then give " + "your recommendation and its reason.";
36671
36675
  var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
36672
36676
  var ASK_IS_FOR_A_PERSON = "An ask is a question for a person, never a request to another agent. Ask an agent by envoy_send or a comment on the issue.";
36673
- var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on the issue's assignee until a person hands it on. No agent can hand one on.";
36677
+ var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on its asked-of person, else the issue's assignee, else the project's default assignee; no agent hands one on.";
36674
36678
  var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
36675
36679
  function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
36676
36680
  return {
@@ -36925,7 +36929,7 @@ var dispatchToolSpecs = [
36925
36929
  spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
36926
36930
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
36927
36931
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
36928
- assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee when it still names a person who has signed in, else unassigned. Set it only when a person said who owns the issue.").optional(),
36932
+ assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
36929
36933
  components: componentsArgument(z).optional(),
36930
36934
  repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; a child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
36931
36935
  })
@@ -36937,7 +36941,7 @@ var dispatchToolSpecs = [
36937
36941
  priority: 1,
36938
36942
  before: "DSP-2"
36939
36943
  },
36940
- description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue. Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
36944
+ description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue, and every ask on it then waits on the project's default " + "assignee: a question reaches the person it was handed to, else the issue's assignee, else " + "the project's default assignee, so every question reaches a person. " + "Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
36941
36945
  arguments: (z) => ({
36942
36946
  issue: z.string().describe(ISSUE_REFERENCE),
36943
36947
  status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
@@ -36945,7 +36949,7 @@ var dispatchToolSpecs = [
36945
36949
  title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
36946
36950
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Replacement label set, at most 20 labels of up to 40 characters; replaces every existing label.").optional(),
36947
36951
  priority: z.number({ int: true, min: 0, max: 3 }).nullable().optional().describe("Coarse priority: 0 is P0 (highest) through 3 is P3 (lowest); null clears it."),
36948
- assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
36952
+ assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
36949
36953
  external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
36950
36954
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
36951
36955
  parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
@@ -37201,7 +37205,7 @@ var dispatchToolSpecs = [
37201
37205
  {
37202
37206
  name: "dispatch_request_approval",
37203
37207
  example: { issue: "DSP-1", summary: "A live sync replaces the nightly export." },
37204
- description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
37208
+ description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. " + "The request reaches the person it was handed to, else the issue's assignee, else the " + "project's default assignee, so it always reaches a person, and this tool's answer names " + "that person. " + "An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
37205
37209
  arguments: (z) => ({
37206
37210
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
37207
37211
  project: z.string().describe("Project key owning the document.").optional(),
@@ -37360,10 +37364,11 @@ var dispatchToolSpecs = [
37360
37364
  {
37361
37365
  name: "dispatch_project",
37362
37366
  example: { key: "CORE", name: "Core" },
37363
- description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. When no person ` + "asked for a project and an existing project already covers the work, do not create a project. File an " + "issue in that project with dispatch issue.",
37367
+ description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. ` + "Every project names a default assignee, the person its unowned work lands on: the login " + "default_assignee names, else the person creating the project, else the person your " + "credential acts for. A call that names none under a credential acting for no person is " + "refused with 400 INVALID_PROJECT naming default_assignee, so ask a person who it should " + "be rather than choosing one. A login nobody has signed in with is refused with 400 " + "ASSIGNEE_NOT_ALLOWED. The answer names the default the project took. When no person " + "asked for a project and an existing project already covers the work, do not create a project. File an " + "issue in that project with dispatch issue.",
37364
37368
  arguments: (z) => ({
37365
37369
  key: z.string().describe("The new project's key, such as CORE."),
37366
- name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`)
37370
+ name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`),
37371
+ default_assignee: z.string().describe("Email of the person the project's unowned work lands on: a new issue with no assignee, and every question on an issue nobody holds. It must name a person who has signed in to Dispatch. Left out, it falls to the person creating the project, else the person your credential acts for; a credential that acts for nobody must name it.").optional()
37367
37372
  }),
37368
37373
  strict: true
37369
37374
  },
@@ -37410,7 +37415,7 @@ var dispatchToolSpecs = [
37410
37415
  {
37411
37416
  name: "dispatch_whoami",
37412
37417
  example: {},
37413
- description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
37418
+ description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
37414
37419
  arguments: () => ({}),
37415
37420
  strict: true
37416
37421
  },
@@ -49139,13 +49144,15 @@ function openAskAge(ageSeconds) {
49139
49144
  const days = Math.floor(hours / 24);
49140
49145
  return `${days}d${hours % 24 === 0 ? "" : ` ${hours % 24}h`}`;
49141
49146
  }
49142
- function openAskAskedOf(ask) {
49143
- const person = ask.waiting_on_person;
49144
- return person === undefined || person === "" ? "nobody" : person;
49147
+ function namedPerson(person) {
49148
+ return person === undefined || person === "" ? undefined : person;
49149
+ }
49150
+ function waitsOnPerson(ask) {
49151
+ return namedPerson(ask.waiting_on_person);
49145
49152
  }
49146
49153
  function openAskLine(ask, baseUrl) {
49147
49154
  const priority = ask.priority === null ? "" : `P${ask.priority} \xB7 `;
49148
- return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${openAskAskedOf(ask)} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
49155
+ return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${waitsOnPerson(ask) ?? "nobody"} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
49149
49156
  }
49150
49157
  function formatOpenAsksSummary(response, baseUrl) {
49151
49158
  const scope = "active open asks you authored on open issues and project documents";
@@ -49548,9 +49555,10 @@ async function askCommand(context) {
49548
49555
  });
49549
49556
  const declinedLines = ask.issue_key === null ? [] : declinedAskLines(ask.advice, ask.issue_key, linkBase);
49550
49557
  const adviceLines = await otherAdviceLines(() => renderAdvice(input.tool, askOwner.label, ask.advice, {}));
49558
+ const asked = waitsOnPerson(ask);
49551
49559
  return {
49552
49560
  text: [
49553
- `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency}): ${ask.question}`,
49561
+ `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency})${asked === undefined ? "" : `, waiting on ${asked}`}: ${ask.question}`,
49554
49562
  ...checkLines,
49555
49563
  ...declinedLines,
49556
49564
  await followsAsk(askOwner, input.subscriptions),
@@ -50136,9 +50144,10 @@ async function requestApprovalCommand(context) {
50136
50144
  }
50137
50145
  const details = await followedAskDetails(client, result.ask, resolved.artifact);
50138
50146
  const outcome = result.recorded ? `Approval requested for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}).` : `The approval request for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}) already waits on the human, so this call changed nothing: nothing since it last reached the human (a newer version, a human's reply in its thread, or your progress note) left it waiting on you.`;
50147
+ const waitsOn = waitsOnPerson(result.ask);
50139
50148
  return {
50140
50149
  text: [
50141
- `${outcome} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
50150
+ `${outcome}${waitsOn === undefined ? "" : ` It waits on ${waitsOn}.`} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
50142
50151
  ...coverageLines
50143
50152
  ].join(`
50144
50153
  `),
@@ -51181,15 +51190,23 @@ async function projectCommand(context) {
51181
51190
  project = await client.createProject({
51182
51191
  key: stringArg(args, "key"),
51183
51192
  name: stringArg(args, "name"),
51193
+ ...defined("default_assignee", optionalString(args, "default_assignee")),
51184
51194
  actor
51185
51195
  });
51186
51196
  } catch (error) {
51187
51197
  throw refusalWithCode(error);
51188
51198
  }
51189
51199
  const href = new URL(`/projects/${encodeURIComponent(project.key)}`, linkBase).toString();
51200
+ const projectDefault = namedPerson(project.default_assignee);
51190
51201
  return {
51191
- text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}`,
51192
- details: { project: project.key, name: project.name, created_at: project.created_at }
51202
+ text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}` + (projectDefault === undefined ? "" : `
51203
+ Its unowned work lands on ${projectDefault}: a question on an issue nobody holds reaches them.`),
51204
+ details: {
51205
+ project: project.key,
51206
+ name: project.name,
51207
+ created_at: project.created_at,
51208
+ ...defined("default_assignee", projectDefault)
51209
+ }
51193
51210
  };
51194
51211
  }
51195
51212
  async function projectsCommand(context) {
@@ -51750,7 +51767,7 @@ async function whoamiCommand(context) {
51750
51767
  const proved = identity.kind === "agent" ? identity.session ?? null : null;
51751
51768
  const project = identity.kind === "agent" ? identity.project ?? null : null;
51752
51769
  const session = proved ?? sessionId;
51753
- const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, else nobody.";
51770
+ const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
51754
51771
  const signInNeeded = owner === null && service !== null && proved !== null;
51755
51772
  const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
51756
51773
  const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";
@@ -56182,7 +56199,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
56182
56199
 
56183
56200
  // package.json
56184
56201
  var name = "@sjawhar/claude-envoy";
56185
- var version2 = "2.12.0";
56202
+ var version2 = "2.13.0";
56186
56203
  var legion = {
56187
56204
  daemonApiVersion: 98
56188
56205
  };
@@ -13778,7 +13778,6 @@ var ProjectSchema = strictObject({
13778
13778
  gated_steps: array(_enum2(GATED_STEPS)).optional(),
13779
13779
  created_at: string2()
13780
13780
  }).readonly();
13781
- var ProjectDefaultAssigneeSchema = strictObject({ project: string2(), assignee: string2().nullable() }).readonly();
13782
13781
  var RepoProjectSchema = strictObject({
13783
13782
  repo: string2(),
13784
13783
  project: string2(),
@@ -13800,6 +13799,11 @@ var ArchitectureSourceSchema = strictObject({
13800
13799
  components: number2().int()
13801
13800
  }).readonly();
13802
13801
  var RepoProjectUpdatedEventPayloadSchema = strictObject({ mapping: RepoProjectSchema, deleted: boolean2() }).readonly();
13802
+ var ProjectDefaultAssigneeUpdatedEventPayloadSchema = strictObject({
13803
+ project: string2(),
13804
+ assignee: string2().nullable(),
13805
+ thread_logins: array(string2()).optional()
13806
+ }).readonly();
13803
13807
  var ArchitectureSourceUpdatedEventPayloadSchema = strictObject({ source: ArchitectureSourceSchema, deleted: boolean2() }).readonly();
13804
13808
  var ArchitectureSyncedEventPayloadSchema = strictObject({
13805
13809
  repo: string2().optional(),
@@ -14017,7 +14021,7 @@ var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is
14017
14021
  var ASK_QUESTION_CONTRACT = "The question names the concrete case first: which machines, files, sessions or people, and the " + "numbers. It asks the choice in those terms, saying what happens to whom under each option " + '("Ship Friday and risk signing out 1,240 users, or hold to Monday?"), never "How should we ' + 'proceed?" or "Which option?", because a reader cannot work back from a general question to ' + "the case. It carries every fact the reader needs to decide and nothing " + "that does not change the decision. Generalize only after the specifics, if at all. Then give " + "your recommendation and its reason.";
14018
14022
  var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
14019
14023
  var ASK_IS_FOR_A_PERSON = "An ask is a question for a person, never a request to another agent. Ask an agent by envoy_send or a comment on the issue.";
14020
- var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on the issue's assignee until a person hands it on. No agent can hand one on.";
14024
+ var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on its asked-of person, else the issue's assignee, else the project's default assignee; no agent hands one on.";
14021
14025
  var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
14022
14026
  function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
14023
14027
  return {
@@ -14272,7 +14276,7 @@ var dispatchToolSpecs = [
14272
14276
  spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
14273
14277
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
14274
14278
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
14275
- assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee when it still names a person who has signed in, else unassigned. Set it only when a person said who owns the issue.").optional(),
14279
+ assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
14276
14280
  components: componentsArgument(z).optional(),
14277
14281
  repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; a child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
14278
14282
  })
@@ -14284,7 +14288,7 @@ var dispatchToolSpecs = [
14284
14288
  priority: 1,
14285
14289
  before: "DSP-2"
14286
14290
  },
14287
- description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue. Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
14291
+ description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue, and every ask on it then waits on the project's default " + "assignee: a question reaches the person it was handed to, else the issue's assignee, else " + "the project's default assignee, so every question reaches a person. " + "Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
14288
14292
  arguments: (z) => ({
14289
14293
  issue: z.string().describe(ISSUE_REFERENCE),
14290
14294
  status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
@@ -14292,7 +14296,7 @@ var dispatchToolSpecs = [
14292
14296
  title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
14293
14297
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Replacement label set, at most 20 labels of up to 40 characters; replaces every existing label.").optional(),
14294
14298
  priority: z.number({ int: true, min: 0, max: 3 }).nullable().optional().describe("Coarse priority: 0 is P0 (highest) through 3 is P3 (lowest); null clears it."),
14295
- assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
14299
+ assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
14296
14300
  external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
14297
14301
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
14298
14302
  parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
@@ -14548,7 +14552,7 @@ var dispatchToolSpecs = [
14548
14552
  {
14549
14553
  name: "dispatch_request_approval",
14550
14554
  example: { issue: "DSP-1", summary: "A live sync replaces the nightly export." },
14551
- description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
14555
+ description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. " + "The request reaches the person it was handed to, else the issue's assignee, else the " + "project's default assignee, so it always reaches a person, and this tool's answer names " + "that person. " + "An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
14552
14556
  arguments: (z) => ({
14553
14557
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
14554
14558
  project: z.string().describe("Project key owning the document.").optional(),
@@ -14707,10 +14711,11 @@ var dispatchToolSpecs = [
14707
14711
  {
14708
14712
  name: "dispatch_project",
14709
14713
  example: { key: "CORE", name: "Core" },
14710
- description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. When no person ` + "asked for a project and an existing project already covers the work, do not create a project. File an " + "issue in that project with dispatch issue.",
14714
+ description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. ` + "Every project names a default assignee, the person its unowned work lands on: the login " + "default_assignee names, else the person creating the project, else the person your " + "credential acts for. A call that names none under a credential acting for no person is " + "refused with 400 INVALID_PROJECT naming default_assignee, so ask a person who it should " + "be rather than choosing one. A login nobody has signed in with is refused with 400 " + "ASSIGNEE_NOT_ALLOWED. The answer names the default the project took. When no person " + "asked for a project and an existing project already covers the work, do not create a project. File an " + "issue in that project with dispatch issue.",
14711
14715
  arguments: (z) => ({
14712
14716
  key: z.string().describe("The new project's key, such as CORE."),
14713
- name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`)
14717
+ name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`),
14718
+ default_assignee: z.string().describe("Email of the person the project's unowned work lands on: a new issue with no assignee, and every question on an issue nobody holds. It must name a person who has signed in to Dispatch. Left out, it falls to the person creating the project, else the person your credential acts for; a credential that acts for nobody must name it.").optional()
14714
14719
  }),
14715
14720
  strict: true
14716
14721
  },
@@ -14757,7 +14762,7 @@ var dispatchToolSpecs = [
14757
14762
  {
14758
14763
  name: "dispatch_whoami",
14759
14764
  example: {},
14760
- description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
14765
+ description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
14761
14766
  arguments: () => ({}),
14762
14767
  strict: true
14763
14768
  },
@@ -21741,13 +21746,15 @@ function openAskAge(ageSeconds) {
21741
21746
  const days = Math.floor(hours / 24);
21742
21747
  return `${days}d${hours % 24 === 0 ? "" : ` ${hours % 24}h`}`;
21743
21748
  }
21744
- function openAskAskedOf(ask) {
21745
- const person = ask.waiting_on_person;
21746
- return person === undefined || person === "" ? "nobody" : person;
21749
+ function namedPerson(person) {
21750
+ return person === undefined || person === "" ? undefined : person;
21751
+ }
21752
+ function waitsOnPerson(ask) {
21753
+ return namedPerson(ask.waiting_on_person);
21747
21754
  }
21748
21755
  function openAskLine(ask, baseUrl) {
21749
21756
  const priority = ask.priority === null ? "" : `P${ask.priority} \xB7 `;
21750
- return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${openAskAskedOf(ask)} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
21757
+ return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${waitsOnPerson(ask) ?? "nobody"} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
21751
21758
  }
21752
21759
  function formatOpenAsksSummary(response, baseUrl) {
21753
21760
  const scope = "active open asks you authored on open issues and project documents";
@@ -22215,9 +22222,10 @@ async function askCommand(context) {
22215
22222
  });
22216
22223
  const declinedLines = ask.issue_key === null ? [] : declinedAskLines(ask.advice, ask.issue_key, linkBase);
22217
22224
  const adviceLines = await otherAdviceLines(() => renderAdvice(input.tool, askOwner.label, ask.advice, {}));
22225
+ const asked = waitsOnPerson(ask);
22218
22226
  return {
22219
22227
  text: [
22220
- `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency}): ${ask.question}`,
22228
+ `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency})${asked === undefined ? "" : `, waiting on ${asked}`}: ${ask.question}`,
22221
22229
  ...checkLines,
22222
22230
  ...declinedLines,
22223
22231
  await followsAsk(askOwner, input.subscriptions),
@@ -22803,9 +22811,10 @@ async function requestApprovalCommand(context) {
22803
22811
  }
22804
22812
  const details = await followedAskDetails(client, result.ask, resolved.artifact);
22805
22813
  const outcome = result.recorded ? `Approval requested for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}).` : `The approval request for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}) already waits on the human, so this call changed nothing: nothing since it last reached the human (a newer version, a human's reply in its thread, or your progress note) left it waiting on you.`;
22814
+ const waitsOn = waitsOnPerson(result.ask);
22806
22815
  return {
22807
22816
  text: [
22808
- `${outcome} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
22817
+ `${outcome}${waitsOn === undefined ? "" : ` It waits on ${waitsOn}.`} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
22809
22818
  ...coverageLines
22810
22819
  ].join(`
22811
22820
  `),
@@ -23848,15 +23857,23 @@ async function projectCommand(context) {
23848
23857
  project = await client.createProject({
23849
23858
  key: stringArg(args, "key"),
23850
23859
  name: stringArg(args, "name"),
23860
+ ...defined("default_assignee", optionalString(args, "default_assignee")),
23851
23861
  actor
23852
23862
  });
23853
23863
  } catch (error) {
23854
23864
  throw refusalWithCode(error);
23855
23865
  }
23856
23866
  const href = new URL(`/projects/${encodeURIComponent(project.key)}`, linkBase).toString();
23867
+ const projectDefault = namedPerson(project.default_assignee);
23857
23868
  return {
23858
- text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}`,
23859
- details: { project: project.key, name: project.name, created_at: project.created_at }
23869
+ text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}` + (projectDefault === undefined ? "" : `
23870
+ Its unowned work lands on ${projectDefault}: a question on an issue nobody holds reaches them.`),
23871
+ details: {
23872
+ project: project.key,
23873
+ name: project.name,
23874
+ created_at: project.created_at,
23875
+ ...defined("default_assignee", projectDefault)
23876
+ }
23860
23877
  };
23861
23878
  }
23862
23879
  async function projectsCommand(context) {
@@ -24449,7 +24466,7 @@ async function whoamiCommand(context) {
24449
24466
  const proved = identity.kind === "agent" ? identity.session ?? null : null;
24450
24467
  const project = identity.kind === "agent" ? identity.project ?? null : null;
24451
24468
  const session = proved ?? sessionId;
24452
- const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, else nobody.";
24469
+ const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
24453
24470
  const signInNeeded = owner === null && service !== null && proved !== null;
24454
24471
  const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
24455
24472
  const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";
@@ -26,8 +26,7 @@ legion({ op: "set_status", issue: "<report KEY>", status: "icebox" })
26
26
  ```
27
27
 
28
28
  With no person known, leave out `--assignee`: the issue then goes to your token's owner, or, under
29
- the shared token, to the project's default assignee when a person set one, and is otherwise
30
- unassigned.
29
+ the shared token, to the project's default assignee, which every project names.
31
30
 
32
31
  ## Keep it answerable
33
32
 
@@ -43,7 +42,8 @@ Each time you read it:
43
42
  (`400 ASSIGNEE_NOT_ALLOWED` names an email nobody has signed in to Dispatch with): name it, with
44
43
  its first line, in your summary.
45
44
  - While `Assignee:` says `unassigned`, open each report with one sentence asking a person to take
46
- the issue from its header, because its asks reach only the Inbox's `Unassigned` filter.
45
+ the issue from its header, because until someone does, its asks go to the project's default
46
+ assignee and not to the person the report is for.
47
47
 
48
48
  ## When
49
49
 
@@ -141,7 +141,7 @@ architect for it, whatever it asks. For a person's mention, take the first of th
141
141
  no label and waits for a person to hand it over. Never label a request outside the scope the
142
142
  deployment instructions state. Reply with the new issue's key, its title, the link and assignee
143
143
  the `Created` line names (naming nobody, Dispatch assigns the issue to your token's owner, or,
144
- under the shared token, to the project's default assignee when a person set one),
144
+ under the shared token, to the project's default assignee, which every project names),
145
145
  and whether Legion will take it: with the label, triage admits it in its next turn unless a
146
146
  person's request says to wait or puts it out of scope. That request is the request itself, the
147
147
  deployment instructions, or a line of the weekly plan that names the person's request behind it.
@@ -72,14 +72,14 @@ Read this on a `triage` wake, at every start, and when a person hands you an iss
72
72
  work is done, folded into another issue (name it) or no longer needed.
73
73
  For a root you admitted, say in that comment who will be asked: `Assigned to <login>,
74
74
  who will get this tree's questions and its design approval`, or, when `Assignee:` says
75
- `unassigned`, `Unassigned — nobody's Inbox shows this tree's questions or its design approval
76
- until someone takes it from the issue header (Assignee, beside Priority)`. Promise the design
77
- approval only when your system prompt's `Design gate steps:` sentence names at least one step;
78
- when it reads `Design gate steps: none.` nobody approves a design, so drop "and its design
79
- approval" (and "or its design approval"). Take the assignee from the read, never
80
- from how the issue was created, because an issue filed with no assignee still lands on the
81
- project's default assignee where a person set one. An unassigned root still runs, but its
82
- architect's asks reach only the Inbox's `Unassigned` filter.
75
+ `unassigned`, `Unassigned — this tree's questions and its design approval go to the project's
76
+ default assignee until someone takes it from the issue header (Assignee, beside Priority)`.
77
+ Promise the design approval only when your system prompt's `Design gate steps:` sentence names
78
+ at least one step; when it reads `Design gate steps: none.` nobody approves a design, so drop
79
+ "and its design approval". Take the assignee from the read, never from how the issue was
80
+ created: an issue filed with no assignee lands on the project's default assignee, which every
81
+ project names, but a person can clear an assignee later, and a root with none still has its
82
+ architect's asks reach the project's default assignee.
83
83
 
84
84
  ## Label an issue for a person
85
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",
@@ -15,7 +15,7 @@ Dispatch is a record for the people who decide, never a log of your work.
15
15
  ## Asks and ask blocks
16
16
 
17
17
  - An ask is a question for a person, never a request to another agent. Ask an agent by envoy_send or a comment on the issue.
18
- - An ask waits on the issue's assignee until a person hands it on. No agent can hand one on.
18
+ - An ask waits on its asked-of person, else the issue's assignee, else the project's default assignee; no agent hands one on.
19
19
  - A design question's ask block ends its section:
20
20
 
21
21
  ```md