agent-nuvira 3.5.0 → 3.5.2

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 (134) hide show
  1. package/README.md +13 -13
  2. package/dist/agent-sdk/src/scaffold.d.ts +1 -1
  3. package/dist/agent-sdk/src/scaffold.js +1 -1
  4. package/dist/cli/chat.d.ts +159 -6
  5. package/dist/cli/chat.d.ts.map +1 -1
  6. package/dist/cli/chat.js +583 -35
  7. package/dist/cli/chat.js.map +1 -1
  8. package/dist/cli/duties.d.ts +11 -0
  9. package/dist/cli/duties.d.ts.map +1 -1
  10. package/dist/cli/duties.js +31 -0
  11. package/dist/cli/duties.js.map +1 -1
  12. package/dist/cli/edit.d.ts.map +1 -1
  13. package/dist/cli/edit.js +3 -2
  14. package/dist/cli/edit.js.map +1 -1
  15. package/dist/cli/execute.d.ts.map +1 -1
  16. package/dist/cli/execute.js +10 -3
  17. package/dist/cli/execute.js.map +1 -1
  18. package/dist/cli/loop-executor.d.ts +16 -0
  19. package/dist/cli/loop-executor.d.ts.map +1 -1
  20. package/dist/cli/loop-executor.js +9 -0
  21. package/dist/cli/loop-executor.js.map +1 -1
  22. package/dist/cli/models.d.ts.map +1 -1
  23. package/dist/cli/models.js +55 -0
  24. package/dist/cli/models.js.map +1 -1
  25. package/dist/cli/plan.d.ts.map +1 -1
  26. package/dist/cli/plan.js +18 -6
  27. package/dist/cli/plan.js.map +1 -1
  28. package/dist/cli/run.d.ts.map +1 -1
  29. package/dist/cli/run.js +23 -8
  30. package/dist/cli/run.js.map +1 -1
  31. package/dist/cli/ui/answer-view.d.ts +38 -0
  32. package/dist/cli/ui/answer-view.d.ts.map +1 -0
  33. package/dist/cli/ui/answer-view.js +72 -0
  34. package/dist/cli/ui/answer-view.js.map +1 -0
  35. package/dist/cli/ui/cards.d.ts +61 -0
  36. package/dist/cli/ui/cards.d.ts.map +1 -0
  37. package/dist/cli/ui/cards.js +141 -0
  38. package/dist/cli/ui/cards.js.map +1 -0
  39. package/dist/cli/ui/highlight.d.ts +32 -0
  40. package/dist/cli/ui/highlight.d.ts.map +1 -0
  41. package/dist/cli/ui/highlight.js +261 -0
  42. package/dist/cli/ui/highlight.js.map +1 -0
  43. package/dist/cli/ui/index.d.ts +21 -0
  44. package/dist/cli/ui/index.d.ts.map +1 -0
  45. package/dist/cli/ui/index.js +14 -0
  46. package/dist/cli/ui/index.js.map +1 -0
  47. package/dist/cli/ui/markdown.d.ts +90 -0
  48. package/dist/cli/ui/markdown.d.ts.map +1 -0
  49. package/dist/cli/ui/markdown.js +292 -0
  50. package/dist/cli/ui/markdown.js.map +1 -0
  51. package/dist/cli/ui/presenter.d.ts +147 -0
  52. package/dist/cli/ui/presenter.d.ts.map +1 -0
  53. package/dist/cli/ui/presenter.js +313 -0
  54. package/dist/cli/ui/presenter.js.map +1 -0
  55. package/dist/cli/ui/render.d.ts +52 -0
  56. package/dist/cli/ui/render.d.ts.map +1 -0
  57. package/dist/cli/ui/render.js +384 -0
  58. package/dist/cli/ui/render.js.map +1 -0
  59. package/dist/cli/ui/theme.d.ts +36 -0
  60. package/dist/cli/ui/theme.d.ts.map +1 -0
  61. package/dist/cli/ui/theme.js +92 -0
  62. package/dist/cli/ui/theme.js.map +1 -0
  63. package/dist/inference/model-entitlement.d.ts +10 -0
  64. package/dist/inference/model-entitlement.d.ts.map +1 -1
  65. package/dist/inference/model-entitlement.js +1 -1
  66. package/dist/inference/model-entitlement.js.map +1 -1
  67. package/dist/learning/auto-router.d.ts +38 -1
  68. package/dist/learning/auto-router.d.ts.map +1 -1
  69. package/dist/learning/auto-router.js +139 -8
  70. package/dist/learning/auto-router.js.map +1 -1
  71. package/dist/learning/duty-lease.d.ts +163 -0
  72. package/dist/learning/duty-lease.d.ts.map +1 -0
  73. package/dist/learning/duty-lease.js +301 -0
  74. package/dist/learning/duty-lease.js.map +1 -0
  75. package/dist/learning/model-first-router.d.ts +14 -0
  76. package/dist/learning/model-first-router.d.ts.map +1 -1
  77. package/dist/learning/model-first-router.js +54 -17
  78. package/dist/learning/model-first-router.js.map +1 -1
  79. package/dist/learning/model-warmup.d.ts +92 -0
  80. package/dist/learning/model-warmup.d.ts.map +1 -1
  81. package/dist/learning/model-warmup.js +137 -2
  82. package/dist/learning/model-warmup.js.map +1 -1
  83. package/dist/learning/reasoning-trace.d.ts +21 -1
  84. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  85. package/dist/learning/reasoning-trace.js.map +1 -1
  86. package/dist/learning/resilient-call.d.ts.map +1 -1
  87. package/dist/learning/resilient-call.js +70 -4
  88. package/dist/learning/resilient-call.js.map +1 -1
  89. package/dist/learning/retry-patience.d.ts +139 -0
  90. package/dist/learning/retry-patience.d.ts.map +1 -0
  91. package/dist/learning/retry-patience.js +169 -0
  92. package/dist/learning/retry-patience.js.map +1 -0
  93. package/dist/tools/process-liveness.d.ts +227 -0
  94. package/dist/tools/process-liveness.d.ts.map +1 -0
  95. package/dist/tools/process-liveness.js +486 -0
  96. package/dist/tools/process-liveness.js.map +1 -0
  97. package/dist/tools/registry.d.ts.map +1 -1
  98. package/dist/tools/registry.js +4 -2
  99. package/dist/tools/registry.js.map +1 -1
  100. package/dist/tools/run-registry.d.ts +282 -0
  101. package/dist/tools/run-registry.d.ts.map +1 -0
  102. package/dist/tools/run-registry.js +544 -0
  103. package/dist/tools/run-registry.js.map +1 -0
  104. package/dist/tools/run-terminal.d.ts +100 -2
  105. package/dist/tools/run-terminal.d.ts.map +1 -1
  106. package/dist/tools/run-terminal.js +841 -67
  107. package/dist/tools/run-terminal.js.map +1 -1
  108. package/dist/tools/tool-loop.d.ts +87 -3
  109. package/dist/tools/tool-loop.d.ts.map +1 -1
  110. package/dist/tools/tool-loop.js +375 -6
  111. package/dist/tools/tool-loop.js.map +1 -1
  112. package/dist/web-dashboard/chat-console.d.ts +25 -0
  113. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  114. package/dist/web-dashboard/chat-console.js +16 -1
  115. package/dist/web-dashboard/chat-console.js.map +1 -1
  116. package/dist/web-dashboard/server.d.ts.map +1 -1
  117. package/dist/web-dashboard/server.js +7 -1
  118. package/dist/web-dashboard/server.js.map +1 -1
  119. package/dist/web-dashboard/src/types.d.ts +32 -1
  120. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  121. package/dist/web-dashboard/task-registry.d.ts +98 -0
  122. package/dist/web-dashboard/task-registry.d.ts.map +1 -0
  123. package/dist/web-dashboard/task-registry.js +159 -0
  124. package/dist/web-dashboard/task-registry.js.map +1 -0
  125. package/dist/web-dashboard/task-runner.d.ts +155 -5
  126. package/dist/web-dashboard/task-runner.d.ts.map +1 -1
  127. package/dist/web-dashboard/task-runner.js +505 -14
  128. package/dist/web-dashboard/task-runner.js.map +1 -1
  129. package/package.json +4 -1
  130. package/src/web-dashboard/public/assets/index-DycGBWwy.js +236 -0
  131. package/src/web-dashboard/public/assets/index-DycGBWwy.js.map +1 -0
  132. package/src/web-dashboard/public/index.html +1 -1
  133. package/src/web-dashboard/public/assets/index-yky0dw5e.js +0 -236
  134. package/src/web-dashboard/public/assets/index-yky0dw5e.js.map +0 -1
