|
|
@@ -77,6 +77,10 @@ import { |
| 77 | 77 |
submitReview, |
| 78 | 78 |
} from "../actions/pulls.ts"; |
| 79 | 79 |
import { originError } from "../web/pages/thread.ts"; |
| 80 |
import { NO_DESTINATION } from "../web/pages/backups.ts"; |
| 81 |
import { resolveDestination } from "../snapshot/destination.ts"; |
| 82 |
import { mirrorNeed } from "../snapshot/mirror.ts"; |
| 83 |
import { snapshotsOf } from "../snapshot/service.ts"; |
| 80 | 84 |
import { holdPull, releasePull } from "../actions/holds.ts"; |
| 81 | 85 |
import { openPlan, parsePlan, PLAN_MAX, proposePlan } from "../actions/plan.ts"; |
| 82 | 86 |
import { |
|
|
@@ -513,7 +517,7 @@ const TOOLS: readonly Tool[] = [ |
| 513 | 517 |
{ |
| 514 | 518 |
name: "new_app", |
| 515 | 519 |
description: |
| 516 | |
"Make an app from a sentence: a repository, production started, and with `description` a first issue.", |
| 520 |
"Make an app from a sentence: a repository, production, and a first issue with `description`.", |
| 517 | 521 |
inputSchema: { |
| 518 | 522 |
type: "object", |
| 519 | 523 |
properties: { |
|
|
@@ -598,7 +602,7 @@ const TOOLS: readonly Tool[] = [ |
| 598 | 602 |
{ |
| 599 | 603 |
name: "repo_settings", |
| 600 | 604 |
description: |
| 601 | |
"Change a repository's description or visibility, as PATCH /api/v1/repos/:owner/:name (admin token).", |
| 605 |
"Change a repository's description or visibility, as PATCH /api/v1/repos/:owner/:name.", |
| 602 | 606 |
inputSchema: { |
| 603 | 607 |
type: "object", |
| 604 | 608 |
properties: { |
|
|
@@ -634,7 +638,7 @@ const TOOLS: readonly Tool[] = [ |
| 634 | 638 |
{ |
| 635 | 639 |
name: "here", |
| 636 | 640 |
description: |
| 637 | |
"What you can do on a forge page, as who you are: each open action with its HTTP route and MCP tool.", |
| 641 |
"What you can do on a forge page: each open action with its HTTP route and MCP tool.", |
| 638 | 642 |
inputSchema: { |
| 639 | 643 |
type: "object", |
| 640 | 644 |
properties: { url: { type: "string", maxLength: 2000 } }, |
|
|
@@ -661,7 +665,7 @@ const TOOLS: readonly Tool[] = [ |
| 661 | 665 |
{ |
| 662 | 666 |
name: "tell", |
| 663 | 667 |
description: |
| 664 | |
"Tell an app's crew what should change (first line is the title). No `repo`: kept, answers a thought id.", |
| 668 |
"Tell an app's crew what should change (first line is the title). No `repo`: kept as a thought.", |
| 665 | 669 |
inputSchema: { |
| 666 | 670 |
type: "object", |
| 667 | 671 |
properties: { |
|
|
@@ -740,7 +744,7 @@ const TOOLS: readonly Tool[] = [ |
| 740 | 744 |
{ |
| 741 | 745 |
name: "share", |
| 742 | 746 |
description: |
| 743 | |
"Share a feed item: no `to` tells the app's crew and owners, else its followers; daily budget each.", |
| 747 |
"Share a feed item: no `to` tells the app's crew and owners, else followers; daily budget.", |
| 744 | 748 |
inputSchema: { |
| 745 | 749 |
type: "object", |
| 746 | 750 |
properties: { |
|
|
@@ -767,7 +771,7 @@ const TOOLS: readonly Tool[] = [ |
| 767 | 771 |
{ |
| 768 | 772 |
name: "say", |
| 769 | 773 |
description: |
| 770 | |
"Say something on an issue or pull. A working builder hears it next; otherwise the next run does.", |
| 774 |
"Say something on an issue or pull. A working builder hears it next, else the next run.", |
| 771 | 775 |
inputSchema: { |
| 772 | 776 |
type: "object", |
| 773 | 777 |
properties: { |
|
|
@@ -799,7 +803,7 @@ const TOOLS: readonly Tool[] = [ |
| 799 | 803 |
{ |
| 800 | 804 |
name: "issue", |
| 801 | 805 |
description: |
| 802 | |
"One issue with comments, `blockedBy`, `blocks`; a crew agent sees `untrusted: true` on text by non-writers.", |
| 806 |
"One issue with comments, `blockedBy`, `blocks`; crew agents see `untrusted: true` on non-writers' text.", |
| 803 | 807 |
inputSchema: { |
| 804 | 808 |
type: "object", |
| 805 | 809 |
properties: { |
|
|
@@ -868,7 +872,7 @@ const TOOLS: readonly Tool[] = [ |
| 868 | 872 |
{ |
| 869 | 873 |
name: "pull", |
| 870 | 874 |
description: |
| 871 | |
"Read a pull: title, state, head, base; open: `mergeable`, `conflicts`, `proposal`, `checkStale`, `check`.", |
| 875 |
"A pull: title, state, head, base; open: `mergeable`, `conflicts`, `proposal`, `checkStale`, `check`.", |
| 872 | 876 |
inputSchema: { |
| 873 | 877 |
type: "object", |
| 874 | 878 |
properties: { |
|
|
@@ -911,7 +915,7 @@ const TOOLS: readonly Tool[] = [ |
| 911 | 915 |
{ |
| 912 | 916 |
name: "pulls", |
| 913 | 917 |
description: |
| 914 | |
"A repository's pulls, newest first. `state` open (default) or closed; `limit` 1-50 (default 20).", |
| 918 |
"A repository's pulls, newest first. `state` open (default) or closed; `limit` 1-50.", |
| 915 | 919 |
inputSchema: { |
| 916 | 920 |
type: "object", |
| 917 | 921 |
properties: { |
|
|
@@ -955,7 +959,7 @@ const TOOLS: readonly Tool[] = [ |
| 955 | 959 |
{ |
| 956 | 960 |
name: "variant", |
| 957 | 961 |
description: |
| 958 | |
"Like or dislike one pull among its variants; a later vote replaces it; a dislike closes it (`reason`).", |
| 962 |
"Like or dislike a pull among variants; a later vote replaces it; a dislike closes it.", |
| 959 | 963 |
inputSchema: { |
| 960 | 964 |
type: "object", |
| 961 | 965 |
properties: { |
|
|
@@ -996,7 +1000,7 @@ const TOOLS: readonly Tool[] = [ |
| 996 | 1000 |
{ |
| 997 | 1001 |
name: "edit", |
| 998 | 1002 |
description: |
| 999 | |
"Retitle or rewrite an issue or pull: yours, or any where you write; an agent edits only its own.", |
| 1003 |
"Retitle or rewrite an issue or pull: yours, or where you write; agents only their own.", |
| 1000 | 1004 |
inputSchema: { |
| 1001 | 1005 |
type: "object", |
| 1002 | 1006 |
properties: { |
|
|
@@ -1140,7 +1144,7 @@ const TOOLS: readonly Tool[] = [ |
| 1140 | 1144 |
{ |
| 1141 | 1145 |
name: "asks", |
| 1142 | 1146 |
description: |
| 1143 | |
"What waits on you, most consequential first: decision, options, cost of inaction; your saved filter applies.", |
| 1147 |
"What waits on you, most consequential first: decision, options, cost of inaction; your filter applies.", |
| 1144 | 1148 |
inputSchema: { type: "object", properties: { ...CHIP_ARGS } }, |
| 1145 | 1149 |
writes: false, |
| 1146 | 1150 |
run(ctx, user, args) { |
|
|
@@ -1152,7 +1156,7 @@ const TOOLS: readonly Tool[] = [ |
| 1152 | 1156 |
{ |
| 1153 | 1157 |
name: "asks_act", |
| 1154 | 1158 |
description: |
| 1155 | |
"Decide asks (`items`: `asks` ids, `issue:<id>`): dismiss, decline, ship (never undone), close (`reason`), mute, replan.", |
| 1159 |
"Decide asks (`items`: `asks` ids, `issue:<id>`): dismiss, decline, ship (final), close (`reason`), mute, replan.", |
| 1156 | 1160 |
inputSchema: { |
| 1157 | 1161 |
type: "object", |
| 1158 | 1162 |
properties: { |
|
|
@@ -2672,7 +2676,7 @@ const TOOLS: readonly Tool[] = [ |
| 2672 | 2676 |
{ |
| 2673 | 2677 |
name: "propose_to_parent_forge", |
| 2674 | 2678 |
description: |
| 2675 | |
"Offer this forge's landed change to its parent as a pull on `child/<name>/…`; the same tip answers that pull.", |
| 2679 |
"Offer this forge's landed change to its parent as a pull on `child/<name>/…`.", |
| 2676 | 2680 |
inputSchema: { |
| 2677 | 2681 |
type: "object", |
| 2678 | 2682 |
properties: { repo: REPO_ARG }, |
|
|
@@ -4038,7 +4042,7 @@ const TOOLS: readonly Tool[] = [ |
| 4038 | 4042 |
{ |
| 4039 | 4043 |
name: "prompts", |
| 4040 | 4044 |
description: |
| 4041 | |
"An app's prompt sources (Instagram): list, add (`kind`, `token`, `at`), run or remove (`id`). Repository admin token.", |
| 4045 |
"An app's prompt sources (Instagram): list, add (`kind`, `token`, `at`), run or remove (`id`). Repo admin.", |
| 4042 | 4046 |
inputSchema: { |
| 4043 | 4047 |
type: "object", |
| 4044 | 4048 |
properties: { |
|
|
@@ -4088,7 +4092,7 @@ const TOOLS: readonly Tool[] = [ |
| 4088 | 4092 |
{ |
| 4089 | 4093 |
name: "access", |
| 4090 | 4094 |
description: |
| 4091 | |
"What outside agents tried: redacted log of non-browser requests to public paths, newest first, max 500. Forge admin.", |
| 4095 |
"What outside agents tried: redacted non-browser requests to public paths, newest first, max 500. Admin.", |
| 4092 | 4096 |
inputSchema: { |
| 4093 | 4097 |
type: "object", |
| 4094 | 4098 |
properties: { |
|
|
@@ -4167,7 +4171,7 @@ const TOOLS: readonly Tool[] = [ |
| 4167 | 4171 |
{ |
| 4168 | 4172 |
name: "flow", |
| 4169 | 4173 |
description: |
| 4170 | |
"The pipeline (forge admin): per-stage counts, `oldestWaiting`, `capacity`, bottleneck, `queue`, `reviewing` by reviewer.", |
| 4174 |
"The pipeline (admin): stage counts, `oldestWaiting`, `capacity`, bottleneck, `queue`, `reviewing`.", |
| 4171 | 4175 |
inputSchema: { type: "object", properties: {} }, |
| 4172 | 4176 |
writes: false, |
| 4173 | 4177 |
run(ctx, user) { |
|
|
@@ -4331,6 +4335,43 @@ const TOOLS: readonly Tool[] = [ |
| 4331 | 4335 |
return good({ says: `${changed.value.name} saved at ${changed.value.dial}%.`, ...changed.value }); |
| 4332 | 4336 |
}, |
| 4333 | 4337 |
}, |
| 4338 |
{ |
| 4339 |
name: "backups", |
| 4340 |
description: "Backups (admin): destination, last snapshots, mirror.", |
| 4341 |
inputSchema: { type: "object", properties: {} }, |
| 4342 |
adminOnly: true, |
| 4343 |
writes: false, |
| 4344 |
async run(ctx, user) { |
| 4345 |
if (!user.isAdmin) return bad("not_found", "The page you asked for does not exist, or is not visible to you."); |
| 4346 |
const dest = resolveDestination({ db: ctx.app.db, dataDir: ctx.app.config.dataDir, bus: ctx.app.bus }); |
| 4347 |
const svc = snapshotsOf(ctx.app); |
| 4348 |
const mirror = svc?.mirrored(); |
| 4349 |
const need = mirrorNeed(mirror, Date.now()); |
| 4350 |
const mirrorSays = { |
| 4351 |
configured: svc?.mirror !== undefined, |
| 4352 |
where: svc?.mirror?.where ?? null, |
| 4353 |
reachable: mirror?.reachable ?? null, |
| 4354 |
syncedAt: mirror?.syncedAt ?? null, |
| 4355 |
newest: mirror?.newest ?? null, |
| 4356 |
problem: need?.sentence ?? null, |
| 4357 |
}; |
| 4358 |
if (!dest || svc?.store === undefined) |
| 4359 |
return good({ destination: null, says: NO_DESTINATION, snapshots: [], mirror: mirrorSays }); |
| 4360 |
let snapshots: { key: string; at: string; bytes: number }[] = []; |
| 4361 |
let listing: string | null = null; |
| 4362 |
try { |
| 4363 |
snapshots = (await svc.list()).slice(0, 14).map((m) => ({ key: m.name, at: m.finishedAt, bytes: m.bytes })); |
| 4364 |
} catch (error) { |
| 4365 |
listing = String(error); |
| 4366 |
} |
| 4367 |
return good({ |
| 4368 |
destination: { kind: dest.source, where: svc.store.where }, |
| 4369 |
snapshots, |
| 4370 |
listing, |
| 4371 |
mirror: mirrorSays, |
| 4372 |
}); |
| 4373 |
}, |
| 4374 |
}, |
| 4334 | 4375 |
{ |
| 4335 | 4376 |
name: "cloud_accounts", |
| 4336 | 4377 |
description: |