@sjawhar/pi-legion-envoy 1.6.0 → 1.8.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/envoy.js +26 -16
- package/dist/legion.js +26 -16
- package/dist/skills/dispatch/SKILL.md +10 -8
- package/package.json +1 -1
package/dist/envoy.js
CHANGED
|
@@ -29662,6 +29662,7 @@ var DispatchEventSchema = object({
|
|
|
29662
29662
|
});
|
|
29663
29663
|
var IssueEventPayloadSchema = object({
|
|
29664
29664
|
title: string2().optional(),
|
|
29665
|
+
labels: array(string2()).optional(),
|
|
29665
29666
|
status: string2().optional(),
|
|
29666
29667
|
rank: string2().optional(),
|
|
29667
29668
|
route: string2().nullish()
|
|
@@ -29837,7 +29838,8 @@ var dispatchToolSpecs = [
|
|
|
29837
29838
|
parent: z.string().describe("Optional parent issue.").optional(),
|
|
29838
29839
|
external: z.string().describe("Optional external issue reference.").optional(),
|
|
29839
29840
|
force: z.boolean().describe("Create even though POSSIBLE_DUPLICATE listed similar issues; pass it only after reading them.").optional(),
|
|
29840
|
-
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_GUIDANCE}`).optional()
|
|
29841
|
+
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_GUIDANCE}`).optional(),
|
|
29842
|
+
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()
|
|
29841
29843
|
})
|
|
29842
29844
|
},
|
|
29843
29845
|
{
|
|
@@ -29846,7 +29848,7 @@ var dispatchToolSpecs = [
|
|
|
29846
29848
|
arguments: (z) => ({
|
|
29847
29849
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29848
29850
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29849
|
-
artifact: z.string().describe("Project document slug or
|
|
29851
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename.").optional(),
|
|
29850
29852
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
29851
29853
|
question: z.string({ max: 800 }).describe("Decision question, at most 800 characters."),
|
|
29852
29854
|
options: z.array(z.object({
|
|
@@ -29899,7 +29901,7 @@ var dispatchToolSpecs = [
|
|
|
29899
29901
|
arguments: (z) => ({
|
|
29900
29902
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29901
29903
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29902
|
-
artifact: z.string().describe("
|
|
29904
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename required when quote is given.").optional(),
|
|
29903
29905
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
29904
29906
|
quote: z.string().describe("Optional exact quoted document text.").optional(),
|
|
29905
29907
|
occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based occurrence of quote.").optional(),
|
|
@@ -29915,7 +29917,7 @@ var dispatchToolSpecs = [
|
|
|
29915
29917
|
arguments: (z) => ({
|
|
29916
29918
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29917
29919
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29918
|
-
artifact: z.string().describe("
|
|
29920
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename containing the quoted text; optional when ref names it.").optional(),
|
|
29919
29921
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
29920
29922
|
quote: z.string().describe("Exact document text to replace."),
|
|
29921
29923
|
replace_with: z.string().describe("Replacement text."),
|
|
@@ -29939,7 +29941,7 @@ var dispatchToolSpecs = [
|
|
|
29939
29941
|
arguments: (z) => ({
|
|
29940
29942
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29941
29943
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29942
|
-
artifact: z.string().describe("
|
|
29944
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename; optional when ref names it.").optional(),
|
|
29943
29945
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
29944
29946
|
ops: z.array(z.object({
|
|
29945
29947
|
op: z.enum(DOC_EDIT_OPS).describe("Edit operation."),
|
|
@@ -29960,7 +29962,7 @@ var dispatchToolSpecs = [
|
|
|
29960
29962
|
arguments: (z) => ({
|
|
29961
29963
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29962
29964
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29963
|
-
artifact: z.string().describe("Optional artifact slug or
|
|
29965
|
+
artifact: z.string().describe("Optional project document artifact id, slug, or filename; primary document by default for an issue.").optional(),
|
|
29964
29966
|
version: z.number({ int: true, min: 1 }).describe("Optional version number.").optional(),
|
|
29965
29967
|
ref: z.string().describe("Optional dispatch:// document reference.").optional()
|
|
29966
29968
|
}),
|
|
@@ -29972,7 +29974,7 @@ var dispatchToolSpecs = [
|
|
|
29972
29974
|
arguments: (z) => ({
|
|
29973
29975
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29974
29976
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29975
|
-
artifact: z.string().describe("
|
|
29977
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename; primary document by default for an issue.").optional()
|
|
29976
29978
|
}),
|
|
29977
29979
|
validation: documentOwnerValidation(true)
|
|
29978
29980
|
},
|
|
@@ -30001,7 +30003,7 @@ var dispatchToolSpecs = [
|
|
|
30001
30003
|
arguments: (z) => ({
|
|
30002
30004
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
30003
30005
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
30004
|
-
artifact: z.string().describe("Project document slug or
|
|
30006
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename.").optional(),
|
|
30005
30007
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional()
|
|
30006
30008
|
}),
|
|
30007
30009
|
validation: documentOwnerValidation(true)
|
|
@@ -31582,6 +31584,9 @@ class DispatchClient {
|
|
|
31582
31584
|
async docRead(id, version) {
|
|
31583
31585
|
return version === undefined ? this.#json("GET", ["api", "v1", "artifacts", id, "text"]) : this.#json("GET", ["api", "v1", "artifacts", id, "versions", String(version)]);
|
|
31584
31586
|
}
|
|
31587
|
+
async artifactBlocks(id) {
|
|
31588
|
+
return this.#json("GET", ["api", "v1", "artifacts", id, "blocks"]);
|
|
31589
|
+
}
|
|
31585
31590
|
async docEdit(id, input) {
|
|
31586
31591
|
return this.#json("POST", ["api", "v1", "artifacts", id, "edits"], input);
|
|
31587
31592
|
}
|
|
@@ -31892,7 +31897,7 @@ async function resolveOwnerArguments(tool, args, cwd, env, exec) {
|
|
|
31892
31897
|
return { args, ref: null, owner: null };
|
|
31893
31898
|
const refArgument = args.ref;
|
|
31894
31899
|
const ref = typeof refArgument === "string" ? parseDispatchRef(refArgument) ?? (() => {
|
|
31895
|
-
throw new Error("ref must be a valid dispatch:// reference such as dispatch://KEY-1, " + "dispatch://KEY-1/ask/<uuid>, dispatch://KEY-1/comment/<uuid>, " + "dispatch://KEY-1/message/<uuid>, dispatch://KEY-1/artifact/<slug>, or " + "dispatch://PROJECT/artifact/<slug
|
|
31900
|
+
throw new Error("ref must be a valid dispatch:// reference such as dispatch://KEY-1, " + "dispatch://KEY-1/ask/<uuid>, dispatch://KEY-1/comment/<uuid>, " + "dispatch://KEY-1/message/<uuid>, dispatch://KEY-1/artifact/<slug>, or " + "dispatch://PROJECT/artifact/<document-ref> (an artifact id, slug, or filename)");
|
|
31896
31901
|
})() : null;
|
|
31897
31902
|
const issueArgument = args.issue;
|
|
31898
31903
|
const projectArgument = args.project;
|
|
@@ -31973,14 +31978,16 @@ async function resolveArtifact(client, owner, artifactReference) {
|
|
|
31973
31978
|
if (!(error instanceof DispatchServiceError) || error.status !== 404)
|
|
31974
31979
|
throw error;
|
|
31975
31980
|
const artifacts = await client.listProjectArtifacts(owner.project, true);
|
|
31976
|
-
const
|
|
31977
|
-
if (
|
|
31978
|
-
|
|
31979
|
-
|
|
31980
|
-
|
|
31981
|
-
|
|
31981
|
+
const artifact = artifacts.find((candidate) => candidate.id === artifactReference) ?? artifacts.find((candidate) => candidate.slug === artifactReference);
|
|
31982
|
+
if (artifact)
|
|
31983
|
+
return { owner, artifact };
|
|
31984
|
+
const names = artifacts.filter((candidate) => candidate.name === artifactReference);
|
|
31985
|
+
if (names.length > 1) {
|
|
31986
|
+
throw new Error(`artifact name ${artifactReference} is ambiguous in project ${owner.project}; ` + `${names.length} documents share it \u2014 use its slug instead`);
|
|
31987
|
+
}
|
|
31988
|
+
if (names[0] === undefined)
|
|
31982
31989
|
throw error;
|
|
31983
|
-
return { owner, artifact };
|
|
31990
|
+
return { owner, artifact: names[0] };
|
|
31984
31991
|
}
|
|
31985
31992
|
}
|
|
31986
31993
|
const issue = await client.getIssue(owner.issue);
|
|
@@ -32031,6 +32038,7 @@ function issueSummary(issue, events, references) {
|
|
|
32031
32038
|
`Title: ${issue.title}`,
|
|
32032
32039
|
`Key: ${issue.key}`,
|
|
32033
32040
|
`Status: ${issue.status}`,
|
|
32041
|
+
`Labels: ${issue.labels.length === 0 ? "none" : issue.labels.join(", ")}`,
|
|
32034
32042
|
`Route: ${issue.route ?? "none"}`,
|
|
32035
32043
|
...specApproval === undefined ? [] : [`Spec ${specApproval.replace(/^Approval/, "approval")}`],
|
|
32036
32044
|
"Open asks:",
|
|
@@ -32163,6 +32171,7 @@ async function executeDispatchTool(input) {
|
|
|
32163
32171
|
const external = optionalString(args, "external");
|
|
32164
32172
|
const force = optionalBoolean(args, "force");
|
|
32165
32173
|
const spec = optionalString(args, "spec");
|
|
32174
|
+
const labels = args.labels;
|
|
32166
32175
|
try {
|
|
32167
32176
|
const created = await client.issue({
|
|
32168
32177
|
project,
|
|
@@ -32171,6 +32180,7 @@ async function executeDispatchTool(input) {
|
|
|
32171
32180
|
...external === undefined ? {} : { external },
|
|
32172
32181
|
...force === undefined ? {} : { force },
|
|
32173
32182
|
...spec === undefined ? {} : { spec },
|
|
32183
|
+
...Array.isArray(labels) ? { labels } : {},
|
|
32174
32184
|
actor
|
|
32175
32185
|
});
|
|
32176
32186
|
return {
|
package/dist/legion.js
CHANGED
|
@@ -29661,6 +29661,7 @@ var DispatchEventSchema = object({
|
|
|
29661
29661
|
});
|
|
29662
29662
|
var IssueEventPayloadSchema = object({
|
|
29663
29663
|
title: string2().optional(),
|
|
29664
|
+
labels: array(string2()).optional(),
|
|
29664
29665
|
status: string2().optional(),
|
|
29665
29666
|
rank: string2().optional(),
|
|
29666
29667
|
route: string2().nullish()
|
|
@@ -29836,7 +29837,8 @@ var dispatchToolSpecs = [
|
|
|
29836
29837
|
parent: z.string().describe("Optional parent issue.").optional(),
|
|
29837
29838
|
external: z.string().describe("Optional external issue reference.").optional(),
|
|
29838
29839
|
force: z.boolean().describe("Create even though POSSIBLE_DUPLICATE listed similar issues; pass it only after reading them.").optional(),
|
|
29839
|
-
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_GUIDANCE}`).optional()
|
|
29840
|
+
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_GUIDANCE}`).optional(),
|
|
29841
|
+
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()
|
|
29840
29842
|
})
|
|
29841
29843
|
},
|
|
29842
29844
|
{
|
|
@@ -29845,7 +29847,7 @@ var dispatchToolSpecs = [
|
|
|
29845
29847
|
arguments: (z) => ({
|
|
29846
29848
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29847
29849
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29848
|
-
artifact: z.string().describe("Project document slug or
|
|
29850
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename.").optional(),
|
|
29849
29851
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
29850
29852
|
question: z.string({ max: 800 }).describe("Decision question, at most 800 characters."),
|
|
29851
29853
|
options: z.array(z.object({
|
|
@@ -29898,7 +29900,7 @@ var dispatchToolSpecs = [
|
|
|
29898
29900
|
arguments: (z) => ({
|
|
29899
29901
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29900
29902
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29901
|
-
artifact: z.string().describe("
|
|
29903
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename required when quote is given.").optional(),
|
|
29902
29904
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
29903
29905
|
quote: z.string().describe("Optional exact quoted document text.").optional(),
|
|
29904
29906
|
occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based occurrence of quote.").optional(),
|
|
@@ -29914,7 +29916,7 @@ var dispatchToolSpecs = [
|
|
|
29914
29916
|
arguments: (z) => ({
|
|
29915
29917
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29916
29918
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29917
|
-
artifact: z.string().describe("
|
|
29919
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename containing the quoted text; optional when ref names it.").optional(),
|
|
29918
29920
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
29919
29921
|
quote: z.string().describe("Exact document text to replace."),
|
|
29920
29922
|
replace_with: z.string().describe("Replacement text."),
|
|
@@ -29938,7 +29940,7 @@ var dispatchToolSpecs = [
|
|
|
29938
29940
|
arguments: (z) => ({
|
|
29939
29941
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29940
29942
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29941
|
-
artifact: z.string().describe("
|
|
29943
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename; optional when ref names it.").optional(),
|
|
29942
29944
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
29943
29945
|
ops: z.array(z.object({
|
|
29944
29946
|
op: z.enum(DOC_EDIT_OPS).describe("Edit operation."),
|
|
@@ -29959,7 +29961,7 @@ var dispatchToolSpecs = [
|
|
|
29959
29961
|
arguments: (z) => ({
|
|
29960
29962
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29961
29963
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29962
|
-
artifact: z.string().describe("Optional artifact slug or
|
|
29964
|
+
artifact: z.string().describe("Optional project document artifact id, slug, or filename; primary document by default for an issue.").optional(),
|
|
29963
29965
|
version: z.number({ int: true, min: 1 }).describe("Optional version number.").optional(),
|
|
29964
29966
|
ref: z.string().describe("Optional dispatch:// document reference.").optional()
|
|
29965
29967
|
}),
|
|
@@ -29971,7 +29973,7 @@ var dispatchToolSpecs = [
|
|
|
29971
29973
|
arguments: (z) => ({
|
|
29972
29974
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
29973
29975
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
29974
|
-
artifact: z.string().describe("
|
|
29976
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename; primary document by default for an issue.").optional()
|
|
29975
29977
|
}),
|
|
29976
29978
|
validation: documentOwnerValidation(true)
|
|
29977
29979
|
},
|
|
@@ -30000,7 +30002,7 @@ var dispatchToolSpecs = [
|
|
|
30000
30002
|
arguments: (z) => ({
|
|
30001
30003
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
30002
30004
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
30003
|
-
artifact: z.string().describe("Project document slug or
|
|
30005
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename.").optional(),
|
|
30004
30006
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional()
|
|
30005
30007
|
}),
|
|
30006
30008
|
validation: documentOwnerValidation(true)
|
|
@@ -32008,6 +32010,9 @@ class DispatchClient {
|
|
|
32008
32010
|
async docRead(id, version) {
|
|
32009
32011
|
return version === undefined ? this.#json("GET", ["api", "v1", "artifacts", id, "text"]) : this.#json("GET", ["api", "v1", "artifacts", id, "versions", String(version)]);
|
|
32010
32012
|
}
|
|
32013
|
+
async artifactBlocks(id) {
|
|
32014
|
+
return this.#json("GET", ["api", "v1", "artifacts", id, "blocks"]);
|
|
32015
|
+
}
|
|
32011
32016
|
async docEdit(id, input) {
|
|
32012
32017
|
return this.#json("POST", ["api", "v1", "artifacts", id, "edits"], input);
|
|
32013
32018
|
}
|
|
@@ -32318,7 +32323,7 @@ async function resolveOwnerArguments(tool, args, cwd, env, exec) {
|
|
|
32318
32323
|
return { args, ref: null, owner: null };
|
|
32319
32324
|
const refArgument = args.ref;
|
|
32320
32325
|
const ref = typeof refArgument === "string" ? parseDispatchRef(refArgument) ?? (() => {
|
|
32321
|
-
throw new Error("ref must be a valid dispatch:// reference such as dispatch://KEY-1, " + "dispatch://KEY-1/ask/<uuid>, dispatch://KEY-1/comment/<uuid>, " + "dispatch://KEY-1/message/<uuid>, dispatch://KEY-1/artifact/<slug>, or " + "dispatch://PROJECT/artifact/<slug
|
|
32326
|
+
throw new Error("ref must be a valid dispatch:// reference such as dispatch://KEY-1, " + "dispatch://KEY-1/ask/<uuid>, dispatch://KEY-1/comment/<uuid>, " + "dispatch://KEY-1/message/<uuid>, dispatch://KEY-1/artifact/<slug>, or " + "dispatch://PROJECT/artifact/<document-ref> (an artifact id, slug, or filename)");
|
|
32322
32327
|
})() : null;
|
|
32323
32328
|
const issueArgument = args.issue;
|
|
32324
32329
|
const projectArgument = args.project;
|
|
@@ -32399,14 +32404,16 @@ async function resolveArtifact(client, owner, artifactReference) {
|
|
|
32399
32404
|
if (!(error instanceof DispatchServiceError) || error.status !== 404)
|
|
32400
32405
|
throw error;
|
|
32401
32406
|
const artifacts = await client.listProjectArtifacts(owner.project, true);
|
|
32402
|
-
const
|
|
32403
|
-
if (
|
|
32404
|
-
|
|
32405
|
-
|
|
32406
|
-
|
|
32407
|
-
|
|
32407
|
+
const artifact = artifacts.find((candidate) => candidate.id === artifactReference) ?? artifacts.find((candidate) => candidate.slug === artifactReference);
|
|
32408
|
+
if (artifact)
|
|
32409
|
+
return { owner, artifact };
|
|
32410
|
+
const names = artifacts.filter((candidate) => candidate.name === artifactReference);
|
|
32411
|
+
if (names.length > 1) {
|
|
32412
|
+
throw new Error(`artifact name ${artifactReference} is ambiguous in project ${owner.project}; ` + `${names.length} documents share it \u2014 use its slug instead`);
|
|
32413
|
+
}
|
|
32414
|
+
if (names[0] === undefined)
|
|
32408
32415
|
throw error;
|
|
32409
|
-
return { owner, artifact };
|
|
32416
|
+
return { owner, artifact: names[0] };
|
|
32410
32417
|
}
|
|
32411
32418
|
}
|
|
32412
32419
|
const issue = await client.getIssue(owner.issue);
|
|
@@ -32457,6 +32464,7 @@ function issueSummary(issue, events, references) {
|
|
|
32457
32464
|
`Title: ${issue.title}`,
|
|
32458
32465
|
`Key: ${issue.key}`,
|
|
32459
32466
|
`Status: ${issue.status}`,
|
|
32467
|
+
`Labels: ${issue.labels.length === 0 ? "none" : issue.labels.join(", ")}`,
|
|
32460
32468
|
`Route: ${issue.route ?? "none"}`,
|
|
32461
32469
|
...specApproval === undefined ? [] : [`Spec ${specApproval.replace(/^Approval/, "approval")}`],
|
|
32462
32470
|
"Open asks:",
|
|
@@ -32589,6 +32597,7 @@ async function executeDispatchTool(input) {
|
|
|
32589
32597
|
const external = optionalString(args, "external");
|
|
32590
32598
|
const force = optionalBoolean(args, "force");
|
|
32591
32599
|
const spec = optionalString(args, "spec");
|
|
32600
|
+
const labels = args.labels;
|
|
32592
32601
|
try {
|
|
32593
32602
|
const created = await client.issue({
|
|
32594
32603
|
project,
|
|
@@ -32597,6 +32606,7 @@ async function executeDispatchTool(input) {
|
|
|
32597
32606
|
...external === undefined ? {} : { external },
|
|
32598
32607
|
...force === undefined ? {} : { force },
|
|
32599
32608
|
...spec === undefined ? {} : { spec },
|
|
32609
|
+
...Array.isArray(labels) ? { labels } : {},
|
|
32600
32610
|
actor
|
|
32601
32611
|
});
|
|
32602
32612
|
return {
|
|
@@ -76,10 +76,11 @@ Issue reads include `rank`, the server-owned ordering key used by project boards
|
|
|
76
76
|
|
|
77
77
|
Architects create newly tracked child work with:
|
|
78
78
|
```ts
|
|
79
|
-
dispatch_issue({ project, title, parent?, external?, spec?, force
|
|
79
|
+
dispatch_issue({ project, title, parent?, external?, spec?, force?, labels?: string[] })
|
|
80
80
|
```
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
`labels` are optional initial labels: Dispatch trims them, preserves their case, and removes case-insensitive duplicates. It returns
|
|
82
|
+
`details` `{ issue, topic }`. Use `dispatch_issue` only to create an issue; never use it to park a question. When `spec` is supplied,
|
|
83
|
+
follow [Writing a spec](#writing-a-spec).
|
|
83
84
|
|
|
84
85
|
## Search first
|
|
85
86
|
|
|
@@ -188,7 +189,7 @@ Read the current document before changing it:
|
|
|
188
189
|
dispatch_doc_read({ issue?, project?, artifact?, version?, ref? })
|
|
189
190
|
```
|
|
190
191
|
It returns live or versioned markdown with open marks. `issue` with an omitted `artifact` reads the issue specification; a project needs
|
|
191
|
-
`artifact`; and a `dispatch://PROJECT/artifact/<
|
|
192
|
+
`artifact`; and a `dispatch://PROJECT/artifact/<document-ref>` ref supplies both, where `document-ref` is the id, slug, or filename.
|
|
192
193
|
|
|
193
194
|
```ts
|
|
194
195
|
dispatch_doc_edit({ issue?, project?, artifact, ops, summary? })
|
|
@@ -266,7 +267,8 @@ Exactly one of `issue` and `project` is required. A project upload creates an un
|
|
|
266
267
|
Exactly one of `path` and `content` is required. It returns issue or project-document owner details plus `artifact`, `version`, and its
|
|
267
268
|
write `topic`. Uploading the same `name` creates its next version — so uploading `spec.md` **replaces the issue's own specification**
|
|
268
269
|
with your text. Never do that: the spec is edited in place with `dispatch_doc_edit` (see [The Spec](#the-spec)). Address an existing
|
|
269
|
-
artifact by the slug shown in the upload result or by its filename
|
|
270
|
+
artifact by the slug shown in the upload result or by its filename, and a project document by its artifact id, slug, or filename; the
|
|
271
|
+
slug also arrives on `artifact.created` events.
|
|
270
272
|
|
|
271
273
|
## Messages
|
|
272
274
|
|
|
@@ -315,9 +317,9 @@ dispatch://KEY/artifact/<slug>[@vN]
|
|
|
315
317
|
dispatch://KEY/ask/<id>
|
|
316
318
|
dispatch://KEY/comment/<id>
|
|
317
319
|
dispatch://KEY/message/<id>
|
|
318
|
-
dispatch://PROJECT/artifact/<
|
|
319
|
-
dispatch://PROJECT/artifact/<
|
|
320
|
-
dispatch://PROJECT/artifact/<
|
|
320
|
+
dispatch://PROJECT/artifact/<document-ref>[@vN]
|
|
321
|
+
dispatch://PROJECT/artifact/<document-ref>/ask/<id>
|
|
322
|
+
dispatch://PROJECT/artifact/<document-ref>/comment/<id>
|
|
321
323
|
```
|
|
322
324
|
|
|
323
325
|
A bare UUID or `KEY#seq` is not a reference; the `dispatch://` form is what Dispatch links and records.
|