@@ -31,10 +31,99 @@
31
31
  * (maskSenderId — phone numbers never echo back in full).
32
32
  */
33
33
  import type { ToolContext } from './registry.js';
34
+ /**
35
+ * The wait budget this command deserves, and the reason (for the message).
36
+ * Exported so the assessment is testable on its own — it is a decision, not an
37
+ * implementation detail.
38
+ */
39
+ export declare function assessCommandTime(command: string): {
40
+ budgetMs: number;
41
+ why: string;
42
+ } | null;
43
+ /**
44
+ * How long this call waits before handing the command to monitoring.
45
+ *
46
+ * Priority, and why in that order:
47
+ * 1. an explicit `timeout_ms` — the model knows something the classifier does not;
48
+ * 2. the ASSESSED class — a full test suite or a build is minutes by nature, and
49
+ * giving it the short default is what produced the kill-mid-run failures;
50
+ * 3. the room — a person watching waits less (P7), an unattended run waits more.
51
+ *
52
+ * Exported because this is a decision, not an implementation detail: it is what
53
+ * `run_terminal` believes the work needs, and it should be asserted directly
54
+ * rather than inferred from a message.
55
+ */
56
+ export declare function resolveWaitMs(command: string, explicitMs: number | undefined, interactive: boolean | undefined): number;
34
57
  /** Test/DI seam: forget every recorded failure streak. */
