superagent-claude 0.3.1 → 0.4.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/lib/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import { DatabaseSync } from "node:sqlite";
|
|
|
13
13
|
import { checkSync, lockSync } from "proper-lockfile";
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
15
|
// package.json
|
|
16
|
-
var version = "0.
|
|
16
|
+
var version = "0.4.0";
|
|
17
17
|
// src/infra/env.ts
|
|
18
18
|
/**
|
|
19
19
|
* Environment for subprocesses: only the inherited whitelist (PATH, HOME, LANG) plus explicitly named variables.
|
|
@@ -394,10 +394,6 @@ function sdkOptions(spec, ctx) {
|
|
|
394
394
|
} : spec.instructions,
|
|
395
395
|
allowedTools: allowed,
|
|
396
396
|
disallowedTools: spec.role === "worker" ? tools.disallowed : [...tools.disallowed, AGENT_TOOL],
|
|
397
|
-
canUseTool: async (toolName) => ({
|
|
398
|
-
behavior: "deny",
|
|
399
|
-
message: `${toolName} is not allowed in this session`
|
|
400
|
-
}),
|
|
401
397
|
mcpServers: ctx.mcp ? { superagent: ctx.mcp } : {},
|
|
402
398
|
strictMcpConfig: true,
|
|
403
399
|
...agents ? { agents } : {},
|
|
@@ -415,7 +411,10 @@ function sdkOptions(spec, ctx) {
|
|
|
415
411
|
failIfUnavailable: true,
|
|
416
412
|
allowUnsandboxedCommands: false,
|
|
417
413
|
autoAllowBashIfSandboxed: true,
|
|
418
|
-
network: {
|
|
414
|
+
network: {
|
|
415
|
+
allowedDomains: [...spec.network.allow],
|
|
416
|
+
allowLocalBinding: ctx.allowLocalBinding ?? true
|
|
417
|
+
},
|
|
419
418
|
...ctx.weakerNestedSandbox ? {
|
|
420
419
|
enableWeakerNestedSandbox: true,
|
|
421
420
|
filesystem: { denyRead: ["/proc"] }
|
|
@@ -2955,11 +2954,13 @@ const ConfigSchema = z.object({
|
|
|
2955
2954
|
security: z.object({
|
|
2956
2955
|
trustRepoConfig: z.boolean().default(false),
|
|
2957
2956
|
allowUnsandboxed: z.boolean().default(false),
|
|
2958
|
-
weakerNestedSandbox: z.boolean().default(false)
|
|
2957
|
+
weakerNestedSandbox: z.boolean().default(false),
|
|
2958
|
+
allowLocalBinding: z.boolean().default(true)
|
|
2959
2959
|
}).strict().default({
|
|
2960
2960
|
trustRepoConfig: false,
|
|
2961
2961
|
allowUnsandboxed: false,
|
|
2962
|
-
weakerNestedSandbox: false
|
|
2962
|
+
weakerNestedSandbox: false,
|
|
2963
|
+
allowLocalBinding: true
|
|
2963
2964
|
}),
|
|
2964
2965
|
retention: z.object({ endedTicketDays: z.number().int().min(1).default(14) }).strict().default({ endedTicketDays: 14 }),
|
|
2965
2966
|
models: z.object({
|
|
@@ -4250,6 +4251,7 @@ var ClaudeSession = class {
|
|
|
4250
4251
|
configDir: config.configDir,
|
|
4251
4252
|
sandbox: config.sandbox,
|
|
4252
4253
|
weakerNestedSandbox: config.weakerNestedSandbox,
|
|
4254
|
+
allowLocalBinding: config.allowLocalBinding,
|
|
4253
4255
|
sessionId: spec.resume ? void 0 : this.id,
|
|
4254
4256
|
mcp: spec.tools.length ? mcpServer(spec.tools, this.abort.signal) : void 0,
|
|
4255
4257
|
onRead: () => this.emitAll(this.mapper.read()),
|
|
@@ -4404,6 +4406,7 @@ var ClaudeRuntime = class {
|
|
|
4404
4406
|
env: this.options.env ?? process.env,
|
|
4405
4407
|
sandbox: (this.options.sandbox ?? true) && (!this.options.allowUnsandboxed || this.sandboxUsable()),
|
|
4406
4408
|
weakerNestedSandbox: this.options.weakerNestedSandbox ?? false,
|
|
4409
|
+
allowLocalBinding: this.options.allowLocalBinding ?? true,
|
|
4407
4410
|
stderr: this.options.stderr,
|
|
4408
4411
|
trustRepoConfig: this.options.trustRepoConfig ?? false,
|
|
4409
4412
|
onDeny: this.options.onDeny,
|
|
@@ -4676,6 +4679,7 @@ function createAgent(o) {
|
|
|
4676
4679
|
env: agentEnv(o.credential, o.env),
|
|
4677
4680
|
trustRepoConfig: o.config.security.trustRepoConfig,
|
|
4678
4681
|
weakerNestedSandbox: o.config.security.weakerNestedSandbox,
|
|
4682
|
+
allowLocalBinding: o.config.security.allowLocalBinding,
|
|
4679
4683
|
allowUnsandboxed: o.config.security.allowUnsandboxed,
|
|
4680
4684
|
children: join(o.config.stateDir, "children.json"),
|
|
4681
4685
|
...o.query ? { query: o.query } : {},
|
|
@@ -8103,7 +8107,12 @@ const COMMON_HOST_RULES = [
|
|
|
8103
8107
|
];
|
|
8104
8108
|
const HOST_RULES = {
|
|
8105
8109
|
router: [...COMMON_HOST_RULES, "- You route and relay; you do not edit files or run commands."].join("\n"),
|
|
8106
|
-
worker: [
|
|
8110
|
+
worker: [
|
|
8111
|
+
...COMMON_HOST_RULES,
|
|
8112
|
+
"- Work only inside your ticket worktree, the current directory.",
|
|
8113
|
+
"- If the sandbox blocks an action (for example EPERM, or a network host that is not allowed), say in the PR description or your report what was blocked and what you could not verify because of it. Never ask or advise a person to change your CLI or sandbox settings, sandbox options or settings files such as .claude/settings.json; if a person must act, name only superagent-claude config keys: `security.allowLocalBinding` or `network.allow`. This rule takes precedence over any default guidance that says otherwise.",
|
|
8114
|
+
"- A missing UI capture alone does not make the work incomplete: never report blocked or leave the PR as draft for that reason. Without a real capture, add one line to the PR description saying there is no visual evidence and what a person should check visually. Never invent a capture or refer to one that does not exist."
|
|
8115
|
+
].join("\n")
|
|
8107
8116
|
};
|
|
8108
8117
|
const WRITE_ACCESS_NOTE_LEAD = "Host note: the agent account cannot push to";
|
|
8109
8118
|
function writeAccessNote(repository, access) {
|
package/package.json
CHANGED
package/prompts/team/delivery.md
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
<!-- Ported from dsh-superagent-prototype (MIT) prompts/team/delivery.md -->
|
|
2
|
-
For
|
|
3
|
-
Capture the same scenario, viewport, theme and relevant UI state so the comparison is meaningful; screenshots or demonstrations are acceptable.
|
|
4
|
-
After-only evidence is incomplete.
|
|
5
|
-
Use actual application captures, not a mockup presented as the previous implementation, and do not expose credentials.
|
|
2
|
+
For a ticket that changes UI, attach visual evidence when a real capture can be made in this environment: clearly labelled Before and After captures of the same scenario, viewport, theme and UI state, with the baseline and changed revision identified; screenshots or demonstrations are acceptable.
|
|
6
3
|
Refresh the comparison when later UI changes make it stale.
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
When a capture cannot be made, add one line to the PR description saying there is no visual evidence and what a person should check visually; that alone does not make the PR blocked or draft.
|
|
5
|
+
Never fabricate captures, never present a mockup as the previous implementation, never refer to a capture that does not exist, and do not expose credentials.
|
|
9
6
|
|
|
10
7
|
Publish commits and open or update the ticket PR only with mcp__superagent__orchestrator_publish; calling it again pushes new commits to the same PR, it never force-pushes, so never rewrite a pushed commit.
|
|
11
8
|
When mcp__superagent__orchestrator_publish returns published: false, the agent account has no write access to the repository and nothing was pushed: call mcp__superagent__orchestrator_report with state: blocked and one human_action asking a person to give the agent account write access to that repository, then stop; publish again only after a person says access was granted.
|