tines 0.0.85 → 0.0.86
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/index.js +33 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3417,7 +3417,7 @@ var AGENT_GUIDELINES_NAME = "agent-guidelines";
|
|
|
3417
3417
|
var JOURNAL_NAME = "journal";
|
|
3418
3418
|
var AGENT_GUIDELINES_BODY = `You are an agent working on a Tines issue over its HTTP API / CLI. Beyond doing the work, leave the workspace smarter than you found it. Four places to write, chosen by who should inherit what you learned:
|
|
3419
3419
|
|
|
3420
|
-
- **Issue comments** \u2014 all prose about this issue: progress, findings, dead ends, questions, and instructions for whoever picks it up next. Pass the body on stdin with a quoted heredoc, so backticks, $VARS, quotes and apostrophes reach the thread untouched by the shell (
|
|
3420
|
+
- **Issue comments** \u2014 all prose about this issue: progress, findings, dead ends, questions, and instructions for whoever picks it up next. Pass the body on stdin with a quoted heredoc, so backticks, $VARS, quotes and apostrophes reach the thread untouched by the shell (\`tines issues comment-edit <ref> <comment-id>\` and \`comment-delete\` repair your own mis-posts, but a clean first post is cheaper):
|
|
3421
3421
|
|
|
3422
3422
|
\`\`\`
|
|
3423
3423
|
tines issues comment <project>/<number> - <<'EOF'
|
|
@@ -3572,6 +3572,8 @@ var DESCRIBERS = {
|
|
|
3572
3572
|
return segs;
|
|
3573
3573
|
},
|
|
3574
3574
|
"issue.commented": () => [text("commented on"), selfRef()],
|
|
3575
|
+
"issue.comment_edited": () => [text("edited a comment on"), selfRef()],
|
|
3576
|
+
"issue.comment_deleted": () => [text("deleted a comment on"), selfRef()],
|
|
3575
3577
|
"issue.link_added": linkSegments,
|
|
3576
3578
|
"issue.link_removed": linkSegments,
|
|
3577
3579
|
"issue.parked": (_ev, p) => [
|
|
@@ -3765,6 +3767,8 @@ function createApiClient(options) {
|
|
|
3765
3767
|
// Comments
|
|
3766
3768
|
listComments: (issueId, page = {}) => get(`/api/v1/issues/${issueId}/comments${query(page)}`),
|
|
3767
3769
|
createComment: (issueId, body) => request("POST", `/api/v1/issues/${issueId}/comments`, body),
|
|
3770
|
+
updateComment: (issueId, commentId, body) => request("PATCH", `/api/v1/issues/${issueId}/comments/${commentId}`, body),
|
|
3771
|
+
deleteComment: (issueId, commentId) => request("DELETE", `/api/v1/issues/${issueId}/comments/${commentId}`),
|
|
3768
3772
|
// Scheduled tasks
|
|
3769
3773
|
listSchedules: (filters = {}) => get(`/api/v1/schedules${query(filters)}`),
|
|
3770
3774
|
listProjectSchedules: (projectId, page = {}) => get(`/api/v1/projects/${projectId}/schedules${query(page)}`),
|
|
@@ -4018,6 +4022,10 @@ function quotaLabel(quota, stateName) {
|
|
|
4018
4022
|
);
|
|
4019
4023
|
return `state roster: default ${quota.default_limit} per state${overrides.length > 0 ? `, overrides: ${overrides.join(", ")}` : ""}`;
|
|
4020
4024
|
}
|
|
4025
|
+
function commentLines(comment) {
|
|
4026
|
+
const header = ` [${timestamp(comment.created_at)}] ${actorLabel(comment.actor)} (${comment.id})${comment.updated_at ? " (edited)" : ""}:`;
|
|
4027
|
+
return ["", header, ...comment.body.split("\n").map((line) => ` ${line}`)];
|
|
4028
|
+
}
|
|
4021
4029
|
function runRow(run) {
|
|
4022
4030
|
return [
|
|
4023
4031
|
run.id,
|
|
@@ -4543,9 +4551,7 @@ allowed actions: ${allowed.length ? allowed.join(", ") : "none (terminal state)"
|
|
|
4543
4551
|
console.log(`
|
|
4544
4552
|
comments (${issue.comments.length}):`);
|
|
4545
4553
|
for (const c of issue.comments) {
|
|
4546
|
-
console.log(
|
|
4547
|
-
[${timestamp(c.created_at)}] ${actorLabel(c.actor)}:`);
|
|
4548
|
-
for (const line of c.body.split("\n")) console.log(` ${line}`);
|
|
4554
|
+
for (const line of commentLines(c)) console.log(line);
|
|
4549
4555
|
}
|
|
4550
4556
|
}
|
|
4551
4557
|
}
|
|
@@ -4732,7 +4738,29 @@ function register2(program3) {
|
|
|
4732
4738
|
const issue = await resolveIssue(api, ref);
|
|
4733
4739
|
const comment = await api.createComment(issue.id, { body });
|
|
4734
4740
|
if (opts.json) return printJson(comment);
|
|
4735
|
-
console.log(
|
|
4741
|
+
console.log(
|
|
4742
|
+
`commented on ${issue.project_name}/#${issue.number} as ${actorLabel(comment.actor)} (id ${comment.id})`
|
|
4743
|
+
);
|
|
4744
|
+
});
|
|
4745
|
+
withCommon(
|
|
4746
|
+
issues.command("comment-edit <ref> <comment-id> <markdown>").description(`Replace the body of your own comment \u2014 Markdown body: ${BODY_VALUE_HELP}`).passThroughOptions()
|
|
4747
|
+
).action(async (ref, commentId, markdown, opts, command) => {
|
|
4748
|
+
if (helpGuard(command, markdown)) return;
|
|
4749
|
+
const body = readBodyValue(markdown);
|
|
4750
|
+
const api = client(opts);
|
|
4751
|
+
const issue = await resolveIssue(api, ref);
|
|
4752
|
+
const comment = await api.updateComment(issue.id, commentId, { body });
|
|
4753
|
+
if (opts.json) return printJson(comment);
|
|
4754
|
+
console.log(`edited comment ${comment.id} on ${issue.project_name}/#${issue.number}`);
|
|
4755
|
+
});
|
|
4756
|
+
withCommon(
|
|
4757
|
+
issues.command("comment-delete <ref> <comment-id>").description("Delete your own comment (the event keeps the record of the deletion)")
|
|
4758
|
+
).action(async (ref, commentId, opts) => {
|
|
4759
|
+
const api = client(opts);
|
|
4760
|
+
const issue = await resolveIssue(api, ref);
|
|
4761
|
+
await api.deleteComment(issue.id, commentId);
|
|
4762
|
+
if (opts.json) return printJson({ id: commentId, deleted: true });
|
|
4763
|
+
console.log(`deleted comment ${commentId} from ${issue.project_name}/#${issue.number}`);
|
|
4736
4764
|
});
|
|
4737
4765
|
withCommon(
|
|
4738
4766
|
issues.command("block <blocker> <blocked>").description("Record that <blocker> blocks <blocked> (advisory: transitions stay allowed)")
|