35
58
  export declare function resetTerminalFailureStreaks(): void;
36
- /** The guidance a timed-out command gets instead of a bare "timed out". */
37
- export declare function timeoutGuidance(command: string, timeoutMs: number, repeated: boolean): string;
59
+ /** How long a CONFIRMED hang is left running before it is stopped (0 = never). */
60
+ export declare function hangReapMs(): number;
61
+ /**
62
+ * One heartbeat over every monitored run.
63
+ *
64
+ * Exported (and takes `now`) so the decision can be driven deterministically in
65
+ * a test instead of waited for.
66
+ */
67
+ export declare function sampleMonitoredRuns(now?: number): void;
68
+ /**
69
+ * The marker a result carries when the command OUTLIVED its wait budget and is
70
+ * still running under monitoring.
71
+ *
72
+ * It is neither success nor failure, and the loop must read it as neither:
73
+ *
74
+ * - NOT success — a live run has verified nothing yet. Counting it as proof is
75
+ * how a turn ends up claiming "the tests pass" about a suite that is still on
76
+ * its first file.
77
+ * - NOT failure — reporting it as one is the bug this whole change removes: the
78
+ * work was destroyed (or, now, is still going) and the user is told it broke.
79
+ *
80
+ * So it is its own state, and this exported string is the one both the tool and
81
+ * the loop's success classifier read (see `ranOk` in tool-loop.ts).
82
+ */
83
+ export declare const RUN_TERMINAL_INCOMPLETE_PREFIX = "\u23F3 run_terminal: still running";
84
+ /**
85
+ * Re-attach to the runs a PREVIOUS process left behind.
86
+ *
87
+ * Without this, every restart orphaned the record of work that is still going:
88
+ * the command keeps running, nothing can poll it, and the turn that started it
89
+ * has no way to collect its real verdict. Runs whose process is gone are marked
90
+ * finished (with an honest "its exit code was not recorded" reason), and live
91
+ * ones are re-attached to be polled, sampled and — only after their pid is
92
+ * re-verified — stopped.
93
+ *
94
+ * Returns how many runs were recovered.
95
+ */
96
+ export declare function hydrateMonitoredRuns(): number;
97
+ /** Test/DI seam: forget the monitored runs. Kills nothing (they keep running). */
98
+ export declare function resetDetachedRuns(): void;
99
+ /**
100
+ * Everything currently being followed.
101
+ *
102
+ * Hydrates first, so this answers for the runs a PREVIOUS process left behind as
103
+ * well as this one's — otherwise a restart would make the whole list vanish while
104
+ * the commands are still running.
105
+ */
106
+ export declare function listDetachedRuns(): string;
107
+ /**
108
+ * Stop one monitored run deliberately (the model's own decision after a
109
+ * diagnosis). Bounded on purpose: it can only ever touch a command THIS tool
110
+ * started and is still following — never an arbitrary pid.
111
+ */
112
+ export declare function stopDetachedRun(id: string): string;
113
+ /**
114
+ * The state of one monitored command. A finished one keeps its result available
115
+ * (bounded) so the agent can read the exit code and output after doing other
116
+ * work — the poll is how a long command's verdict finally reaches the turn.
117
+ */
118
+ export declare function pollDetachedRun(id: string): string;
119
+ /**
120
+ * What the model is told when a command outlives this call's wait budget.
121
+ * Exported so the wording is testable: the two things it MUST say are that the
122
+ * command was not killed and that re-running it is wrong.
123
+ */
124
+ export declare function waitBudgetGuidance(command: string, id: string, waitMs: number, assessed: {
125
+ why: string;
126
+ } | null, bytes: number, quietMs: number, reapAfterMs?: number): string;
38
127
  /**
39
128
  * Does this command ADD a dependency (rather than install what is declared)?
40
129
  *
@@ -55,6 +144,15 @@ export declare function classifyCommand(command: string): CommandClass;
55
144
  /** ─── The tool ───────────────────────────────────────────────────────────── */
56
145
  export interface RunTerminalArgs {
57
146
  command: string;
147
+ /**
148
+ * 'run' (default) executes the command. 'poll' reports one monitored long run
149
+ * (`process_id`), 'list' shows them all — the follow-up half of the
150
+ * still-running hand-off, so a command that outlives its wait budget is
151
+ * followed to its REAL exit code instead of being killed or guessed at.
152
+ */
153
+ action?: 'run' | 'poll' | 'list' | 'stop';
154
+ /** The monitored run to stop or report on (from a `still running` result). */
155
+ process_id?: string;
58
156
  confirm?: boolean;
59
157
  timeout_ms?: number;
60
158
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"run-terminal.d.ts","sourceRoot":"","sources":["../../src/tools/run-terminal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;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