@novalabai/adk 2.6.0 → 2.7.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.
Files changed (45) hide show
  1. package/dist/client.d.ts +12 -0
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +16 -0
  4. package/dist/client.js.map +1 -1
  5. package/dist/core/http.d.ts +7 -0
  6. package/dist/core/http.d.ts.map +1 -1
  7. package/dist/core/http.js +23 -0
  8. package/dist/core/http.js.map +1 -1
  9. package/dist/index.d.ts +9 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +10 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/resources/auto-agent.d.ts +53 -0
  14. package/dist/resources/auto-agent.d.ts.map +1 -0
  15. package/dist/resources/auto-agent.js +61 -0
  16. package/dist/resources/auto-agent.js.map +1 -0
  17. package/dist/resources/files.d.ts +59 -0
  18. package/dist/resources/files.d.ts.map +1 -0
  19. package/dist/resources/files.js +59 -0
  20. package/dist/resources/files.js.map +1 -0
  21. package/dist/resources/planner.d.ts +66 -0
  22. package/dist/resources/planner.d.ts.map +1 -0
  23. package/dist/resources/planner.js +80 -0
  24. package/dist/resources/planner.js.map +1 -0
  25. package/dist/resources/repair.d.ts +73 -0
  26. package/dist/resources/repair.d.ts.map +1 -0
  27. package/dist/resources/repair.js +100 -0
  28. package/dist/resources/repair.js.map +1 -0
  29. package/dist/types/auto-agent.d.ts +64 -0
  30. package/dist/types/auto-agent.d.ts.map +1 -0
  31. package/dist/types/auto-agent.js +10 -0
  32. package/dist/types/auto-agent.js.map +1 -0
  33. package/dist/types/files.d.ts +18 -0
  34. package/dist/types/files.d.ts.map +1 -0
  35. package/dist/types/files.js +4 -0
  36. package/dist/types/files.js.map +1 -0
  37. package/dist/types/planner.d.ts +68 -0
  38. package/dist/types/planner.d.ts.map +1 -0
  39. package/dist/types/planner.js +11 -0
  40. package/dist/types/planner.js.map +1 -0
  41. package/dist/types/repair.d.ts +79 -0
  42. package/dist/types/repair.d.ts.map +1 -0
  43. package/dist/types/repair.js +16 -0
  44. package/dist/types/repair.js.map +1 -0
  45. package/package.json +1 -1
