agentplugged 1.0.6 → 1.3.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/README.md +3 -4
- package/dist/agent-commands.js +6796 -510
- package/dist/forge-follow.js +3 -3
- package/dist/{webauthn.js → hash.js} +3624 -549
- package/dist/helpers.js +723 -294
- package/dist/launcher.js +2 -2
- package/dist/main.js +358 -47
- package/dist/method/agents/noah/SKILL.md +19 -17
- package/dist/method/agents/noah/references/conduct.md +4 -1
- package/dist/method/agents/noah/references/decisions.md +1 -0
- package/dist/method/models.yaml +0 -11
- package/dist/method/skills/workshop/references/create.md +1 -1
- package/dist/product-root.js +15601 -15076
- package/dist/rolldown-runtime.js +1 -1
- package/dist/webauthn-verify.js +112 -1
- package/dist/webauthn-verify2.js +1 -107
- package/package.json +11 -11
package/dist/rolldown-runtime.js
CHANGED
|
@@ -12,7 +12,7 @@ var __esmMin = (fn, res, err) => () => {
|
|
|
12
12
|
throw err = [e], e;
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
15
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
16
16
|
var __exportAll = (all, no_symbols) => {
|
|
17
17
|
let target = {};
|
|
18
18
|
for (var name in all) __defProp(target, name, {
|
package/dist/webauthn-verify.js
CHANGED
|
@@ -1 +1,112 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as fromBase64url, l as utf8, r as sha256, s as toBase64url, ts as SIGNATURE_REASON } from "./hash.js";
|
|
2
|
+
//#region ../../packages/crypto/dist/webauthn.js
|
|
3
|
+
/** Relying party of every `presence` credential. */
|
|
4
|
+
const WEBAUTHN_RP_ID = "agentplugged.local";
|
|
5
|
+
const WEBAUTHN_ORIGIN = `https://${WEBAUTHN_RP_ID}`;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ../../packages/crypto/dist/webauthn-verify.js
|
|
8
|
+
/** COSE algorithm of each WebAuthn `alg`. */
|
|
9
|
+
const COSE_ALG = {
|
|
10
|
+
"webauthn-es256": -7,
|
|
11
|
+
"webauthn-rs256": -257
|
|
12
|
+
};
|
|
13
|
+
/** Authenticator data flags (WebAuthn §6.1). */
|
|
14
|
+
const FLAG_UV = 4;
|
|
15
|
+
/** rpIdHash (32) + flags (1) + signCount (4). */
|
|
16
|
+
const AUTHENTICATOR_DATA_MIN = 37;
|
|
17
|
+
function equal(a, b) {
|
|
18
|
+
return a.length === b.length && a.every((byte, index) => byte === b[index]);
|
|
19
|
+
}
|
|
20
|
+
const fail = (reason) => ({
|
|
21
|
+
ok: false,
|
|
22
|
+
reason
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Checks a WebAuthn assertion over `challenge`: credential algorithm, client data (type,
|
|
26
|
+
* origin, challenge), relying party, UV flag, signature counter, then the signature with
|
|
27
|
+
* `@simplewebauthn/server`. Returns the new counter, to store with the credential.
|
|
28
|
+
*/
|
|
29
|
+
async function verifyWebAuthn(alg, sig, challenge, credential) {
|
|
30
|
+
const { decodeCredentialPublicKey, cose } = await import("./helpers2.js");
|
|
31
|
+
try {
|
|
32
|
+
if (decodeCredentialPublicKey(new Uint8Array(credential.publicKey)).get(cose.COSEKEYS.alg) !== COSE_ALG[alg]) return fail(SIGNATURE_REASON.algMismatch);
|
|
33
|
+
} catch {
|
|
34
|
+
return fail(SIGNATURE_REASON.algMismatch);
|
|
35
|
+
}
|
|
36
|
+
const clientDataBytes = fromBase64url(sig.clientDataJSON);
|
|
37
|
+
const authenticatorData = fromBase64url(sig.authenticatorData);
|
|
38
|
+
if (clientDataBytes === void 0 || authenticatorData === void 0) return fail(SIGNATURE_REASON.clientDataMismatch);
|
|
39
|
+
let clientData;
|
|
40
|
+
try {
|
|
41
|
+
clientData = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(clientDataBytes));
|
|
42
|
+
} catch {
|
|
43
|
+
return fail(SIGNATURE_REASON.clientDataMismatch);
|
|
44
|
+
}
|
|
45
|
+
if (typeof clientData !== "object" || clientData === null || clientData.type !== "webauthn.get" || clientData.origin !== "https://agentplugged.local") return fail(SIGNATURE_REASON.clientDataMismatch);
|
|
46
|
+
const expectedChallenge = toBase64url(challenge);
|
|
47
|
+
if (clientData.challenge !== expectedChallenge) return fail(SIGNATURE_REASON.challengeMismatch);
|
|
48
|
+
if (authenticatorData.length < AUTHENTICATOR_DATA_MIN || !equal(authenticatorData.subarray(0, 32), sha256(utf8("agentplugged.local")))) return fail(SIGNATURE_REASON.clientDataMismatch);
|
|
49
|
+
if (((authenticatorData[32] ?? 0) & FLAG_UV) === 0) return fail(SIGNATURE_REASON.uvMissing);
|
|
50
|
+
const counter = new DataView(authenticatorData.buffer, authenticatorData.byteOffset, authenticatorData.byteLength).getUint32(33);
|
|
51
|
+
const stored = credential.counter ?? 0;
|
|
52
|
+
if ((stored > 0 || counter > 0) && counter <= stored) return fail(SIGNATURE_REASON.counterRegression);
|
|
53
|
+
const { verifyAuthenticationResponse } = await import("./esm.js");
|
|
54
|
+
try {
|
|
55
|
+
const result = await verifyAuthenticationResponse({
|
|
56
|
+
response: {
|
|
57
|
+
id: credential.id,
|
|
58
|
+
rawId: credential.id,
|
|
59
|
+
type: "public-key",
|
|
60
|
+
response: {
|
|
61
|
+
authenticatorData: sig.authenticatorData,
|
|
62
|
+
clientDataJSON: sig.clientDataJSON,
|
|
63
|
+
signature: sig.signature
|
|
64
|
+
},
|
|
65
|
+
clientExtensionResults: {}
|
|
66
|
+
},
|
|
67
|
+
expectedChallenge,
|
|
68
|
+
expectedOrigin: WEBAUTHN_ORIGIN,
|
|
69
|
+
expectedRPID: WEBAUTHN_RP_ID,
|
|
70
|
+
credential: {
|
|
71
|
+
id: credential.id,
|
|
72
|
+
publicKey: new Uint8Array(credential.publicKey),
|
|
73
|
+
counter: stored
|
|
74
|
+
},
|
|
75
|
+
requireUserVerification: true
|
|
76
|
+
});
|
|
77
|
+
return result.verified && result.authenticationInfo.userVerified ? {
|
|
78
|
+
ok: true,
|
|
79
|
+
newCounter: result.authenticationInfo.newCounter
|
|
80
|
+
} : fail(SIGNATURE_REASON.signatureMismatch);
|
|
81
|
+
} catch {
|
|
82
|
+
return fail(SIGNATURE_REASON.signatureMismatch);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The credential a platform authenticator created, read from its attestation object (CBOR): the
|
|
87
|
+
* attested credential data of its authenticator data. The attestation statement is not checked
|
|
88
|
+
* (attestation `none`): the credential proves itself when it signs `human.presence_linked`.
|
|
89
|
+
* Undefined when the object is unreadable, made for another relying party, without user
|
|
90
|
+
* verification, or of an algorithm other than ES256 and RS256.
|
|
91
|
+
*/
|
|
92
|
+
async function parsePresenceAttestation(attestationObject) {
|
|
93
|
+
const { decodeAttestationObject, parseAuthenticatorData, decodeCredentialPublicKey, cose } = await import("./helpers2.js");
|
|
94
|
+
try {
|
|
95
|
+
const parsed = parseAuthenticatorData(decodeAttestationObject(new Uint8Array(attestationObject)).get("authData"));
|
|
96
|
+
if (!equal(parsed.rpIdHash, sha256(utf8("agentplugged.local"))) || !parsed.flags.uv) return void 0;
|
|
97
|
+
const { credentialID, credentialPublicKey } = parsed;
|
|
98
|
+
if (credentialID === void 0 || credentialPublicKey === void 0) return void 0;
|
|
99
|
+
const algId = decodeCredentialPublicKey(credentialPublicKey).get(cose.COSEKEYS.alg);
|
|
100
|
+
const alg = Object.keys(COSE_ALG).find((name) => COSE_ALG[name] === algId);
|
|
101
|
+
if (alg === void 0) return void 0;
|
|
102
|
+
return {
|
|
103
|
+
credential_id: toBase64url(credentialID),
|
|
104
|
+
cose_public_key: toBase64url(credentialPublicKey),
|
|
105
|
+
alg
|
|
106
|
+
};
|
|
107
|
+
} catch {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
112
|
+
export { verifyWebAuthn as n, parsePresenceAttestation as t };
|
package/dist/webauthn-verify2.js
CHANGED
|
@@ -1,107 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../../packages/crypto/dist/webauthn-verify.js
|
|
3
|
-
/** COSE algorithm of each WebAuthn `alg`. */
|
|
4
|
-
const COSE_ALG = {
|
|
5
|
-
"webauthn-es256": -7,
|
|
6
|
-
"webauthn-rs256": -257
|
|
7
|
-
};
|
|
8
|
-
/** Authenticator data flags (WebAuthn §6.1). */
|
|
9
|
-
const FLAG_UV = 4;
|
|
10
|
-
/** rpIdHash (32) + flags (1) + signCount (4). */
|
|
11
|
-
const AUTHENTICATOR_DATA_MIN = 37;
|
|
12
|
-
function equal(a, b) {
|
|
13
|
-
return a.length === b.length && a.every((byte, index) => byte === b[index]);
|
|
14
|
-
}
|
|
15
|
-
const fail = (reason) => ({
|
|
16
|
-
ok: false,
|
|
17
|
-
reason
|
|
18
|
-
});
|
|
19
|
-
/**
|
|
20
|
-
* Checks a WebAuthn assertion over `challenge`: credential algorithm, client data (type,
|
|
21
|
-
* origin, challenge), relying party, UV flag, signature counter, then the signature with
|
|
22
|
-
* `@simplewebauthn/server`. Returns the new counter, to store with the credential.
|
|
23
|
-
*/
|
|
24
|
-
async function verifyWebAuthn(alg, sig, challenge, credential) {
|
|
25
|
-
const { decodeCredentialPublicKey, cose } = await import("./helpers2.js");
|
|
26
|
-
try {
|
|
27
|
-
if (decodeCredentialPublicKey(new Uint8Array(credential.publicKey)).get(cose.COSEKEYS.alg) !== COSE_ALG[alg]) return fail(SIGNATURE_REASON.algMismatch);
|
|
28
|
-
} catch {
|
|
29
|
-
return fail(SIGNATURE_REASON.algMismatch);
|
|
30
|
-
}
|
|
31
|
-
const clientDataBytes = fromBase64url(sig.clientDataJSON);
|
|
32
|
-
const authenticatorData = fromBase64url(sig.authenticatorData);
|
|
33
|
-
if (clientDataBytes === void 0 || authenticatorData === void 0) return fail(SIGNATURE_REASON.clientDataMismatch);
|
|
34
|
-
let clientData;
|
|
35
|
-
try {
|
|
36
|
-
clientData = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(clientDataBytes));
|
|
37
|
-
} catch {
|
|
38
|
-
return fail(SIGNATURE_REASON.clientDataMismatch);
|
|
39
|
-
}
|
|
40
|
-
if (typeof clientData !== "object" || clientData === null || clientData.type !== "webauthn.get" || clientData.origin !== WEBAUTHN_ORIGIN) return fail(SIGNATURE_REASON.clientDataMismatch);
|
|
41
|
-
const expectedChallenge = toBase64url(challenge);
|
|
42
|
-
if (clientData.challenge !== expectedChallenge) return fail(SIGNATURE_REASON.challengeMismatch);
|
|
43
|
-
if (authenticatorData.length < AUTHENTICATOR_DATA_MIN || !equal(authenticatorData.subarray(0, 32), sha256(utf8("agentplugged.local")))) return fail(SIGNATURE_REASON.clientDataMismatch);
|
|
44
|
-
if (((authenticatorData[32] ?? 0) & FLAG_UV) === 0) return fail(SIGNATURE_REASON.uvMissing);
|
|
45
|
-
const counter = new DataView(authenticatorData.buffer, authenticatorData.byteOffset, authenticatorData.byteLength).getUint32(33);
|
|
46
|
-
const stored = credential.counter ?? 0;
|
|
47
|
-
if ((stored > 0 || counter > 0) && counter <= stored) return fail(SIGNATURE_REASON.counterRegression);
|
|
48
|
-
const { verifyAuthenticationResponse } = await import("./esm.js");
|
|
49
|
-
try {
|
|
50
|
-
const result = await verifyAuthenticationResponse({
|
|
51
|
-
response: {
|
|
52
|
-
id: credential.id,
|
|
53
|
-
rawId: credential.id,
|
|
54
|
-
type: "public-key",
|
|
55
|
-
response: {
|
|
56
|
-
authenticatorData: sig.authenticatorData,
|
|
57
|
-
clientDataJSON: sig.clientDataJSON,
|
|
58
|
-
signature: sig.signature
|
|
59
|
-
},
|
|
60
|
-
clientExtensionResults: {}
|
|
61
|
-
},
|
|
62
|
-
expectedChallenge,
|
|
63
|
-
expectedOrigin: WEBAUTHN_ORIGIN,
|
|
64
|
-
expectedRPID: WEBAUTHN_RP_ID,
|
|
65
|
-
credential: {
|
|
66
|
-
id: credential.id,
|
|
67
|
-
publicKey: new Uint8Array(credential.publicKey),
|
|
68
|
-
counter: stored
|
|
69
|
-
},
|
|
70
|
-
requireUserVerification: true
|
|
71
|
-
});
|
|
72
|
-
return result.verified && result.authenticationInfo.userVerified ? {
|
|
73
|
-
ok: true,
|
|
74
|
-
newCounter: result.authenticationInfo.newCounter
|
|
75
|
-
} : fail(SIGNATURE_REASON.signatureMismatch);
|
|
76
|
-
} catch {
|
|
77
|
-
return fail(SIGNATURE_REASON.signatureMismatch);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* The credential a platform authenticator created, read from its attestation object (CBOR): the
|
|
82
|
-
* attested credential data of its authenticator data. The attestation statement is not checked
|
|
83
|
-
* (attestation `none`): the credential proves itself when it signs `human.presence_linked`.
|
|
84
|
-
* Undefined when the object is unreadable, made for another relying party, without user
|
|
85
|
-
* verification, or of an algorithm other than ES256 and RS256.
|
|
86
|
-
*/
|
|
87
|
-
async function parsePresenceAttestation(attestationObject) {
|
|
88
|
-
const { decodeAttestationObject, parseAuthenticatorData, decodeCredentialPublicKey, cose } = await import("./helpers2.js");
|
|
89
|
-
try {
|
|
90
|
-
const parsed = parseAuthenticatorData(decodeAttestationObject(new Uint8Array(attestationObject)).get("authData"));
|
|
91
|
-
if (!equal(parsed.rpIdHash, sha256(utf8("agentplugged.local"))) || !parsed.flags.uv) return void 0;
|
|
92
|
-
const { credentialID, credentialPublicKey } = parsed;
|
|
93
|
-
if (credentialID === void 0 || credentialPublicKey === void 0) return void 0;
|
|
94
|
-
const algId = decodeCredentialPublicKey(credentialPublicKey).get(cose.COSEKEYS.alg);
|
|
95
|
-
const alg = Object.keys(COSE_ALG).find((name) => COSE_ALG[name] === algId);
|
|
96
|
-
if (alg === void 0) return void 0;
|
|
97
|
-
return {
|
|
98
|
-
credential_id: toBase64url(credentialID),
|
|
99
|
-
cose_public_key: toBase64url(credentialPublicKey),
|
|
100
|
-
alg
|
|
101
|
-
};
|
|
102
|
-
} catch {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
//#endregion
|
|
107
|
-
export { verifyWebAuthn as n, parsePresenceAttestation as t };
|
|
1
|
+
export { n as verifyWebAuthn } from "./webauthn-verify.js";
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentplugged",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Install the AgentPlugged method in a repository and make its agents callable from Claude Code, Codex, Antigravity
|
|
5
|
-
"releaseSummary": "
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Install the AgentPlugged method in a repository and make its agents callable from Claude Code, Codex, Antigravity CLI and Cursor.",
|
|
5
|
+
"releaseSummary": "One circuit: pause the whole team, stop a story at its budget before the next tool call, and let Noah keep a note of each exchange.",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|
|
7
7
|
"author": "Innovel Studio SASU",
|
|
8
8
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"ai",
|
|
21
21
|
"claude-code",
|
|
22
22
|
"codex",
|
|
23
|
-
"
|
|
23
|
+
"antigravity-cli",
|
|
24
24
|
"cursor",
|
|
25
25
|
"cli"
|
|
26
26
|
],
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"koffi": "~3.3.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@agentplugged/adapters-git": "1.0
|
|
51
|
-
"@agentplugged/adapters-tools": "1.0
|
|
52
|
-
"@agentplugged/core": "1.0
|
|
53
|
-
"@agentplugged/crypto": "1.0
|
|
54
|
-
"@agentplugged/i18n": "1.0
|
|
55
|
-
"@agentplugged/mcp": "1.0
|
|
50
|
+
"@agentplugged/adapters-git": "1.3.0",
|
|
51
|
+
"@agentplugged/adapters-tools": "1.3.0",
|
|
52
|
+
"@agentplugged/core": "1.3.0",
|
|
53
|
+
"@agentplugged/crypto": "1.3.0",
|
|
54
|
+
"@agentplugged/i18n": "1.3.0",
|
|
55
|
+
"@agentplugged/mcp": "1.3.0",
|
|
56
56
|
"@agentplugged/method": "0.0.0",
|
|
57
|
-
"@agentplugged/protocol": "1.0
|
|
57
|
+
"@agentplugged/protocol": "1.3.0",
|
|
58
58
|
"@biomejs/biome": "~2.5.15",
|
|
59
59
|
"@modelcontextprotocol/client": "~2.3.0",
|
|
60
60
|
"@types/node": "^24.19.1",
|