@namzu/sdk 52.4.0 → 52.5.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.
- package/CHANGELOG.md +27 -0
- package/dist/authorization/gate.d.ts +11 -0
- package/dist/authorization/gate.d.ts.map +1 -1
- package/dist/authorization/gate.js +35 -0
- package/dist/authorization/gate.js.map +1 -1
- package/dist/authorization/removal.js +11 -6
- package/dist/authorization/removal.js.map +1 -1
- package/dist/authorization/rules.d.ts.map +1 -1
- package/dist/authorization/rules.js +30 -2
- package/dist/authorization/rules.js.map +1 -1
- package/dist/authorization/shell-paths.d.ts +20 -0
- package/dist/authorization/shell-paths.d.ts.map +1 -1
- package/dist/authorization/shell-paths.js +254 -52
- package/dist/authorization/shell-paths.js.map +1 -1
- package/dist/bridge/acp/server.d.ts +8 -0
- package/dist/bridge/acp/server.d.ts.map +1 -1
- package/dist/bridge/acp/server.js +7 -0
- package/dist/bridge/acp/server.js.map +1 -1
- package/dist/manager/resident/outbox.d.ts +4 -4
- package/dist/public-runtime.d.ts +2 -1
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +4 -1
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-types.d.ts +1 -0
- package/dist/public-types.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/classifier.d.ts +130 -0
- package/dist/runtime/query/auto-review/classifier.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/classifier.js +244 -0
- package/dist/runtime/query/auto-review/classifier.js.map +1 -0
- package/dist/runtime/query/auto-review/index.d.ts +7 -0
- package/dist/runtime/query/auto-review/index.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/index.js +4 -0
- package/dist/runtime/query/auto-review/index.js.map +1 -0
- package/dist/runtime/query/auto-review/prompt.d.ts +20 -0
- package/dist/runtime/query/auto-review/prompt.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/prompt.js +89 -0
- package/dist/runtime/query/auto-review/prompt.js.map +1 -0
- package/dist/runtime/query/auto-review/rules.d.ts +49 -0
- package/dist/runtime/query/auto-review/rules.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/rules.js +81 -0
- package/dist/runtime/query/auto-review/rules.js.map +1 -0
- package/dist/runtime/query/auto-review/transcript.d.ts +59 -0
- package/dist/runtime/query/auto-review/transcript.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/transcript.js +116 -0
- package/dist/runtime/query/auto-review/transcript.js.map +1 -0
- package/dist/runtime/query/auto-review/verdict.d.ts +21 -0
- package/dist/runtime/query/auto-review/verdict.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/verdict.js +45 -0
- package/dist/runtime/query/auto-review/verdict.js.map +1 -0
- package/dist/runtime/query/executor.d.ts +7 -0
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +26 -2
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.js +2 -2
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +0 -9
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js +11 -2
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +39 -0
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/path-escalation.d.ts.map +1 -1
- package/dist/runtime/query/path-escalation.js +43 -10
- package/dist/runtime/query/path-escalation.js.map +1 -1
- package/dist/runtime/query/resume-pending.d.ts.map +1 -1
- package/dist/runtime/query/resume-pending.js +14 -0
- package/dist/runtime/query/resume-pending.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +88 -1
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +504 -11
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +2 -0
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/classifier-input.d.ts +9 -0
- package/dist/tools/builtins/classifier-input.d.ts.map +1 -0
- package/dist/tools/builtins/classifier-input.js +20 -0
- package/dist/tools/builtins/classifier-input.js.map +1 -0
- package/dist/tools/builtins/code-analysis.d.ts +2 -0
- package/dist/tools/builtins/code-analysis.d.ts.map +1 -1
- package/dist/tools/builtins/code-analysis.js +196 -119
- package/dist/tools/builtins/code-analysis.js.map +1 -1
- package/dist/tools/builtins/computer-use.d.ts +10 -10
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +12 -0
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/monitor.d.ts.map +1 -1
- package/dist/tools/builtins/monitor.js +3 -0
- package/dist/tools/builtins/monitor.js.map +1 -1
- package/dist/tools/builtins/web.d.ts.map +1 -1
- package/dist/tools/builtins/web.js +3 -0
- package/dist/tools/builtins/web.js.map +1 -1
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +6 -0
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/defineTool.d.ts +2 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +1 -0
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/types/acp/index.d.ts +7 -0
- package/dist/types/acp/index.d.ts.map +1 -1
- package/dist/types/code-analysis/index.d.ts +54 -3
- package/dist/types/code-analysis/index.d.ts.map +1 -1
- package/dist/types/hitl/index.d.ts +45 -1
- package/dist/types/hitl/index.d.ts.map +1 -1
- package/dist/types/hitl/index.js.map +1 -1
- package/dist/types/tool/index.d.ts +16 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/package.json +1 -1
- package/src/authorization/gate.ts +35 -0
- package/src/authorization/removal.ts +12 -6
- package/src/authorization/rules.ts +27 -2
- package/src/authorization/shell-paths.ts +264 -51
- package/src/bridge/acp/server.ts +20 -0
- package/src/public-runtime.ts +18 -0
- package/src/public-types.ts +11 -0
- package/src/runtime/query/auto-review/classifier.ts +404 -0
- package/src/runtime/query/auto-review/index.ts +23 -0
- package/src/runtime/query/auto-review/prompt.ts +97 -0
- package/src/runtime/query/auto-review/rules.ts +106 -0
- package/src/runtime/query/auto-review/transcript.ts +159 -0
- package/src/runtime/query/auto-review/verdict.ts +50 -0
- package/src/runtime/query/executor.ts +29 -2
- package/src/runtime/query/index.ts +2 -2
- package/src/runtime/query/iteration/phases/context.ts +17 -3
- package/src/runtime/query/iteration/phases/tool-review.ts +41 -0
- package/src/runtime/query/path-escalation.ts +44 -9
- package/src/runtime/query/resume-pending.ts +14 -0
- package/src/runtime/query/review-policy.ts +591 -14
- package/src/tools/builtins/bash.ts +3 -0
- package/src/tools/builtins/classifier-input.ts +19 -0
- package/src/tools/builtins/code-analysis.ts +211 -119
- package/src/tools/builtins/edit.ts +13 -0
- package/src/tools/builtins/monitor.ts +4 -0
- package/src/tools/builtins/web.ts +3 -0
- package/src/tools/builtins/write-file.ts +6 -0
- package/src/tools/defineTool.ts +3 -0
- package/src/types/acp/index.ts +7 -0
- package/src/types/code-analysis/index.ts +51 -3
- package/src/types/hitl/index.ts +49 -1
- package/src/types/tool/index.ts +17 -0
package/src/types/hitl/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CostInfo, TokenUsage } from '../common/index.js'
|
|
2
2
|
import type { CheckpointId, PlanId, SessionId, TurnId } from '../ids/index.js'
|
|
3
|
+
import type { Message } from '../message/index.js'
|
|
3
4
|
|
|
4
5
|
export type { CheckpointId }
|
|
5
6
|
|
|
@@ -139,7 +140,28 @@ export type HITLDecisionRequest =
|
|
|
139
140
|
question: UserQuestionData
|
|
140
141
|
}
|
|
141
142
|
|
|
142
|
-
|
|
143
|
+
/**
|
|
144
|
+
* What the turn offers a resume handler besides the request, in memory only.
|
|
145
|
+
*
|
|
146
|
+
* Kept out of {@link HITLDecisionRequest} on purpose: the request is written
|
|
147
|
+
* to the session log when a decision takes long, and a transcript does not
|
|
148
|
+
* belong there. A handler that does not need it ignores the argument; one that
|
|
149
|
+
* wraps another passes it on.
|
|
150
|
+
*/
|
|
151
|
+
export interface ResumeContext {
|
|
152
|
+
/**
|
|
153
|
+
* The conversation as it stands now, the batch under review included.
|
|
154
|
+
* Read on demand; the array is the turn's own, so a caller must not change it.
|
|
155
|
+
*/
|
|
156
|
+
readonly transcript: () => readonly Message[]
|
|
157
|
+
/** The turn's cancellation signal, when it has one. */
|
|
158
|
+
readonly signal?: AbortSignal
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type ResumeHandler = (
|
|
162
|
+
request: HITLDecisionRequest,
|
|
163
|
+
context?: ResumeContext,
|
|
164
|
+
) => Promise<HITLResumeDecision>
|
|
143
165
|
|
|
144
166
|
export interface ToolCallSummary {
|
|
145
167
|
id: string
|
|
@@ -158,6 +180,24 @@ export interface ToolCallSummary {
|
|
|
158
180
|
reason?: string
|
|
159
181
|
/** A matching rule requested review; read-only exemptions must not bypass it. */
|
|
160
182
|
explicitReview?: true
|
|
183
|
+
/**
|
|
184
|
+
* A rule written to ask a person (a `review` rule), or a hook that asked
|
|
185
|
+
* for one, requested this review. Unlike {@link explicitReview} it is not
|
|
186
|
+
* set when an `allow` rule was demoted to review because the call reaches
|
|
187
|
+
* past its boundary. `bypass` and `classify` keep this question for a
|
|
188
|
+
* person; they answer the demoted kind themselves.
|
|
189
|
+
*/
|
|
190
|
+
askRule?: true
|
|
191
|
+
/**
|
|
192
|
+
* How wide the `allow` rule that settled this call is. `tool` means the
|
|
193
|
+
* rule names the whole tool, a category, a tier or a source, or its
|
|
194
|
+
* pattern matches every input; `pattern` means it matches some inputs
|
|
195
|
+
* only. Present only when `decision` is `allow` and a rule (not the
|
|
196
|
+
* read-only allowance) decided it. The `classify` review mode reads it:
|
|
197
|
+
* a whole-tool allow for a shell tool would let the classifier never
|
|
198
|
+
* see a command.
|
|
199
|
+
*/
|
|
200
|
+
allowScope?: 'tool' | 'pattern'
|
|
161
201
|
}
|
|
162
202
|
/**
|
|
163
203
|
* What this call reaches beyond the turn's ordinary boundary, as the
|
|
@@ -278,6 +318,14 @@ export interface ToolCallEscalation {
|
|
|
278
318
|
* tool that declares `commandArgument`.
|
|
279
319
|
*/
|
|
280
320
|
dangerousRemoval?: string
|
|
321
|
+
/**
|
|
322
|
+
* Why the kernel could not finish looking at this call: the check that
|
|
323
|
+
* finds the escalations above threw, so none of them is known to be
|
|
324
|
+
* absent. Treated as the most serious escalation there is, because the
|
|
325
|
+
* safety checks did not run: a person is asked in every mode, `bypass`
|
|
326
|
+
* and `classify` included, and it is refused when nobody can be asked.
|
|
327
|
+
*/
|
|
328
|
+
unfinishedCheck?: string
|
|
281
329
|
}
|
|
282
330
|
|
|
283
331
|
export interface ToolModification {
|
package/src/types/tool/index.ts
CHANGED
|
@@ -1178,6 +1178,23 @@ export interface ToolDefinition<TInput = unknown> extends ToolPresentation<TInpu
|
|
|
1178
1178
|
*/
|
|
1179
1179
|
requiresApproval?(input: TInput): boolean
|
|
1180
1180
|
|
|
1181
|
+
/**
|
|
1182
|
+
* What the auto-mode safety classifier is shown of this call.
|
|
1183
|
+
*
|
|
1184
|
+
* The classifier (`createAutoReviewClassifier`, review mode `classify`)
|
|
1185
|
+
* reads a compact transcript, not raw tool arguments: a tool knows which
|
|
1186
|
+
* part of its own input says what the call DOES. A shell tool returns the
|
|
1187
|
+
* command, a file tool the path and a short summary of the change, a fetch
|
|
1188
|
+
* the address. The string should be short and carry no content the model
|
|
1189
|
+
* could not already be trusted with; the runtime caps its length.
|
|
1190
|
+
*
|
|
1191
|
+
* Absent, the classifier is shown the input as compact JSON. A tool whose
|
|
1192
|
+
* input is large or opaque (a file body, a binary payload) should declare
|
|
1193
|
+
* this so the classifier judges the action rather than the bulk. Never
|
|
1194
|
+
* called with a tool RESULT: results are untrusted and are not shown.
|
|
1195
|
+
*/
|
|
1196
|
+
classifierInput?(input: TInput): string
|
|
1197
|
+
|
|
1181
1198
|
/**
|
|
1182
1199
|
* Free-form, tool-author-declared data for filtering and behaviour
|
|
1183
1200
|
* customization — never a classification the runtime itself reads.
|