@codeam/shared 2.75.3 → 2.75.5

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.js CHANGED
@@ -34,12 +34,6 @@ __export(index_exports, {
34
34
  GUARDRAIL_CONFIGURE_COMMAND: () => GUARDRAIL_CONFIGURE_COMMAND,
35
35
  GUARDRAIL_DISPOSITIONS: () => GUARDRAIL_DISPOSITIONS,
36
36
  HANDOFF_FENCE_TAG: () => HANDOFF_FENCE_TAG,
37
- HEADROOM_BACKEND_ENV: () => HEADROOM_BACKEND_ENV,
38
- HEADROOM_EXTRAS_BY_SURFACE: () => HEADROOM_EXTRAS_BY_SURFACE,
39
- HEADROOM_MODELS: () => HEADROOM_MODELS,
40
- HEADROOM_PIP_COMPANIONS: () => HEADROOM_PIP_COMPANIONS,
41
- HEADROOM_PROXY_PORT: () => HEADROOM_PROXY_PORT,
42
- HEADROOM_USAGE_COMMAND: () => HEADROOM_USAGE_COMMAND,
43
37
  HEARTBEAT_INTERVAL_MS_DEFAULT: () => HEARTBEAT_INTERVAL_MS_DEFAULT,
44
38
  HOUSE_AGENT_ID: () => HOUSE_AGENT_ID,
45
39
  HOUSE_AGENT_NAME: () => HOUSE_AGENT_NAME,
@@ -96,14 +90,9 @@ __export(index_exports, {
96
90
  getPackDefinition: () => getPackDefinition,
97
91
  getPricing: () => getPricing,
98
92
  getSkillDefinition: () => getSkillDefinition,
99
- headroomKindFor: () => headroomKindFor,
100
- headroomModelPredownloadScript: () => headroomModelPredownloadScript,
101
- headroomPipPackage: () => headroomPipPackage,
102
- headroomSnapshotDownloadLine: () => headroomSnapshotDownloadLine,
103
93
  installableAgentIds: () => installableAgentIds,
104
94
  internalToPublic: () => internalToPublic,
105
95
  isGuardrailDisposition: () => isGuardrailDisposition,
106
- isHeadroomWrappable: () => isHeadroomWrappable,
107
96
  isKnownAgentId: () => isKnownAgentId,
108
97
  isKnownIntegrationId: () => isKnownIntegrationId,
109
98
  isKnownModel: () => isKnownModel,
@@ -356,8 +345,6 @@ var AGENT_REGISTRY = {
356
345
  // `claude setup-token` → delivered via CLAUDE_CODE_OAUTH_TOKEN.
357
346
  supportedAuthKinds: ["setup_token", "oauth_token", "api_key"],
358
347
  preferredAuthKind: "setup_token",
359
- headroomWrappable: true,
360
- headroomKind: "claude",
361
348
  // npm adapter `@agentclientprotocol/claude-agent-acp`.
362
349
  acp: true
363
350
  },
@@ -368,8 +355,6 @@ var AGENT_REGISTRY = {
368
355
  enabled: true,
369
356
  supportedAuthKinds: ["oauth_token", "api_key"],
370
357
  preferredAuthKind: "oauth_token",
371
- headroomWrappable: true,
372
- headroomKind: "codex",
373
358
  // npm adapter `@agentclientprotocol/codex-acp`.
374
359
  acp: true,
375
360
  // OAuth device-code flow; the user_code on the OpenAI page IS a real
@@ -384,10 +369,7 @@ var AGENT_REGISTRY = {
384
369
  enabled: false,
385
370
  supportedAuthKinds: ["oauth_token"],
386
371
  preferredAuthKind: "oauth_token",
387
- // `headroom init --global copilot` exists even though the agent is
388
372
  // still disabled here (no runtime builder yet).
389
- headroomWrappable: true,
390
- headroomKind: "copilot",
391
373
  acp: false
392
374
  },
393
375
  coderabbit: {
@@ -403,7 +385,6 @@ var AGENT_REGISTRY = {
403
385
  // user's own machine, so linking is always CLI-mediated.
404
386
  supportedAuthKinds: ["oauth_token", "api_key"],
405
387
  preferredAuthKind: "oauth_token",
406
- headroomWrappable: false,
407
388
  // Legacy PTY runtime — no ACP adapter registered.
408
389
  acp: false
409
390
  },
@@ -419,9 +400,7 @@ var AGENT_REGISTRY = {
419
400
  // no longer offers api_key.
420
401
  supportedAuthKinds: ["oauth_token"],
421
402
  preferredAuthKind: "oauth_token",
422
- // `headroom wrap cursor` is "manual/print-only" (IDE settings; the
423
403
  // headless cursor-agent CLI has no base-URL override) — runs native.
424
- headroomWrappable: false,
425
404
  // Native ACP server: `cursor-agent acp`.
426
405
  acp: true,
427
406
  // Reverse-engineered device/poll flow; `userCode` is the secret PKCE
@@ -439,7 +418,6 @@ var AGENT_REGISTRY = {
439
418
  // this via the existing --api-key escape hatch in commands/link.ts.
440
419
  supportedAuthKinds: ["api_key"],
441
420
  preferredAuthKind: "api_key",
442
- headroomWrappable: false,
443
421
  // Legacy PTY runtime — no ACP adapter registered.
444
422
  acp: false
445
423
  },
@@ -476,8 +454,6 @@ var AGENT_REGISTRY = {
476
454
  // provider, where the ineligible-tier message already explains why.
477
455
  supportedAuthKinds: ["api_key"],
478
456
  preferredAuthKind: "api_key",
479
- // Not listed by `headroom wrap --help` — runs native.
480
- headroomWrappable: false,
481
457
  // Native ACP server: `gemini --skip-trust --acp`.
482
458
  acp: true
483
459
  },
@@ -493,8 +469,6 @@ var AGENT_REGISTRY = {
493
469
  // that blob server-side is a separate reverse-engineering spike (phase 2).
494
470
  supportedAuthKinds: ["api_key", "oauth_token"],
495
471
  preferredAuthKind: "api_key",
496
- // Moonshot's `kimi` is not listed by `headroom wrap --help` — runs native.
497
- headroomWrappable: false,
498
472
  // Native ACP server: `kimi acp` (stdio JSON-RPC, answers `initialize`).
499
473
  acp: true
500
474
  },
@@ -509,8 +483,6 @@ var AGENT_REGISTRY = {
509
483
  // the matching env var (detected by prefix) at deploy. api_key only.
510
484
  supportedAuthKinds: ["api_key"],
511
485
  preferredAuthKind: "api_key",
512
- // Not listed by `headroom init --global` (claude/codex/copilot only) — native.
513
- headroomWrappable: false,
514
486
  // Native ACP server: `opencode acp` (stdio JSON-RPC).
515
487
  acp: true
516
488
  }
@@ -642,19 +614,6 @@ function normalizeAgentId(raw) {
642
614
  if (isKnownAgentId(unprefixed)) return unprefixed;
643
615
  return AGENT_ID_ALIASES[unprefixed] ?? null;
644
616
  }
645
- function headroomKindFor(agentId) {
646
- const normalized = (agentId ?? "").toLowerCase().replace(/[_-]/g, "");
647
- if (!normalized) return null;
648
- for (const meta of Object.values(AGENT_REGISTRY)) {
649
- if (meta.headroomKind !== void 0 && normalized.startsWith(meta.id)) {
650
- return meta.headroomKind;
651
- }
652
- }
653
- return null;
654
- }
655
- function isHeadroomWrappable(agentId) {
656
- return headroomKindFor(agentId) !== null;
657
- }
658
617
 
659
618
  // src/agents/install-snippets.ts
660
619
  var CODEX = `
@@ -2657,6 +2616,26 @@ var AGENT_STANDARD_TEXT = `# Working standard
2657
2616
 
2658
2617
  You are an AI coding agent working on the user's project through CodeAgent Mobile. Follow this standard on every task.
2659
2618
 
2619
+ ## How to answer \u2014 you are being read on a PHONE
2620
+
2621
+ Your reply is read on a narrow screen, often one-handed, often while the user is doing something else. Length is a cost they pay. Write accordingly.
2622
+
2623
+ - **Lead with the answer.** First line = the result, the decision, or what changed. No preamble, no restating the request, no "Great question!", no narrating what you are about to do.
2624
+ - **Default to a few sentences.** Most replies fit in 1-2 short paragraphs or 3-6 tight bullets. A long reply is a deliberate choice you make because the task genuinely needs it \u2014 not the default.
2625
+ - **Say it once.** No summary of the summary, no closing paragraph that repeats the opening, no "let me know if you need anything else".
2626
+ - **Cut every word that carries no information** \u2014 hedges, filler adverbs, throat-clearing, and praise for the question.
2627
+ - **Expand when asked.** "Explain in detail", "walk me through it", "why?" are requests for depth: give it fully. Brevity is the default, not a ceiling.
2628
+
2629
+ **Formatting for a narrow screen:**
2630
+ - Short paragraphs (1-3 sentences). Bullets over prose for anything that is a list. Never a wall of text.
2631
+ - **No wide tables** \u2014 they force horizontal scrolling and become unreadable. Use bullets, or at most two columns.
2632
+ - Code blocks only when the user needs the exact characters (a command to run, the changed lines). Show the relevant lines, not the whole file. Keep lines short so they don't wrap badly.
2633
+ - File references as \`path/to/file.ts:42\`, not pasted paths inside long prose.
2634
+ - Bold sparingly, for the one thing that matters in a block. Headings only when the reply genuinely has multiple sections.
2635
+ - No ASCII art, no banners, no decorative separators, no emoji unless the user uses them first.
2636
+
2637
+ **Compress evidence, don't drop it.** Report the outcome, not the transcript: "tests: 128/128 green", "build failed \u2014 \`TS2322\` in \`api/client.ts:80\`". Paste raw output only when the user needs to read it themselves, and only the relevant lines.
2638
+
2660
2639
  ## How to work
2661
2640
  - **Understand before acting.** Restate the goal, read the relevant code, and be clear on what "done" looks like before changing anything.
2662
2641
  - **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.
@@ -2886,9 +2865,6 @@ function resolveApiBaseUrl() {
2886
2865
  return DEFAULT_API_BASE_URL;
2887
2866
  }
2888
2867
 
2889
- // src/types/headroom.ts
2890
- var HEADROOM_USAGE_COMMAND = "headroom_usage";
2891
-
2892
2868
  // src/types/agent-switch.ts
2893
2869
  var SWITCH_AGENT_COMMAND = "switch_agent";
2894
2870
 
@@ -2912,48 +2888,6 @@ var SQUAD_SPECIALTIES = {
2912
2888
  opencode: "general implementation tasks"
2913
2889
  };
2914
2890
 
2915
- // src/headroom/manifest.ts
2916
- var HEADROOM_PROXY_PORT = 8787;
2917
- var HEADROOM_BACKEND_ENV = {
2918
- HEADROOM_KOMPRESS_BACKEND: "onnx_cpu"
2919
- };
2920
- var HEADROOM_PIP_COMPANIONS = [
2921
- "fastapi",
2922
- "uvicorn",
2923
- "httpx[http2]",
2924
- "websockets",
2925
- "zstandard"
2926
- ];
2927
- var HEADROOM_EXTRAS_BY_SURFACE = {
2928
- codespace: ["proxy", "code"],
2929
- selfHosted: ["proxy", "code"],
2930
- onDemand: ["proxy", "code", "image"]
2931
- };
2932
- function headroomPipPackage(extras) {
2933
- return `headroom-ai[${extras.join(",")}]`;
2934
- }
2935
- var HEADROOM_MODELS = [
2936
- {
2937
- repo: "chopratejas/kompress-v2-base",
2938
- allowPatterns: ["*.json", "onnx/*.onnx", "kompress-int8-wo.onnx"]
2939
- },
2940
- {
2941
- repo: "answerdotai/ModernBERT-base",
2942
- allowPatterns: ["*.json", "tokenizer*", "*.txt", "vocab*", "merges*"]
2943
- }
2944
- ];
2945
- function headroomSnapshotDownloadLine(model, opts = {}) {
2946
- const sep = opts.spaceAfterComma ? ", " : ",";
2947
- const patterns = model.allowPatterns.map((p) => `"${p}"`).join(sep);
2948
- return `snapshot_download("${model.repo}", allow_patterns=[${patterns}])`;
2949
- }
2950
- function headroomModelPredownloadScript(opts = {}) {
2951
- return [
2952
- "from huggingface_hub import snapshot_download",
2953
- ...HEADROOM_MODELS.map((m) => headroomSnapshotDownloadLine(m, opts))
2954
- ].join("\n");
2955
- }
2956
-
2957
2891
  // src/types/events.ts
2958
2892
  var USER_EVENTS = {
2959
2893
  PAIRED_SESSION_STATUS: "paired_session_status",
@@ -2985,7 +2919,6 @@ var USER_EVENTS = {
2985
2919
  CREDENTIAL_INVALID: "credential_invalid",
2986
2920
  CODESPACE_WAKING: "codespace_waking",
2987
2921
  CODESPACE_BILLING_BLOCKED: "codespace_billing_blocked",
2988
- COST_SAVING_UPDATED: "cost_saving_updated",
2989
2922
  COMMAND_COMPLETED: "command_completed",
2990
2923
  AI_SUMMARY_PENDING: "ai_summary_pending",
2991
2924
  AI_SUMMARY_READY: "ai_summary_ready",
@@ -3027,10 +2960,7 @@ var USER_EVENTS = {
3027
2960
  * a box never creates. */
3028
2961
  FLEET_BOX_READY: "fleet_box_ready",
3029
2962
  REFERRAL_REWARD_EARNED: "referral_reward_earned",
3030
- HEADROOM_PROGRESS: "headroom_progress",
3031
- HEADROOM_STATUS: "headroom_status",
3032
2963
  BEADS_STATUS: "beads_status",
3033
- LINKED_AGENT_HEADROOM_BUDGET_UPDATED: "linked_agent_headroom_budget_updated",
3034
2964
  CLI_UPDATE_AVAILABLE: "cli_update_available",
3035
2965
  AGENT_INSTALL_PROGRESS: "agent_install_progress",
3036
2966
  AGENT_INSTALL_FAILED: "agent_install_failed",
@@ -3080,7 +3010,15 @@ var USER_EVENTS = {
3080
3010
  * balance, so nothing has to be fetched to render it. ⚠️ NOT published on
3081
3011
  * debits: those are one per agent hop, and the client already walks its
3082
3012
  * own balance down as metered usage streams in. */
3083
- CREDITS_CHANGED: "credits_changed"
3013
+ CREDITS_CHANGED: "credits_changed",
3014
+ /** La recarga automatica NO se hizo, y el motivo significa algo para el
3015
+ * usuario (enfriamiento, tope diario o mensual, pausada, apagada).
3016
+ * ⚠️ Existe porque antes el saldo llegaba a cero EN SILENCIO: la sesion se
3017
+ * paraba y no habia una sola pista de por que no se habia recargado sola
3018
+ * (2026-09-17). Los motivos internos —`duplicate_intent` y compañia— no se
3019
+ * publican: no dicen nada a quien los lee. El CLI no lo consume; vive aqui
3020
+ * porque este fichero es la fuente del espejo que valida `shared-type-drift`. */
3021
+ AUTO_RECHARGE_BLOCKED: "auto_recharge_blocked"
3084
3022
  };
3085
3023
 
3086
3024
  // src/preview-prompts.ts
@@ -3145,12 +3083,6 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
3145
3083
  GUARDRAIL_CONFIGURE_COMMAND,
3146
3084
  GUARDRAIL_DISPOSITIONS,
3147
3085
  HANDOFF_FENCE_TAG,
3148
- HEADROOM_BACKEND_ENV,
3149
- HEADROOM_EXTRAS_BY_SURFACE,
3150
- HEADROOM_MODELS,
3151
- HEADROOM_PIP_COMPANIONS,
3152
- HEADROOM_PROXY_PORT,
3153
- HEADROOM_USAGE_COMMAND,
3154
3086
  HEARTBEAT_INTERVAL_MS_DEFAULT,
3155
3087
  HOUSE_AGENT_ID,
3156
3088
  HOUSE_AGENT_NAME,
@@ -3207,14 +3139,9 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
3207
3139
  getPackDefinition,
3208
3140
  getPricing,
3209
3141
  getSkillDefinition,
3210
- headroomKindFor,
3211
- headroomModelPredownloadScript,
3212
- headroomPipPackage,
3213
- headroomSnapshotDownloadLine,
3214
3142
  installableAgentIds,
3215
3143
  internalToPublic,
3216
3144
  isGuardrailDisposition,
3217
- isHeadroomWrappable,
3218
3145
  isKnownAgentId,
3219
3146
  isKnownIntegrationId,
3220
3147
  isKnownModel,