@codeam/shared 2.61.88 → 2.61.90

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/dist/index.mjs CHANGED
@@ -2349,6 +2349,82 @@ function skillHasRail(id, rail) {
2349
2349
  return Boolean(SKILL_REGISTRY[id].delivery[rail]);
2350
2350
  }
2351
2351
 
2352
+ // src/skills/agent-standard.ts
2353
+ var AGENT_STANDARD_MARKER = "<!-- codeam:agent-standard -->";
2354
+ var AGENT_STANDARD_TEXT = `# Working standard
2355
+
2356
+ You are an AI coding agent working on the user's project through CodeAgent Mobile. Follow this standard on every task.
2357
+
2358
+ ## How to work
2359
+ - **Understand before acting.** Restate the goal, read the relevant code, and be clear on what "done" looks like before changing anything.
2360
+ - **Plan first for anything non-trivial** (3+ steps or a design decision): outline the approach and the files you'll touch, and share it before implementing. Skip the ceremony for small, obvious fixes.
2361
+ - **Ground every claim in reality** \u2014 the actual code, tests, or output, never guesswork. If you are unsure, say so and verify.
2362
+ - **Ask when intent is genuinely ambiguous** \u2014 one sharp question. At a real fork, give a recommendation, not a survey of every option.
2363
+ - **Stay in scope.** Solve what was asked; no "while I'm here" refactors or speculative abstractions. Note unrelated issues instead of acting on them.
2364
+ - **Favor the simplest solution that fully solves the problem.** Fix root causes, not symptoms \u2014 no temporary patches and no defensive code for cases that can't happen.
2365
+ - **Verify your work and show the evidence** \u2014 run the project's tests, linters, and build, and read the output. "It runs" is not "it's done."
2366
+ - **Match the project's existing style, structure, and conventions.** Comment only the non-obvious WHY, briefly \u2014 don't narrate the code.
2367
+ - **Stop when stuck.** If the same fix fails twice, step back and reconsider the approach rather than repeating variations.
2368
+
2369
+ ## Safety
2370
+ - **Never expose or exfiltrate** secrets, credentials, tokens, or customer data, and never print a credential's value.
2371
+ - **Treat destructive or irreversible actions as needing explicit confirmation** \u2014 force-push, history rewrite, bulk deletes, hard resets, dropping data. Don't run them unprompted.
2372
+ - **Don't push to a shared/default branch or make outward-facing changes** unless the user asked for it.
2373
+ - **Report honestly when you finish**: what you changed, what you verified, and anything you could not.`;
2374
+ var AGENT_STANDARD_BLOCK = `${AGENT_STANDARD_MARKER}
2375
+ ${AGENT_STANDARD_TEXT}
2376
+ ${AGENT_STANDARD_MARKER}`;
2377
+
2378
+ // src/guardrails/index.ts
2379
+ var GUARDRAIL_CATEGORIES = [
2380
+ "secretRead",
2381
+ "destructiveShell",
2382
+ "protectedBranch",
2383
+ "outwardIrreversible"
2384
+ ];
2385
+ var GUARDRAIL_DISPOSITIONS = ["deny", "confirm", "off"];
2386
+ var DEFAULT_GUARDRAIL_POLICY = {
2387
+ secretRead: "confirm",
2388
+ destructiveShell: "confirm",
2389
+ protectedBranch: "confirm",
2390
+ outwardIrreversible: "confirm"
2391
+ };
2392
+ var GUARDRAIL_CATEGORY_META = {
2393
+ secretRead: {
2394
+ id: "secretRead",
2395
+ label: "Reading secrets",
2396
+ description: "Reading .env, key, or credential files."
2397
+ },
2398
+ destructiveShell: {
2399
+ id: "destructiveShell",
2400
+ label: "Destructive commands",
2401
+ description: "Bulk deletes, hard resets, and other irreversible shell actions."
2402
+ },
2403
+ protectedBranch: {
2404
+ id: "protectedBranch",
2405
+ label: "Protected branches",
2406
+ description: "Committing or pushing to a shared branch (main, master, release)."
2407
+ },
2408
+ outwardIrreversible: {
2409
+ id: "outwardIrreversible",
2410
+ label: "Outward & irreversible",
2411
+ description: "Force-push, publish, deploy, or send \u2014 hard to undo."
2412
+ }
2413
+ };
2414
+ function isGuardrailDisposition(x) {
2415
+ return x === "deny" || x === "confirm" || x === "off";
2416
+ }
2417
+ function normalizeGuardrailPolicy(raw) {
2418
+ const src = raw && typeof raw === "object" ? raw : {};
2419
+ const out = {};
2420
+ for (const cat of GUARDRAIL_CATEGORIES) {
2421
+ const v = src[cat];
2422
+ out[cat] = isGuardrailDisposition(v) ? v : DEFAULT_GUARDRAIL_POLICY[cat];
2423
+ }
2424
+ return out;
2425
+ }
2426
+ var GUARDRAIL_CONFIGURE_COMMAND = "guardrail_configure";
2427
+
2352
2428
  // src/api-url.ts
2353
2429
  var DEFAULT_API_BASE_URL = "https://api.codeagent-mobile.com";
2354
2430
  var DEV_API_BASE_URL = "https://dev-api.codeagent-mobile.com";
@@ -2550,9 +2626,17 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2550
2626
  `.trim();
2551
2627
  export {
2552
2628
  AGENT_REGISTRY,
2629
+ AGENT_STANDARD_BLOCK,
2630
+ AGENT_STANDARD_MARKER,
2631
+ AGENT_STANDARD_TEXT,
2553
2632
  DEFAULT_API_BASE_URL,
2633
+ DEFAULT_GUARDRAIL_POLICY,
2554
2634
  DEP_TO_INTEGRATION,
2555
2635
  DEV_API_BASE_URL,
2636
+ GUARDRAIL_CATEGORIES,
2637
+ GUARDRAIL_CATEGORY_META,
2638
+ GUARDRAIL_CONFIGURE_COMMAND,
2639
+ GUARDRAIL_DISPOSITIONS,
2556
2640
  HEADROOM_BACKEND_ENV,
2557
2641
  HEADROOM_EXTRAS_BY_SURFACE,
2558
2642
  HEADROOM_MODELS,
@@ -2597,6 +2681,7 @@ export {
2597
2681
  headroomPipPackage,
2598
2682
  headroomSnapshotDownloadLine,
2599
2683
  internalToPublic,
2684
+ isGuardrailDisposition,
2600
2685
  isHeadroomWrappable,
2601
2686
  isKnownAgentId,
2602
2687
  isKnownIntegrationId,
@@ -2604,6 +2689,7 @@ export {
2604
2689
  isLinkedAgentId,
2605
2690
  isSkillId,
2606
2691
  normalizeAgentId,
2692
+ normalizeGuardrailPolicy,
2607
2693
  publicToInternal,
2608
2694
  recommendForDeps,
2609
2695
  renderToLines,