@mmerterden/multi-agent-pipeline 20.29.0 → 20.33.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 +86 -0
- package/README.md +50 -5
- package/README.tr.md +64 -5
- package/docs/architecture.md +3 -3
- package/docs/ecosystem.md +5 -5
- package/docs/facts.json +9 -9
- package/install/_unattended-profile.mjs +61 -0
- package/install/catalog-history.json +1 -1
- package/install/claude.mjs +19 -3
- package/install/codex.mjs +2 -0
- package/install/copilot.mjs +13 -0
- package/install/index.mjs +10 -1
- package/install/templates/claude-hooks.json +12 -1
- package/manifest.json +230 -88
- package/package.json +3 -1
- package/pipeline/commands/multi-agent/analysis/SKILL.md +4 -4
- package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +13 -15
- package/pipeline/commands/multi-agent/office-off/SKILL.md +27 -0
- package/pipeline/commands/multi-agent/office-on/SKILL.md +51 -0
- package/pipeline/commands/multi-agent/office-status/SKILL.md +29 -0
- package/pipeline/commands/multi-agent/prune-logs/SKILL.md +4 -1
- package/pipeline/commands/multi-agent/review/SKILL.md +4 -3
- package/pipeline/commands/multi-agent/scenario-audit/SKILL.md +4 -2
- package/pipeline/commands/multi-agent/serve/SKILL.md +4 -2
- package/pipeline/commands/multi-agent/stack/SKILL.md +15 -8
- package/pipeline/commands/multi-agent/steer/SKILL.md +10 -9
- package/pipeline/commands/multi-agent/sync/SKILL.md +15 -3
- package/pipeline/commands/multi-agent/test-gen/SKILL.md +29 -3
- package/pipeline/contract/CHANGELOG.md +108 -0
- package/pipeline/contract/README.md +72 -12
- package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
- package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
- package/pipeline/contract/fixtures/error-unsigned.json +1 -1
- package/pipeline/contract/fixtures/launch-plan.json +1 -1
- package/pipeline/contract/fixtures/runs-awaiting-question.json +6 -1
- package/pipeline/contract/fixtures/runs-empty.json +1 -1
- package/pipeline/contract/fixtures/runs-failed.json +6 -1
- package/pipeline/contract/fixtures/runs-old-schema.json +6 -1
- package/pipeline/contract/fixtures/runs-pr-opened-redacted.json +5 -1
- package/pipeline/contract/fixtures/runs-pr-opened.json +6 -1
- package/pipeline/contract/fixtures/runs-running.json +6 -1
- package/pipeline/contract/manifest.json +506 -27
- package/pipeline/contract/types/index.d.ts +829 -4
- package/pipeline/lib/bg-launch.mjs +106 -0
- package/pipeline/lib/code-digest.mjs +49 -0
- package/pipeline/lib/credential-resolve.mjs +42 -2
- package/pipeline/multi-agent-refs/cross-cli-contract.md +5 -4
- package/pipeline/multi-agent-refs/features/office-threat-model.md +109 -0
- package/pipeline/multi-agent-refs/features/unattended-security.md +1 -1
- package/pipeline/multi-agent-refs/help/en.md +3 -0
- package/pipeline/multi-agent-refs/help/tr.md +3 -0
- package/pipeline/multi-agent-refs/phases/modes.md +7 -7
- package/pipeline/multi-agent-refs/phases/phase-5-report.md +16 -10
- package/pipeline/multi-agent-refs/review-standalone-tracker.md +37 -0
- package/pipeline/multi-agent-refs/tracker-contract.md +8 -3
- package/pipeline/office/NOTICE.md +45 -0
- package/pipeline/office/assets/ARCHIVE_BOXES.png +0 -0
- package/pipeline/office/assets/BIN.png +0 -0
- package/pipeline/office/assets/BOOKSHELF.png +0 -0
- package/pipeline/office/assets/CACTUS.png +0 -0
- package/pipeline/office/assets/CLOCK.png +0 -0
- package/pipeline/office/assets/COFFEE.png +0 -0
- package/pipeline/office/assets/COFFEE_MACHINE.png +0 -0
- package/pipeline/office/assets/COFFEE_TABLE.png +0 -0
- package/pipeline/office/assets/COUNTER_SINK.png +0 -0
- package/pipeline/office/assets/CUSHIONED_BENCH.png +0 -0
- package/pipeline/office/assets/CUSHIONED_CHAIR_BACK.png +0 -0
- package/pipeline/office/assets/CUSHIONED_CHAIR_FRONT.png +0 -0
- package/pipeline/office/assets/CUSHIONED_CHAIR_SIDE.png +0 -0
- package/pipeline/office/assets/DESK_FRONT.png +0 -0
- package/pipeline/office/assets/DESK_SIDE.png +0 -0
- package/pipeline/office/assets/DEVICE_STAND.png +0 -0
- package/pipeline/office/assets/DOUBLE_BOOKSHELF.png +0 -0
- package/pipeline/office/assets/FILING_CABINET.png +0 -0
- package/pipeline/office/assets/FRIDGE.png +0 -0
- package/pipeline/office/assets/HANGING_PLANT.png +0 -0
- package/pipeline/office/assets/LARGE_PAINTING.png +0 -0
- package/pipeline/office/assets/LARGE_PLANT.png +0 -0
- package/pipeline/office/assets/MAILBOX.png +0 -0
- package/pipeline/office/assets/MOP_BUCKET.png +0 -0
- package/pipeline/office/assets/PC_BACK.png +0 -0
- package/pipeline/office/assets/PC_FRONT_OFF.png +0 -0
- package/pipeline/office/assets/PC_FRONT_ON_1.png +0 -0
- package/pipeline/office/assets/PC_FRONT_ON_2.png +0 -0
- package/pipeline/office/assets/PC_FRONT_ON_3.png +0 -0
- package/pipeline/office/assets/PC_SIDE.png +0 -0
- package/pipeline/office/assets/PLANT.png +0 -0
- package/pipeline/office/assets/PLANT_2.png +0 -0
- package/pipeline/office/assets/POT.png +0 -0
- package/pipeline/office/assets/PRINTER.png +0 -0
- package/pipeline/office/assets/RECEPTION_DESK.png +0 -0
- package/pipeline/office/assets/SERVER_RACK.png +0 -0
- package/pipeline/office/assets/SERVER_RACK_2.png +0 -0
- package/pipeline/office/assets/SMALL_PAINTING.png +0 -0
- package/pipeline/office/assets/SMALL_PAINTING_2.png +0 -0
- package/pipeline/office/assets/SMALL_TABLE_FRONT.png +0 -0
- package/pipeline/office/assets/SMALL_TABLE_SIDE.png +0 -0
- package/pipeline/office/assets/SOFA_BACK.png +0 -0
- package/pipeline/office/assets/SOFA_FRONT.png +0 -0
- package/pipeline/office/assets/SOFA_SIDE.png +0 -0
- package/pipeline/office/assets/TABLE_FRONT.png +0 -0
- package/pipeline/office/assets/TOILET_STALL.png +0 -0
- package/pipeline/office/assets/VENDING.png +0 -0
- package/pipeline/office/assets/WASHBASIN.png +0 -0
- package/pipeline/office/assets/WATER_COOLER.png +0 -0
- package/pipeline/office/assets/WHITEBOARD.png +0 -0
- package/pipeline/office/assets/WOODEN_BENCH.png +0 -0
- package/pipeline/office/assets/WOODEN_CHAIR_BACK.png +0 -0
- package/pipeline/office/assets/WOODEN_CHAIR_FRONT.png +0 -0
- package/pipeline/office/assets/WOODEN_CHAIR_SIDE.png +0 -0
- package/pipeline/office/assets/char_0.png +0 -0
- package/pipeline/office/assets/char_1.png +0 -0
- package/pipeline/office/assets/char_2.png +0 -0
- package/pipeline/office/assets/char_3.png +0 -0
- package/pipeline/office/assets/char_4.png +0 -0
- package/pipeline/office/assets/char_5.png +0 -0
- package/pipeline/office/assets/floor_0.png +0 -0
- package/pipeline/office/assets/floor_1.png +0 -0
- package/pipeline/office/assets/floor_2.png +0 -0
- package/pipeline/office/assets/floor_3.png +0 -0
- package/pipeline/office/assets/floor_4.png +0 -0
- package/pipeline/office/assets/floor_5.png +0 -0
- package/pipeline/office/assets/floor_6.png +0 -0
- package/pipeline/office/assets/floor_7.png +0 -0
- package/pipeline/office/assets/floor_8.png +0 -0
- package/pipeline/office/assets/wall_0.png +0 -0
- package/pipeline/office/index.html +8431 -0
- package/pipeline/office/toolkit.json +3 -0
- package/pipeline/schemas/activity-chat.schema.json +78 -0
- package/pipeline/schemas/activity-roles.json +48 -0
- package/pipeline/schemas/activity-roles.schema.json +49 -0
- package/pipeline/schemas/activity.schema.json +613 -0
- package/pipeline/schemas/agent-state.schema.json +493 -115
- package/pipeline/schemas/autopilot-on-request.schema.json +33 -0
- package/pipeline/schemas/autopilot-on.schema.json +111 -0
- package/pipeline/schemas/contract-error.schema.json +45 -4
- package/pipeline/schemas/issue-maturity.schema.json +68 -0
- package/pipeline/schemas/job-change.schema.json +72 -0
- package/pipeline/schemas/job-request.schema.json +38 -0
- package/pipeline/schemas/launch.json +4 -4
- package/pipeline/schemas/ledger.schema.json +202 -0
- package/pipeline/schemas/office-credentials.schema.json +71 -0
- package/pipeline/schemas/office-jobs.json +253 -0
- package/pipeline/schemas/office-jobs.schema.json +62 -0
- package/pipeline/schemas/office-memory.schema.json +105 -0
- package/pipeline/schemas/office-settings-request.schema.json +30 -0
- package/pipeline/schemas/office-settings.schema.json +67 -0
- package/pipeline/schemas/permissions.schema.json +47 -0
- package/pipeline/schemas/phases.json +10 -2
- package/pipeline/schemas/phases.schema.json +86 -19
- package/pipeline/schemas/prefs.schema.json +19 -0
- package/pipeline/schemas/prs.schema.json +78 -0
- package/pipeline/schemas/prune-logs-request.schema.json +26 -0
- package/pipeline/schemas/prune-logs.schema.json +52 -0
- package/pipeline/schemas/repo-change.schema.json +54 -0
- package/pipeline/schemas/repo-request.schema.json +29 -0
- package/pipeline/schemas/repos.schema.json +49 -1
- package/pipeline/schemas/review-verdict-request.schema.json +20 -0
- package/pipeline/schemas/review-verdict.schema.json +62 -0
- package/pipeline/schemas/routine-delete.schema.json +59 -0
- package/pipeline/schemas/routines.schema.json +38 -0
- package/pipeline/schemas/run-evidence.schema.json +29 -0
- package/pipeline/schemas/run-results.schema.json +218 -0
- package/pipeline/schemas/runs-index.schema.json +257 -46
- package/pipeline/schemas/service-read.schema.json +58 -0
- package/pipeline/schemas/stack-change.schema.json +82 -0
- package/pipeline/schemas/stack-request.schema.json +33 -0
- package/pipeline/schemas/stack.schema.json +59 -0
- package/pipeline/schemas/steer-request.schema.json +25 -0
- package/pipeline/schemas/steer.schema.json +59 -0
- package/pipeline/schemas/system-status.schema.json +111 -0
- package/pipeline/schemas/tool-call-request.schema.json +19 -0
- package/pipeline/schemas/tool-call.schema.json +47 -0
- package/pipeline/schemas/tools.schema.json +65 -0
- package/pipeline/schemas/unattended-profile.json +7 -2
- package/pipeline/scripts/_active-run.mjs +2 -1
- package/pipeline/scripts/_cost.mjs +66 -1
- package/pipeline/scripts/_office-smoke-lib.sh +115 -0
- package/pipeline/scripts/_spawn-async.mjs +77 -0
- package/pipeline/scripts/_transcript-tail.mjs +274 -0
- package/pipeline/scripts/activity-snapshot.mjs +1223 -0
- package/pipeline/scripts/autopilot-control.mjs +214 -9
- package/pipeline/scripts/autopilot-runner.mjs +7 -5
- package/pipeline/scripts/contract-server.mjs +1853 -197
- package/pipeline/scripts/cost-analyze.mjs +2 -53
- package/pipeline/scripts/cost-table.json +1 -0
- package/pipeline/scripts/gen-mode-dispatch.mjs +3 -1
- package/pipeline/scripts/job-launch.mjs +477 -0
- package/pipeline/scripts/launch-request.mjs +94 -9
- package/pipeline/scripts/office-build.mjs +226 -0
- package/pipeline/scripts/office-control.mjs +410 -0
- package/pipeline/scripts/office-credentials.mjs +106 -0
- package/pipeline/scripts/office-ledger.mjs +409 -0
- package/pipeline/scripts/office-memory.mjs +200 -0
- package/pipeline/scripts/office-prune.mjs +125 -0
- package/pipeline/scripts/office-settings.mjs +145 -0
- package/pipeline/scripts/phase-tracker.sh +12 -5
- package/pipeline/scripts/prune-logs.sh +53 -2
- package/pipeline/scripts/routine-registry.mjs +42 -6
- package/pipeline/scripts/run-results.mjs +373 -0
- package/pipeline/scripts/runs-index.mjs +62 -2
- package/pipeline/scripts/service-read.mjs +244 -0
- package/pipeline/scripts/stack-toggle.mjs +285 -0
- package/pipeline/scripts/steer-run.mjs +97 -0
- package/pipeline/scripts/system-status.mjs +196 -0
- package/pipeline/scripts/task-mirror.mjs +150 -0
- package/pipeline/scripts/task-mirror.sh +20 -0
- package/pipeline/scripts/toolkit-tools.mjs +625 -0
- package/pipeline/scripts/transcript-index.mjs +4 -1
- package/pipeline/scripts/uninstall.mjs +3 -0
- package/pipeline/scripts/work-items.mjs +473 -0
- package/pipeline/skills/.skill-manifest.json +23 -11
- package/pipeline/skills/.skills-index.json +34 -1
- package/pipeline/skills/shared/README.md +6 -3
- package/pipeline/skills/shared/core/multi-agent-autopilot-on/SKILL.md +13 -15
- package/pipeline/skills/shared/core/multi-agent-office-off/SKILL.md +16 -0
- package/pipeline/skills/shared/core/multi-agent-office-on/SKILL.md +21 -0
- package/pipeline/skills/shared/core/multi-agent-office-status/SKILL.md +17 -0
- package/pipeline/skills/shared/core/multi-agent-prune-logs/SKILL.md +4 -1
- package/pipeline/skills/shared/core/multi-agent-review/SKILL.md +19 -0
- package/pipeline/skills/shared/core/multi-agent-scenario-audit/SKILL.md +4 -2
- package/pipeline/skills/shared/core/multi-agent-serve/SKILL.md +4 -2
- package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +14 -6
- package/pipeline/skills/shared/core/multi-agent-steer/SKILL.md +10 -9
- package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +3 -3
- package/pipeline/skills/shared/core/multi-agent-test-gen/SKILL.md +26 -3
- package/pipeline/skills/skills-index.md +4 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Generated by pipeline/contract/build.mjs from pipeline/schemas/*.schema.json.
|
|
2
2
|
// Do not edit: change the schema and run `node pipeline/contract/build.mjs --write`.
|
|
3
3
|
|
|
4
|
-
export type ContractVersion = "1.
|
|
5
|
-
export type SurfaceId = "runs" | "run" | "commands" | "questions" | "issues" | "worktrees" | "launch-spec" | "repos" | "launch" | "answer" | "run-log" | "resume" | "kill" | "gc" | "autopilot" | "autopilot-off" | "phone-runs" | "phone-run" | "phone-answer" | "phone-launch";
|
|
4
|
+
export type ContractVersion = "1.6.0";
|
|
5
|
+
export type SurfaceId = "runs" | "run" | "commands" | "questions" | "issues" | "worktrees" | "launch-spec" | "repos" | "repo-add" | "repo-remove" | "launch" | "answer" | "run-log" | "resume" | "kill" | "gc" | "autopilot" | "autopilot-off" | "phone-runs" | "phone-run" | "phone-answer" | "phone-launch" | "autopilot-on" | "steer" | "activity" | "activity-stream" | "agent-chat" | "routines" | "routine-delete" | "jobs" | "job-start" | "stack" | "stack-set" | "ledger" | "system" | "prune-logs" | "settings" | "settings-set" | "credentials" | "memory" | "run-results" | "run-evidence" | "review-verdict" | "issue-maturity" | "prs" | "tools" | "tool-call" | "service-confluence" | "service-crashlytics" | "service-figma" | "permissions";
|
|
6
6
|
|
|
7
7
|
/** What `runs-index.mjs --json` prints: every run under the log root and the unattended log root (one record per task id), grouped per status/SKILL.md 3b. Fields are only ever added - a decoder ignores keys it does not know. `--redact` drops every x-sensitivity local field (and `logsRoot`) and scrubs the free text in the title, `now`, sub-step names, task subjects and the pending question. */
|
|
8
8
|
export interface RunsIndex {
|
|
@@ -51,6 +51,8 @@ export interface RunsIndexRun {
|
|
|
51
51
|
};
|
|
52
52
|
estUsd: number;
|
|
53
53
|
unlockedWrites: number;
|
|
54
|
+
/** agent-state.json mode as the run recorded it (analysis, test-gen, review...), so a reader can name the command; null when none was recorded. */
|
|
55
|
+
mode?: string | null;
|
|
54
56
|
/** autopilot when the run is in autopilot mode; analysis for an analysis-family run (agent-state mode analysis, or a tracker with no agent state); development otherwise. Added in 1.2.0. */
|
|
55
57
|
runType?: "analysis" | "development" | "autopilot";
|
|
56
58
|
/** The issue summary Phase 0 recorded (agent-state title), else the input the run was launched with (launchRequest.input), else null. Scrubbed under --redact. Added in 1.2.0. */
|
|
@@ -64,6 +66,27 @@ export interface RunsIndexRun {
|
|
|
64
66
|
subject: string;
|
|
65
67
|
activeForm: string | null;
|
|
66
68
|
} | null;
|
|
69
|
+
/** Where the work came from: a Jira key, a GitHub issue (owner/repo#N) or free text; a GitHub issue that got a Jira has both. Null when the run recorded neither. Added in 1.3.0. */
|
|
70
|
+
source?: {
|
|
71
|
+
kind: "jira" | "github" | "text";
|
|
72
|
+
jira: string | null;
|
|
73
|
+
issue: string | null;
|
|
74
|
+
} | null;
|
|
75
|
+
/** The pull request's number, from the state or its URL; the URL itself is prUrl (local). Added in 1.3.0. */
|
|
76
|
+
prNumber?: number | null;
|
|
77
|
+
/** Where Phase 5 sent the report, per adapter (state.channelResults); empty before then. Added in 1.3.0. */
|
|
78
|
+
channels?: Array<{
|
|
79
|
+
channel: "pr" | "jira" | "confluence" | "wiki" | "issue";
|
|
80
|
+
status: "posted" | "skipped" | "failed";
|
|
81
|
+
}>;
|
|
82
|
+
/** The address each adapter posted to, https only; dropped from a redacted answer. Added in 1.3.0. */
|
|
83
|
+
channelUrls?: {
|
|
84
|
+
pr?: string;
|
|
85
|
+
jira?: string;
|
|
86
|
+
confluence?: string;
|
|
87
|
+
wiki?: string;
|
|
88
|
+
issue?: string;
|
|
89
|
+
};
|
|
67
90
|
}
|
|
68
91
|
|
|
69
92
|
export interface RunsIndexQuestion {
|
|
@@ -490,7 +513,7 @@ export interface AutopilotOff {
|
|
|
490
513
|
stoppedInFlight: boolean;
|
|
491
514
|
}
|
|
492
515
|
|
|
493
|
-
/** What GET /v1/repos returns and `launch-request.mjs repos` prints: the repositories POST /v1/launch?repo= accepts, by real path. source autopilot is a configured autopilot repo (config.json repos[], named by nameWithOwner); registered is one added with `launch-request.mjs register-repo` (launch-repos.json, named by its directory). path is dropped under redact. */
|
|
516
|
+
/** What GET /v1/repos returns and `launch-request.mjs repos` prints: the repositories POST /v1/launch?repo= accepts, by real path. source autopilot is a configured autopilot repo (config.json repos[], named by nameWithOwner); registered is one added with `launch-request.mjs register-repo` (launch-repos.json, named by its directory). path is dropped under redact. With --all (?all=1): suggested lists checkouts earlier runs worked in that launch does not accept yet, and missing lists registered entries that are no longer a directory; each carries an id that POST /v1/repos and DELETE /v1/repos/{id} take. */
|
|
494
517
|
export interface Repos {
|
|
495
518
|
contractVersion: string;
|
|
496
519
|
repos: Array<{
|
|
@@ -498,15 +521,817 @@ export interface Repos {
|
|
|
498
521
|
name: string;
|
|
499
522
|
source: "autopilot" | "registered";
|
|
500
523
|
}>;
|
|
524
|
+
suggested?: Array<{
|
|
525
|
+
id: string;
|
|
526
|
+
path?: string;
|
|
527
|
+
name: string;
|
|
528
|
+
}>;
|
|
529
|
+
missing?: Array<{
|
|
530
|
+
id: string;
|
|
531
|
+
path?: string;
|
|
532
|
+
name: string;
|
|
533
|
+
}>;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/** The body of POST /v1/repos. The first request names suggestion (an id from GET /v1/repos?all=1) or path (an absolute path to a git checkout); the second sends only confirmToken. */
|
|
537
|
+
export interface RepoRequest {
|
|
538
|
+
contractVersion: string;
|
|
539
|
+
suggestion?: string;
|
|
540
|
+
path?: string;
|
|
541
|
+
confirmToken?: string;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/** What POST /v1/repos and DELETE /v1/repos/{id} return. Without a token: preview (the repository's name) with confirmToken and expiresAt. With it: registered or removed, by name. Paths never leave the server here. */
|
|
545
|
+
export interface RepoChange {
|
|
546
|
+
contractVersion: string;
|
|
547
|
+
preview?: {
|
|
548
|
+
name: string;
|
|
549
|
+
};
|
|
550
|
+
confirmToken?: string;
|
|
551
|
+
expiresAt?: string;
|
|
552
|
+
registered?: {
|
|
553
|
+
name: string;
|
|
554
|
+
};
|
|
555
|
+
removed?: {
|
|
556
|
+
name: string;
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/** The catalog of jobs the office can start (office-jobs.json), read by job-launch.mjs and served by GET /v1/jobs. */
|
|
561
|
+
export interface OfficeJobs {
|
|
562
|
+
$schema?: string;
|
|
563
|
+
contractVersion: string;
|
|
564
|
+
description?: string;
|
|
565
|
+
jobs: Array<{
|
|
566
|
+
id: string;
|
|
567
|
+
command: string;
|
|
568
|
+
role: string;
|
|
569
|
+
team: boolean;
|
|
570
|
+
launch?: "development" | "analysis" | "autopilot";
|
|
571
|
+
available?: boolean;
|
|
572
|
+
reason?: string | null;
|
|
573
|
+
params: Array<{
|
|
574
|
+
name: string;
|
|
575
|
+
kind: "work-item" | "pull-request" | "branch" | "run-id" | "jira-key" | "github-issue" | "enum" | "repo-path";
|
|
576
|
+
values?: Array<string>;
|
|
577
|
+
required: boolean;
|
|
578
|
+
}>;
|
|
579
|
+
writes: "none" | "branch" | "branch-pr" | "pr-comments" | "issue-comment";
|
|
580
|
+
}>;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/** The body of POST /v1/jobs. The first request names jobId (from GET /v1/jobs), repo (a name from GET /v1/repos or its path) and args (by parameter name), plus answers for a pipeline run; the second sends only confirmToken. */
|
|
584
|
+
export interface JobRequest {
|
|
585
|
+
contractVersion: string;
|
|
586
|
+
jobId?: string;
|
|
587
|
+
repo?: string;
|
|
588
|
+
args?: {
|
|
589
|
+
[key: string]: string;
|
|
590
|
+
};
|
|
591
|
+
answers?: Record<string, unknown>;
|
|
592
|
+
confirmToken?: string;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/** What POST /v1/jobs returns. Without a token: preview (the job, the role that does it, team or solo, the repository by name, the exact prompt the session receives and what it writes outside the machine) with confirmToken and expiresAt. With it: started, the session the server began. */
|
|
596
|
+
export interface JobChange {
|
|
597
|
+
contractVersion: string;
|
|
598
|
+
preview?: {
|
|
599
|
+
jobId: string;
|
|
600
|
+
role: string;
|
|
601
|
+
team: boolean;
|
|
602
|
+
repo: string;
|
|
603
|
+
prompt: string;
|
|
604
|
+
writes: "none" | "branch" | "branch-pr" | "pr-comments" | "issue-comment";
|
|
605
|
+
};
|
|
606
|
+
confirmToken?: string;
|
|
607
|
+
expiresAt?: string;
|
|
608
|
+
started?: {
|
|
609
|
+
sessionId: string;
|
|
610
|
+
jobId: string;
|
|
611
|
+
role: string;
|
|
612
|
+
team: boolean;
|
|
613
|
+
repo: string;
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/** What GET /v1/activity returns and `activity-snapshot.mjs --json` prints, and what each GET /v1/activity/stream event carries: one room per repository, one table per run (its team; a session no run claims sits at a table of its own), one seat per agent seen in the recent window, the orchestrator at the head. Derived from disk on every call. No field is machine-local: there are no paths, seat labels come from allow-listed fields only (tool name, file basename, sidecar description), and every free-text string has been through the redactor, so the redacted and the full view are the same document. */
|
|
618
|
+
export interface Activity {
|
|
619
|
+
contractVersion: string;
|
|
620
|
+
generatedAt: string;
|
|
621
|
+
/** A session or subagent whose transcript changed within this window has a desk. */
|
|
622
|
+
recentMinutes: number;
|
|
623
|
+
counts: {
|
|
624
|
+
rooms: number;
|
|
625
|
+
tables: number;
|
|
626
|
+
seats: number;
|
|
627
|
+
live: number;
|
|
628
|
+
waiting: number;
|
|
629
|
+
};
|
|
630
|
+
rooms: Array<{
|
|
631
|
+
repo: string;
|
|
632
|
+
tables: Array<ActivityTable>;
|
|
633
|
+
}>;
|
|
634
|
+
/** Runs over more than one repository: the table and the rooms its corridor joins. */
|
|
635
|
+
corridors: Array<{
|
|
636
|
+
tableId: string;
|
|
637
|
+
repos: Array<string>;
|
|
638
|
+
}>;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
export interface ActivityTable {
|
|
642
|
+
id: string;
|
|
643
|
+
/** run: a pipeline run; session: a session no run claims (outside the pipeline); unmatched: a session more than one run could claim, kept apart rather than guessed. solo: a session the office started for a one-person job, seated at a desk. */
|
|
644
|
+
kind: "run" | "session" | "solo" | "unmatched";
|
|
645
|
+
/** The command the table runs, for its room sign: /multi-agent, /multi-agent:analysis, /multi-agent:test-gen. Null for a session no command owns. */
|
|
646
|
+
command: string | null;
|
|
647
|
+
/** Which pipeline the table runs: /multi-agent (development), /multi-agent:analysis, or an autopilot run. Null for a session no pipeline owns. The office names the room after it. */
|
|
648
|
+
runType: "development" | "analysis" | "autopilot" | null;
|
|
649
|
+
taskId: string | null;
|
|
650
|
+
title: string | null;
|
|
651
|
+
host: "claude" | "copilot" | "codex";
|
|
652
|
+
/** true for a Copilot CLI or Codex session: no subagent detail exists there. */
|
|
653
|
+
limited: boolean;
|
|
654
|
+
sessionId: string | null;
|
|
655
|
+
/** How the session was tied to the run: the session id the run recorded, or its working directory and branch. */
|
|
656
|
+
matchedBy: "session" | "cwd-branch" | null;
|
|
657
|
+
repos: Array<string>;
|
|
658
|
+
phase: {
|
|
659
|
+
id: number;
|
|
660
|
+
name: string;
|
|
661
|
+
/** The last phase id, for an n of last display. */
|
|
662
|
+
last: number;
|
|
663
|
+
} | null;
|
|
664
|
+
/** The task in progress in the phase in progress, from the mirrored task list. */
|
|
665
|
+
currentTask: string | null;
|
|
666
|
+
progress: number | null;
|
|
667
|
+
now: string | null;
|
|
668
|
+
status: string | null;
|
|
669
|
+
waitingForYou: boolean;
|
|
670
|
+
pendingQuestion: {
|
|
671
|
+
id: string;
|
|
672
|
+
text: string;
|
|
673
|
+
kind: "single-select" | "multi-select";
|
|
674
|
+
options: Array<{
|
|
675
|
+
id: string;
|
|
676
|
+
label: string;
|
|
677
|
+
}>;
|
|
678
|
+
} | null;
|
|
679
|
+
tokens: {
|
|
680
|
+
in: number;
|
|
681
|
+
out: number;
|
|
682
|
+
cached: number;
|
|
683
|
+
} | null;
|
|
684
|
+
estUsd: number | null;
|
|
685
|
+
/** Where tokens and estUsd come from. not-measured means the numbers are null, never 0. */
|
|
686
|
+
costSource: "tracker-state" | "not-measured";
|
|
687
|
+
/** The room this table stands in. */
|
|
688
|
+
repo: string;
|
|
689
|
+
/** worktree: the run works in its own worktree; local: in the main checkout; unknown when the state does not say. */
|
|
690
|
+
location: "worktree" | "local" | "unknown";
|
|
691
|
+
branch: string | null;
|
|
692
|
+
phaseHistory: Array<{
|
|
693
|
+
id: number | null;
|
|
694
|
+
/** How far the phase is, from its mirrored task list; null when it has none. */
|
|
695
|
+
progress: number | null;
|
|
696
|
+
/** The phase's task list as the host task widget shows it (mirrored by phase-tracker.sh task), redacted and cut short. */
|
|
697
|
+
tasks: Array<{
|
|
698
|
+
subject: string;
|
|
699
|
+
status: "pending" | "in_progress" | "completed";
|
|
700
|
+
}>;
|
|
701
|
+
name: string;
|
|
702
|
+
status: string;
|
|
703
|
+
startedAt: string | null;
|
|
704
|
+
completedAt: string | null;
|
|
705
|
+
}>;
|
|
706
|
+
startedAt: string | null;
|
|
707
|
+
elapsedSeconds: number | null;
|
|
708
|
+
/** The seat id that holds the work now. */
|
|
709
|
+
holder: string | null;
|
|
710
|
+
/** The last seat of an earlier phase, for drawing the handoff. */
|
|
711
|
+
previousHolder: string | null;
|
|
712
|
+
seats: Array<ActivitySeat>;
|
|
713
|
+
/** The office job a session was started for (run tables carry none). */
|
|
714
|
+
job?: null | {
|
|
715
|
+
id: string;
|
|
716
|
+
role: string;
|
|
717
|
+
team: boolean;
|
|
718
|
+
};
|
|
719
|
+
/** Where the run's work came from, for the table sign: a Jira key, a GitHub issue or free text. Null for a session or a run that recorded neither. */
|
|
720
|
+
source: {
|
|
721
|
+
kind: "jira" | "github" | "text";
|
|
722
|
+
jira: string | null;
|
|
723
|
+
issue: string | null;
|
|
724
|
+
} | null;
|
|
725
|
+
/** The pull request the run opened, by number only. */
|
|
726
|
+
pr: {
|
|
727
|
+
number: number;
|
|
728
|
+
} | null;
|
|
729
|
+
/** What a waiting run waits for: a step it paused at (the run's waitingFor), or terminal when its session holds a question open in its own window. */
|
|
730
|
+
waitingFor: "maturity" | "user-channels-choice" | "local-test" | "attended-reply" | "question" | "terminal" | null;
|
|
731
|
+
/** Where the run's report went, per adapter, for the run window; empty for a session or before Phase 5. */
|
|
732
|
+
channels: Array<{
|
|
733
|
+
channel: "pr" | "jira" | "confluence" | "wiki" | "issue";
|
|
734
|
+
status: "posted" | "skipped" | "failed";
|
|
735
|
+
}>;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
export interface ActivitySeat {
|
|
739
|
+
/** The desk's own task list from its transcript (TaskCreate / TaskUpdate / TodoWrite), phase tiles left out, redacted and cut short. */
|
|
740
|
+
tasks: Array<{
|
|
741
|
+
subject: string;
|
|
742
|
+
status: "pending" | "in_progress" | "completed";
|
|
743
|
+
}>;
|
|
744
|
+
/** The desk's last MCP calls, newest last: server, tool, whether it is still running, failed or answered, and how long it took. No input or result. */
|
|
745
|
+
mcp: Array<{
|
|
746
|
+
server: string;
|
|
747
|
+
tool: string;
|
|
748
|
+
state: "running" | "ok" | "error";
|
|
749
|
+
ms: number | null;
|
|
750
|
+
at: string | null;
|
|
751
|
+
}>;
|
|
752
|
+
id: string;
|
|
753
|
+
sessionId: string | null;
|
|
754
|
+
/** null for the session's own (orchestrator) desk. */
|
|
755
|
+
agentId: string | null;
|
|
756
|
+
agentType: string | null;
|
|
757
|
+
role: string;
|
|
758
|
+
/** The role, numbered when agents of the same role sit at one table (Reviewer 1, Reviewer 2). */
|
|
759
|
+
label: string;
|
|
760
|
+
/** false when the agent type is in no role table entry and the raw type is shown. */
|
|
761
|
+
known: boolean;
|
|
762
|
+
sprite: number;
|
|
763
|
+
color: string;
|
|
764
|
+
model: string | null;
|
|
765
|
+
modelLabel: string | null;
|
|
766
|
+
description: string | null;
|
|
767
|
+
state: "reading" | "writing" | "spawning" | "waiting" | "idle" | "done";
|
|
768
|
+
tool: string | null;
|
|
769
|
+
detail: string | null;
|
|
770
|
+
/** Whether the session is alive per `claude agents --json`; null when that list cannot be read. */
|
|
771
|
+
live: boolean | null;
|
|
772
|
+
startedAt: string | null;
|
|
773
|
+
lastAt: string | null;
|
|
774
|
+
/** The run phase the agent was spawned in; null for the orchestrator or outside a run. */
|
|
775
|
+
phase: number | null;
|
|
776
|
+
status: "working" | "idle" | "done";
|
|
777
|
+
/** What the seat is doing in a few plain words (Reading Foo.swift, Running a command), else the raw tool name. */
|
|
778
|
+
doing: string;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/** What GET /v1/agents/{sessionId}/{agentId}/chat returns and `activity-snapshot.mjs chat` prints: one page of an agent's transcript read from its end, oldest first, at most `limit` messages. Only user and assistant records are read; api-request records are never parsed and thinking blocks are never emitted. Every text has been through the redactor; a text the outbound gate still flags is replaced by a marker. `before` is the byte offset to send back for the previous page, null at the start of the file. */
|
|
782
|
+
export interface ActivityChat {
|
|
783
|
+
contractVersion: string;
|
|
784
|
+
sessionId: string;
|
|
785
|
+
/** null for the session's own transcript (the orchestrator). */
|
|
786
|
+
agentId: string | null;
|
|
787
|
+
messages: Array<{
|
|
788
|
+
offset: number;
|
|
789
|
+
role: "user" | "assistant";
|
|
790
|
+
at: string | null;
|
|
791
|
+
blocks: Array<{
|
|
792
|
+
kind: "text";
|
|
793
|
+
text: string;
|
|
794
|
+
} | {
|
|
795
|
+
kind: "tool";
|
|
796
|
+
name: string;
|
|
797
|
+
summary: string;
|
|
798
|
+
toolUseId: string | null;
|
|
799
|
+
} | {
|
|
800
|
+
kind: "result";
|
|
801
|
+
toolUseId: string | null;
|
|
802
|
+
text: string;
|
|
803
|
+
isError: boolean;
|
|
804
|
+
}>;
|
|
805
|
+
}>;
|
|
806
|
+
before: number | null;
|
|
807
|
+
/** How many items the redactor replaced on this page. */
|
|
808
|
+
redacted: number;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/** What GET /v1/routines returns (`routine-registry.mjs list --json`): the routines saved with /multi-agent:save. Description and source are scrubbed. */
|
|
812
|
+
export interface Routines {
|
|
813
|
+
contractVersion: string;
|
|
814
|
+
routines: Array<{
|
|
815
|
+
name: string;
|
|
816
|
+
description: string;
|
|
817
|
+
createdAt: string | null;
|
|
818
|
+
source: string | null;
|
|
819
|
+
}>;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/** What DELETE /v1/routines/{name} returns. Without ?confirm: preview (the routine) with confirmToken and expiresAt. With it: removed, from `routine-registry.mjs remove`. A shipped command is never removed. */
|
|
823
|
+
export interface RoutineDelete {
|
|
824
|
+
contractVersion: string;
|
|
825
|
+
preview?: {
|
|
826
|
+
name: string;
|
|
827
|
+
description: string;
|
|
828
|
+
createdAt: string | null;
|
|
829
|
+
source: string | null;
|
|
830
|
+
};
|
|
831
|
+
confirmToken?: string;
|
|
832
|
+
expiresAt?: string;
|
|
833
|
+
removed?: {
|
|
834
|
+
name: string;
|
|
835
|
+
removedDir: boolean;
|
|
836
|
+
removedEntry: boolean;
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
/** What GET /v1/stack?repo= returns (`stack-toggle.mjs status --json`): the stacks a repository enables in .claude/settings.json and every marketplace plugin with its skills. manifestVerified is false when the marketplace manifest could not be read and the plugin list is the convention. */
|
|
841
|
+
export interface Stack {
|
|
842
|
+
contractVersion: string;
|
|
843
|
+
stacks: Array<string>;
|
|
844
|
+
knownStacks: Array<string>;
|
|
845
|
+
plugins: Array<{
|
|
846
|
+
name: string;
|
|
847
|
+
enabled: boolean;
|
|
848
|
+
alwaysOn: boolean;
|
|
849
|
+
stack: string | null;
|
|
850
|
+
skills: Array<string>;
|
|
851
|
+
}>;
|
|
852
|
+
manifestVerified: boolean;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
/** The body of POST /v1/stack. The first request names repo (a name from GET /v1/repos or its path) and stacks (as /multi-agent:stack takes them, aliases allowed); the second sends only confirmToken. */
|
|
856
|
+
export interface StackRequest {
|
|
857
|
+
contractVersion: string;
|
|
858
|
+
repo?: string;
|
|
859
|
+
stacks?: Array<string>;
|
|
860
|
+
confirmToken?: string;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/** What POST /v1/stack returns (`stack-toggle.mjs set`). Step one: preview {stacks, changed, enabledPlugins, dropped} with confirmToken and expiresAt, nothing written. Step two: the written enabledPlugins, the keys that changed and written. */
|
|
864
|
+
export interface StackChange {
|
|
865
|
+
contractVersion: string;
|
|
866
|
+
preview?: {
|
|
867
|
+
stacks: Array<string>;
|
|
868
|
+
changed: Array<string>;
|
|
869
|
+
enabledPlugins: {
|
|
870
|
+
[key: string]: boolean;
|
|
871
|
+
};
|
|
872
|
+
dropped: Array<string>;
|
|
873
|
+
};
|
|
874
|
+
confirmToken?: string;
|
|
875
|
+
expiresAt?: string;
|
|
876
|
+
stacks?: Array<string>;
|
|
877
|
+
enabledPlugins?: {
|
|
878
|
+
[key: string]: boolean;
|
|
879
|
+
};
|
|
880
|
+
changed?: Array<string>;
|
|
881
|
+
dropped?: Array<string>;
|
|
882
|
+
written?: boolean;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/** The body of POST /v1/autopilot/on. The first request names the selection (repos, by nameWithOwner, each already in the autopilot config) and gets a preview and a confirm token; the second sends only the token and turns the mode on for exactly what was previewed. An empty selection is refused: the mode is never turned on without a repository. */
|
|
886
|
+
export interface AutopilotOnRequest {
|
|
887
|
+
contractVersion: string;
|
|
888
|
+
repos?: Array<string>;
|
|
889
|
+
/** Save the selection without scheduling anything. */
|
|
890
|
+
configureOnly?: boolean;
|
|
891
|
+
confirmToken?: string;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
/** What POST /v1/autopilot/on returns (`autopilot-control.mjs on-preview`, then `on`). Step one: preview {keep, drop, probe, configureOnly} with confirmToken and expiresAt. Step two: enabled and scheduled say whether the schedule was loaded; it is not when configureOnly was asked or a credential probe failed, and probe says which. */
|
|
895
|
+
export interface AutopilotOn {
|
|
896
|
+
contractVersion: string;
|
|
897
|
+
preview?: {
|
|
898
|
+
keep: Array<string>;
|
|
899
|
+
drop: Array<string>;
|
|
900
|
+
probe: {
|
|
901
|
+
ready: boolean;
|
|
902
|
+
problems: Array<string>;
|
|
903
|
+
warnings: Array<string>;
|
|
904
|
+
};
|
|
905
|
+
configureOnly: boolean;
|
|
906
|
+
};
|
|
907
|
+
confirmToken?: string;
|
|
908
|
+
expiresAt?: string;
|
|
909
|
+
enabled?: boolean;
|
|
910
|
+
scheduled?: boolean;
|
|
911
|
+
awake?: boolean | null;
|
|
912
|
+
repos?: Array<string>;
|
|
913
|
+
dropped?: Array<string>;
|
|
914
|
+
probe?: {
|
|
915
|
+
ready: boolean;
|
|
916
|
+
problems: Array<string>;
|
|
917
|
+
warnings: Array<string>;
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/** The body of POST /v1/runs/{id}/steer. The first request carries text (verbatim, up to 4000 characters) and gets a preview and a confirm token bound to the run and that text; the second carries only confirmToken. */
|
|
922
|
+
export interface SteerRequest {
|
|
923
|
+
contractVersion: string;
|
|
924
|
+
text?: string;
|
|
925
|
+
confirmToken?: string;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/** What POST /v1/runs/{id}/steer returns (`steer-run.mjs`). Step one: preview {text, status, currentPhase, replaces} with confirmToken and expiresAt, nothing written. Step two: the instruction is queued as the run's pendingSteer and applied at the entry to its next phase; replaced is the unconsumed instruction it replaced, or null. */
|
|
929
|
+
export interface Steer {
|
|
930
|
+
contractVersion: string;
|
|
931
|
+
taskId: string;
|
|
932
|
+
queuedAt?: string;
|
|
933
|
+
replaced?: string | null;
|
|
934
|
+
status?: string | null;
|
|
935
|
+
currentPhase?: number | null;
|
|
936
|
+
preview?: {
|
|
937
|
+
text: string;
|
|
938
|
+
status: string | null;
|
|
939
|
+
currentPhase: number | null;
|
|
940
|
+
replaces: string | null;
|
|
941
|
+
};
|
|
942
|
+
confirmToken?: string;
|
|
943
|
+
expiresAt?: string;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
/** What GET /v1/ledger returns and `office-ledger.mjs --json` prints: tokens and estimated USD for today, this week (from Monday) and this month, in local time, broken down by run, repository, model and phase. A run's numbers come from its tracker-state.json when the tracker carries tokens, else from the usage records of the transcripts tied to it; a run with neither is not-measured, and its usd and tokens are null, never 0. Sessions no run claims are counted apart as outside the pipeline. Prices come from cost-table.json; a cache write is priced at 1.25 times input. Every amount names its source. */
|
|
947
|
+
export interface Ledger {
|
|
948
|
+
contractVersion: string;
|
|
949
|
+
generatedAt: string;
|
|
950
|
+
prices: {
|
|
951
|
+
table: "cost-table.json";
|
|
952
|
+
verifiedAt: string | null;
|
|
953
|
+
ageDays: number | null;
|
|
954
|
+
stale: boolean;
|
|
955
|
+
warning: string | null;
|
|
956
|
+
};
|
|
957
|
+
windows: {
|
|
958
|
+
today: LedgerWindow;
|
|
959
|
+
week: LedgerWindow;
|
|
960
|
+
month: LedgerWindow;
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
/** tracker-state: the pipeline's own ledger; transcript: derived from the host's usage records; mixed: a sum of both kinds; not-measured: nothing could be read, so the numbers are null. */
|
|
965
|
+
export type LedgerSource = "tracker-state" | "transcript" | "mixed" | "not-measured";
|
|
966
|
+
|
|
967
|
+
export type LedgerTokens = {
|
|
968
|
+
in: number;
|
|
969
|
+
out: number;
|
|
970
|
+
cacheRead: number;
|
|
971
|
+
cacheWrite: number;
|
|
972
|
+
} | null;
|
|
973
|
+
|
|
974
|
+
export interface LedgerAmount {
|
|
975
|
+
tokens: LedgerTokens;
|
|
976
|
+
usd: number | null;
|
|
977
|
+
source: LedgerSource;
|
|
978
|
+
/** Usage records whose model has no price; their tokens are counted, their cost is not. */
|
|
979
|
+
unpriced: number;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
export interface LedgerRow {
|
|
983
|
+
key: string;
|
|
984
|
+
/** On byRun rows: the run repository. */
|
|
985
|
+
repo?: string | null;
|
|
986
|
+
tokens: LedgerTokens;
|
|
987
|
+
usd: number | null;
|
|
988
|
+
source: LedgerSource;
|
|
989
|
+
unpriced: number;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
export interface LedgerWindow {
|
|
993
|
+
since: string;
|
|
994
|
+
total: LedgerAmount;
|
|
995
|
+
outsidePipeline: LedgerAmount;
|
|
996
|
+
/** Task ids of runs active in the window whose cost could not be measured. */
|
|
997
|
+
notMeasured: Array<string>;
|
|
998
|
+
byRun: Array<LedgerRow>;
|
|
999
|
+
byRepo: Array<LedgerRow>;
|
|
1000
|
+
byModel: Array<LedgerRow>;
|
|
1001
|
+
byPhase: Array<LedgerRow>;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/** What GET /v1/system returns and `system-status.mjs --json` prints: CPU load, memory, free disk and what the pipeline itself uses. Numbers only: no path, process argument, user name or host name. A value that could not be measured is null, never 0. */
|
|
1005
|
+
export interface SystemStatus {
|
|
1006
|
+
contractVersion: string;
|
|
1007
|
+
generatedAt: string;
|
|
1008
|
+
cpu: {
|
|
1009
|
+
cores: number;
|
|
1010
|
+
/** Busy share of all cores over a short sampling window. */
|
|
1011
|
+
usage: number | null;
|
|
1012
|
+
/** Load average over 1, 5 and 15 minutes. */
|
|
1013
|
+
load: Array<number>;
|
|
1014
|
+
};
|
|
1015
|
+
memory: {
|
|
1016
|
+
totalMb: number;
|
|
1017
|
+
/** Total minus what the OS reports free; on macOS that counts the file cache as used. */
|
|
1018
|
+
usedMb: number;
|
|
1019
|
+
};
|
|
1020
|
+
disk: {
|
|
1021
|
+
home: SystemStatusDisk;
|
|
1022
|
+
/** The disk the run logs live on, when it is not the home disk; null when it is the same disk. */
|
|
1023
|
+
logs: SystemStatusDisk;
|
|
1024
|
+
};
|
|
1025
|
+
pipeline: {
|
|
1026
|
+
/** Claude Code processes running. */
|
|
1027
|
+
sessions: number | null;
|
|
1028
|
+
/** multi-agent-toolkit server processes running. */
|
|
1029
|
+
toolkit: number | null;
|
|
1030
|
+
/** Their resident memory together. */
|
|
1031
|
+
rssMb: number | null;
|
|
1032
|
+
/** Size of the run log folder; null when it could not be measured in time. */
|
|
1033
|
+
logsMb: number | null;
|
|
1034
|
+
};
|
|
1035
|
+
/** disk-low: under 10 percent of the home disk is free. cpu-busy: the 5-minute load is above the core count. */
|
|
1036
|
+
warnings: (Array<"disk-low" | "cpu-busy">);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
export type SystemStatusDisk = {
|
|
1040
|
+
totalMb: number;
|
|
1041
|
+
freeMb: number;
|
|
1042
|
+
} | null;
|
|
1043
|
+
|
|
1044
|
+
/** What GET /v1/credentials returns and `office-credentials.mjs --json` prints: for each credential the pipeline knows by logical name, whether the store holds it and, with probe, whether its service accepted it. Never a value: lib/credential-inventory.sh reads each through the store with stdout discarded. Renewal stays in the terminal (/multi-agent:setup). */
|
|
1045
|
+
export interface OfficeCredentials {
|
|
1046
|
+
contractVersion: string;
|
|
1047
|
+
generatedAt: string;
|
|
1048
|
+
probed: boolean;
|
|
1049
|
+
/** False when the inventory could not run on this host. */
|
|
1050
|
+
available: boolean;
|
|
1051
|
+
credentials: Array<{
|
|
1052
|
+
logical: string;
|
|
1053
|
+
state: "present" | "mapped-but-missing" | "unmapped";
|
|
1054
|
+
reachability: "not-probed" | "reachable" | "auth-rejected" | "unreachable" | "no-host-configured" | "well-formed" | "not-probeable" | "malformed" | "no-credential" | "probe-error" | "server-error" | "tier-1-ready" | "tier-2-ready" | "tier-1-no-grant" | "unknown";
|
|
1055
|
+
capability: string | null;
|
|
1056
|
+
}>;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/** What GET /v1/memory returns and `office-memory.mjs --json` prints: per repository, the code graph's age and size and how many learnings, past review findings and session notes the learning loop holds, with the newest learnings redacted and cut short. An empty shelf is reported, never left out. */
|
|
1060
|
+
export interface OfficeMemory {
|
|
1061
|
+
contractVersion: string;
|
|
1062
|
+
generatedAt: string;
|
|
1063
|
+
shelves: Array<{
|
|
1064
|
+
repo: string;
|
|
1065
|
+
graph: null | {
|
|
1066
|
+
builtAt: string | null;
|
|
1067
|
+
ageDays: number;
|
|
1068
|
+
sizeKb: number;
|
|
1069
|
+
};
|
|
1070
|
+
learnings: number;
|
|
1071
|
+
findings: number;
|
|
1072
|
+
sessionNotes: number;
|
|
1073
|
+
recent: Array<{
|
|
1074
|
+
kind: string | null;
|
|
1075
|
+
statement: string;
|
|
1076
|
+
at: string | null;
|
|
1077
|
+
}>;
|
|
1078
|
+
lastWrite: string | null;
|
|
1079
|
+
}>;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/** What POST /v1/prune-logs returns. The preview (body {olderThanDays}) is prune-logs.sh's dry run for that age with a confirm token; the confirmation (body {confirmToken}) runs it again with the same age and --yes. The audit trail, the metrics corpus and task counters are never removed, and a folder written in the last minutes is spared. */
|
|
1083
|
+
export interface PruneLogs {
|
|
1084
|
+
contractVersion: string;
|
|
1085
|
+
olderThanDays: 7 | 30 | 90;
|
|
1086
|
+
applied: boolean;
|
|
1087
|
+
count: number;
|
|
1088
|
+
freedMb: number;
|
|
1089
|
+
/** project/task folders, at most 200 listed. */
|
|
1090
|
+
folders: Array<string>;
|
|
1091
|
+
confirmToken?: string;
|
|
1092
|
+
expiresAt?: string;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
/** The body of POST /v1/prune-logs. Step 1 names the age in days (7, 30 or 90); step 2 sends only the confirmToken step 1 returned. */
|
|
1096
|
+
export interface PruneLogsRequest {
|
|
1097
|
+
contractVersion: string;
|
|
1098
|
+
olderThanDays?: 7 | 30 | 90;
|
|
1099
|
+
/** The confirmToken the preview returned. Single use, bound to the route. */
|
|
1100
|
+
confirmToken?: string;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
/** What GET /v1/runs/{id}/results returns (`run-results.mjs <id> --json`): what a run produced, read from its own files. diff from agent-state diffRisk or .review-diff.txt; findings from triage-output.json or agent-state review; tests from the test-summary gate and uiTest; evidence the screenshot names under .pipeline/evidence; analysis the documents an analysis run wrote. A part with no source is null. Text is scrubbed and redacted; paths are reduced to file names. */
|
|
1104
|
+
export interface RunResults {
|
|
1105
|
+
contractVersion: string;
|
|
1106
|
+
taskId: string;
|
|
1107
|
+
diff: {
|
|
1108
|
+
files: number;
|
|
1109
|
+
added: number | null;
|
|
1110
|
+
removed: number | null;
|
|
1111
|
+
maxScore: number | null;
|
|
1112
|
+
signals: Array<string>;
|
|
1113
|
+
changed: Array<string>;
|
|
1114
|
+
source: string;
|
|
1115
|
+
} | null;
|
|
1116
|
+
findings: {
|
|
1117
|
+
approved: boolean | null;
|
|
1118
|
+
items: Array<{
|
|
1119
|
+
severity: string;
|
|
1120
|
+
file: string | null;
|
|
1121
|
+
line: number | null;
|
|
1122
|
+
issue: string;
|
|
1123
|
+
fix: string | null;
|
|
1124
|
+
reviewer: string | null;
|
|
1125
|
+
verdict: string;
|
|
1126
|
+
}>;
|
|
1127
|
+
total: number;
|
|
1128
|
+
source: string;
|
|
1129
|
+
} | null;
|
|
1130
|
+
tests: {
|
|
1131
|
+
status: string | null;
|
|
1132
|
+
passed: number | null;
|
|
1133
|
+
failed: number | null;
|
|
1134
|
+
skipped: number | null;
|
|
1135
|
+
uiTest: {
|
|
1136
|
+
ran: boolean;
|
|
1137
|
+
status: string | null;
|
|
1138
|
+
notRunReason: string | null;
|
|
1139
|
+
} | null;
|
|
1140
|
+
source: string;
|
|
1141
|
+
} | null;
|
|
1142
|
+
evidence: Array<{
|
|
1143
|
+
name: string;
|
|
1144
|
+
phase: "before" | "after" | null;
|
|
1145
|
+
}>;
|
|
1146
|
+
analysis: {
|
|
1147
|
+
documents: Array<{
|
|
1148
|
+
name: string;
|
|
1149
|
+
text: string | null;
|
|
1150
|
+
}>;
|
|
1151
|
+
confluencePages: number;
|
|
1152
|
+
jiraIssueKey: string | null;
|
|
1153
|
+
} | null;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
/** What GET /v1/runs/{id}/evidence/{name} returns (`run-results.mjs <id> --evidence <name>`): one screenshot from the run's .pipeline/evidence directory, base64. name is a bare png or jpg file name; one that resolves outside the directory is not found. */
|
|
1157
|
+
export interface RunEvidence {
|
|
1158
|
+
contractVersion: string;
|
|
1159
|
+
taskId: string;
|
|
1160
|
+
name: string;
|
|
1161
|
+
mime: "image/png" | "image/jpeg";
|
|
1162
|
+
data: string;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/** What GET /v1/issues/{key}/maturity returns (`work-items.mjs maturity <key>`, from lib/issue-fetcher.sh): the maturity check the pipeline runs before it starts on an issue. key is a Jira key, owner/repo#N or #N. Blockers stop a run; warnings are asked about. Text is redacted. */
|
|
1166
|
+
export interface IssueMaturity {
|
|
1167
|
+
contractVersion: string;
|
|
1168
|
+
key: string;
|
|
1169
|
+
kind: "jira" | "github" | "freetext";
|
|
1170
|
+
title: string;
|
|
1171
|
+
type: string | null;
|
|
1172
|
+
status: string | null;
|
|
1173
|
+
maturity: {
|
|
1174
|
+
score: number | null;
|
|
1175
|
+
blockers: Array<string>;
|
|
1176
|
+
warnings: Array<string>;
|
|
1177
|
+
summary: string | null;
|
|
1178
|
+
};
|
|
1179
|
+
description: string | null;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/** What GET /v1/prs returns (`work-items.mjs prs`): open pull requests where you are asked to review or are the author. sources says per host whether it was read; Bitbucket listing is not implemented and says so rather than showing an empty list. url is dropped under redact. */
|
|
1183
|
+
export interface Prs {
|
|
1184
|
+
contractVersion: string;
|
|
1185
|
+
items: Array<{
|
|
1186
|
+
source: "github" | "bitbucket";
|
|
1187
|
+
/** The GitHub login the pull request was listed under, when gh is logged in to more than one account (personal and corporate). Null for Bitbucket. */
|
|
1188
|
+
account?: string | null;
|
|
1189
|
+
repo: string;
|
|
1190
|
+
number: number;
|
|
1191
|
+
title: string;
|
|
1192
|
+
url: string | null;
|
|
1193
|
+
author: string | null;
|
|
1194
|
+
updatedAt: string | null;
|
|
1195
|
+
role: "reviewer" | "author";
|
|
1196
|
+
}>;
|
|
1197
|
+
sources: Array<{
|
|
1198
|
+
source: string;
|
|
1199
|
+
ok: boolean;
|
|
1200
|
+
count: number;
|
|
1201
|
+
reason?: string;
|
|
1202
|
+
}>;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
/** The body of POST /v1/runs/{id}/review-verdict: empty for the preview, confirmToken to post. The verdict is never chosen by the request; it follows from the review's recorded findings. */
|
|
1206
|
+
export interface ReviewVerdictRequest {
|
|
1207
|
+
contractVersion: string;
|
|
1208
|
+
confirmToken?: string;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/** What POST /v1/runs/{id}/review-verdict returns (`work-items.mjs verdict <id> [--post]`). Only a finished review whose every finding is triaged (accepted, rejected or deferred) is previewed (409 review-incomplete otherwise). The preview carries findingsDigest, the hash of the findings it was made from, and the decision lib/post-pr-review.sh would post (approve with no accepted blocking or important finding, else needs-work), a confirmToken bound to that decision and digest, and expiresAt; a confirmation after either changed is 409 confirm-mismatch; the confirmation runs post-pr-review.sh, which posts the comments and the verdict with the user's own credential, and says posted. */
|
|
1212
|
+
export interface ReviewVerdict {
|
|
1213
|
+
contractVersion: string;
|
|
1214
|
+
taskId: string;
|
|
1215
|
+
provider: "github" | "bitbucket-server" | null;
|
|
1216
|
+
prNumber: number | null;
|
|
1217
|
+
decision: "approve" | "needs-work";
|
|
1218
|
+
acceptedBlocking: number;
|
|
1219
|
+
acceptedImportant: number;
|
|
1220
|
+
findings: number;
|
|
1221
|
+
posted?: boolean;
|
|
1222
|
+
confirmToken?: string;
|
|
1223
|
+
expiresAt?: string;
|
|
1224
|
+
findingsDigest: string;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/** What GET /v1/tools returns (`toolkit-tools.mjs list`): every tool the registered multi-agent-toolkit MCP server serves, with its category (the name's prefix), risk from its own annotations (readOnlyHint read, destructiveHint high, else low) and its inputSchema, from which a client builds the form. Calls are denied by default; allowed says which tools can be called and reason why the others cannot. */
|
|
1228
|
+
export interface Tools {
|
|
1229
|
+
contractVersion: string;
|
|
1230
|
+
tools: Array<{
|
|
1231
|
+
name: string;
|
|
1232
|
+
title: string | null;
|
|
1233
|
+
category: string;
|
|
1234
|
+
description: string;
|
|
1235
|
+
risk: "read" | "low" | "high";
|
|
1236
|
+
inputSchema: Record<string, unknown>;
|
|
1237
|
+
/** Whether POST /v1/tools/{name}/call accepts this tool: only a readOnlyHint tool whose inputSchema takes no location (path, URL, file, directory, output, project, root) and that is not in the web or context family. */
|
|
1238
|
+
allowed: boolean;
|
|
1239
|
+
reason: string | null;
|
|
1240
|
+
}>;
|
|
1241
|
+
/** The exact toolkit version the panel starts: the registration's own when it names one, else the version the install recorded from the release. */
|
|
1242
|
+
version?: string | null;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
/** The body of POST /v1/tools/{name}/call: the tool's arguments, which must satisfy its inputSchema. At most 64 KiB. */
|
|
1246
|
+
export interface ToolCallRequest {
|
|
1247
|
+
contractVersion: string;
|
|
1248
|
+
arguments?: Record<string, unknown>;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
/** What POST /v1/tools/{name}/call returns (`toolkit-tools.mjs call`): the tool's result as text, JSON (as text) and images (base64, image types only). Every text is redacted. */
|
|
1252
|
+
export interface ToolCall {
|
|
1253
|
+
contractVersion: string;
|
|
1254
|
+
tool: string;
|
|
1255
|
+
risk: "read" | "low" | "high";
|
|
1256
|
+
isError: boolean;
|
|
1257
|
+
content: Array<{
|
|
1258
|
+
kind: "text" | "json" | "image";
|
|
1259
|
+
text?: string;
|
|
1260
|
+
mime?: string;
|
|
1261
|
+
data?: string;
|
|
1262
|
+
}>;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/** What GET /v1/services/confluence, /crashlytics and /figma return (`service-read.mjs`): one Confluence page, one Crashlytics issue or one Figma frame render, through the pipeline's own clients. Text is redacted; a frame comes back as base64 PNG. */
|
|
1266
|
+
export interface ServiceRead {
|
|
1267
|
+
contractVersion: string;
|
|
1268
|
+
service: "confluence" | "crashlytics" | "figma";
|
|
1269
|
+
pageId?: string | null;
|
|
1270
|
+
title?: string;
|
|
1271
|
+
body?: string;
|
|
1272
|
+
apiContracts?: number;
|
|
1273
|
+
type?: string | null;
|
|
1274
|
+
occurrences?: number | null;
|
|
1275
|
+
impactedUsers?: number | null;
|
|
1276
|
+
stackTrace?: Array<string>;
|
|
1277
|
+
fileKey?: string;
|
|
1278
|
+
nodeId?: string;
|
|
1279
|
+
mime?: "image/png";
|
|
1280
|
+
data?: string;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/** What GET /v1/permissions returns: the host permission prompts waiting on the user. available is false while the host records none where another process can read them; requests is then empty and reason says so. When available, each request names its session, the tool and a redacted summary. */
|
|
1284
|
+
export interface Permissions {
|
|
1285
|
+
contractVersion: string;
|
|
1286
|
+
available: boolean;
|
|
1287
|
+
reason: string | null;
|
|
1288
|
+
requests: Array<{
|
|
1289
|
+
id: string;
|
|
1290
|
+
sessionId: string;
|
|
1291
|
+
tool: string;
|
|
1292
|
+
summary: string;
|
|
1293
|
+
at: string;
|
|
1294
|
+
}>;
|
|
501
1295
|
}
|
|
502
1296
|
|
|
503
1297
|
/** Every non-2xx body contract-server.mjs sends, on the desktop and the phone routes alike. `error` is a fixed code a client switches on; `message` is for a person and names no path, host or token. `errors` lists schema or rule violations for invalid-body and invalid-request; `supported` lists the majors ?v= accepts for unsupported-version. run-active and not-resumable answer POST /v1/runs/{id}/resume; confirm-expired and confirm-mismatch answer the confirming request of a kill or gc. */
|
|
504
1298
|
export interface ContractError {
|
|
505
1299
|
contractVersion: string;
|
|
506
|
-
error: "unauthorized" | "forbidden-host" | "forbidden-origin" | "not-found" | "method-not-allowed" | "invalid-query" | "unsupported-version" | "unsupported-media-type" | "invalid-body" | "invalid-request" | "no-launch-shape" | "not-waiting" | "wrong-question" | "wrong-arity" | "not-an-option" | "state-moved" | "unsigned" | "unknown-device" | "revoked-device" | "bad-signature" | "stale-request" | "replayed" | "replay-store-full" | "unknown-verb" | "forbidden-scope" | "launch-disabled" | "repo-not-allowed" | "run-active" | "not-resumable" | "confirm-expired" | "confirm-mismatch" | "unattended-profile-missing" | "workspace-not-trusted" | "internal";
|
|
1300
|
+
error: "unauthorized" | "forbidden-host" | "forbidden-origin" | "not-found" | "method-not-allowed" | "invalid-query" | "unsupported-version" | "unsupported-media-type" | "invalid-body" | "invalid-request" | "no-launch-shape" | "not-waiting" | "wrong-question" | "wrong-arity" | "not-an-option" | "state-moved" | "unsigned" | "unknown-device" | "revoked-device" | "bad-signature" | "stale-request" | "replayed" | "replay-store-full" | "unknown-verb" | "forbidden-scope" | "launch-disabled" | "repo-not-allowed" | "run-active" | "not-resumable" | "confirm-expired" | "confirm-mismatch" | "unattended-profile-missing" | "workspace-not-trusted" | "no-selection" | "repo-not-configured" | "invalid-config" | "not-installed" | "repo-ambiguous" | "unreadable-settings" | "not-removable" | "not-steerable" | "too-many-streams" | "no-review" | "upstream-failed" | "tool-not-allowed" | "busy" | "review-incomplete" | "host-not-allowed" | "internal" | "unknown-job" | "command-not-installed" | "invalid-repo" | "invalid-args" | "room-busy" | "sandbox-unavailable" | "launch-failed" | "guard-missing" | "name-taken" | "already-registered" | "not-registered";
|
|
507
1301
|
message: string;
|
|
508
1302
|
errors?: Array<string>;
|
|
509
1303
|
supported?: Array<number>;
|
|
510
1304
|
/** What fixes the refusal: for unattended-profile-missing the installer step that writes the unattended permission profile; for workspace-not-trusted opening Claude Code once in the repository to accept the trust prompt (the path is left out under redact). */
|
|
511
1305
|
remedy?: string;
|
|
512
1306
|
}
|
|
1307
|
+
|
|
1308
|
+
/** What GET /v1/settings returns and POST /v1/settings returns after a change: the output language, the fable rung and model routing. A preview (the first POST) adds the change it would make and a confirmToken. */
|
|
1309
|
+
export interface OfficeSettings {
|
|
1310
|
+
contractVersion: string;
|
|
1311
|
+
language: "en" | "tr";
|
|
1312
|
+
/** Whether the fable rung is in play. */
|
|
1313
|
+
model: "on" | "off";
|
|
1314
|
+
/** Whether model routing is on. */
|
|
1315
|
+
route: "on" | "off";
|
|
1316
|
+
change?: {
|
|
1317
|
+
setting: "language" | "model" | "route";
|
|
1318
|
+
from: string;
|
|
1319
|
+
to: string;
|
|
1320
|
+
/** Present when turning routing on brings back a saved free provider chain: the confirmation names it. */
|
|
1321
|
+
freeChain?: {
|
|
1322
|
+
enabled: true;
|
|
1323
|
+
allowTraining: boolean;
|
|
1324
|
+
};
|
|
1325
|
+
};
|
|
1326
|
+
confirmToken?: string;
|
|
1327
|
+
expiresAt?: string;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
/** The body of POST /v1/settings. Step 1 names the setting and its new value; step 2 sends only the confirmToken step 1 returned. */
|
|
1331
|
+
export interface OfficeSettingsRequest {
|
|
1332
|
+
contractVersion: string;
|
|
1333
|
+
setting?: "language" | "model" | "route";
|
|
1334
|
+
value?: "en" | "tr" | "on" | "off";
|
|
1335
|
+
/** The confirmToken the preview returned. Single use, bound to the route. */
|
|
1336
|
+
confirmToken?: string;
|
|
1337
|
+
}
|