@aidenhq/sdk 0.5.2 → 0.5.4
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/event-send.js
CHANGED
|
@@ -70,11 +70,16 @@ export async function flushEvents(store, post, onRefused) {
|
|
|
70
70
|
const held = store.load();
|
|
71
71
|
if (!held.length)
|
|
72
72
|
return { sent: 0, left: 0 };
|
|
73
|
-
|
|
74
|
-
const
|
|
73
|
+
// One event per id a pass (a live one and its replay share an id, and the kernel answers by id): the other goes next pass.
|
|
74
|
+
const key = (e) => `${e.id}\0${String(e.replay ?? "")}`;
|
|
75
|
+
const seen = new Set(), batch = held.filter((e) => !seen.has(e.id) && Boolean(seen.add(e.id)));
|
|
76
|
+
const r = await sendEvents(post, batch);
|
|
77
|
+
// Exactly the events this pass sent are removed; one stored meanwhile, or held back above, stays.
|
|
78
|
+
const ids = new Set([...r.sent, ...r.refused.map((x) => x.id)]);
|
|
79
|
+
const gone = new Set(batch.filter((e) => ids.has(e.id)).map(key));
|
|
75
80
|
let left = held.length;
|
|
76
81
|
if (gone.size) {
|
|
77
|
-
const rest = store.load().filter((e) => !gone.has(e
|
|
82
|
+
const rest = store.load().filter((e) => !gone.has(key(e)));
|
|
78
83
|
store.save(rest);
|
|
79
84
|
left = rest.length;
|
|
80
85
|
}
|
package/dist/src/executor.d.ts
CHANGED
|
@@ -78,6 +78,11 @@ export interface ExecuteRequest {
|
|
|
78
78
|
identifier?: string;
|
|
79
79
|
/** The record's tier as the kernel set it (0 ran unreviewed): an executor rechecks what a Tier 0 rested on. */
|
|
80
80
|
tier?: 0 | 1 | 2;
|
|
81
|
+
/** How it was decided: `approve` only on the AI reviewer's approval (`code` `fail_open` when the review didn't finish), `owner`, or `none` (Tier 0). */
|
|
82
|
+
review?: {
|
|
83
|
+
decision: "approve" | "owner" | "none";
|
|
84
|
+
code: string | null;
|
|
85
|
+
};
|
|
81
86
|
}
|
|
82
87
|
export interface Executor {
|
|
83
88
|
plan(req: PlanRequest): Promise<PlanResult>;
|
package/dist/src/executor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// executor@1, the module side (spec §3.3.2): the kernel calls a module's write kinds here, with the module's own service key.
|
|
2
2
|
// POST <path>/plan { kind, args, requester, task, evidence?, revalidate? } → { args, targets?, facts?, raise?, card?, satisfied? }
|
|
3
|
-
// POST <path>/execute { id, kind, args, digest, idempotency_key, task } → { accepted: true } at once; the outcome follows to the
|
|
3
|
+
// POST <path>/execute { id, kind, args, digest, idempotency_key, task, tier, review } → { accepted: true } at once; the outcome follows to the
|
|
4
4
|
// kernel's POST /v1/writes/:id/outcome. Once per id: a repeat is accepted and runs nothing.
|
|
5
5
|
// POST <path>/status { id, idempotency_key } → { state: running | done | failed | unknown, text?, objects? }
|
|
6
6
|
// The kernel calls execute only for an approved, claimed and revalidated record; plan never changes anything.
|
|
@@ -24,6 +24,9 @@ export interface MaintainedRepo {
|
|
|
24
24
|
name: string;
|
|
25
25
|
/** Validate `fix_label` issues, hand fixes over and see them through (default on). */
|
|
26
26
|
fixes: boolean;
|
|
27
|
+
/** A verified security fix is built and opened as a PR here (default off: the security agent reports it to the owner privately).
|
|
28
|
+
* The kernel enforces it on every code-host push, PR and git token rooted in the security agent's work (kernel/src/security-prs.ts). */
|
|
29
|
+
security_prs: boolean;
|
|
27
30
|
/** Whether unlabelled issues are triaged: no, each new one, or each new one and the backlog (default new). */
|
|
28
31
|
triage: (typeof TRIAGE)[number];
|
|
29
32
|
/** Triage feature requests, and build the ones carrying BUILD_LABEL (default off). */
|
|
@@ -25,7 +25,7 @@ export const TRIAGE_CAP_PER_AUTHOR_DAY = 5;
|
|
|
25
25
|
export const TRIAGE_ADMISSION_PER_AUTHOR_DAY = 20;
|
|
26
26
|
export const RESOLVED_CLOSES_PER_RUN = 10;
|
|
27
27
|
export const INACTIVE_GRACE_DAYS = 14;
|
|
28
|
-
const KEYS = ["repo", "fixes", "triage", "features", "actions", "no_reply_days", "inactive_issue_days", "fix_label", "trusted", "protected_labels"];
|
|
28
|
+
const KEYS = ["repo", "fixes", "security_prs", "triage", "features", "actions", "no_reply_days", "inactive_issue_days", "fix_label", "trusted", "protected_labels"];
|
|
29
29
|
const SHAPE = `{ ${KEYS.join(", ")} }`;
|
|
30
30
|
/** Keys an older entry may still carry, with what replaced each: named in the refusal. */
|
|
31
31
|
const REMOVED = {
|
|
@@ -110,7 +110,7 @@ export function parseRepos(raw) {
|
|
|
110
110
|
const actions = Object.fromEntries(VERDICTS.map((v) => [v, one(`actions.${v}`, a[v], ACTIONS, "label")]));
|
|
111
111
|
return {
|
|
112
112
|
repo: `${m[1]}/${m[2]}`, owner: m[1], name: m[2],
|
|
113
|
-
fixes: bool("fixes", true), triage: one("triage", e.triage, TRIAGE, "new"), features: bool("features", false),
|
|
113
|
+
fixes: bool("fixes", true), security_prs: bool("security_prs", false), triage: one("triage", e.triage, TRIAGE, "new"), features: bool("features", false),
|
|
114
114
|
actions,
|
|
115
115
|
no_reply_days: days("no_reply_days"), inactive_issue_days: days("inactive_issue_days"),
|
|
116
116
|
fix_label, trusted: [...new Set(trusted)],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidenhq/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
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": {
|