agent-relay-server 0.10.20 → 0.10.22
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/docs/openapi.json +459 -70
- package/package.json +2 -2
- package/public/index.html +1200 -472
- package/scripts/orchestrator-spawn-smoke.ts +26 -2
- package/src/db.ts +97 -21
- package/src/lifecycle-manager.ts +56 -1
- package/src/maintenance.ts +117 -0
- package/src/routes.ts +415 -27
package/docs/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Agent Relay API",
|
|
5
|
-
"version": "0.10.
|
|
5
|
+
"version": "0.10.21",
|
|
6
6
|
"description": "Real-time message bus for inter-agent communication. Agent-first: this spec is designed for machine consumption — agents can self-discover the full API surface via GET /api/spec.",
|
|
7
7
|
"license": {
|
|
8
8
|
"name": "MIT",
|
|
@@ -1737,6 +1737,96 @@
|
|
|
1737
1737
|
]
|
|
1738
1738
|
}
|
|
1739
1739
|
},
|
|
1740
|
+
"/api/agents/{id}/prompt": {
|
|
1741
|
+
"post": {
|
|
1742
|
+
"operationId": "postAgentPrompt",
|
|
1743
|
+
"summary": "Inject a prompt into a live agent",
|
|
1744
|
+
"tags": [
|
|
1745
|
+
"Agents"
|
|
1746
|
+
],
|
|
1747
|
+
"description": "Injects a prompt directly into a runner-managed agent's provider session via the live-session lane. Creates a session message for the timeline and emits a prompt.inject bus command. The agent does not consume a relay message — the text goes straight into the provider stdin. Use for agents with liveSession.inject capability.",
|
|
1748
|
+
"parameters": [
|
|
1749
|
+
{
|
|
1750
|
+
"name": "id",
|
|
1751
|
+
"in": "path",
|
|
1752
|
+
"required": true,
|
|
1753
|
+
"schema": {
|
|
1754
|
+
"type": "string"
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
],
|
|
1758
|
+
"requestBody": {
|
|
1759
|
+
"required": true,
|
|
1760
|
+
"content": {
|
|
1761
|
+
"application/json": {
|
|
1762
|
+
"schema": {
|
|
1763
|
+
"type": "object",
|
|
1764
|
+
"properties": {
|
|
1765
|
+
"body": {
|
|
1766
|
+
"type": "string"
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
},
|
|
1773
|
+
"responses": {
|
|
1774
|
+
"200": {
|
|
1775
|
+
"description": "Success",
|
|
1776
|
+
"content": {
|
|
1777
|
+
"application/json": {}
|
|
1778
|
+
}
|
|
1779
|
+
},
|
|
1780
|
+
"201": {
|
|
1781
|
+
"description": "Created",
|
|
1782
|
+
"content": {
|
|
1783
|
+
"application/json": {}
|
|
1784
|
+
}
|
|
1785
|
+
},
|
|
1786
|
+
"400": {
|
|
1787
|
+
"description": "Bad request",
|
|
1788
|
+
"content": {
|
|
1789
|
+
"application/json": {
|
|
1790
|
+
"schema": {
|
|
1791
|
+
"$ref": "#/components/schemas/Error"
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
},
|
|
1796
|
+
"404": {
|
|
1797
|
+
"description": "Not found",
|
|
1798
|
+
"content": {
|
|
1799
|
+
"application/json": {
|
|
1800
|
+
"schema": {
|
|
1801
|
+
"$ref": "#/components/schemas/Error"
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
},
|
|
1806
|
+
"422": {
|
|
1807
|
+
"description": "Unprocessable entity",
|
|
1808
|
+
"content": {
|
|
1809
|
+
"application/json": {
|
|
1810
|
+
"schema": {
|
|
1811
|
+
"$ref": "#/components/schemas/Error"
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
},
|
|
1817
|
+
"security": [
|
|
1818
|
+
{
|
|
1819
|
+
"bearerAuth": []
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
"tokenHeader": []
|
|
1823
|
+
},
|
|
1824
|
+
{
|
|
1825
|
+
"tokenQuery": []
|
|
1826
|
+
}
|
|
1827
|
+
]
|
|
1828
|
+
}
|
|
1829
|
+
},
|
|
1740
1830
|
"/api/agents/{id}/permission-decision": {
|
|
1741
1831
|
"post": {
|
|
1742
1832
|
"operationId": "postAgentPermissionDecision",
|
|
@@ -2631,10 +2721,11 @@
|
|
|
2631
2721
|
"/api/orchestrators/{id}/actions": {
|
|
2632
2722
|
"post": {
|
|
2633
2723
|
"operationId": "postOrchestratorAction",
|
|
2634
|
-
"summary": "
|
|
2724
|
+
"summary": "Run an orchestrator action",
|
|
2635
2725
|
"tags": [
|
|
2636
2726
|
"Orchestrators"
|
|
2637
2727
|
],
|
|
2728
|
+
"description": "Dispatches a host action to the orchestrator over the command bus. `restart`/`shutdown` target a managed agent (omit `agentId` for all). `upgrade` triggers a remote self-upgrade: the relay stamps a desired version and the orchestrator installs it via the bundled `agent-relay upgrade --no-restart` CLI, then restarts itself decoupled (systemd-run) so the bus keepalive survives its own teardown. The upgrade command is intentionally left `running` — the relay settles it (succeeded/failed) by reconciling the version the orchestrator reports on its post-restart re-register, within a deadline. Safety rails: semver-only `targetVersion` (defaults to the relay's own version), npm-registry providers only, and no downgrade unless `force` is set. Requires systemd --user supervision on the orchestrator host.",
|
|
2638
2729
|
"parameters": [
|
|
2639
2730
|
{
|
|
2640
2731
|
"name": "id",
|
|
@@ -2651,27 +2742,57 @@
|
|
|
2651
2742
|
"application/json": {
|
|
2652
2743
|
"schema": {
|
|
2653
2744
|
"type": "object",
|
|
2745
|
+
"required": [
|
|
2746
|
+
"action"
|
|
2747
|
+
],
|
|
2654
2748
|
"properties": {
|
|
2655
2749
|
"action": {
|
|
2656
|
-
"type": "string"
|
|
2750
|
+
"type": "string",
|
|
2751
|
+
"enum": [
|
|
2752
|
+
"restart",
|
|
2753
|
+
"shutdown",
|
|
2754
|
+
"upgrade"
|
|
2755
|
+
],
|
|
2756
|
+
"description": "Action to dispatch."
|
|
2757
|
+
},
|
|
2758
|
+
"targetVersion": {
|
|
2759
|
+
"type": "string",
|
|
2760
|
+
"description": "upgrade only — semver (e.g. 0.10.21) to install. Defaults to the relay's own version (fleet target) when omitted."
|
|
2761
|
+
},
|
|
2762
|
+
"providers": {
|
|
2763
|
+
"type": "array",
|
|
2764
|
+
"items": {
|
|
2765
|
+
"type": "string"
|
|
2766
|
+
},
|
|
2767
|
+
"description": "upgrade only — packages to upgrade. Defaults to [\"orchestrator\"]."
|
|
2768
|
+
},
|
|
2769
|
+
"force": {
|
|
2770
|
+
"type": "boolean",
|
|
2771
|
+
"description": "upgrade only — allow a downgrade (targetVersion < current)."
|
|
2657
2772
|
},
|
|
2658
2773
|
"agentId": {
|
|
2659
|
-
"type": "string"
|
|
2774
|
+
"type": "string",
|
|
2775
|
+
"description": "restart/shutdown only — managed agent id to target; omit to target all."
|
|
2660
2776
|
},
|
|
2661
2777
|
"policyName": {
|
|
2662
|
-
"type": "string"
|
|
2778
|
+
"type": "string",
|
|
2779
|
+
"description": "restart/shutdown only — managed policy correlation."
|
|
2663
2780
|
},
|
|
2664
2781
|
"spawnRequestId": {
|
|
2665
|
-
"type": "string"
|
|
2782
|
+
"type": "string",
|
|
2783
|
+
"description": "restart/shutdown only — spawn request correlation."
|
|
2666
2784
|
},
|
|
2667
2785
|
"sessionName": {
|
|
2668
|
-
"type": "string"
|
|
2786
|
+
"type": "string",
|
|
2787
|
+
"description": "restart/shutdown only."
|
|
2669
2788
|
},
|
|
2670
2789
|
"tmuxSession": {
|
|
2671
|
-
"type": "string"
|
|
2790
|
+
"type": "string",
|
|
2791
|
+
"description": "restart/shutdown only."
|
|
2672
2792
|
},
|
|
2673
2793
|
"reason": {
|
|
2674
|
-
"type": "string"
|
|
2794
|
+
"type": "string",
|
|
2795
|
+
"description": "restart/shutdown only — human-readable reason (default \"manual\")."
|
|
2675
2796
|
}
|
|
2676
2797
|
}
|
|
2677
2798
|
}
|
|
@@ -2679,37 +2800,17 @@
|
|
|
2679
2800
|
}
|
|
2680
2801
|
},
|
|
2681
2802
|
"responses": {
|
|
2682
|
-
"200": {
|
|
2683
|
-
"description": "Success",
|
|
2684
|
-
"content": {
|
|
2685
|
-
"application/json": {}
|
|
2686
|
-
}
|
|
2687
|
-
},
|
|
2688
2803
|
"202": {
|
|
2689
|
-
"description": "
|
|
2690
|
-
"content": {
|
|
2691
|
-
"application/json": {}
|
|
2692
|
-
}
|
|
2804
|
+
"description": "Accepted. The command was created and emitted on the bus. For `upgrade`, the response includes the created command and the resolved `targetVersion`, and the orchestrator's `upgrade` state is stamped `pending` (settled later via version reconciliation)."
|
|
2693
2805
|
},
|
|
2694
2806
|
"400": {
|
|
2695
|
-
"description": "
|
|
2696
|
-
"content": {
|
|
2697
|
-
"application/json": {
|
|
2698
|
-
"schema": {
|
|
2699
|
-
"$ref": "#/components/schemas/Error"
|
|
2700
|
-
}
|
|
2701
|
-
}
|
|
2702
|
-
}
|
|
2807
|
+
"description": "Invalid body — missing/unknown `action`, or `targetVersion` is not valid semver."
|
|
2703
2808
|
},
|
|
2704
2809
|
"404": {
|
|
2705
|
-
"description": "
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
"$ref": "#/components/schemas/Error"
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2810
|
+
"description": "Orchestrator not found."
|
|
2811
|
+
},
|
|
2812
|
+
"409": {
|
|
2813
|
+
"description": "Refusing downgrade — `targetVersion` is older than the orchestrator's current version; pass `force: true` to override."
|
|
2713
2814
|
}
|
|
2714
2815
|
},
|
|
2715
2816
|
"security": [
|
|
@@ -3492,6 +3593,95 @@
|
|
|
3492
3593
|
]
|
|
3493
3594
|
}
|
|
3494
3595
|
},
|
|
3596
|
+
"/api/workspaces/orphans": {
|
|
3597
|
+
"get": {
|
|
3598
|
+
"operationId": "getWorkspaceOrphans",
|
|
3599
|
+
"summary": "List orphaned worktrees",
|
|
3600
|
+
"tags": [
|
|
3601
|
+
"Other"
|
|
3602
|
+
],
|
|
3603
|
+
"description": "Worktrees found on disk (agent/* branches) with no live workspace row — left behind by crashes or failed cleanups. Probes each known repo's owning online orchestrator and subtracts active DB rows. Returns `{ orphans: [...] }` (empty with a `reason` when no orchestrator is online). Reclaim via POST /api/workspaces/orphans/reclaim.",
|
|
3604
|
+
"responses": {
|
|
3605
|
+
"200": {
|
|
3606
|
+
"description": "Success",
|
|
3607
|
+
"content": {
|
|
3608
|
+
"application/json": {}
|
|
3609
|
+
}
|
|
3610
|
+
}
|
|
3611
|
+
},
|
|
3612
|
+
"security": [
|
|
3613
|
+
{
|
|
3614
|
+
"bearerAuth": []
|
|
3615
|
+
},
|
|
3616
|
+
{
|
|
3617
|
+
"tokenHeader": []
|
|
3618
|
+
},
|
|
3619
|
+
{
|
|
3620
|
+
"tokenQuery": []
|
|
3621
|
+
}
|
|
3622
|
+
]
|
|
3623
|
+
}
|
|
3624
|
+
},
|
|
3625
|
+
"/api/workspaces/orphans/reclaim": {
|
|
3626
|
+
"post": {
|
|
3627
|
+
"operationId": "postWorkspaceOrphanReclaim",
|
|
3628
|
+
"summary": "Reclaim an orphaned worktree",
|
|
3629
|
+
"tags": [
|
|
3630
|
+
"Other"
|
|
3631
|
+
],
|
|
3632
|
+
"description": "Removes an orphaned worktree (and its branch) from the host via a `workspace.cleanup` command. Body: `worktreePath`, `repoRoot`, optional `branch`. Refuses (409) if the path still backs a live workspace row, or if no online orchestrator owns the path. Requires `command:write`. Returns 202 with the created command.",
|
|
3633
|
+
"requestBody": {
|
|
3634
|
+
"required": true,
|
|
3635
|
+
"content": {
|
|
3636
|
+
"application/json": {
|
|
3637
|
+
"schema": {
|
|
3638
|
+
"type": "object",
|
|
3639
|
+
"required": [
|
|
3640
|
+
"worktreePath",
|
|
3641
|
+
"repoRoot"
|
|
3642
|
+
],
|
|
3643
|
+
"properties": {
|
|
3644
|
+
"worktreePath": {
|
|
3645
|
+
"type": "string",
|
|
3646
|
+
"description": "Absolute path of the orphaned worktree to remove."
|
|
3647
|
+
},
|
|
3648
|
+
"repoRoot": {
|
|
3649
|
+
"type": "string",
|
|
3650
|
+
"description": "Repo root the worktree belongs to (for orchestrator routing)."
|
|
3651
|
+
},
|
|
3652
|
+
"branch": {
|
|
3653
|
+
"type": "string",
|
|
3654
|
+
"description": "Agent branch to delete after worktree removal."
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
},
|
|
3661
|
+
"responses": {
|
|
3662
|
+
"202": {
|
|
3663
|
+
"description": "Reclaim command created and emitted."
|
|
3664
|
+
},
|
|
3665
|
+
"400": {
|
|
3666
|
+
"description": "Missing worktreePath/repoRoot."
|
|
3667
|
+
},
|
|
3668
|
+
"409": {
|
|
3669
|
+
"description": "Path backs a live workspace, or no online orchestrator owns it."
|
|
3670
|
+
}
|
|
3671
|
+
},
|
|
3672
|
+
"security": [
|
|
3673
|
+
{
|
|
3674
|
+
"bearerAuth": []
|
|
3675
|
+
},
|
|
3676
|
+
{
|
|
3677
|
+
"tokenHeader": []
|
|
3678
|
+
},
|
|
3679
|
+
{
|
|
3680
|
+
"tokenQuery": []
|
|
3681
|
+
}
|
|
3682
|
+
]
|
|
3683
|
+
}
|
|
3684
|
+
},
|
|
3495
3685
|
"/api/workspaces/{id}": {
|
|
3496
3686
|
"get": {
|
|
3497
3687
|
"operationId": "getWorkspaceById",
|
|
@@ -3538,15 +3728,201 @@
|
|
|
3538
3728
|
"tokenQuery": []
|
|
3539
3729
|
}
|
|
3540
3730
|
]
|
|
3731
|
+
},
|
|
3732
|
+
"delete": {
|
|
3733
|
+
"operationId": "deleteWorkspaceById",
|
|
3734
|
+
"summary": "Purge a workspace record (last resort)",
|
|
3735
|
+
"tags": [
|
|
3736
|
+
"Other"
|
|
3737
|
+
],
|
|
3738
|
+
"description": "Removes the workspace's DB row only — it does NOT touch the worktree on disk. Use the `cleanup` action to remove the worktree. This is the escape hatch for rows whose owning orchestrator is gone for good and can no longer run a cleanup command. Requires `command:write` scope.",
|
|
3739
|
+
"parameters": [
|
|
3740
|
+
{
|
|
3741
|
+
"name": "id",
|
|
3742
|
+
"in": "path",
|
|
3743
|
+
"required": true,
|
|
3744
|
+
"schema": {
|
|
3745
|
+
"type": "string"
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
],
|
|
3749
|
+
"responses": {
|
|
3750
|
+
"200": {
|
|
3751
|
+
"description": "Success",
|
|
3752
|
+
"content": {
|
|
3753
|
+
"application/json": {}
|
|
3754
|
+
}
|
|
3755
|
+
},
|
|
3756
|
+
"404": {
|
|
3757
|
+
"description": "Not found",
|
|
3758
|
+
"content": {
|
|
3759
|
+
"application/json": {
|
|
3760
|
+
"schema": {
|
|
3761
|
+
"$ref": "#/components/schemas/Error"
|
|
3762
|
+
}
|
|
3763
|
+
}
|
|
3764
|
+
}
|
|
3765
|
+
}
|
|
3766
|
+
},
|
|
3767
|
+
"security": [
|
|
3768
|
+
{
|
|
3769
|
+
"bearerAuth": []
|
|
3770
|
+
},
|
|
3771
|
+
{
|
|
3772
|
+
"tokenHeader": []
|
|
3773
|
+
},
|
|
3774
|
+
{
|
|
3775
|
+
"tokenQuery": []
|
|
3776
|
+
}
|
|
3777
|
+
]
|
|
3778
|
+
}
|
|
3779
|
+
},
|
|
3780
|
+
"/api/workspaces/{id}/git-state": {
|
|
3781
|
+
"get": {
|
|
3782
|
+
"operationId": "getWorkspaceGitState",
|
|
3783
|
+
"summary": "Get live git state of a workspace worktree",
|
|
3784
|
+
"tags": [
|
|
3785
|
+
"Other"
|
|
3786
|
+
],
|
|
3787
|
+
"description": "Returns ahead/behind base commit counts, dirty file count, and last commit for the workspace's isolated worktree, computed on the host by the owning orchestrator. Degrades to `{ available: false, reason }` when no online orchestrator owns the path or the workspace has no worktree.",
|
|
3788
|
+
"parameters": [
|
|
3789
|
+
{
|
|
3790
|
+
"name": "id",
|
|
3791
|
+
"in": "path",
|
|
3792
|
+
"required": true,
|
|
3793
|
+
"schema": {
|
|
3794
|
+
"type": "string"
|
|
3795
|
+
}
|
|
3796
|
+
},
|
|
3797
|
+
{
|
|
3798
|
+
"name": "strategy",
|
|
3799
|
+
"in": "query",
|
|
3800
|
+
"schema": {
|
|
3801
|
+
"type": "string"
|
|
3802
|
+
}
|
|
3803
|
+
}
|
|
3804
|
+
],
|
|
3805
|
+
"responses": {
|
|
3806
|
+
"200": {
|
|
3807
|
+
"description": "Success",
|
|
3808
|
+
"content": {
|
|
3809
|
+
"application/json": {}
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
},
|
|
3813
|
+
"security": [
|
|
3814
|
+
{
|
|
3815
|
+
"bearerAuth": []
|
|
3816
|
+
},
|
|
3817
|
+
{
|
|
3818
|
+
"tokenHeader": []
|
|
3819
|
+
},
|
|
3820
|
+
{
|
|
3821
|
+
"tokenQuery": []
|
|
3822
|
+
}
|
|
3823
|
+
]
|
|
3824
|
+
}
|
|
3825
|
+
},
|
|
3826
|
+
"/api/workspaces/{id}/merge-preview": {
|
|
3827
|
+
"get": {
|
|
3828
|
+
"operationId": "getWorkspaceMergePreview",
|
|
3829
|
+
"summary": "Pre-flight check for merging a workspace's work",
|
|
3830
|
+
"tags": [
|
|
3831
|
+
"Other"
|
|
3832
|
+
],
|
|
3833
|
+
"description": "Returns whether the workspace's branch can be cleanly integrated into its base: ahead/behind counts, predicted conflict (three-way merge-tree), clean-fast-forward eligibility, whether a remote and `gh` are available, and the strategy `auto` would resolve to (`pr` when a remote + gh + base branch exist, else `rebase-ff`). Computed on the host by the owning orchestrator. Optional `?strategy=` (`pr`|`rebase-ff`|`auto`) overrides the resolved strategy. Degrades to `{ available: false, reason }` when no online orchestrator owns the path or the workspace has no worktree.",
|
|
3834
|
+
"parameters": [
|
|
3835
|
+
{
|
|
3836
|
+
"name": "id",
|
|
3837
|
+
"in": "path",
|
|
3838
|
+
"required": true,
|
|
3839
|
+
"schema": {
|
|
3840
|
+
"type": "string"
|
|
3841
|
+
}
|
|
3842
|
+
},
|
|
3843
|
+
{
|
|
3844
|
+
"name": "strategy",
|
|
3845
|
+
"in": "query",
|
|
3846
|
+
"schema": {
|
|
3847
|
+
"type": "string"
|
|
3848
|
+
}
|
|
3849
|
+
}
|
|
3850
|
+
],
|
|
3851
|
+
"responses": {
|
|
3852
|
+
"200": {
|
|
3853
|
+
"description": "Success",
|
|
3854
|
+
"content": {
|
|
3855
|
+
"application/json": {}
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3858
|
+
},
|
|
3859
|
+
"security": [
|
|
3860
|
+
{
|
|
3861
|
+
"bearerAuth": []
|
|
3862
|
+
},
|
|
3863
|
+
{
|
|
3864
|
+
"tokenHeader": []
|
|
3865
|
+
},
|
|
3866
|
+
{
|
|
3867
|
+
"tokenQuery": []
|
|
3868
|
+
}
|
|
3869
|
+
]
|
|
3870
|
+
}
|
|
3871
|
+
},
|
|
3872
|
+
"/api/workspaces/{id}/diff": {
|
|
3873
|
+
"get": {
|
|
3874
|
+
"operationId": "getWorkspaceDiff",
|
|
3875
|
+
"summary": "Diff a workspace against its base",
|
|
3876
|
+
"tags": [
|
|
3877
|
+
"Other"
|
|
3878
|
+
],
|
|
3879
|
+
"description": "Per-file line counts and a size-capped unified patch for the workspace's committed work (base...HEAD), computed on the host by the owning orchestrator. `?patch=0` omits the patch body (file list only). Degrades to `{ available: false, reason }` when the host is offline or there's no worktree.",
|
|
3880
|
+
"parameters": [
|
|
3881
|
+
{
|
|
3882
|
+
"name": "id",
|
|
3883
|
+
"in": "path",
|
|
3884
|
+
"required": true,
|
|
3885
|
+
"schema": {
|
|
3886
|
+
"type": "string"
|
|
3887
|
+
}
|
|
3888
|
+
},
|
|
3889
|
+
{
|
|
3890
|
+
"name": "patch",
|
|
3891
|
+
"in": "query",
|
|
3892
|
+
"schema": {
|
|
3893
|
+
"type": "string"
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
],
|
|
3897
|
+
"responses": {
|
|
3898
|
+
"200": {
|
|
3899
|
+
"description": "Success",
|
|
3900
|
+
"content": {
|
|
3901
|
+
"application/json": {}
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3904
|
+
},
|
|
3905
|
+
"security": [
|
|
3906
|
+
{
|
|
3907
|
+
"bearerAuth": []
|
|
3908
|
+
},
|
|
3909
|
+
{
|
|
3910
|
+
"tokenHeader": []
|
|
3911
|
+
},
|
|
3912
|
+
{
|
|
3913
|
+
"tokenQuery": []
|
|
3914
|
+
}
|
|
3915
|
+
]
|
|
3541
3916
|
}
|
|
3542
3917
|
},
|
|
3543
3918
|
"/api/workspaces/{id}/actions": {
|
|
3544
3919
|
"post": {
|
|
3545
3920
|
"operationId": "postWorkspaceAction",
|
|
3546
|
-
"summary": "
|
|
3921
|
+
"summary": "Run a workspace action",
|
|
3547
3922
|
"tags": [
|
|
3548
3923
|
"Other"
|
|
3549
3924
|
],
|
|
3925
|
+
"description": "Transitions a workspace's lifecycle state and, for command actions, dispatches to the owning orchestrator over the command bus. Actions: `status` (read), `ready`, `request-review`, `conflict-found`, `merge-plan` (soft labels), `merge` (real integration — `workspace.merge` command: rebase + fast-forward into base or open a PR via `gh`, then delete the branch on success; accepts `strategy` (`pr`|`rebase-ff`|`auto`, default `auto`), `prTitle`, `prBody`, `deleteBranch`), `cleanup` (remove the worktree), and `abandon`. `merge`/`cleanup` require an online orchestrator owning the path and return 202 with the created command; the final status is reconciled from the command result.",
|
|
3550
3926
|
"parameters": [
|
|
3551
3927
|
{
|
|
3552
3928
|
"name": "id",
|
|
@@ -3563,18 +3939,52 @@
|
|
|
3563
3939
|
"application/json": {
|
|
3564
3940
|
"schema": {
|
|
3565
3941
|
"type": "object",
|
|
3942
|
+
"required": [
|
|
3943
|
+
"action"
|
|
3944
|
+
],
|
|
3566
3945
|
"properties": {
|
|
3567
3946
|
"action": {
|
|
3568
|
-
"type": "string"
|
|
3947
|
+
"type": "string",
|
|
3948
|
+
"enum": [
|
|
3949
|
+
"status",
|
|
3950
|
+
"ready",
|
|
3951
|
+
"request-review",
|
|
3952
|
+
"conflict-found",
|
|
3953
|
+
"merge-plan",
|
|
3954
|
+
"merge",
|
|
3955
|
+
"cleanup",
|
|
3956
|
+
"abandon"
|
|
3957
|
+
],
|
|
3958
|
+
"description": "Lifecycle action to apply."
|
|
3959
|
+
},
|
|
3960
|
+
"strategy": {
|
|
3961
|
+
"type": "string",
|
|
3962
|
+
"enum": [
|
|
3963
|
+
"pr",
|
|
3964
|
+
"rebase-ff",
|
|
3965
|
+
"auto"
|
|
3966
|
+
],
|
|
3967
|
+
"description": "merge only — integration strategy. `auto` picks PR when a remote + gh + base branch exist, else rebase-ff. Defaults to `auto`."
|
|
3968
|
+
},
|
|
3969
|
+
"prTitle": {
|
|
3970
|
+
"type": "string",
|
|
3971
|
+
"description": "merge (pr strategy) only — PR title. Defaults to the last commit subject."
|
|
3972
|
+
},
|
|
3973
|
+
"prBody": {
|
|
3974
|
+
"type": "string",
|
|
3975
|
+
"description": "merge (pr strategy) only — PR body."
|
|
3976
|
+
},
|
|
3977
|
+
"deleteBranch": {
|
|
3978
|
+
"type": "boolean",
|
|
3979
|
+
"description": "merge only — delete the agent branch + remove the worktree after a successful rebase-ff. Defaults to true."
|
|
3569
3980
|
},
|
|
3570
3981
|
"agentId": {
|
|
3571
|
-
"type": "string"
|
|
3982
|
+
"type": "string",
|
|
3983
|
+
"description": "Optional agent id recorded as the actor."
|
|
3572
3984
|
},
|
|
3573
3985
|
"detail": {
|
|
3574
|
-
"type": "string"
|
|
3575
|
-
|
|
3576
|
-
"metadata": {
|
|
3577
|
-
"type": "string"
|
|
3986
|
+
"type": "string",
|
|
3987
|
+
"description": "Optional human-readable note."
|
|
3578
3988
|
}
|
|
3579
3989
|
}
|
|
3580
3990
|
}
|
|
@@ -3583,40 +3993,19 @@
|
|
|
3583
3993
|
},
|
|
3584
3994
|
"responses": {
|
|
3585
3995
|
"200": {
|
|
3586
|
-
"description": "
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3996
|
+
"description": "State updated (non-command actions)."
|
|
3997
|
+
},
|
|
3998
|
+
"202": {
|
|
3999
|
+
"description": "Accepted — a `merge`/`cleanup` command was created and emitted on the bus. Final workspace status is reconciled from the command result."
|
|
3590
4000
|
},
|
|
3591
4001
|
"400": {
|
|
3592
|
-
"description": "
|
|
3593
|
-
"content": {
|
|
3594
|
-
"application/json": {
|
|
3595
|
-
"schema": {
|
|
3596
|
-
"$ref": "#/components/schemas/Error"
|
|
3597
|
-
}
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
4002
|
+
"description": "Invalid body or unknown action."
|
|
3600
4003
|
},
|
|
3601
4004
|
"404": {
|
|
3602
|
-
"description": "
|
|
3603
|
-
"content": {
|
|
3604
|
-
"application/json": {
|
|
3605
|
-
"schema": {
|
|
3606
|
-
"$ref": "#/components/schemas/Error"
|
|
3607
|
-
}
|
|
3608
|
-
}
|
|
3609
|
-
}
|
|
4005
|
+
"description": "Workspace not found."
|
|
3610
4006
|
},
|
|
3611
4007
|
"409": {
|
|
3612
|
-
"description": "
|
|
3613
|
-
"content": {
|
|
3614
|
-
"application/json": {
|
|
3615
|
-
"schema": {
|
|
3616
|
-
"$ref": "#/components/schemas/Error"
|
|
3617
|
-
}
|
|
3618
|
-
}
|
|
3619
|
-
}
|
|
4008
|
+
"description": "No online orchestrator owns the workspace path."
|
|
3620
4009
|
}
|
|
3621
4010
|
},
|
|
3622
4011
|
"security": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-relay-server",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.22",
|
|
4
4
|
"description": "Lightweight HTTP message relay for inter-agent communication across machines",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"CONTRIBUTING.md"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"agent-relay-sdk": "0.2.
|
|
35
|
+
"agent-relay-sdk": "0.2.2"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"postinstall": "node scripts/install-bin-shim.cjs",
|