@slopus/happy-providers 0.0.46 → 0.0.48

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.
Files changed (142) hide show
  1. package/dist/core/ProviderModelCompatibility.d.ts +2 -2
  2. package/dist/core/ProviderModelCompatibility.d.ts.map +1 -1
  3. package/dist/core/ProviderModelCompatibility.js +8 -2
  4. package/dist/core/ProviderModelCompatibility.js.map +1 -1
  5. package/dist/core/SessionProviderError.d.ts +12 -0
  6. package/dist/core/SessionProviderError.d.ts.map +1 -1
  7. package/dist/core/SessionProviderError.js +2 -0
  8. package/dist/core/SessionProviderError.js.map +1 -1
  9. package/dist/core/SessionRunRequest.d.ts +6 -0
  10. package/dist/core/SessionRunRequest.d.ts.map +1 -1
  11. package/dist/core/isNetworkFailure.d.ts +8 -0
  12. package/dist/core/isNetworkFailure.d.ts.map +1 -0
  13. package/dist/core/isNetworkFailure.js +45 -0
  14. package/dist/core/isNetworkFailure.js.map +1 -0
  15. package/dist/core/providerModelFamily.d.ts.map +1 -1
  16. package/dist/core/providerModelFamily.js +4 -0
  17. package/dist/core/providerModelFamily.js.map +1 -1
  18. package/dist/index.d.ts +6 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +5 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/protocol/acp/AcpConnection.d.ts +41 -0
  23. package/dist/protocol/acp/AcpConnection.d.ts.map +1 -0
  24. package/dist/protocol/acp/AcpConnection.js +2 -0
  25. package/dist/protocol/acp/AcpConnection.js.map +1 -0
  26. package/dist/protocol/acp/AcpProvider.d.ts +86 -0
  27. package/dist/protocol/acp/AcpProvider.d.ts.map +1 -0
  28. package/dist/protocol/acp/AcpProvider.js +27 -0
  29. package/dist/protocol/acp/AcpProvider.js.map +1 -0
  30. package/dist/protocol/acp/AcpSession.d.ts +26 -0
  31. package/dist/protocol/acp/AcpSession.d.ts.map +1 -0
  32. package/dist/protocol/acp/AcpSession.js +676 -0
  33. package/dist/protocol/acp/AcpSession.js.map +1 -0
  34. package/dist/protocol/acp/acpDiscoverModels.d.ts +10 -0
  35. package/dist/protocol/acp/acpDiscoverModels.d.ts.map +1 -0
  36. package/dist/protocol/acp/acpDiscoverModels.js +34 -0
  37. package/dist/protocol/acp/acpDiscoverModels.js.map +1 -0
  38. package/dist/protocol/acp/impl/AcpToolBridgeServer.d.ts +37 -0
  39. package/dist/protocol/acp/impl/AcpToolBridgeServer.d.ts.map +1 -0
  40. package/dist/protocol/acp/impl/AcpToolBridgeServer.js +136 -0
  41. package/dist/protocol/acp/impl/AcpToolBridgeServer.js.map +1 -0
  42. package/dist/protocol/acp/impl/AcpTurnQueue.d.ts +10 -0
  43. package/dist/protocol/acp/impl/AcpTurnQueue.d.ts.map +1 -0
  44. package/dist/protocol/acp/impl/AcpTurnQueue.js +26 -0
  45. package/dist/protocol/acp/impl/AcpTurnQueue.js.map +1 -0
  46. package/dist/protocol/acp/impl/acpCompactWithAgent.d.ts +10 -0
  47. package/dist/protocol/acp/impl/acpCompactWithAgent.d.ts.map +1 -0
  48. package/dist/protocol/acp/impl/acpCompactWithAgent.js +69 -0
  49. package/dist/protocol/acp/impl/acpCompactWithAgent.js.map +1 -0
  50. package/dist/protocol/acp/impl/acpConfigOptions.d.ts +22 -0
  51. package/dist/protocol/acp/impl/acpConfigOptions.d.ts.map +1 -0
  52. package/dist/protocol/acp/impl/acpConfigOptions.js +37 -0
  53. package/dist/protocol/acp/impl/acpConfigOptions.js.map +1 -0
  54. package/dist/protocol/acp/impl/acpConnectionSpawn.d.ts +9 -0
  55. package/dist/protocol/acp/impl/acpConnectionSpawn.d.ts.map +1 -0
  56. package/dist/protocol/acp/impl/acpConnectionSpawn.js +64 -0
  57. package/dist/protocol/acp/impl/acpConnectionSpawn.js.map +1 -0
  58. package/dist/protocol/acp/impl/acpPromptFromMessages.d.ts +22 -0
  59. package/dist/protocol/acp/impl/acpPromptFromMessages.d.ts.map +1 -0
  60. package/dist/protocol/acp/impl/acpPromptFromMessages.js +139 -0
  61. package/dist/protocol/acp/impl/acpPromptFromMessages.js.map +1 -0
  62. package/dist/protocol/acp/impl/acpResponseEvents.d.ts +20 -0
  63. package/dist/protocol/acp/impl/acpResponseEvents.d.ts.map +1 -0
  64. package/dist/protocol/acp/impl/acpResponseEvents.js +183 -0
  65. package/dist/protocol/acp/impl/acpResponseEvents.js.map +1 -0
  66. package/dist/protocol/acp/impl/acpSessionStore.d.ts +25 -0
  67. package/dist/protocol/acp/impl/acpSessionStore.d.ts.map +1 -0
  68. package/dist/protocol/acp/impl/acpSessionStore.js +50 -0
  69. package/dist/protocol/acp/impl/acpSessionStore.js.map +1 -0
  70. package/dist/protocol/acp/impl/processTree.d.ts +11 -0
  71. package/dist/protocol/acp/impl/processTree.d.ts.map +1 -0
  72. package/dist/protocol/acp/impl/processTree.js +80 -0
  73. package/dist/protocol/acp/impl/processTree.js.map +1 -0
  74. package/dist/vendors/bedrock/errors/anthropicBedrockErrors.d.ts.map +1 -1
  75. package/dist/vendors/bedrock/errors/anthropicBedrockErrors.js +6 -3
  76. package/dist/vendors/bedrock/errors/anthropicBedrockErrors.js.map +1 -1
  77. package/dist/vendors/claude/impl/auth.d.ts +3 -1
  78. package/dist/vendors/claude/impl/auth.d.ts.map +1 -1
  79. package/dist/vendors/claude/impl/auth.js +9 -6
  80. package/dist/vendors/claude/impl/auth.js.map +1 -1
  81. package/dist/vendors/claude/impl/toClaudeSdkOptions.d.ts.map +1 -1
  82. package/dist/vendors/claude/impl/toClaudeSdkOptions.js +10 -0
  83. package/dist/vendors/claude/impl/toClaudeSdkOptions.js.map +1 -1
  84. package/dist/vendors/claudeAgent/claudeAgentConnect.d.ts +10 -0
  85. package/dist/vendors/claudeAgent/claudeAgentConnect.d.ts.map +1 -0
  86. package/dist/vendors/claudeAgent/claudeAgentConnect.js +347 -0
  87. package/dist/vendors/claudeAgent/claudeAgentConnect.js.map +1 -0
  88. package/dist/vendors/claudeAgent/impl/AsyncInputQueue.d.ts +8 -0
  89. package/dist/vendors/claudeAgent/impl/AsyncInputQueue.d.ts.map +1 -0
  90. package/dist/vendors/claudeAgent/impl/AsyncInputQueue.js +37 -0
  91. package/dist/vendors/claudeAgent/impl/AsyncInputQueue.js.map +1 -0
  92. package/dist/vendors/claudeAgent/impl/claudeAgentUpdates.d.ts +12 -0
  93. package/dist/vendors/claudeAgent/impl/claudeAgentUpdates.d.ts.map +1 -0
  94. package/dist/vendors/claudeAgent/impl/claudeAgentUpdates.js +126 -0
  95. package/dist/vendors/claudeAgent/impl/claudeAgentUpdates.js.map +1 -0
  96. package/dist/vendors/codex/errors/codexErrors.d.ts.map +1 -1
  97. package/dist/vendors/codex/errors/codexErrors.js +8 -4
  98. package/dist/vendors/codex/errors/codexErrors.js.map +1 -1
  99. package/dist/vendors/codexAppServer/codexAppServerConnect.d.ts +11 -0
  100. package/dist/vendors/codexAppServer/codexAppServerConnect.d.ts.map +1 -0
  101. package/dist/vendors/codexAppServer/codexAppServerConnect.js +409 -0
  102. package/dist/vendors/codexAppServer/codexAppServerConnect.js.map +1 -0
  103. package/dist/vendors/codexAppServer/impl/codexItemUpdates.d.ts +10 -0
  104. package/dist/vendors/codexAppServer/impl/codexItemUpdates.d.ts.map +1 -0
  105. package/dist/vendors/codexAppServer/impl/codexItemUpdates.js +113 -0
  106. package/dist/vendors/codexAppServer/impl/codexItemUpdates.js.map +1 -0
  107. package/dist/vendors/codexAppServer/resolveCodexExecutable.d.ts +10 -0
  108. package/dist/vendors/codexAppServer/resolveCodexExecutable.d.ts.map +1 -0
  109. package/dist/vendors/codexAppServer/resolveCodexExecutable.js +61 -0
  110. package/dist/vendors/codexAppServer/resolveCodexExecutable.js.map +1 -0
  111. package/dist/vendors/foreignAgents/ForeignAgent.d.ts +74 -0
  112. package/dist/vendors/foreignAgents/ForeignAgent.d.ts.map +1 -0
  113. package/dist/vendors/foreignAgents/ForeignAgent.js +54 -0
  114. package/dist/vendors/foreignAgents/ForeignAgent.js.map +1 -0
  115. package/dist/vendors/foreignAgents/acpGenericAgent.d.ts +11 -0
  116. package/dist/vendors/foreignAgents/acpGenericAgent.d.ts.map +1 -0
  117. package/dist/vendors/foreignAgents/acpGenericAgent.js +33 -0
  118. package/dist/vendors/foreignAgents/acpGenericAgent.js.map +1 -0
  119. package/dist/vendors/foreignAgents/antigravityAgent.d.ts +11 -0
  120. package/dist/vendors/foreignAgents/antigravityAgent.d.ts.map +1 -0
  121. package/dist/vendors/foreignAgents/antigravityAgent.js +104 -0
  122. package/dist/vendors/foreignAgents/antigravityAgent.js.map +1 -0
  123. package/dist/vendors/foreignAgents/claudeCodeAgent.d.ts +8 -0
  124. package/dist/vendors/foreignAgents/claudeCodeAgent.d.ts.map +1 -0
  125. package/dist/vendors/foreignAgents/claudeCodeAgent.js +71 -0
  126. package/dist/vendors/foreignAgents/claudeCodeAgent.js.map +1 -0
  127. package/dist/vendors/foreignAgents/codexCliAgent.d.ts +10 -0
  128. package/dist/vendors/foreignAgents/codexCliAgent.d.ts.map +1 -0
  129. package/dist/vendors/foreignAgents/codexCliAgent.js +68 -0
  130. package/dist/vendors/foreignAgents/codexCliAgent.js.map +1 -0
  131. package/dist/vendors/foreignAgents/foreignAgents.d.ts +6 -0
  132. package/dist/vendors/foreignAgents/foreignAgents.d.ts.map +1 -0
  133. package/dist/vendors/foreignAgents/foreignAgents.js +17 -0
  134. package/dist/vendors/foreignAgents/foreignAgents.js.map +1 -0
  135. package/dist/vendors/foreignAgents/opencodeAgent.d.ts +8 -0
  136. package/dist/vendors/foreignAgents/opencodeAgent.d.ts.map +1 -0
  137. package/dist/vendors/foreignAgents/opencodeAgent.js +28 -0
  138. package/dist/vendors/foreignAgents/opencodeAgent.js.map +1 -0
  139. package/dist/vendors/grok/errors/grokErrors.d.ts.map +1 -1
  140. package/dist/vendors/grok/errors/grokErrors.js +6 -3
  141. package/dist/vendors/grok/errors/grokErrors.js.map +1 -1
  142. package/package.json +3 -1
@@ -0,0 +1,74 @@
1
+ import type { AcpConnect } from "../../protocol/acp/AcpConnection.js";
2
+ import type { AcpAgentLaunch, AcpAgentProfile } from "../../protocol/acp/AcpProvider.js";
3
+ import type { SessionReasoningEffort } from "../../core/SessionRunRequest.js";
4
+ import type { AcpSelectValue } from "../../protocol/acp/impl/acpConfigOptions.js";
5
+ /**
6
+ * The foreign agents Happy can drive, by harness type: Claude Code and Codex through their own
7
+ * typed APIs; Antigravity, OpenCode, and any other agent through the Agent Client Protocol.
8
+ */
9
+ export type ForeignAgentType = "claude-code" | "codex-cli" | "antigravity" | "opencode" | "acp";
10
+ export declare const FOREIGN_AGENT_TYPES: readonly ForeignAgentType[];
11
+ /**
12
+ * One model a foreign agent serves, under Happy's `<prefix>/<the agent's model value>` ID. The
13
+ * prefix is the agent's type, or `acp/<harness>` for a configured ACP agent.
14
+ */
15
+ export interface ForeignAgentModel {
16
+ readonly id: string;
17
+ readonly name: string;
18
+ readonly effortLevels: readonly SessionReasoningEffort[];
19
+ readonly defaultEffort: SessionReasoningEffort;
20
+ readonly contextWindow: number;
21
+ }
22
+ /** Credentials a foreign agent may be started with instead of its CLI's default login. */
23
+ export interface ForeignAgentCredentials {
24
+ readonly apiKey?: string;
25
+ readonly authToken?: string;
26
+ readonly oauthToken?: string;
27
+ /** The agent CLI's own configuration directory, such as `CLAUDE_CONFIG_DIR` or `CODEX_HOME`. */
28
+ readonly configDir?: string;
29
+ }
30
+ /** What configuration says about starting one account's agent. */
31
+ export interface ForeignAgentStart {
32
+ /** The program to start instead of the agent's default, when the agent starts one. */
33
+ readonly command?: string;
34
+ readonly args?: readonly string[];
35
+ /** The credentials' environment and any configured extra variables. */
36
+ readonly env: NodeJS.ProcessEnv;
37
+ }
38
+ /** Everything that differs between foreign agents, around one shared session implementation. */
39
+ export interface ForeignAgent {
40
+ readonly type: ForeignAgentType;
41
+ readonly label: string;
42
+ /** The model ID prefix, without its trailing slash. */
43
+ readonly modelPrefix: string;
44
+ /**
45
+ * How to reach the agent: a first-party driver over the vendor's own typed API, which takes
46
+ * steering mid-turn, or an ACP adapter process. `start` carries the configured overrides.
47
+ */
48
+ connect(start: ForeignAgentStart): AcpConnect;
49
+ /** The models assumed until the agent has been asked which it serves. */
50
+ readonly models: readonly ForeignAgentModel[];
51
+ /** Turn the values of the agent's own model selector into Happy models. */
52
+ readonly modelsFromSelector: (values: readonly AcpSelectValue[]) => readonly ForeignAgentModel[];
53
+ readonly profile: AcpAgentProfile;
54
+ /** Environment that hands the configured credentials to the agent's own CLI. */
55
+ credentialEnvironment(credentials: ForeignAgentCredentials): NodeJS.ProcessEnv;
56
+ }
57
+ /** The agent's own model value for a Happy `<prefix>/<model>` ID. */
58
+ export declare function foreignAgentModelName(prefix: string, model: string | undefined): string | undefined;
59
+ /** Whether a Happy model ID names a foreign agent's model. */
60
+ export declare function isForeignAgentModel(model: string): boolean;
61
+ /**
62
+ * Happy models from a model selector whose values carry their efforts in `_meta`, as the
63
+ * first-party drivers report them. Efforts Happy has no name for are left out, and a value with
64
+ * none is offered at medium.
65
+ */
66
+ export declare function foreignModelsWithEfforts(prefix: string, values: readonly AcpSelectValue[], shape: (value: string, name: string) => {
67
+ readonly name: string;
68
+ readonly contextWindow: number;
69
+ }): readonly ForeignAgentModel[];
70
+ /** The ACP adapter `start` names, or `fallback` when configuration names none. */
71
+ export declare function foreignAgentLaunch(start: ForeignAgentStart, fallback: AcpAgentLaunch | undefined): AcpAgentLaunch;
72
+ /** Speak ACP to an adapter process. */
73
+ export declare function acpSpawnConnect(launch: AcpAgentLaunch): AcpConnect;
74
+ //# sourceMappingURL=ForeignAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForeignAgent.d.ts","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/ForeignAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErF,OAAO,KAAK,EA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5
+ "antigravity",
6
+ "opencode",
7
+ "acp",
8
+ ];
9
+ /** The agent's own model value for a Happy `<prefix>/<model>` ID. */
10
+ export function foreignAgentModelName(prefix, model) {
11
+ const head = `${prefix}/`;
12
+ return model?.startsWith(head) === true ? model.slice(head.length) : undefined;
13
+ }
14
+ /** Whether a Happy model ID names a foreign agent's model. */
15
+ export function isForeignAgentModel(model) {
16
+ return FOREIGN_AGENT_TYPES.some((type) => model.startsWith(`${type}/`));
17
+ }
18
+ const HAPPY_EFFORTS = [
19
+ "minimal",
20
+ "low",
21
+ "medium",
22
+ "high",
23
+ "xhigh",
24
+ "max",
25
+ ];
26
+ /**
27
+ * Happy models from a model selector whose values carry their efforts in `_meta`, as the
28
+ * first-party drivers report them. Efforts Happy has no name for are left out, and a value with
29
+ * none is offered at medium.
30
+ */
31
+ export function foreignModelsWithEfforts(prefix, values, shape) {
32
+ return values.map(({ value, name, meta }) => {
33
+ const offered = Array.isArray(meta?.["efforts"]) ? meta["efforts"] : [];
34
+ const efforts = HAPPY_EFFORTS.filter((effort) => offered.includes(effort));
35
+ const effortLevels = efforts.length === 0 ? ["medium"] : efforts;
36
+ const preferred = meta?.["defaultEffort"];
37
+ const defaultEffort = effortLevels.find((effort) => effort === preferred) ??
38
+ (effortLevels.includes("medium") ? "medium" : effortLevels[0]);
39
+ return { id: `${prefix}/${value}`, ...shape(value, name), effortLevels, defaultEffort };
40
+ });
41
+ }
42
+ /** The ACP adapter `start` names, or `fallback` when configuration names none. */
43
+ export function foreignAgentLaunch(start, fallback) {
44
+ const command = start.command ?? fallback?.command;
45
+ if (command === undefined)
46
+ throw new Error("The agent has no command to start.");
47
+ const args = start.command === undefined ? (fallback?.args ?? []) : (start.args ?? []);
48
+ return { command, args, env: start.env };
49
+ }
50
+ /** Speak ACP to an adapter process. */
51
+ export function acpSpawnConnect(launch) {
52
+ return (cwd, client) => acpConnectionSpawn(launch, cwd, client);
53
+ }
54
+ //# sourceMappingURL=ForeignAgent.js.map
@@ -0,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AO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type ForeignAgent } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ /**
3
+ * Any agent with an ACP server, configured as harness `harness` and started from its `command`,
4
+ * `args` and `env`. Its model IDs are `acp/<harness>/<model>`.
5
+ *
6
+ * Nothing about it is known ahead of time: its models are whatever its model selector offers,
7
+ * with efforts when the agent lists them in `_meta`, and its permission is the answer Happy's mode
8
+ * gives to each `session/request_permission`. Happy never compacts ahead of it.
9
+ */
10
+ export declare function acpGenericAgent(harness: string): ForeignAgent;
11
+ //# sourceMappingURL=acpGenericAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acpGenericAgent.d.ts","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/acpGenericAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,YAAY,EACpB,MAAM,yCAAyC,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAuB7D"}
@@ -0,0 +1,33 @@
1
+ import { acpSpawnConnect, foreignAgentLaunch, foreignAgentModelName, foreignModelsWithEfforts, } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ /**
3
+ * Any agent with an ACP server, configured as harness `harness` and started from its `command`,
4
+ * `args` and `env`. Its model IDs are `acp/<harness>/<model>`.
5
+ *
6
+ * Nothing about it is known ahead of time: its models are whatever its model selector offers,
7
+ * with efforts when the agent lists them in `_meta`, and its permission is the answer Happy's mode
8
+ * gives to each `session/request_permission`. Happy never compacts ahead of it.
9
+ */
10
+ export function acpGenericAgent(harness) {
11
+ const modelPrefix = `acp/${harness}`;
12
+ return {
13
+ type: "acp",
14
+ label: "ACP agent",
15
+ modelPrefix,
16
+ connect: (start) => acpSpawnConnect(foreignAgentLaunch(start, undefined)),
17
+ models: [],
18
+ modelsFromSelector: (values) => foreignModelsWithEfforts(modelPrefix, values, (_value, name) => ({
19
+ name,
20
+ contextWindow: 1_000_000,
21
+ })),
22
+ profile: {
23
+ modelOptions: (selected) => {
24
+ const name = foreignAgentModelName(modelPrefix, selected);
25
+ return name === undefined
26
+ ? []
27
+ : [{ configId: "model", category: "model", value: name }];
28
+ },
29
+ },
30
+ credentialEnvironment: () => ({}),
31
+ };
32
+ }
33
+ //# sourceMappingURL=acpGenericAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acpGenericAgent.js","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/acpGenericAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GAE3B,MAAM,yCAAyC,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC3C,MAAM,WAAW,GAAG,OAAO,OAAO,EAAE,CAAC;IACrC,OAAO;QACH,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,WAAW;QAClB,WAAW;QACX,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACzE,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,CAAC,MAAM,EAAE,EAAE,CAC3B,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YAC7D,IAAI;YACJ,aAAa,EAAE,SAAS;SAC3B,CAAC,CAAC;QACP,OAAO,EAAE;YACL,YAAY,EAAE,CAAC,QAAQ,EAAE,EAAE;gBACvB,MAAM,IAAI,GAAG,qBAAqB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;gBAC1D,OAAO,IAAI,KAAK,SAAS;oBACrB,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAClE,CAAC;SACJ;QACD,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;KACpC,CAAC;AACN,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type ForeignAgent } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ /**
3
+ * Google Antigravity through the community `antigravity-acp` adapter, which drives the signed-in
4
+ * `agy` CLI and can resume its conversations.
5
+ *
6
+ * Antigravity names effort inside the model value (`gemini-3.8-flash-high`) and ignores ACP
7
+ * `mcpServers`; it does read `.agents/mcp_config.json` from every workspace directory, so the
8
+ * Happy bridge is placed in a private directory passed as an additional workspace root.
9
+ */
10
+ export declare const antigravityAgent: ForeignAgent;
11
+ //# sourceMappingURL=antigravityAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antigravityAgent.d.ts","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/antigravityAgent.ts"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,YAAY,EAEpB,MAAM,yCAAyC,CAAC;AAqBjD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAuC9B,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { acpSpawnConnect, foreignAgentLaunch, foreignAgentModelName, } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ const THREE = ["low", "medium", "high"];
3
+ /** Efforts Antigravity spells as a model-value suffix, in Happy's picker order. */
4
+ const EFFORT_SUFFIXES = [
5
+ "minimal",
6
+ "low",
7
+ "medium",
8
+ "high",
9
+ "xhigh",
10
+ "max",
11
+ ];
12
+ const models = [
13
+ model("gemini-4-argon", "Gemini 4 Argon", THREE, "medium"),
14
+ model("gemini-3.8-flash", "Gemini 3.8 Flash", THREE, "high"),
15
+ model("claude-opus-5-5", "Claude Opus 5.5 (Antigravity)", THREE, "medium"),
16
+ model("claude-sonnet-5-5", "Claude Sonnet 5.5 (Antigravity)", THREE, "medium"),
17
+ model("gpt-oss-120b", "GPT-OSS 120B (Antigravity)", ["medium"], "medium"),
18
+ ];
19
+ /**
20
+ * Google Antigravity through the community `antigravity-acp` adapter, which drives the signed-in
21
+ * `agy` CLI and can resume its conversations.
22
+ *
23
+ * Antigravity names effort inside the model value (`gemini-3.8-flash-high`) and ignores ACP
24
+ * `mcpServers`; it does read `.agents/mcp_config.json` from every workspace directory, so the
25
+ * Happy bridge is placed in a private directory passed as an additional workspace root.
26
+ */
27
+ export const antigravityAgent = {
28
+ type: "antigravity",
29
+ modelPrefix: "antigravity",
30
+ label: "Antigravity",
31
+ connect: (start) => acpSpawnConnect(foreignAgentLaunch(start, { command: "npx", args: ["-y", "antigravity-acp@1.2.0"] })),
32
+ models,
33
+ modelsFromSelector,
34
+ profile: {
35
+ modelOptions: (selected, effort) => {
36
+ const name = foreignAgentModelName("antigravity", selected);
37
+ if (name === undefined)
38
+ return [];
39
+ // The API only admits efforts the catalog lists for this model, so the suffix exists.
40
+ const known = models.find((candidate) => candidate.id === selected);
41
+ const level = effort ?? known?.defaultEffort ?? "medium";
42
+ return [{ configId: "model", value: `${name}-${level}` }];
43
+ },
44
+ permissionOptions: (mode) => [
45
+ { configId: "mode", value: mode === "read_only" ? "plan" : "default" },
46
+ { configId: "sandbox", value: mode !== "full_access" },
47
+ ],
48
+ // antigravity-acp binds a new session to the next conversation database agy creates in
49
+ // its shared store, so two new sessions started together can take each other's.
50
+ serializeNewSessions: true,
51
+ bridgeDirectoryFiles: (bridge) => [
52
+ {
53
+ path: ".agents/mcp_config.json",
54
+ content: JSON.stringify({
55
+ mcpServers: {
56
+ [bridge.name]: { serverUrl: bridge.url, headers: bridge.headers },
57
+ },
58
+ }),
59
+ },
60
+ ],
61
+ },
62
+ credentialEnvironment: (credentials) => credentials.apiKey === undefined ? {} : { GEMINI_API_KEY: credentials.apiKey },
63
+ };
64
+ /**
65
+ * Antigravity lists every model once per effort (`gemini-3.8-flash-high`). Each base name becomes
66
+ * one Happy model whose efforts are its suffixes; a value without a known suffix is one model.
67
+ */
68
+ function modelsFromSelector(values) {
69
+ const grouped = new Map();
70
+ for (const { value, name } of values) {
71
+ const effort = EFFORT_SUFFIXES.find((level) => value.endsWith(`-${level}`));
72
+ const base = effort === undefined ? value : value.slice(0, -(effort.length + 1));
73
+ const entry = grouped.get(base) ?? {
74
+ label: modelLabel(base, name, effort),
75
+ efforts: new Set(),
76
+ };
77
+ if (effort !== undefined)
78
+ entry.efforts.add(effort);
79
+ grouped.set(base, entry);
80
+ }
81
+ return [...grouped].map(([base, { label, efforts }]) => {
82
+ const levels = EFFORT_SUFFIXES.filter((level) => efforts.has(level));
83
+ const effortLevels = levels.length === 0 ? ["medium"] : levels;
84
+ const curated = models.find((candidate) => candidate.id === `antigravity/${base}`);
85
+ return model(base, curated?.name ?? label, effortLevels, effortLevels.includes("medium") ? "medium" : effortLevels[0]);
86
+ });
87
+ }
88
+ /** The agent's label for a model, without the effort it appends to it. */
89
+ function modelLabel(base, name, effort) {
90
+ if (effort === undefined)
91
+ return name;
92
+ const trimmed = name.replace(new RegExp(`[\\s(-]*${effort}\\)?$`, "i"), "").trim();
93
+ return trimmed.length > 0 && trimmed !== name ? trimmed : base;
94
+ }
95
+ function model(name, label, effortLevels, defaultEffort) {
96
+ return {
97
+ id: `antigravity/${name}`,
98
+ name: label,
99
+ effortLevels,
100
+ defaultEffort,
101
+ contextWindow: 1_000_000,
102
+ };
103
+ }
104
+ //# sourceMappingURL=antigravityAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antigravityAgent.js","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/antigravityAgent.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,qBAAqB,GAGxB,MAAM,yCAAyC,CAAC;AAEjD,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAU,CAA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Y,CAAC,CAAC,CAAE,CAChE,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC;AAED,0EAA0E;AAC1E,SAAS,UAAU,CACf,IAAY,EACZ,IAAY,EACZ,MAA0C;IAE1C,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,WAAW,MAAM,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnF,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACnE,CAAC;AAED,SAAS,KAAK,CACV,IAAY,EACZ,KAAa,EACb,YAA+C,EAC/C,aAAiD;IAEjD,OAAO;QACH,EAAE,EAAE,eAAe,IAAI,EAAE;QACzB,IAAI,EAAE,KAAK;QACX,YAAY;QACZ,aAAa;QACb,aAAa,EAAE,SAAS;KAC3B,CAAC;AACN,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type ForeignAgent } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ /**
3
+ * Unmodified Claude Code through the Claude Agent SDK: Claude's own prompt, tools, settings,
4
+ * subagents and compaction, with Happy's tools bridged over MCP, real mid-turn steering, and the
5
+ * models the signed-in account serves. The SDK starts the Claude Code build Happy ships with.
6
+ */
7
+ export declare const claudeCodeAgent: ForeignAgent;
8
+ //# sourceMappingURL=claudeCodeAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claudeCodeAgent.d.ts","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/claudeCodeAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,YAAY,EAEpB,MAAM,yCAAyC,CAAC;AAWjD;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,YAgD7B,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { foreignAgentModelName, foreignModelsWithEfforts, } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ import { claudeAgentConnect } from "../../vendors/claudeAgent/claudeAgentConnect.js";
3
+ const EFFORTS = ["low", "medium", "high", "xhigh", "max"];
4
+ const models = [
5
+ model("opus", "Claude Code · Opus"),
6
+ model("sonnet", "Claude Code · Sonnet"),
7
+ model("haiku", "Claude Code · Haiku"),
8
+ ];
9
+ /**
10
+ * Unmodified Claude Code through the Claude Agent SDK: Claude's own prompt, tools, settings,
11
+ * subagents and compaction, with Happy's tools bridged over MCP, real mid-turn steering, and the
12
+ * models the signed-in account serves. The SDK starts the Claude Code build Happy ships with.
13
+ */
14
+ export const claudeCodeAgent = {
15
+ type: "claude-code",
16
+ modelPrefix: "claude-code",
17
+ label: "Claude Code",
18
+ connect: (start) => claudeAgentConnect(start.env),
19
+ models,
20
+ modelsFromSelector: (values) => foreignModelsWithEfforts("claude-code", values, (value, name) => ({
21
+ name: `Claude Code · ${name}`,
22
+ contextWindow: value === "haiku" ? 200_000 : 1_000_000,
23
+ })),
24
+ profile: {
25
+ modelOptions: (selected, effort) => {
26
+ const name = foreignAgentModelName("claude-code", selected);
27
+ if (name === undefined)
28
+ return [];
29
+ return [
30
+ { configId: "model", value: name },
31
+ ...(effort === undefined || !EFFORTS.includes(effort)
32
+ ? []
33
+ : [{ configId: "effort", value: effort }]),
34
+ ];
35
+ },
36
+ permissionOptions: (mode) => [
37
+ {
38
+ configId: "mode",
39
+ value: mode === "read_only"
40
+ ? "plan"
41
+ : mode === "workspace_write"
42
+ ? "acceptEdits"
43
+ : mode === "auto"
44
+ ? "auto"
45
+ : "bypassPermissions",
46
+ },
47
+ ],
48
+ },
49
+ credentialEnvironment: (credentials) => ({
50
+ ...(credentials.oauthToken === undefined
51
+ ? {}
52
+ : { CLAUDE_CODE_OAUTH_TOKEN: credentials.oauthToken }),
53
+ ...(credentials.apiKey === undefined ? {} : { ANTHROPIC_API_KEY: credentials.apiKey }),
54
+ ...(credentials.authToken === undefined
55
+ ? {}
56
+ : { ANTHROPIC_AUTH_TOKEN: credentials.authToken }),
57
+ ...(credentials.configDir === undefined
58
+ ? {}
59
+ : { CLAUDE_CONFIG_DIR: credentials.configDir }),
60
+ }),
61
+ };
62
+ function model(name, label) {
63
+ return {
64
+ id: `claude-code/${name}`,
65
+ name: label,
66
+ effortLevels: EFFORTS,
67
+ defaultEffort: "high",
68
+ contextWindow: name === "haiku" ? 200_000 : 1_000_000,
69
+ };
70
+ }
71
+ //# sourceMappingURL=claudeCodeAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claudeCodeAgent.js","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/claudeCodeAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EACrB,wBAAwB,GAG3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEjF,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAEnE,MAAM,MAAM,GAAiC;IACzC,KAAK,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACnC,KAAK,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IACvC,KAAK,CAAC,OAAO,EAAE,qBAAqB,CAAC;CACxC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAiB;IACzC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC;IACjD,MAAM;IACN,kBAAkB,EAAE,CAAC,MAAM,EAAE,EAAE,CAC3B,wBAAwB,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9D,IAAI,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AAE,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;QACtF,GAAG,CAAC,WAAW,CAAC,SAAS,KAAK,SAAS;YACnC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,oBAAoB,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC;QACtD,GAAG,CAAC,WAAW,CAAC,SAAS,KAAK,SAAS;YACnC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,iBAAiB,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC;KACtD,CAAC;CACL,CAAC;AAEF,SAAS,KAAK,CAAC,IAAY,EAAE,KAAa;IACtC,OAAO;QACH,EAAE,EAAE,eAAe,IAAI,EAAE;QACzB,IAAI,EAAE,KAAK;QACX,YAAY,EAAE,OAAO;QACrB,aAAa,EAAE,MAAM;QACrB,aAAa,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;KACxD,CAAC;AACN,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type ForeignAgent } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ /**
3
+ * Unmodified Codex through `codex app-server`, the typed API the Codex apps use: Codex's own
4
+ * prompt, tools, sandbox and subagents, with Happy's tools bridged over MCP, real mid-turn
5
+ * steering, and the models the signed-in account serves. It runs the pinned release installed with
6
+ * Happy, else an installed `codex`; a configured `command` replaces both, and its `args` must start
7
+ * the app-server.
8
+ */
9
+ export declare const codexCliAgent: ForeignAgent;
10
+ //# sourceMappingURL=codexCliAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codexCliAgent.d.ts","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/codexCliAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,YAAY,EAEpB,MAAM,yCAAyC,CAAC;AAajD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,YA4C3B,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { foreignAgentLaunch, foreignAgentModelName, foreignModelsWithEfforts, } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ import { codexAppServerConnect } from "../../vendors/codexAppServer/codexAppServerConnect.js";
3
+ import { codexAppServerLaunch } from "../../vendors/codexAppServer/resolveCodexExecutable.js";
4
+ const EFFORTS = ["low", "medium", "high", "xhigh", "max"];
5
+ const models = [
6
+ model("gpt-6.1-sol", "Codex · GPT-6.1 Sol", "high"),
7
+ model("gpt-6-sol", "Codex · GPT-6 Sol", "high"),
8
+ model("gpt-6-luna", "Codex · GPT-6 Luna", "medium"),
9
+ model("gpt-5.6-sol", "Codex · GPT-5.6 Sol", "medium"),
10
+ ];
11
+ /**
12
+ * Unmodified Codex through `codex app-server`, the typed API the Codex apps use: Codex's own
13
+ * prompt, tools, sandbox and subagents, with Happy's tools bridged over MCP, real mid-turn
14
+ * steering, and the models the signed-in account serves. It runs the pinned release installed with
15
+ * Happy, else an installed `codex`; a configured `command` replaces both, and its `args` must start
16
+ * the app-server.
17
+ */
18
+ export const codexCliAgent = {
19
+ type: "codex-cli",
20
+ modelPrefix: "codex-cli",
21
+ label: "Codex CLI",
22
+ connect: (start) => codexAppServerConnect(start.command === undefined
23
+ ? codexAppServerLaunch(start.env)
24
+ : foreignAgentLaunch(start, undefined)),
25
+ models,
26
+ modelsFromSelector: (values) => foreignModelsWithEfforts("codex-cli", values, (_value, name) => ({
27
+ name: `Codex · ${name}`,
28
+ contextWindow: 272_000,
29
+ })),
30
+ profile: {
31
+ modelOptions: (selected, effort) => {
32
+ const name = foreignAgentModelName("codex-cli", selected);
33
+ if (name === undefined)
34
+ return [];
35
+ return [
36
+ { configId: "model", value: name },
37
+ ...(effort === undefined || !EFFORTS.includes(effort)
38
+ ? []
39
+ : [{ configId: "reasoning_effort", value: effort }]),
40
+ ];
41
+ },
42
+ // Codex's sandbox; Codex never stops to ask, so the sandbox is the whole policy.
43
+ permissionOptions: (mode) => [
44
+ {
45
+ configId: "mode",
46
+ value: mode === "read_only"
47
+ ? "read-only"
48
+ : mode === "full_access"
49
+ ? "danger-full-access"
50
+ : "workspace-write",
51
+ },
52
+ ],
53
+ },
54
+ credentialEnvironment: (credentials) => ({
55
+ ...(credentials.apiKey === undefined ? {} : { OPENAI_API_KEY: credentials.apiKey }),
56
+ ...(credentials.configDir === undefined ? {} : { CODEX_HOME: credentials.configDir }),
57
+ }),
58
+ };
59
+ function model(name, label, defaultEffort) {
60
+ return {
61
+ id: `codex-cli/${name}`,
62
+ name: label,
63
+ effortLevels: EFFORTS,
64
+ defaultEffort,
65
+ contextWindow: 272_000,
66
+ };
67
+ }
68
+ //# sourceMappingURL=codexCliAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codexCliAgent.js","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/codexCliAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GAG3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAE1F,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAEnE,MAAM,MAAM,GAAiC;IACzC,KAAK,CAAC,aAAa,EAAE,qBAAqB,EAAE,MAAM,CAAC;IACnD,KAAK,CAAC,WAAW,EAAE,mBAAmB,EAAE,MAAM,CAAC;IAC/C,KAAK,CAAC,YAAY,EAAE,oBAAoB,EAAE,QAAQ,CAAC;IACnD,KAAK,CAAC,aAAa,EAAE,qBAAqB,EAAE,QAAQ,CAAC;CACxD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiB;IACvC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,WAAW;IACxB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,CAAC,KAA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AAC;QACrC,GAAG,CAAC,WAAW,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;QACnF,GAAG,CAAC,WAAW,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC;KACxF,CAAC;CACL,CAAC;AAEF,SAAS,KAAK,CACV,IAAY,EACZ,KAAa,EACb,aAAiD;IAEjD,OAAO;QACH,EAAE,EAAE,aAAa,IAAI,EAAE;QACvB,IAAI,EAAE,KAAK;QACX,YAAY,EAAE,OAAO;QACrB,aAAa;QACb,aAAa,EAAE,OAAO;KACzB,CAAC;AACN,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ForeignAgent, ForeignAgentType } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ /** Every built-in foreign agent, by harness type. */
3
+ export declare const FOREIGN_AGENTS: Readonly<Record<Exclude<ForeignAgentType, "acp">, ForeignAgent>>;
4
+ /** The foreign agent behind harness `harness` of type `type`. */
5
+ export declare function foreignAgent(type: ForeignAgentType, harness: string): ForeignAgent;
6
+ //# sourceMappingURL=foreignAgents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreignAgents.d.ts","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/foreignAgents.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE9F,qDAAqD;AACrD,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE,YAAY,CAAC,CAMtF,CAAC;AAEP,iEAAiE;AACjE,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAElF"}
@@ -0,0 +1,17 @@
1
+ import { acpGenericAgent } from "../../vendors/foreignAgents/acpGenericAgent.js";
2
+ import { antigravityAgent } from "../../vendors/foreignAgents/antigravityAgent.js";
3
+ import { claudeCodeAgent } from "../../vendors/foreignAgents/claudeCodeAgent.js";
4
+ import { codexCliAgent } from "../../vendors/foreignAgents/codexCliAgent.js";
5
+ import { opencodeAgent } from "../../vendors/foreignAgents/opencodeAgent.js";
6
+ /** Every built-in foreign agent, by harness type. */
7
+ export const FOREIGN_AGENTS = Object.freeze({
8
+ "claude-code": claudeCodeAgent,
9
+ "codex-cli": codexCliAgent,
10
+ antigravity: antigravityAgent,
11
+ opencode: opencodeAgent,
12
+ });
13
+ /** The foreign agent behind harness `harness` of type `type`. */
14
+ export function foreignAgent(type, harness) {
15
+ return type === "acp" ? acpGenericAgent(harness) : FOREIGN_AGENTS[type];
16
+ }
17
+ //# sourceMappingURL=foreignAgents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreignAgents.js","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/foreignAgents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAGzE,qDAAqD;AACrD,MAAM,CAAC,MAAM,cAAc,GACvB,MAAM,CAAC,MAAM,CAAC;IACV,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,aAAa;CAC1B,CAAC,CAAC;AAEP,iEAAiE;AACjE,MAAM,UAAU,YAAY,CAAC,IAAsB,EAAE,OAAe;IAChE,OAAO,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type ForeignAgent } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ /**
3
+ * OpenCode through its own ACP server, `opencode acp`, signed in with its own providers. Its
4
+ * models are whatever those providers serve (`openai/gpt-5.5`, …), so there is no curated list;
5
+ * Happy's read-only mode is OpenCode's `plan` mode and every other mode is `build`.
6
+ */
7
+ export declare const opencodeAgent: ForeignAgent;
8
+ //# sourceMappingURL=opencodeAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencodeAgent.d.ts","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/opencodeAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,YAAY,EACpB,MAAM,yCAAyC,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,YAuB3B,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { acpSpawnConnect, foreignAgentLaunch, foreignAgentModelName, foreignModelsWithEfforts, } from "../../vendors/foreignAgents/ForeignAgent.js";
2
+ /**
3
+ * OpenCode through its own ACP server, `opencode acp`, signed in with its own providers. Its
4
+ * models are whatever those providers serve (`openai/gpt-5.5`, …), so there is no curated list;
5
+ * Happy's read-only mode is OpenCode's `plan` mode and every other mode is `build`.
6
+ */
7
+ export const opencodeAgent = {
8
+ type: "opencode",
9
+ label: "OpenCode",
10
+ modelPrefix: "opencode",
11
+ connect: (start) => acpSpawnConnect(foreignAgentLaunch(start, { command: "opencode", args: ["acp"] })),
12
+ models: [],
13
+ modelsFromSelector: (values) => foreignModelsWithEfforts("opencode", values, (_value, name) => ({
14
+ name: `OpenCode · ${name}`,
15
+ contextWindow: 400_000,
16
+ })),
17
+ profile: {
18
+ modelOptions: (selected) => {
19
+ const name = foreignAgentModelName("opencode", selected);
20
+ return name === undefined ? [] : [{ configId: "model", value: name }];
21
+ },
22
+ permissionOptions: (mode) => [
23
+ { configId: "mode", value: mode === "read_only" ? "plan" : "build" },
24
+ ],
25
+ },
26
+ credentialEnvironment: (credentials) => credentials.apiKey === undefined ? {} : { OPENAI_API_KEY: credentials.apiKey },
27
+ };
28
+ //# sourceMappingURL=opencodeAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencodeAgent.js","sourceRoot":"","sources":["../../../sources/vendors/foreignAgents/opencodeAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GAE3B,MAAM,yCAAyC,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiB;IACvC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,UAAU;IACvB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACf,eAAe,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACtF,MAAM,EAAE,EAAE;IACV,kBAAkB,EAAE,CAAC,MAAM,EAAE,EAAE,CAC3B,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5D,IAAI,EAAE,cAAc,IAAI,EAAE;QAC1B,aAAa,EAAE,OAAO;KACzB,CAAC,CAAC;IACP,OAAO,EAAE;QACL,YAAY,EAAE,CAAC,QAAQ,EAAE,EAAE;YACvB,MAAM,IAAI,GAAG,qBAAqB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACzD,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1E,CAAC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EAAE,MAAM,GAAG,OAAO,CAavE"}
1
+ {"version":3,"file":"grokErrors.d.ts","sourceRoot":"","sources":["../../../../sources/vendors/grok/errors/grokErrors.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAyDrF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKlE;AAED,kEAAkE;AAClE,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED,oEAAoE;AACpE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG3D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAWnE;AAED,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACjB,oBAAoB,CAoCtB;AAED,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAItF;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAe7D;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAavE"}
@@ -1,4 +1,5 @@
1
1
  import { extractProviderErrorDiagnostics, extractProviderRetryResetAt, } from "../../../core/extractProviderErrorDiagnostics.js";
2
+ import { isNetworkFailure } from "../../../core/isNetworkFailure.js";
2
3
  const CONTEXT_OVERFLOW_PATTERNS = [
3
4
  "too long for this model",
4
5
  "prompt is too long",
@@ -105,9 +106,11 @@ export function classifyGrokProviderError(error, message, attempts) {
105
106
  ? "rate_limit"
106
107
  : status === 503 || normalized.includes("overloaded")
107
108
  ? "server_overloaded"
108
- : (status !== undefined && status >= 500) || kind === "internal_error"
109
- ? "internal_server_error"
110
- : "unclassified";
109
+ : status === undefined && isNetworkFailure(error, message)
110
+ ? "network"
111
+ : (status !== undefined && status >= 500) || kind === "internal_error"
112
+ ? "internal_server_error"
113
+ : "unclassified";
111
114
  if (type === "rate_limit" || type === "out_of_tokens") {
112
115
  const resetAt = extractProviderRetryResetAt(error);
113
116
  return {