superagent-claude 0.3.0 → 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/README.md +1 -1
- package/lib/cli.js +1 -1
- package/lib/{main-CX62QQM7.js → main-B3cWj580.js} +19 -20
- package/package.json +1 -1
- package/prompts/team/delivery.md +3 -6
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ It needs Node.js 22.19 or later. `npx superagent-claude start --config superagen
|
|
|
20
20
|
|
|
21
21
|
`auth.mode` picks which one (`api-key` or `subscription`); Bedrock and Vertex also work. See [docs/authentication.md](docs/authentication.md) for both modes and the subscription terms warning.
|
|
22
22
|
|
|
23
|
-
The config needs `repositories
|
|
23
|
+
The config needs `repositories` and `policy.allowed`; `auth.mode` defaults to `api-key` and needs its credential. See [docs/getting-started.md](docs/getting-started.md), which also covers building from source.
|
|
24
24
|
|
|
25
25
|
A container image is published as `ghcr.io/ok0/superagent-claude`. See [Docker](docs/deploy.md#docker) to run it.
|
|
26
26
|
|
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({
|
|
@@ -3066,18 +3067,8 @@ const SUBSCRIPTION_POLICY_WARNING = "auth.mode subscription runs the agent on a
|
|
|
3066
3067
|
const SHARED_USE_WARNING = "ToS risk: with auth.mode subscription, people other than the subscription owner (policy.allowed is not exactly [auth.owner]) can make the agent work on the owner's subscription; this shared use may violate the subscription terms.";
|
|
3067
3068
|
const SANDBOX_DOC = "docs/deploy.md#sandbox-in-containers";
|
|
3068
3069
|
const UNSANDBOXED_WARNING = `security.allowUnsandboxed is true and the runtime sandbox is unavailable here: sessions run without the sandbox, network.allow is not enforced and commands can read the agent's tokens from other processes; restrict egress outside the agent (see ${SANDBOX_DOC})`;
|
|
3069
|
-
const RULE_NUMBER = {
|
|
3070
|
-
credential: 1,
|
|
3071
|
-
"allowed-empty": 2,
|
|
3072
|
-
"repositories-empty": 3,
|
|
3073
|
-
"agent-allowed": 4,
|
|
3074
|
-
"subscription-shared": 6,
|
|
3075
|
-
unsandboxed: 7,
|
|
3076
|
-
"no-repository": 8
|
|
3077
|
-
};
|
|
3078
3070
|
function refused(rule, text) {
|
|
3079
|
-
|
|
3080
|
-
return new StartupRefused(rule, number ? `Startup refused (rule ${number}, ${rule}): ${text}` : `Startup refused (${rule}): ${text}`);
|
|
3071
|
+
return new StartupRefused(rule, `Startup refused (${rule}): ${text}`);
|
|
3081
3072
|
}
|
|
3082
3073
|
const present = (value) => typeof value === "string" && value.trim() !== "";
|
|
3083
3074
|
function resolveCredential(mode, env) {
|
|
@@ -4260,6 +4251,7 @@ var ClaudeSession = class {
|
|
|
4260
4251
|
configDir: config.configDir,
|
|
4261
4252
|
sandbox: config.sandbox,
|
|
4262
4253
|
weakerNestedSandbox: config.weakerNestedSandbox,
|
|
4254
|
+
allowLocalBinding: config.allowLocalBinding,
|
|
4263
4255
|
sessionId: spec.resume ? void 0 : this.id,
|
|
4264
4256
|
mcp: spec.tools.length ? mcpServer(spec.tools, this.abort.signal) : void 0,
|
|
4265
4257
|
onRead: () => this.emitAll(this.mapper.read()),
|
|
@@ -4414,6 +4406,7 @@ var ClaudeRuntime = class {
|
|
|
4414
4406
|
env: this.options.env ?? process.env,
|
|
4415
4407
|
sandbox: (this.options.sandbox ?? true) && (!this.options.allowUnsandboxed || this.sandboxUsable()),
|
|
4416
4408
|
weakerNestedSandbox: this.options.weakerNestedSandbox ?? false,
|
|
4409
|
+
allowLocalBinding: this.options.allowLocalBinding ?? true,
|
|
4417
4410
|
stderr: this.options.stderr,
|
|
4418
4411
|
trustRepoConfig: this.options.trustRepoConfig ?? false,
|
|
4419
4412
|
onDeny: this.options.onDeny,
|
|
@@ -4686,6 +4679,7 @@ function createAgent(o) {
|
|
|
4686
4679
|
env: agentEnv(o.credential, o.env),
|
|
4687
4680
|
trustRepoConfig: o.config.security.trustRepoConfig,
|
|
4688
4681
|
weakerNestedSandbox: o.config.security.weakerNestedSandbox,
|
|
4682
|
+
allowLocalBinding: o.config.security.allowLocalBinding,
|
|
4689
4683
|
allowUnsandboxed: o.config.security.allowUnsandboxed,
|
|
4690
4684
|
children: join(o.config.stateDir, "children.json"),
|
|
4691
4685
|
...o.query ? { query: o.query } : {},
|
|
@@ -8113,7 +8107,12 @@ const COMMON_HOST_RULES = [
|
|
|
8113
8107
|
];
|
|
8114
8108
|
const HOST_RULES = {
|
|
8115
8109
|
router: [...COMMON_HOST_RULES, "- You route and relay; you do not edit files or run commands."].join("\n"),
|
|
8116
|
-
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")
|
|
8117
8116
|
};
|
|
8118
8117
|
const WRITE_ACCESS_NOTE_LEAD = "Host note: the agent account cannot push to";
|
|
8119
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.
|