@sjawhar/opencode-legion-envoy 1.6.1 → 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/src/server.js +26 -16
- package/package.json +1 -1
- package/skills/dispatch/SKILL.md +10 -8
package/dist/src/server.js
CHANGED
|
@@ -13565,6 +13565,7 @@ var DispatchEventSchema = object({
|
|
|
13565
13565
|
});
|
|
13566
13566
|
var IssueEventPayloadSchema = object({
|
|
13567
13567
|
title: string2().optional(),
|
|
13568
|
+
labels: array(string2()).optional(),
|
|
13568
13569
|
status: string2().optional(),
|
|
13569
13570
|
rank: string2().optional(),
|
|
13570
13571
|
route: string2().nullish()
|
|
@@ -13740,7 +13741,8 @@ var dispatchToolSpecs = [
|
|
|
13740
13741
|
parent: z.string().describe("Optional parent issue.").optional(),
|
|
13741
13742
|
external: z.string().describe("Optional external issue reference.").optional(),
|
|
13742
13743
|
force: z.boolean().describe("Create even though POSSIBLE_DUPLICATE listed similar issues; pass it only after reading them.").optional(),
|
|
13743
|
-
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_GUIDANCE}`).optional()
|
|
13744
|
+
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_GUIDANCE}`).optional(),
|
|
13745
|
+
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()
|
|
13744
13746
|
})
|
|
13745
13747
|
},
|
|
13746
13748
|
{
|
|
@@ -13749,7 +13751,7 @@ var dispatchToolSpecs = [
|
|
|
13749
13751
|
arguments: (z) => ({
|
|
13750
13752
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
13751
13753
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
13752
|
-
artifact: z.string().describe("Project document slug or
|
|
13754
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename.").optional(),
|
|
13753
13755
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
13754
13756
|
question: z.string({ max: 800 }).describe("Decision question, at most 800 characters."),
|
|
13755
13757
|
options: z.array(z.object({
|
|
@@ -13802,7 +13804,7 @@ var dispatchToolSpecs = [
|
|
|
13802
13804
|
arguments: (z) => ({
|
|
13803
13805
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
13804
13806
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
13805
|
-
artifact: z.string().describe("
|
|
13807
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename required when quote is given.").optional(),
|
|
13806
13808
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
13807
13809
|
quote: z.string().describe("Optional exact quoted document text.").optional(),
|
|
13808
13810
|
occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based occurrence of quote.").optional(),
|
|
@@ -13818,7 +13820,7 @@ var dispatchToolSpecs = [
|
|
|
13818
13820
|
arguments: (z) => ({
|
|
13819
13821
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
13820
13822
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
13821
|
-
artifact: z.string().describe("
|
|
13823
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename containing the quoted text; optional when ref names it.").optional(),
|
|
13822
13824
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
13823
13825
|
quote: z.string().describe("Exact document text to replace."),
|
|
13824
13826
|
replace_with: z.string().describe("Replacement text."),
|
|
@@ -13842,7 +13844,7 @@ var dispatchToolSpecs = [
|
|
|
13842
13844
|
arguments: (z) => ({
|
|
13843
13845
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
13844
13846
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
13845
|
-
artifact: z.string().describe("
|
|
13847
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename; optional when ref names it.").optional(),
|
|
13846
13848
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
13847
13849
|
ops: z.array(z.object({
|
|
13848
13850
|
op: z.enum(DOC_EDIT_OPS).describe("Edit operation."),
|
|
@@ -13863,7 +13865,7 @@ var dispatchToolSpecs = [
|
|
|
13863
13865
|
arguments: (z) => ({
|
|
13864
13866
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
13865
13867
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
13866
|
-
artifact: z.string().describe("Optional artifact slug or
|
|
13868
|
+
artifact: z.string().describe("Optional project document artifact id, slug, or filename; primary document by default for an issue.").optional(),
|
|
13867
13869
|
version: z.number({ int: true, min: 1 }).describe("Optional version number.").optional(),
|
|
13868
13870
|
ref: z.string().describe("Optional dispatch:// document reference.").optional()
|
|
13869
13871
|
}),
|
|
@@ -13875,7 +13877,7 @@ var dispatchToolSpecs = [
|
|
|
13875
13877
|
arguments: (z) => ({
|
|
13876
13878
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
13877
13879
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
13878
|
-
artifact: z.string().describe("
|
|
13880
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename; primary document by default for an issue.").optional()
|
|
13879
13881
|
}),
|
|
13880
13882
|
validation: documentOwnerValidation(true)
|
|
13881
13883
|
},
|
|
@@ -13904,7 +13906,7 @@ var dispatchToolSpecs = [
|
|
|
13904
13906
|
arguments: (z) => ({
|
|
13905
13907
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
13906
13908
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
13907
|
-
artifact: z.string().describe("Project document slug or
|
|
13909
|
+
artifact: z.string().describe("Project document artifact id, slug, or filename.").optional(),
|
|
13908
13910
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional()
|
|
13909
13911
|
}),
|
|
13910
13912
|
validation: documentOwnerValidation(true)
|
|
@@ -14704,6 +14706,9 @@ class DispatchClient {
|
|
|
14704
14706
|
async docRead(id, version) {
|
|
14705
14707
|
return version === undefined ? this.#json("GET", ["api", "v1", "artifacts", id, "text"]) : this.#json("GET", ["api", "v1", "artifacts", id, "versions", String(version)]);
|
|
14706
14708
|
}
|
|
14709
|
+
async artifactBlocks(id) {
|
|
14710
|
+
return this.#json("GET", ["api", "v1", "artifacts", id, "blocks"]);
|
|
14711
|
+
}
|
|
14707
14712
|
async docEdit(id, input) {
|
|
14708
14713
|
return this.#json("POST", ["api", "v1", "artifacts", id, "edits"], input);
|
|
14709
14714
|
}
|
|
@@ -15014,7 +15019,7 @@ async function resolveOwnerArguments(tool, args, cwd, env, exec) {
|
|
|
15014
15019
|
return { args, ref: null, owner: null };
|
|
15015
15020
|
const refArgument = args.ref;
|
|
15016
15021
|
const ref = typeof refArgument === "string" ? parseDispatchRef(refArgument) ?? (() => {
|
|
15017
|
-
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
|
|
15022
|
+
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)");
|
|
15018
15023
|
})() : null;
|
|
15019
15024
|
const issueArgument = args.issue;
|
|
15020
15025
|
const projectArgument = args.project;
|
|
@@ -15095,14 +15100,16 @@ async function resolveArtifact(client, owner, artifactReference) {
|
|
|
15095
15100
|
if (!(error instanceof DispatchServiceError) || error.status !== 404)
|
|
15096
15101
|
throw error;
|
|
15097
15102
|
const artifacts = await client.listProjectArtifacts(owner.project, true);
|
|
15098
|
-
const
|
|
15099
|
-
if (
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15103
|
+
const artifact = artifacts.find((candidate) => candidate.id === artifactReference) ?? artifacts.find((candidate) => candidate.slug === artifactReference);
|
|
15104
|
+
if (artifact)
|
|
15105
|
+
return { owner, artifact };
|
|
15106
|
+
const names = artifacts.filter((candidate) => candidate.name === artifactReference);
|
|
15107
|
+
if (names.length > 1) {
|
|
15108
|
+
throw new Error(`artifact name ${artifactReference} is ambiguous in project ${owner.project}; ` + `${names.length} documents share it \u2014 use its slug instead`);
|
|
15109
|
+
}
|
|
15110
|
+
if (names[0] === undefined)
|
|
15104
15111
|
throw error;
|
|
15105
|
-
return { owner, artifact };
|
|
15112
|
+
return { owner, artifact: names[0] };
|
|
15106
15113
|
}
|
|
15107
15114
|
}
|
|
15108
15115
|
const issue = await client.getIssue(owner.issue);
|
|
@@ -15153,6 +15160,7 @@ function issueSummary(issue, events, references) {
|
|
|
15153
15160
|
`Title: ${issue.title}`,
|
|
15154
15161
|
`Key: ${issue.key}`,
|
|
15155
15162
|
`Status: ${issue.status}`,
|
|
15163
|
+
`Labels: ${issue.labels.length === 0 ? "none" : issue.labels.join(", ")}`,
|
|
15156
15164
|
`Route: ${issue.route ?? "none"}`,
|
|
15157
15165
|
...specApproval === undefined ? [] : [`Spec ${specApproval.replace(/^Approval/, "approval")}`],
|
|
15158
15166
|
"Open asks:",
|
|
@@ -15285,6 +15293,7 @@ async function executeDispatchTool(input) {
|
|
|
15285
15293
|
const external = optionalString(args, "external");
|
|
15286
15294
|
const force = optionalBoolean(args, "force");
|
|
15287
15295
|
const spec = optionalString(args, "spec");
|
|
15296
|
+
const labels = args.labels;
|
|
15288
15297
|
try {
|
|
15289
15298
|
const created = await client.issue({
|
|
15290
15299
|
project,
|
|
@@ -15293,6 +15302,7 @@ async function executeDispatchTool(input) {
|
|
|
15293
15302
|
...external === undefined ? {} : { external },
|
|
15294
15303
|
...force === undefined ? {} : { force },
|
|
15295
15304
|
...spec === undefined ? {} : { spec },
|
|
15305
|
+
...Array.isArray(labels) ? { labels } : {},
|
|
15296
15306
|
actor
|
|
15297
15307
|
});
|
|
15298
15308
|
return {
|
package/package.json
CHANGED
package/skills/dispatch/SKILL.md
CHANGED
|
@@ -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.
|