@@ -0,0 +1,66 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { AgentList, Plan, PlanCreateRequest, PlanList } from '../types/planner.js';
3
+ /**
4
+ * Decompose a goal into a DAG and run each step against the right specialist.
5
+ *
6
+ * Take a plain-English goal, decompose it into a DAG of specialist steps,
7
+ * execute. Each step's full artifact (deck HTML, document body, image URL)
8
+ * is returned in `result_full` so callers can render or download.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const nova = new NovaClient({ apiKey: 'nova_xxx' });
13
+ *
14
+ * // Decompose a goal into a plan
15
+ * const plan = await nova.planner.create({
16
+ * goal: 'Build a marketing plan for Acme AI and a 10-slide deck for the seed pitch',
17
+ * });
18
+ * for (const step of plan.steps) {
19
+ * console.log(`${step.agent}: ${step.action}`);
20
+ * }
21
+ *
22
+ * // Kick off execution
23
+ * await nova.planner.execute(plan.id);
24
+ *
25
+ * // Poll until done
26
+ * let current: Plan;
27
+ * while (true) {
28
+ * current = await nova.planner.get(plan.id);
29
+ * if (['done', 'failed', 'cancelled'].includes(current.status)) break;
30
+ * await new Promise((r) => setTimeout(r, 2000));
31
+ * }
32
+ *
33
+ * // Read each step's full output
34
+ * for (const step of current.steps) {
35
+ * if (step.result_full) {
36
+ * // e.g. deck HTML — render or persist
37
+ * }
38
+ * }
39
+ * ```
40
+ */
41
+ export declare class PlannerResource {
42
+ private readonly http;
43
+ constructor(http: HttpClient);
44
+ /** Every specialist the planner can call (registry-backed). */
45
+ listAgents(): Promise<AgentList>;
46
+ /**
47
+ * Decompose a goal into a plan. Doesn't execute — call `execute()` next.
48
+ *
49
+ * When `use_memory` is true (default), the planner pulls relevant memory
50
+ * snippets to inform decomposition (e.g. user's tone, prior product names).
51
+ */
52
+ create(params: PlanCreateRequest): Promise<Plan>;
53
+ /** List the caller's plans (newest first). */
54
+ listPlans(): Promise<PlanList>;
55
+ /**
56
+ * Read a plan by id, including current step statuses + result_full bodies.
57
+ * Use this to poll while a plan is executing.
58
+ */
59
+ get(planId: string): Promise<Plan>;
60
+ /**
61
+ * Kick off execution. Returns immediately with status flipped to "running";
62
+ * steps execute in the background. Poll `get(planId)` for progress.
63
+ */
64
+ execute(planId: string): Promise<Plan>;
65
+ }
66
+ //# sourceMappingURL=planner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/resources/planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,SAAS,EACT,IAAI,EACJ,iBAAiB,EACjB,QAAQ,EACT,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B,+DAA+D;IACzD,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC;IAItC;;;;;OAKG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD,8CAA8C;IACxC,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC;IAIpC;;;OAGG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC;;;OAGG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlannerResource = void 0;
4
+ /**
5
+ * Decompose a goal into a DAG and run each step against the right specialist.
6
+ *
7
+ * Take a plain-English goal, decompose it into a DAG of specialist steps,
8
+ * execute. Each step's full artifact (deck HTML, document body, image URL)
9
+ * is returned in `result_full` so callers can render or download.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const nova = new NovaClient({ apiKey: 'nova_xxx' });
14
+ *
15
+ * // Decompose a goal into a plan
16
+ * const plan = await nova.planner.create({
17
+ * goal: 'Build a marketing plan for Acme AI and a 10-slide deck for the seed pitch',
18
+ * });
19
+ * for (const step of plan.steps) {
20
+ * console.log(`${step.agent}: ${step.action}`);
21
+ * }
22
+ *
23
+ * // Kick off execution
24
+ * await nova.planner.execute(plan.id);
25
+ *
26
+ * // Poll until done
27
+ * let current: Plan;
28
+ * while (true) {
29
+ * current = await nova.planner.get(plan.id);
30
+ * if (['done', 'failed', 'cancelled'].includes(current.status)) break;
31
+ * await new Promise((r) => setTimeout(r, 2000));
32
+ * }
33
+ *
34
+ * // Read each step's full output
35
+ * for (const step of current.steps) {
36
+ * if (step.result_full) {
37
+ * // e.g. deck HTML — render or persist
38
+ * }
39
+ * }
40
+ * ```
41
+ */
42
+ class PlannerResource {
43
+ http;
44
+ constructor(http) {
45
+ this.http = http;
46
+ }
47
+ /** Every specialist the planner can call (registry-backed). */
48
+ async listAgents() {
49
+ return this.http.get('/planner/agents');
50
+ }
51
+ /**
52
+ * Decompose a goal into a plan. Doesn't execute — call `execute()` next.
53
+ *
54
+ * When `use_memory` is true (default), the planner pulls relevant memory
55
+ * snippets to inform decomposition (e.g. user's tone, prior product names).
56
+ */
57
+ async create(params) {
58
+ return this.http.post('/planner/plan', params);
59
+ }
60
+ /** List the caller's plans (newest first). */
61
+ async listPlans() {
62
+ return this.http.get('/planner/plans');
63
+ }
64
+ /**
65
+ * Read a plan by id, including current step statuses + result_full bodies.
66
+ * Use this to poll while a plan is executing.
67
+ */
68
+ async get(planId) {
69
+ return this.http.get(`/planner/plans/${planId}`);
70
+ }
71
+ /**
72
+ * Kick off execution. Returns immediately with status flipped to "running";
73
+ * steps execute in the background. Poll `get(planId)` for progress.
74
+ */
75
+ async execute(planId) {
76
+ return this.http.post(`/planner/plans/${planId}/execute`, {});
77
+ }
78
+ }
79
+ exports.PlannerResource = PlannerResource;
80
+ //# sourceMappingURL=planner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.js","sourceRoot":"","sources":["../../src/resources/planner.ts"],"names":[],"mappings":";;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAa,eAAe;IACT,IAAI,CAAa;IAElC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,+DAA+D;IAC/D,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAY,iBAAiB,CAAC,CAAC;IACrD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CAAC,MAAyB;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAO,eAAe,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,8CAA8C;IAC9C,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAW,gBAAgB,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG,CAAC,MAAc;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAO,kBAAkB,MAAM,EAAE,CAAC,CAAC;IACzD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,MAAc;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAO,kBAAkB,MAAM,UAAU,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AA1CD,0CA0CC"}
@@ -0,0 +1,73 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { ApplyFixResponse, ProposeFixResponse, RepairCase, RepairCaseListResponse } from '../types/repair.js';
3
+ /**
4
+ * Read + drive the Repair Agent's case queue.
5
+ *
6
+ * The Repair Agent self-diagnoses chat-pipeline failures and can open
7
+ * autonomous draft PRs via the GitHub REST API. Four phases:
8
+ *
9
+ * R1 narrative diagnosis (Sonnet writes 4-section markdown)
10
+ * R2 tool-using diagnosis (the agent reads files, greps the codebase)
11
+ * R3 propose a unified-diff fix
12
+ * R4 apply the fix as a GitHub draft PR
13
+ *
14
+ * Most callers only need to *read* cases (list + detail). Triggering R3/R4
15
+ * is reserved for operators / dashboard UI.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const nova = new NovaClient({ apiKey: 'nova_xxx' });
20
+ *
21
+ * // List recent cases
22
+ * const list = await nova.repair.listCases(10);
23
+ * for (const caseDict of list.cases) {
24
+ * console.log(caseDict.case_id, caseDict.error_class);
25
+ * }
26
+ *
27
+ * // Drill into one case
28
+ * const c = await nova.repair.getCase('case_abc');
29
+ * console.log((c.diagnosis_md ?? '').slice(0, 500));
30
+ *
31
+ * // R3 — propose a fix
32
+ * const proposal = await nova.repair.proposeFix('case_abc');
33
+ * if (!proposal.no_fix_proposed) console.log(proposal.fix_md);
34
+ *
35
+ * // R4 — open autonomous PR (requires GITHUB_AUTOFIX_TOKEN on the API)
36
+ * const applied = await nova.repair.applyFix('case_abc');
37
+ * if (applied.ok) console.log('Draft PR:', applied.pr_url);
38
+ * ```
39
+ */
40
+ export declare class RepairResource {
41
+ private readonly http;
42
+ constructor(http: HttpClient);
43
+ /**
44
+ * Return the most recent repair cases (newest first). Each entry
45
+ * includes the failure context, markdown diagnosis, chosen action,
46
+ * and whether the case was escalated.
47
+ */
48
+ listCases(limit?: number): Promise<RepairCaseListResponse>;
49
+ /**
50
+ * Full detail for one case.
51
+ *
52
+ * Includes the traceback head, attachments summary, pipeline tail,
53
+ * any R1 diagnosis, and any R3 fix proposal that's been generated.
54
+ */
55
+ getCase(caseId: string): Promise<RepairCase>;
56
+ /**
57
+ * R3 — re-run the propose_fix Claude tool loop on an already-
58
+ * diagnosed case. Returns markdown describing the proposed unified
59
+ * diff (or `no_fix_proposed: true` when the agent isn't confident in
60
+ * any fix).
61
+ */
62
+ proposeFix(caseId: string): Promise<ProposeFixResponse>;
63
+ /**
64
+ * R4 — open an autonomous draft PR for the case's proposed fix.
65
+ *
66
+ * Requires `GITHUB_AUTOFIX_TOKEN` to be set on the API container (via
67
+ * Secrets Manager). When the token is missing the call returns 503
68
+ * with `code: autofix_disabled` — your HttpClient will surface this
69
+ * as a NovaAPIError.
70
+ */
71
+ applyFix(caseId: string): Promise<ApplyFixResponse>;
72
+ }
73
+ //# sourceMappingURL=repair.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repair.d.ts","sourceRoot":"","sources":["../../src/resources/repair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B;;;;OAIG;IACG,SAAS,CAAC,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAMpE;;;;;OAKG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAmBlD;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAO7D;;;;;;;OAOG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAM1D"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RepairResource = void 0;
4
+ /**
5
+ * Read + drive the Repair Agent's case queue.
6
+ *
7
+ * The Repair Agent self-diagnoses chat-pipeline failures and can open
8
+ * autonomous draft PRs via the GitHub REST API. Four phases:
9
+ *
10
+ * R1 narrative diagnosis (Sonnet writes 4-section markdown)
11
+ * R2 tool-using diagnosis (the agent reads files, greps the codebase)
12
+ * R3 propose a unified-diff fix
13
+ * R4 apply the fix as a GitHub draft PR
14
+ *
15
+ * Most callers only need to *read* cases (list + detail). Triggering R3/R4
16
+ * is reserved for operators / dashboard UI.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const nova = new NovaClient({ apiKey: 'nova_xxx' });
21
+ *
22
+ * // List recent cases
23
+ * const list = await nova.repair.listCases(10);
24
+ * for (const caseDict of list.cases) {
25
+ * console.log(caseDict.case_id, caseDict.error_class);
26
+ * }
27
+ *
28
+ * // Drill into one case
29
+ * const c = await nova.repair.getCase('case_abc');
30
+ * console.log((c.diagnosis_md ?? '').slice(0, 500));
31
+ *
32
+ * // R3 — propose a fix
33
+ * const proposal = await nova.repair.proposeFix('case_abc');
34
+ * if (!proposal.no_fix_proposed) console.log(proposal.fix_md);
35
+ *
36
+ * // R4 — open autonomous PR (requires GITHUB_AUTOFIX_TOKEN on the API)
37
+ * const applied = await nova.repair.applyFix('case_abc');
38
+ * if (applied.ok) console.log('Draft PR:', applied.pr_url);
39
+ * ```
40
+ */
41
+ class RepairResource {
42
+ http;
43
+ constructor(http) {
44
+ this.http = http;
45
+ }
46
+ /**
47
+ * Return the most recent repair cases (newest first). Each entry
48
+ * includes the failure context, markdown diagnosis, chosen action,
49
+ * and whether the case was escalated.
50
+ */
51
+ async listCases(limit = 50) {
52
+ return this.http.get(`/repair/cases?limit=${Math.max(1, Math.min(Math.floor(limit), 200))}`);
53
+ }
54
+ /**
55
+ * Full detail for one case.
56
+ *
57
+ * Includes the traceback head, attachments summary, pipeline tail,
58
+ * any R1 diagnosis, and any R3 fix proposal that's been generated.
59
+ */
60
+ async getCase(caseId) {
61
+ const data = await this.http.get(`/repair/cases/${caseId}`);
62
+ return {
63
+ case_id: data.case_id ?? caseId,
64
+ agent_id: data.agent_id ?? null,
65
+ task_id: data.task_id ?? null,
66
+ error_class: data.error_class ?? null,
67
+ error_message: data.error_message ?? null,
68
+ traceback_head: data.traceback_head ?? null,
69
+ pipeline_tail: data.pipeline_tail ?? null,
70
+ diagnosis_md: data.diagnosis_md ?? null,
71
+ fix_md: data.fix_md ?? null,
72
+ pr_url: data.pr_url ?? null,
73
+ status: data.status ?? '',
74
+ created_at: data.created_at ?? 0,
75
+ raw: data,
76
+ };
77
+ }
78
+ /**
79
+ * R3 — re-run the propose_fix Claude tool loop on an already-
80
+ * diagnosed case. Returns markdown describing the proposed unified
81
+ * diff (or `no_fix_proposed: true` when the agent isn't confident in
82
+ * any fix).
83
+ */
84
+ async proposeFix(caseId) {
85
+ return this.http.post(`/repair/cases/${caseId}/propose-fix`, {});
86
+ }
87
+ /**
88
+ * R4 — open an autonomous draft PR for the case's proposed fix.
89
+ *
90
+ * Requires `GITHUB_AUTOFIX_TOKEN` to be set on the API container (via
91
+ * Secrets Manager). When the token is missing the call returns 503
92
+ * with `code: autofix_disabled` — your HttpClient will surface this
93
+ * as a NovaAPIError.
94
+ */
95
+ async applyFix(caseId) {
96
+ return this.http.post(`/repair/cases/${caseId}/apply-fix`, {});
97
+ }
98
+ }
99
+ exports.RepairResource = RepairResource;
100
+ //# sourceMappingURL=repair.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repair.js","sourceRoot":"","sources":["../../src/resources/repair.ts"],"names":[],"mappings":";;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAa,cAAc;IACR,IAAI,CAAa;IAElC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,SAAS,CAAC,QAAgB,EAAE;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,uBAAuB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAA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1
+ /**
2
+ * Types for Nova's Auto-Agent API.
3
+ *
4
+ * Auto-Agent synthesizes a fit-for-purpose specialist on demand. When
5
+ * the user's request doesn't fit any registered specialist, Haiku drafts
6
+ * a fresh system prompt + capabilities for the task and runs it.
7
+ */
8
+ /**
9
+ * Request body for /v1/auto-agent/synthesize and /v1/auto-agent/run.
10
+ */
11
+ export interface AutoAgentRequest {
12
+ /** The user's request — synthesizer reads this to invent a specialist */
13
+ message: string;
14
+ /**
15
+ * Optional last few chat turns ([{role, content}, ...]) for context.
16
+ * When provided, the synthesized agent sees them as conversation history.
17
+ */
18
+ history?: Array<{
19
+ role: string;
20
+ content: string;
21
+ }>;
22
+ }
23
+ /**
24
+ * The synthesized specialist spec.
25
+ *
26
+ * Save this into nova_custom_agents to make a one-off into a reusable
27
+ * specialist; otherwise it's ephemeral (lives for one turn).
28
+ */
29
+ export interface AutoAgentSpec {
30
+ /** Lowercase slug, max 30 chars */
31
+ name: string;
32
+ /** Title-case, max 40 chars */
33
+ display_name: string;
34
+ /** One sentence — what this agent does */
35
+ description: string;
36
+ /** Full system message used when running the agent */
37
+ system_prompt: string;
38
+ /** Verb phrases describing what it can do */
39
+ capabilities: string[];
40
+ /** Synth's self-rated fit, 0.0 to 1.0. Below 0.45 = fall back to chat */
41
+ confidence: number;
42
+ /** One sentence — why these choices fit */
43
+ rationale: string;
44
+ /** False when synthesis fell back to a generic stub (no API key, parse error) */
45
+ used_llm: boolean;
46
+ }
47
+ /** Response from /v1/auto-agent/synthesize — spec only, no execution. */
48
+ export interface AutoAgentSynthesizeResponse {
49
+ spec: AutoAgentSpec;
50
+ }
51
+ /** Response from /v1/auto-agent/run — spec + executed reply. */
52
+ export interface AutoAgentRunResponse {
53
+ spec: AutoAgentSpec;
54
+ /** The synthesized agent's reply to the user's message */
55
+ response: string;
56
+ /** False when run path fell back to a stub reply */
57
+ used_llm: boolean;
58
+ /**
59
+ * Set when the run hit a recoverable error (e.g. 'no_api_key', 'http_429').
60
+ * The `response` field will still carry a usable stub.
61
+ */
62
+ error: string | null;
63
+ }
64
+ //# sourceMappingURL=auto-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-agent.d.ts","sourceRoot":"","sources":["../../src/types/auto-agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,yEAAyE;AACzE,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,aAAa,CAAC;IACpB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * Types for Nova's Auto-Agent API.
4
+ *
5
+ * Auto-Agent synthesizes a fit-for-purpose specialist on demand. When
6
+ * the user's request doesn't fit any registered specialist, Haiku drafts
7
+ * a fresh system prompt + capabilities for the task and runs it.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ //# sourceMappingURL=auto-agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-agent.js","sourceRoot":"","sources":["../../src/types/auto-agent.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
@@ -0,0 +1,18 @@
1
+ /** Types for Nova's file-upload API (chat attachments). */
2
+ export interface FileUploadResponse {
3
+ file_id: string;
4
+ /** The session this file is bound to (newly created if none was provided) */
5
+ session_id: string;
6
+ filename: string;
7
+ content_type: string;
8
+ /** Bytes */
9
+ size: number;
10
+ /** Backend storage key (null when running on local /tmp fallback) */
11
+ s3_key?: string | null;
12
+ /**
13
+ * First N chars of extracted text — what gets inlined into chat prompts.
14
+ * Empty for binary types we can't extract from.
15
+ */
16
+ extracted_head?: string | null;
17
+ }
18
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/types/files.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /** Types for Nova's file-upload API (chat attachments). */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/types/files.ts"],"names":[],"mappings":";AAAA,2DAA2D"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Types for Nova's Planner API.
3
+ *
4
+ * The Planner takes a high-level goal, decomposes it into a DAG of agent
5
+ * steps, and runs each step against the right specialist. Each step's
6
+ * result lands in `result_summary` (short label) + `result_full` (full
7
+ * artifact body, e.g. complete deck HTML, document body, image URL).
8
+ */
9
+ /** Body for POST /v1/planner/plan. */
10
+ export interface PlanCreateRequest {
11
+ /** Plain-English goal — Nova decomposes it */
12
+ goal: string;
13
+ /** When true, the planner pulls user memory snippets to inform decomposition */
14
+ use_memory?: boolean;
15
+ }
16
+ /** One step in a Plan's DAG. */
17
+ export interface PlanStep {
18
+ id: string;
19
+ /** Specialist name — e.g. 'marketing', 'deck_builder' */
20
+ agent: string;
21
+ /** The instruction this step runs */
22
+ action: string;
23
+ params?: Record<string, unknown>;
24
+ /** Other step ids that must finish first */
25
+ depends_on?: string[];
26
+ requires_approval?: boolean;
27
+ rationale?: string;
28
+ /** Status flow: pending → running → succeeded / failed / waiting_approval / skipped */
29
+ status: string;
30
+ /**
31
+ * One-liner label like "Built slide deck (60KB)". Capped at 8000 chars
32
+ * to keep planner re-prompts small.
33
+ */
34
+ result_summary?: string | null;
35
+ /**
36
+ * Full artifact body when the step produced one (e.g. complete deck HTML).
37
+ * Use this to render previews; result_summary stays as the inline label.
38
+ */
39
+ result_full?: string | null;
40
+ model_used?: string | null;
41
+ duration_ms?: number | null;
42
+ }
43
+ /** A planner-generated DAG plus its execution state. */
44
+ export interface Plan {
45
+ id: string;
46
+ goal: string;
47
+ user_id: string;
48
+ steps: PlanStep[];
49
+ created_at: number;
50
+ /** draft / running / done / failed / cancelled */
51
+ status: string;
52
+ version: number;
53
+ /**
54
+ * The [ATTACHED FILES] block that was in scope when the plan was created.
55
+ * Prepended to every step's prompt at execute time so each specialist
56
+ * sees the uploaded files. Empty when no attachments were in scope.
57
+ */
58
+ attachments_context?: string;
59
+ }
60
+ /** Response from GET /v1/planner/plans. */
61
+ export interface PlanList {
62
+ plans: Plan[];
63
+ }
64
+ /** Response from GET /v1/planner/agents — every specialist the planner can call. */
65
+ export interface AgentList {
66
+ agents: Array<Record<string, unknown>>;
67
+ }
68
+ //# sourceMappingURL=planner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/types/planner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,gCAAgC;AAChC,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,wDAAwD;AACxD,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,2CAA2C;AAC3C,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,oFAAoF;AACpF,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACxC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Types for Nova's Planner API.
4
+ *
5
+ * The Planner takes a high-level goal, decomposes it into a DAG of agent
6
+ * steps, and runs each step against the right specialist. Each step's
7
+ * result lands in `result_summary` (short label) + `result_full` (full
8
+ * artifact body, e.g. complete deck HTML, document body, image URL).
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ //# sourceMappingURL=planner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.js","sourceRoot":"","sources":["../../src/types/planner.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Types for Nova's Repair Agent API.
3
+ *
4
+ * The Repair Agent observes chat-pipeline failures, diagnoses them with
5
+ * a Sonnet-backed analyzer, proposes unified-diff fixes, and (optionally)
6
+ * opens an autonomous draft PR via the GitHub REST API.
7
+ *
8
+ * Phases:
9
+ * R1 narrative diagnosis (Sonnet writes 4-section markdown)
10
+ * R2 tool-using diagnosis (read files, grep, recurse)
11
+ * R3 unified-diff fix proposal
12
+ * R4 autonomous draft PR
13
+ */
14
+ /** One entry in the recent-cases list. */
15
+ export interface RepairCaseSummary {
16
+ case_id: string;
17
+ agent_id?: string | null;
18
+ task_id?: string | null;
19
+ error_class?: string | null;
20
+ error_message?: string | null;
21
+ created_at: number;
22
+ status: string;
23
+ has_diagnosis: boolean;
24
+ has_fix: boolean;
25
+ }
26
+ /** Response from GET /v1/repair/cases. */
27
+ export interface RepairCaseListResponse {
28
+ count: number;
29
+ /** Raw case dicts. Use case.case_id, case.status, case.agent_id, etc. */
30
+ cases: Array<Record<string, unknown>>;
31
+ }
32
+ /**
33
+ * Full case detail.
34
+ *
35
+ * Backend persists arbitrary fields per phase (R1 adds diagnosis_md,
36
+ * R3 adds fix_md, R4 adds pr_url, etc.). Common fields surfaced
37
+ * explicitly; full payload available via `raw`.
38
+ */
39
+ export interface RepairCase {
40
+ case_id: string;
41
+ agent_id?: string | null;
42
+ task_id?: string | null;
43
+ error_class?: string | null;
44
+ error_message?: string | null;
45
+ traceback_head?: string | null;
46
+ pipeline_tail?: Array<Record<string, unknown>> | null;
47
+ diagnosis_md?: string | null;
48
+ fix_md?: string | null;
49
+ pr_url?: string | null;
50
+ status: string;
51
+ created_at: number;
52
+ /** Full backend payload (every field the backend persisted). */
53
+ raw: Record<string, unknown>;
54
+ }
55
+ /** Response from POST /v1/repair/cases/{id}/propose-fix (R3). */
56
+ export interface ProposeFixResponse {
57
+ case_id: string;
58
+ /** Markdown-formatted unified diff or fix narrative */
59
+ fix_md: string;
60
+ /** True when the agent decided no confident fix exists for this case */
61
+ no_fix_proposed: boolean;
62
+ }
63
+ /** Response from POST /v1/repair/cases/{id}/apply-fix (R4). */
64
+ export interface ApplyFixResponse {
65
+ case_id: string;
66
+ /** True when a draft PR was opened successfully */
67
+ ok: boolean;
68
+ /** When ok=false: where the apply path stopped (e.g. 'no_patches', 'gh_failure') */
69
+ stage?: string | null;
70
+ /** Human-readable failure reason */
71
+ reason?: string | null;
72
+ /** Draft PR URL when ok=true */
73
+ pr_url?: string | null;
74
+ /** Branch name the patches landed on */
75
+ branch?: string | null;
76
+ /** How many file-level patches landed */
77
+ patches_applied: number;
78
+ }
79
+ //# sourceMappingURL=repair.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repair.d.ts","sourceRoot":"","sources":["../../src/types/repair.ts"],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AChE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B;AAED,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,+DAA+D;AAC/D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,EAAE,EAAE,OAAO,CAAC;IACZ,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,yCAAyC;IACzC,eAAe,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * Types for Nova's Repair Agent API.
4
+ *
5
+ * The Repair Agent observes chat-pipeline failures, diagnoses them with
6
+ * a Sonnet-backed analyzer, proposes unified-diff fixes, and (optionally)
7
+ * opens an autonomous draft PR via the GitHub REST API.
8
+ *
9
+ * Phases:
10
+ * R1 narrative diagnosis (Sonnet writes 4-section markdown)
11
+ * R2 tool-using diagnosis (read files, grep, recurse)
12
+ * R3 unified-diff fix proposal
13
+ * R4 autonomous draft PR
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ //# sourceMappingURL=repair.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repair.js","sourceRoot":"","sources":["../../src/types/repair.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novalabai/adk",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "NovaLab Agent Development Kit — Build, test, and deploy Nova AI agents with multi-agent orchestration, smart model routing, trust layer, and confidence scoring",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",