@50arms/platform-mcp 0.1.472 → 0.1.474
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/dist/agent-gate.js +1 -1
- package/dist/heartbeat-reporter.js +3 -1
- package/dist/machine-toolkit.js +1 -1
- package/dist/permission-request.js +2 -2
- package/dist/plugin-screenshot.js +1 -1
- package/dist/route-board-scope.generated.js +1 -0
- package/dist/session-access.js +1 -1
- package/dist/session-stats.js +25 -11
- package/package.json +1 -1
package/dist/agent-gate.js
CHANGED
|
@@ -47,7 +47,7 @@ export function agentGateHalt(gate) {
|
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* DX-5724 / DX-5765: the ONE list of the two routes a session with no agent may still reach (propose an agent, then attach its avatar), as the route templates
|
|
50
|
-
* `50arms_api_list` reports and `50arms_api_spec` takes.
|
|
50
|
+
* `50arms_api_list` reports and `50arms_api_spec` takes.
|
|
51
51
|
*/
|
|
52
52
|
export const AGENT_PROPOSAL_ENDPOINTS = [
|
|
53
53
|
"POST /api/team/agent-proposals",
|
|
@@ -77,7 +77,9 @@ export class HeartbeatReporter {
|
|
|
77
77
|
this.dashboardTitle = undefined;
|
|
78
78
|
this.lastTitleError = null;
|
|
79
79
|
// DX-5415: the old transcript's held finals are stored before this returns; the swap above is synchronous so a second call sees the new path.
|
|
80
|
-
return previous
|
|
80
|
+
return previous
|
|
81
|
+
.stop(this.send(undefined), settleBound())
|
|
82
|
+
.then(() => undefined);
|
|
81
83
|
}
|
|
82
84
|
/** A fresh connect cycle earns a clean slate for the silent-failure count. */
|
|
83
85
|
resetFailureStreak() {
|
package/dist/machine-toolkit.js
CHANGED
|
@@ -612,7 +612,7 @@ var readOwnManifest = () => JSON.parse(
|
|
|
612
612
|
readFileSync(new URL("../../package.json", import.meta.url), "utf8")
|
|
613
613
|
).version;
|
|
614
614
|
var TOOLKIT_VERSION = resolveToolkitVersion(
|
|
615
|
-
false ? void 0 : "0.1.
|
|
615
|
+
false ? void 0 : "0.1.474",
|
|
616
616
|
readOwnManifest
|
|
617
617
|
);
|
|
618
618
|
function envelope(now) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defaultSleep } from "./session-access.js";
|
|
2
2
|
import { McpOutdatedError } from "./version-floor.js";
|
|
3
3
|
const PERMISSION_REQUESTS_BASE_PATH = "/api/permission-requests";
|
|
4
|
-
const APPROVAL_REQUIRED_INSTRUCTION = "Show the person the approval URL and the confirm code (they check the code matches, then approve). Keep working on anything " +
|
|
4
|
+
export const APPROVAL_REQUIRED_INSTRUCTION = "Show the person the approval URL and the confirm code (they check the code matches, then approve). Keep working on anything " +
|
|
5
5
|
"else: this call has returned and nothing waits. The request stays open until this session ends, however long they take. If " +
|
|
6
6
|
"they approve, this process picks the grant up in the background and a later call simply succeeds with the same key (no new " +
|
|
7
7
|
"key, no re-auth). If you are blocked without it, raise a problem on the card; a person sees problems in Needs You.";
|
|
8
|
-
const APPROVAL_PENDING_INSTRUCTION = "This permission is already asked for and not yet decided; the request stays open until this session ends. Remind the person " +
|
|
8
|
+
export const APPROVAL_PENDING_INSTRUCTION = "This permission is already asked for and not yet decided; the request stays open until this session ends. Remind the person " +
|
|
9
9
|
"of the confirm code and the approval URL; keep working on anything else. A grant is picked up in the background and a later " +
|
|
10
10
|
"call simply succeeds with the same key. If you are blocked without it, raise a problem on the card.";
|
|
11
11
|
/** The dedupe set: sorted and de-duplicated, so the order the agent listed them in never matters. */
|
|
@@ -5,7 +5,7 @@ export const PLUGIN_PREVIEW_FILES = "/__plugin-preview__/";
|
|
|
5
5
|
export const PLUGIN_PREVIEW_ATTRIBUTE = "data-plugin-preview";
|
|
6
6
|
export const PLUGIN_PREVIEW_MANIFEST_GLOBAL = "__DANX_PLUGIN_PREVIEW_MANIFEST__";
|
|
7
7
|
// Restated from `src/plugins/plugin-manifest.ts` (`CARD_VIEW_EXPORT`, `CARD_LIST_VIEW_EXPORT`): this package cannot import the app's source.
|
|
8
|
-
const CARD_VIEW_EXPORT = "CardView";
|
|
8
|
+
export const CARD_VIEW_EXPORT = "CardView";
|
|
9
9
|
const CARD_LIST_VIEW_EXPORT = "CardListView";
|
|
10
10
|
export function previewModeOf(exports) {
|
|
11
11
|
if (exports.includes(CARD_VIEW_EXPORT))
|
|
@@ -66,6 +66,7 @@ export const GET_ROUTE_BOARD_SCOPE = [
|
|
|
66
66
|
["/api/team/consumer-tokens", "refuse"],
|
|
67
67
|
["/api/team/cost/landed-cards", "refuse"],
|
|
68
68
|
["/api/team/delivery", "refuse"],
|
|
69
|
+
["/api/team/imports", "refuse"],
|
|
69
70
|
["/api/team/invitations", "refuse"],
|
|
70
71
|
["/api/team/members", "refuse"],
|
|
71
72
|
["/api/team/overview/boards", "refuse"],
|
package/dist/session-access.js
CHANGED
|
@@ -130,7 +130,7 @@ function launchRefusalWhy(claim) {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
const EXPIRED_NOTE = "The previous request expired before it was approved: the dashboard stopped hearing from this session. This is a new " +
|
|
133
|
+
export const EXPIRED_NOTE = "The previous request expired before it was approved: the dashboard stopped hearing from this session. This is a new " +
|
|
134
134
|
"request: show the user its new confirm code and URL.";
|
|
135
135
|
export const defaultSleep = (ms) => new Promise((resolve) => {
|
|
136
136
|
setTimeout(resolve, ms).unref();
|
package/dist/session-stats.js
CHANGED
|
@@ -146,39 +146,53 @@ export class OperatorSessionStats {
|
|
|
146
146
|
*/
|
|
147
147
|
async stop(send, bound) {
|
|
148
148
|
if (this.stopped)
|
|
149
|
-
return;
|
|
149
|
+
return { kind: "already-stopped" };
|
|
150
150
|
this.stopped = true;
|
|
151
151
|
const watcher = this.watcher;
|
|
152
152
|
if (watcher === null)
|
|
153
|
-
return;
|
|
153
|
+
return { kind: "not-collecting" };
|
|
154
154
|
const cutOff = new Promise((resolve) => {
|
|
155
155
|
if (bound.aborted)
|
|
156
156
|
resolve("cut");
|
|
157
157
|
else
|
|
158
158
|
bound.addEventListener("abort", () => resolve("cut"), { once: true });
|
|
159
159
|
});
|
|
160
|
+
let outcome;
|
|
160
161
|
try {
|
|
161
162
|
const settled = (async () => {
|
|
162
163
|
await watcher.drainFinal();
|
|
163
164
|
// DX-5415: a failed or refused flush re-queues nothing for a collector that is stopping, so it says what it costs.
|
|
164
165
|
const flushed = (await this.flushVia(send)).outcome;
|
|
165
|
-
if (flushed
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
if (flushed === "ok")
|
|
167
|
+
return { kind: "settled" };
|
|
168
|
+
return {
|
|
169
|
+
kind: "flush-not-landed",
|
|
170
|
+
flush: flushed,
|
|
171
|
+
message: `operator session stats: the final flush was ${flushed}; held sub-agent finals may be lost\n`,
|
|
172
|
+
};
|
|
170
173
|
})();
|
|
171
174
|
settled.catch(() => undefined); // a cut-off settle's late failure is already reported by the race below
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
const raced = await Promise.race([settled, cutOff]);
|
|
176
|
+
outcome =
|
|
177
|
+
raced === "cut"
|
|
178
|
+
? {
|
|
179
|
+
kind: "cut-off",
|
|
180
|
+
message: "operator session stats: the final settle was cut off by its bound; held sub-agent finals may be lost\n",
|
|
181
|
+
}
|
|
182
|
+
: raced;
|
|
175
183
|
}
|
|
176
184
|
catch (err) {
|
|
177
|
-
|
|
185
|
+
outcome = {
|
|
186
|
+
kind: "settle-failed",
|
|
187
|
+
message: `operator session stats: final settle failed: ${err instanceof Error ? err.message : String(err)}\n`,
|
|
188
|
+
};
|
|
178
189
|
}
|
|
179
190
|
finally {
|
|
180
191
|
watcher.stop();
|
|
181
192
|
}
|
|
193
|
+
if ("message" in outcome)
|
|
194
|
+
process.stderr.write(outcome.message);
|
|
195
|
+
return outcome;
|
|
182
196
|
}
|
|
183
197
|
begin(stored) {
|
|
184
198
|
// `this.watcher !== null`: the relay fires `tick` without awaiting it, so
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@50arms/platform-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.474",
|
|
4
4
|
"description": "Stdio MCP server fronting the 50 Arms dashboard API for agents (operator sessions and dispatched workers alike): the generic 50arms_api/50arms_api_list/50arms_api_spec tools reach any route the caller's credential may call, plus dedicated agent-specific tools (session_connect, request_permission, attach_file, and 50arms_slack_reply) (DX-3465, PLN-11 R-25).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|