@htooayelwinict/appv23 2.3.0 → 2.3.1

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 CHANGED
@@ -23,7 +23,7 @@ The launcher pulls and runs:
23
23
  ghcr.io/htooayelwinict/appv23:production
24
24
  ```
25
25
 
26
- It mounts only the selected `--cwd` as `/workspace`, stores sandbox state in `~/.appv23/sandbox-home`, and copies host `~/.agents/skills` into the sandbox.
26
+ It mounts only the selected `--cwd` as `/workspace`, stores sandbox state in `~/.appv23/sandbox-home`, copies host `~/.agents/AGENTS.md` into the sandbox agent context, and copies host `~/.agents/skills` into the sandbox.
27
27
 
28
28
  ## Options
29
29
 
package/bin/appv23.js CHANGED
@@ -11,6 +11,7 @@ const DEFAULT_IMAGE =
11
11
  const PUBLIC_APPV23_IMAGE_PREFIX = "ghcr.io/htooayelwinict/appv23:";
12
12
  const CONTAINER_WORKSPACE = "/workspace";
13
13
  const CONTAINER_AGENT_HOME = "/agent-home";
14
+ const IMPORTED_AGENTS_MARKER = "<!-- appv23-sandbox-imported-agents -->";
14
15
  const SKIP_IMPORT_NAMES = new Set([
15
16
  ".DS_Store",
16
17
  ".git",
@@ -222,24 +223,27 @@ function buildPullEnv(config, dockerConfig, env = process.env) {
222
223
 
223
224
  function prepareSandboxImports(config, runtime = {}) {
224
225
  const homeDir = runtime.homeDir || os.homedir();
226
+ const packageRoot = runtime.packageRoot || path.resolve(__dirname, "..");
225
227
  fs.mkdirSync(config.agentHome, { recursive: true, mode: 0o700 });
226
- prepareAgentsFiles(config);
227
- prepareSkills(config, homeDir);
228
+ prepareAgentsFiles(config, homeDir);
229
+ prepareSkills(config, homeDir, packageRoot);
228
230
  }
229
231
 
230
- function prepareAgentsFiles(config) {
231
- if (!config.agentsFiles.length) {
232
+ function prepareAgentsFiles(config, homeDir = os.homedir()) {
233
+ const sources = collectAgentsFiles(config, homeDir);
234
+ const target = path.join(config.agentHome, "agent", "AGENTS.md");
235
+ if (!sources.length) {
236
+ removeImportedAgentsFile(target);
232
237
  return;
233
238
  }
234
- const target = path.join(config.agentHome, "agent", "AGENTS.md");
235
239
  const parts = [
236
- "<!-- appv23-sandbox-imported-agents -->",
240
+ IMPORTED_AGENTS_MARKER,
237
241
  "# Imported appv23 sandbox instructions",
238
242
  "",
239
- "These instructions were copied into the sandbox from explicit --agents-file arguments.",
243
+ "These instructions were copied into the sandbox from host ~/.agents/AGENTS.md and explicit --agents-file arguments.",
240
244
  "",
241
245
  ];
242
- for (const source of config.agentsFiles) {
246
+ for (const source of sources) {
243
247
  const stat = fs.statSync(source);
244
248
  if (!stat.isFile()) {
245
249
  throw new Error(`agents file is not a file: ${source}`);
@@ -250,8 +254,42 @@ function prepareAgentsFiles(config) {
250
254
  fs.writeFileSync(target, parts.join("\n"), { mode: 0o600 });
251
255
  }
252
256
 
253
- function prepareSkills(config, homeDir) {
257
+ function collectAgentsFiles(config, homeDir) {
258
+ const sources = [];
259
+ const userAgentsFile = path.join(homeDir, ".agents", "AGENTS.md");
260
+ if (fs.existsSync(userAgentsFile)) {
261
+ sources.push(userAgentsFile);
262
+ }
263
+ sources.push(...config.agentsFiles);
264
+ const deduped = [];
265
+ const seen = new Set();
266
+ for (const source of sources) {
267
+ const key = path.resolve(source);
268
+ if (seen.has(key)) {
269
+ continue;
270
+ }
271
+ deduped.push(key);
272
+ seen.add(key);
273
+ }
274
+ return deduped;
275
+ }
276
+
277
+ function removeImportedAgentsFile(target) {
278
+ if (!fs.existsSync(target)) {
279
+ return;
280
+ }
281
+ const text = fs.readFileSync(target, "utf8");
282
+ if (text.startsWith(IMPORTED_AGENTS_MARKER)) {
283
+ fs.unlinkSync(target);
284
+ }
285
+ }
286
+
287
+ function prepareSkills(config, homeDir, packageRoot) {
254
288
  const sources = [];
289
+ const bundledSkills = path.join(packageRoot, "skills");
290
+ if (fs.existsSync(bundledSkills)) {
291
+ sources.push(bundledSkills);
292
+ }
255
293
  const userSkills = path.join(homeDir, ".agents", "skills");
256
294
  if (config.importUserSkills && fs.existsSync(userSkills)) {
257
295
  sources.push(userSkills);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htooayelwinict/appv23",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "npx-friendly Docker launcher for the appv23 coding-agent sandbox.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -9,6 +9,7 @@
9
9
  },
10
10
  "files": [
11
11
  "bin/appv23.js",
12
+ "skills/**/*.md",
12
13
  "README.md",
13
14
  "package.json"
14
15
  ],
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: subagent-delegation
3
+ description: Use only when the user explicitly asks to spawn, delegate to, hand off to, or verify work through subagents, child agents, reviewer agents, explorer agents, research agents, web-search agents, or agent-to-agent workflows.
4
+ ---
5
+
6
+ # Subagent Delegation
7
+
8
+ Use this skill only when the user explicitly asks for subagents, delegation, handoff, reviewer/explorer/research child agents, `/delegate`, or `/subagents`.
9
+
10
+ ## Default behavior
11
+
12
+ - Keep the parent agent normal unless this skill is explicitly triggered.
13
+ - This skill is active for the current user request only. After the parent reports child results, return to normal main-agent behavior.
14
+ - Do not use this skill on a later user request unless that later request explicitly asks for subagents, delegation, handoff, reviewer/explorer/research child agents, `/delegate`, or `/subagents`.
15
+ - Use one delegation wave by default, with at most 3 child agents.
16
+ - Do not launch a second wave unless the user explicitly asks for it after seeing the first child summaries.
17
+ - Do not describe or plan "Wave 2", "Wave 3", or future waves in the same answer.
18
+ - If the task is larger than 3 children can cover, process only the first bounded slice and ask the user whether to continue.
19
+ - Do not let children spawn more subagents.
20
+ - Do not write files unless the user explicitly asks for written artifacts.
21
+
22
+ ## Scope control
23
+
24
+ - If the requested scope is vague, ask one concise clarification instead of broadening it.
25
+ - For phrases like "those files" or "those md files", use only exact files already named in the current conversation or visible parent output.
26
+ - If no exact file list is available, ask which files or directory to use.
27
+ - Never convert a vague request into a whole-repo or whole-workspace sweep.
28
+ - Never run whole-workspace file-count or whole-workspace discovery commands such as `find /workspace -type f`.
29
+ - Avoid unbounded discovery commands. Prefer a named directory and a capped listing, for example `find docs -maxdepth 1 -name '*.md' | head -20`.
30
+ - If there are more than 12 candidate files, ask the user to narrow scope before spawning children.
31
+
32
+ ## Child task contract
33
+
34
+ Before spawning, the parent must give each child:
35
+
36
+ - A role.
37
+ - Exact paths or one narrow directory.
38
+ - A clear stop condition.
39
+ - A small output budget.
40
+ - A requirement to report status, blockers, and a concise summary.
41
+
42
+ Child instructions must say:
43
+
44
+ - Make one diagnostic attempt after a missing path or failed tool call, then stop and report the blocker.
45
+ - Do not retry the same tool call with the same arguments.
46
+ - Do not call a `glob` tool. This runtime does not provide one; use `ls`, `find`, `read`, or a bounded `bash` command when needed.
47
+ - Do not scan parent directories outside the assigned scope.
48
+ - Do not include full tool traces in the final answer.
49
+
50
+ ## Parent reporting
51
+
52
+ After children finish, report only:
53
+
54
+ - Child task id.
55
+ - Child role.
56
+ - Child status.
57
+ - Concise child summary.
58
+ - Any blocker or guardrail status.
59
+
60
+ If a child hits a guardrail or cancellation, report it and stop. Do not retry automatically.
61
+
62
+ Do not compensate for child failure by directly scanning the remaining parent scope. Report the child status and ask the user for the next step.
63
+
64
+ Do not carry this workflow into the next user message. A completed child result is not permission to call more subagent tools later.