@aidenhq/sdk 0.5.14 → 0.5.16
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/src/card-words.js
CHANGED
|
@@ -16,6 +16,7 @@ export const REVIEW_WORDS = {
|
|
|
16
16
|
malicious: "The reviewer found it malicious.",
|
|
17
17
|
secret_exfiltration: "It would send a secret or private data out.",
|
|
18
18
|
prompt_injection: "It follows instructions from untrusted text.",
|
|
19
|
+
private_disclosure: "A reply would tell someone other than you what only you may see: you decide whether it goes.",
|
|
19
20
|
reviewer_failed: "The reviewer failed to answer.",
|
|
20
21
|
fail_open: "The review didn't finish twice, so it was approved (fail open).",
|
|
21
22
|
files_not_shown: "The diff didn't match the code host's own count of the change.",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The AI reviewer's code on a card: what it judged (model-chosen, malice only) or what code decided in its place. */
|
|
2
|
-
export declare const REVIEW_CODES: readonly ["clean", "malicious", "secret_exfiltration", "prompt_injection", "reviewer_failed", "fail_open", "files_not_shown", "instance_details", "tool_call_unreadable", "owner_veto", "shadow", "refused_by_code", "stale_head"];
|
|
2
|
+
export declare const REVIEW_CODES: readonly ["clean", "malicious", "secret_exfiltration", "prompt_injection", "private_disclosure", "reviewer_failed", "fail_open", "files_not_shown", "instance_details", "tool_call_unreadable", "owner_veto", "shadow", "refused_by_code", "stale_head"];
|
|
3
3
|
export type ReviewCode = (typeof REVIEW_CODES)[number];
|
|
4
4
|
/** A grant refusal (kernel/src/identity.ts): the tool isn't granted, the agent lacks a role, or it has no grants at all. */
|
|
5
5
|
export declare const GRANT_CODES: readonly ["denied_not_granted", "denied_role", "denied_no_grants", "denied_unknown_caller"];
|
|
@@ -7,7 +7,7 @@ export declare const GRANT_CODES: readonly ["denied_not_granted", "denied_role",
|
|
|
7
7
|
export declare const GATEWAY_CODES: readonly ["cap_reached", "model_not_granted", "advisor_limit"];
|
|
8
8
|
/** A request already satisfied on its target: no card is filed (the duplicate-card guard). */
|
|
9
9
|
export declare const ALREADY_APPLIED_CODE = "already_applied";
|
|
10
|
-
export declare const REASON_CODES: readonly ["clean", "malicious", "secret_exfiltration", "prompt_injection", "reviewer_failed", "fail_open", "files_not_shown", "instance_details", "tool_call_unreadable", "owner_veto", "shadow", "refused_by_code", "stale_head", "denied_not_granted", "denied_role", "denied_no_grants", "denied_unknown_caller", "cap_reached", "model_not_granted", "advisor_limit", "already_applied"];
|
|
10
|
+
export declare const REASON_CODES: readonly ["clean", "malicious", "secret_exfiltration", "prompt_injection", "private_disclosure", "reviewer_failed", "fail_open", "files_not_shown", "instance_details", "tool_call_unreadable", "owner_veto", "shadow", "refused_by_code", "stale_head", "denied_not_granted", "denied_role", "denied_no_grants", "denied_unknown_caller", "cap_reached", "model_not_granted", "advisor_limit", "already_applied"];
|
|
11
11
|
export type ReasonCode = (typeof REASON_CODES)[number];
|
|
12
12
|
/** The shape of a tier rule (tiers.mjs `rule`; also the board's deploy_app, app_run and raise_cap rules). */
|
|
13
13
|
export declare const TIER_RULE: RegExp;
|
package/dist/src/reason-codes.js
CHANGED
|
@@ -14,6 +14,8 @@ export const REVIEW_CODES = [
|
|
|
14
14
|
"malicious",
|
|
15
15
|
"secret_exfiltration",
|
|
16
16
|
"prompt_injection",
|
|
17
|
+
// the model's escalate, only for a reply to someone other than the owner that would tell them what only the owner may see: the owner decides
|
|
18
|
+
"private_disclosure",
|
|
17
19
|
// the review didn't finish (a call failed, timed out, refused or hit a limit): tried once more, then approved
|
|
18
20
|
"reviewer_failed",
|
|
19
21
|
"fail_open",
|
|
@@ -111,7 +111,7 @@ export interface TokenStore {
|
|
|
111
111
|
/** Resolves once the token is persisted: nothing is kept in memory or used before that. */
|
|
112
112
|
write(t: StoredToken): void | Promise<void>;
|
|
113
113
|
}
|
|
114
|
-
/** token.json (0600), written atomically; a file removed from outside reads as signed out. */
|
|
114
|
+
/** token.json (0600), written atomically; a file removed from outside reads as signed out. A token this process saved stays read until the file shows (a hosted mount projects a save a moment after the kernel answers) and is dropped only once the file has been there and is gone. */
|
|
115
115
|
export declare function fileStore(path: string): TokenStore;
|
|
116
116
|
/** token.json: the pair plus the client it belongs to. Extra fields a vendor answered (Slack's user_id) are kept. */
|
|
117
117
|
export interface StoredToken {
|
package/dist/src/vendor/oauth.js
CHANGED
|
@@ -27,13 +27,18 @@ async function persist(path, text) {
|
|
|
27
27
|
chmodSync(tmp, 0o600);
|
|
28
28
|
renameSync(tmp, path);
|
|
29
29
|
}
|
|
30
|
-
/** token.json (0600), written atomically; a file removed from outside reads as signed out. */
|
|
30
|
+
/** token.json (0600), written atomically; a file removed from outside reads as signed out. A token this process saved stays read until the file shows (a hosted mount projects a save a moment after the kernel answers) and is dropped only once the file has been there and is gone. */
|
|
31
31
|
export function fileStore(path) {
|
|
32
32
|
let token;
|
|
33
|
+
let seen = false;
|
|
33
34
|
return {
|
|
34
35
|
read() {
|
|
35
|
-
if (!existsSync(path))
|
|
36
|
-
|
|
36
|
+
if (!existsSync(path)) {
|
|
37
|
+
if (seen)
|
|
38
|
+
(token = undefined), (seen = false);
|
|
39
|
+
return token;
|
|
40
|
+
}
|
|
41
|
+
seen = true;
|
|
37
42
|
return (token ??= JSON.parse(readFileSync(path, "utf8")));
|
|
38
43
|
},
|
|
39
44
|
async write(t) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidenhq/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.16",
|
|
4
4
|
"description": "The shared code of AidenHQ modules: contract types, engine IO, the caller check and fence, write executors, the reviewer side, the judges' models and call, the source writer and the vendor MCP pass-through.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|