@codeam/shared 2.75.4 → 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 +9 -272
- package/dist/index.d.ts +9 -272
- package/dist/index.js +9 -102
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -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 = `
|
|
@@ -2780,9 +2750,6 @@ function resolveApiBaseUrl() {
|
|
|
2780
2750
|
return DEFAULT_API_BASE_URL;
|
|
2781
2751
|
}
|
|
2782
2752
|
|
|
2783
|
-
// src/types/headroom.ts
|
|
2784
|
-
var HEADROOM_USAGE_COMMAND = "headroom_usage";
|
|
2785
|
-
|
|
2786
2753
|
// src/types/agent-switch.ts
|
|
2787
2754
|
var SWITCH_AGENT_COMMAND = "switch_agent";
|
|
2788
2755
|
|
|
@@ -2806,48 +2773,6 @@ var SQUAD_SPECIALTIES = {
|
|
|
2806
2773
|
opencode: "general implementation tasks"
|
|
2807
2774
|
};
|
|
2808
2775
|
|
|
2809
|
-
// src/headroom/manifest.ts
|
|
2810
|
-
var HEADROOM_PROXY_PORT = 8787;
|
|
2811
|
-
var HEADROOM_BACKEND_ENV = {
|
|
2812
|
-
HEADROOM_KOMPRESS_BACKEND: "onnx_cpu"
|
|
2813
|
-
};
|
|
2814
|
-
var HEADROOM_PIP_COMPANIONS = [
|
|
2815
|
-
"fastapi",
|
|
2816
|
-
"uvicorn",
|
|
2817
|
-
"httpx[http2]",
|
|
2818
|
-
"websockets",
|
|
2819
|
-
"zstandard"
|
|
2820
|
-
];
|
|
2821
|
-
var HEADROOM_EXTRAS_BY_SURFACE = {
|
|
2822
|
-
codespace: ["proxy", "code"],
|
|
2823
|
-
selfHosted: ["proxy", "code"],
|
|
2824
|
-
onDemand: ["proxy", "code", "image"]
|
|
2825
|
-
};
|
|
2826
|
-
function headroomPipPackage(extras) {
|
|
2827
|
-
return `headroom-ai[${extras.join(",")}]`;
|
|
2828
|
-
}
|
|
2829
|
-
var HEADROOM_MODELS = [
|
|
2830
|
-
{
|
|
2831
|
-
repo: "chopratejas/kompress-v2-base",
|
|
2832
|
-
allowPatterns: ["*.json", "onnx/*.onnx", "kompress-int8-wo.onnx"]
|
|
2833
|
-
},
|
|
2834
|
-
{
|
|
2835
|
-
repo: "answerdotai/ModernBERT-base",
|
|
2836
|
-
allowPatterns: ["*.json", "tokenizer*", "*.txt", "vocab*", "merges*"]
|
|
2837
|
-
}
|
|
2838
|
-
];
|
|
2839
|
-
function headroomSnapshotDownloadLine(model, opts = {}) {
|
|
2840
|
-
const sep = opts.spaceAfterComma ? ", " : ",";
|
|
2841
|
-
const patterns = model.allowPatterns.map((p) => `"${p}"`).join(sep);
|
|
2842
|
-
return `snapshot_download("${model.repo}", allow_patterns=[${patterns}])`;
|
|
2843
|
-
}
|
|
2844
|
-
function headroomModelPredownloadScript(opts = {}) {
|
|
2845
|
-
return [
|
|
2846
|
-
"from huggingface_hub import snapshot_download",
|
|
2847
|
-
...HEADROOM_MODELS.map((m) => headroomSnapshotDownloadLine(m, opts))
|
|
2848
|
-
].join("\n");
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
2776
|
// src/types/events.ts
|
|
2852
2777
|
var USER_EVENTS = {
|
|
2853
2778
|
PAIRED_SESSION_STATUS: "paired_session_status",
|
|
@@ -2879,7 +2804,6 @@ var USER_EVENTS = {
|
|
|
2879
2804
|
CREDENTIAL_INVALID: "credential_invalid",
|
|
2880
2805
|
CODESPACE_WAKING: "codespace_waking",
|
|
2881
2806
|
CODESPACE_BILLING_BLOCKED: "codespace_billing_blocked",
|
|
2882
|
-
COST_SAVING_UPDATED: "cost_saving_updated",
|
|
2883
2807
|
COMMAND_COMPLETED: "command_completed",
|
|
2884
2808
|
AI_SUMMARY_PENDING: "ai_summary_pending",
|
|
2885
2809
|
AI_SUMMARY_READY: "ai_summary_ready",
|
|
@@ -2921,10 +2845,7 @@ var USER_EVENTS = {
|
|
|
2921
2845
|
* a box never creates. */
|
|
2922
2846
|
FLEET_BOX_READY: "fleet_box_ready",
|
|
2923
2847
|
REFERRAL_REWARD_EARNED: "referral_reward_earned",
|
|
2924
|
-
HEADROOM_PROGRESS: "headroom_progress",
|
|
2925
|
-
HEADROOM_STATUS: "headroom_status",
|
|
2926
2848
|
BEADS_STATUS: "beads_status",
|
|
2927
|
-
LINKED_AGENT_HEADROOM_BUDGET_UPDATED: "linked_agent_headroom_budget_updated",
|
|
2928
2849
|
CLI_UPDATE_AVAILABLE: "cli_update_available",
|
|
2929
2850
|
AGENT_INSTALL_PROGRESS: "agent_install_progress",
|
|
2930
2851
|
AGENT_INSTALL_FAILED: "agent_install_failed",
|
|
@@ -2974,7 +2895,15 @@ var USER_EVENTS = {
|
|
|
2974
2895
|
* balance, so nothing has to be fetched to render it. ⚠️ NOT published on
|
|
2975
2896
|
* debits: those are one per agent hop, and the client already walks its
|
|
2976
2897
|
* own balance down as metered usage streams in. */
|
|
2977
|
-
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"
|
|
2978
2907
|
};
|
|
2979
2908
|
|
|
2980
2909
|
// src/preview-prompts.ts
|
|
@@ -3038,12 +2967,6 @@ export {
|
|
|
3038
2967
|
GUARDRAIL_CONFIGURE_COMMAND,
|
|
3039
2968
|
GUARDRAIL_DISPOSITIONS,
|
|
3040
2969
|
HANDOFF_FENCE_TAG,
|
|
3041
|
-
HEADROOM_BACKEND_ENV,
|
|
3042
|
-
HEADROOM_EXTRAS_BY_SURFACE,
|
|
3043
|
-
HEADROOM_MODELS,
|
|
3044
|
-
HEADROOM_PIP_COMPANIONS,
|
|
3045
|
-
HEADROOM_PROXY_PORT,
|
|
3046
|
-
HEADROOM_USAGE_COMMAND,
|
|
3047
2970
|
HEARTBEAT_INTERVAL_MS_DEFAULT,
|
|
3048
2971
|
HOUSE_AGENT_ID,
|
|
3049
2972
|
HOUSE_AGENT_NAME,
|
|
@@ -3100,14 +3023,9 @@ export {
|
|
|
3100
3023
|
getPackDefinition,
|
|
3101
3024
|
getPricing,
|
|
3102
3025
|
getSkillDefinition,
|
|
3103
|
-
headroomKindFor,
|
|
3104
|
-
headroomModelPredownloadScript,
|
|
3105
|
-
headroomPipPackage,
|
|
3106
|
-
headroomSnapshotDownloadLine,
|
|
3107
3026
|
installableAgentIds,
|
|
3108
3027
|
internalToPublic,
|
|
3109
3028
|
isGuardrailDisposition,
|
|
3110
|
-
isHeadroomWrappable,
|
|
3111
3029
|
isKnownAgentId,
|
|
3112
3030
|
isKnownIntegrationId,
|
|
3113
3031
|
isKnownModel,
|