@tangle-network/agent-gateway 0.5.0 → 0.6.0

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.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { createAgentGateway } from './middleware.js';
2
- import { A as ApiKeyInfo, M as MppConfig, X as X402Config, C as ChatMessage } from './types-BbTSfNhx.js';
3
- export { a as AgentMeta, b as AuthFailureReason, c as ChatCompletionChunk, d as ChatCompletionRequest, e as CompositeObserver, f as ConsoleObserver, G as GatewayConfig, g as GatewayObserver, h as GatewayUsageEvent, P as PaymentMethod, i as PaymentResult, R as RequestContext, S as SandboxBox, j as SandboxStreamEvent, k as generateRequestId } from './types-BbTSfNhx.js';
2
+ import { A as ApiKeyInfo, M as MppConfig, X as X402Config, C as ChatMessage } from './types-C_L7yXXI.js';
3
+ export { a as AgentMeta, b as AuthFailureReason, c as ChatCompletionChunk, d as ChatCompletionRequest, e as CompositeObserver, f as ConsoleObserver, G as GatewayConfig, g as GatewayObserver, h as GatewayUsageEvent, P as PaymentMethod, i as PaymentResult, R as RequestContext, S as SandboxBox, j as SandboxStreamEvent, k as generateRequestId } from './types-C_L7yXXI.js';
4
4
  import { NonceStore } from './nonce-store.js';
5
5
  export { KvNonceStore, MemoryNonceStore } from './nonce-store.js';
6
6
  export { KvRateLimitStore, MemoryRateLimitStore, RateLimitConfig, RateLimitResult, RateLimitStore, checkRateLimit } from './rate-limit.js';
@@ -1,6 +1,6 @@
1
1
  import * as hono_types from 'hono/types';
2
2
  import { Hono } from 'hono';
3
- import { G as GatewayConfig } from './types-BbTSfNhx.js';
3
+ import { G as GatewayConfig } from './types-C_L7yXXI.js';
4
4
  import './nonce-store.js';
5
5
  import './rate-limit.js';
6
6
 
@@ -150,6 +150,40 @@ interface AgentMeta {
150
150
  remoteBearerToken: string | null;
151
151
  /** Whether agent is published and accepting requests */
152
152
  enabled: boolean;
153
+ /**
154
+ * CLI harness backend that runs this agent inside the sandbox sidecar.
155
+ *
156
+ * When set, the host's `getSandbox()` SHOULD return a `SandboxBox`
157
+ * whose `streamPrompt` POSTs to the sidecar's
158
+ * `POST /agent/invoke/chat/completions` endpoint with
159
+ * `model: "<harness>/<harnessModel>"` — that endpoint runs the
160
+ * harness against the sandbox workspace and streams OpenAI-shape
161
+ * `chat.completion.chunk` frames back.
162
+ *
163
+ * When unset (legacy / template mode), the host's `streamPrompt`
164
+ * falls back to the template's own `/api/chat/completions` (proxied
165
+ * via the sidecar's `/agent/invoke`).
166
+ *
167
+ * Known harnesses (registered in agent-dev-container's
168
+ * cli-agent-bindings.ts): opencode, claude-code, codex, kimi-code,
169
+ * amp, factory-droids, pi, hermes, openclaw, forge, acp, cursor.
170
+ * Aliases the sidecar canonicalizes: claude → claude-code,
171
+ * kimi → kimi-code, factory → factory-droids.
172
+ */
173
+ harness?: string;
174
+ /**
175
+ * Model identifier to pass after the harness in the
176
+ * `<harness>/<model>` slash form. Format is harness-specific:
177
+ * claude-code: "sonnet", "opus", or a versioned id like
178
+ * "claude-sonnet-4-20250514"
179
+ * opencode: "anthropic/claude-sonnet-4-5", "openai/gpt-4o", …
180
+ * (opencode embeds provider before model)
181
+ * codex: "gpt-5-codex"
182
+ * kimi-code: "kimi-for-coding"
183
+ *
184
+ * Only meaningful when `harness` is set; ignored otherwise.
185
+ */
186
+ harnessModel?: string;
153
187
  }
154
188
  type PaymentMethod = 'x402' | 'mpp' | 'apikey' | 'none';
155
189
  interface X402Config {
package/dist/types.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { a as AgentMeta, A as ApiKeyInfo, c as ChatCompletionChunk, d as ChatCompletionRequest, C as ChatMessage, G as GatewayConfig, h as GatewayUsageEvent, M as MppConfig, P as PaymentMethod, i as PaymentResult, S as SandboxBox, j as SandboxStreamEvent, X as X402Config } from './types-BbTSfNhx.js';
1
+ export { a as AgentMeta, A as ApiKeyInfo, c as ChatCompletionChunk, d as ChatCompletionRequest, C as ChatMessage, G as GatewayConfig, h as GatewayUsageEvent, M as MppConfig, P as PaymentMethod, i as PaymentResult, S as SandboxBox, j as SandboxStreamEvent, X as X402Config } from './types-C_L7yXXI.js';
2
2
  import './nonce-store.js';
3
3
  import './rate-limit.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-gateway",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "x402 + API key payment gateway for Tangle agent products. Mount on any Hono app to expose agents as paid OpenAI-compatible endpoints.",
6
6
  "exports": {
package/src/types.ts CHANGED
@@ -21,6 +21,40 @@ export interface AgentMeta {
21
21
  remoteBearerToken: string | null
22
22
  /** Whether agent is published and accepting requests */
23
23
  enabled: boolean
24
+ /**
25
+ * CLI harness backend that runs this agent inside the sandbox sidecar.
26
+ *
27
+ * When set, the host's `getSandbox()` SHOULD return a `SandboxBox`
28
+ * whose `streamPrompt` POSTs to the sidecar's
29
+ * `POST /agent/invoke/chat/completions` endpoint with
30
+ * `model: "<harness>/<harnessModel>"` — that endpoint runs the
31
+ * harness against the sandbox workspace and streams OpenAI-shape
32
+ * `chat.completion.chunk` frames back.
33
+ *
34
+ * When unset (legacy / template mode), the host's `streamPrompt`
35
+ * falls back to the template's own `/api/chat/completions` (proxied
36
+ * via the sidecar's `/agent/invoke`).
37
+ *
38
+ * Known harnesses (registered in agent-dev-container's
39
+ * cli-agent-bindings.ts): opencode, claude-code, codex, kimi-code,
40
+ * amp, factory-droids, pi, hermes, openclaw, forge, acp, cursor.
41
+ * Aliases the sidecar canonicalizes: claude → claude-code,
42
+ * kimi → kimi-code, factory → factory-droids.
43
+ */
44
+ harness?: string
45
+ /**
46
+ * Model identifier to pass after the harness in the
47
+ * `<harness>/<model>` slash form. Format is harness-specific:
48
+ * claude-code: "sonnet", "opus", or a versioned id like
49
+ * "claude-sonnet-4-20250514"
50
+ * opencode: "anthropic/claude-sonnet-4-5", "openai/gpt-4o", …
51
+ * (opencode embeds provider before model)
52
+ * codex: "gpt-5-codex"
53
+ * kimi-code: "kimi-for-coding"
54
+ *
55
+ * Only meaningful when `harness` is set; ignored otherwise.
56
+ */
57
+ harnessModel?: string
24
58
  }
25
59
 
26
60
  // --- Payment ---