@staix/agent-hub 0.48.4 → 0.49.1
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 +20 -0
- package/README.md +1 -1
- package/docs/agent-notes/daemon.md +2 -2
- package/docs/agent-notes/tasks.md +1 -1
- package/docs/design/adapters.md +5 -7
- package/docs/design/agent-hub-architecture.md +2 -1
- package/docs/design/agent-hub.md +2 -1
- package/docs/design/bus.md +3 -2
- package/docs/design/cli-output-inventory.md +39 -38
- package/docs/design/cli-output.md +9 -4
- package/docs/design/execution-reference.md +1 -0
- package/docs/design/guidance-experiments.md +4 -1
- package/docs/design/guidance-probes.md +34 -31
- package/docs/design/model-routes.md +12 -14
- package/docs/design/roadmap.md +11 -9
- package/docs/design/supervision.md +7 -6
- package/docs/design/task-board.md +3 -2
- package/docs/dogfood.md +1 -1
- package/docs/memory.md +3 -3
- package/docs/operations.md +14 -9
- package/docs/quickstart.md +20 -2
- package/docs/roadmap.json +519 -1
- package/docs/roadmap.md +94 -0
- package/docs/security.md +4 -2
- package/docs/verification/2026-11-26-compat-pi-1.6.1.md +28 -0
- package/docs/verification/2026-11-28-0.49.0.md +53 -0
- package/docs/verification/2026-11-29-0.49.1.md +50 -0
- package/docs/verified.json +19 -19
- package/package.json +3 -3
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/kimi-hook.js +324 -98
- package/plugins/agent-hub/server.js +334 -104
- package/src/adapters/channel-peer.ts +5 -2
- package/src/adapters/claude-channel.ts +1 -0
- package/src/adapters/compat.ts +4 -4
- package/src/adapters/definitions/native-cli-entry-claude.ts +22 -1
- package/src/cli/agents-output.ts +13 -0
- package/src/cli/agents.ts +16 -7
- package/src/cli/answer-output.ts +67 -0
- package/src/cli/broker.ts +9 -2
- package/src/cli/console-state.ts +12 -39
- package/src/cli/launch.ts +1 -1
- package/src/cli/main.ts +96 -127
- package/src/cli/recovery-package.ts +78 -26
- package/src/cli/reset-output.ts +50 -0
- package/src/cli/sdlc-output.ts +57 -0
- package/src/cli/settings-output.ts +80 -0
- package/src/hub/check-runner.ts +7 -3
- package/src/hub/claude-launch-proof.ts +12 -2
- package/src/hub/claude-state.ts +3 -0
- package/src/hub/control-client.ts +2 -0
- package/src/hub/daemon.ts +102 -40
- package/src/hub/roadmap-export.ts +12 -9
- package/src/hub/roadmap-issue-states.ts +35 -0
- package/src/hub/runtime-capture-prune.ts +21 -6
- package/src/hub/runtime-package-assets.ts +6 -0
- package/src/hub/supervision-proposals.ts +3 -3
- package/src/hub/supervision-rules.ts +2 -2
- package/src/hub/task-sweep.ts +1 -1
- package/src/hub/tasks.ts +37 -20
package/src/hub/tasks.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { parseMilestoneInput, parseMilestonePatch, milestoneId, milestoneRevisio
|
|
|
5
5
|
import { milestoneViews, type MilestoneView, type RoadmapSnapshot } from "./roadmap-view.ts";
|
|
6
6
|
import { readMirrorSnapshot, planRoadmapMirror, recoverMirrorBinding } from "./roadmap-sync.ts";
|
|
7
7
|
import { roadmapExport } from "./roadmap-export.ts";
|
|
8
|
+
import { roadmapIssueStates } from "./roadmap-issue-states.ts";
|
|
8
9
|
import { checkRoadmap, type DriftMilestone, type RoadmapDrift } from "./roadmap-check.ts";
|
|
9
10
|
import type { RoadmapConfig } from "./roadmap.ts";
|
|
10
11
|
import { computeUnplaced, withTree, type ReadyToClose, type TreeRollup, type UnplacedResult } from "./roadmap-unplaced.ts";
|
|
@@ -3838,6 +3839,18 @@ export class Tasks {
|
|
|
3838
3839
|
throw new PreEffectToolRefusal("GitHub roadmap writes require the person or the configured conductor with roadmap.github_write enabled");
|
|
3839
3840
|
}
|
|
3840
3841
|
|
|
3842
|
+
private roadmapIssueRefs(views: ReturnType<Tasks["milestoneList"]>): Set<string> {
|
|
3843
|
+
const refs = new Set<string>();
|
|
3844
|
+
for (const view of views) {
|
|
3845
|
+
for (const issue of view.issues) refs.add(issue.ref);
|
|
3846
|
+
for (const member of view.tasks) {
|
|
3847
|
+
const task = this.d.board.get(member.id); if (!task) continue;
|
|
3848
|
+
try { const source = this.planIssueIdentity(task); if (source && this.publicMetadataText(source.repo)) refs.add(`${source.repo.toLowerCase()}#${source.issue}`); } catch { /* ambiguous identity is unknown */ }
|
|
3849
|
+
}
|
|
3850
|
+
}
|
|
3851
|
+
return refs;
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3841
3854
|
/** Render only screened views. Issue writes require an exact preview and fresh authority. */
|
|
3842
3855
|
async roadmapExport(by: PeerId, input: { issue?: number; apply?: boolean; confirm?: string } = {}): Promise<{ json: string; markdown: string; fingerprint: string; call?: string[]; applied: boolean }> {
|
|
3843
3856
|
const check = this.requestCheck(by, () => this.d.sweepHeld?.() || this.d.bus.isRecoveryHeld || this.d.bus.storageError ? "roadmap is held by recovery or storage" : undefined);
|
|
@@ -3846,7 +3859,27 @@ export class Tasks {
|
|
|
3846
3859
|
if (input.issue !== undefined) this.roadmapParsed(() => milestoneId(input.issue));
|
|
3847
3860
|
if (input.apply && input.issue === undefined) throw new PreEffectToolRefusal("roadmap export --apply needs an issue; preview with --issue first");
|
|
3848
3861
|
if (input.apply) this.roadmapApplyAuthority(by);
|
|
3849
|
-
|
|
3862
|
+
let pinned: { report: SpecsCheckReport | SpecsCoverReport | undefined } | undefined;
|
|
3863
|
+
const specs = () => { if (!pinned) { pinned = { report: undefined }; pinned.report = this.roadmapSpecsFor(by); } return pinned.report; };
|
|
3864
|
+
let checkedKey = this.roadmapBoardKey(by);
|
|
3865
|
+
const views = this.milestoneList(by, specs), refs = this.roadmapIssueRefs(views);
|
|
3866
|
+
const evidence = JSON.stringify([views, [...refs]]);
|
|
3867
|
+
const privacy = JSON.stringify([this.d.routing(), this.d.piiPaths, this.d.deny]);
|
|
3868
|
+
const current = () => {
|
|
3869
|
+
check(); this.roadmapReadAuthority(by);
|
|
3870
|
+
const key = this.roadmapBoardKey(by);
|
|
3871
|
+
const sameViews = () => {
|
|
3872
|
+
if (key === checkedKey) return true;
|
|
3873
|
+
const latest = this.milestoneList(by, specs);
|
|
3874
|
+
return JSON.stringify([latest, [...this.roadmapIssueRefs(latest)]]) === evidence;
|
|
3875
|
+
};
|
|
3876
|
+
if (JSON.stringify([this.d.routing(), this.d.piiPaths, this.d.deny]) !== privacy || !sameViews())
|
|
3877
|
+
throw new PreEffectToolRefusal("roadmap or privacy policy changed while exporting; retry ahub roadmap export");
|
|
3878
|
+
checkedKey = key;
|
|
3879
|
+
};
|
|
3880
|
+
const issueStates = await roadmapIssueStates(refs, this.roadmapGh(), current);
|
|
3881
|
+
current();
|
|
3882
|
+
const rendered = roadmapExport(views, issueStates);
|
|
3850
3883
|
const repo = input.issue === undefined ? undefined : this.roadmapRepository();
|
|
3851
3884
|
const call = repo === undefined ? undefined : ["api", `repos/${repo}/issues/${input.issue}`, "--hostname", "github.com", "--method", "PATCH", "-f", `body=${rendered.markdown}`];
|
|
3852
3885
|
const fingerprint = createHash("sha256").update(JSON.stringify({ repo: repo ?? null, issue: input.issue ?? null, markdown: rendered.markdown })).digest("hex");
|
|
@@ -3857,7 +3890,7 @@ export class Tasks {
|
|
|
3857
3890
|
try { result = await this.roadmapGh()(call!, 10_000, undefined, 64 * 1024); }
|
|
3858
3891
|
catch { throw new Error("roadmap issue update outcome is unknown; inspect the issue before retrying"); }
|
|
3859
3892
|
if (result.code !== 0) throw new Error("roadmap issue update was not confirmed; inspect the issue before retrying");
|
|
3860
|
-
try {
|
|
3893
|
+
try { current(); this.roadmapApplyAuthority(by); if (this.roadmapRepository() !== repo) throw new Error("changed"); }
|
|
3861
3894
|
catch { throw new Error("roadmap or authority changed after issue update; inspect the issue and preview again"); }
|
|
3862
3895
|
return { ...rendered, fingerprint, call, applied: true };
|
|
3863
3896
|
}
|
|
@@ -3878,7 +3911,8 @@ export class Tasks {
|
|
|
3878
3911
|
// and after each issue read. Rebuild only when a task write (statusRevision), a milestone, link or release row, or the caller's planner role (it screens backlog tasks) says the views can differ; config and privacy are compared on every call below.
|
|
3879
3912
|
const sameViews = () => { const key = boardKey(); if (key === checkedKey) return true; if (snapshot(this.milestoneList(by, specs)) !== evidence) return false; checkedKey = key; return true; };
|
|
3880
3913
|
const current = () => { check(); this.roadmapReadAuthority(by); if (!sameViews() || JSON.stringify(this.d.roadmapConfig?.() ?? { github_mirror: false, github_write: "off" }) !== JSON.stringify(config) || JSON.stringify([this.d.routing(), this.d.piiPaths, this.d.deny]) !== privacy) throw new PreEffectToolRefusal("roadmap or privacy policy changed while checking; retry ahub roadmap check"); };
|
|
3881
|
-
const
|
|
3914
|
+
const issueStates = await roadmapIssueStates(this.roadmapIssueRefs(views), this.roadmapGh(), current);
|
|
3915
|
+
const rendered = roadmapExport(views, issueStates), exportStates: (boolean | undefined)[] = [];
|
|
3882
3916
|
for (const [path, expected] of [["docs/roadmap.json", rendered.json], ["docs/roadmap.md", rendered.markdown]] as const) {
|
|
3883
3917
|
try {
|
|
3884
3918
|
const file = await readGuardedDeliverable(path, { cwd: this.d.cwd, deny: this.d.deny ?? [], private: name => matchesPolicy(this.d.cwd, name, this.d.piiPaths ?? [], true) });
|
|
@@ -3887,23 +3921,6 @@ export class Tasks {
|
|
|
3887
3921
|
}
|
|
3888
3922
|
const exportMatches = exportStates.includes(false) ? false : exportStates.every(value => value === true) ? true : undefined;
|
|
3889
3923
|
current();
|
|
3890
|
-
const refs = new Set<string>();
|
|
3891
|
-
for (const view of views) {
|
|
3892
|
-
for (const issue of view.issues) refs.add(issue.ref);
|
|
3893
|
-
for (const member of view.tasks) {
|
|
3894
|
-
const task = this.d.board.get(member.id); if (!task) continue;
|
|
3895
|
-
try { const source = this.planIssueIdentity(task); if (source && this.publicMetadataText(source.repo)) refs.add(`${source.repo.toLowerCase()}#${source.issue}`); } catch { /* ambiguous identity is unknown */ }
|
|
3896
|
-
}
|
|
3897
|
-
}
|
|
3898
|
-
const issueStates = new Map<string, "open" | "closed">(), issueDeadline = performance.now() + 20_000;
|
|
3899
|
-
for (const ref of [...refs].sort().slice(0, 100)) {
|
|
3900
|
-
const match = /^([^#]+)#([1-9][0-9]*)$/.exec(ref); if (!match || issueDeadline <= performance.now()) break;
|
|
3901
|
-
const value = await readPlanIssueMetadata(match[1]!, Number(match[2]), async (args, timeout, cwd, cap) => {
|
|
3902
|
-
current(); const remaining = issueDeadline - performance.now();
|
|
3903
|
-
return remaining > 0 ? this.roadmapGh()([...args.slice(0, 2), "--hostname", "github.com", ...args.slice(2)], Math.min(timeout ?? remaining, remaining), cwd, cap) : { code: 1, stdout: "" };
|
|
3904
|
-
});
|
|
3905
|
-
current(); if (value) issueStates.set(ref, value.state === "CLOSED" ? "closed" : "open");
|
|
3906
|
-
}
|
|
3907
3924
|
let mirror: Awaited<ReturnType<typeof readMirrorSnapshot>> | undefined, repo: string | undefined;
|
|
3908
3925
|
if (config.github_mirror) {
|
|
3909
3926
|
try { repo = this.roadmapRepository(); mirror = await readMirrorSnapshot(repo, this.roadmapGh()); }
|