@sjawhar/pi-envoy 17.11.0 → 17.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dispatch.js CHANGED
@@ -14700,7 +14700,6 @@ var ProjectSchema = strictObject({
14700
14700
  gated_steps: array(_enum2(GATED_STEPS)).optional(),
14701
14701
  created_at: string2()
14702
14702
  }).readonly();
14703
- var ProjectDefaultAssigneeSchema = strictObject({ project: string2(), assignee: string2().nullable() }).readonly();
14704
14703
  var RepoProjectSchema = strictObject({
14705
14704
  repo: string2(),
14706
14705
  project: string2(),
@@ -14722,6 +14721,11 @@ var ArchitectureSourceSchema = strictObject({
14722
14721
  components: number2().int()
14723
14722
  }).readonly();
14724
14723
  var RepoProjectUpdatedEventPayloadSchema = strictObject({ mapping: RepoProjectSchema, deleted: boolean2() }).readonly();
14724
+ var ProjectDefaultAssigneeUpdatedEventPayloadSchema = strictObject({
14725
+ project: string2(),
14726
+ assignee: string2().nullable(),
14727
+ thread_logins: array(string2()).optional()
14728
+ }).readonly();
14725
14729
  var ArchitectureSourceUpdatedEventPayloadSchema = strictObject({ source: ArchitectureSourceSchema, deleted: boolean2() }).readonly();
14726
14730
  var ArchitectureSyncedEventPayloadSchema = strictObject({
14727
14731
  repo: string2().optional(),
@@ -14939,7 +14943,7 @@ var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is
14939
14943
  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.";
14940
14944
  var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
14941
14945
  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.";
14942
- 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.";
14946
+ 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.";
14943
14947
  var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
14944
14948
  function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
14945
14949
  return {
@@ -15194,7 +15198,7 @@ var dispatchToolSpecs = [
15194
15198
  spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
15195
15199
  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(),
15196
15200
  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(),
15197
- 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(),
15201
+ 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(),
15198
15202
  components: componentsArgument(z).optional(),
15199
15203
  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()
15200
15204
  })
@@ -15206,7 +15210,7 @@ var dispatchToolSpecs = [
15206
15210
  priority: 1,
15207
15211
  before: "DSP-2"
15208
15212
  },
15209
- 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}`,
15213
+ 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}`,
15210
15214
  arguments: (z) => ({
15211
15215
  issue: z.string().describe(ISSUE_REFERENCE),
15212
15216
  status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
@@ -15214,7 +15218,7 @@ var dispatchToolSpecs = [
15214
15218
  title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
15215
15219
  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(),
15216
15220
  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."),
15217
- 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."),
15221
+ 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."),
15218
15222
  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(),
15219
15223
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
15220
15224
  parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
@@ -15470,7 +15474,7 @@ var dispatchToolSpecs = [
15470
15474
  {
15471
15475
  name: "dispatch_request_approval",
15472
15476
  example: { issue: "DSP-1", summary: "A live sync replaces the nightly export." },
15473
- 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,
15477
+ 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,
15474
15478
  arguments: (z) => ({
15475
15479
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
15476
15480
  project: z.string().describe("Project key owning the document.").optional(),
@@ -15629,10 +15633,11 @@ var dispatchToolSpecs = [
15629
15633
  {
15630
15634
  name: "dispatch_project",
15631
15635
  example: { key: "CORE", name: "Core" },
15632
- 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.",
15636
+ 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.",
15633
15637
  arguments: (z) => ({
15634
15638
  key: z.string().describe("The new project's key, such as CORE."),
15635
- name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`)
15639
+ name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`),
15640
+ 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()
15636
15641
  }),
15637
15642
  strict: true
15638
15643
  },
@@ -15679,7 +15684,7 @@ var dispatchToolSpecs = [
15679
15684
  {
15680
15685
  name: "dispatch_whoami",
15681
15686
  example: {},
15682
- 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.",
15687
+ 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.",
15683
15688
  arguments: () => ({}),
15684
15689
  strict: true
15685
15690
  },
@@ -21397,13 +21402,15 @@ function openAskAge(ageSeconds) {
21397
21402
  const days = Math.floor(hours / 24);
21398
21403
  return `${days}d${hours % 24 === 0 ? "" : ` ${hours % 24}h`}`;
21399
21404
  }
21400
- function openAskAskedOf(ask) {
21401
- const person = ask.waiting_on_person;
21402
- return person === undefined || person === "" ? "nobody" : person;
21405
+ function namedPerson(person) {
21406
+ return person === undefined || person === "" ? undefined : person;
21407
+ }
21408
+ function waitsOnPerson(ask) {
21409
+ return namedPerson(ask.waiting_on_person);
21403
21410
  }
21404
21411
  function openAskLine(ask, baseUrl) {
21405
21412
  const priority = ask.priority === null ? "" : `P${ask.priority} \xB7 `;
21406
- 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()}`;
21413
+ 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()}`;
21407
21414
  }
21408
21415
  function formatOpenAsksSummary(response, baseUrl) {
21409
21416
  const scope = "active open asks you authored on open issues and project documents";
@@ -21845,9 +21852,10 @@ async function askCommand(context) {
21845
21852
  });
21846
21853
  const declinedLines = ask.issue_key === null ? [] : declinedAskLines(ask.advice, ask.issue_key, linkBase);
21847
21854
  const adviceLines = await otherAdviceLines(() => renderAdvice(input.tool, askOwner.label, ask.advice, {}));
21855
+ const asked = waitsOnPerson(ask);
21848
21856
  return {
21849
21857
  text: [
21850
- `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency}): ${ask.question}`,
21858
+ `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency})${asked === undefined ? "" : `, waiting on ${asked}`}: ${ask.question}`,
21851
21859
  ...checkLines,
21852
21860
  ...declinedLines,
21853
21861
  await followsAsk(askOwner, input.subscriptions),
@@ -22433,9 +22441,10 @@ async function requestApprovalCommand(context) {
22433
22441
  }
22434
22442
  const details = await followedAskDetails(client, result.ask, resolved.artifact);
22435
22443
  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.`;
22444
+ const waitsOn = waitsOnPerson(result.ask);
22436
22445
  return {
22437
22446
  text: [
22438
- `${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.`,
22447
+ `${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.`,
22439
22448
  ...coverageLines
22440
22449
  ].join(`
22441
22450
  `),
@@ -23478,15 +23487,23 @@ async function projectCommand(context) {
23478
23487
  project = await client.createProject({
23479
23488
  key: stringArg(args, "key"),
23480
23489
  name: stringArg(args, "name"),
23490
+ ...defined("default_assignee", optionalString(args, "default_assignee")),
23481
23491
  actor
23482
23492
  });
23483
23493
  } catch (error) {
23484
23494
  throw refusalWithCode(error);
23485
23495
  }
23486
23496
  const href = new URL(`/projects/${encodeURIComponent(project.key)}`, linkBase).toString();
23497
+ const projectDefault = namedPerson(project.default_assignee);
23487
23498
  return {
23488
- text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}`,
23489
- details: { project: project.key, name: project.name, created_at: project.created_at }
23499
+ text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}` + (projectDefault === undefined ? "" : `
23500
+ Its unowned work lands on ${projectDefault}: a question on an issue nobody holds reaches them.`),
23501
+ details: {
23502
+ project: project.key,
23503
+ name: project.name,
23504
+ created_at: project.created_at,
23505
+ ...defined("default_assignee", projectDefault)
23506
+ }
23490
23507
  };
23491
23508
  }
23492
23509
  async function projectsCommand(context) {
@@ -23854,7 +23871,7 @@ async function whoamiCommand(context) {
23854
23871
  const proved = identity.kind === "agent" ? identity.session ?? null : null;
23855
23872
  const project = identity.kind === "agent" ? identity.project ?? null : null;
23856
23873
  const session = proved ?? sessionId;
23857
- 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.";
23874
+ 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.";
23858
23875
  const signInNeeded = owner === null && service !== null && proved !== null;
23859
23876
  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}`;
23860
23877
  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}.` : "";
package/dist/envoy.js CHANGED
@@ -29792,7 +29792,6 @@ var ProjectSchema = strictObject({
29792
29792
  gated_steps: array(_enum2(GATED_STEPS)).optional(),
29793
29793
  created_at: string2()
29794
29794
  }).readonly();
29795
- var ProjectDefaultAssigneeSchema = strictObject({ project: string2(), assignee: string2().nullable() }).readonly();
29796
29795
  var RepoProjectSchema = strictObject({
29797
29796
  repo: string2(),
29798
29797
  project: string2(),
@@ -29814,6 +29813,11 @@ var ArchitectureSourceSchema = strictObject({
29814
29813
  components: number2().int()
29815
29814
  }).readonly();
29816
29815
  var RepoProjectUpdatedEventPayloadSchema = strictObject({ mapping: RepoProjectSchema, deleted: boolean2() }).readonly();
29816
+ var ProjectDefaultAssigneeUpdatedEventPayloadSchema = strictObject({
29817
+ project: string2(),
29818
+ assignee: string2().nullable(),
29819
+ thread_logins: array(string2()).optional()
29820
+ }).readonly();
29817
29821
  var ArchitectureSourceUpdatedEventPayloadSchema = strictObject({ source: ArchitectureSourceSchema, deleted: boolean2() }).readonly();
29818
29822
  var ArchitectureSyncedEventPayloadSchema = strictObject({
29819
29823
  repo: string2().optional(),
@@ -30032,7 +30036,7 @@ var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is
30032
30036
  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.";
30033
30037
  var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
30034
30038
  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.";
30035
- 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.";
30039
+ 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.";
30036
30040
  var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
30037
30041
  function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
30038
30042
  return {
@@ -30287,7 +30291,7 @@ var dispatchToolSpecs = [
30287
30291
  spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
30288
30292
  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(),
30289
30293
  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(),
30290
- 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(),
30294
+ 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(),
30291
30295
  components: componentsArgument(z).optional(),
30292
30296
  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()
30293
30297
  })
@@ -30299,7 +30303,7 @@ var dispatchToolSpecs = [
30299
30303
  priority: 1,
30300
30304
  before: "DSP-2"
30301
30305
  },
30302
- 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}`,
30306
+ 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}`,
30303
30307
  arguments: (z) => ({
30304
30308
  issue: z.string().describe(ISSUE_REFERENCE),
30305
30309
  status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
@@ -30307,7 +30311,7 @@ var dispatchToolSpecs = [
30307
30311
  title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
30308
30312
  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(),
30309
30313
  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."),
30310
- 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."),
30314
+ 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."),
30311
30315
  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(),
30312
30316
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
30313
30317
  parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
@@ -30563,7 +30567,7 @@ var dispatchToolSpecs = [
30563
30567
  {
30564
30568
  name: "dispatch_request_approval",
30565
30569
  example: { issue: "DSP-1", summary: "A live sync replaces the nightly export." },
30566
- 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,
30570
+ 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,
30567
30571
  arguments: (z) => ({
30568
30572
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
30569
30573
  project: z.string().describe("Project key owning the document.").optional(),
@@ -30722,10 +30726,11 @@ var dispatchToolSpecs = [
30722
30726
  {
30723
30727
  name: "dispatch_project",
30724
30728
  example: { key: "CORE", name: "Core" },
30725
- 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.",
30729
+ 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.",
30726
30730
  arguments: (z) => ({
30727
30731
  key: z.string().describe("The new project's key, such as CORE."),
30728
- name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`)
30732
+ name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`),
30733
+ 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()
30729
30734
  }),
30730
30735
  strict: true
30731
30736
  },
@@ -30772,7 +30777,7 @@ var dispatchToolSpecs = [
30772
30777
  {
30773
30778
  name: "dispatch_whoami",
30774
30779
  example: {},
30775
- 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.",
30780
+ 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.",
30776
30781
  arguments: () => ({}),
30777
30782
  strict: true
30778
30783
  },
@@ -41911,13 +41916,15 @@ function openAskAge(ageSeconds) {
41911
41916
  const days = Math.floor(hours / 24);
41912
41917
  return `${days}d${hours % 24 === 0 ? "" : ` ${hours % 24}h`}`;
41913
41918
  }
41914
- function openAskAskedOf(ask) {
41915
- const person = ask.waiting_on_person;
41916
- return person === undefined || person === "" ? "nobody" : person;
41919
+ function namedPerson(person) {
41920
+ return person === undefined || person === "" ? undefined : person;
41921
+ }
41922
+ function waitsOnPerson(ask) {
41923
+ return namedPerson(ask.waiting_on_person);
41917
41924
  }
41918
41925
  function openAskLine(ask, baseUrl) {
41919
41926
  const priority = ask.priority === null ? "" : `P${ask.priority} \xB7 `;
41920
- 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()}`;
41927
+ 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()}`;
41921
41928
  }
41922
41929
  function formatOpenAsksSummary(response, baseUrl) {
41923
41930
  const scope = "active open asks you authored on open issues and project documents";
@@ -42320,9 +42327,10 @@ async function askCommand(context) {
42320
42327
  });
42321
42328
  const declinedLines = ask.issue_key === null ? [] : declinedAskLines(ask.advice, ask.issue_key, linkBase);
42322
42329
  const adviceLines = await otherAdviceLines(() => renderAdvice(input.tool, askOwner.label, ask.advice, {}));
42330
+ const asked = waitsOnPerson(ask);
42323
42331
  return {
42324
42332
  text: [
42325
- `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency}): ${ask.question}`,
42333
+ `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency})${asked === undefined ? "" : `, waiting on ${asked}`}: ${ask.question}`,
42326
42334
  ...checkLines,
42327
42335
  ...declinedLines,
42328
42336
  await followsAsk(askOwner, input.subscriptions),
@@ -42908,9 +42916,10 @@ async function requestApprovalCommand(context) {
42908
42916
  }
42909
42917
  const details = await followedAskDetails(client, result.ask, resolved.artifact);
42910
42918
  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.`;
42919
+ const waitsOn = waitsOnPerson(result.ask);
42911
42920
  return {
42912
42921
  text: [
42913
- `${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.`,
42922
+ `${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.`,
42914
42923
  ...coverageLines
42915
42924
  ].join(`
42916
42925
  `),
@@ -43953,15 +43962,23 @@ async function projectCommand(context) {
43953
43962
  project = await client.createProject({
43954
43963
  key: stringArg(args, "key"),
43955
43964
  name: stringArg(args, "name"),
43965
+ ...defined("default_assignee", optionalString(args, "default_assignee")),
43956
43966
  actor
43957
43967
  });
43958
43968
  } catch (error) {
43959
43969
  throw refusalWithCode(error);
43960
43970
  }
43961
43971
  const href = new URL(`/projects/${encodeURIComponent(project.key)}`, linkBase).toString();
43972
+ const projectDefault = namedPerson(project.default_assignee);
43962
43973
  return {
43963
- text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}`,
43964
- details: { project: project.key, name: project.name, created_at: project.created_at }
43974
+ text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}` + (projectDefault === undefined ? "" : `
43975
+ Its unowned work lands on ${projectDefault}: a question on an issue nobody holds reaches them.`),
43976
+ details: {
43977
+ project: project.key,
43978
+ name: project.name,
43979
+ created_at: project.created_at,
43980
+ ...defined("default_assignee", projectDefault)
43981
+ }
43965
43982
  };
43966
43983
  }
43967
43984
  async function projectsCommand(context) {
@@ -44522,7 +44539,7 @@ async function whoamiCommand(context) {
44522
44539
  const proved = identity.kind === "agent" ? identity.session ?? null : null;
44523
44540
  const project = identity.kind === "agent" ? identity.project ?? null : null;
44524
44541
  const session = proved ?? sessionId;
44525
- 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.";
44542
+ 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.";
44526
44543
  const signInNeeded = owner === null && service !== null && proved !== null;
44527
44544
  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}`;
44528
44545
  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}.` : "";
@@ -46499,7 +46516,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
46499
46516
 
46500
46517
  // package.json
46501
46518
  var name = "@sjawhar/pi-envoy";
46502
- var version2 = "17.11.0";
46519
+ var version2 = "17.12.0";
46503
46520
  var package_default = {
46504
46521
  name,
46505
46522
  version: version2,
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-envoy",
3
- "version": "17.11.0",
3
+ "version": "17.12.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {