@tylerl0706/ahpx 0.2.9 → 0.2.10

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/bin.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  createLogger,
12
12
  ensureFileUri,
13
13
  setVerbose
14
- } from "./chunk-TCJ6NC7B.js";
14
+ } from "./chunk-646D2XNX.js";
15
15
 
16
16
  // src/bin.ts
17
17
  import { randomUUID as randomUUID3 } from "crypto";
@@ -39,6 +39,19 @@ var ActionType = /* @__PURE__ */ ((ActionType2) => {
39
39
  return ActionType2;
40
40
  })(ActionType || {});
41
41
 
42
+ // src/protocol/notifications.ts
43
+ var AuthRequiredReason = /* @__PURE__ */ ((AuthRequiredReason2) => {
44
+ AuthRequiredReason2["Required"] = "required";
45
+ AuthRequiredReason2["Expired"] = "expired";
46
+ return AuthRequiredReason2;
47
+ })(AuthRequiredReason || {});
48
+ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
49
+ NotificationType2["SessionAdded"] = "notify/sessionAdded";
50
+ NotificationType2["SessionRemoved"] = "notify/sessionRemoved";
51
+ NotificationType2["AuthRequired"] = "notify/authRequired";
52
+ return NotificationType2;
53
+ })(NotificationType || {});
54
+
42
55
  // src/client/protocol.ts
43
56
  import { EventEmitter } from "events";
44
57
  var RpcError = class extends Error {
@@ -139,6 +152,12 @@ var ProtocolLayer = class extends EventEmitter {
139
152
  };
140
153
 
141
154
  // src/protocol/state.ts
155
+ var PolicyState = /* @__PURE__ */ ((PolicyState2) => {
156
+ PolicyState2["Enabled"] = "enabled";
157
+ PolicyState2["Disabled"] = "disabled";
158
+ PolicyState2["Unconfigured"] = "unconfigured";
159
+ return PolicyState2;
160
+ })(PolicyState || {});
142
161
  var PendingMessageKind = /* @__PURE__ */ ((PendingMessageKind2) => {
143
162
  PendingMessageKind2["Steering"] = "steering";
144
163
  PendingMessageKind2["Queued"] = "queued";
@@ -156,6 +175,18 @@ var SessionStatus = /* @__PURE__ */ ((SessionStatus2) => {
156
175
  SessionStatus2["Error"] = "error";
157
176
  return SessionStatus2;
158
177
  })(SessionStatus || {});
178
+ var TurnState = /* @__PURE__ */ ((TurnState2) => {
179
+ TurnState2["Complete"] = "complete";
180
+ TurnState2["Cancelled"] = "cancelled";
181
+ TurnState2["Error"] = "error";
182
+ return TurnState2;
183
+ })(TurnState || {});
184
+ var AttachmentType = /* @__PURE__ */ ((AttachmentType2) => {
185
+ AttachmentType2["File"] = "file";
186
+ AttachmentType2["Directory"] = "directory";
187
+ AttachmentType2["Selection"] = "selection";
188
+ return AttachmentType2;
189
+ })(AttachmentType || {});
159
190
  var ResponsePartKind = /* @__PURE__ */ ((ResponsePartKind2) => {
160
191
  ResponsePartKind2["Markdown"] = "markdown";
161
192
  ResponsePartKind2["ContentRef"] = "contentRef";
@@ -172,6 +203,32 @@ var ToolCallStatus = /* @__PURE__ */ ((ToolCallStatus2) => {
172
203
  ToolCallStatus2["Cancelled"] = "cancelled";
173
204
  return ToolCallStatus2;
174
205
  })(ToolCallStatus || {});
206
+ var ToolCallConfirmationReason = /* @__PURE__ */ ((ToolCallConfirmationReason2) => {
207
+ ToolCallConfirmationReason2["NotNeeded"] = "not-needed";
208
+ ToolCallConfirmationReason2["UserAction"] = "user-action";
209
+ ToolCallConfirmationReason2["Setting"] = "setting";
210
+ return ToolCallConfirmationReason2;
211
+ })(ToolCallConfirmationReason || {});
212
+ var ToolCallCancellationReason = /* @__PURE__ */ ((ToolCallCancellationReason2) => {
213
+ ToolCallCancellationReason2["Denied"] = "denied";
214
+ ToolCallCancellationReason2["Skipped"] = "skipped";
215
+ ToolCallCancellationReason2["ResultDenied"] = "result-denied";
216
+ return ToolCallCancellationReason2;
217
+ })(ToolCallCancellationReason || {});
218
+ var ToolResultContentType = /* @__PURE__ */ ((ToolResultContentType2) => {
219
+ ToolResultContentType2["Text"] = "text";
220
+ ToolResultContentType2["EmbeddedResource"] = "embeddedResource";
221
+ ToolResultContentType2["Resource"] = "resource";
222
+ ToolResultContentType2["FileEdit"] = "fileEdit";
223
+ return ToolResultContentType2;
224
+ })(ToolResultContentType || {});
225
+ var CustomizationStatus = /* @__PURE__ */ ((CustomizationStatus2) => {
226
+ CustomizationStatus2["Loading"] = "loading";
227
+ CustomizationStatus2["Loaded"] = "loaded";
228
+ CustomizationStatus2["Degraded"] = "degraded";
229
+ CustomizationStatus2["Error"] = "error";
230
+ return CustomizationStatus2;
231
+ })(CustomizationStatus || {});
175
232
 
176
233
  // src/client/session-handle.ts
177
234
  import { randomUUID } from "crypto";
@@ -2404,14 +2461,23 @@ function encodeFilePathComponents(filePath) {
2404
2461
 
2405
2462
  export {
2406
2463
  ActionType,
2464
+ AuthRequiredReason,
2465
+ NotificationType,
2407
2466
  RpcError,
2408
2467
  RpcTimeoutError,
2409
2468
  ProtocolLayer,
2469
+ PolicyState,
2410
2470
  PendingMessageKind,
2411
2471
  SessionLifecycle,
2412
2472
  SessionStatus,
2473
+ TurnState,
2474
+ AttachmentType,
2413
2475
  ResponsePartKind,
2414
2476
  ToolCallStatus,
2477
+ ToolCallConfirmationReason,
2478
+ ToolCallCancellationReason,
2479
+ ToolResultContentType,
2480
+ CustomizationStatus,
2415
2481
  SessionHandle,
2416
2482
  StateMirror,
2417
2483
  Transport,
package/dist/index.d.ts CHANGED
@@ -111,7 +111,7 @@ interface IProtectedResourceMetadata {
111
111
  *
112
112
  * @category Root State
113
113
  */
114
- declare const enum PolicyState {
114
+ declare enum PolicyState {
115
115
  Enabled = "enabled",
116
116
  Disabled = "disabled",
117
117
  Unconfigured = "unconfigured"
@@ -181,7 +181,7 @@ interface ISessionModelInfo {
181
181
  *
182
182
  * @category Pending Message Types
183
183
  */
184
- declare const enum PendingMessageKind {
184
+ declare enum PendingMessageKind {
185
185
  /** Injected into the current turn at a convenient point */
186
186
  Steering = "steering",
187
187
  /** Sent automatically as a new turn after the current turn finishes */
@@ -207,7 +207,7 @@ interface IPendingMessage {
207
207
  *
208
208
  * @category Session State
209
209
  */
210
- declare const enum SessionLifecycle {
210
+ declare enum SessionLifecycle {
211
211
  Creating = "creating",
212
212
  Ready = "ready",
213
213
  CreationFailed = "creationFailed"
@@ -217,7 +217,7 @@ declare const enum SessionLifecycle {
217
217
  *
218
218
  * @category Session State
219
219
  */
220
- declare const enum SessionStatus {
220
+ declare enum SessionStatus {
221
221
  Idle = "idle",
222
222
  InProgress = "in-progress",
223
223
  Error = "error"
@@ -300,7 +300,7 @@ interface ISessionSummary {
300
300
  *
301
301
  * @category Turn Types
302
302
  */
303
- declare const enum TurnState {
303
+ declare enum TurnState {
304
304
  Complete = "complete",
305
305
  Cancelled = "cancelled",
306
306
  Error = "error"
@@ -310,7 +310,7 @@ declare const enum TurnState {
310
310
  *
311
311
  * @category Turn Types
312
312
  */
313
- declare const enum AttachmentType {
313
+ declare enum AttachmentType {
314
314
  File = "file",
315
315
  Directory = "directory",
316
316
  Selection = "selection"
@@ -383,7 +383,7 @@ interface IMessageAttachment {
383
383
  *
384
384
  * @category Response Parts
385
385
  */
386
- declare const enum ResponsePartKind {
386
+ declare enum ResponsePartKind {
387
387
  Markdown = "markdown",
388
388
  ContentRef = "contentRef",
389
389
  ToolCall = "toolCall",
@@ -457,7 +457,7 @@ type IResponsePart = IMarkdownResponsePart | IResourceReponsePart | IToolCallRes
457
457
  *
458
458
  * @category Tool Call Types
459
459
  */
460
- declare const enum ToolCallStatus {
460
+ declare enum ToolCallStatus {
461
461
  Streaming = "streaming",
462
462
  PendingConfirmation = "pending-confirmation",
463
463
  Running = "running",
@@ -474,7 +474,7 @@ declare const enum ToolCallStatus {
474
474
  *
475
475
  * @category Tool Call Types
476
476
  */
477
- declare const enum ToolCallConfirmationReason {
477
+ declare enum ToolCallConfirmationReason {
478
478
  NotNeeded = "not-needed",
479
479
  UserAction = "user-action",
480
480
  Setting = "setting"
@@ -484,7 +484,7 @@ declare const enum ToolCallConfirmationReason {
484
484
  *
485
485
  * @category Tool Call Types
486
486
  */
487
- declare const enum ToolCallCancellationReason {
487
+ declare enum ToolCallCancellationReason {
488
488
  Denied = "denied",
489
489
  Skipped = "skipped",
490
490
  ResultDenied = "result-denied"
@@ -709,7 +709,7 @@ interface IToolAnnotations {
709
709
  *
710
710
  * @category Tool Result Content
711
711
  */
712
- declare const enum ToolResultContentType {
712
+ declare enum ToolResultContentType {
713
713
  Text = "text",
714
714
  EmbeddedResource = "embeddedResource",
715
715
  Resource = "resource",
@@ -824,7 +824,7 @@ interface ICustomizationRef {
824
824
  *
825
825
  * @category Customization Types
826
826
  */
827
- declare const enum CustomizationStatus {
827
+ declare enum CustomizationStatus {
828
828
  /** Plugin is being loaded */
829
829
  Loading = "loading",
830
830
  /** Plugin is fully operational */
@@ -906,7 +906,7 @@ interface ISnapshot {
906
906
  *
907
907
  * @category Actions
908
908
  */
909
- declare const enum ActionType {
909
+ declare enum ActionType {
910
910
  RootAgentsChanged = "root/agentsChanged",
911
911
  RootActiveSessionsChanged = "root/activeSessionsChanged",
912
912
  SessionReady = "session/ready",
@@ -1551,7 +1551,7 @@ interface IInitializeResult {
1551
1551
  *
1552
1552
  * @category Commands
1553
1553
  */
1554
- declare const enum ReconnectResultType {
1554
+ declare enum ReconnectResultType {
1555
1555
  Replay = "replay",
1556
1556
  Snapshot = "snapshot"
1557
1557
  }
@@ -1718,7 +1718,7 @@ interface IListSessionsResult {
1718
1718
  *
1719
1719
  * @category Commands
1720
1720
  */
1721
- declare const enum ContentEncoding {
1721
+ declare enum ContentEncoding {
1722
1722
  Base64 = "base64",
1723
1723
  Utf8 = "utf-8"
1724
1724
  }
@@ -2058,7 +2058,7 @@ interface IAuthenticateResult {
2058
2058
  *
2059
2059
  * @category Protocol Notifications
2060
2060
  */
2061
- declare const enum AuthRequiredReason {
2061
+ declare enum AuthRequiredReason {
2062
2062
  /** The client has not yet authenticated for the resource */
2063
2063
  Required = "required",
2064
2064
  /** A previously valid token has expired or been revoked */
@@ -2069,7 +2069,7 @@ declare const enum AuthRequiredReason {
2069
2069
  *
2070
2070
  * @category Protocol Notifications
2071
2071
  */
2072
- declare const enum NotificationType {
2072
+ declare enum NotificationType {
2073
2073
  SessionAdded = "notify/sessionAdded",
2074
2074
  SessionRemoved = "notify/sessionRemoved",
2075
2075
  AuthRequired = "notify/authRequired"
@@ -3396,4 +3396,4 @@ declare function ensureFileUri(pathOrUri: string): string;
3396
3396
  */
3397
3397
  declare function fileUriToDisplayPath(uri: string): string;
3398
3398
 
3399
- export { ActionType, ActiveClientManager, AhpClient, type AhpClientEvents, type AhpClientOptions, type AhpxEvent, AuthHandler, type AuthHandlerOptions, ConnectionPool, type ConnectionPoolOptions, type ConnectionProfile, ContentEncoding, type EventForwarder, FleetManager, type FleetManagerOptions, ForwardingFormatter, type ForwardingFormatterOptions, HealthChecker, type IActionEnvelope, type IActiveTurn, type IAgentInfo, type ICreateSessionParams, type ICustomizationRef, type IErrorInfo, type IFetchTurnsResult, type IInitializeResult, type IListSessionsResult, type IMarkdownResponsePart, type IPendingMessage, type IProtocolNotification, type IReasoningResponsePart, type IResourceCopyParams, type IResourceCopyResult, type IResourceDeleteParams, type IResourceDeleteResult, type IResourceListResult, type IResourceMoveParams, type IResourceMoveResult, type IResourceReadResult, type IResourceWriteParams, type IResourceWriteResult, type IResponsePart, type IRootState, type ISessionCustomization, type ISessionForkSource, type ISessionState, type ISessionSummary, type ISnapshot, type IStateAction, type ISubscribeResult, type IToolAnnotations, type IToolCallResponsePart, type IToolCallState, type IToolDefinition, type ITurn, type IUsageInfo, type IUserMessage, type Icon, type OpenSessionOptions, PendingMessageKind, type PromptOptions, ProtocolLayer, type ProtocolLayerOptions, ReconnectManager, type ReconnectOptions, type ReconnectOutcome, ResponsePartKind, type ResumeOutcome, type RoutingStrategy, RpcError, RpcTimeoutError, type ServerHealth, type ServerRequirements, type SessionFilter, SessionHandle, type SessionHandleEvents, SessionLifecycle, SessionPersistence, type SessionRecord, SessionStatus, SessionStore, type TurnResult as SessionTurnResult, StateMirror, type SyncResult, ToolCallStatus, Transport, type TransportOptions, type TurnSummary, type URI, WebSocketForwarder, type WebSocketForwarderOptions, WebhookForwarder, type WebhookForwarderOptions, buildTurnSummary, ensureFileUri, fileUriToDisplayPath, truncatePreview };
3399
+ export { ActionType, ActiveClientManager, AhpClient, type AhpClientEvents, type AhpClientOptions, type AhpxEvent, AttachmentType, AuthHandler, type AuthHandlerOptions, AuthRequiredReason, ConnectionPool, type ConnectionPoolOptions, type ConnectionProfile, ContentEncoding, CustomizationStatus, type EventForwarder, FleetManager, type FleetManagerOptions, ForwardingFormatter, type ForwardingFormatterOptions, HealthChecker, type IActionEnvelope, type IActiveTurn, type IAgentInfo, type ICreateSessionParams, type ICustomizationRef, type IErrorInfo, type IFetchTurnsResult, type IInitializeResult, type IListSessionsResult, type IMarkdownResponsePart, type IPendingMessage, type IProtocolNotification, type IReasoningResponsePart, type IResourceCopyParams, type IResourceCopyResult, type IResourceDeleteParams, type IResourceDeleteResult, type IResourceListResult, type IResourceMoveParams, type IResourceMoveResult, type IResourceReadResult, type IResourceWriteParams, type IResourceWriteResult, type IResponsePart, type IRootState, type ISessionCustomization, type ISessionForkSource, type ISessionState, type ISessionSummary, type ISnapshot, type IStateAction, type ISubscribeResult, type IToolAnnotations, type IToolCallResponsePart, type IToolCallState, type IToolDefinition, type ITurn, type IUsageInfo, type IUserMessage, type Icon, NotificationType, type OpenSessionOptions, PendingMessageKind, PolicyState, type PromptOptions, ProtocolLayer, type ProtocolLayerOptions, ReconnectManager, type ReconnectOptions, type ReconnectOutcome, ReconnectResultType, ResponsePartKind, type ResumeOutcome, type RoutingStrategy, RpcError, RpcTimeoutError, type ServerHealth, type ServerRequirements, type SessionFilter, SessionHandle, type SessionHandleEvents, SessionLifecycle, SessionPersistence, type SessionRecord, SessionStatus, SessionStore, type TurnResult as SessionTurnResult, StateMirror, type SyncResult, ToolCallCancellationReason, ToolCallConfirmationReason, ToolCallStatus, ToolResultContentType, Transport, type TransportOptions, TurnState, type TurnSummary, type URI, WebSocketForwarder, type WebSocketForwarderOptions, WebhookForwarder, type WebhookForwarderOptions, buildTurnSummary, ensureFileUri, fileUriToDisplayPath, truncatePreview };
package/dist/index.js CHANGED
@@ -2,10 +2,15 @@ import {
2
2
  ActionType,
3
3
  ActiveClientManager,
4
4
  AhpClient,
5
+ AttachmentType,
5
6
  AuthHandler,
7
+ AuthRequiredReason,
8
+ CustomizationStatus,
6
9
  ForwardingFormatter,
7
10
  HealthChecker,
11
+ NotificationType,
8
12
  PendingMessageKind,
13
+ PolicyState,
9
14
  ProtocolLayer,
10
15
  ReconnectManager,
11
16
  ResponsePartKind,
@@ -17,15 +22,19 @@ import {
17
22
  SessionStatus,
18
23
  SessionStore,
19
24
  StateMirror,
25
+ ToolCallCancellationReason,
26
+ ToolCallConfirmationReason,
20
27
  ToolCallStatus,
28
+ ToolResultContentType,
21
29
  Transport,
30
+ TurnState,
22
31
  WebSocketForwarder,
23
32
  WebhookForwarder,
24
33
  buildTurnSummary,
25
34
  ensureFileUri,
26
35
  fileUriToDisplayPath,
27
36
  truncatePreview
28
- } from "./chunk-TCJ6NC7B.js";
37
+ } from "./chunk-646D2XNX.js";
29
38
 
30
39
  // src/client/connection-pool.ts
31
40
  var ConnectionPool = class {
@@ -191,6 +200,11 @@ var FleetManager = class {
191
200
  };
192
201
 
193
202
  // src/protocol/commands.ts
203
+ var ReconnectResultType = /* @__PURE__ */ ((ReconnectResultType2) => {
204
+ ReconnectResultType2["Replay"] = "replay";
205
+ ReconnectResultType2["Snapshot"] = "snapshot";
206
+ return ReconnectResultType2;
207
+ })(ReconnectResultType || {});
194
208
  var ContentEncoding = /* @__PURE__ */ ((ContentEncoding2) => {
195
209
  ContentEncoding2["Base64"] = "base64";
196
210
  ContentEncoding2["Utf8"] = "utf-8";
@@ -200,15 +214,21 @@ export {
200
214
  ActionType,
201
215
  ActiveClientManager,
202
216
  AhpClient,
217
+ AttachmentType,
203
218
  AuthHandler,
219
+ AuthRequiredReason,
204
220
  ConnectionPool,
205
221
  ContentEncoding,
222
+ CustomizationStatus,
206
223
  FleetManager,
207
224
  ForwardingFormatter,
208
225
  HealthChecker,
226
+ NotificationType,
209
227
  PendingMessageKind,
228
+ PolicyState,
210
229
  ProtocolLayer,
211
230
  ReconnectManager,
231
+ ReconnectResultType,
212
232
  ResponsePartKind,
213
233
  RpcError,
214
234
  RpcTimeoutError,
@@ -218,8 +238,12 @@ export {
218
238
  SessionStatus,
219
239
  SessionStore,
220
240
  StateMirror,
241
+ ToolCallCancellationReason,
242
+ ToolCallConfirmationReason,
221
243
  ToolCallStatus,
244
+ ToolResultContentType,
222
245
  Transport,
246
+ TurnState,
223
247
  WebSocketForwarder,
224
248
  WebhookForwarder,
225
249
  buildTurnSummary,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tylerl0706/ahpx",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "type": "module",
5
5
  "description": "Agent Host Protocol client — use as a library or CLI to manage AHP server connections, sessions, and agent interactions",
6
6
  "license": "MIT",