@50arms/platform-mcp 0.1.451 → 0.1.453
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/index.js +2 -1
- package/dist/listen.js +1 -1
- package/dist/machine-toolkit.js +1 -1
- package/dist/session-access.js +20 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -889,11 +889,12 @@ strictTool("session_connect",
|
|
|
889
889
|
disconnect: z.boolean().optional().describe("true = leave `target` (the plan or card you hold); no `title`."),
|
|
890
890
|
role: z
|
|
891
891
|
.string()
|
|
892
|
+
// Keep in step with `ROLE_KEY_PATTERN` (`src/lib/auth-rules.ts`): this published package cannot import the service's source.
|
|
892
893
|
.regex(/^[a-z0-9]+(-[a-z0-9]+)*$/)
|
|
893
894
|
.optional()
|
|
894
895
|
.describe(
|
|
895
896
|
// DX-6939: read only by a call that makes a sign-in claim; a signed-in session's call ignores it.
|
|
896
|
-
"The key of the team role this session's key is minted with when this call signs it in: default `
|
|
897
|
+
"The key of the team role this session's key is minted with when this call signs it in: default `session`, the system agent role every team has that a Member holds within. Name `agent` (what a dispatched worker runs on) only when a person said so: it holds keys a Member lacks, so the sign-in is refused unless that person holds them too. It must be an agent role within what the person this machine is registered to holds, or the sign-in is refused. Omit it unless a person named another role."),
|
|
897
898
|
launch_token: z
|
|
898
899
|
.string()
|
|
899
900
|
.min(1)
|
package/dist/listen.js
CHANGED
|
@@ -289,7 +289,7 @@ function subjectRef(event) {
|
|
|
289
289
|
return typeof event.planId === "number" ? event.planRef : event.cardId;
|
|
290
290
|
}
|
|
291
291
|
function replyInstructionAt(path) {
|
|
292
|
-
return `Answer it through its reply message: first call 50arms_api POST ${path} with {"phase":"ack","body":"<one short sentence of your own acknowledging it>"} so the person sees it was received, then do the work and call POST ${path} again with {"phase":"reply","body":"<your full answer>"}, which
|
|
292
|
+
return `Answer it through its reply message: first call 50arms_api POST ${path} with {"phase":"ack","body":"<one short sentence of your own acknowledging it>"} so the person sees it was received, then do the work and call POST ${path} again with {"phase":"reply","body":"<your full answer>"}, which replaces your acknowledgement in the same message. A comment you already answered (its follow-up arrived after your answer) takes only another {"phase":"reply","body":"<your answer to the follow-up>"}, which is added as the next message; never send "ack" after an answer, and never answer with a separate comment`;
|
|
293
293
|
}
|
|
294
294
|
/** DX-6064: what a session does with a person's answer (or changed answer), so a decision never lives only in its conversation. */
|
|
295
295
|
export const UPDATE_RECORDS_NOW = "Update every plan record and card this answer changes, this turn";
|
package/dist/machine-toolkit.js
CHANGED
|
@@ -250,7 +250,7 @@ function resolveToolkitVersion(stamped, readManifest) {
|
|
|
250
250
|
return stamped ?? readManifest();
|
|
251
251
|
}
|
|
252
252
|
var readOwnManifest = () => JSON.parse(readFileSync2(new URL("../../package.json", import.meta.url), "utf8")).version;
|
|
253
|
-
var TOOLKIT_VERSION = resolveToolkitVersion(false ? void 0 : "0.1.
|
|
253
|
+
var TOOLKIT_VERSION = resolveToolkitVersion(false ? void 0 : "0.1.453", readOwnManifest);
|
|
254
254
|
function envelope(now) {
|
|
255
255
|
return { contract_version: CONTRACT_VERSION, toolkit_version: TOOLKIT_VERSION, profile: PROFILE, measured_at: now.toISOString() };
|
|
256
256
|
}
|
package/dist/session-access.js
CHANGED
|
@@ -63,18 +63,29 @@ const DASHBOARD_OUTDATED_ERROR = "this dashboard does not support request-and-ap
|
|
|
63
63
|
"it must be updated before this session can sign in";
|
|
64
64
|
const RATE_LIMITED_ERROR = "too many access requests from this address; wait, then call session_connect again";
|
|
65
65
|
/**
|
|
66
|
-
* DX-6939 - the role a session's sign-in claim asks for unless `session_connect` names another: the system agent role every team holds
|
|
67
|
-
* (`src/auth/permissions.ts`),
|
|
66
|
+
* DX-6939 / DX-7020 - the role a session's sign-in claim asks for unless `session_connect` names another: the system `session` agent role every team holds
|
|
67
|
+
* and cannot delete (`src/auth/permissions.ts`). It holds nothing a default Member lacks, so a Member's session signs in on it; a dispatched worker runs on
|
|
68
|
+
* the `agent` role, which a session names only when a person said so.
|
|
69
|
+
*/
|
|
70
|
+
export const DEFAULT_SESSION_ROLE = "session";
|
|
71
|
+
/**
|
|
72
|
+
* DX-6939 / DX-7020 - why the dashboard refused a sign-in claim, in words the agent can act on; null for a refusal it does not name. A `role_exceeds_owner`
|
|
73
|
+
* on the default role says the person's own role is too small for any agent session and what to ask for; on a role a person named, it says to choose another.
|
|
68
74
|
*/
|
|
69
|
-
export const DEFAULT_SESSION_ROLE = "agent";
|
|
70
|
-
/** DX-6939 - why the dashboard refused a sign-in claim, in words the agent can act on; null for a refusal it does not name. */
|
|
71
75
|
function claimRefusalError(body, role) {
|
|
72
|
-
const
|
|
73
|
-
switch (error) {
|
|
76
|
+
const refusal = body;
|
|
77
|
+
switch (refusal?.error) {
|
|
74
78
|
case "unknown_role":
|
|
75
|
-
return `the team has no role "${role}"; call session_connect again without \`role\` (the default
|
|
76
|
-
case "role_exceeds_owner":
|
|
77
|
-
|
|
79
|
+
return `the team has no role "${role}"; call session_connect again without \`role\` (the default "${DEFAULT_SESSION_ROLE}" role) or with a role key the team has`;
|
|
80
|
+
case "role_exceeds_owner": {
|
|
81
|
+
const missing = Array.isArray(refusal?.missingPermissions) ? refusal.missingPermissions.filter((k) => typeof k === "string") : [];
|
|
82
|
+
const lacks = missing.length === 0 ? "" : ` (their role lacks ${missing.join(", ")})`;
|
|
83
|
+
if (role === DEFAULT_SESSION_ROLE) {
|
|
84
|
+
return (`the person this machine is registered to cannot sign in an agent session on this team: their role is smaller than the "${DEFAULT_SESSION_ROLE}" role a session signs in on${lacks}. ` +
|
|
85
|
+
"Tell them to ask a team admin to give them the Member role or higher on this team, then call session_connect again. Do not retry before that.");
|
|
86
|
+
}
|
|
87
|
+
return `the role "${role}" holds permissions the person this machine is registered to lacks${lacks}, so the dashboard refused the sign-in; call session_connect again without \`role\` (the default "${DEFAULT_SESSION_ROLE}" role, which a Member holds within), or ask them to have a team admin widen their own role`;
|
|
88
|
+
}
|
|
78
89
|
case "session_role_must_be_agent":
|
|
79
90
|
return `the role "${role}" is a person's role, not an agent role; call session_connect again with an agent role, or without \`role\``;
|
|
80
91
|
case "claim_target_required":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@50arms/platform-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.453",
|
|
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",
|