@cmmd-center/forge 0.9.12 → 0.9.14
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/bin.cjs +331 -140
- package/dist/bin.mjs +328 -138
- package/dist/client/assets/{CanvasPanel-CNtJjkFi.js → CanvasPanel-Dc8j2ouo.js} +2 -2
- package/dist/client/assets/{CompositeItem-BYLWaYF6.js → CompositeItem-Cn5DdObI.js} +2 -2
- package/dist/client/assets/{DiffPanel-BilYcllQ.js → DiffPanel-CRdkVPEz.js} +3 -3
- package/dist/client/assets/{DiffPanel.logic-Caky6F_f.js → DiffPanel.logic-BIPcNz_o.js} +2 -2
- package/dist/client/assets/DiffPanelShell-tIdXu7mn.js +2531 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-CTUAka0e.js → DiffWorkerPoolProvider-tFSGuVfC.js} +51 -51
- package/dist/client/assets/PullRequestCodePanel-inwJYfZC.js +5 -0
- package/dist/client/assets/{Virtualizer-CFg_81uW.js → Virtualizer-DeKxnAeU.js} +2 -2
- package/dist/client/assets/{canvasStateStore-BdDORpO9.js → canvasStateStore-Dlm4tanv.js} +2 -2
- package/dist/client/assets/{cmmdAuthRedirect-CrxxHqHr.js → cmmdAuthRedirect-C1FjO86g.js} +2 -2
- package/dist/client/assets/index-4a61qSZ4.css +1 -0
- package/dist/client/assets/{index-BUY6pZDx.js → index-Bublmabf.js} +59 -59
- package/dist/client/assets/src-DljvAdHI.js +3 -0
- package/dist/client/assets/{toggle-BUlphA25.js → toggle-It2CvaLA.js} +2 -2
- package/dist/client/assets/{useTriggerFocusGuards-D2jbdUMe.js → useTriggerFocusGuards-DfUh9uvu.js} +2 -2
- package/dist/client/index.html +11 -11
- package/dist/runtimeBootstrap.cjs +1 -1
- package/dist/runtimeBootstrap.mjs +1 -1
- package/dist/{runtimeControlAuthority-45DPznyK.cjs → runtimeControlAuthority-BdIovv-r.cjs} +28 -1
- package/dist/{runtimeControlAuthority-akIBTI-S.mjs → runtimeControlAuthority-COHmz_WT.mjs} +23 -2
- package/package.json +3 -2
- package/dist/client/assets/DiffPanelShell-DXP_jwHj.js +0 -2531
- package/dist/client/assets/PullRequestCodePanel-4bf4PYHp.js +0 -5
- package/dist/client/assets/index-BydoCpMZ.css +0 -1
- package/dist/client/assets/src-Dqe_-4FQ.js +0 -3
|
@@ -75,6 +75,8 @@ function setRuntimeGrantToken(token) {
|
|
|
75
75
|
//#region src/runtimeAuth/cmmdRuntimeTicket.ts
|
|
76
76
|
const CMMD_CLAUDE_READINESS_TICKET_AUDIENCE = "forge-claude-readiness";
|
|
77
77
|
const CMMD_CLAUDE_READINESS_TICKET_SCOPE = "claude-readiness-probe";
|
|
78
|
+
const CMMD_CLAUDE_USAGE_TICKET_AUDIENCE = "forge-claude-usage";
|
|
79
|
+
const CMMD_CLAUDE_USAGE_TICKET_SCOPE = "claude-usage";
|
|
78
80
|
function decodeBase64UrlJson(value) {
|
|
79
81
|
try {
|
|
80
82
|
return JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
@@ -146,6 +148,25 @@ function verifyCmmdClaudeReadinessTicket(token, expectations) {
|
|
|
146
148
|
jti
|
|
147
149
|
} : null;
|
|
148
150
|
}
|
|
151
|
+
function verifyCmmdClaudeUsageTicket(token, expectations) {
|
|
152
|
+
const payload = verifiedRuntimeTicketPayload(token, expectations.publicKeyPem, CMMD_CLAUDE_USAGE_TICKET_AUDIENCE);
|
|
153
|
+
if (!payload) return null;
|
|
154
|
+
const claims = runtimeTicketClaims(payload, false);
|
|
155
|
+
if (!claims || !runtimeTicketExpectationsMatch(claims, expectations)) return null;
|
|
156
|
+
const jti = stringClaim(payload, "jti");
|
|
157
|
+
const providerAccountId = stringClaim(payload, "provider_account_id");
|
|
158
|
+
const generationId = stringClaim(payload, "credential_generation_id");
|
|
159
|
+
const issuedAtSeconds = nonNegativeIntegerClaim(payload["iat"]);
|
|
160
|
+
const notBeforeSeconds = nonNegativeIntegerClaim(payload["nbf"]);
|
|
161
|
+
const nowSeconds = Math.floor(Date.now() / 1e3);
|
|
162
|
+
if (!jti || !providerAccountId || !generationId || issuedAtSeconds === null || notBeforeSeconds === null || notBeforeSeconds > nowSeconds || issuedAtSeconds > nowSeconds + 5 || claims.expiresAtSeconds - issuedAtSeconds > 90 || claims.scope.length !== 1 || claims.scope[0] !== CMMD_CLAUDE_USAGE_TICKET_SCOPE) return null;
|
|
163
|
+
return {
|
|
164
|
+
...claims,
|
|
165
|
+
jti,
|
|
166
|
+
providerAccountId,
|
|
167
|
+
generationId
|
|
168
|
+
};
|
|
169
|
+
}
|
|
149
170
|
function runtimeTicketExpiration(payload, allowExpired) {
|
|
150
171
|
const expiresAtSeconds = payload["exp"];
|
|
151
172
|
if (typeof expiresAtSeconds !== "number" || !Number.isFinite(expiresAtSeconds)) return null;
|
|
@@ -584,6 +605,12 @@ Object.defineProperty(exports, "verifyCmmdClaudeReadinessTicket", {
|
|
|
584
605
|
return verifyCmmdClaudeReadinessTicket;
|
|
585
606
|
}
|
|
586
607
|
});
|
|
608
|
+
Object.defineProperty(exports, "verifyCmmdClaudeUsageTicket", {
|
|
609
|
+
enumerable: true,
|
|
610
|
+
get: function() {
|
|
611
|
+
return verifyCmmdClaudeUsageTicket;
|
|
612
|
+
}
|
|
613
|
+
});
|
|
587
614
|
Object.defineProperty(exports, "verifyCmmdRuntimeTicket", {
|
|
588
615
|
enumerable: true,
|
|
589
616
|
get: function() {
|
|
@@ -597,4 +624,4 @@ Object.defineProperty(exports, "verifyCmmdRuntimeTicketRefreshProof", {
|
|
|
597
624
|
}
|
|
598
625
|
});
|
|
599
626
|
|
|
600
|
-
//# sourceMappingURL=runtimeControlAuthority-
|
|
627
|
+
//# sourceMappingURL=runtimeControlAuthority-BdIovv-r.cjs.map
|
|
@@ -74,6 +74,8 @@ function setRuntimeGrantToken(token) {
|
|
|
74
74
|
//#region src/runtimeAuth/cmmdRuntimeTicket.ts
|
|
75
75
|
const CMMD_CLAUDE_READINESS_TICKET_AUDIENCE = "forge-claude-readiness";
|
|
76
76
|
const CMMD_CLAUDE_READINESS_TICKET_SCOPE = "claude-readiness-probe";
|
|
77
|
+
const CMMD_CLAUDE_USAGE_TICKET_AUDIENCE = "forge-claude-usage";
|
|
78
|
+
const CMMD_CLAUDE_USAGE_TICKET_SCOPE = "claude-usage";
|
|
77
79
|
function decodeBase64UrlJson(value) {
|
|
78
80
|
try {
|
|
79
81
|
return JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
@@ -145,6 +147,25 @@ function verifyCmmdClaudeReadinessTicket(token, expectations) {
|
|
|
145
147
|
jti
|
|
146
148
|
} : null;
|
|
147
149
|
}
|
|
150
|
+
function verifyCmmdClaudeUsageTicket(token, expectations) {
|
|
151
|
+
const payload = verifiedRuntimeTicketPayload(token, expectations.publicKeyPem, CMMD_CLAUDE_USAGE_TICKET_AUDIENCE);
|
|
152
|
+
if (!payload) return null;
|
|
153
|
+
const claims = runtimeTicketClaims(payload, false);
|
|
154
|
+
if (!claims || !runtimeTicketExpectationsMatch(claims, expectations)) return null;
|
|
155
|
+
const jti = stringClaim(payload, "jti");
|
|
156
|
+
const providerAccountId = stringClaim(payload, "provider_account_id");
|
|
157
|
+
const generationId = stringClaim(payload, "credential_generation_id");
|
|
158
|
+
const issuedAtSeconds = nonNegativeIntegerClaim(payload["iat"]);
|
|
159
|
+
const notBeforeSeconds = nonNegativeIntegerClaim(payload["nbf"]);
|
|
160
|
+
const nowSeconds = Math.floor(Date.now() / 1e3);
|
|
161
|
+
if (!jti || !providerAccountId || !generationId || issuedAtSeconds === null || notBeforeSeconds === null || notBeforeSeconds > nowSeconds || issuedAtSeconds > nowSeconds + 5 || claims.expiresAtSeconds - issuedAtSeconds > 90 || claims.scope.length !== 1 || claims.scope[0] !== CMMD_CLAUDE_USAGE_TICKET_SCOPE) return null;
|
|
162
|
+
return {
|
|
163
|
+
...claims,
|
|
164
|
+
jti,
|
|
165
|
+
providerAccountId,
|
|
166
|
+
generationId
|
|
167
|
+
};
|
|
168
|
+
}
|
|
148
169
|
function runtimeTicketExpiration(payload, allowExpired) {
|
|
149
170
|
const expiresAtSeconds = payload["exp"];
|
|
150
171
|
if (typeof expiresAtSeconds !== "number" || !Number.isFinite(expiresAtSeconds)) return null;
|
|
@@ -529,6 +550,6 @@ async function sendRuntimeControlHeartbeat(input) {
|
|
|
529
550
|
};
|
|
530
551
|
}
|
|
531
552
|
//#endregion
|
|
532
|
-
export { verifyCmmdAuthRuntimeTicket as a,
|
|
553
|
+
export { verifyCmmdAuthRuntimeTicket as a, verifyCmmdRuntimeTicket as c, setRuntimeGrantToken as d, createReadOnceFileTokenAccessor as f, sendRuntimeControlHeartbeat as i, verifyCmmdRuntimeTicketRefreshProof as l, bootstrapRuntimeControlAuthorityFromNarrowGrant as n, verifyCmmdClaudeReadinessTicket as o, readRuntimeControlAuthority as r, verifyCmmdClaudeUsageTicket as s, bootstrapRuntimeControlAuthority as t, runtimeGrantToken as u };
|
|
533
554
|
|
|
534
|
-
//# sourceMappingURL=runtimeControlAuthority-
|
|
555
|
+
//# sourceMappingURL=runtimeControlAuthority-COHmz_WT.mjs.map
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"cmmd-forge": "dist/bin.mjs"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
|
-
"version": "0.9.
|
|
12
|
+
"version": "0.9.14",
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": "^22.16 || ^23.11 || >=24.10"
|
|
15
15
|
},
|
|
@@ -41,9 +41,10 @@
|
|
|
41
41
|
"@opentelemetry/core": "2.10.0",
|
|
42
42
|
"ajv": "8.20.0",
|
|
43
43
|
"brace-expansion": "5.0.9",
|
|
44
|
+
"browserslist": "4.28.7",
|
|
44
45
|
"dompurify": "3.4.13",
|
|
45
46
|
"esbuild": "0.28.1",
|
|
46
|
-
"fast-uri": "4.1.
|
|
47
|
+
"fast-uri": "4.1.3",
|
|
47
48
|
"js-yaml": "4.3.1",
|
|
48
49
|
"nanoid": "3.3.18",
|
|
49
50
|
"picomatch": "4.0.5",
|