@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.d.mts +20 -274
- package/dist/index.d.ts +20 -274
- package/dist/index.js +29 -102
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -91
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -230,8 +230,6 @@ var AGENT_REGISTRY = {
|
|
|
230
230
|
// `claude setup-token` → delivered via CLAUDE_CODE_OAUTH_TOKEN.
|
|
231
231
|
supportedAuthKinds: ["setup_token", "oauth_token", "api_key"],
|
|
232
232
|
preferredAuthKind: "setup_token",
|
|
233
|
-
headroomWrappable: true,
|
|
234
|
-
headroomKind: "claude",
|
|
235
233
|
// npm adapter `@agentclientprotocol/claude-agent-acp`.
|
|
236
234
|
acp: true
|
|
237
235
|
},
|
|
@@ -242,8 +240,6 @@ var AGENT_REGISTRY = {
|
|
|
242
240
|
enabled: true,
|
|
243
241
|
supportedAuthKinds: ["oauth_token", "api_key"],
|
|
244
242
|
preferredAuthKind: "oauth_token",
|
|
245
|
-
headroomWrappable: true,
|
|
246
|
-
headroomKind: "codex",
|
|
247
243
|
// npm adapter `@agentclientprotocol/codex-acp`.
|
|
248
244
|
acp: true,
|
|
249
245
|
// OAuth device-code flow; the user_code on the OpenAI page IS a real
|
|
@@ -258,10 +254,7 @@ var AGENT_REGISTRY = {
|
|
|
258
254
|
enabled: false,
|
|
259
255
|
supportedAuthKinds: ["oauth_token"],
|
|
260
256
|
preferredAuthKind: "oauth_token",
|
|
261
|
-
// `headroom init --global copilot` exists even though the agent is
|
|
262
257
|
// still disabled here (no runtime builder yet).
|
|
263
|
-
headroomWrappable: true,
|
|
264
|
-
headroomKind: "copilot",
|
|
265
258
|
acp: false
|
|
266
259
|
},
|
|
267
260
|
coderabbit: {
|
|
@@ -277,7 +270,6 @@ var AGENT_REGISTRY = {
|
|
|
277
270
|
// user's own machine, so linking is always CLI-mediated.
|
|
278
271
|
supportedAuthKinds: ["oauth_token", "api_key"],
|
|
279
272
|
preferredAuthKind: "oauth_token",
|
|
280
|
-
headroomWrappable: false,
|
|
281
273
|
// Legacy PTY runtime — no ACP adapter registered.
|
|
282
274
|
acp: false
|
|
283
275
|
},
|
|
@@ -293,9 +285,7 @@ var AGENT_REGISTRY = {
|
|
|
293
285
|
// no longer offers api_key.
|
|
294
286
|
supportedAuthKinds: ["oauth_token"],
|
|
295
287
|
preferredAuthKind: "oauth_token",
|
|
296
|
-
// `headroom wrap cursor` is "manual/print-only" (IDE settings; the
|
|
297
288
|
// headless cursor-agent CLI has no base-URL override) — runs native.
|
|
298
|
-
headroomWrappable: false,
|
|
299
289
|
// Native ACP server: `cursor-agent acp`.
|
|
300
290
|
acp: true,
|
|
301
291
|
// Reverse-engineered device/poll flow; `userCode` is the secret PKCE
|
|
@@ -313,7 +303,6 @@ var AGENT_REGISTRY = {
|
|
|
313
303
|
// this via the existing --api-key escape hatch in commands/link.ts.
|
|
314
304
|
supportedAuthKinds: ["api_key"],
|
|
315
305
|
preferredAuthKind: "api_key",
|
|
316
|
-
headroomWrappable: false,
|
|
317
306
|
// Legacy PTY runtime — no ACP adapter registered.
|
|
318
307
|
acp: false
|
|
319
308
|
},
|
|
@@ -350,8 +339,6 @@ var AGENT_REGISTRY = {
|
|
|
350
339
|
// provider, where the ineligible-tier message already explains why.
|
|
351
340
|
supportedAuthKinds: ["api_key"],
|
|
352
341
|
preferredAuthKind: "api_key",
|
|
353
|
-
// Not listed by `headroom wrap --help` — runs native.
|
|
354
|
-
headroomWrappable: false,
|
|
355
342
|
// Native ACP server: `gemini --skip-trust --acp`.
|
|
356
343
|
acp: true
|
|
357
344
|
},
|
|
@@ -367,8 +354,6 @@ var AGENT_REGISTRY = {
|
|
|
367
354
|
// that blob server-side is a separate reverse-engineering spike (phase 2).
|
|
368
355
|
supportedAuthKinds: ["api_key", "oauth_token"],
|
|
369
356
|
preferredAuthKind: "api_key",
|
|
370
|
-
// Moonshot's `kimi` is not listed by `headroom wrap --help` — runs native.
|
|
371
|
-
headroomWrappable: false,
|
|
372
357
|
// Native ACP server: `kimi acp` (stdio JSON-RPC, answers `initialize`).
|
|
373
358
|
acp: true
|
|
374
359
|
},
|
|
@@ -383,8 +368,6 @@ var AGENT_REGISTRY = {
|
|
|
383
368
|
// the matching env var (detected by prefix) at deploy. api_key only.
|
|
384
369
|
supportedAuthKinds: ["api_key"],
|
|
385
370
|
preferredAuthKind: "api_key",
|
|
386
|
-
// Not listed by `headroom init --global` (claude/codex/copilot only) — native.
|
|
387
|
-
headroomWrappable: false,
|
|
388
371
|
// Native ACP server: `opencode acp` (stdio JSON-RPC).
|
|
389
372
|
acp: true
|
|
390
373
|
}
|
|
@@ -516,19 +499,6 @@ function normalizeAgentId(raw) {
|
|
|
516
499
|
if (isKnownAgentId(unprefixed)) return unprefixed;
|
|
517
500
|
return AGENT_ID_ALIASES[unprefixed] ?? null;
|
|
518
501
|
}
|
|
519
|
-
function headroomKindFor(agentId) {
|
|
520
|
-
const normalized = (agentId ?? "").toLowerCase().replace(/[_-]/g, "");
|
|
521
|
-
if (!normalized) return null;
|
|
522
|
-
for (const meta of Object.values(AGENT_REGISTRY)) {
|
|
523
|
-
if (meta.headroomKind !== void 0 && normalized.startsWith(meta.id)) {
|
|
524
|
-
return meta.headroomKind;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
return null;
|
|
528
|
-
}
|
|
529
|
-
function isHeadroomWrappable(agentId) {
|
|
530
|
-
return headroomKindFor(agentId) !== null;
|
|
531
|
-
}
|
|
532
502
|
|
|
533
503
|
// src/agents/install-snippets.ts
|
|
534
504
|
var CODEX = `
|
|
@@ -2531,6 +2501,26 @@ var AGENT_STANDARD_TEXT = `# Working standard
|
|
|
2531
2501
|
|
|
2532
2502
|
You are an AI coding agent working on the user's project through CodeAgent Mobile. Follow this standard on every task.
|
|
2533
2503
|
|
|
2504
|
+
## How to answer \u2014 you are being read on a PHONE
|
|
2505
|
+
|
|
2506
|
+
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.
|
|
2507
|
+
|
|
2508
|
+
- **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.
|
|
2509
|
+
- **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.
|
|
2510
|
+
- **Say it once.** No summary of the summary, no closing paragraph that repeats the opening, no "let me know if you need anything else".
|
|
2511
|
+
- **Cut every word that carries no information** \u2014 hedges, filler adverbs, throat-clearing, and praise for the question.
|
|
2512
|
+
- **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.
|
|
2513
|
+
|
|
2514
|
+
**Formatting for a narrow screen:**
|
|
2515
|
+
- Short paragraphs (1-3 sentences). Bullets over prose for anything that is a list. Never a wall of text.
|
|
2516
|
+
- **No wide tables** \u2014 they force horizontal scrolling and become unreadable. Use bullets, or at most two columns.
|
|
2517
|
+
- 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.
|
|
2518
|
+
- File references as \`path/to/file.ts:42\`, not pasted paths inside long prose.
|
|
2519
|
+
- Bold sparingly, for the one thing that matters in a block. Headings only when the reply genuinely has multiple sections.
|
|
2520
|
+
- No ASCII art, no banners, no decorative separators, no emoji unless the user uses them first.
|
|
2521
|
+
|
|
2522
|
+
**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.
|
|
2523
|
+
|
|
2534
2524
|
## How to work
|
|
2535
2525
|
- **Understand before acting.** Restate the goal, read the relevant code, and be clear on what "done" looks like before changing anything.
|
|
2536
2526
|
- **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.
|
|
@@ -2760,9 +2750,6 @@ function resolveApiBaseUrl() {
|
|
|
2760
2750
|
return DEFAULT_API_BASE_URL;
|
|
2761
2751
|
}
|
|
2762
2752
|
|
|
2763
|
-
// src/types/headroom.ts
|
|
2764
|
-
var HEADROOM_USAGE_COMMAND = "headroom_usage";
|
|
2765
|
-
|
|
2766
2753
|
// src/types/agent-switch.ts
|
|
2767
2754
|
var SWITCH_AGENT_COMMAND = "switch_agent";
|
|
2768
2755
|
|
|
@@ -2786,48 +2773,6 @@ var SQUAD_SPECIALTIES = {
|
|
|
2786
2773
|
opencode: "general implementation tasks"
|
|
2787
2774
|
};
|
|
2788
2775
|
|
|
2789
|
-
// src/headroom/manifest.ts
|
|
2790
|
-
var HEADROOM_PROXY_PORT = 8787;
|
|
2791
|
-
var HEADROOM_BACKEND_ENV = {
|
|
2792
|
-
HEADROOM_KOMPRESS_BACKEND: "onnx_cpu"
|
|
2793
|
-
};
|
|
2794
|
-
var HEADROOM_PIP_COMPANIONS = [
|
|
2795
|
-
"fastapi",
|
|
2796
|
-
"uvicorn",
|
|
2797
|
-
"httpx[http2]",
|
|
2798
|
-
"websockets",
|
|
2799
|
-
"zstandard"
|
|
2800
|
-
];
|
|
2801
|
-
var HEADROOM_EXTRAS_BY_SURFACE = {
|
|
2802
|
-
codespace: ["proxy", "code"],
|
|
2803
|
-
selfHosted: ["proxy", "code"],
|
|
2804
|
-
onDemand: ["proxy", "code", "image"]
|
|
2805
|
-
};
|
|
2806
|
-
function headroomPipPackage(extras) {
|
|
2807
|
-
return `headroom-ai[${extras.join(",")}]`;
|
|
2808
|
-
}
|
|
2809
|
-
var HEADROOM_MODELS = [
|
|
2810
|
-
{
|
|
2811
|
-
repo: "chopratejas/kompress-v2-base",
|
|
2812
|
-
allowPatterns: ["*.json", "onnx/*.onnx", "kompress-int8-wo.onnx"]
|
|
2813
|
-
},
|
|
2814
|
-
{
|
|
2815
|
-
repo: "answerdotai/ModernBERT-base",
|
|
2816
|
-
allowPatterns: ["*.json", "tokenizer*", "*.txt", "vocab*", "merges*"]
|
|
2817
|
-
}
|
|
2818
|
-
];
|
|
2819
|
-
function headroomSnapshotDownloadLine(model, opts = {}) {
|
|
2820
|
-
const sep = opts.spaceAfterComma ? ", " : ",";
|
|
2821
|
-
const patterns = model.allowPatterns.map((p) => `"${p}"`).join(sep);
|
|
2822
|
-
return `snapshot_download("${model.repo}", allow_patterns=[${patterns}])`;
|
|
2823
|
-
}
|
|
2824
|
-
function headroomModelPredownloadScript(opts = {}) {
|
|
2825
|
-
return [
|
|
2826
|
-
"from huggingface_hub import snapshot_download",
|
|
2827
|
-
...HEADROOM_MODELS.map((m) => headroomSnapshotDownloadLine(m, opts))
|
|
2828
|
-
].join("\n");
|
|
2829
|
-
}
|
|
2830
|
-
|
|
2831
2776
|
// src/types/events.ts
|
|
2832
2777
|
var USER_EVENTS = {
|
|
2833
2778
|
PAIRED_SESSION_STATUS: "paired_session_status",
|
|
@@ -2859,7 +2804,6 @@ var USER_EVENTS = {
|
|
|
2859
2804
|
CREDENTIAL_INVALID: "credential_invalid",
|
|
2860
2805
|
CODESPACE_WAKING: "codespace_waking",
|
|
2861
2806
|
CODESPACE_BILLING_BLOCKED: "codespace_billing_blocked",
|
|
2862
|
-
COST_SAVING_UPDATED: "cost_saving_updated",
|
|
2863
2807
|
COMMAND_COMPLETED: "command_completed",
|
|
2864
2808
|
AI_SUMMARY_PENDING: "ai_summary_pending",
|
|
2865
2809
|
AI_SUMMARY_READY: "ai_summary_ready",
|
|
@@ -2901,10 +2845,7 @@ var USER_EVENTS = {
|
|
|
2901
2845
|
* a box never creates. */
|
|
2902
2846
|
FLEET_BOX_READY: "fleet_box_ready",
|
|
2903
2847
|
REFERRAL_REWARD_EARNED: "referral_reward_earned",
|
|
2904
|
-
HEADROOM_PROGRESS: "headroom_progress",
|
|
2905
|
-
HEADROOM_STATUS: "headroom_status",
|
|
2906
2848
|
BEADS_STATUS: "beads_status",
|
|
2907
|
-
LINKED_AGENT_HEADROOM_BUDGET_UPDATED: "linked_agent_headroom_budget_updated",
|
|
2908
2849
|
CLI_UPDATE_AVAILABLE: "cli_update_available",
|
|
2909
2850
|
AGENT_INSTALL_PROGRESS: "agent_install_progress",
|
|
2910
2851
|
AGENT_INSTALL_FAILED: "agent_install_failed",
|
|
@@ -2954,7 +2895,15 @@ var USER_EVENTS = {
|
|
|
2954
2895
|
* balance, so nothing has to be fetched to render it. ⚠️ NOT published on
|
|
2955
2896
|
* debits: those are one per agent hop, and the client already walks its
|
|
2956
2897
|
* own balance down as metered usage streams in. */
|
|
2957
|
-
CREDITS_CHANGED: "credits_changed"
|
|
2898
|
+
CREDITS_CHANGED: "credits_changed",
|
|
2899
|
+
/** La recarga automatica NO se hizo, y el motivo significa algo para el
|
|
2900
|
+
* usuario (enfriamiento, tope diario o mensual, pausada, apagada).
|
|
2901
|
+
* ⚠️ Existe porque antes el saldo llegaba a cero EN SILENCIO: la sesion se
|
|
2902
|
+
* paraba y no habia una sola pista de por que no se habia recargado sola
|
|
2903
|
+
* (2026-09-17). Los motivos internos —`duplicate_intent` y compañia— no se
|
|
2904
|
+
* publican: no dicen nada a quien los lee. El CLI no lo consume; vive aqui
|
|
2905
|
+
* porque este fichero es la fuente del espejo que valida `shared-type-drift`. */
|
|
2906
|
+
AUTO_RECHARGE_BLOCKED: "auto_recharge_blocked"
|
|
2958
2907
|
};
|
|
2959
2908
|
|
|
2960
2909
|
// src/preview-prompts.ts
|
|
@@ -3018,12 +2967,6 @@ export {
|
|
|
3018
2967
|
GUARDRAIL_CONFIGURE_COMMAND,
|
|
3019
2968
|
GUARDRAIL_DISPOSITIONS,
|
|
3020
2969
|
HANDOFF_FENCE_TAG,
|
|
3021
|
-
HEADROOM_BACKEND_ENV,
|
|
3022
|
-
HEADROOM_EXTRAS_BY_SURFACE,
|
|
3023
|
-
HEADROOM_MODELS,
|
|
3024
|
-
HEADROOM_PIP_COMPANIONS,
|
|
3025
|
-
HEADROOM_PROXY_PORT,
|
|
3026
|
-
HEADROOM_USAGE_COMMAND,
|
|
3027
2970
|
HEARTBEAT_INTERVAL_MS_DEFAULT,
|
|
3028
2971
|
HOUSE_AGENT_ID,
|
|
3029
2972
|
HOUSE_AGENT_NAME,
|
|
@@ -3080,14 +3023,9 @@ export {
|
|
|
3080
3023
|
getPackDefinition,
|
|
3081
3024
|
getPricing,
|
|
3082
3025
|
getSkillDefinition,
|
|
3083
|
-
headroomKindFor,
|
|
3084
|
-
headroomModelPredownloadScript,
|
|
3085
|
-
headroomPipPackage,
|
|
3086
|
-
headroomSnapshotDownloadLine,
|
|
3087
3026
|
installableAgentIds,
|
|
3088
3027
|
internalToPublic,
|
|
3089
3028
|
isGuardrailDisposition,
|
|
3090
|
-
isHeadroomWrappable,
|
|
3091
3029
|
isKnownAgentId,
|
|
3092
3030
|
isKnownIntegrationId,
|
|
3093
3031
|
isKnownModel,
|