@aidenhq/sdk 0.5.15 → 0.5.17
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/tiers.d.ts +5 -1
- package/dist/src/tiers.js +10 -5
- package/dist/src/vendor/oauth.d.ts +1 -1
- package/dist/src/vendor/oauth.js +8 -3
- package/package.json +1 -1
package/dist/src/tiers.d.ts
CHANGED
|
@@ -15,7 +15,11 @@ export declare const MANIFESTS: string[];
|
|
|
15
15
|
export declare const PROSE: string[];
|
|
16
16
|
/** Rule files a folder's AGENTS.md links to (`modules/AGENTS.md`): a change to one steers an agent as much as the guide does. */
|
|
17
17
|
export declare const FOLDER_RULES: string[];
|
|
18
|
-
/**
|
|
18
|
+
/** Agent handbooks and the review's own rules: what the product's agents do, so any change to one is sensitive. */
|
|
19
|
+
export declare const AGENT_RULES: string[];
|
|
20
|
+
/** A repo's developer guidance: a change to one is standard (trivial only in a sandbox repo, as everything there), sensitive only through the rest of its PR. */
|
|
21
|
+
export declare const DEV_GUIDES: string[];
|
|
22
|
+
/** The files that steer an agent (a reviewer reads them as guidance): never reviewed as prose. */
|
|
19
23
|
export declare const INSTRUCTIONS: string[];
|
|
20
24
|
export declare const SENSITIVE: string[];
|
|
21
25
|
export type Facts = {
|
package/dist/src/tiers.js
CHANGED
|
@@ -17,10 +17,14 @@ const RISKY = ["auth", "secur", "token", "session", "permission"].flatMap((w) =>
|
|
|
17
17
|
export const PROSE = ["docs/**/*.md", "docs/**/*.rst"]; // not mdx: it can run code
|
|
18
18
|
/** Rule files a folder's AGENTS.md links to (`modules/AGENTS.md`): a change to one steers an agent as much as the guide does. */
|
|
19
19
|
export const FOLDER_RULES = ["modules/agent-anatomy.md", "modules/teammates.md"];
|
|
20
|
-
/**
|
|
21
|
-
export const
|
|
20
|
+
/** Agent handbooks and the review's own rules: what the product's agents do, so any change to one is sensitive. */
|
|
21
|
+
export const AGENT_RULES = ["**/AGENTS.md", "**/AGENTS.override.md", "**/REVIEW.md", ...FOLDER_RULES];
|
|
22
|
+
/** A repo's developer guidance: a change to one is standard (trivial only in a sandbox repo, as everything there), sensitive only through the rest of its PR. */
|
|
23
|
+
export const DEV_GUIDES = ["**/CLAUDE.md", "docs/conventions-*.md"];
|
|
24
|
+
/** The files that steer an agent (a reviewer reads them as guidance): never reviewed as prose. */
|
|
25
|
+
export const INSTRUCTIONS = [...AGENT_RULES, ...DEV_GUIDES];
|
|
22
26
|
export const SENSITIVE = [
|
|
23
|
-
".github/**", "**/Dockerfile*", "**/package.json", ...
|
|
27
|
+
".github/**", "**/Dockerfile*", "**/package.json", ...AGENT_RULES, "**/.codex/**", "**/codex.toml", ...RISKY,
|
|
24
28
|
...LOCKS, "**/.eslintrc*", "**/eslint.config.*", "**/.oxlintrc*", "**/oxlint.config.*", "**/oxlint-plugin.*", "**/oxlint-suppressions.json", "**/vitest.config.*", "**/jest.config.*", "**/tsconfig*.json", "**/CODEOWNERS",
|
|
25
29
|
"**/migrations/**", "**/*.tf", "infra/**", "**/.env*", "**/config/**", "**/docker-compose*",
|
|
26
30
|
];
|
|
@@ -48,13 +52,14 @@ export const CONDITIONS = [...COUNTS, ...GLOBS, "author", "repo_class"];
|
|
|
48
52
|
export const DEFAULT_RULES = [
|
|
49
53
|
{ when: { repo_class: "critical" }, tier: "sensitive" },
|
|
50
54
|
{ when: { author: "bot", only_paths: [...MANIFESTS, ...LOCKS] }, tier: "skip" },
|
|
51
|
-
{ when: { paths:
|
|
52
|
-
{ when: { author: "member", only_paths: PROSE }, tier: "standard" },
|
|
55
|
+
{ when: { paths: AGENT_RULES }, tier: "sensitive" },
|
|
56
|
+
{ when: { author: "member", only_paths: [...PROSE, ...DEV_GUIDES] }, tier: "standard" },
|
|
53
57
|
{ when: { paths: SENSITIVE }, tier: "sensitive" },
|
|
54
58
|
{ when: { author: "outsider" }, tier: "sensitive" },
|
|
55
59
|
{ when: { repo_class: "sandbox" }, tier: "trivial" },
|
|
56
60
|
{ when: { lines_max: 0 }, tier: "sensitive" },
|
|
57
61
|
{ when: { lines_min: 600 }, tier: "sensitive" },
|
|
62
|
+
{ when: { paths: DEV_GUIDES }, tier: "standard" },
|
|
58
63
|
{ when: { author: "member", lines_max: 10, files_max: 20 }, tier: "trivial" },
|
|
59
64
|
{ tier: "standard" },
|
|
60
65
|
];
|
|
@@ -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.17",
|
|
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": {
|