@neturely/okffs 0.8.0 → 0.10.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/CHANGELOG.md +16 -1
- package/README.md +27 -2
- package/dist/autopilot.d.ts +16 -0
- package/dist/autopilot.d.ts.map +1 -0
- package/dist/autopilot.js +42 -0
- package/dist/autopilot.js.map +1 -0
- package/dist/cli/banner.d.ts +17 -0
- package/dist/cli/banner.d.ts.map +1 -0
- package/dist/cli/banner.js +65 -0
- package/dist/cli/banner.js.map +1 -0
- package/dist/cli/env.d.ts +30 -0
- package/dist/cli/env.d.ts.map +1 -0
- package/dist/cli/env.js +171 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +77 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/manifest.d.ts +48 -0
- package/dist/cli/manifest.d.ts.map +1 -0
- package/dist/cli/manifest.js +312 -0
- package/dist/cli/manifest.js.map +1 -0
- package/dist/cli/probe.d.ts +32 -0
- package/dist/cli/probe.d.ts.map +1 -0
- package/dist/cli/probe.js +101 -0
- package/dist/cli/probe.js.map +1 -0
- package/dist/cli/sanity.d.ts +16 -0
- package/dist/cli/sanity.d.ts.map +1 -0
- package/dist/cli/sanity.js +99 -0
- package/dist/cli/sanity.js.map +1 -0
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +254 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -0
- package/dist/config.js.map +1 -1
- package/dist/github.d.ts +1 -0
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +53 -6
- package/dist/github.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -107
- package/dist/index.js.map +1 -1
- package/dist/prompts/setup.d.ts +18 -0
- package/dist/prompts/setup.d.ts.map +1 -0
- package/dist/prompts/setup.js +77 -0
- package/dist/prompts/setup.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +183 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/commit_and_update.d.ts +3 -0
- package/dist/tools/commit_and_update.d.ts.map +1 -1
- package/dist/tools/commit_and_update.js +6 -0
- package/dist/tools/commit_and_update.js.map +1 -1
- package/dist/tools/configure.d.ts +27 -0
- package/dist/tools/configure.d.ts.map +1 -0
- package/dist/tools/configure.js +91 -0
- package/dist/tools/configure.js.map +1 -0
- package/dist/tools/create_issue.d.ts.map +1 -1
- package/dist/tools/create_issue.js +24 -4
- package/dist/tools/create_issue.js.map +1 -1
- package/dist/tools/create_pull_request.d.ts +3 -0
- package/dist/tools/create_pull_request.d.ts.map +1 -1
- package/dist/tools/create_pull_request.js +9 -0
- package/dist/tools/create_pull_request.js.map +1 -1
- package/dist/tools/plan.d.ts.map +1 -1
- package/dist/tools/plan.js +11 -2
- package/dist/tools/plan.js.map +1 -1
- package/dist/tools/update_project_status.d.ts +2 -2
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -1,110 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
// okffs entrypoint (the package's single `okffs` bin).
|
|
3
|
+
//
|
|
4
|
+
// With no arguments it runs as an MCP server over stdio — how Claude Code and
|
|
5
|
+
// other MCP hosts launch it. With a CLI subcommand (`setup`, `login`, `--help`,
|
|
6
|
+
// `--version`) it dispatches to the CLI instead.
|
|
7
|
+
//
|
|
8
|
+
// The server is loaded via a DYNAMIC import so the CLI path never pulls in the
|
|
9
|
+
// tool chain (→ github.ts), which resolves the token/owner/repo at import time
|
|
10
|
+
// and throws when unconfigured — precisely the state `okffs setup` runs in.
|
|
2
11
|
import "dotenv/config";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import * as getIssue from "./tools/get_issue.js";
|
|
14
|
-
import * as commentIssue from "./tools/comment_issue.js";
|
|
15
|
-
import * as createIssuesFromList from "./tools/create_issues_from_list.js";
|
|
16
|
-
import * as plan from "./tools/plan.js";
|
|
17
|
-
import * as linkIssues from "./tools/link_issues.js";
|
|
18
|
-
import * as createPullRequest from "./tools/create_pull_request.js";
|
|
19
|
-
import * as commitAndUpdate from "./tools/commit_and_update.js";
|
|
20
|
-
import * as listPrReviewComments from "./tools/list_pr_review_comments.js";
|
|
21
|
-
import * as replyToReviewComment from "./tools/reply_to_review_comment.js";
|
|
22
|
-
import * as resolveReviewThread from "./tools/resolve_review_thread.js";
|
|
23
|
-
import * as prepareRelease from "./tools/prepare_release.js";
|
|
24
|
-
import * as updateProjectStatus from "./tools/update_project_status.js";
|
|
25
|
-
import * as setIssueFields from "./tools/set_issue_fields.js";
|
|
26
|
-
import * as updateIssue from "./tools/update_issue.js";
|
|
27
|
-
import * as promoteBranch from "./tools/promote_branch.js";
|
|
28
|
-
import * as mergePullRequest from "./tools/merge_pull_request.js";
|
|
29
|
-
import * as fixIntoBase from "./tools/fix_into_base.js";
|
|
30
|
-
import * as addressPrReview from "./prompts/address_pr_review.js";
|
|
31
|
-
import * as updateGuidance from "./prompts/update_guidance.js";
|
|
32
|
-
const tools = [createIssue, listIssues, closeIssue, deleteIssue, deleteBranch, getIssue, commentIssue, createIssuesFromList, plan, linkIssues, createPullRequest, commitAndUpdate, listPrReviewComments, replyToReviewComment, resolveReviewThread, prepareRelease, updateProjectStatus, setIssueFields, updateIssue, promoteBranch, mergePullRequest, fixIntoBase];
|
|
33
|
-
const prompts = [addressPrReview, updateGuidance];
|
|
34
|
-
// Read the package version so the server reports the real version (dist/index.js
|
|
35
|
-
// lives one level below package.json in both dev and the published package).
|
|
36
|
-
const version = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
37
|
-
// Server-level instructions: the MCP `initialize` result carries this string and
|
|
38
|
-
// hosts (Claude Code, etc.) surface it to the agent every session. It ships with
|
|
39
|
-
// the package version, so upgrading okffs automatically updates the guidance the
|
|
40
|
-
// agent sees — this is how new tools/behaviour get adopted instead of the agent
|
|
41
|
-
// defaulting to raw git/gh (#169). Keep it tight: it's always-on context. This is
|
|
42
|
-
// the machine-visible counterpart to the human-facing README/CLAUDE.md guidance.
|
|
43
|
-
const SERVER_INSTRUCTIONS = `okffs owns the GitHub issue → branch → PR → merge → close workflow (plus, when enabled, a GitHub Projects v2 board and releases).
|
|
44
|
-
|
|
45
|
-
ALWAYS reach for an okffs tool before raw git/gh/GraphQL when one covers the action — this is a correctness rule, not a style preference:
|
|
46
|
-
- Identity/permissions: okffs authenticates with the configured GITHUB_TOKEN (a PAT scoped for this repo, incl. Projects / org Issue Fields when set). Raw gh/git uses whatever ambient CLI token is signed in — often the wrong identity or missing the Projects/org scopes, so it fails or acts as the wrong user.
|
|
47
|
-
- Conventions: okffs applies branch naming ({issue}-{slug}), the **Branch:** issue link, Closes #N, board placement, changelog fragments, and the OKFFS_PROTECTED_BRANCH invariant. Hand-rolled gh/git silently skips all of that.
|
|
48
|
-
Fall back to raw git/gh ONLY when no okffs tool fits the action.
|
|
49
|
-
|
|
50
|
-
Common action → tool:
|
|
51
|
-
- Start work: create_issue (creates the issue, the linked branch, and the **Branch:** line that create_pull_request/commit_and_update rely on). Many at once: create_issues_from_list or plan.
|
|
52
|
-
- Progress: commit_and_update (stage + commit + push + issue comment) — prefer over raw git commit/push.
|
|
53
|
-
- Open/finalize an issue's PR (into the base branch): create_pull_request (always adds Closes #N).
|
|
54
|
-
- Promotion/release gate — a base→protected PR with no issue, e.g. develop→main: promote_branch (issue-less; adds the PR to the board; NEVER use raw \`gh pr create\` for this).
|
|
55
|
-
- Edit an existing issue's core fields (title, assignees, labels, milestone, body): update_issue — prefer over raw \`gh issue edit\`. (Board Priority/Effort is set_issue_fields; Status column is update_project_status — those aren't issue fields.)
|
|
56
|
-
- Board: create_issue sets an inferred priority/effort at creation; set them on an EXISTING issue with set_issue_fields; move columns with update_project_status (Backlog/Ready/In Progress/Review — Done is GitHub's own automation).
|
|
57
|
-
- PR review: list_pr_review_comments → fix → reply_to_review_comment → resolve_review_thread (honours OKFFS_RESOLVE_THREADS); or the /okffs:address_pr_review prompt.
|
|
58
|
-
- Release prep: prepare_release (bumps version + rolls the changelog; does NOT tag or publish).
|
|
59
|
-
- Land an issue PR into the BASE branch (e.g. develop): merge_pull_request — the one okffs action that merges. Opt-in (OKFFS_AUTO_MERGE_BASE=true) and heavily gated; it verifies checks/threads itself and NEVER touches OKFFS_PROTECTED_BRANCH. Off by default → it just declines.
|
|
60
|
-
- Land an ISSUE-LESS fix into the BASE branch (no issue, e.g. review-comment cleanups): fix_into_base — the mirror of promote_branch. Opens (always safe) then merges under the same OKFFS_AUTO_MERGE_BASE gating as merge_pull_request. Prefer over raw \`gh pr create\`/\`gh pr merge\`; never targets OKFFS_PROTECTED_BRANCH.
|
|
61
|
-
|
|
62
|
-
Rules: never merge, tag, or publish into OKFFS_PROTECTED_BRANCH autonomously — okffs may OPEN a PR into it (promote_branch), but the merge/tag are yours to hand back for. merge_pull_request only ever lands PRs into the base tier, never the protected branch. Destructive tools (delete_issue, delete_branch) require confirmed: true (call once to preview, again to act).`;
|
|
63
|
-
const server = new Server({ name: "okffs", version }, { capabilities: { tools: {}, prompts: {} }, instructions: SERVER_INSTRUCTIONS });
|
|
64
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
65
|
-
// A tool may export an async getDescription() to compute its description at
|
|
66
|
-
// list time (e.g. create_issue injects the board's real Priority/Effort options
|
|
67
|
-
// — #133). Fall back to the static description on absence or failure.
|
|
68
|
-
tools: await Promise.all(tools.map(async (t) => {
|
|
69
|
-
let description = t.description;
|
|
70
|
-
const getDescription = t.getDescription;
|
|
71
|
-
if (getDescription) {
|
|
72
|
-
try {
|
|
73
|
-
description = await getDescription();
|
|
74
|
-
}
|
|
75
|
-
catch (err) {
|
|
76
|
-
console.warn(`[okffs] getDescription() failed for ${t.name}, using static description:`, err instanceof Error ? err.message : err);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
name: t.name,
|
|
81
|
-
description,
|
|
82
|
-
inputSchema: zodToJsonSchema(t.inputSchema),
|
|
83
|
-
};
|
|
84
|
-
})),
|
|
85
|
-
}));
|
|
86
|
-
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
87
|
-
const tool = tools.find((t) => t.name === req.params.name);
|
|
88
|
-
if (!tool) {
|
|
89
|
-
throw new Error(`Unknown tool: ${req.params.name}`);
|
|
90
|
-
}
|
|
91
|
-
const input = tool.inputSchema.parse(req.params.arguments);
|
|
92
|
-
return tool.handler(input);
|
|
93
|
-
});
|
|
94
|
-
server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
95
|
-
prompts: prompts.map((p) => ({
|
|
96
|
-
name: p.name,
|
|
97
|
-
description: p.description,
|
|
98
|
-
arguments: p.argumentDefs,
|
|
99
|
-
})),
|
|
100
|
-
}));
|
|
101
|
-
server.setRequestHandler(GetPromptRequestSchema, async (req) => {
|
|
102
|
-
const prompt = prompts.find((p) => p.name === req.params.name);
|
|
103
|
-
if (!prompt) {
|
|
104
|
-
throw new Error(`Unknown prompt: ${req.params.name}`);
|
|
105
|
-
}
|
|
106
|
-
return prompt.build(req.params.arguments ?? {});
|
|
107
|
-
});
|
|
108
|
-
const transport = new StdioServerTransport();
|
|
109
|
-
await server.connect(transport);
|
|
12
|
+
import { isCliInvocation, runCli } from "./cli/index.js";
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
if (isCliInvocation(args)) {
|
|
15
|
+
const code = await runCli(args);
|
|
16
|
+
process.exit(code);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const { startServer } = await import("./server.js");
|
|
20
|
+
await startServer();
|
|
21
|
+
}
|
|
110
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,uDAAuD;AACvD,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,iDAAiD;AACjD,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,4EAA4E;AAC5E,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEzD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC;KAAM,CAAC;IACN,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;IACpD,MAAM,WAAW,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const name = "setup";
|
|
2
|
+
export declare const description = "Configure okffs for this repo conversationally, right here in the chat \u2014 the in-Claude-Code counterpart to the `okffs setup` CLI wizard. Interviews you for the settings that apply, then writes them to .env via the `configure` tool (preserving your own variables and comments).";
|
|
3
|
+
export declare const argumentDefs: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
}[];
|
|
8
|
+
export declare function build(args: Record<string, string | undefined>): {
|
|
9
|
+
description: string;
|
|
10
|
+
messages: {
|
|
11
|
+
role: "user";
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
};
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/prompts/setup.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,UAAU,CAAC;AAE5B,eAAO,MAAM,WAAW,8RACgQ,CAAC;AAEzR,eAAO,MAAM,YAAY;;;;GAMxB,CAAC;AAwBF,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;;;;;;;;;EA8C7D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { SECTIONS } from "../cli/manifest.js";
|
|
2
|
+
export const name = "setup";
|
|
3
|
+
export const description = "Configure okffs for this repo conversationally, right here in the chat — the in-Claude-Code counterpart to the `okffs setup` CLI wizard. Interviews you for the settings that apply, then writes them to .env via the `configure` tool (preserving your own variables and comments).";
|
|
4
|
+
export const argumentDefs = [
|
|
5
|
+
{
|
|
6
|
+
name: "mode",
|
|
7
|
+
description: "Optional: 'quick' (auth + repo + base branch only), 'full' (every section), or 'sync' (only options not yet configured). Defaults to sync when a .env exists, else asks.",
|
|
8
|
+
required: false,
|
|
9
|
+
},
|
|
10
|
+
];
|
|
11
|
+
// Render the manifest into a compact reference the model can drive the interview
|
|
12
|
+
// from, so the prompt is self-contained (no need to also expose the manifest as a
|
|
13
|
+
// resource). Mirrors how create_issue injects the board's real options.
|
|
14
|
+
function renderReference() {
|
|
15
|
+
const lines = [];
|
|
16
|
+
for (const s of SECTIONS) {
|
|
17
|
+
const gate = !s.gated
|
|
18
|
+
? "always ask"
|
|
19
|
+
: s.gateKey
|
|
20
|
+
? `gated — ask "${s.gatePrompt}" and record the answer as ${s.gateKey}=true/false`
|
|
21
|
+
: `gated — ask "${s.gatePrompt}"; if declined, mark its vars declined`;
|
|
22
|
+
const cond = s.onlyIf ? " [only if a protected branch is set]" : "";
|
|
23
|
+
lines.push(`\n### ${s.title} (${gate})${cond}`);
|
|
24
|
+
for (const v of s.vars) {
|
|
25
|
+
const opts = v.options ? ` options: ${v.options.map((o) => o || "(unset)").join("/")};` : "";
|
|
26
|
+
const def = v.default ? ` default: ${v.default};` : "";
|
|
27
|
+
lines.push(`- \`${v.key}\` (${v.kind});${opts}${def} ${v.description}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return lines.join("\n");
|
|
31
|
+
}
|
|
32
|
+
export function build(args) {
|
|
33
|
+
const mode = args.mode?.trim().toLowerCase();
|
|
34
|
+
const text = [
|
|
35
|
+
`Configure okffs for THIS repository by talking with the user, then persist the result by calling the \`configure\` tool. Do not edit .env yourself — \`configure\` owns the write (it preserves the user's own variables and comments, touching only okffs's marked block).`,
|
|
36
|
+
``,
|
|
37
|
+
`## 1. Assess current state`,
|
|
38
|
+
`- Read \`./.env\` in the current working directory if it exists (use your file-reading tool). Note which \`GITHUB_*\`/\`OKFFS_*\` variables are already set, and look for the \`# okffs:configured-version=…\` stamp.`,
|
|
39
|
+
`- **Never print or echo the value of GITHUB_TOKEN** (or any secret). Acknowledge it's set without showing it.`,
|
|
40
|
+
``,
|
|
41
|
+
`## 2. Choose breadth`,
|
|
42
|
+
mode
|
|
43
|
+
? `- The user requested **${mode}** mode.`
|
|
44
|
+
: `- No .env yet → ask the user: **Quick** (auth, repo, base branch only) or **Full** (every section). A .env already exists → default to **sync**: only ask about variables that are not yet set. Offer "reconfigure everything" if they want a full pass.`,
|
|
45
|
+
`- In sync/upgrade situations, only ask about variables that are missing — leave already-configured values alone unless the user asks to change them.`,
|
|
46
|
+
``,
|
|
47
|
+
`## 3. Interview`,
|
|
48
|
+
`- Go section by section using the reference below. For a **gated** section, ask its single gate question first; if the user declines, skip the whole group (and include those vars in \`declined\`).`,
|
|
49
|
+
`- For each variable: show already-set values (mask the token) with a keep/change choice; for unset ones, give the short description and default and let the user set or skip.`,
|
|
50
|
+
`- For \`GITHUB_TOKEN\`: mention they can leave it blank to use the GitHub CLI (\`gh auth token\`), and share the fine-grained PAT URL from the reference. Let them paste a token OR choose the gh fallback — don't force it.`,
|
|
51
|
+
`- Keep it brief and batch related questions; don't interrogate one variable at a time when a section can be covered together.`,
|
|
52
|
+
``,
|
|
53
|
+
`## 4. Persist`,
|
|
54
|
+
`- Call \`configure\` once with:`,
|
|
55
|
+
` - \`set\`: a map of every variable the user gave a value for (booleans as "true"/"false").`,
|
|
56
|
+
` - \`declined\`: every OPTIONAL variable the user explicitly skipped (so a later sync won't re-ask it). Don't list variables you never brought up.`,
|
|
57
|
+
`- Then relay \`configure\`'s summary and remind the user to **restart the MCP server / Claude Code** so okffs re-reads .env.`,
|
|
58
|
+
``,
|
|
59
|
+
`## 5. Notes`,
|
|
60
|
+
`- Booleans that default on (inference/metadata) should stay on unless the user wants them off.`,
|
|
61
|
+
`- If the user wants \`OKFFS_AUTO_MERGE_BASE=true\`, confirm \`OKFFS_PROTECTED_BRANCH\` is also set — the merge tool refuses without it.`,
|
|
62
|
+
`- The Projects and promotion sections only matter if the user uses a GitHub Projects board / a protected-branch promotion flow; it's fine to skip them.`,
|
|
63
|
+
``,
|
|
64
|
+
`## Variable reference`,
|
|
65
|
+
renderReference(),
|
|
66
|
+
].join("\n");
|
|
67
|
+
return {
|
|
68
|
+
description: "Configure okffs for this repo conversationally, then persist via the configure tool",
|
|
69
|
+
messages: [
|
|
70
|
+
{
|
|
71
|
+
role: "user",
|
|
72
|
+
content: { type: "text", text },
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/prompts/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,CAAC,MAAM,IAAI,GA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/server.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// The MCP server. Split out of index.ts so the CLI entrypoint can dispatch
|
|
2
|
+
// `okffs setup` WITHOUT importing this file — importing it pulls in the tool
|
|
3
|
+
// chain (→ github.ts), which resolves the token/owner/repo at import time and
|
|
4
|
+
// throws when unconfigured, which is exactly the state `okffs setup` runs in.
|
|
5
|
+
// index.ts only dynamically imports this module for a bare (no-arg) invocation,
|
|
6
|
+
// so the MCP server's behaviour is unchanged.
|
|
7
|
+
import { readFileSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
10
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
11
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
12
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
13
|
+
import * as createIssue from "./tools/create_issue.js";
|
|
14
|
+
import * as listIssues from "./tools/list_issues.js";
|
|
15
|
+
import * as closeIssue from "./tools/close_issue.js";
|
|
16
|
+
import * as deleteIssue from "./tools/delete_issue.js";
|
|
17
|
+
import * as deleteBranch from "./tools/delete_branch.js";
|
|
18
|
+
import * as getIssue from "./tools/get_issue.js";
|
|
19
|
+
import * as commentIssue from "./tools/comment_issue.js";
|
|
20
|
+
import * as createIssuesFromList from "./tools/create_issues_from_list.js";
|
|
21
|
+
import * as plan from "./tools/plan.js";
|
|
22
|
+
import * as linkIssues from "./tools/link_issues.js";
|
|
23
|
+
import * as createPullRequest from "./tools/create_pull_request.js";
|
|
24
|
+
import * as commitAndUpdate from "./tools/commit_and_update.js";
|
|
25
|
+
import * as listPrReviewComments from "./tools/list_pr_review_comments.js";
|
|
26
|
+
import * as replyToReviewComment from "./tools/reply_to_review_comment.js";
|
|
27
|
+
import * as resolveReviewThread from "./tools/resolve_review_thread.js";
|
|
28
|
+
import * as prepareRelease from "./tools/prepare_release.js";
|
|
29
|
+
import * as updateProjectStatus from "./tools/update_project_status.js";
|
|
30
|
+
import * as setIssueFields from "./tools/set_issue_fields.js";
|
|
31
|
+
import * as updateIssue from "./tools/update_issue.js";
|
|
32
|
+
import * as promoteBranch from "./tools/promote_branch.js";
|
|
33
|
+
import * as mergePullRequest from "./tools/merge_pull_request.js";
|
|
34
|
+
import * as fixIntoBase from "./tools/fix_into_base.js";
|
|
35
|
+
import * as configure from "./tools/configure.js";
|
|
36
|
+
import * as addressPrReview from "./prompts/address_pr_review.js";
|
|
37
|
+
import * as updateGuidance from "./prompts/update_guidance.js";
|
|
38
|
+
import * as setupPrompt from "./prompts/setup.js";
|
|
39
|
+
import { parseEnv } from "./cli/env.js";
|
|
40
|
+
import { allKeys } from "./cli/manifest.js";
|
|
41
|
+
const tools = [createIssue, listIssues, closeIssue, deleteIssue, deleteBranch, getIssue, commentIssue, createIssuesFromList, plan, linkIssues, createPullRequest, commitAndUpdate, listPrReviewComments, replyToReviewComment, resolveReviewThread, prepareRelease, updateProjectStatus, setIssueFields, updateIssue, promoteBranch, mergePullRequest, fixIntoBase, configure];
|
|
42
|
+
const prompts = [addressPrReview, updateGuidance, setupPrompt];
|
|
43
|
+
// Read the package version so the server reports the real version (dist/server.js
|
|
44
|
+
// lives one level below package.json in both dev and the published package).
|
|
45
|
+
const version = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
46
|
+
// Server-level instructions: the MCP `initialize` result carries this string and
|
|
47
|
+
// hosts (Claude Code, etc.) surface it to the agent every session. It ships with
|
|
48
|
+
// the package version, so upgrading okffs automatically updates the guidance the
|
|
49
|
+
// agent sees — this is how new tools/behaviour get adopted instead of the agent
|
|
50
|
+
// defaulting to raw git/gh (#169). Keep it tight: it's always-on context. This is
|
|
51
|
+
// the machine-visible counterpart to the human-facing README/CLAUDE.md guidance.
|
|
52
|
+
const SERVER_INSTRUCTIONS = `okffs owns the GitHub issue → branch → PR → merge → close workflow (plus, when enabled, a GitHub Projects v2 board and releases).
|
|
53
|
+
|
|
54
|
+
ALWAYS reach for an okffs tool before raw git/gh/GraphQL when one covers the action — this is a correctness rule, not a style preference:
|
|
55
|
+
- Identity/permissions: okffs authenticates with the configured GITHUB_TOKEN (a PAT scoped for this repo, incl. Projects / org Issue Fields when set). Raw gh/git uses whatever ambient CLI token is signed in — often the wrong identity or missing the Projects/org scopes, so it fails or acts as the wrong user.
|
|
56
|
+
- Conventions: okffs applies branch naming ({issue}-{slug}), the **Branch:** issue link, Closes #N, board placement, changelog fragments, and the OKFFS_PROTECTED_BRANCH invariant. Hand-rolled gh/git silently skips all of that.
|
|
57
|
+
Fall back to raw git/gh ONLY when no okffs tool fits the action.
|
|
58
|
+
|
|
59
|
+
Common action → tool:
|
|
60
|
+
- Start work: create_issue (creates the issue, the linked branch, and the **Branch:** line that create_pull_request/commit_and_update rely on). Many at once: create_issues_from_list or plan.
|
|
61
|
+
- Progress: commit_and_update (stage + commit + push + issue comment) — prefer over raw git commit/push.
|
|
62
|
+
- Open/finalize an issue's PR (into the base branch): create_pull_request (always adds Closes #N).
|
|
63
|
+
- Promotion/release gate — a base→protected PR with no issue, e.g. develop→main: promote_branch (issue-less; adds the PR to the board; NEVER use raw \`gh pr create\` for this).
|
|
64
|
+
- Edit an existing issue's core fields (title, assignees, labels, milestone, body): update_issue — prefer over raw \`gh issue edit\`. (Board Priority/Effort is set_issue_fields; Status column is update_project_status — those aren't issue fields.)
|
|
65
|
+
- Board: create_issue sets an inferred priority/effort at creation; set them on an EXISTING issue with set_issue_fields; move columns with update_project_status (Backlog/Ready/In Progress/Review — Done is GitHub's own automation).
|
|
66
|
+
- PR review: list_pr_review_comments → fix → reply_to_review_comment → resolve_review_thread (honours OKFFS_RESOLVE_THREADS); or the /okffs:address_pr_review prompt.
|
|
67
|
+
- Release prep: prepare_release (bumps version + rolls the changelog; does NOT tag or publish).
|
|
68
|
+
- Land an issue PR into the BASE branch (e.g. develop): merge_pull_request — the one okffs action that merges. Opt-in (OKFFS_AUTO_MERGE_BASE=true) and heavily gated; it verifies checks/threads itself and NEVER touches OKFFS_PROTECTED_BRANCH. Off by default → it just declines.
|
|
69
|
+
- Land an ISSUE-LESS fix into the BASE branch (no issue, e.g. review-comment cleanups): fix_into_base — the mirror of promote_branch. Opens (always safe) then merges under the same OKFFS_AUTO_MERGE_BASE gating as merge_pull_request. Prefer over raw \`gh pr create\`/\`gh pr merge\`; never targets OKFFS_PROTECTED_BRANCH.
|
|
70
|
+
|
|
71
|
+
Setup/config: if the user needs to configure okffs — a missing token/repo, or turning on a feature like Projects — offer the /okffs:setup prompt, which configures okffs conversationally right here in Claude Code (it interviews the user and persists via the configure tool, no terminal needed). The equivalent terminal wizard is \`npx @neturely/okffs setup\` — a guided CLI that writes/updates .env preserving the user's own vars and comments, but being interactive it must be run in their own terminal, not via a tool or the \`!\` shell.
|
|
72
|
+
|
|
73
|
+
Autopilot (minimum-interference mode): a session interaction style — when ACTIVE, stop asking the user to choose between options for REVERSIBLE decisions; take the recommended/logical option at each fork and drive the issue all the way to a PR into the base branch (and a merge into the base branch where OKFFS_AUTO_MERGE_BASE=true), then report the choices. It removes confirmation friction — it does NOT escalate authorization: everything autopilot does, okffs was already permitted to do, and it stays entirely on the recoverable side of OKFFS_PROTECTED_BRANCH (which is why decide-then-report is safe). Activate it per-request when the user says something like "minimum interference", "fully handle this", "handle it end to end", or "autopilot"; it is also on by default when OKFFS_AUTOPILOT=true. When it is NOT active, keep asking as usual. Under autopilot:
|
|
74
|
+
- Decide-and-log (judgment calls): merge method, PR structure, whether a review nit is valid, changelog category, inferred priority/effort/type, and similar — pick the sensible default and record it; do not ask.
|
|
75
|
+
- Ask-or-flag (missing-information calls): when a wrong guess would waste real work because only the user holds the context (e.g. "which of my repos matter", product intent) — "minimum", not "zero": you may ask ONE quick question, or pick the most reversible option and flag it prominently in the report for a one-message course-correction. Prefer this over a blunt "never ask" that silently takes the wrong branch.
|
|
76
|
+
- HARD STOPS — always interrupt, even in autopilot: anything into OKFFS_PROTECTED_BRANCH (merge/tag/publish — the standing invariant); destructive tools (delete_issue/delete_branch confirmed:true); anything that costs money (e.g. a billable Copilot review on a NEW promotion PR — keep it asking); and genuinely irreversible or externally-visible actions.
|
|
77
|
+
- Decisions report (the safety valve that makes decide-then-report acceptable): at the end of a run emit a concise "Autopilot decisions" block — one line per fork, what you chose + a one-line why. Pass it as create_pull_request's \`autopilot_decisions\` (and to commit_and_update along the way) so okffs renders it into the PR body and the issue comment, and echo it in chat.
|
|
78
|
+
okffs also OFFERS autopilot when work starts (create_issue's closing prompt), mirroring an auto mode.
|
|
79
|
+
|
|
80
|
+
Rules: never merge, tag, or publish into OKFFS_PROTECTED_BRANCH autonomously — okffs may OPEN a PR into it (promote_branch), but the merge/tag are yours to hand back for. merge_pull_request only ever lands PRs into the base tier, never the protected branch. Destructive tools (delete_issue, delete_branch) require confirmed: true (call once to preview, again to act). These rules hold even under autopilot.`;
|
|
81
|
+
// Compare two dotted versions; >0 if a is newer than b. Prerelease suffixes are
|
|
82
|
+
// ignored (split on `.`/`-`), which is fine for the coarse "did we upgrade?" check.
|
|
83
|
+
function isNewer(a, b) {
|
|
84
|
+
const pa = a.split(/[.-]/).map((n) => parseInt(n, 10) || 0);
|
|
85
|
+
const pb = b.split(/[.-]/).map((n) => parseInt(n, 10) || 0);
|
|
86
|
+
for (let i = 0; i < 3; i++) {
|
|
87
|
+
const d = (pa[i] || 0) - (pb[i] || 0);
|
|
88
|
+
if (d !== 0)
|
|
89
|
+
return d > 0;
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
// Upgrade nudge (#242): if this repo's .env was configured by an older okffs (or
|
|
94
|
+
// predates version stamping) AND this okffs version has config options not set
|
|
95
|
+
// here, append a one-time-per-session note so the agent can OFFER /okffs:setup.
|
|
96
|
+
// Gentle by construction — it lands in the always-on instructions read on connect,
|
|
97
|
+
// not a per-turn interruption, and self-resolves once the user runs setup (which
|
|
98
|
+
// stamps the current version and marks the new options known/declined).
|
|
99
|
+
function upgradeNudge() {
|
|
100
|
+
try {
|
|
101
|
+
const parsed = parseEnv(join(process.cwd(), ".env"));
|
|
102
|
+
if (!parsed.exists)
|
|
103
|
+
return "";
|
|
104
|
+
const stamp = parsed.configuredVersion;
|
|
105
|
+
const configuredCount = allKeys().filter((k) => parsed.known.has(k)).length;
|
|
106
|
+
// Only for repos that actually use okffs config (a stamp, or some okffs vars);
|
|
107
|
+
// don't pester a .env that just isn't an okffs-configured repo.
|
|
108
|
+
if (!stamp && configuredCount === 0)
|
|
109
|
+
return "";
|
|
110
|
+
// Only when this okffs is newer than what configured the .env (or the .env
|
|
111
|
+
// predates stamping — stamp === null).
|
|
112
|
+
if (stamp && !isNewer(version, stamp))
|
|
113
|
+
return "";
|
|
114
|
+
const newKeys = allKeys().filter((k) => !parsed.known.has(k));
|
|
115
|
+
if (newKeys.length === 0)
|
|
116
|
+
return "";
|
|
117
|
+
const from = stamp ? `from ${stamp} ` : "";
|
|
118
|
+
return `\n\nUPGRADE NUDGE: this repo's .env was configured ${from}with an older okffs; okffs ${version} has ${newKeys.length} config option(s) not set here. Once, offer to run the /okffs:setup prompt (sync) to review the new options — if the user declines, drop it, don't repeat.`;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return "";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Autopilot banner (#238): when OKFFS_AUTOPILOT=true, append a one-line note so
|
|
125
|
+
// the agent knows minimum-interference mode is the session default and applies
|
|
126
|
+
// the autopilot rules above without waiting to be told each turn. Off → nothing
|
|
127
|
+
// (per-request activation via a phrase still works, and the guidance above still
|
|
128
|
+
// describes the mode). Kept in sync with config.ts via the same env var.
|
|
129
|
+
function autopilotBanner() {
|
|
130
|
+
return process.env.OKFFS_AUTOPILOT === "true"
|
|
131
|
+
? `\n\nAUTOPILOT IS ACTIVE (OKFFS_AUTOPILOT=true): apply the minimum-interference rules above by default this session — take the recommended option at each reversible fork, drive to a base-branch PR, honour the hard stops, and end with an "Autopilot decisions" report.`
|
|
132
|
+
: "";
|
|
133
|
+
}
|
|
134
|
+
export async function startServer() {
|
|
135
|
+
const server = new Server({ name: "okffs", version }, { capabilities: { tools: {}, prompts: {} }, instructions: SERVER_INSTRUCTIONS + upgradeNudge() + autopilotBanner() });
|
|
136
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
137
|
+
// A tool may export an async getDescription() to compute its description at
|
|
138
|
+
// list time (e.g. create_issue injects the board's real Priority/Effort options
|
|
139
|
+
// — #133). Fall back to the static description on absence or failure.
|
|
140
|
+
tools: await Promise.all(tools.map(async (t) => {
|
|
141
|
+
let description = t.description;
|
|
142
|
+
const getDescription = t.getDescription;
|
|
143
|
+
if (getDescription) {
|
|
144
|
+
try {
|
|
145
|
+
description = await getDescription();
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
console.warn(`[okffs] getDescription() failed for ${t.name}, using static description:`, err instanceof Error ? err.message : err);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
name: t.name,
|
|
153
|
+
description,
|
|
154
|
+
inputSchema: zodToJsonSchema(t.inputSchema),
|
|
155
|
+
};
|
|
156
|
+
})),
|
|
157
|
+
}));
|
|
158
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
159
|
+
const tool = tools.find((t) => t.name === req.params.name);
|
|
160
|
+
if (!tool) {
|
|
161
|
+
throw new Error(`Unknown tool: ${req.params.name}`);
|
|
162
|
+
}
|
|
163
|
+
const input = tool.inputSchema.parse(req.params.arguments);
|
|
164
|
+
return tool.handler(input);
|
|
165
|
+
});
|
|
166
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
167
|
+
prompts: prompts.map((p) => ({
|
|
168
|
+
name: p.name,
|
|
169
|
+
description: p.description,
|
|
170
|
+
arguments: p.argumentDefs,
|
|
171
|
+
})),
|
|
172
|
+
}));
|
|
173
|
+
server.setRequestHandler(GetPromptRequestSchema, async (req) => {
|
|
174
|
+
const prompt = prompts.find((p) => p.name === req.params.name);
|
|
175
|
+
if (!prompt) {
|
|
176
|
+
throw new Error(`Unknown prompt: ${req.params.name}`);
|
|
177
|
+
}
|
|
178
|
+
return prompt.build(req.params.arguments ?? {});
|
|
179
|
+
});
|
|
180
|
+
const transport = new StdioServerTransport();
|
|
181
|
+
await server.connect(transport);
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,gFAAgF;AAChF,8CAA8C;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,oBAAoB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,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M,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -4,11 +4,14 @@ export declare const description = "Stage all changes, build a commit message fr
|
|
|
4
4
|
export declare const inputSchema: z.ZodObject<{
|
|
5
5
|
issue_number: z.ZodNumber;
|
|
6
6
|
hint: z.ZodOptional<z.ZodString>;
|
|
7
|
+
autopilot_decisions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
8
|
}, "strip", z.ZodTypeAny, {
|
|
8
9
|
issue_number: number;
|
|
10
|
+
autopilot_decisions?: string[] | undefined;
|
|
9
11
|
hint?: string | undefined;
|
|
10
12
|
}, {
|
|
11
13
|
issue_number: number;
|
|
14
|
+
autopilot_decisions?: string[] | undefined;
|
|
12
15
|
hint?: string | undefined;
|
|
13
16
|
}>;
|
|
14
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit_and_update.d.ts","sourceRoot":"","sources":["../../src/tools/commit_and_update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"commit_and_update.d.ts","sourceRoot":"","sources":["../../src/tools/commit_and_update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,IAAI,sBAAsB,CAAC;AACxC,eAAO,MAAM,WAAW,yLACgK,CAAC;AAEzL,eAAO,MAAM,WAAW;;;;;;;;;;;;EAItB,CAAC;AAIH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CA0BnF;AAED,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAwF/D"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { addIssueComment, getIssue, extractBranchFromBody } from "../github.js";
|
|
3
3
|
import { git, gitOutput, currentBranch } from "../git.js";
|
|
4
|
+
import { renderAutopilotDecisions, AUTOPILOT_DECISIONS_DESCRIPTION } from "../autopilot.js";
|
|
4
5
|
export const name = "commit_and_update";
|
|
5
6
|
export const description = "Stage all changes, build a commit message from the provided hint (or the changed file list), commit, push to the issue branch, and post a rich progress comment to the linked issue.";
|
|
6
7
|
export const inputSchema = z.object({
|
|
7
8
|
issue_number: z.number().int().positive().describe("The issue number this work is against"),
|
|
8
9
|
hint: z.string().optional().describe("Short description of what was done — used to build the commit message and issue comment"),
|
|
10
|
+
autopilot_decisions: z.array(z.string()).optional().describe(AUTOPILOT_DECISIONS_DESCRIPTION),
|
|
9
11
|
});
|
|
10
12
|
const SUBJECT_MAX = 72;
|
|
11
13
|
/**
|
|
@@ -114,6 +116,9 @@ export async function handler(input) {
|
|
|
114
116
|
const filesSection = changedFiles.length > 0
|
|
115
117
|
? changedFiles.map((f) => `- \`${f}\``).join("\n")
|
|
116
118
|
: "- No files detected";
|
|
119
|
+
// Autopilot decisions report (#238) — logged onto the issue as work progresses
|
|
120
|
+
// so a decide-then-report run leaves an audit trail at each step, not only at PR.
|
|
121
|
+
const decisionsSection = renderAutopilotDecisions(input.autopilot_decisions);
|
|
117
122
|
const comment = [
|
|
118
123
|
`### 🔧 Commit update`,
|
|
119
124
|
``,
|
|
@@ -124,6 +129,7 @@ export async function handler(input) {
|
|
|
124
129
|
`**Files changed:**`,
|
|
125
130
|
filesSection,
|
|
126
131
|
hintText ? `\n**Summary:** ${hintText}` : "",
|
|
132
|
+
decisionsSection ? `\n${decisionsSection}` : "",
|
|
127
133
|
].filter((l) => l !== undefined).join("\n");
|
|
128
134
|
await addIssueComment(input.issue_number, comment);
|
|
129
135
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit_and_update.js","sourceRoot":"","sources":["../../src/tools/commit_and_update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"commit_and_update.js","sourceRoot":"","sources":["../../src/tools/commit_and_update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAE5F,MAAM,CAAC,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GACtB,sLAAsL,CAAC;AAEzL,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAC3F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yFAAyF,CAAC;IAC/H,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA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AC,CAAC;IAEnD,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,eAAe,UAAU,yBAAyB,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC;KACpH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const name = "configure";
|
|
3
|
+
export declare const description: string;
|
|
4
|
+
export declare const inputSchema: z.ZodObject<{
|
|
5
|
+
set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
6
|
+
declined: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
set?: Record<string, string> | undefined;
|
|
9
|
+
declined?: string[] | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
set?: Record<string, string> | undefined;
|
|
12
|
+
declined?: string[] | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function handler(input: z.infer<typeof inputSchema>): Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
isError: boolean;
|
|
20
|
+
} | {
|
|
21
|
+
content: {
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError?: undefined;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=configure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../src/tools/configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,IAAI,cAAc,CAAC;AAEhC,eAAO,MAAM,WAAW,QAKoI,CAAC;AAE7J,eAAO,MAAM,WAAW;;;;;;;;;EAStB,CAAC;AASH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;;;;;;;;GAmE/D"}
|