@namzu/sdk 69.3.0 → 70.0.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 +55 -0
- package/dist/authorization/protected-paths.d.ts +24 -6
- package/dist/authorization/protected-paths.d.ts.map +1 -1
- package/dist/authorization/protected-paths.js +37 -9
- package/dist/authorization/protected-paths.js.map +1 -1
- package/dist/authorization/readonly-commands.d.ts.map +1 -1
- package/dist/authorization/readonly-commands.js +30 -2
- package/dist/authorization/readonly-commands.js.map +1 -1
- package/dist/authorization/shell-lexer.d.ts.map +1 -1
- package/dist/authorization/shell-lexer.js +263 -0
- package/dist/authorization/shell-lexer.js.map +1 -1
- package/dist/connector/web/guarded-fetch.d.ts +30 -0
- package/dist/connector/web/guarded-fetch.d.ts.map +1 -1
- package/dist/connector/web/guarded-fetch.js +85 -0
- package/dist/connector/web/guarded-fetch.js.map +1 -1
- package/dist/connector/web/index.d.ts +1 -1
- package/dist/connector/web/index.d.ts.map +1 -1
- package/dist/connector/web/index.js +1 -1
- package/dist/connector/web/index.js.map +1 -1
- package/dist/plugin/common-layout/read.js +2 -2
- package/dist/plugin/common-layout/read.js.map +1 -1
- package/dist/plugin/hook-module/capabilities.d.ts +12 -0
- package/dist/plugin/hook-module/capabilities.d.ts.map +1 -1
- package/dist/plugin/hook-module/capabilities.js +82 -10
- package/dist/plugin/hook-module/capabilities.js.map +1 -1
- package/dist/plugin/hook-module/consent.d.ts +11 -0
- package/dist/plugin/hook-module/consent.d.ts.map +1 -1
- package/dist/plugin/hook-module/consent.js +31 -0
- package/dist/plugin/hook-module/consent.js.map +1 -1
- package/dist/plugin/hook-module/host.d.ts.map +1 -1
- package/dist/plugin/hook-module/host.js +69 -23
- package/dist/plugin/hook-module/host.js.map +1 -1
- package/dist/plugin/hook-module/index.d.ts +1 -1
- package/dist/plugin/hook-module/index.d.ts.map +1 -1
- package/dist/plugin/hook-module/index.js +1 -1
- package/dist/plugin/hook-module/index.js.map +1 -1
- package/dist/plugin/hook-module/scan.js +1 -1
- package/dist/plugin/hook-module/scan.js.map +1 -1
- package/dist/plugin/hook-module/worker-source.d.ts +5 -4
- package/dist/plugin/hook-module/worker-source.d.ts.map +1 -1
- package/dist/plugin/hook-module/worker-source.js +198 -28
- package/dist/plugin/hook-module/worker-source.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +1 -1
- package/dist/provider/side-request-reasoning.d.ts.map +1 -1
- package/dist/provider/side-request-reasoning.js +5 -1
- package/dist/provider/side-request-reasoning.js.map +1 -1
- package/dist/public-runtime.d.ts +3 -3
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +3 -3
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +1 -1
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +1 -1
- package/dist/public-tools.js.map +1 -1
- package/dist/runtime/query/auto-review/classifier.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/classifier.js +13 -2
- package/dist/runtime/query/auto-review/classifier.js.map +1 -1
- package/dist/runtime/query/auto-review/failure.d.ts +12 -5
- package/dist/runtime/query/auto-review/failure.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/failure.js +42 -7
- package/dist/runtime/query/auto-review/failure.js.map +1 -1
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +75 -10
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +21 -3
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +57 -25
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/runtime/query/turn/check-scope.d.ts +18 -0
- package/dist/runtime/query/turn/check-scope.d.ts.map +1 -0
- package/dist/runtime/query/turn/check-scope.js +90 -0
- package/dist/runtime/query/turn/check-scope.js.map +1 -0
- package/dist/runtime/query/turn/outcome-ledger.d.ts.map +1 -1
- package/dist/runtime/query/turn/outcome-ledger.js +13 -0
- package/dist/runtime/query/turn/outcome-ledger.js.map +1 -1
- package/dist/skills/inline-shell-host.d.ts +6 -0
- package/dist/skills/inline-shell-host.d.ts.map +1 -1
- package/dist/skills/inline-shell-host.js +8 -0
- package/dist/skills/inline-shell-host.js.map +1 -1
- package/dist/skills/inline-shell.d.ts +9 -1
- package/dist/skills/inline-shell.d.ts.map +1 -1
- package/dist/skills/inline-shell.js +78 -10
- package/dist/skills/inline-shell.js.map +1 -1
- package/dist/tools/builtins/job.d.ts.map +1 -1
- package/dist/tools/builtins/job.js +4 -1
- package/dist/tools/builtins/job.js.map +1 -1
- package/dist/tools/builtins/skill.d.ts.map +1 -1
- package/dist/tools/builtins/skill.js +2 -0
- package/dist/tools/builtins/skill.js.map +1 -1
- package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
- package/dist/tools/builtins/wait-for-job.js +2 -1
- package/dist/tools/builtins/wait-for-job.js.map +1 -1
- package/dist/types/permission/index.d.ts +11 -2
- package/dist/types/permission/index.d.ts.map +1 -1
- package/dist/types/permission/index.js +12 -2
- package/dist/types/permission/index.js.map +1 -1
- package/dist/types/tool/index.d.ts +7 -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/protected-paths.ts +44 -9
- package/src/authorization/readonly-commands.ts +30 -2
- package/src/authorization/shell-lexer.ts +242 -0
- package/src/connector/web/guarded-fetch.ts +92 -0
- package/src/connector/web/index.ts +6 -1
- package/src/plugin/common-layout/read.ts +2 -2
- package/src/plugin/hook-module/capabilities.ts +94 -10
- package/src/plugin/hook-module/consent.ts +36 -0
- package/src/plugin/hook-module/host.ts +72 -21
- package/src/plugin/hook-module/index.ts +2 -0
- package/src/plugin/hook-module/scan.ts +2 -2
- package/src/plugin/hook-module/worker-source.ts +199 -28
- package/src/prompt/coding-agent-doctrine.ts +1 -1
- package/src/provider/side-request-reasoning.ts +5 -1
- package/src/public-runtime.ts +6 -0
- package/src/public-tools.ts +4 -1
- package/src/runtime/query/auto-review/classifier.ts +14 -2
- package/src/runtime/query/auto-review/failure.ts +52 -7
- package/src/runtime/query/executor.ts +74 -7
- package/src/runtime/query/review-policy.ts +72 -19
- package/src/runtime/query/turn/check-scope.ts +90 -0
- package/src/runtime/query/turn/outcome-ledger.ts +11 -0
- package/src/skills/inline-shell-host.ts +16 -0
- package/src/skills/inline-shell.ts +90 -8
- package/src/tools/builtins/job.ts +4 -1
- package/src/tools/builtins/skill.ts +2 -0
- package/src/tools/builtins/wait-for-job.ts +3 -1
- package/src/types/permission/index.ts +20 -3
- package/src/types/tool/index.ts +7 -0
|
@@ -432,6 +432,8 @@ export function createSkillTool(options: SkillToolOptions = {}) {
|
|
|
432
432
|
host: createToolSkillShellHost({
|
|
433
433
|
context: input.context,
|
|
434
434
|
...(allow ? { allow } : {}),
|
|
435
|
+
// Only a model loaded this, so only a model can run a command in its own call.
|
|
436
|
+
...(input.invokedBy === 'model' ? { handOff: true } : {}),
|
|
435
437
|
}),
|
|
436
438
|
commandName: input.name,
|
|
437
439
|
...(block !== undefined ? { block } : {}),
|
|
@@ -119,7 +119,9 @@ export const WaitForJobTool = defineTool({
|
|
|
119
119
|
return {
|
|
120
120
|
kind: 'generic',
|
|
121
121
|
presentation: 'activity',
|
|
122
|
-
|
|
122
|
+
// No id in the row: it is the model's handle on the job, not something the person reads.
|
|
123
|
+
label:
|
|
124
|
+
input.output_contains === undefined ? 'Wait for background job' : 'Wait for job output',
|
|
123
125
|
}
|
|
124
126
|
},
|
|
125
127
|
|
|
@@ -42,13 +42,30 @@ export const PLAN_MODE_REFUSAL_WITH_PLAN_FILE =
|
|
|
42
42
|
* - `strict` runs only calls a rule allowed (or that only read). A skill's
|
|
43
43
|
* grant is not a rule, so it never lifts this.
|
|
44
44
|
*
|
|
45
|
-
*
|
|
46
|
-
* classifier
|
|
45
|
+
* - `classify` (auto) sends every call but a read, or one a narrow rule allows, to
|
|
46
|
+
* the classifier. A nested call has no classifier to go to, so it is refused,
|
|
47
|
+
* as the direct call would not have run unreviewed. A rule that covers a whole
|
|
48
|
+
* shell tool or a program that runs whatever it is given is too wide to stand
|
|
49
|
+
* in for the reviewer (`ruleTooWide`), as it is for a direct call.
|
|
50
|
+
*
|
|
51
|
+
* Every other mode answers a call that no rule decided by asking a person,
|
|
52
|
+
* which a load cannot do; that stays the caller's refusal.
|
|
47
53
|
*/
|
|
54
|
+
export const CLASSIFY_NESTED_REFUSAL =
|
|
55
|
+
'auto mode reviews only the commands you run yourself, so it does not run this one from inside a skill; run it as a direct call so it can be reviewed'
|
|
56
|
+
|
|
48
57
|
export function nestedCallModeRefusal(
|
|
49
58
|
mode: string | undefined,
|
|
50
|
-
call: {
|
|
59
|
+
call: {
|
|
60
|
+
readonly readOnly: boolean
|
|
61
|
+
readonly allowedByRule: boolean
|
|
62
|
+
/** The rule that allowed it covers a whole tool, or a line that launches code. */
|
|
63
|
+
readonly ruleTooWide?: boolean
|
|
64
|
+
},
|
|
51
65
|
): string | undefined {
|
|
66
|
+
if (mode === 'classify' && !call.readOnly && !(call.allowedByRule && call.ruleTooWide !== true)) {
|
|
67
|
+
return CLASSIFY_NESTED_REFUSAL
|
|
68
|
+
}
|
|
52
69
|
if (mode === 'plan' && !call.readOnly) {
|
|
53
70
|
return 'plan mode only runs commands that read, and this one can change something'
|
|
54
71
|
}
|
package/src/types/tool/index.ts
CHANGED
|
@@ -637,6 +637,13 @@ export interface ToolDispatchOptions {
|
|
|
637
637
|
* floor stopped, and never covers a call the tool declares needs approval.
|
|
638
638
|
*/
|
|
639
639
|
readonly allow?: (call: { readonly name: string; readonly input: unknown }) => boolean
|
|
640
|
+
/**
|
|
641
|
+
* For a tool that is loading text for a model: a call that the turn's auto mode
|
|
642
|
+
* would send to its reviewer (and that no rule denies) is not run and not treated
|
|
643
|
+
* as a failure. It comes back unsuccessful with `data.handedOff === true`, so the
|
|
644
|
+
* caller can ask the model to make the call itself, where the reviewer sees it.
|
|
645
|
+
*/
|
|
646
|
+
readonly handOff?: boolean
|
|
640
647
|
/**
|
|
641
648
|
* Asked after the call is allowed and before it starts. Returns `undefined`
|
|
642
649
|
* to let it run, or the reason it is not to run, which comes back as the
|