@band-ai/sdk 0.3.4 → 0.4.1
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/README.md +54 -1
- package/dist/{ClaudeSDKAdapter-CXud2DBE.d.ts → CopilotACPAdapter-B_AVyAl6.d.ts} +249 -19
- package/dist/{ClaudeSDKAdapter-Cx6zhSaG.d.cts → CopilotACPAdapter-Clid9xGR.d.cts} +249 -19
- package/dist/{opencode-2YdscIc1.d.cts → acp-client-D-I_5lK-.d.cts} +23 -4
- package/dist/{opencode-Bld62x5t.d.ts → acp-client-DUXyczlF.d.ts} +23 -4
- package/dist/acp-server-BlcYMxKt.d.ts +17 -0
- package/dist/acp-server-CJhclo6P.d.cts +17 -0
- package/dist/adapters.cjs +2257 -969
- package/dist/adapters.d.cts +21 -132
- package/dist/adapters.d.ts +21 -132
- package/dist/adapters.js +26 -1922
- package/dist/{backends-D-dBdDm-.d.ts → backends-CgsPQa9B.d.ts} +2 -2
- package/dist/{backends-ZLxmQrTZ.d.cts → backends-Dh2WXcHQ.d.cts} +2 -2
- package/dist/{chunk-JY75VSQK.js → chunk-4OVNFDD7.js} +14 -1
- package/dist/chunk-6BE2EG5P.js +128 -0
- package/dist/{chunk-U6AFCLYZ.js → chunk-6TGXV5TE.js} +1824 -514
- package/dist/{chunk-OH6VVVKT.js → chunk-CBCHTTUY.js} +10 -0
- package/dist/{chunk-K5KAEYPF.js → chunk-HNWZZXAE.js} +288 -120
- package/dist/chunk-I34SXMTJ.js +6 -0
- package/dist/{chunk-XWHWJP4I.js → chunk-JDW5WSGF.js} +2 -2
- package/dist/{chunk-KXJ74J73.js → chunk-JIZE4EC6.js} +4 -10
- package/dist/chunk-OGOXY43L.js +119 -0
- package/dist/{chunk-W5IAI6Z4.js → chunk-OVXVZUPO.js} +5 -5
- package/dist/{chunk-YJ42AZO4.js → chunk-RJNJUISR.js} +5 -2
- package/dist/{chunk-MQY74R7D.js → chunk-SHZBLLDQ.js} +21 -9
- package/dist/{chunk-JADCAMZY.js → chunk-TGDDFBYS.js} +45 -0
- package/dist/{chunk-US226AS4.js → chunk-UENIC5FJ.js} +14 -11
- package/dist/{chunk-MQBBWYRP.js → chunk-UFO6XMCV.js} +3404 -572
- package/dist/{chunk-WA7CHXUS.js → chunk-UL3Y5C4J.js} +2 -2
- package/dist/{chunk-WL2HNJZ6.js → chunk-VOMJRQOM.js} +3 -3
- package/dist/{chunk-OD2G5LFQ.js → chunk-ZYOXI4JL.js} +41 -2
- package/dist/config.cjs +2 -12
- package/dist/config.js +2 -2
- package/dist/converters.cjs +36 -11
- package/dist/converters.d.cts +7 -5
- package/dist/converters.d.ts +7 -5
- package/dist/converters.js +11 -13
- package/dist/core.cjs +239 -5
- package/dist/core.d.cts +71 -6
- package/dist/core.d.ts +71 -6
- package/dist/core.js +31 -6
- package/dist/{customTools-BzF0IISO.d.cts → customTools-Bfecd0mJ.d.cts} +1 -1
- package/dist/{customTools-BzF0IISO.d.ts → customTools-Bfecd0mJ.d.ts} +1 -1
- package/dist/{disconnectReason-IuADl6TH.d.ts → disconnectReason-Cctmg1SN.d.cts} +1 -1
- package/dist/{disconnectReason-IuADl6TH.d.cts → disconnectReason-Cctmg1SN.d.ts} +1 -1
- package/dist/{dtos-B8KU_q4d.d.ts → dtos-CjQsN1_h.d.cts} +5 -12
- package/dist/{dtos-B8KU_q4d.d.cts → dtos-CjQsN1_h.d.ts} +5 -12
- package/dist/index.cjs +5289 -1474
- package/dist/index.d.cts +61 -22
- package/dist/index.d.ts +61 -22
- package/dist/index.js +151 -43
- package/dist/linear.cjs +45 -7
- package/dist/linear.d.cts +4 -3
- package/dist/linear.d.ts +4 -3
- package/dist/linear.js +10 -10
- package/dist/mcp-claude.cjs +11 -6
- package/dist/mcp-claude.d.cts +4 -3
- package/dist/mcp-claude.d.ts +4 -3
- package/dist/mcp-claude.js +4 -5
- package/dist/mcp.cjs +13 -7
- package/dist/mcp.d.cts +6 -5
- package/dist/mcp.d.ts +6 -5
- package/dist/mcp.js +5 -6
- package/dist/{pagination-DqdkQArT.d.cts → pagination-BZDhB_nO.d.cts} +2 -2
- package/dist/{pagination-BgEx-HeL.d.ts → pagination-CPz0J_vQ.d.ts} +2 -2
- package/dist/{protocols-Bz1rxcUg.d.cts → protocols-CabgO52c.d.cts} +38 -3
- package/dist/{protocols-Bwwcql0h.d.ts → protocols-Dpci6uae.d.ts} +38 -3
- package/dist/rest.cjs +43 -1
- package/dist/rest.d.cts +6 -5
- package/dist/rest.d.ts +6 -5
- package/dist/rest.js +6 -5
- package/dist/runtime.cjs +2113 -597
- package/dist/runtime.d.cts +44 -25
- package/dist/runtime.d.ts +44 -25
- package/dist/runtime.js +11 -11
- package/dist/{schemas-BgJhlqqO.d.cts → schemas-BKnh4fKR.d.cts} +209 -24
- package/dist/{schemas-C4mK1WSs.d.ts → schemas-CDa3V_I5.d.ts} +209 -24
- package/dist/{sdk-BTciSLRQ.d.cts → sdk-CXNqzoY1.d.cts} +1 -1
- package/dist/{sdk-qKJtMma_.d.ts → sdk-Cin80BTC.d.ts} +1 -1
- package/dist/{simpleAdapter-BpT4XbZC.d.cts → simpleAdapter-D75rcz9n.d.cts} +3 -1
- package/dist/{simpleAdapter--wznuoOw.d.ts → simpleAdapter-eLvsAQNo.d.ts} +3 -1
- package/dist/testing.cjs +25 -7
- package/dist/testing.d.cts +5 -3
- package/dist/testing.d.ts +5 -3
- package/dist/testing.js +9 -6
- package/dist/{types-BivGO7I9.d.ts → types-42-HWeX8.d.cts} +10 -4
- package/dist/types-CKU1N0SK.d.ts +137 -0
- package/dist/{types-BgYFd_Yw.d.cts → types-CjxZekMH.d.ts} +10 -4
- package/dist/types-DtcOLALn.d.cts +137 -0
- package/package.json +25 -26
- package/dist/acp-server-CiUqN3G3.d.ts +0 -24
- package/dist/acp-server-Dlj7D563.d.cts +0 -24
- package/dist/chunk-AVVDPXP4.js +0 -39
- package/dist/chunk-F63TPOI3.js +0 -29
- package/dist/chunk-V5TSWS7P.js +0 -62
- package/dist/types-BNNtOXu3.d.cts +0 -446
- package/dist/types-DFUtpxah.d.ts +0 -446
package/dist/index.d.cts
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { F as FrameworkAdapter } from './protocols-
|
|
2
|
-
export { A as AdapterToolsProtocol,
|
|
1
|
+
import { F as FrameworkAdapter } from './protocols-CabgO52c.cjs';
|
|
2
|
+
export { A as AdapterToolsProtocol, b as AgentToolsProtocol, C as ContactTools, c as FAILURE_EVENT_TYPE, d as FAILURE_METADATA_KEY, a as FrameworkAdapterInput, H as HistoryConverter, M as MemoryTools, e as MessagingTools, f as ParticipantTools, g as PeerLookupTools, h as Preprocessor, R as RoomParticipantTools, T as ToolExecutor, i as ToolSchemaProvider, t as toFailureEvent } from './protocols-CabgO52c.cjs';
|
|
3
3
|
import { AgentCredentials } from './config.cjs';
|
|
4
4
|
export { AgentConfigResult, LoadAgentConfigFromEnvOptions, loadAgentConfig, loadAgentConfigFromEnv } from './config.cjs';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { S as
|
|
13
|
-
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import './
|
|
18
|
-
import '
|
|
5
|
+
import { L as Logger } from './logger-CABQOnlR.cjs';
|
|
6
|
+
import { P as PlatformRuntime, a as PlatformRuntimeOptions, R as RuntimeLifecycleState } from './schemas-BKnh4fKR.cjs';
|
|
7
|
+
export { A as AgentRuntime, B as BandLink, D as DefaultPreprocessor, E as ExecutionContextOptions, b as ExecutionLifecycleState, M as MCP_SERVER_NAME, c as MCP_TOOL_PREFIX, T as TOOL_MODELS, d as deriveDefaultRestUrl } from './schemas-BKnh4fKR.cjs';
|
|
8
|
+
import { P as PlatformMessage } from './types-DtcOLALn.cjs';
|
|
9
|
+
export { A as AgentConfig, a as AgentInput, C as ContactEvent, b as ContactEventCallback, c as ContactEventConfig, d as ContactEventStrategy, e as ConversationContext, H as HistoryProvider, M as MessageHandler, f as PlatformEvent, R as ReconnectedEvent, S as SessionConfig } from './types-DtcOLALn.cjs';
|
|
10
|
+
export { W as WebSocketConflictPolicy, a as WebSocketDisconnectError, b as WebSocketDisconnectReason } from './disconnectReason-Cctmg1SN.cjs';
|
|
11
|
+
export { C as CustomToolDef } from './customTools-Bfecd0mJ.cjs';
|
|
12
|
+
export { A as A2AAdapter, a as A2AAdapterOptions, b as A2AGatewayAdapter, c as ACPClientAdapter, d as ACPClientAdapterBaseOptions, e as ACPClientAdapterOptions, f as ACPClientStdioOptions, g as ACPClientTcpOptions, h as ACPConfigRequest, i as ACPConfigSelections, j as AnthropicAdapter, k as AnthropicAdapterOptions, C as CODEX_REASONING_EFFORTS, l as CODEX_REASONING_SUMMARIES, m as CODEX_WEB_SEARCH_MODES, n as ClaudePermissionMode, o as ClaudeSDKAdapter, p as ClaudeSDKAdapterOptions, q as CodexAdapter, r as CodexAdapterConfig, s as CodexApprovalPolicy, t as CodexReasoningEffort, u as CodexReasoningSummary, v as CodexSandboxMode, w as CodexWebSearchMode, x as CopilotACPAdapter, y as CopilotACPAdapterOptions, z as CopilotACPStdioOptions, B as CopilotACPTcpOptions, D as DEFAULT_COPILOT_ACP_COMMAND, E as DEFAULT_OMP_ACP_COMMAND, G as GeminiAdapter, F as GeminiAdapterOptions, H as GenericAdapter, I as GenericAdapterHandler, J as GoogleADKAdapter, K as GoogleADKAdapterOptions, L as LangGraphAdapter, M as LangGraphAdapterOptions, N as LangGraphGraph, O as LettaAdapter, P as LettaAdapterOptions, Q as OmpACPAdapter, R as OmpACPAdapterOptions, S as OpenAIAdapter, T as OpenAIAdapterOptions, U as OpencodeAdapter, V as OpencodeAdapterConfig, W as OpencodeApprovalMode, X as OpencodeApprovalReply, Y as OpencodeQuestionMode, Z as ParlantAdapter, _ as ParlantAdapterOptions, $ as ToolCallingModel, a0 as VercelAISDKAdapter, a1 as VercelAISDKAdapterOptions } from './CopilotACPAdapter-Clid9xGR.cjs';
|
|
13
|
+
export { S as SimpleAdapter } from './simpleAdapter-D75rcz9n.cjs';
|
|
14
|
+
export { A as A2AAuth, a as A2AGatewayAdapterOptions } from './acp-client-D-I_5lK-.cjs';
|
|
15
|
+
export { AgentFailure } from '@band-ai/band-sdk-core';
|
|
16
|
+
export { DeliveryFailedError, ProviderTurnFailedError, RecoverableTurnError, agentFailure, deliverReply, reportTurnFailure } from './core.cjs';
|
|
17
|
+
import './dtos-CjQsN1_h.cjs';
|
|
18
|
+
import './types-42-HWeX8.cjs';
|
|
19
|
+
import './pagination-BZDhB_nO.cjs';
|
|
19
20
|
import 'zod';
|
|
20
|
-
import './backends-
|
|
21
|
-
import './sdk-
|
|
21
|
+
import './backends-Dh2WXcHQ.cjs';
|
|
22
|
+
import './sdk-CXNqzoY1.cjs';
|
|
22
23
|
import '@anthropic-ai/claude-agent-sdk';
|
|
24
|
+
import '@agentclientprotocol/sdk';
|
|
23
25
|
|
|
24
26
|
interface AgentCreateOptions extends Omit<PlatformRuntimeOptions, "agentId" | "apiKey" | "wsUrl" | "restUrl"> {
|
|
25
27
|
adapter: FrameworkAdapter;
|
|
@@ -39,16 +41,53 @@ interface AgentCreateOptions extends Omit<PlatformRuntimeOptions, "agentId" | "a
|
|
|
39
41
|
declare class Agent {
|
|
40
42
|
private readonly platformRuntime;
|
|
41
43
|
private readonly adapter;
|
|
42
|
-
private
|
|
43
|
-
private
|
|
44
|
+
private readonly lifecycle;
|
|
45
|
+
private readonly logger;
|
|
46
|
+
private readonly startGate;
|
|
47
|
+
private readonly stopGate;
|
|
44
48
|
private shutdownTimeoutMs;
|
|
45
|
-
constructor(runtime: PlatformRuntime, adapter: FrameworkAdapter);
|
|
49
|
+
constructor(runtime: PlatformRuntime, adapter: FrameworkAdapter, logger?: Logger);
|
|
46
50
|
/** Build an Agent from credentials and a framework adapter. */
|
|
47
51
|
static create(options: AgentCreateOptions): Agent;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the agent is currently started.
|
|
54
|
+
*
|
|
55
|
+
* `false` while a `start()` call is still in flight — it only turns `true`
|
|
56
|
+
* once that call has resolved — and `false` again once the agent is stopped.
|
|
57
|
+
*
|
|
58
|
+
* @deprecated Read {@link Agent.state} instead, which also distinguishes
|
|
59
|
+
* `"starting"`, `"stopping"` and `"failed"` from a plain `"not_started"`.
|
|
60
|
+
*/
|
|
48
61
|
get isRunning(): boolean;
|
|
62
|
+
/** Current lifecycle state of this agent. */
|
|
63
|
+
get state(): RuntimeLifecycleState;
|
|
64
|
+
/**
|
|
65
|
+
* The underlying `PlatformRuntime`, for reading its `link`/`getContext()`/etc.
|
|
66
|
+
*
|
|
67
|
+
* Do not call `runtime.start()`/`runtime.stop()` directly: `Agent` keeps its
|
|
68
|
+
* own lifecycle tracker, so driving `PlatformRuntime`'s independently leaves
|
|
69
|
+
* `agent.state` reporting stale information. Use {@link Agent.start}/
|
|
70
|
+
* {@link Agent.stop} instead.
|
|
71
|
+
*/
|
|
49
72
|
get runtime(): PlatformRuntime;
|
|
73
|
+
/**
|
|
74
|
+
* Start the agent.
|
|
75
|
+
*
|
|
76
|
+
* Repeated or concurrent calls join the in-flight start. Calling `start()`
|
|
77
|
+
* while a `stop()` is still in flight rejects with a `RuntimeStateError`.
|
|
78
|
+
*/
|
|
50
79
|
start(): Promise<void>;
|
|
80
|
+
private runStart;
|
|
81
|
+
/**
|
|
82
|
+
* Stop the agent.
|
|
83
|
+
*
|
|
84
|
+
* A concurrent second call joins the in-flight teardown and mirrors its
|
|
85
|
+
* outcome — including rejecting with the *same* `Error` instance. A rejected
|
|
86
|
+
* `stop()` is not treated as a completed one: the next `stop()` reports the
|
|
87
|
+
* same failure, and a `start()` re-arms teardown.
|
|
88
|
+
*/
|
|
51
89
|
stop(timeoutMs?: number | null): Promise<boolean>;
|
|
90
|
+
private runStop;
|
|
52
91
|
runForever(): Promise<void>;
|
|
53
92
|
bootstrapRoomMessage(roomId: string, message: PlatformMessage): Promise<void>;
|
|
54
93
|
resetRoomSession(roomId: string, timeoutMs?: number): Promise<boolean>;
|
|
@@ -62,4 +101,4 @@ declare class Agent {
|
|
|
62
101
|
|
|
63
102
|
declare function isDirectExecution(importMetaUrl: string): boolean;
|
|
64
103
|
|
|
65
|
-
export { Agent, type AgentCreateOptions, AgentCredentials, FrameworkAdapter, PlatformMessage, PlatformRuntime, PlatformRuntimeOptions, isDirectExecution };
|
|
104
|
+
export { Agent, type AgentCreateOptions, AgentCredentials, FrameworkAdapter, PlatformMessage, PlatformRuntime, PlatformRuntimeOptions, RuntimeLifecycleState, isDirectExecution };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { F as FrameworkAdapter } from './protocols-
|
|
2
|
-
export { A as AdapterToolsProtocol,
|
|
1
|
+
import { F as FrameworkAdapter } from './protocols-Dpci6uae.js';
|
|
2
|
+
export { A as AdapterToolsProtocol, b as AgentToolsProtocol, C as ContactTools, c as FAILURE_EVENT_TYPE, d as FAILURE_METADATA_KEY, a as FrameworkAdapterInput, H as HistoryConverter, M as MemoryTools, e as MessagingTools, f as ParticipantTools, g as PeerLookupTools, h as Preprocessor, R as RoomParticipantTools, T as ToolExecutor, i as ToolSchemaProvider, t as toFailureEvent } from './protocols-Dpci6uae.js';
|
|
3
3
|
import { AgentCredentials } from './config.js';
|
|
4
4
|
export { AgentConfigResult, LoadAgentConfigFromEnvOptions, loadAgentConfig, loadAgentConfigFromEnv } from './config.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { S as
|
|
13
|
-
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import './
|
|
18
|
-
import '
|
|
5
|
+
import { L as Logger } from './logger-CABQOnlR.js';
|
|
6
|
+
import { P as PlatformRuntime, a as PlatformRuntimeOptions, R as RuntimeLifecycleState } from './schemas-CDa3V_I5.js';
|
|
7
|
+
export { A as AgentRuntime, B as BandLink, D as DefaultPreprocessor, E as ExecutionContextOptions, b as ExecutionLifecycleState, M as MCP_SERVER_NAME, c as MCP_TOOL_PREFIX, T as TOOL_MODELS, d as deriveDefaultRestUrl } from './schemas-CDa3V_I5.js';
|
|
8
|
+
import { P as PlatformMessage } from './types-CKU1N0SK.js';
|
|
9
|
+
export { A as AgentConfig, a as AgentInput, C as ContactEvent, b as ContactEventCallback, c as ContactEventConfig, d as ContactEventStrategy, e as ConversationContext, H as HistoryProvider, M as MessageHandler, f as PlatformEvent, R as ReconnectedEvent, S as SessionConfig } from './types-CKU1N0SK.js';
|
|
10
|
+
export { W as WebSocketConflictPolicy, a as WebSocketDisconnectError, b as WebSocketDisconnectReason } from './disconnectReason-Cctmg1SN.js';
|
|
11
|
+
export { C as CustomToolDef } from './customTools-Bfecd0mJ.js';
|
|
12
|
+
export { A as A2AAdapter, a as A2AAdapterOptions, b as A2AGatewayAdapter, c as ACPClientAdapter, d as ACPClientAdapterBaseOptions, e as ACPClientAdapterOptions, f as ACPClientStdioOptions, g as ACPClientTcpOptions, h as ACPConfigRequest, i as ACPConfigSelections, j as AnthropicAdapter, k as AnthropicAdapterOptions, C as CODEX_REASONING_EFFORTS, l as CODEX_REASONING_SUMMARIES, m as CODEX_WEB_SEARCH_MODES, n as ClaudePermissionMode, o as ClaudeSDKAdapter, p as ClaudeSDKAdapterOptions, q as CodexAdapter, r as CodexAdapterConfig, s as CodexApprovalPolicy, t as CodexReasoningEffort, u as CodexReasoningSummary, v as CodexSandboxMode, w as CodexWebSearchMode, x as CopilotACPAdapter, y as CopilotACPAdapterOptions, z as CopilotACPStdioOptions, B as CopilotACPTcpOptions, D as DEFAULT_COPILOT_ACP_COMMAND, E as DEFAULT_OMP_ACP_COMMAND, G as GeminiAdapter, F as GeminiAdapterOptions, H as GenericAdapter, I as GenericAdapterHandler, J as GoogleADKAdapter, K as GoogleADKAdapterOptions, L as LangGraphAdapter, M as LangGraphAdapterOptions, N as LangGraphGraph, O as LettaAdapter, P as LettaAdapterOptions, Q as OmpACPAdapter, R as OmpACPAdapterOptions, S as OpenAIAdapter, T as OpenAIAdapterOptions, U as OpencodeAdapter, V as OpencodeAdapterConfig, W as OpencodeApprovalMode, X as OpencodeApprovalReply, Y as OpencodeQuestionMode, Z as ParlantAdapter, _ as ParlantAdapterOptions, $ as ToolCallingModel, a0 as VercelAISDKAdapter, a1 as VercelAISDKAdapterOptions } from './CopilotACPAdapter-B_AVyAl6.js';
|
|
13
|
+
export { S as SimpleAdapter } from './simpleAdapter-eLvsAQNo.js';
|
|
14
|
+
export { A as A2AAuth, a as A2AGatewayAdapterOptions } from './acp-client-DUXyczlF.js';
|
|
15
|
+
export { AgentFailure } from '@band-ai/band-sdk-core';
|
|
16
|
+
export { DeliveryFailedError, ProviderTurnFailedError, RecoverableTurnError, agentFailure, deliverReply, reportTurnFailure } from './core.js';
|
|
17
|
+
import './dtos-CjQsN1_h.js';
|
|
18
|
+
import './types-CjxZekMH.js';
|
|
19
|
+
import './pagination-CPz0J_vQ.js';
|
|
19
20
|
import 'zod';
|
|
20
|
-
import './backends-
|
|
21
|
-
import './sdk-
|
|
21
|
+
import './backends-CgsPQa9B.js';
|
|
22
|
+
import './sdk-Cin80BTC.js';
|
|
22
23
|
import '@anthropic-ai/claude-agent-sdk';
|
|
24
|
+
import '@agentclientprotocol/sdk';
|
|
23
25
|
|
|
24
26
|
interface AgentCreateOptions extends Omit<PlatformRuntimeOptions, "agentId" | "apiKey" | "wsUrl" | "restUrl"> {
|
|
25
27
|
adapter: FrameworkAdapter;
|
|
@@ -39,16 +41,53 @@ interface AgentCreateOptions extends Omit<PlatformRuntimeOptions, "agentId" | "a
|
|
|
39
41
|
declare class Agent {
|
|
40
42
|
private readonly platformRuntime;
|
|
41
43
|
private readonly adapter;
|
|
42
|
-
private
|
|
43
|
-
private
|
|
44
|
+
private readonly lifecycle;
|
|
45
|
+
private readonly logger;
|
|
46
|
+
private readonly startGate;
|
|
47
|
+
private readonly stopGate;
|
|
44
48
|
private shutdownTimeoutMs;
|
|
45
|
-
constructor(runtime: PlatformRuntime, adapter: FrameworkAdapter);
|
|
49
|
+
constructor(runtime: PlatformRuntime, adapter: FrameworkAdapter, logger?: Logger);
|
|
46
50
|
/** Build an Agent from credentials and a framework adapter. */
|
|
47
51
|
static create(options: AgentCreateOptions): Agent;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the agent is currently started.
|
|
54
|
+
*
|
|
55
|
+
* `false` while a `start()` call is still in flight — it only turns `true`
|
|
56
|
+
* once that call has resolved — and `false` again once the agent is stopped.
|
|
57
|
+
*
|
|
58
|
+
* @deprecated Read {@link Agent.state} instead, which also distinguishes
|
|
59
|
+
* `"starting"`, `"stopping"` and `"failed"` from a plain `"not_started"`.
|
|
60
|
+
*/
|
|
48
61
|
get isRunning(): boolean;
|
|
62
|
+
/** Current lifecycle state of this agent. */
|
|
63
|
+
get state(): RuntimeLifecycleState;
|
|
64
|
+
/**
|
|
65
|
+
* The underlying `PlatformRuntime`, for reading its `link`/`getContext()`/etc.
|
|
66
|
+
*
|
|
67
|
+
* Do not call `runtime.start()`/`runtime.stop()` directly: `Agent` keeps its
|
|
68
|
+
* own lifecycle tracker, so driving `PlatformRuntime`'s independently leaves
|
|
69
|
+
* `agent.state` reporting stale information. Use {@link Agent.start}/
|
|
70
|
+
* {@link Agent.stop} instead.
|
|
71
|
+
*/
|
|
49
72
|
get runtime(): PlatformRuntime;
|
|
73
|
+
/**
|
|
74
|
+
* Start the agent.
|
|
75
|
+
*
|
|
76
|
+
* Repeated or concurrent calls join the in-flight start. Calling `start()`
|
|
77
|
+
* while a `stop()` is still in flight rejects with a `RuntimeStateError`.
|
|
78
|
+
*/
|
|
50
79
|
start(): Promise<void>;
|
|
80
|
+
private runStart;
|
|
81
|
+
/**
|
|
82
|
+
* Stop the agent.
|
|
83
|
+
*
|
|
84
|
+
* A concurrent second call joins the in-flight teardown and mirrors its
|
|
85
|
+
* outcome — including rejecting with the *same* `Error` instance. A rejected
|
|
86
|
+
* `stop()` is not treated as a completed one: the next `stop()` reports the
|
|
87
|
+
* same failure, and a `start()` re-arms teardown.
|
|
88
|
+
*/
|
|
51
89
|
stop(timeoutMs?: number | null): Promise<boolean>;
|
|
90
|
+
private runStop;
|
|
52
91
|
runForever(): Promise<void>;
|
|
53
92
|
bootstrapRoomMessage(roomId: string, message: PlatformMessage): Promise<void>;
|
|
54
93
|
resetRoomSession(roomId: string, timeoutMs?: number): Promise<boolean>;
|
|
@@ -62,4 +101,4 @@ declare class Agent {
|
|
|
62
101
|
|
|
63
102
|
declare function isDirectExecution(importMetaUrl: string): boolean;
|
|
64
103
|
|
|
65
|
-
export { Agent, type AgentCreateOptions, AgentCredentials, FrameworkAdapter, PlatformMessage, PlatformRuntime, PlatformRuntimeOptions, isDirectExecution };
|
|
104
|
+
export { Agent, type AgentCreateOptions, AgentCredentials, FrameworkAdapter, PlatformMessage, PlatformRuntime, PlatformRuntimeOptions, RuntimeLifecycleState, isDirectExecution };
|
package/dist/index.js
CHANGED
|
@@ -1,68 +1,102 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ACPClientAdapter,
|
|
2
3
|
AnthropicAdapter,
|
|
3
4
|
CODEX_REASONING_EFFORTS,
|
|
4
5
|
CODEX_REASONING_SUMMARIES,
|
|
5
6
|
CODEX_WEB_SEARCH_MODES,
|
|
6
7
|
ClaudeSDKAdapter,
|
|
7
8
|
CodexAdapter,
|
|
9
|
+
CopilotACPAdapter,
|
|
10
|
+
DEFAULT_COPILOT_ACP_COMMAND,
|
|
11
|
+
DEFAULT_OMP_ACP_COMMAND,
|
|
8
12
|
GeminiAdapter,
|
|
9
13
|
GenericAdapter,
|
|
10
14
|
GoogleADKAdapter,
|
|
11
15
|
LangGraphAdapter,
|
|
12
16
|
LettaAdapter,
|
|
17
|
+
OmpACPAdapter,
|
|
13
18
|
OpenAIAdapter,
|
|
14
19
|
OpencodeAdapter,
|
|
15
20
|
VercelAISDKAdapter
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-UFO6XMCV.js";
|
|
22
|
+
import "./chunk-UL3Y5C4J.js";
|
|
23
|
+
import "./chunk-JDW5WSGF.js";
|
|
19
24
|
import {
|
|
20
25
|
loadAgentConfig,
|
|
21
26
|
loadAgentConfigFromEnv
|
|
22
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VOMJRQOM.js";
|
|
23
28
|
import {
|
|
24
29
|
A2AAdapter,
|
|
25
30
|
A2AGatewayAdapter,
|
|
26
31
|
ParlantAdapter
|
|
27
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-HNWZZXAE.js";
|
|
28
33
|
import {
|
|
29
|
-
|
|
30
|
-
} from "./chunk-
|
|
34
|
+
AgentFailure
|
|
35
|
+
} from "./chunk-I34SXMTJ.js";
|
|
36
|
+
import {
|
|
37
|
+
DeliveryFailedError,
|
|
38
|
+
ProviderTurnFailedError,
|
|
39
|
+
SimpleAdapter,
|
|
40
|
+
agentFailure,
|
|
41
|
+
deliverReply,
|
|
42
|
+
reportTurnFailure
|
|
43
|
+
} from "./chunk-OGOXY43L.js";
|
|
31
44
|
import {
|
|
32
45
|
AgentRuntime,
|
|
33
46
|
BandLink,
|
|
34
47
|
DefaultPreprocessor,
|
|
48
|
+
LifecycleTracker,
|
|
35
49
|
PlatformRuntime,
|
|
50
|
+
SingleFlight,
|
|
36
51
|
deriveDefaultRestUrl,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
isLegalRuntimeTransition,
|
|
53
|
+
runWithGracefulShutdown,
|
|
54
|
+
startWithGate
|
|
55
|
+
} from "./chunk-6TGXV5TE.js";
|
|
56
|
+
import "./chunk-CBCHTTUY.js";
|
|
57
|
+
import "./chunk-RJNJUISR.js";
|
|
41
58
|
import {
|
|
42
59
|
MCP_SERVER_NAME,
|
|
43
60
|
MCP_TOOL_PREFIX,
|
|
44
61
|
TOOL_MODELS
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import "./chunk-F63TPOI3.js";
|
|
62
|
+
} from "./chunk-SHZBLLDQ.js";
|
|
47
63
|
import {
|
|
48
64
|
WebSocketDisconnectError
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import
|
|
54
|
-
|
|
65
|
+
} from "./chunk-UENIC5FJ.js";
|
|
66
|
+
import "./chunk-OVXVZUPO.js";
|
|
67
|
+
import "./chunk-JIZE4EC6.js";
|
|
68
|
+
import "./chunk-6BE2EG5P.js";
|
|
69
|
+
import {
|
|
70
|
+
FAILURE_EVENT_TYPE,
|
|
71
|
+
FAILURE_METADATA_KEY,
|
|
72
|
+
toFailureEvent
|
|
73
|
+
} from "./chunk-TGDDFBYS.js";
|
|
74
|
+
import {
|
|
75
|
+
resolveLogger
|
|
76
|
+
} from "./chunk-ZYOXI4JL.js";
|
|
77
|
+
import {
|
|
78
|
+
RecoverableTurnError
|
|
79
|
+
} from "./chunk-4OVNFDD7.js";
|
|
55
80
|
|
|
56
81
|
// src/agent/Agent.ts
|
|
57
82
|
var Agent = class _Agent {
|
|
58
83
|
platformRuntime;
|
|
59
84
|
adapter;
|
|
60
|
-
|
|
61
|
-
|
|
85
|
+
lifecycle;
|
|
86
|
+
logger;
|
|
87
|
+
startGate = new SingleFlight();
|
|
88
|
+
stopGate = new SingleFlight();
|
|
62
89
|
shutdownTimeoutMs = 3e4;
|
|
63
|
-
constructor(runtime, adapter) {
|
|
90
|
+
constructor(runtime, adapter, logger) {
|
|
64
91
|
this.platformRuntime = runtime;
|
|
65
92
|
this.adapter = adapter;
|
|
93
|
+
this.logger = resolveLogger(logger);
|
|
94
|
+
this.lifecycle = new LifecycleTracker({ status: "not_started" }, {
|
|
95
|
+
owner: "Agent",
|
|
96
|
+
logContext: { agentId: runtime.agentId },
|
|
97
|
+
logger: this.logger,
|
|
98
|
+
isLegalTransition: isLegalRuntimeTransition
|
|
99
|
+
});
|
|
66
100
|
}
|
|
67
101
|
/** Build an Agent from credentials and a framework adapter. */
|
|
68
102
|
static create(options) {
|
|
@@ -83,44 +117,103 @@ var Agent = class _Agent {
|
|
|
83
117
|
...wsUrl !== void 0 || config?.wsUrl !== void 0 ? { wsUrl: wsUrl ?? config?.wsUrl } : {},
|
|
84
118
|
...restUrl !== void 0 || config?.restUrl !== void 0 ? { restUrl: restUrl ?? config?.restUrl } : {}
|
|
85
119
|
});
|
|
86
|
-
const agent = new _Agent(runtime, adapter);
|
|
120
|
+
const agent = new _Agent(runtime, adapter, runtimeOptions.logger);
|
|
87
121
|
agent.shutdownTimeoutMs = shutdownTimeoutMs === void 0 ? 3e4 : shutdownTimeoutMs;
|
|
88
122
|
return agent;
|
|
89
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Whether the agent is currently started.
|
|
126
|
+
*
|
|
127
|
+
* `false` while a `start()` call is still in flight — it only turns `true`
|
|
128
|
+
* once that call has resolved — and `false` again once the agent is stopped.
|
|
129
|
+
*
|
|
130
|
+
* @deprecated Read {@link Agent.state} instead, which also distinguishes
|
|
131
|
+
* `"starting"`, `"stopping"` and `"failed"` from a plain `"not_started"`.
|
|
132
|
+
*/
|
|
90
133
|
get isRunning() {
|
|
91
|
-
return this.
|
|
134
|
+
return this.lifecycle.is("running");
|
|
135
|
+
}
|
|
136
|
+
/** Current lifecycle state of this agent. */
|
|
137
|
+
get state() {
|
|
138
|
+
return this.lifecycle.state;
|
|
92
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* The underlying `PlatformRuntime`, for reading its `link`/`getContext()`/etc.
|
|
142
|
+
*
|
|
143
|
+
* Do not call `runtime.start()`/`runtime.stop()` directly: `Agent` keeps its
|
|
144
|
+
* own lifecycle tracker, so driving `PlatformRuntime`'s independently leaves
|
|
145
|
+
* `agent.state` reporting stale information. Use {@link Agent.start}/
|
|
146
|
+
* {@link Agent.stop} instead.
|
|
147
|
+
*/
|
|
93
148
|
get runtime() {
|
|
94
149
|
return this.platformRuntime;
|
|
95
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Start the agent.
|
|
153
|
+
*
|
|
154
|
+
* Repeated or concurrent calls join the in-flight start. Calling `start()`
|
|
155
|
+
* while a `stop()` is still in flight rejects with a `RuntimeStateError`.
|
|
156
|
+
*/
|
|
96
157
|
async start() {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.startPromise = null;
|
|
104
|
-
throw error;
|
|
158
|
+
await startWithGate({
|
|
159
|
+
lifecycle: this.lifecycle,
|
|
160
|
+
startGate: this.startGate,
|
|
161
|
+
stopGate: this.stopGate,
|
|
162
|
+
ownerName: "Agent",
|
|
163
|
+
runStart: () => this.runStart()
|
|
105
164
|
});
|
|
106
|
-
return this.startPromise;
|
|
107
165
|
}
|
|
166
|
+
async runStart() {
|
|
167
|
+
const startState = this.lifecycle.state;
|
|
168
|
+
try {
|
|
169
|
+
await this.platformRuntime.start(this.adapter);
|
|
170
|
+
} catch (error) {
|
|
171
|
+
if (this.lifecycle.isCurrent(startState)) {
|
|
172
|
+
this.lifecycle.fail(error, "start-failed");
|
|
173
|
+
}
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
if (this.lifecycle.isCurrent(startState)) {
|
|
177
|
+
this.lifecycle.transition({ status: "running" }, "started");
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Stop the agent.
|
|
182
|
+
*
|
|
183
|
+
* A concurrent second call joins the in-flight teardown and mirrors its
|
|
184
|
+
* outcome — including rejecting with the *same* `Error` instance. A rejected
|
|
185
|
+
* `stop()` is not treated as a completed one: the next `stop()` reports the
|
|
186
|
+
* same failure, and a `start()` re-arms teardown.
|
|
187
|
+
*/
|
|
108
188
|
async stop(timeoutMs) {
|
|
109
|
-
|
|
189
|
+
return await this.stopGate.run(() => this.runStop(timeoutMs));
|
|
190
|
+
}
|
|
191
|
+
async runStop(timeoutMs) {
|
|
192
|
+
if (this.lifecycle.is("failed")) {
|
|
193
|
+
this.logger.debug("Agent stop is resurfacing the recorded start failure", { error: this.lifecycle.state.error });
|
|
194
|
+
throw this.lifecycle.state.error;
|
|
195
|
+
}
|
|
196
|
+
if (!this.lifecycle.is("starting") && !this.lifecycle.is("running")) {
|
|
110
197
|
return true;
|
|
111
198
|
}
|
|
112
|
-
|
|
199
|
+
const pendingStart = this.lifecycle.is("starting") ? this.startGate.pending : null;
|
|
200
|
+
this.startGate.reset();
|
|
201
|
+
this.lifecycle.transition({ status: "stopping" }, "stop");
|
|
202
|
+
const stopping = this.platformRuntime.stop(timeoutMs ?? void 0);
|
|
203
|
+
if (pendingStart) {
|
|
113
204
|
try {
|
|
114
|
-
await
|
|
115
|
-
} catch {
|
|
116
|
-
|
|
205
|
+
await pendingStart;
|
|
206
|
+
} catch (error) {
|
|
207
|
+
this.logger.debug("Agent stop superseded the in-flight start", { error });
|
|
117
208
|
}
|
|
118
209
|
}
|
|
119
210
|
try {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
211
|
+
const graceful = await stopping;
|
|
212
|
+
this.lifecycle.transition({ status: "stopped" }, "stopped");
|
|
213
|
+
return graceful;
|
|
214
|
+
} catch (error) {
|
|
215
|
+
this.lifecycle.fail(error, "stop-failed");
|
|
216
|
+
throw error;
|
|
124
217
|
}
|
|
125
218
|
}
|
|
126
219
|
async runForever() {
|
|
@@ -173,7 +266,9 @@ function isDirectExecution(importMetaUrl) {
|
|
|
173
266
|
export {
|
|
174
267
|
A2AAdapter,
|
|
175
268
|
A2AGatewayAdapter,
|
|
269
|
+
ACPClientAdapter,
|
|
176
270
|
Agent,
|
|
271
|
+
AgentFailure,
|
|
177
272
|
AgentRuntime,
|
|
178
273
|
AnthropicAdapter,
|
|
179
274
|
BandLink,
|
|
@@ -182,7 +277,13 @@ export {
|
|
|
182
277
|
CODEX_WEB_SEARCH_MODES,
|
|
183
278
|
ClaudeSDKAdapter,
|
|
184
279
|
CodexAdapter,
|
|
280
|
+
CopilotACPAdapter,
|
|
281
|
+
DEFAULT_COPILOT_ACP_COMMAND,
|
|
282
|
+
DEFAULT_OMP_ACP_COMMAND,
|
|
185
283
|
DefaultPreprocessor,
|
|
284
|
+
DeliveryFailedError,
|
|
285
|
+
FAILURE_EVENT_TYPE,
|
|
286
|
+
FAILURE_METADATA_KEY,
|
|
186
287
|
GeminiAdapter,
|
|
187
288
|
GenericAdapter,
|
|
188
289
|
GoogleADKAdapter,
|
|
@@ -190,16 +291,23 @@ export {
|
|
|
190
291
|
LettaAdapter,
|
|
191
292
|
MCP_SERVER_NAME,
|
|
192
293
|
MCP_TOOL_PREFIX,
|
|
294
|
+
OmpACPAdapter,
|
|
193
295
|
OpenAIAdapter,
|
|
194
296
|
OpencodeAdapter,
|
|
195
297
|
ParlantAdapter,
|
|
196
298
|
PlatformRuntime,
|
|
299
|
+
ProviderTurnFailedError,
|
|
300
|
+
RecoverableTurnError,
|
|
197
301
|
SimpleAdapter,
|
|
198
302
|
TOOL_MODELS,
|
|
199
303
|
VercelAISDKAdapter,
|
|
200
304
|
WebSocketDisconnectError,
|
|
305
|
+
agentFailure,
|
|
306
|
+
deliverReply,
|
|
201
307
|
deriveDefaultRestUrl,
|
|
202
308
|
isDirectExecution,
|
|
203
309
|
loadAgentConfig,
|
|
204
|
-
loadAgentConfigFromEnv
|
|
310
|
+
loadAgentConfigFromEnv,
|
|
311
|
+
reportTurnFailure,
|
|
312
|
+
toFailureEvent
|
|
205
313
|
};
|
package/dist/linear.cjs
CHANGED
|
@@ -81,14 +81,52 @@ var UnsupportedFeatureError = class extends BandSdkError {
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
+
// src/core/sensitiveTerms.ts
|
|
85
|
+
var SENSITIVE_KEY_TERMS = "authorization|api[-_ ]?key|token|secret|password|cookie";
|
|
86
|
+
var GATEWAY_FREE_TEXT_SENSITIVE_KEY_TERMS = `${SENSITIVE_KEY_TERMS}|session`;
|
|
87
|
+
|
|
84
88
|
// src/core/logger.ts
|
|
85
89
|
var noop = () => void 0;
|
|
90
|
+
var SENSITIVE_KEY_PATTERN = new RegExp(`(${SENSITIVE_KEY_TERMS})`, "i");
|
|
86
91
|
var NoopLogger = class {
|
|
87
92
|
debug = noop;
|
|
88
93
|
info = noop;
|
|
89
94
|
warn = noop;
|
|
90
95
|
error = noop;
|
|
91
96
|
};
|
|
97
|
+
function resolveLogger(logger) {
|
|
98
|
+
if (!logger) {
|
|
99
|
+
return new NoopLogger();
|
|
100
|
+
}
|
|
101
|
+
return logger instanceof GuardedLogger ? logger : new GuardedLogger(logger);
|
|
102
|
+
}
|
|
103
|
+
var GuardedLogger = class {
|
|
104
|
+
constructor(inner) {
|
|
105
|
+
this.inner = inner;
|
|
106
|
+
}
|
|
107
|
+
debug(message, context) {
|
|
108
|
+
return this.emit("debug", message, context);
|
|
109
|
+
}
|
|
110
|
+
info(message, context) {
|
|
111
|
+
return this.emit("info", message, context);
|
|
112
|
+
}
|
|
113
|
+
warn(message, context) {
|
|
114
|
+
return this.emit("warn", message, context);
|
|
115
|
+
}
|
|
116
|
+
error(message, context) {
|
|
117
|
+
return this.emit("error", message, context);
|
|
118
|
+
}
|
|
119
|
+
emit(level, message, context) {
|
|
120
|
+
try {
|
|
121
|
+
const result = this.inner[level](message, context);
|
|
122
|
+
if (result instanceof Promise) {
|
|
123
|
+
result.catch(noop);
|
|
124
|
+
}
|
|
125
|
+
return result;
|
|
126
|
+
} catch {
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
92
130
|
|
|
93
131
|
// src/integrations/linear/handles.ts
|
|
94
132
|
function stripHandlePrefix(handle) {
|
|
@@ -210,7 +248,7 @@ var StaleSessionGuard = class {
|
|
|
210
248
|
constructor(options) {
|
|
211
249
|
this.store = options.store;
|
|
212
250
|
this.linearClient = options.linearClient;
|
|
213
|
-
this.logger = options.logger
|
|
251
|
+
this.logger = resolveLogger(options.logger);
|
|
214
252
|
this.checkIntervalMs = options.checkIntervalMs ?? STALE_SESSION_CHECK_INTERVAL_MS;
|
|
215
253
|
this.staleThresholdMs = options.staleThresholdMs ?? STALE_SESSION_THRESHOLD_MS;
|
|
216
254
|
this.keepAliveMessage = options.keepAliveMessage ?? DEFAULT_KEEPALIVE_MESSAGE;
|
|
@@ -521,7 +559,7 @@ function getAgentSessionEventKey(payload) {
|
|
|
521
559
|
].join(":");
|
|
522
560
|
}
|
|
523
561
|
async function handleAgentSessionEvent(input, options) {
|
|
524
|
-
const logger = input.deps.logger
|
|
562
|
+
const logger = resolveLogger(input.deps.logger);
|
|
525
563
|
const config = normalizeConfig(input.config);
|
|
526
564
|
const action = normalizeAction(input.payload.action);
|
|
527
565
|
const runtime = options?.runtime ?? createLinearBridgeRuntime();
|
|
@@ -1912,9 +1950,9 @@ function createLinearTools(options) {
|
|
|
1912
1950
|
session_id: import_zod.z.string().describe("The Linear agent session ID"),
|
|
1913
1951
|
body: import_zod.z.string().describe("The message body in Markdown format")
|
|
1914
1952
|
});
|
|
1915
|
-
const issueIdInputSchema = import_zod.z.
|
|
1953
|
+
const issueIdInputSchema = import_zod.z.looseObject({
|
|
1916
1954
|
issue_id: import_zod.z.string().optional().describe("The Linear issue ID (UUID) from the session context")
|
|
1917
|
-
})
|
|
1955
|
+
});
|
|
1918
1956
|
const issueCommentLimitSchema = import_zod.z.number().int().min(1).max(50).optional().describe("Maximum number of recent comments to return");
|
|
1919
1957
|
const requiredIssueIdSchema = issueIdInputSchema;
|
|
1920
1958
|
const optionalIssueIdSchema = issueIdInputSchema;
|
|
@@ -2604,7 +2642,7 @@ var import_webhooks = require("@linear/sdk/webhooks");
|
|
|
2604
2642
|
var DISPATCH_RETRY_LIMIT = 2;
|
|
2605
2643
|
var DISPATCH_RETRY_BASE_DELAY_MS = 1e3;
|
|
2606
2644
|
function createInlineLinearBridgeDispatcher(options) {
|
|
2607
|
-
const logger = options?.logger
|
|
2645
|
+
const logger = resolveLogger(options?.logger);
|
|
2608
2646
|
const runtime = createLinearBridgeRuntime();
|
|
2609
2647
|
return {
|
|
2610
2648
|
dispatch: async (job) => {
|
|
@@ -2646,7 +2684,7 @@ function createInlineLinearBridgeDispatcher(options) {
|
|
|
2646
2684
|
};
|
|
2647
2685
|
}
|
|
2648
2686
|
function createInProcessLinearBridgeDispatcher(options) {
|
|
2649
|
-
const logger = options?.logger
|
|
2687
|
+
const logger = resolveLogger(options?.logger);
|
|
2650
2688
|
const runtime = createLinearBridgeRuntime();
|
|
2651
2689
|
const queued = /* @__PURE__ */ new Set();
|
|
2652
2690
|
const inFlight = /* @__PURE__ */ new Set();
|
|
@@ -2728,7 +2766,7 @@ function createInProcessLinearBridgeDispatcher(options) {
|
|
|
2728
2766
|
};
|
|
2729
2767
|
}
|
|
2730
2768
|
function createLinearWebhookHandler(options) {
|
|
2731
|
-
const logger = options.deps.logger
|
|
2769
|
+
const logger = resolveLogger(options.deps.logger);
|
|
2732
2770
|
const runtime = createLinearBridgeRuntime();
|
|
2733
2771
|
const dispatcher = options.dispatcher ?? createInlineLinearBridgeDispatcher({ logger });
|
|
2734
2772
|
const webhookClient = new import_webhooks.LinearWebhookClient(options.config.linearWebhookSecret);
|
package/dist/linear.d.cts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { LinearClient, LinearDocument } from '@linear/sdk';
|
|
2
|
-
import { R as RestApi } from './types-
|
|
2
|
+
import { R as RestApi } from './types-42-HWeX8.cjs';
|
|
3
3
|
import { AppUserNotificationWebhookPayloadWithNotification, AgentSessionEventWebhookPayload, AppUserTeamAccessChangedWebhookPayload, OAuthAppWebhookPayload } from '@linear/sdk/webhooks';
|
|
4
4
|
import { L as Logger } from './logger-CABQOnlR.cjs';
|
|
5
|
-
import { C as CustomToolDef } from './customTools-
|
|
5
|
+
import { C as CustomToolDef } from './customTools-Bfecd0mJ.cjs';
|
|
6
6
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
7
|
-
import './dtos-
|
|
7
|
+
import './dtos-CjQsN1_h.cjs';
|
|
8
|
+
import '@band-ai/band-sdk-core';
|
|
8
9
|
import 'zod';
|
|
9
10
|
|
|
10
11
|
interface CandidateRepositoryInput {
|