@agentrix/shared 2.12.0 → 2.13.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/dist/{errors-B6LhjViV.d.cts → errors-B5CcMP8s.d.cts} +31 -3
- package/dist/gitlabWebhook.cjs +22 -0
- package/dist/gitlabWebhook.d.cts +8 -0
- package/dist/gitlabWebhook.mjs +19 -0
- package/dist/index.cjs +102 -2
- package/dist/index.d.cts +202 -14
- package/dist/node.cjs +302 -1
- package/dist/node.d.cts +77 -3
- package/package.json +6 -1
|
@@ -1107,6 +1107,8 @@ type AskUserResponseMessage = z.infer<typeof AskUserResponseMessageSchema>;
|
|
|
1107
1107
|
interface CompanionHeartbeatMessage {
|
|
1108
1108
|
type: 'companion_heartbeat';
|
|
1109
1109
|
timestamp: string;
|
|
1110
|
+
triggerTime?: string;
|
|
1111
|
+
triggerReasons?: string[];
|
|
1110
1112
|
}
|
|
1111
1113
|
/**
|
|
1112
1114
|
* Companion reminder message payload (Shadow → Main)
|
|
@@ -1397,6 +1399,7 @@ declare const baseTaskSchema: z.ZodObject<{
|
|
|
1397
1399
|
cwd: z.ZodOptional<z.ZodString>;
|
|
1398
1400
|
userCwd: z.ZodOptional<z.ZodString>;
|
|
1399
1401
|
forceUserCwd: z.ZodOptional<z.ZodBoolean>;
|
|
1402
|
+
useWorktree: z.ZodOptional<z.ZodBoolean>;
|
|
1400
1403
|
dataEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
1401
1404
|
model: z.ZodOptional<z.ZodString>;
|
|
1402
1405
|
fallbackModel: z.ZodOptional<z.ZodString>;
|
|
@@ -1457,6 +1460,7 @@ declare const createTaskSchema: z.ZodObject<{
|
|
|
1457
1460
|
cwd: z.ZodOptional<z.ZodString>;
|
|
1458
1461
|
userCwd: z.ZodOptional<z.ZodString>;
|
|
1459
1462
|
forceUserCwd: z.ZodOptional<z.ZodBoolean>;
|
|
1463
|
+
useWorktree: z.ZodOptional<z.ZodBoolean>;
|
|
1460
1464
|
dataEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
1461
1465
|
model: z.ZodOptional<z.ZodString>;
|
|
1462
1466
|
fallbackModel: z.ZodOptional<z.ZodString>;
|
|
@@ -1520,6 +1524,7 @@ declare const resumeTaskSchema: z.ZodObject<{
|
|
|
1520
1524
|
cwd: z.ZodOptional<z.ZodString>;
|
|
1521
1525
|
userCwd: z.ZodOptional<z.ZodString>;
|
|
1522
1526
|
forceUserCwd: z.ZodOptional<z.ZodBoolean>;
|
|
1527
|
+
useWorktree: z.ZodOptional<z.ZodBoolean>;
|
|
1523
1528
|
dataEncryptionKey: z.ZodOptional<z.ZodString>;
|
|
1524
1529
|
model: z.ZodOptional<z.ZodString>;
|
|
1525
1530
|
fallbackModel: z.ZodOptional<z.ZodString>;
|
|
@@ -1993,6 +1998,22 @@ declare const SubTaskResultUpdatedEventSchema: z.ZodObject<{
|
|
|
1993
1998
|
}, z.core.$strip>>;
|
|
1994
1999
|
}, z.core.$strip>;
|
|
1995
2000
|
type SubTaskResultUpdatedEventData = z.infer<typeof SubTaskResultUpdatedEventSchema>;
|
|
2001
|
+
/**
|
|
2002
|
+
* Sent when a sub task uses ask_user to request user input
|
|
2003
|
+
* Delivered to parent task worker so it can answer on behalf of the user
|
|
2004
|
+
*/
|
|
2005
|
+
declare const SubTaskAskUserEventSchema: z.ZodObject<{
|
|
2006
|
+
eventId: z.ZodString;
|
|
2007
|
+
taskId: z.ZodString;
|
|
2008
|
+
parentTaskId: z.ZodString;
|
|
2009
|
+
rootTaskId: z.ZodString;
|
|
2010
|
+
agentId: z.ZodString;
|
|
2011
|
+
agentName: z.ZodString;
|
|
2012
|
+
taskName: z.ZodOptional<z.ZodString>;
|
|
2013
|
+
message: z.ZodOptional<z.ZodCustom<TaskMessagePayload, TaskMessagePayload>>;
|
|
2014
|
+
encryptedMessage: z.ZodOptional<z.ZodString>;
|
|
2015
|
+
}, z.core.$strip>;
|
|
2016
|
+
type SubTaskAskUserEventData = z.infer<typeof SubTaskAskUserEventSchema>;
|
|
1996
2017
|
declare const MergePullRequestEventSchema: z.ZodObject<{
|
|
1997
2018
|
eventId: z.ZodString;
|
|
1998
2019
|
taskId: z.ZodString;
|
|
@@ -2344,6 +2365,8 @@ declare const DaemonGitlabOperationSchema: z.ZodEnum<{
|
|
|
2344
2365
|
createMergeRequest: "createMergeRequest";
|
|
2345
2366
|
getMergeRequest: "getMergeRequest";
|
|
2346
2367
|
listMergeRequests: "listMergeRequests";
|
|
2368
|
+
triggerPipeline: "triggerPipeline";
|
|
2369
|
+
ensurePipelineTriggerToken: "ensurePipelineTriggerToken";
|
|
2347
2370
|
requestGitlabApi: "requestGitlabApi";
|
|
2348
2371
|
resolveGitAuthContext: "resolveGitAuthContext";
|
|
2349
2372
|
}>;
|
|
@@ -2362,6 +2385,8 @@ declare const DaemonGitlabRequestSchema: z.ZodObject<{
|
|
|
2362
2385
|
createMergeRequest: "createMergeRequest";
|
|
2363
2386
|
getMergeRequest: "getMergeRequest";
|
|
2364
2387
|
listMergeRequests: "listMergeRequests";
|
|
2388
|
+
triggerPipeline: "triggerPipeline";
|
|
2389
|
+
ensurePipelineTriggerToken: "ensurePipelineTriggerToken";
|
|
2365
2390
|
requestGitlabApi: "requestGitlabApi";
|
|
2366
2391
|
resolveGitAuthContext: "resolveGitAuthContext";
|
|
2367
2392
|
}>;
|
|
@@ -2391,6 +2416,8 @@ declare const CompanionHeartbeatRequestSchema: z.ZodObject<{
|
|
|
2391
2416
|
chatId: z.ZodString;
|
|
2392
2417
|
userId: z.ZodString;
|
|
2393
2418
|
timestamp: z.ZodString;
|
|
2419
|
+
triggerTime: z.ZodOptional<z.ZodString>;
|
|
2420
|
+
triggerReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2394
2421
|
}, z.core.$strip>;
|
|
2395
2422
|
type CompanionHeartbeatRequestData = z.infer<typeof CompanionHeartbeatRequestSchema>;
|
|
2396
2423
|
declare const CompanionHeartbeatResponseSchema: z.ZodObject<{
|
|
@@ -2417,7 +2444,7 @@ declare const ResetTaskSessionSchema: z.ZodObject<{
|
|
|
2417
2444
|
taskId: z.ZodString;
|
|
2418
2445
|
}, z.core.$strip>;
|
|
2419
2446
|
type ResetTaskSessionEventData = z.infer<typeof ResetTaskSessionSchema>;
|
|
2420
|
-
type EventData = AppAliveEventData | ApiServerAliveEventData | MachineAliveEventData | ShutdownMachineData | WorkerInitializingEventData | WorkerInitializedEventData | WorkerReadyEventData | WorkerAliveEventData | WorkerExitEventData | WorkerRunningEventData | WorkerPermissionModeEventData | WorkerStatusRequestEventData | ChatWorkersStatusRequestEventData | ChatWorkersStatusResponseEventData | CreateTaskEventData | ResumeTaskEventData | CancelTaskEventData | StopTaskEventData | TaskMessageEventData | ChangeTaskTitleEventData | TaskStateChangeEventData | UpdateTaskAgentSessionIdEventData | TaskInfoUpdateEventData | TaskSlashCommandsUpdateEventData | MergeRequestEventData | TaskStoppedEventData | SubTaskResultUpdatedEventData | SystemMessageEventData | CreditExhaustedEventData | RtcIceServersRequestEventData | RtcIceServersResponseEventData | MachineRtcRequestEventData | MachineRtcResponseEventData | RtcSignalEventData | WorkspaceFileRequestEventData | WorkspaceFileResponseEventData | UpdateAgentInfoEventData | DaemonGitlabRequestEventData | DaemonGitlabResponseEventData | CompanionHeartbeatRequestData | CompanionHeartbeatResponseData | CompanionInitRequestData | CompanionInitResponseData | ResetTaskSessionEventData | SeqSyncRequestEventData | SeqSyncResponseEventData;
|
|
2447
|
+
type EventData = AppAliveEventData | ApiServerAliveEventData | MachineAliveEventData | ShutdownMachineData | WorkerInitializingEventData | WorkerInitializedEventData | WorkerReadyEventData | WorkerAliveEventData | WorkerExitEventData | WorkerRunningEventData | WorkerPermissionModeEventData | WorkerStatusRequestEventData | ChatWorkersStatusRequestEventData | ChatWorkersStatusResponseEventData | CreateTaskEventData | ResumeTaskEventData | CancelTaskEventData | StopTaskEventData | TaskMessageEventData | ChangeTaskTitleEventData | TaskStateChangeEventData | UpdateTaskAgentSessionIdEventData | TaskInfoUpdateEventData | TaskSlashCommandsUpdateEventData | MergeRequestEventData | TaskStoppedEventData | SubTaskResultUpdatedEventData | SubTaskAskUserEventData | SystemMessageEventData | CreditExhaustedEventData | RtcIceServersRequestEventData | RtcIceServersResponseEventData | MachineRtcRequestEventData | MachineRtcResponseEventData | RtcSignalEventData | WorkspaceFileRequestEventData | WorkspaceFileResponseEventData | UpdateAgentInfoEventData | DaemonGitlabRequestEventData | DaemonGitlabResponseEventData | CompanionHeartbeatRequestData | CompanionHeartbeatResponseData | CompanionInitRequestData | CompanionInitResponseData | ResetTaskSessionEventData | SeqSyncRequestEventData | SeqSyncResponseEventData;
|
|
2421
2448
|
declare const SeqSyncRequestEventDataSchema: z.ZodObject<{
|
|
2422
2449
|
eventId: z.ZodString;
|
|
2423
2450
|
tasks: z.ZodArray<z.ZodObject<{
|
|
@@ -2465,6 +2492,7 @@ type EventMap = {
|
|
|
2465
2492
|
"deploy-agent-complete": DeployAgentCompleteEventData;
|
|
2466
2493
|
"task-stopped": TaskStoppedEventData;
|
|
2467
2494
|
"sub-task-result-updated": SubTaskResultUpdatedEventData;
|
|
2495
|
+
"sub-task-ask-user": SubTaskAskUserEventData;
|
|
2468
2496
|
"associate-repo": AssociateRepoEventData;
|
|
2469
2497
|
"update-agent-info": UpdateAgentInfoEventData;
|
|
2470
2498
|
"system-message": SystemMessageEventData;
|
|
@@ -2939,5 +2967,5 @@ declare class MissingAgentFileError extends AgentError {
|
|
|
2939
2967
|
constructor(filePath: string);
|
|
2940
2968
|
}
|
|
2941
2969
|
|
|
2942
|
-
export { stopTaskRequestSchema as A, StopTaskResponseSchema as B, CancelTaskRequestSchema as C, DEFAULT_WORKER_EXECUTION_MODE as D, EnsureIssueRootTaskRequestSchema as E, PermissionResponseRequestSchema as G, permissionResponseRequestSchema as I, PermissionResponseResponseSchema as J, ListTasksRequestSchema as L, ProjectEntrySchema as M, ProjectDirectoryResponseSchema as O, ResumeTaskRequestSchema as R, StartTaskRequestSchema as S, TaskTodoSchema as T, QueryEventsRequestSchema as U, FillEventsRequestSchema as Z, WorkerExecutionModeSchema as a, CreateMergeRequestSchema as a0, createMergeRequestSchema as a2, CreateMergeRequestResponseSchema as a3, ApprovePrRequestSchema as a5, ApprovePrResponseSchema as a7, CreateTaskShareSchema as a9, ListSubTasksRequestSchema as aA, SubTaskSummarySchema as aC, ListSubTasksResponseSchema as aE, ListRecentTasksRequestSchema as aG, RecentTaskSummarySchema as aI, ListRecentTasksResponseSchema as aK, FindTaskByAgentRequestSchema as aM, FindTaskByAgentResponseSchema as aO, AskUserOptionSchema as aQ, AskUserQuestionSchema as aS, AskUserMessageSchema as aU, AskUserResponseStatusSchema as aW, AskUserResponseReasonSchema as aX, AskUserResponseMessageSchema as a_, CreateTaskShareResponseSchema as ab, ArchiveTaskRequestSchema as ad, ArchiveTaskResponseSchema as af, UnarchiveTaskRequestSchema as ah, UnarchiveTaskResponseSchema as aj, UpdateTaskTitleRequestSchema as al, UpdateTaskTitleResponseSchema as an, SendTaskMessageRequestSchema as aq, SendTaskMessageResponseSchema as as, ShowModalRequestSchema as au, ShowModalResponseSchema as aw, GetTaskSessionResponseSchema as ay, PreviewProjectTypeSchema as b$, TaskAgentInfoSchema as b4, isAskUserMessage as b6, isAskUserResponseMessage as b7, isCompanionHeartbeatMessage as b8, isCompanionReminderMessage as b9, WorkerExitSchema as bA, WorkerRunningSchema as bC, WorkerPermissionModeSchema as bE, WorkerStatusRequestSchema as bG, WorkerStatusValueSchema as bI, WorkerStatusSnapshotSchema as bK, ChatWorkersStatusRequestSchema as bM, ChatWorkersStatusResponseSchema as bO, baseTaskSchema as bQ, createTaskSchema as bR, resumeTaskSchema as bT, cancelTaskSchema as bV, StopTaskSchema as bX, TaskArtifactsStatsSchema as bZ, isSubTaskAskUserMessage as ba, isSDKMessage as bb, isSDKUserMessage as bc, createEventId as bd, EventAckSchema as be, AppAliveEventSchema as bg, ApiServerAliveEventSchema as bi, MachineAliveEventSchema as bk, ShutdownMachineSchema as bm, WorkerInitializingSchema as bo, WorkerInitializedSchema as bq, WorkerPermissionModeValueSchema as bs, WorkerReadySchema as bu, ActiveAgentSchema as bw, WorkerAliveEventSchema as by, PreviewMethodSchema as c1, PreviewMetadataSchema as c3, TaskArtifactsSummarySchema as c4, TaskMessageSchema as c6, ShowModalEventDataSchema as c9, TaskSlashCommandSchema as cB, TaskSlashCommandsUpdateEventDataSchema as cD, MergeRequestEventSchema as cF, TaskStoppedEventSchema as cH, SubTaskResultUpdatedEventSchema as cJ,
|
|
2943
|
-
export type { FillEventsResponse as $, StopTaskResponse as F, PermissionResponseRequest as H, PermissionResponseResponse as K, ProjectEntry as N, PreviewMetadata as P, ProjectDirectoryResponse as Q, QueryEventsRequest as V, WorkerExecutionMode as W, TaskEvent as X, QueryEventsResponse as Y, FillEventsRequest as _, AskUserResponseMessage as a$, CreateMergeRequestRequest as a1, CreateMergeRequestResponse as a4, ApprovePrRequest as a6, ApprovePrResponse as a8, ListSubTasksRequest as aB, SubTaskSummary as aD, ListSubTasksResponse as aF, ListRecentTasksRequest as aH, RecentTaskSummary as aJ, ListRecentTasksResponse as aL, FindTaskByAgentRequest as aN, FindTaskByAgentResponse as aP, AskUserOption as aR, AskUserQuestion as aT, AskUserMessage as aV, AskUserResponseStatus as aY, AskUserResponseReason as aZ, CreateTaskShareRequest as aa, CreateTaskShareResponse as ac, ArchiveTaskRequest as ae, ArchiveTaskResponse as ag, UnarchiveTaskRequest as ai, UnarchiveTaskResponse as ak, UpdateTaskTitleRequest as am, UpdateTaskTitleResponse as ao, SendMessageTarget as ap, SendTaskMessageRequest as ar, SendTaskMessageResponse as at, ShowModalRequest as av, ShowModalResponse as ax, GetTaskSessionResponse as az, TaskTodo as b, CompanionHeartbeatMessage as b0, CompanionReminderMessage as b1, SubTaskAskUserMessage as b2, TaskMessagePayload as b3, TaskAgentInfo as b5, WorkerExitEventData as bB, WorkerRunningEventData as bD, WorkerPermissionModeEventData as bF, WorkerStatusRequestEventData as bH, WorkerStatusValue as bJ, WorkerStatusSnapshot as bL, ChatWorkersStatusRequestEventData as bN, ChatWorkersStatusResponseEventData as bP, CreateTaskEventData as bS, ResumeTaskEventData as bU, CancelTaskEventData as bW, StopTaskEventData as bY, TaskArtifactsStats as b_, EventAckData as bf, AppAliveEventData as bh, ApiServerAliveEventData as bj, MachineAliveEventData as bl, ShutdownMachineData as bn, WorkerInitializingEventData as bp, WorkerInitializedEventData as br, WorkerPermissionModeValue as bt, WorkerReadyEventData as bv, ActiveAgent as bx, WorkerAliveEventData as bz, StartTaskRequest as c,
|
|
2970
|
+
export { stopTaskRequestSchema as A, StopTaskResponseSchema as B, CancelTaskRequestSchema as C, DEFAULT_WORKER_EXECUTION_MODE as D, EnsureIssueRootTaskRequestSchema as E, PermissionResponseRequestSchema as G, permissionResponseRequestSchema as I, PermissionResponseResponseSchema as J, ListTasksRequestSchema as L, ProjectEntrySchema as M, ProjectDirectoryResponseSchema as O, ResumeTaskRequestSchema as R, StartTaskRequestSchema as S, TaskTodoSchema as T, QueryEventsRequestSchema as U, FillEventsRequestSchema as Z, WorkerExecutionModeSchema as a, CreateMergeRequestSchema as a0, createMergeRequestSchema as a2, CreateMergeRequestResponseSchema as a3, ApprovePrRequestSchema as a5, ApprovePrResponseSchema as a7, CreateTaskShareSchema as a9, ListSubTasksRequestSchema as aA, SubTaskSummarySchema as aC, ListSubTasksResponseSchema as aE, ListRecentTasksRequestSchema as aG, RecentTaskSummarySchema as aI, ListRecentTasksResponseSchema as aK, FindTaskByAgentRequestSchema as aM, FindTaskByAgentResponseSchema as aO, AskUserOptionSchema as aQ, AskUserQuestionSchema as aS, AskUserMessageSchema as aU, AskUserResponseStatusSchema as aW, AskUserResponseReasonSchema as aX, AskUserResponseMessageSchema as a_, CreateTaskShareResponseSchema as ab, ArchiveTaskRequestSchema as ad, ArchiveTaskResponseSchema as af, UnarchiveTaskRequestSchema as ah, UnarchiveTaskResponseSchema as aj, UpdateTaskTitleRequestSchema as al, UpdateTaskTitleResponseSchema as an, SendTaskMessageRequestSchema as aq, SendTaskMessageResponseSchema as as, ShowModalRequestSchema as au, ShowModalResponseSchema as aw, GetTaskSessionResponseSchema as ay, PreviewProjectTypeSchema as b$, TaskAgentInfoSchema as b4, isAskUserMessage as b6, isAskUserResponseMessage as b7, isCompanionHeartbeatMessage as b8, isCompanionReminderMessage as b9, WorkerExitSchema as bA, WorkerRunningSchema as bC, WorkerPermissionModeSchema as bE, WorkerStatusRequestSchema as bG, WorkerStatusValueSchema as bI, WorkerStatusSnapshotSchema as bK, ChatWorkersStatusRequestSchema as bM, ChatWorkersStatusResponseSchema as bO, baseTaskSchema as bQ, createTaskSchema as bR, resumeTaskSchema as bT, cancelTaskSchema as bV, StopTaskSchema as bX, TaskArtifactsStatsSchema as bZ, isSubTaskAskUserMessage as ba, isSDKMessage as bb, isSDKUserMessage as bc, createEventId as bd, EventAckSchema as be, AppAliveEventSchema as bg, ApiServerAliveEventSchema as bi, MachineAliveEventSchema as bk, ShutdownMachineSchema as bm, WorkerInitializingSchema as bo, WorkerInitializedSchema as bq, WorkerPermissionModeValueSchema as bs, WorkerReadySchema as bu, ActiveAgentSchema as bw, WorkerAliveEventSchema as by, PreviewMethodSchema as c1, PreviewMetadataSchema as c3, TaskArtifactsSummarySchema as c4, TaskMessageSchema as c6, ShowModalEventDataSchema as c9, TaskSlashCommandSchema as cB, TaskSlashCommandsUpdateEventDataSchema as cD, MergeRequestEventSchema as cF, TaskStoppedEventSchema as cH, SubTaskResultUpdatedEventSchema as cJ, SubTaskAskUserEventSchema as cL, MergePullRequestEventSchema as cN, DeployAgentEventSchema as cQ, DeployAgentCompleteEventSchema as cS, AssociateRepoEventDataSchema as cU, UpdateAgentInfoEventSchema as cV, SystemMessageSchema as c_, ChangeTaskTitleEventSchema as cb, TaskStateChangeEventSchema as cd, CreditExhaustedEventSchema as cf, RtcIceServerSchema as ch, RtcIceServersRequestSchema as cj, RtcIceServersResponseSchema as cl, MachineRtcRequestSchema as cn, MachineRtcResponseSchema as cp, RtcSignalSchema as cr, WorkspaceFileRequestSchema as ct, WorkspaceFileResponseSchema as cv, UpdateTaskAgentSessionIdEventSchema as cx, TaskInfoUpdateEventDataSchema as cz, StartTaskResponseSchema as d, DaemonGitlabOperationSchema as d0, DaemonGitlabRequestSchema as d2, DaemonGitlabResponseSchema as d4, CompanionHeartbeatRequestSchema as d6, CompanionHeartbeatResponseSchema as d8, FRAMEWORK_TYPES as dH, AgentMetadataSchema as dI, ClaudeConfigSchema as dJ, AgentError as dK, AgentNotFoundError as dL, AgentConfigValidationError as dM, FrameworkNotSupportedError as dN, AgentLoadError as dO, MissingAgentFileError as dP, CompanionInitRequestSchema as da, CompanionInitResponseSchema as dc, ResetTaskSessionSchema as de, SeqSyncRequestEventDataSchema as dh, SeqSyncResponseEventDataSchema as dj, EventSchemaMap as dn, workerTaskEvents as dq, RpcCallEventSchema as dr, RpcResponseSchema as dt, setAgentContext as dx, getAgentContext as dy, TaskItemSchema as g, EnsureIssueRootTaskResponseSchema as i, ListTasksResponseSchema as l, normalizeWorkerExecutionMode as n, ResumeTaskResponseSchema as p, resumeTaskRequestSchema as r, startTaskSchema as s, cancelTaskRequestSchema as u, CancelTaskResponseSchema as v, workerExecutionModes as w, StopTaskRequestSchema as y };
|
|
2971
|
+
export type { FillEventsResponse as $, StopTaskResponse as F, PermissionResponseRequest as H, PermissionResponseResponse as K, ProjectEntry as N, PreviewMetadata as P, ProjectDirectoryResponse as Q, QueryEventsRequest as V, WorkerExecutionMode as W, TaskEvent as X, QueryEventsResponse as Y, FillEventsRequest as _, AskUserResponseMessage as a$, CreateMergeRequestRequest as a1, CreateMergeRequestResponse as a4, ApprovePrRequest as a6, ApprovePrResponse as a8, ListSubTasksRequest as aB, SubTaskSummary as aD, ListSubTasksResponse as aF, ListRecentTasksRequest as aH, RecentTaskSummary as aJ, ListRecentTasksResponse as aL, FindTaskByAgentRequest as aN, FindTaskByAgentResponse as aP, AskUserOption as aR, AskUserQuestion as aT, AskUserMessage as aV, AskUserResponseStatus as aY, AskUserResponseReason as aZ, CreateTaskShareRequest as aa, CreateTaskShareResponse as ac, ArchiveTaskRequest as ae, ArchiveTaskResponse as ag, UnarchiveTaskRequest as ai, UnarchiveTaskResponse as ak, UpdateTaskTitleRequest as am, UpdateTaskTitleResponse as ao, SendMessageTarget as ap, SendTaskMessageRequest as ar, SendTaskMessageResponse as at, ShowModalRequest as av, ShowModalResponse as ax, GetTaskSessionResponse as az, TaskTodo as b, CompanionHeartbeatMessage as b0, CompanionReminderMessage as b1, SubTaskAskUserMessage as b2, TaskMessagePayload as b3, TaskAgentInfo as b5, WorkerExitEventData as bB, WorkerRunningEventData as bD, WorkerPermissionModeEventData as bF, WorkerStatusRequestEventData as bH, WorkerStatusValue as bJ, WorkerStatusSnapshot as bL, ChatWorkersStatusRequestEventData as bN, ChatWorkersStatusResponseEventData as bP, CreateTaskEventData as bS, ResumeTaskEventData as bU, CancelTaskEventData as bW, StopTaskEventData as bY, TaskArtifactsStats as b_, EventAckData as bf, AppAliveEventData as bh, ApiServerAliveEventData as bj, MachineAliveEventData as bl, ShutdownMachineData as bn, WorkerInitializingEventData as bp, WorkerInitializedEventData as br, WorkerPermissionModeValue as bt, WorkerReadyEventData as bv, ActiveAgent as bx, WorkerAliveEventData as bz, StartTaskRequest as c, SystemMessageEventData as c$, PreviewProjectType as c0, PreviewMethod as c2, TaskArtifactsSummary as c5, TaskMessageEventData as c7, TaskState as c8, TaskInfoUpdateEventData as cA, TaskSlashCommand as cC, TaskSlashCommandsUpdateEventData as cE, MergeRequestEventData as cG, TaskStoppedEventData as cI, SubTaskResultUpdatedEventData as cK, SubTaskAskUserEventData as cM, MergePullRequestEventData as cO, MergePullRequestAck as cP, DeployAgentEventData as cR, DeployAgentCompleteEventData as cT, UpdateAgentInfoEventData as cW, AssociateRepoEventData as cX, SystemMessageType as cY, PrStateChangedData as cZ, ShowModalEventData as ca, ChangeTaskTitleEventData as cc, TaskStateChangeEventData as ce, CreditExhaustedEventData as cg, RtcIceServer as ci, RtcIceServersRequestEventData as ck, RtcIceServersResponseEventData as cm, MachineRtcRequestEventData as co, MachineRtcResponseEventData as cq, RtcSignalEventData as cs, WorkspaceFileRequestEventData as cu, WorkspaceFileResponseEventData as cw, UpdateTaskAgentSessionIdEventData as cy, DaemonGitlabOperation as d1, DaemonGitlabRequestEventData as d3, DaemonGitlabResponseEventData as d5, CompanionHeartbeatRequestData as d7, CompanionHeartbeatResponseData as d9, AgentMetadata as dA, ClaudeAgentConfig as dB, AgentConfig as dC, ValidationResult as dD, LoadAgentOptions as dE, RepositoryInitHookInput as dF, HookFactory as dG, CompanionInitRequestData as db, CompanionInitResponseData as dd, ResetTaskSessionEventData as df, EventData as dg, SeqSyncRequestEventData as di, SeqSyncResponseEventData as dk, EventMap as dl, EventName as dm, WorkerTaskEvent as dp, RpcCallEventData as ds, RpcResponseData as du, AgentContext as dv, AgentrixContext as dw, FrameworkType as dz, StartTaskResponse as e, EnsureIssueRootTaskRequest as f, TaskItem as h, EnsureIssueRootTaskResponse as j, ListTasksRequest as k, ListTasksResponse as m, ResumeTaskRequest as o, ResumeTaskResponse as q, CancelTaskRequest as t, CancelTaskResponse as x, StopTaskRequest as z };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function buildGitLabWebhookEndpointPath(gitServerId) {
|
|
4
|
+
return `/webhooks/gitlab/${encodeURIComponent(gitServerId)}`;
|
|
5
|
+
}
|
|
6
|
+
function buildGitLabWebhookUrl(gitServerId, daemonState) {
|
|
7
|
+
if (!daemonState?.port) {
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
10
|
+
const host = daemonState.webhookHost ?? daemonState.host ?? "127.0.0.1";
|
|
11
|
+
try {
|
|
12
|
+
const baseUrl = host.includes("://") ? host : `http://${host}:${daemonState.port}`;
|
|
13
|
+
const url = new URL(baseUrl);
|
|
14
|
+
url.pathname = buildGitLabWebhookEndpointPath(gitServerId);
|
|
15
|
+
return url.toString();
|
|
16
|
+
} catch {
|
|
17
|
+
return void 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.buildGitLabWebhookEndpointPath = buildGitLabWebhookEndpointPath;
|
|
22
|
+
exports.buildGitLabWebhookUrl = buildGitLabWebhookUrl;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare function buildGitLabWebhookEndpointPath(gitServerId: string): string;
|
|
2
|
+
declare function buildGitLabWebhookUrl(gitServerId: string, daemonState: {
|
|
3
|
+
port?: number;
|
|
4
|
+
webhookHost?: string;
|
|
5
|
+
host?: string;
|
|
6
|
+
} | null | undefined): string | undefined;
|
|
7
|
+
|
|
8
|
+
export { buildGitLabWebhookEndpointPath, buildGitLabWebhookUrl };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function buildGitLabWebhookEndpointPath(gitServerId) {
|
|
2
|
+
return `/webhooks/gitlab/${encodeURIComponent(gitServerId)}`;
|
|
3
|
+
}
|
|
4
|
+
function buildGitLabWebhookUrl(gitServerId, daemonState) {
|
|
5
|
+
if (!daemonState?.port) {
|
|
6
|
+
return void 0;
|
|
7
|
+
}
|
|
8
|
+
const host = daemonState.webhookHost ?? daemonState.host ?? "127.0.0.1";
|
|
9
|
+
try {
|
|
10
|
+
const baseUrl = host.includes("://") ? host : `http://${host}:${daemonState.port}`;
|
|
11
|
+
const url = new URL(baseUrl);
|
|
12
|
+
url.pathname = buildGitLabWebhookEndpointPath(gitServerId);
|
|
13
|
+
return url.toString();
|
|
14
|
+
} catch {
|
|
15
|
+
return void 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { buildGitLabWebhookEndpointPath, buildGitLabWebhookUrl };
|
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ var tweetnacl = require('tweetnacl');
|
|
|
5
5
|
var base64js = require('base64-js');
|
|
6
6
|
var CryptoJS = require('crypto-js');
|
|
7
7
|
var errors = require('./errors-myQvpVrM.cjs');
|
|
8
|
+
var gitlabWebhook = require('./gitlabWebhook.cjs');
|
|
8
9
|
|
|
9
10
|
function _interopNamespaceDefault(e) {
|
|
10
11
|
var n = Object.create(null);
|
|
@@ -1070,13 +1071,21 @@ const GetInstallUrlResponseSchema = zod.z.object({
|
|
|
1070
1071
|
const GitHubIssueListItemSchema = zod.z.object({
|
|
1071
1072
|
number: zod.z.number(),
|
|
1072
1073
|
title: zod.z.string(),
|
|
1073
|
-
html_url: zod.z.string().url()
|
|
1074
|
+
html_url: zod.z.string().url(),
|
|
1075
|
+
labels: zod.z.array(zod.z.string()),
|
|
1076
|
+
state: zod.z.enum(["open", "closed"]),
|
|
1077
|
+
created_at: DateSchema,
|
|
1078
|
+
updated_at: DateSchema
|
|
1074
1079
|
});
|
|
1075
1080
|
const GitHubIssueSchema = zod.z.object({
|
|
1076
1081
|
number: zod.z.number(),
|
|
1077
1082
|
title: zod.z.string(),
|
|
1078
1083
|
body: zod.z.string().nullable(),
|
|
1079
1084
|
html_url: zod.z.string().url(),
|
|
1085
|
+
labels: zod.z.array(zod.z.string()),
|
|
1086
|
+
state: zod.z.enum(["open", "closed"]),
|
|
1087
|
+
created_at: DateSchema,
|
|
1088
|
+
updated_at: DateSchema,
|
|
1080
1089
|
author: zod.z.string().optional(),
|
|
1081
1090
|
authorIdentity: zod.z.lazy(() => RepositoryActorIdentitySchema).optional(),
|
|
1082
1091
|
assigneeIdentities: zod.z.array(zod.z.lazy(() => RepositoryActorIdentitySchema)).optional()
|
|
@@ -1707,6 +1716,63 @@ const DeleteApiKeyResponseSchema = zod.z.object({
|
|
|
1707
1716
|
success: zod.z.literal(true)
|
|
1708
1717
|
});
|
|
1709
1718
|
|
|
1719
|
+
const ResourceMetadataSchema = zod.z.object({
|
|
1720
|
+
platform: zod.z.enum(["mac", "windows", "linux"]).optional(),
|
|
1721
|
+
arch: zod.z.enum(["arm64", "x64", "universal"]).optional(),
|
|
1722
|
+
version: zod.z.string().optional()
|
|
1723
|
+
}).passthrough();
|
|
1724
|
+
const PublicResourceItemSchema = zod.z.object({
|
|
1725
|
+
id: IdSchema,
|
|
1726
|
+
type: zod.z.string(),
|
|
1727
|
+
name: zod.z.string(),
|
|
1728
|
+
description: zod.z.string().nullable(),
|
|
1729
|
+
url: zod.z.string(),
|
|
1730
|
+
thumbnailUrl: zod.z.string().nullable(),
|
|
1731
|
+
metadata: ResourceMetadataSchema.nullable(),
|
|
1732
|
+
sortOrder: zod.z.number()
|
|
1733
|
+
});
|
|
1734
|
+
const ListPublicResourcesQuerySchema = zod.z.object({
|
|
1735
|
+
type: zod.z.string().min(1)
|
|
1736
|
+
});
|
|
1737
|
+
const ListPublicResourcesResponseSchema = zod.z.object({
|
|
1738
|
+
resources: zod.z.array(PublicResourceItemSchema)
|
|
1739
|
+
});
|
|
1740
|
+
const AdminResourceItemSchema = zod.z.object({
|
|
1741
|
+
id: IdSchema,
|
|
1742
|
+
type: zod.z.string(),
|
|
1743
|
+
name: zod.z.string(),
|
|
1744
|
+
description: zod.z.string().nullable(),
|
|
1745
|
+
url: zod.z.string(),
|
|
1746
|
+
thumbnailUrl: zod.z.string().nullable(),
|
|
1747
|
+
metadata: ResourceMetadataSchema.nullable(),
|
|
1748
|
+
sortOrder: zod.z.number(),
|
|
1749
|
+
enabled: zod.z.boolean(),
|
|
1750
|
+
createdAt: zod.z.string(),
|
|
1751
|
+
updatedAt: zod.z.string()
|
|
1752
|
+
});
|
|
1753
|
+
const ListAdminResourcesResponseSchema = zod.z.object({
|
|
1754
|
+
resources: zod.z.array(AdminResourceItemSchema)
|
|
1755
|
+
});
|
|
1756
|
+
const CreateResourceRequestSchema = zod.z.object({
|
|
1757
|
+
type: zod.z.string().min(1),
|
|
1758
|
+
name: zod.z.string().min(1),
|
|
1759
|
+
description: zod.z.string().optional(),
|
|
1760
|
+
url: zod.z.string().url(),
|
|
1761
|
+
thumbnailUrl: zod.z.string().url().optional(),
|
|
1762
|
+
metadata: ResourceMetadataSchema.optional(),
|
|
1763
|
+
sortOrder: zod.z.number().int().optional(),
|
|
1764
|
+
enabled: zod.z.boolean().optional()
|
|
1765
|
+
});
|
|
1766
|
+
const UpdateResourceRequestSchema = zod.z.object({
|
|
1767
|
+
name: zod.z.string().min(1).optional(),
|
|
1768
|
+
description: zod.z.string().nullable().optional(),
|
|
1769
|
+
url: zod.z.string().url().optional(),
|
|
1770
|
+
thumbnailUrl: zod.z.string().url().nullable().optional(),
|
|
1771
|
+
metadata: ResourceMetadataSchema.nullable().optional(),
|
|
1772
|
+
sortOrder: zod.z.number().int().optional(),
|
|
1773
|
+
enabled: zod.z.boolean().optional()
|
|
1774
|
+
});
|
|
1775
|
+
|
|
1710
1776
|
const RpcCallEventSchema = zod.z.object({
|
|
1711
1777
|
eventId: zod.z.string(),
|
|
1712
1778
|
taskId: zod.z.string(),
|
|
@@ -2161,6 +2227,8 @@ const baseTaskSchema = EventBaseSchema.extend({
|
|
|
2161
2227
|
// User-provided working directory for local mode
|
|
2162
2228
|
forceUserCwd: zod.z.boolean().optional(),
|
|
2163
2229
|
// Force using user-provided cwd (no worktree)
|
|
2230
|
+
useWorktree: zod.z.boolean().optional(),
|
|
2231
|
+
// Whether the worker should use a git worktree when supported
|
|
2164
2232
|
dataEncryptionKey: zod.z.string().optional(),
|
|
2165
2233
|
// User's public key for encrypting sensitive data
|
|
2166
2234
|
model: zod.z.string().optional(),
|
|
@@ -2470,6 +2538,22 @@ const SubTaskResultUpdatedEventSchema = EventBaseSchema.extend({
|
|
|
2470
2538
|
// Optional artifacts summary (for displaying in parent task chat)
|
|
2471
2539
|
artifacts: TaskArtifactsSummarySchema.optional()
|
|
2472
2540
|
});
|
|
2541
|
+
const SubTaskAskUserEventSchema = EventBaseSchema.extend({
|
|
2542
|
+
taskId: zod.z.string(),
|
|
2543
|
+
// Sub task ID
|
|
2544
|
+
parentTaskId: zod.z.string(),
|
|
2545
|
+
// Parent task ID
|
|
2546
|
+
rootTaskId: zod.z.string(),
|
|
2547
|
+
// Root task ID
|
|
2548
|
+
agentId: zod.z.string(),
|
|
2549
|
+
// Agent ID that executed the sub task
|
|
2550
|
+
agentName: zod.z.string(),
|
|
2551
|
+
// Agent display name
|
|
2552
|
+
taskName: zod.z.string().optional(),
|
|
2553
|
+
// Sub task title
|
|
2554
|
+
message: zod.z.custom().optional(),
|
|
2555
|
+
encryptedMessage: zod.z.string().optional()
|
|
2556
|
+
});
|
|
2473
2557
|
const MergePullRequestEventSchema = EventBaseSchema.extend({
|
|
2474
2558
|
taskId: zod.z.string(),
|
|
2475
2559
|
mergeMethod: zod.z.enum(["merge", "squash", "rebase"]).optional().default("squash")
|
|
@@ -2589,6 +2673,8 @@ const DaemonGitlabOperationSchema = zod.z.enum([
|
|
|
2589
2673
|
"createMergeRequest",
|
|
2590
2674
|
"getMergeRequest",
|
|
2591
2675
|
"listMergeRequests",
|
|
2676
|
+
"triggerPipeline",
|
|
2677
|
+
"ensurePipelineTriggerToken",
|
|
2592
2678
|
"requestGitlabApi",
|
|
2593
2679
|
"resolveGitAuthContext"
|
|
2594
2680
|
]);
|
|
@@ -2615,7 +2701,9 @@ const CompanionHeartbeatRequestSchema = EventBaseSchema.extend({
|
|
|
2615
2701
|
agentId: zod.z.string(),
|
|
2616
2702
|
chatId: zod.z.string(),
|
|
2617
2703
|
userId: zod.z.string(),
|
|
2618
|
-
timestamp: zod.z.string()
|
|
2704
|
+
timestamp: zod.z.string(),
|
|
2705
|
+
triggerTime: zod.z.string().optional(),
|
|
2706
|
+
triggerReasons: zod.z.array(zod.z.string()).optional()
|
|
2619
2707
|
});
|
|
2620
2708
|
const CompanionHeartbeatResponseSchema = EventBaseSchema.extend({
|
|
2621
2709
|
taskId: zod.z.string(),
|
|
@@ -2681,6 +2769,7 @@ const EventSchemaMap = {
|
|
|
2681
2769
|
// Multi-agent collaboration events
|
|
2682
2770
|
"task-stopped": TaskStoppedEventSchema,
|
|
2683
2771
|
"sub-task-result-updated": SubTaskResultUpdatedEventSchema,
|
|
2772
|
+
"sub-task-ask-user": SubTaskAskUserEventSchema,
|
|
2684
2773
|
// Repository association events
|
|
2685
2774
|
"associate-repo": AssociateRepoEventDataSchema,
|
|
2686
2775
|
// Agent info update events
|
|
@@ -3207,11 +3296,14 @@ exports.FrameworkNotSupportedError = errors.FrameworkNotSupportedError;
|
|
|
3207
3296
|
exports.MissingAgentFileError = errors.MissingAgentFileError;
|
|
3208
3297
|
exports.getAgentContext = errors.getAgentContext;
|
|
3209
3298
|
exports.setAgentContext = errors.setAgentContext;
|
|
3299
|
+
exports.buildGitLabWebhookEndpointPath = gitlabWebhook.buildGitLabWebhookEndpointPath;
|
|
3300
|
+
exports.buildGitLabWebhookUrl = gitlabWebhook.buildGitLabWebhookUrl;
|
|
3210
3301
|
exports.AcceptPrivateCloudInviteRequestSchema = AcceptPrivateCloudInviteRequestSchema;
|
|
3211
3302
|
exports.AcceptPrivateCloudInviteResponseSchema = AcceptPrivateCloudInviteResponseSchema;
|
|
3212
3303
|
exports.ActiveAgentSchema = ActiveAgentSchema;
|
|
3213
3304
|
exports.AddChatMemberRequestSchema = AddChatMemberRequestSchema;
|
|
3214
3305
|
exports.AddChatMemberResponseSchema = AddChatMemberResponseSchema;
|
|
3306
|
+
exports.AdminResourceItemSchema = AdminResourceItemSchema;
|
|
3215
3307
|
exports.AgentCustomConfigSchema = AgentCustomConfigSchema;
|
|
3216
3308
|
exports.AgentPermissionsSchema = AgentPermissionsSchema;
|
|
3217
3309
|
exports.AgentSchema = AgentSchema;
|
|
@@ -3300,6 +3392,7 @@ exports.CreatePrivateCloudInviteRequestSchema = CreatePrivateCloudInviteRequestS
|
|
|
3300
3392
|
exports.CreatePrivateCloudInviteResponseSchema = CreatePrivateCloudInviteResponseSchema;
|
|
3301
3393
|
exports.CreatePrivateCloudRequestSchema = CreatePrivateCloudRequestSchema;
|
|
3302
3394
|
exports.CreatePrivateCloudResponseSchema = CreatePrivateCloudResponseSchema;
|
|
3395
|
+
exports.CreateResourceRequestSchema = CreateResourceRequestSchema;
|
|
3303
3396
|
exports.CreateSubscriptionPlanRequestSchema = CreateSubscriptionPlanRequestSchema;
|
|
3304
3397
|
exports.CreateTaskShareResponseSchema = CreateTaskShareResponseSchema;
|
|
3305
3398
|
exports.CreateTaskShareSchema = CreateTaskShareSchema;
|
|
@@ -3361,6 +3454,7 @@ exports.GitServerSchema = GitServerSchema;
|
|
|
3361
3454
|
exports.IGNORED_DIRECTORIES = IGNORED_DIRECTORIES;
|
|
3362
3455
|
exports.IdSchema = IdSchema;
|
|
3363
3456
|
exports.JsonSchemaDocumentSchema = JsonSchemaDocumentSchema;
|
|
3457
|
+
exports.ListAdminResourcesResponseSchema = ListAdminResourcesResponseSchema;
|
|
3364
3458
|
exports.ListAgentsResponseSchema = ListAgentsResponseSchema;
|
|
3365
3459
|
exports.ListApiKeysQuerySchema = ListApiKeysQuerySchema;
|
|
3366
3460
|
exports.ListApiKeysResponseSchema = ListApiKeysResponseSchema;
|
|
@@ -3383,6 +3477,8 @@ exports.ListPackagesQuerySchema = ListPackagesQuerySchema;
|
|
|
3383
3477
|
exports.ListPackagesResponseSchema = ListPackagesResponseSchema;
|
|
3384
3478
|
exports.ListPrivateCloudMembersResponseSchema = ListPrivateCloudMembersResponseSchema;
|
|
3385
3479
|
exports.ListPrivateCloudsResponseSchema = ListPrivateCloudsResponseSchema;
|
|
3480
|
+
exports.ListPublicResourcesQuerySchema = ListPublicResourcesQuerySchema;
|
|
3481
|
+
exports.ListPublicResourcesResponseSchema = ListPublicResourcesResponseSchema;
|
|
3386
3482
|
exports.ListRecentTasksRequestSchema = ListRecentTasksRequestSchema;
|
|
3387
3483
|
exports.ListRecentTasksResponseSchema = ListRecentTasksResponseSchema;
|
|
3388
3484
|
exports.ListReferencesQuerySchema = ListReferencesQuerySchema;
|
|
@@ -3432,6 +3528,7 @@ exports.PrivateCloudMemberSchema = PrivateCloudMemberSchema;
|
|
|
3432
3528
|
exports.PrivateCloudSummarySchema = PrivateCloudSummarySchema;
|
|
3433
3529
|
exports.ProjectDirectoryResponseSchema = ProjectDirectoryResponseSchema;
|
|
3434
3530
|
exports.ProjectEntrySchema = ProjectEntrySchema;
|
|
3531
|
+
exports.PublicResourceItemSchema = PublicResourceItemSchema;
|
|
3435
3532
|
exports.PublishDraftAgentRequestSchema = PublishDraftAgentRequestSchema;
|
|
3436
3533
|
exports.PublishDraftAgentResponseSchema = PublishDraftAgentResponseSchema;
|
|
3437
3534
|
exports.QueryEventsRequestSchema = QueryEventsRequestSchema;
|
|
@@ -3455,6 +3552,7 @@ exports.ResetSecretRequestSchema = ResetSecretRequestSchema;
|
|
|
3455
3552
|
exports.ResetSecretResponseSchema = ResetSecretResponseSchema;
|
|
3456
3553
|
exports.ResetTaskSessionSchema = ResetTaskSessionSchema;
|
|
3457
3554
|
exports.ResolveUserInboxItemResponseSchema = ResolveUserInboxItemResponseSchema;
|
|
3555
|
+
exports.ResourceMetadataSchema = ResourceMetadataSchema;
|
|
3458
3556
|
exports.ResumeTaskRequestSchema = ResumeTaskRequestSchema;
|
|
3459
3557
|
exports.ResumeTaskResponseSchema = ResumeTaskResponseSchema;
|
|
3460
3558
|
exports.RpcCallEventSchema = RpcCallEventSchema;
|
|
@@ -3487,6 +3585,7 @@ exports.StopTaskRequestSchema = StopTaskRequestSchema;
|
|
|
3487
3585
|
exports.StopTaskResponseSchema = StopTaskResponseSchema;
|
|
3488
3586
|
exports.StopTaskSchema = StopTaskSchema;
|
|
3489
3587
|
exports.StripeCheckoutClientSchema = StripeCheckoutClientSchema;
|
|
3588
|
+
exports.SubTaskAskUserEventSchema = SubTaskAskUserEventSchema;
|
|
3490
3589
|
exports.SubTaskResultUpdatedEventSchema = SubTaskResultUpdatedEventSchema;
|
|
3491
3590
|
exports.SubTaskSummarySchema = SubTaskSummarySchema;
|
|
3492
3591
|
exports.SubscriptionPlanSchema = SubscriptionPlanSchema;
|
|
@@ -3525,6 +3624,7 @@ exports.UpdateDraftAgentRequestSchema = UpdateDraftAgentRequestSchema;
|
|
|
3525
3624
|
exports.UpdateDraftAgentResponseSchema = UpdateDraftAgentResponseSchema;
|
|
3526
3625
|
exports.UpdateOAuthServerRequestSchema = UpdateOAuthServerRequestSchema;
|
|
3527
3626
|
exports.UpdateOAuthServerResponseSchema = UpdateOAuthServerResponseSchema;
|
|
3627
|
+
exports.UpdateResourceRequestSchema = UpdateResourceRequestSchema;
|
|
3528
3628
|
exports.UpdateSecretRequestSchema = UpdateSecretRequestSchema;
|
|
3529
3629
|
exports.UpdateSecretResponseSchema = UpdateSecretResponseSchema;
|
|
3530
3630
|
exports.UpdateSubscriptionPlanRequestSchema = UpdateSubscriptionPlanRequestSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { P as PreviewMetadata } from './errors-
|
|
3
|
-
export { bx as ActiveAgent, bw as ActiveAgentSchema,
|
|
2
|
+
import { P as PreviewMetadata } from './errors-B5CcMP8s.cjs';
|
|
3
|
+
export { bx as ActiveAgent, bw as ActiveAgentSchema, dC as AgentConfig, dM as AgentConfigValidationError, dv as AgentContext, dK as AgentError, dO as AgentLoadError, dA as AgentMetadata, dI as AgentMetadataSchema, dL as AgentNotFoundError, dw as AgentrixContext, bj as ApiServerAliveEventData, bi as ApiServerAliveEventSchema, bh as AppAliveEventData, bg as AppAliveEventSchema, a6 as ApprovePrRequest, a5 as ApprovePrRequestSchema, a8 as ApprovePrResponse, a7 as ApprovePrResponseSchema, ae as ArchiveTaskRequest, ad as ArchiveTaskRequestSchema, ag as ArchiveTaskResponse, af as ArchiveTaskResponseSchema, aV as AskUserMessage, aU as AskUserMessageSchema, aR as AskUserOption, aQ as AskUserOptionSchema, aT as AskUserQuestion, aS as AskUserQuestionSchema, a$ as AskUserResponseMessage, a_ as AskUserResponseMessageSchema, aZ as AskUserResponseReason, aX as AskUserResponseReasonSchema, aY as AskUserResponseStatus, aW as AskUserResponseStatusSchema, cX as AssociateRepoEventData, cU as AssociateRepoEventDataSchema, bW as CancelTaskEventData, t as CancelTaskRequest, C as CancelTaskRequestSchema, x as CancelTaskResponse, v as CancelTaskResponseSchema, cc as ChangeTaskTitleEventData, cb as ChangeTaskTitleEventSchema, bN as ChatWorkersStatusRequestEventData, bM as ChatWorkersStatusRequestSchema, bP as ChatWorkersStatusResponseEventData, bO as ChatWorkersStatusResponseSchema, dB as ClaudeAgentConfig, dJ as ClaudeConfigSchema, b0 as CompanionHeartbeatMessage, d7 as CompanionHeartbeatRequestData, d6 as CompanionHeartbeatRequestSchema, d9 as CompanionHeartbeatResponseData, d8 as CompanionHeartbeatResponseSchema, db as CompanionInitRequestData, da as CompanionInitRequestSchema, dd as CompanionInitResponseData, dc as CompanionInitResponseSchema, b1 as CompanionReminderMessage, a1 as CreateMergeRequestRequest, a4 as CreateMergeRequestResponse, a3 as CreateMergeRequestResponseSchema, a0 as CreateMergeRequestSchema, bS as CreateTaskEventData, aa as CreateTaskShareRequest, ac as CreateTaskShareResponse, ab as CreateTaskShareResponseSchema, a9 as CreateTaskShareSchema, cg as CreditExhaustedEventData, cf as CreditExhaustedEventSchema, D as DEFAULT_WORKER_EXECUTION_MODE, d1 as DaemonGitlabOperation, d0 as DaemonGitlabOperationSchema, d3 as DaemonGitlabRequestEventData, d2 as DaemonGitlabRequestSchema, d5 as DaemonGitlabResponseEventData, d4 as DaemonGitlabResponseSchema, cT as DeployAgentCompleteEventData, cS as DeployAgentCompleteEventSchema, cR as DeployAgentEventData, cQ as DeployAgentEventSchema, f as EnsureIssueRootTaskRequest, E as EnsureIssueRootTaskRequestSchema, j as EnsureIssueRootTaskResponse, i as EnsureIssueRootTaskResponseSchema, bf as EventAckData, be as EventAckSchema, dg as EventData, dl as EventMap, dm as EventName, dn as EventSchemaMap, dH as FRAMEWORK_TYPES, _ as FillEventsRequest, Z as FillEventsRequestSchema, $ as FillEventsResponse, aN as FindTaskByAgentRequest, aM as FindTaskByAgentRequestSchema, aP as FindTaskByAgentResponse, aO as FindTaskByAgentResponseSchema, dN as FrameworkNotSupportedError, dz as FrameworkType, az as GetTaskSessionResponse, ay as GetTaskSessionResponseSchema, dG as HookFactory, aH as ListRecentTasksRequest, aG as ListRecentTasksRequestSchema, aL as ListRecentTasksResponse, aK as ListRecentTasksResponseSchema, aB as ListSubTasksRequest, aA as ListSubTasksRequestSchema, aF as ListSubTasksResponse, aE as ListSubTasksResponseSchema, k as ListTasksRequest, L as ListTasksRequestSchema, m as ListTasksResponse, l as ListTasksResponseSchema, dE as LoadAgentOptions, bl as MachineAliveEventData, bk as MachineAliveEventSchema, co as MachineRtcRequestEventData, cn as MachineRtcRequestSchema, cq as MachineRtcResponseEventData, cp as MachineRtcResponseSchema, cP as MergePullRequestAck, cO as MergePullRequestEventData, cN as MergePullRequestEventSchema, cG as MergeRequestEventData, cF as MergeRequestEventSchema, dP as MissingAgentFileError, H as PermissionResponseRequest, G as PermissionResponseRequestSchema, K as PermissionResponseResponse, J as PermissionResponseResponseSchema, cZ as PrStateChangedData, c3 as PreviewMetadataSchema, c2 as PreviewMethod, c1 as PreviewMethodSchema, c0 as PreviewProjectType, b$ as PreviewProjectTypeSchema, Q as ProjectDirectoryResponse, O as ProjectDirectoryResponseSchema, N as ProjectEntry, M as ProjectEntrySchema, V as QueryEventsRequest, U as QueryEventsRequestSchema, Y as QueryEventsResponse, aJ as RecentTaskSummary, aI as RecentTaskSummarySchema, dF as RepositoryInitHookInput, df as ResetTaskSessionEventData, de as ResetTaskSessionSchema, bU as ResumeTaskEventData, o as ResumeTaskRequest, R as ResumeTaskRequestSchema, q as ResumeTaskResponse, p as ResumeTaskResponseSchema, ds as RpcCallEventData, dr as RpcCallEventSchema, du as RpcResponseData, dt as RpcResponseSchema, ci as RtcIceServer, ch as RtcIceServerSchema, ck as RtcIceServersRequestEventData, cj as RtcIceServersRequestSchema, cm as RtcIceServersResponseEventData, cl as RtcIceServersResponseSchema, cs as RtcSignalEventData, cr as RtcSignalSchema, ap as SendMessageTarget, ar as SendTaskMessageRequest, aq as SendTaskMessageRequestSchema, at as SendTaskMessageResponse, as as SendTaskMessageResponseSchema, di as SeqSyncRequestEventData, dh as SeqSyncRequestEventDataSchema, dk as SeqSyncResponseEventData, dj as SeqSyncResponseEventDataSchema, ca as ShowModalEventData, c9 as ShowModalEventDataSchema, av as ShowModalRequest, au as ShowModalRequestSchema, ax as ShowModalResponse, aw as ShowModalResponseSchema, bn as ShutdownMachineData, bm as ShutdownMachineSchema, c as StartTaskRequest, S as StartTaskRequestSchema, e as StartTaskResponse, d as StartTaskResponseSchema, bY as StopTaskEventData, z as StopTaskRequest, y as StopTaskRequestSchema, F as StopTaskResponse, B as StopTaskResponseSchema, bX as StopTaskSchema, cM as SubTaskAskUserEventData, cL as SubTaskAskUserEventSchema, b2 as SubTaskAskUserMessage, cK as SubTaskResultUpdatedEventData, cJ as SubTaskResultUpdatedEventSchema, aD as SubTaskSummary, aC as SubTaskSummarySchema, c$ as SystemMessageEventData, c_ as SystemMessageSchema, cY as SystemMessageType, b5 as TaskAgentInfo, b4 as TaskAgentInfoSchema, b_ as TaskArtifactsStats, bZ as TaskArtifactsStatsSchema, c5 as TaskArtifactsSummary, c4 as TaskArtifactsSummarySchema, X as TaskEvent, cA as TaskInfoUpdateEventData, cz as TaskInfoUpdateEventDataSchema, h as TaskItem, g as TaskItemSchema, c7 as TaskMessageEventData, b3 as TaskMessagePayload, c6 as TaskMessageSchema, cC as TaskSlashCommand, cB as TaskSlashCommandSchema, cE as TaskSlashCommandsUpdateEventData, cD as TaskSlashCommandsUpdateEventDataSchema, c8 as TaskState, ce as TaskStateChangeEventData, cd as TaskStateChangeEventSchema, cI as TaskStoppedEventData, cH as TaskStoppedEventSchema, b as TaskTodo, T as TaskTodoSchema, ai as UnarchiveTaskRequest, ah as UnarchiveTaskRequestSchema, ak as UnarchiveTaskResponse, aj as UnarchiveTaskResponseSchema, cW as UpdateAgentInfoEventData, cV as UpdateAgentInfoEventSchema, cy as UpdateTaskAgentSessionIdEventData, cx as UpdateTaskAgentSessionIdEventSchema, am as UpdateTaskTitleRequest, al as UpdateTaskTitleRequestSchema, ao as UpdateTaskTitleResponse, an as UpdateTaskTitleResponseSchema, dD as ValidationResult, bz as WorkerAliveEventData, by as WorkerAliveEventSchema, W as WorkerExecutionMode, a as WorkerExecutionModeSchema, bB as WorkerExitEventData, bA as WorkerExitSchema, br as WorkerInitializedEventData, bq as WorkerInitializedSchema, bp as WorkerInitializingEventData, bo as WorkerInitializingSchema, bF as WorkerPermissionModeEventData, bE as WorkerPermissionModeSchema, bt as WorkerPermissionModeValue, bs as WorkerPermissionModeValueSchema, bv as WorkerReadyEventData, bu as WorkerReadySchema, bD as WorkerRunningEventData, bC as WorkerRunningSchema, bH as WorkerStatusRequestEventData, bG as WorkerStatusRequestSchema, bL as WorkerStatusSnapshot, bK as WorkerStatusSnapshotSchema, bJ as WorkerStatusValue, bI as WorkerStatusValueSchema, dp as WorkerTaskEvent, cu as WorkspaceFileRequestEventData, ct as WorkspaceFileRequestSchema, cw as WorkspaceFileResponseEventData, cv as WorkspaceFileResponseSchema, bQ as baseTaskSchema, u as cancelTaskRequestSchema, bV as cancelTaskSchema, bd as createEventId, a2 as createMergeRequestSchema, bR as createTaskSchema, dy as getAgentContext, b6 as isAskUserMessage, b7 as isAskUserResponseMessage, b8 as isCompanionHeartbeatMessage, b9 as isCompanionReminderMessage, bb as isSDKMessage, bc as isSDKUserMessage, ba as isSubTaskAskUserMessage, n as normalizeWorkerExecutionMode, I as permissionResponseRequestSchema, r as resumeTaskRequestSchema, bT as resumeTaskSchema, dx as setAgentContext, s as startTaskSchema, A as stopTaskRequestSchema, w as workerExecutionModes, dq as workerTaskEvents } from './errors-B5CcMP8s.cjs';
|
|
4
4
|
import tweetnacl from 'tweetnacl';
|
|
5
5
|
import { SDKMessage } from '@anthropic-ai/claude-agent-sdk';
|
|
6
|
+
export { buildGitLabWebhookEndpointPath, buildGitLabWebhookUrl } from './gitlabWebhook.cjs';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Common HTTP request/response types and utilities
|
|
@@ -332,8 +333,8 @@ type MachineApprovalStatusQuery = z.infer<typeof MachineApprovalStatusQuerySchem
|
|
|
332
333
|
*/
|
|
333
334
|
declare const ApprovalStatusResponseSchema: z.ZodObject<{
|
|
334
335
|
status: z.ZodEnum<{
|
|
335
|
-
approved: "approved";
|
|
336
336
|
pending: "pending";
|
|
337
|
+
approved: "approved";
|
|
337
338
|
}>;
|
|
338
339
|
}, z.core.$strip>;
|
|
339
340
|
type ApprovalStatusResponse = z.infer<typeof ApprovalStatusResponseSchema>;
|
|
@@ -1358,8 +1359,8 @@ type CreateDraftAgentRequest = z.infer<typeof CreateDraftAgentRequestSchema>;
|
|
|
1358
1359
|
declare const SetEnvironmentVariablesRequestSchema: z.ZodObject<{
|
|
1359
1360
|
ownerType: z.ZodEnum<{
|
|
1360
1361
|
agent: "agent";
|
|
1361
|
-
machine: "machine";
|
|
1362
1362
|
"draft-agent": "draft-agent";
|
|
1363
|
+
machine: "machine";
|
|
1363
1364
|
cloud: "cloud";
|
|
1364
1365
|
}>;
|
|
1365
1366
|
ownerId: z.ZodString;
|
|
@@ -1733,8 +1734,8 @@ declare const CloudSchema: z.ZodObject<{
|
|
|
1733
1734
|
member: "member";
|
|
1734
1735
|
}>>;
|
|
1735
1736
|
userStatus: z.ZodOptional<z.ZodEnum<{
|
|
1736
|
-
active: "active";
|
|
1737
1737
|
pending: "pending";
|
|
1738
|
+
active: "active";
|
|
1738
1739
|
revoked: "revoked";
|
|
1739
1740
|
}>>;
|
|
1740
1741
|
maxMachineCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -1776,8 +1777,8 @@ declare const ListMachinesResponseSchema: z.ZodObject<{
|
|
|
1776
1777
|
member: "member";
|
|
1777
1778
|
}>>;
|
|
1778
1779
|
userStatus: z.ZodOptional<z.ZodEnum<{
|
|
1779
|
-
active: "active";
|
|
1780
1780
|
pending: "pending";
|
|
1781
|
+
active: "active";
|
|
1781
1782
|
revoked: "revoked";
|
|
1782
1783
|
}>>;
|
|
1783
1784
|
maxMachineCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -2105,6 +2106,13 @@ declare const GitHubIssueListItemSchema: z.ZodObject<{
|
|
|
2105
2106
|
number: z.ZodNumber;
|
|
2106
2107
|
title: z.ZodString;
|
|
2107
2108
|
html_url: z.ZodString;
|
|
2109
|
+
labels: z.ZodArray<z.ZodString>;
|
|
2110
|
+
state: z.ZodEnum<{
|
|
2111
|
+
open: "open";
|
|
2112
|
+
closed: "closed";
|
|
2113
|
+
}>;
|
|
2114
|
+
created_at: z.ZodString;
|
|
2115
|
+
updated_at: z.ZodString;
|
|
2108
2116
|
}, z.core.$strip>;
|
|
2109
2117
|
type GitHubIssueListItem = z.infer<typeof GitHubIssueListItemSchema>;
|
|
2110
2118
|
/**
|
|
@@ -2115,6 +2123,13 @@ declare const GitHubIssueSchema: z.ZodObject<{
|
|
|
2115
2123
|
title: z.ZodString;
|
|
2116
2124
|
body: z.ZodNullable<z.ZodString>;
|
|
2117
2125
|
html_url: z.ZodString;
|
|
2126
|
+
labels: z.ZodArray<z.ZodString>;
|
|
2127
|
+
state: z.ZodEnum<{
|
|
2128
|
+
open: "open";
|
|
2129
|
+
closed: "closed";
|
|
2130
|
+
}>;
|
|
2131
|
+
created_at: z.ZodString;
|
|
2132
|
+
updated_at: z.ZodString;
|
|
2118
2133
|
author: z.ZodOptional<z.ZodString>;
|
|
2119
2134
|
authorIdentity: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
2120
2135
|
providerUserId: z.ZodOptional<z.ZodString>;
|
|
@@ -2157,6 +2172,13 @@ declare const ListIssuesResponseSchema: z.ZodObject<{
|
|
|
2157
2172
|
number: z.ZodNumber;
|
|
2158
2173
|
title: z.ZodString;
|
|
2159
2174
|
html_url: z.ZodString;
|
|
2175
|
+
labels: z.ZodArray<z.ZodString>;
|
|
2176
|
+
state: z.ZodEnum<{
|
|
2177
|
+
open: "open";
|
|
2178
|
+
closed: "closed";
|
|
2179
|
+
}>;
|
|
2180
|
+
created_at: z.ZodString;
|
|
2181
|
+
updated_at: z.ZodString;
|
|
2160
2182
|
}, z.core.$strip>>;
|
|
2161
2183
|
total_count: z.ZodNumber;
|
|
2162
2184
|
}, z.core.$strip>;
|
|
@@ -3168,8 +3190,8 @@ declare const PrivateCloudSummarySchema: z.ZodObject<{
|
|
|
3168
3190
|
member: "member";
|
|
3169
3191
|
}>>;
|
|
3170
3192
|
userStatus: z.ZodOptional<z.ZodEnum<{
|
|
3171
|
-
active: "active";
|
|
3172
3193
|
pending: "pending";
|
|
3194
|
+
active: "active";
|
|
3173
3195
|
revoked: "revoked";
|
|
3174
3196
|
}>>;
|
|
3175
3197
|
maxMachineCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -3208,8 +3230,8 @@ declare const ListPrivateCloudsResponseSchema: z.ZodObject<{
|
|
|
3208
3230
|
member: "member";
|
|
3209
3231
|
}>>;
|
|
3210
3232
|
userStatus: z.ZodOptional<z.ZodEnum<{
|
|
3211
|
-
active: "active";
|
|
3212
3233
|
pending: "pending";
|
|
3234
|
+
active: "active";
|
|
3213
3235
|
revoked: "revoked";
|
|
3214
3236
|
}>>;
|
|
3215
3237
|
maxMachineCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -3260,8 +3282,8 @@ declare const CreatePrivateCloudResponseSchema: z.ZodObject<{
|
|
|
3260
3282
|
member: "member";
|
|
3261
3283
|
}>>;
|
|
3262
3284
|
userStatus: z.ZodOptional<z.ZodEnum<{
|
|
3263
|
-
active: "active";
|
|
3264
3285
|
pending: "pending";
|
|
3286
|
+
active: "active";
|
|
3265
3287
|
revoked: "revoked";
|
|
3266
3288
|
}>>;
|
|
3267
3289
|
maxMachineCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -3355,8 +3377,8 @@ declare const AcceptPrivateCloudInviteResponseSchema: z.ZodObject<{
|
|
|
3355
3377
|
member: "member";
|
|
3356
3378
|
}>>;
|
|
3357
3379
|
userStatus: z.ZodOptional<z.ZodEnum<{
|
|
3358
|
-
active: "active";
|
|
3359
3380
|
pending: "pending";
|
|
3381
|
+
active: "active";
|
|
3360
3382
|
revoked: "revoked";
|
|
3361
3383
|
}>>;
|
|
3362
3384
|
maxMachineCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -3387,8 +3409,8 @@ declare const PrivateCloudMemberSchema: z.ZodObject<{
|
|
|
3387
3409
|
member: "member";
|
|
3388
3410
|
}>;
|
|
3389
3411
|
status: z.ZodEnum<{
|
|
3390
|
-
active: "active";
|
|
3391
3412
|
pending: "pending";
|
|
3413
|
+
active: "active";
|
|
3392
3414
|
revoked: "revoked";
|
|
3393
3415
|
}>;
|
|
3394
3416
|
createdAt: z.ZodString;
|
|
@@ -3404,8 +3426,8 @@ declare const ListPrivateCloudMembersResponseSchema: z.ZodObject<{
|
|
|
3404
3426
|
member: "member";
|
|
3405
3427
|
}>;
|
|
3406
3428
|
status: z.ZodEnum<{
|
|
3407
|
-
active: "active";
|
|
3408
3429
|
pending: "pending";
|
|
3430
|
+
active: "active";
|
|
3409
3431
|
revoked: "revoked";
|
|
3410
3432
|
}>;
|
|
3411
3433
|
createdAt: z.ZodString;
|
|
@@ -3832,6 +3854,172 @@ declare const DeleteApiKeyResponseSchema: z.ZodObject<{
|
|
|
3832
3854
|
}, z.core.$strip>;
|
|
3833
3855
|
type DeleteApiKeyResponse = z.infer<typeof DeleteApiKeyResponseSchema>;
|
|
3834
3856
|
|
|
3857
|
+
declare const ResourceMetadataSchema: z.ZodObject<{
|
|
3858
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
3859
|
+
mac: "mac";
|
|
3860
|
+
windows: "windows";
|
|
3861
|
+
linux: "linux";
|
|
3862
|
+
}>>;
|
|
3863
|
+
arch: z.ZodOptional<z.ZodEnum<{
|
|
3864
|
+
arm64: "arm64";
|
|
3865
|
+
x64: "x64";
|
|
3866
|
+
universal: "universal";
|
|
3867
|
+
}>>;
|
|
3868
|
+
version: z.ZodOptional<z.ZodString>;
|
|
3869
|
+
}, z.core.$loose>;
|
|
3870
|
+
type ResourceMetadata = z.infer<typeof ResourceMetadataSchema>;
|
|
3871
|
+
declare const PublicResourceItemSchema: z.ZodObject<{
|
|
3872
|
+
id: z.ZodString;
|
|
3873
|
+
type: z.ZodString;
|
|
3874
|
+
name: z.ZodString;
|
|
3875
|
+
description: z.ZodNullable<z.ZodString>;
|
|
3876
|
+
url: z.ZodString;
|
|
3877
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
3878
|
+
metadata: z.ZodNullable<z.ZodObject<{
|
|
3879
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
3880
|
+
mac: "mac";
|
|
3881
|
+
windows: "windows";
|
|
3882
|
+
linux: "linux";
|
|
3883
|
+
}>>;
|
|
3884
|
+
arch: z.ZodOptional<z.ZodEnum<{
|
|
3885
|
+
arm64: "arm64";
|
|
3886
|
+
x64: "x64";
|
|
3887
|
+
universal: "universal";
|
|
3888
|
+
}>>;
|
|
3889
|
+
version: z.ZodOptional<z.ZodString>;
|
|
3890
|
+
}, z.core.$loose>>;
|
|
3891
|
+
sortOrder: z.ZodNumber;
|
|
3892
|
+
}, z.core.$strip>;
|
|
3893
|
+
type PublicResourceItem = z.infer<typeof PublicResourceItemSchema>;
|
|
3894
|
+
declare const ListPublicResourcesQuerySchema: z.ZodObject<{
|
|
3895
|
+
type: z.ZodString;
|
|
3896
|
+
}, z.core.$strip>;
|
|
3897
|
+
type ListPublicResourcesQuery = z.infer<typeof ListPublicResourcesQuerySchema>;
|
|
3898
|
+
declare const ListPublicResourcesResponseSchema: z.ZodObject<{
|
|
3899
|
+
resources: z.ZodArray<z.ZodObject<{
|
|
3900
|
+
id: z.ZodString;
|
|
3901
|
+
type: z.ZodString;
|
|
3902
|
+
name: z.ZodString;
|
|
3903
|
+
description: z.ZodNullable<z.ZodString>;
|
|
3904
|
+
url: z.ZodString;
|
|
3905
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
3906
|
+
metadata: z.ZodNullable<z.ZodObject<{
|
|
3907
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
3908
|
+
mac: "mac";
|
|
3909
|
+
windows: "windows";
|
|
3910
|
+
linux: "linux";
|
|
3911
|
+
}>>;
|
|
3912
|
+
arch: z.ZodOptional<z.ZodEnum<{
|
|
3913
|
+
arm64: "arm64";
|
|
3914
|
+
x64: "x64";
|
|
3915
|
+
universal: "universal";
|
|
3916
|
+
}>>;
|
|
3917
|
+
version: z.ZodOptional<z.ZodString>;
|
|
3918
|
+
}, z.core.$loose>>;
|
|
3919
|
+
sortOrder: z.ZodNumber;
|
|
3920
|
+
}, z.core.$strip>>;
|
|
3921
|
+
}, z.core.$strip>;
|
|
3922
|
+
type ListPublicResourcesResponse = z.infer<typeof ListPublicResourcesResponseSchema>;
|
|
3923
|
+
declare const AdminResourceItemSchema: z.ZodObject<{
|
|
3924
|
+
id: z.ZodString;
|
|
3925
|
+
type: z.ZodString;
|
|
3926
|
+
name: z.ZodString;
|
|
3927
|
+
description: z.ZodNullable<z.ZodString>;
|
|
3928
|
+
url: z.ZodString;
|
|
3929
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
3930
|
+
metadata: z.ZodNullable<z.ZodObject<{
|
|
3931
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
3932
|
+
mac: "mac";
|
|
3933
|
+
windows: "windows";
|
|
3934
|
+
linux: "linux";
|
|
3935
|
+
}>>;
|
|
3936
|
+
arch: z.ZodOptional<z.ZodEnum<{
|
|
3937
|
+
arm64: "arm64";
|
|
3938
|
+
x64: "x64";
|
|
3939
|
+
universal: "universal";
|
|
3940
|
+
}>>;
|
|
3941
|
+
version: z.ZodOptional<z.ZodString>;
|
|
3942
|
+
}, z.core.$loose>>;
|
|
3943
|
+
sortOrder: z.ZodNumber;
|
|
3944
|
+
enabled: z.ZodBoolean;
|
|
3945
|
+
createdAt: z.ZodString;
|
|
3946
|
+
updatedAt: z.ZodString;
|
|
3947
|
+
}, z.core.$strip>;
|
|
3948
|
+
type AdminResourceItem = z.infer<typeof AdminResourceItemSchema>;
|
|
3949
|
+
declare const ListAdminResourcesResponseSchema: z.ZodObject<{
|
|
3950
|
+
resources: z.ZodArray<z.ZodObject<{
|
|
3951
|
+
id: z.ZodString;
|
|
3952
|
+
type: z.ZodString;
|
|
3953
|
+
name: z.ZodString;
|
|
3954
|
+
description: z.ZodNullable<z.ZodString>;
|
|
3955
|
+
url: z.ZodString;
|
|
3956
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
3957
|
+
metadata: z.ZodNullable<z.ZodObject<{
|
|
3958
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
3959
|
+
mac: "mac";
|
|
3960
|
+
windows: "windows";
|
|
3961
|
+
linux: "linux";
|
|
3962
|
+
}>>;
|
|
3963
|
+
arch: z.ZodOptional<z.ZodEnum<{
|
|
3964
|
+
arm64: "arm64";
|
|
3965
|
+
x64: "x64";
|
|
3966
|
+
universal: "universal";
|
|
3967
|
+
}>>;
|
|
3968
|
+
version: z.ZodOptional<z.ZodString>;
|
|
3969
|
+
}, z.core.$loose>>;
|
|
3970
|
+
sortOrder: z.ZodNumber;
|
|
3971
|
+
enabled: z.ZodBoolean;
|
|
3972
|
+
createdAt: z.ZodString;
|
|
3973
|
+
updatedAt: z.ZodString;
|
|
3974
|
+
}, z.core.$strip>>;
|
|
3975
|
+
}, z.core.$strip>;
|
|
3976
|
+
type ListAdminResourcesResponse = z.infer<typeof ListAdminResourcesResponseSchema>;
|
|
3977
|
+
declare const CreateResourceRequestSchema: z.ZodObject<{
|
|
3978
|
+
type: z.ZodString;
|
|
3979
|
+
name: z.ZodString;
|
|
3980
|
+
description: z.ZodOptional<z.ZodString>;
|
|
3981
|
+
url: z.ZodString;
|
|
3982
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
3983
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
3984
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
3985
|
+
mac: "mac";
|
|
3986
|
+
windows: "windows";
|
|
3987
|
+
linux: "linux";
|
|
3988
|
+
}>>;
|
|
3989
|
+
arch: z.ZodOptional<z.ZodEnum<{
|
|
3990
|
+
arm64: "arm64";
|
|
3991
|
+
x64: "x64";
|
|
3992
|
+
universal: "universal";
|
|
3993
|
+
}>>;
|
|
3994
|
+
version: z.ZodOptional<z.ZodString>;
|
|
3995
|
+
}, z.core.$loose>>;
|
|
3996
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
3997
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
3998
|
+
}, z.core.$strip>;
|
|
3999
|
+
type CreateResourceRequest = z.infer<typeof CreateResourceRequestSchema>;
|
|
4000
|
+
declare const UpdateResourceRequestSchema: z.ZodObject<{
|
|
4001
|
+
name: z.ZodOptional<z.ZodString>;
|
|
4002
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4003
|
+
url: z.ZodOptional<z.ZodString>;
|
|
4004
|
+
thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4005
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
4006
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
4007
|
+
mac: "mac";
|
|
4008
|
+
windows: "windows";
|
|
4009
|
+
linux: "linux";
|
|
4010
|
+
}>>;
|
|
4011
|
+
arch: z.ZodOptional<z.ZodEnum<{
|
|
4012
|
+
arm64: "arm64";
|
|
4013
|
+
x64: "x64";
|
|
4014
|
+
universal: "universal";
|
|
4015
|
+
}>>;
|
|
4016
|
+
version: z.ZodOptional<z.ZodString>;
|
|
4017
|
+
}, z.core.$loose>>>;
|
|
4018
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
4019
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
4020
|
+
}, z.core.$strip>;
|
|
4021
|
+
type UpdateResourceRequest = z.infer<typeof UpdateResourceRequestSchema>;
|
|
4022
|
+
|
|
3835
4023
|
type ClientType = 'user' | 'worker' | 'machine';
|
|
3836
4024
|
interface AuthPayload {
|
|
3837
4025
|
token: string;
|
|
@@ -4090,5 +4278,5 @@ declare function detectPreview(fs: FileSystemAdapter): Promise<PreviewMetadata |
|
|
|
4090
4278
|
*/
|
|
4091
4279
|
declare function decodeGitPath(rawPath: string): string;
|
|
4092
4280
|
|
|
4093
|
-
export { AcceptPrivateCloudInviteRequestSchema, AcceptPrivateCloudInviteResponseSchema, AddChatMemberRequestSchema, AddChatMemberResponseSchema, AgentCustomConfigSchema, AgentPermissionsSchema, AgentSchema, AgentTypeSchema, ApiErrorSchema, ApiKeySchema, ApprovalStatusResponseSchema, BillingStatsResponseSchema, BranchSchema, CONFIG_FILES, CancelCiRunResponseSchema, CancelSubscriptionResponseSchema, ChargeTransactionSchema, ChatMemberInputSchema, ChatMemberSchema, ChatSchema, ChatTypeSchema, ChatWithMembersSchema, CiProviderSchema, CiRunContextSchema, CiRunExecutionSchema, CiRunGitSchema, CiRunRepoSchema, CiRunStatusResponseSchema, CiRunStatusSchema, CloudJoinApprovalRequestSchema, CloudJoinRequestSchema, CloudJoinResultQuerySchema, CloudJoinStatusQuerySchema, CloudMachineSchema, CloudSchema, CompanionEnsureResponseSchema, CompanionWorkspaceFileSchema, ConfirmUploadRequestSchema, ConfirmUploadResponseSchema, ConsumeTransactionSchema, ContactCandidateSchema, ContactSchema, ContactTargetTypeSchema, CreateAgentRequestSchema, CreateAgentResponseSchema, CreateApiKeyRequestSchema, CreateApiKeyResponseSchema, CreateChatRequestSchema, CreateChatResponseSchema, CreateCheckoutRequestSchema, CreateCheckoutResponseSchema, CreateCiRunRequestSchema, CreateCiRunResponseSchema, CreateCloudRequestSchema, CreateCloudResponseSchema, CreateContactRequestSchema, CreateContactResponseSchema, CreateDirectRechargeCheckoutRequestSchema, CreateDirectRechargeCheckoutResponseSchema, CreateDraftAgentRequestSchema, CreateOAuthServerRequestSchema, CreateOAuthServerResponseSchema, CreatePortalRequestSchema, CreatePortalResponseSchema, CreatePrivateCloudInviteRequestSchema, CreatePrivateCloudInviteResponseSchema, CreatePrivateCloudRequestSchema, CreatePrivateCloudResponseSchema, CreateSubscriptionPlanRequestSchema, CreditsBucketSchema, CreditsPackageSchema, DateSchema, DeleteAgentResponseSchema, DeleteApiKeyResponseSchema, DeleteContactResponseSchema, DeleteOAuthServerResponseSchema, DevCreateUserRequestSchema, DevCreateUserResponseSchema, DisplayConfigKeysSchema, DisplayConfigSchema, DraftAgentConfigSchema, DraftAgentSchema, ENTRY_FILE_PATTERNS, EnsureRepoChatRequestSchema, EnsureRepoChatResponseSchema, EnvironmentVariableSchema, FileItemSchema, FileStatsSchema, FileVisibilitySchema, GetAgentGitUrlResponseSchema, GetAgentResponseSchema, GetChatResponseSchema, GetEnvironmentVariablesResponseSchema, GetGitServerResponseSchema, GetGitUrlQuerySchema, GetGitUrlResponseSchema, GetInstallUrlResponseSchema, GetOAuthServerResponseSchema, GetPrivateCloudRunnerSecretResponseSchema, GetReferenceQuerySchema, GetRepositoryResponseSchema, GetSubscriptionResponseSchema, GetSubscriptionTiersResponseSchema, GetUploadUrlsRequestSchema, GetUploadUrlsResponseSchema, GetUserAgentsResponseSchema, GitHubIssueListItemSchema, GitHubIssueSchema, GitServerSchema, IGNORED_DIRECTORIES, IdSchema, JsonSchemaDocumentSchema, ListAgentsResponseSchema, ListApiKeysQuerySchema, ListApiKeysResponseSchema, ListBranchesResponseSchema, ListChatMembersResponseSchema, ListChatTasksResponseSchema, ListChatsQuerySchema, ListChatsResponseSchema, ListContactsResponseSchema, ListFilesQuerySchema, ListFilesResponseSchema, ListGitServersResponseSchema, ListIssuesQuerySchema, ListIssuesResponseSchema, ListMachinesResponseSchema, ListOAuthServersPublicResponseSchema, ListOAuthServersQuerySchema, ListOAuthServersResponseSchema, ListPackagesQuerySchema, ListPackagesResponseSchema, ListPrivateCloudMembersResponseSchema, ListPrivateCloudsResponseSchema, ListReferencesQuerySchema, ListReferencesResponseSchema, ListRepositoriesResponseSchema, ListSubscriptionPlansResponseSchema, ListTransactionsQuerySchema, ListTransactionsResponseSchema, ListUserInboxResponseSchema, LocalMachineSchema, LogoutResponseSchema, MachineApprovalRequestSchema, MachineApprovalStatusQuerySchema, MachineAuthAuthorizedResponseSchema, MachineAuthRequestSchema, MachineAuthResultQuerySchema, MachineUnbindRequestSchema, MachineUnbindResponseSchema, OAuthAccountInfoSchema, OAuthBindCallbackResponseSchema, OAuthBindQuerySchema, OAuthBindResponseSchema, OAuthCallbackQuerySchema, OAuthCallbackResponseSchema, OAuthLoginQuerySchema, OAuthServerPublicSchema, OAuthServerSchema, OAuthUnbindResponseSchema, PaginatedResponseSchema, PreviewMetadata, PrivateCloudEntitlementSchema, PrivateCloudInviteSchema, PrivateCloudMemberSchema, PrivateCloudSummarySchema, PublishDraftAgentRequestSchema, PublishDraftAgentResponseSchema, RELEVANT_DEPENDENCIES, RTC_CHUNK_HEADER_SIZE, RechargeResponseSchema, RegisterCompanionRequestSchema, RegisterCompanionResponseSchema, RemoveChatMemberRequestSchema, RemovePrivateCloudMemberResponseSchema, RepositoryActorIdentitySchema, RepositoryReferenceCommentSchema, RepositoryReferenceCommentsResponseSchema, RepositoryReferenceDiffSchema, RepositoryReferenceKindSchema, RepositoryReferenceListItemSchema, RepositoryReferenceSchema, RepositorySchema, ResetSecretRequestSchema, ResetSecretResponseSchema, ResolveUserInboxItemResponseSchema, RtcChunkFlags, STATIC_FILE_EXTENSIONS, SearchContactCandidatesQuerySchema, SearchContactCandidatesResponseSchema, SenderTypeSchema, SetEnvironmentVariablesRequestSchema, ShareAuthQuerySchema, ShareAuthResponseSchema, SimpleSuccessSchema, StatsQuerySchema, StripeCheckoutClientSchema, SubscriptionPlanSchema, SubscriptionSchema, SubscriptionTierSchema, SyncCloudMachineResponseSchema, SyncLocalMachineResponseSchema, SyncMachineModelsRequestSchema, SyncMachineModelsResponseSchema, SyncMachineRequestSchema, TaskSharePermissionsSchema, TaskTransactionsResponseSchema, ToggleApiKeyRequestSchema, ToggleOAuthServerRequestSchema, ToggleOAuthServerResponseSchema, TransactionSchema, UpdateAgentRequestSchema, UpdateAgentResponseSchema, UpdateApiKeyRequestSchema, UpdateDraftAgentRequestSchema, UpdateDraftAgentResponseSchema, UpdateOAuthServerRequestSchema, UpdateOAuthServerResponseSchema, UpdateSecretRequestSchema, UpdateSecretResponseSchema, UpdateSubscriptionPlanRequestSchema, UpdateSubscriptionRequestSchema, UpdateSubscriptionResponseSchema, UpdateUserProfileRequestSchema, UpdateUserProfileResponseSchema, UploadUrlResultSchema, UserBalanceResponseSchema, UserBasicInfoSchema, UserInboxItemSchema, UserInboxStatusSchema, UserInboxSubjectTypeSchema, UserProfileResponseSchema, UserWithOAuthAccountsSchema, ValidateMachineResponseSchema, buildRtcChunkFrame, createKeyPair, createKeyPairWithUit8Array, createTaskEncryptionPayload, decodeBase64, decodeGitPath, decodeRtcChunkHeader, decryptAES, decryptFileContent, decryptMachineEncryptionKey, decryptSdkMessage, decryptWithEphemeralKey, detectPreview, encodeBase64, encodeBase64Url, encodeRtcChunkHeader, encryptAES, encryptFileContent, encryptMachineEncryptionKey, encryptSdkMessage, encryptWithEphemeralKey, generateAESKey, generateAESKeyBase64, getRandomBytes, machineAuth, splitRtcChunkFrame, userAuth, workerAuth };
|
|
4094
|
-
export type { AcceptPrivateCloudInviteRequest, AcceptPrivateCloudInviteResponse, AddChatMemberRequest, AddChatMemberResponse, Agent, AgentCustomConfig, AgentPermissions, AgentType, ApiError, ApiKey, ApprovalStatusResponse, AuthPayload, BillingStatsResponse, Branch, CancelCiRunResponse, CancelSubscriptionResponse, ChargeTransaction, Chat, ChatMember, ChatMemberInput, ChatType, ChatWithMembers, CiProvider, CiRunContext, CiRunExecution, CiRunGit, CiRunRepo, CiRunStatus, CiRunStatusResponse, ClientType, Cloud, CloudJoinApprovalRequest, CloudJoinRequest, CloudJoinResultQuery, CloudJoinStatusQuery, CloudMachine, CompanionEnsureResponse, CompanionWorkspaceFile, ConfirmUploadRequest, ConfirmUploadResponse, ConsumeTransaction, Contact, ContactCandidate, ContactTargetType, CreateAgentRequest, CreateAgentResponse, CreateApiKeyRequest, CreateApiKeyResponse, CreateChatRequest, CreateChatResponse, CreateCheckoutRequest, CreateCheckoutResponse, CreateCiRunRequest, CreateCiRunResponse, CreateCloudRequest, CreateCloudResponse, CreateContactRequest, CreateContactResponse, CreateDirectRechargeCheckoutRequest, CreateDirectRechargeCheckoutResponse, CreateDraftAgentRequest, CreateOAuthServerRequest, CreateOAuthServerResponse, CreatePortalRequest, CreatePortalResponse, CreatePrivateCloudInviteRequest, CreatePrivateCloudInviteResponse, CreatePrivateCloudRequest, CreatePrivateCloudResponse, CreateSubscriptionPlanRequest, CreditsBucket, CreditsPackage, DeleteAgentResponse, DeleteApiKeyResponse, DeleteContactResponse, DeleteOAuthServerResponse, DevCreateUserRequest, DevCreateUserResponse, DisplayConfig, DisplayConfigKeys, DraftAgent, DraftAgentConfig, EnsureRepoChatRequest, EnsureRepoChatResponse, EnvironmentVariable, FileItem, FileStats, FileSystemAdapter, FileVisibility, GetAgentGitUrlResponse, GetAgentResponse, GetChatResponse, GetEnvironmentVariablesResponse, GetGitServerResponse, GetGitUrlQuery, GetGitUrlResponse, GetInstallUrlResponse, GetOAuthServerResponse, GetPrivateCloudRunnerSecretResponse, GetReferenceQuery, GetRepositoryResponse, GetSubscriptionResponse, GetSubscriptionTiersResponse, GetUploadUrlsRequest, GetUploadUrlsResponse, GetUserAgentsResponse, GitHubIssue, GitHubIssueListItem, GitServer, JsonSchemaDocument, ListAgentsResponse, ListApiKeysQuery, ListApiKeysResponse, ListBranchesResponse, ListChatMembersResponse, ListChatTasksResponse, ListChatsQuery, ListChatsResponse, ListContactsResponse, ListFilesQuery, ListFilesResponse, ListGitServersResponse, ListIssuesQuery, ListIssuesResponse, ListMachinesResponse, ListOAuthServersPublicResponse, ListOAuthServersQuery, ListOAuthServersResponse, ListPackagesQuery, ListPackagesResponse, ListPrivateCloudMembersResponse, ListPrivateCloudsResponse, ListReferencesQuery, ListReferencesResponse, ListRepositoriesResponse, ListSubscriptionPlansResponse, ListTransactionsQuery, ListTransactionsResponse, ListUserInboxResponse, LocalMachine, LogoutResponse, MachineApprovalRequest, MachineApprovalStatusQuery, MachineAuthAuthorizedResponse, MachineAuthRequest, MachineAuthResultQuery, MachineEncryptionKey, MachineUnbindRequest, MachineUnbindResponse, OAuthAccountInfo, OAuthBindCallbackResponse, OAuthBindQuery, OAuthBindResponse, OAuthCallbackQuery, OAuthCallbackResponse, OAuthLoginQuery, OAuthServer, OAuthServerPublic, OAuthUnbindResponse, PrivateCloudEntitlement, PrivateCloudInvite, PrivateCloudMember, PrivateCloudSummary, PublishDraftAgentRequest, PublishDraftAgentResponse, RechargeResponse, RegisterCompanionRequest, RegisterCompanionResponse, RemoveChatMemberRequest, RemovePrivateCloudMemberResponse, Repository, RepositoryActorIdentity, RepositoryReference, RepositoryReferenceComment, RepositoryReferenceCommentsResponse, RepositoryReferenceDiff, RepositoryReferenceKind, RepositoryReferenceListItem, ResetSecretRequest, ResetSecretResponse, ResolveUserInboxItemResponse, RtcChunkFrame, RtcChunkHeader, RtcControlChannel, RtcControlMessage, SearchContactCandidatesQuery, SearchContactCandidatesResponse, SenderType, SetEnvironmentVariablesRequest, ShareAuthQuery, ShareAuthResponse, SimpleSuccess, StatsQuery, StripeCheckoutClient, Subscription, SubscriptionPlan, SubscriptionTier, SyncCloudMachineResponse, SyncLocalMachineResponse, SyncMachineModelsRequest, SyncMachineModelsResponse, SyncMachineRequest, TaskEncryptionPayload, TaskSharePermissions, TaskTransactionsResponse, ToggleApiKeyRequest, ToggleOAuthServerRequest, ToggleOAuthServerResponse, Transaction, UpdateAgentRequest, UpdateAgentResponse, UpdateApiKeyRequest, UpdateDraftAgentRequest, UpdateDraftAgentResponse, UpdateOAuthServerRequest, UpdateOAuthServerResponse, UpdateSecretRequest, UpdateSecretResponse, UpdateSubscriptionPlanRequest, UpdateSubscriptionRequest, UpdateSubscriptionResponse, UpdateUserProfileRequest, UpdateUserProfileResponse, UploadUrlResult, UserBalanceResponse, UserBasicInfo, UserInboxItem, UserInboxStatus, UserInboxSubjectType, UserProfileResponse, UserWithOAuthAccounts, ValidateMachineResponse };
|
|
4281
|
+
export { AcceptPrivateCloudInviteRequestSchema, AcceptPrivateCloudInviteResponseSchema, AddChatMemberRequestSchema, AddChatMemberResponseSchema, AdminResourceItemSchema, AgentCustomConfigSchema, AgentPermissionsSchema, AgentSchema, AgentTypeSchema, ApiErrorSchema, ApiKeySchema, ApprovalStatusResponseSchema, BillingStatsResponseSchema, BranchSchema, CONFIG_FILES, CancelCiRunResponseSchema, CancelSubscriptionResponseSchema, ChargeTransactionSchema, ChatMemberInputSchema, ChatMemberSchema, ChatSchema, ChatTypeSchema, ChatWithMembersSchema, CiProviderSchema, CiRunContextSchema, CiRunExecutionSchema, CiRunGitSchema, CiRunRepoSchema, CiRunStatusResponseSchema, CiRunStatusSchema, CloudJoinApprovalRequestSchema, CloudJoinRequestSchema, CloudJoinResultQuerySchema, CloudJoinStatusQuerySchema, CloudMachineSchema, CloudSchema, CompanionEnsureResponseSchema, CompanionWorkspaceFileSchema, ConfirmUploadRequestSchema, ConfirmUploadResponseSchema, ConsumeTransactionSchema, ContactCandidateSchema, ContactSchema, ContactTargetTypeSchema, CreateAgentRequestSchema, CreateAgentResponseSchema, CreateApiKeyRequestSchema, CreateApiKeyResponseSchema, CreateChatRequestSchema, CreateChatResponseSchema, CreateCheckoutRequestSchema, CreateCheckoutResponseSchema, CreateCiRunRequestSchema, CreateCiRunResponseSchema, CreateCloudRequestSchema, CreateCloudResponseSchema, CreateContactRequestSchema, CreateContactResponseSchema, CreateDirectRechargeCheckoutRequestSchema, CreateDirectRechargeCheckoutResponseSchema, CreateDraftAgentRequestSchema, CreateOAuthServerRequestSchema, CreateOAuthServerResponseSchema, CreatePortalRequestSchema, CreatePortalResponseSchema, CreatePrivateCloudInviteRequestSchema, CreatePrivateCloudInviteResponseSchema, CreatePrivateCloudRequestSchema, CreatePrivateCloudResponseSchema, CreateResourceRequestSchema, CreateSubscriptionPlanRequestSchema, CreditsBucketSchema, CreditsPackageSchema, DateSchema, DeleteAgentResponseSchema, DeleteApiKeyResponseSchema, DeleteContactResponseSchema, DeleteOAuthServerResponseSchema, DevCreateUserRequestSchema, DevCreateUserResponseSchema, DisplayConfigKeysSchema, DisplayConfigSchema, DraftAgentConfigSchema, DraftAgentSchema, ENTRY_FILE_PATTERNS, EnsureRepoChatRequestSchema, EnsureRepoChatResponseSchema, EnvironmentVariableSchema, FileItemSchema, FileStatsSchema, FileVisibilitySchema, GetAgentGitUrlResponseSchema, GetAgentResponseSchema, GetChatResponseSchema, GetEnvironmentVariablesResponseSchema, GetGitServerResponseSchema, GetGitUrlQuerySchema, GetGitUrlResponseSchema, GetInstallUrlResponseSchema, GetOAuthServerResponseSchema, GetPrivateCloudRunnerSecretResponseSchema, GetReferenceQuerySchema, GetRepositoryResponseSchema, GetSubscriptionResponseSchema, GetSubscriptionTiersResponseSchema, GetUploadUrlsRequestSchema, GetUploadUrlsResponseSchema, GetUserAgentsResponseSchema, GitHubIssueListItemSchema, GitHubIssueSchema, GitServerSchema, IGNORED_DIRECTORIES, IdSchema, JsonSchemaDocumentSchema, ListAdminResourcesResponseSchema, ListAgentsResponseSchema, ListApiKeysQuerySchema, ListApiKeysResponseSchema, ListBranchesResponseSchema, ListChatMembersResponseSchema, ListChatTasksResponseSchema, ListChatsQuerySchema, ListChatsResponseSchema, ListContactsResponseSchema, ListFilesQuerySchema, ListFilesResponseSchema, ListGitServersResponseSchema, ListIssuesQuerySchema, ListIssuesResponseSchema, ListMachinesResponseSchema, ListOAuthServersPublicResponseSchema, ListOAuthServersQuerySchema, ListOAuthServersResponseSchema, ListPackagesQuerySchema, ListPackagesResponseSchema, ListPrivateCloudMembersResponseSchema, ListPrivateCloudsResponseSchema, ListPublicResourcesQuerySchema, ListPublicResourcesResponseSchema, ListReferencesQuerySchema, ListReferencesResponseSchema, ListRepositoriesResponseSchema, ListSubscriptionPlansResponseSchema, ListTransactionsQuerySchema, ListTransactionsResponseSchema, ListUserInboxResponseSchema, LocalMachineSchema, LogoutResponseSchema, MachineApprovalRequestSchema, MachineApprovalStatusQuerySchema, MachineAuthAuthorizedResponseSchema, MachineAuthRequestSchema, MachineAuthResultQuerySchema, MachineUnbindRequestSchema, MachineUnbindResponseSchema, OAuthAccountInfoSchema, OAuthBindCallbackResponseSchema, OAuthBindQuerySchema, OAuthBindResponseSchema, OAuthCallbackQuerySchema, OAuthCallbackResponseSchema, OAuthLoginQuerySchema, OAuthServerPublicSchema, OAuthServerSchema, OAuthUnbindResponseSchema, PaginatedResponseSchema, PreviewMetadata, PrivateCloudEntitlementSchema, PrivateCloudInviteSchema, PrivateCloudMemberSchema, PrivateCloudSummarySchema, PublicResourceItemSchema, PublishDraftAgentRequestSchema, PublishDraftAgentResponseSchema, RELEVANT_DEPENDENCIES, RTC_CHUNK_HEADER_SIZE, RechargeResponseSchema, RegisterCompanionRequestSchema, RegisterCompanionResponseSchema, RemoveChatMemberRequestSchema, RemovePrivateCloudMemberResponseSchema, RepositoryActorIdentitySchema, RepositoryReferenceCommentSchema, RepositoryReferenceCommentsResponseSchema, RepositoryReferenceDiffSchema, RepositoryReferenceKindSchema, RepositoryReferenceListItemSchema, RepositoryReferenceSchema, RepositorySchema, ResetSecretRequestSchema, ResetSecretResponseSchema, ResolveUserInboxItemResponseSchema, ResourceMetadataSchema, RtcChunkFlags, STATIC_FILE_EXTENSIONS, SearchContactCandidatesQuerySchema, SearchContactCandidatesResponseSchema, SenderTypeSchema, SetEnvironmentVariablesRequestSchema, ShareAuthQuerySchema, ShareAuthResponseSchema, SimpleSuccessSchema, StatsQuerySchema, StripeCheckoutClientSchema, SubscriptionPlanSchema, SubscriptionSchema, SubscriptionTierSchema, SyncCloudMachineResponseSchema, SyncLocalMachineResponseSchema, SyncMachineModelsRequestSchema, SyncMachineModelsResponseSchema, SyncMachineRequestSchema, TaskSharePermissionsSchema, TaskTransactionsResponseSchema, ToggleApiKeyRequestSchema, ToggleOAuthServerRequestSchema, ToggleOAuthServerResponseSchema, TransactionSchema, UpdateAgentRequestSchema, UpdateAgentResponseSchema, UpdateApiKeyRequestSchema, UpdateDraftAgentRequestSchema, UpdateDraftAgentResponseSchema, UpdateOAuthServerRequestSchema, UpdateOAuthServerResponseSchema, UpdateResourceRequestSchema, UpdateSecretRequestSchema, UpdateSecretResponseSchema, UpdateSubscriptionPlanRequestSchema, UpdateSubscriptionRequestSchema, UpdateSubscriptionResponseSchema, UpdateUserProfileRequestSchema, UpdateUserProfileResponseSchema, UploadUrlResultSchema, UserBalanceResponseSchema, UserBasicInfoSchema, UserInboxItemSchema, UserInboxStatusSchema, UserInboxSubjectTypeSchema, UserProfileResponseSchema, UserWithOAuthAccountsSchema, ValidateMachineResponseSchema, buildRtcChunkFrame, createKeyPair, createKeyPairWithUit8Array, createTaskEncryptionPayload, decodeBase64, decodeGitPath, decodeRtcChunkHeader, decryptAES, decryptFileContent, decryptMachineEncryptionKey, decryptSdkMessage, decryptWithEphemeralKey, detectPreview, encodeBase64, encodeBase64Url, encodeRtcChunkHeader, encryptAES, encryptFileContent, encryptMachineEncryptionKey, encryptSdkMessage, encryptWithEphemeralKey, generateAESKey, generateAESKeyBase64, getRandomBytes, machineAuth, splitRtcChunkFrame, userAuth, workerAuth };
|
|
4282
|
+
export type { AcceptPrivateCloudInviteRequest, AcceptPrivateCloudInviteResponse, AddChatMemberRequest, AddChatMemberResponse, AdminResourceItem, Agent, AgentCustomConfig, AgentPermissions, AgentType, ApiError, ApiKey, ApprovalStatusResponse, AuthPayload, BillingStatsResponse, Branch, CancelCiRunResponse, CancelSubscriptionResponse, ChargeTransaction, Chat, ChatMember, ChatMemberInput, ChatType, ChatWithMembers, CiProvider, CiRunContext, CiRunExecution, CiRunGit, CiRunRepo, CiRunStatus, CiRunStatusResponse, ClientType, Cloud, CloudJoinApprovalRequest, CloudJoinRequest, CloudJoinResultQuery, CloudJoinStatusQuery, CloudMachine, CompanionEnsureResponse, CompanionWorkspaceFile, ConfirmUploadRequest, ConfirmUploadResponse, ConsumeTransaction, Contact, ContactCandidate, ContactTargetType, CreateAgentRequest, CreateAgentResponse, CreateApiKeyRequest, CreateApiKeyResponse, CreateChatRequest, CreateChatResponse, CreateCheckoutRequest, CreateCheckoutResponse, CreateCiRunRequest, CreateCiRunResponse, CreateCloudRequest, CreateCloudResponse, CreateContactRequest, CreateContactResponse, CreateDirectRechargeCheckoutRequest, CreateDirectRechargeCheckoutResponse, CreateDraftAgentRequest, CreateOAuthServerRequest, CreateOAuthServerResponse, CreatePortalRequest, CreatePortalResponse, CreatePrivateCloudInviteRequest, CreatePrivateCloudInviteResponse, CreatePrivateCloudRequest, CreatePrivateCloudResponse, CreateResourceRequest, CreateSubscriptionPlanRequest, CreditsBucket, CreditsPackage, DeleteAgentResponse, DeleteApiKeyResponse, DeleteContactResponse, DeleteOAuthServerResponse, DevCreateUserRequest, DevCreateUserResponse, DisplayConfig, DisplayConfigKeys, DraftAgent, DraftAgentConfig, EnsureRepoChatRequest, EnsureRepoChatResponse, EnvironmentVariable, FileItem, FileStats, FileSystemAdapter, FileVisibility, GetAgentGitUrlResponse, GetAgentResponse, GetChatResponse, GetEnvironmentVariablesResponse, GetGitServerResponse, GetGitUrlQuery, GetGitUrlResponse, GetInstallUrlResponse, GetOAuthServerResponse, GetPrivateCloudRunnerSecretResponse, GetReferenceQuery, GetRepositoryResponse, GetSubscriptionResponse, GetSubscriptionTiersResponse, GetUploadUrlsRequest, GetUploadUrlsResponse, GetUserAgentsResponse, GitHubIssue, GitHubIssueListItem, GitServer, JsonSchemaDocument, ListAdminResourcesResponse, ListAgentsResponse, ListApiKeysQuery, ListApiKeysResponse, ListBranchesResponse, ListChatMembersResponse, ListChatTasksResponse, ListChatsQuery, ListChatsResponse, ListContactsResponse, ListFilesQuery, ListFilesResponse, ListGitServersResponse, ListIssuesQuery, ListIssuesResponse, ListMachinesResponse, ListOAuthServersPublicResponse, ListOAuthServersQuery, ListOAuthServersResponse, ListPackagesQuery, ListPackagesResponse, ListPrivateCloudMembersResponse, ListPrivateCloudsResponse, ListPublicResourcesQuery, ListPublicResourcesResponse, ListReferencesQuery, ListReferencesResponse, ListRepositoriesResponse, ListSubscriptionPlansResponse, ListTransactionsQuery, ListTransactionsResponse, ListUserInboxResponse, LocalMachine, LogoutResponse, MachineApprovalRequest, MachineApprovalStatusQuery, MachineAuthAuthorizedResponse, MachineAuthRequest, MachineAuthResultQuery, MachineEncryptionKey, MachineUnbindRequest, MachineUnbindResponse, OAuthAccountInfo, OAuthBindCallbackResponse, OAuthBindQuery, OAuthBindResponse, OAuthCallbackQuery, OAuthCallbackResponse, OAuthLoginQuery, OAuthServer, OAuthServerPublic, OAuthUnbindResponse, PrivateCloudEntitlement, PrivateCloudInvite, PrivateCloudMember, PrivateCloudSummary, PublicResourceItem, PublishDraftAgentRequest, PublishDraftAgentResponse, RechargeResponse, RegisterCompanionRequest, RegisterCompanionResponse, RemoveChatMemberRequest, RemovePrivateCloudMemberResponse, Repository, RepositoryActorIdentity, RepositoryReference, RepositoryReferenceComment, RepositoryReferenceCommentsResponse, RepositoryReferenceDiff, RepositoryReferenceKind, RepositoryReferenceListItem, ResetSecretRequest, ResetSecretResponse, ResolveUserInboxItemResponse, ResourceMetadata, RtcChunkFrame, RtcChunkHeader, RtcControlChannel, RtcControlMessage, SearchContactCandidatesQuery, SearchContactCandidatesResponse, SenderType, SetEnvironmentVariablesRequest, ShareAuthQuery, ShareAuthResponse, SimpleSuccess, StatsQuery, StripeCheckoutClient, Subscription, SubscriptionPlan, SubscriptionTier, SyncCloudMachineResponse, SyncLocalMachineResponse, SyncMachineModelsRequest, SyncMachineModelsResponse, SyncMachineRequest, TaskEncryptionPayload, TaskSharePermissions, TaskTransactionsResponse, ToggleApiKeyRequest, ToggleOAuthServerRequest, ToggleOAuthServerResponse, Transaction, UpdateAgentRequest, UpdateAgentResponse, UpdateApiKeyRequest, UpdateDraftAgentRequest, UpdateDraftAgentResponse, UpdateOAuthServerRequest, UpdateOAuthServerResponse, UpdateResourceRequest, UpdateSecretRequest, UpdateSecretResponse, UpdateSubscriptionPlanRequest, UpdateSubscriptionRequest, UpdateSubscriptionResponse, UpdateUserProfileRequest, UpdateUserProfileResponse, UploadUrlResult, UserBalanceResponse, UserBasicInfo, UserInboxItem, UserInboxStatus, UserInboxSubjectType, UserProfileResponse, UserWithOAuthAccounts, ValidateMachineResponse };
|
package/dist/node.cjs
CHANGED
|
@@ -4,6 +4,8 @@ var node_fs = require('node:fs');
|
|
|
4
4
|
var node_path = require('node:path');
|
|
5
5
|
var errors = require('./errors-myQvpVrM.cjs');
|
|
6
6
|
var os = require('node:os');
|
|
7
|
+
var gitlabWebhook = require('./gitlabWebhook.cjs');
|
|
8
|
+
var node_crypto = require('node:crypto');
|
|
7
9
|
require('zod');
|
|
8
10
|
|
|
9
11
|
function _interopNamespaceDefault(e) {
|
|
@@ -213,11 +215,14 @@ async function loadSystemPrompt(claudeDir, promptFile) {
|
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
function replacePromptPlaceholders(template, cwd, extra) {
|
|
218
|
+
const now = /* @__PURE__ */ new Date();
|
|
216
219
|
const vars = {
|
|
217
220
|
WORKING_DIR: cwd,
|
|
218
221
|
PLATFORM: process.platform,
|
|
219
222
|
OS_VERSION: `${os__namespace.type()} ${os__namespace.release()}`,
|
|
220
|
-
DATE:
|
|
223
|
+
DATE: now.toISOString().split("T")[0],
|
|
224
|
+
TIME: now.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit", hour12: false }),
|
|
225
|
+
TIMEZONE: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
221
226
|
...extra
|
|
222
227
|
};
|
|
223
228
|
let result = template.replace(
|
|
@@ -234,6 +239,296 @@ function replacePromptPlaceholders(template, cwd, extra) {
|
|
|
234
239
|
return result;
|
|
235
240
|
}
|
|
236
241
|
|
|
242
|
+
const ALGORITHM = "aes-256-gcm";
|
|
243
|
+
const DEFAULT_PAT_VALIDATE_TIMEOUT_MS = 1e4;
|
|
244
|
+
const DEFAULT_GITLAB_PAT_REQUIRED_SCOPES = ["api", "read_repository", "write_repository"];
|
|
245
|
+
function hmacSha512(key, data) {
|
|
246
|
+
const hmac = node_crypto.createHmac("sha512", key);
|
|
247
|
+
hmac.update(data);
|
|
248
|
+
return new Uint8Array(hmac.digest());
|
|
249
|
+
}
|
|
250
|
+
function deriveLocalGitServerEncryptionKey(masterSecret) {
|
|
251
|
+
const decoded = Buffer.from(masterSecret, "base64");
|
|
252
|
+
const rootSeedKey = new TextEncoder().encode("Agentrix EnCoder Master Seed");
|
|
253
|
+
const rootI = hmacSha512(rootSeedKey, decoded);
|
|
254
|
+
const chainCode = rootI.slice(32);
|
|
255
|
+
const childData = new Uint8Array([0, ...new TextEncoder().encode("content")]);
|
|
256
|
+
const childI = hmacSha512(chainCode, childData);
|
|
257
|
+
return childI.slice(0, 32);
|
|
258
|
+
}
|
|
259
|
+
function parseScopes(rawScopes) {
|
|
260
|
+
if (!rawScopes) return [];
|
|
261
|
+
return rawScopes.split(",").map((scope) => scope.trim()).filter(Boolean);
|
|
262
|
+
}
|
|
263
|
+
function makeFailedResult(status, error, extras = {}) {
|
|
264
|
+
return { valid: false, status, error, ...extras };
|
|
265
|
+
}
|
|
266
|
+
function validateRequiredScopes(scopes, requiredScopes) {
|
|
267
|
+
if (!requiredScopes.length) return [];
|
|
268
|
+
const actual = new Set(scopes);
|
|
269
|
+
return requiredScopes.filter((scope) => !actual.has(scope));
|
|
270
|
+
}
|
|
271
|
+
async function fetchPatSelfInfo(apiUrl, pat, timeoutMs, log) {
|
|
272
|
+
let response;
|
|
273
|
+
try {
|
|
274
|
+
response = await fetch(`${apiUrl}/personal_access_tokens/self`, {
|
|
275
|
+
headers: { Authorization: `Bearer ${pat}` },
|
|
276
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
277
|
+
});
|
|
278
|
+
} catch (err) {
|
|
279
|
+
log?.warn?.("[PAT] Failed to fetch PAT expiry:", err);
|
|
280
|
+
return void 0;
|
|
281
|
+
}
|
|
282
|
+
if (!response.ok) {
|
|
283
|
+
return void 0;
|
|
284
|
+
}
|
|
285
|
+
try {
|
|
286
|
+
const tokenInfo = await response.json();
|
|
287
|
+
return {
|
|
288
|
+
expiresAt: tokenInfo.expires_at ?? void 0,
|
|
289
|
+
scopes: Array.isArray(tokenInfo.scopes) ? tokenInfo.scopes.map((scope) => scope.trim()).filter(Boolean) : void 0
|
|
290
|
+
};
|
|
291
|
+
} catch (err) {
|
|
292
|
+
log?.warn?.("[PAT] Failed to parse PAT self response:", err);
|
|
293
|
+
return void 0;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
async function validateGitLabPatToken(apiUrl, pat, options = {}) {
|
|
297
|
+
const requiredScopes = options.requiredScopes ?? DEFAULT_GITLAB_PAT_REQUIRED_SCOPES;
|
|
298
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_PAT_VALIDATE_TIMEOUT_MS;
|
|
299
|
+
if (!pat.trim()) {
|
|
300
|
+
return { result: makeFailedResult("invalid", "Token is empty") };
|
|
301
|
+
}
|
|
302
|
+
let response;
|
|
303
|
+
try {
|
|
304
|
+
response = await fetch(`${apiUrl}/user`, {
|
|
305
|
+
headers: { Authorization: `Bearer ${pat}` },
|
|
306
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
307
|
+
});
|
|
308
|
+
} catch (err) {
|
|
309
|
+
options.log?.error?.("[PAT] GitLab API validation failed:", err);
|
|
310
|
+
return { result: makeFailedResult("network_error", `Cannot reach GitLab: ${err.message}`) };
|
|
311
|
+
}
|
|
312
|
+
if (!response.ok) {
|
|
313
|
+
if (response.status === 401 || response.status === 403) {
|
|
314
|
+
return { result: makeFailedResult("expired", `GitLab returned ${response.status}`) };
|
|
315
|
+
}
|
|
316
|
+
return { result: makeFailedResult("invalid", `GitLab returned ${response.status}`) };
|
|
317
|
+
}
|
|
318
|
+
let user;
|
|
319
|
+
try {
|
|
320
|
+
user = await response.json();
|
|
321
|
+
} catch {
|
|
322
|
+
return { result: makeFailedResult("invalid", "GitLab returned an invalid response") };
|
|
323
|
+
}
|
|
324
|
+
if (!user?.username) {
|
|
325
|
+
return { result: makeFailedResult("invalid", "GitLab response missing username") };
|
|
326
|
+
}
|
|
327
|
+
const scopesFromHeader = parseScopes(response.headers.get("x-oauth-scopes"));
|
|
328
|
+
const selfInfo = await fetchPatSelfInfo(apiUrl, pat, timeoutMs, options.log);
|
|
329
|
+
const scopesFromSelf = selfInfo?.scopes ?? [];
|
|
330
|
+
const effectiveScopes = scopesFromHeader.length > 0 ? scopesFromHeader : scopesFromSelf;
|
|
331
|
+
const expiresAt = selfInfo?.expiresAt;
|
|
332
|
+
const shouldEnforceScopes = effectiveScopes.length > 0;
|
|
333
|
+
const missingScopes = shouldEnforceScopes ? validateRequiredScopes(effectiveScopes, requiredScopes) : [];
|
|
334
|
+
if (shouldEnforceScopes && missingScopes.length > 0) {
|
|
335
|
+
return {
|
|
336
|
+
result: makeFailedResult(
|
|
337
|
+
"insufficient_scope",
|
|
338
|
+
`Token is missing required scopes: ${missingScopes.join(", ")}`,
|
|
339
|
+
{ username: user.username, scopes: effectiveScopes, missingScopes, expiresAt }
|
|
340
|
+
),
|
|
341
|
+
user
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
return {
|
|
345
|
+
result: { valid: true, status: "valid", username: user.username, scopes: effectiveScopes, expiresAt },
|
|
346
|
+
user
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
class GitServerLocalStore {
|
|
350
|
+
credentialsDir;
|
|
351
|
+
constructor(options) {
|
|
352
|
+
this.credentialsDir = options.credentialsDir;
|
|
353
|
+
}
|
|
354
|
+
ensureCredentialsDir() {
|
|
355
|
+
if (!node_fs.existsSync(this.credentialsDir)) {
|
|
356
|
+
node_fs.mkdirSync(this.credentialsDir, { recursive: true });
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
getPatFilePath(gitServerId) {
|
|
360
|
+
return node_path.join(this.credentialsDir, `${gitServerId}.pat.enc`);
|
|
361
|
+
}
|
|
362
|
+
getPatMetaFilePath(gitServerId) {
|
|
363
|
+
return node_path.join(this.credentialsDir, `${gitServerId}.pat.meta.json`);
|
|
364
|
+
}
|
|
365
|
+
getGitServerConfigFilePath(gitServerId) {
|
|
366
|
+
return node_path.join(this.credentialsDir, `${gitServerId}.git-server.json`);
|
|
367
|
+
}
|
|
368
|
+
getGitLabWebhookBridgeFilePath(gitServerId) {
|
|
369
|
+
return node_path.join(this.credentialsDir, `${gitServerId}.gitlab-webhook.enc`);
|
|
370
|
+
}
|
|
371
|
+
encryptJsonFile(filePath, value, encryptionKey) {
|
|
372
|
+
this.ensureCredentialsDir();
|
|
373
|
+
const iv = node_crypto.randomBytes(16);
|
|
374
|
+
const key = encryptionKey.slice(0, 32);
|
|
375
|
+
const cipher = node_crypto.createCipheriv(ALGORITHM, key, iv);
|
|
376
|
+
let encrypted = cipher.update(JSON.stringify(value), "utf8", "hex");
|
|
377
|
+
encrypted += cipher.final("hex");
|
|
378
|
+
const authTag = cipher.getAuthTag();
|
|
379
|
+
const payload = {
|
|
380
|
+
iv: iv.toString("hex"),
|
|
381
|
+
authTag: authTag.toString("hex"),
|
|
382
|
+
encrypted
|
|
383
|
+
};
|
|
384
|
+
node_fs.writeFileSync(filePath, JSON.stringify(payload), { mode: 384 });
|
|
385
|
+
}
|
|
386
|
+
decryptJsonFile(filePath, encryptionKey) {
|
|
387
|
+
if (!node_fs.existsSync(filePath)) return null;
|
|
388
|
+
try {
|
|
389
|
+
const raw = node_fs.readFileSync(filePath, "utf8");
|
|
390
|
+
const { iv, authTag, encrypted } = JSON.parse(raw);
|
|
391
|
+
const key = encryptionKey.slice(0, 32);
|
|
392
|
+
const decipher = node_crypto.createDecipheriv(ALGORITHM, key, Buffer.from(iv, "hex"));
|
|
393
|
+
decipher.setAuthTag(Buffer.from(authTag, "hex"));
|
|
394
|
+
let decrypted = decipher.update(encrypted, "hex", "utf8");
|
|
395
|
+
decrypted += decipher.final("utf8");
|
|
396
|
+
return JSON.parse(decrypted);
|
|
397
|
+
} catch {
|
|
398
|
+
return null;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
saveGitServerConfig(gitServerId, input) {
|
|
402
|
+
this.ensureCredentialsDir();
|
|
403
|
+
const existing = this.loadGitServerConfig(gitServerId) ?? {};
|
|
404
|
+
const next = {
|
|
405
|
+
...existing,
|
|
406
|
+
...input
|
|
407
|
+
};
|
|
408
|
+
node_fs.writeFileSync(this.getGitServerConfigFilePath(gitServerId), JSON.stringify(next, null, 2), { mode: 384 });
|
|
409
|
+
}
|
|
410
|
+
loadGitServerConfig(gitServerId) {
|
|
411
|
+
const filePath = this.getGitServerConfigFilePath(gitServerId);
|
|
412
|
+
if (!node_fs.existsSync(filePath)) return null;
|
|
413
|
+
try {
|
|
414
|
+
return JSON.parse(node_fs.readFileSync(filePath, "utf8"));
|
|
415
|
+
} catch {
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
deleteGitServerConfig(gitServerId) {
|
|
420
|
+
const configPath = this.getGitServerConfigFilePath(gitServerId);
|
|
421
|
+
if (node_fs.existsSync(configPath)) {
|
|
422
|
+
node_fs.unlinkSync(configPath);
|
|
423
|
+
}
|
|
424
|
+
const bridgePath = this.getGitLabWebhookBridgeFilePath(gitServerId);
|
|
425
|
+
if (node_fs.existsSync(bridgePath)) {
|
|
426
|
+
node_fs.unlinkSync(bridgePath);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
listGitServerIds() {
|
|
430
|
+
this.ensureCredentialsDir();
|
|
431
|
+
const ids = /* @__PURE__ */ new Set();
|
|
432
|
+
for (const file of node_fs.readdirSync(this.credentialsDir)) {
|
|
433
|
+
if (file.endsWith(".git-server.json")) {
|
|
434
|
+
ids.add(file.slice(0, -".git-server.json".length));
|
|
435
|
+
} else if (file.endsWith(".pat.enc")) {
|
|
436
|
+
ids.add(file.slice(0, -".pat.enc".length));
|
|
437
|
+
} else if (file.endsWith(".gitlab-webhook.enc")) {
|
|
438
|
+
ids.add(file.slice(0, -".gitlab-webhook.enc".length));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return [...ids].sort();
|
|
442
|
+
}
|
|
443
|
+
listPats() {
|
|
444
|
+
this.ensureCredentialsDir();
|
|
445
|
+
const files = node_fs.readdirSync(this.credentialsDir).filter((file) => file.endsWith(".pat.enc"));
|
|
446
|
+
return files.map((file) => ({
|
|
447
|
+
gitServerId: file.replace(".pat.enc", ""),
|
|
448
|
+
exists: true
|
|
449
|
+
}));
|
|
450
|
+
}
|
|
451
|
+
loadGitLabWebhookBridgeSecrets(gitServerId, encryptionKey) {
|
|
452
|
+
return this.decryptJsonFile(
|
|
453
|
+
this.getGitLabWebhookBridgeFilePath(gitServerId),
|
|
454
|
+
encryptionKey
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
saveGitLabWebhookBridgeSecrets(gitServerId, secrets, encryptionKey) {
|
|
458
|
+
this.encryptJsonFile(this.getGitLabWebhookBridgeFilePath(gitServerId), secrets, encryptionKey);
|
|
459
|
+
}
|
|
460
|
+
ensureGitLabWebhookSecret(gitServerId, encryptionKey) {
|
|
461
|
+
const current = this.loadGitLabWebhookBridgeSecrets(gitServerId, encryptionKey);
|
|
462
|
+
if (current?.webhookSecret) {
|
|
463
|
+
return current.webhookSecret;
|
|
464
|
+
}
|
|
465
|
+
const webhookSecret = node_crypto.randomBytes(32).toString("hex");
|
|
466
|
+
this.saveGitLabWebhookBridgeSecrets(gitServerId, {
|
|
467
|
+
...current ?? {},
|
|
468
|
+
webhookSecret,
|
|
469
|
+
projectTriggerTokens: current?.projectTriggerTokens ?? {}
|
|
470
|
+
}, encryptionKey);
|
|
471
|
+
return webhookSecret;
|
|
472
|
+
}
|
|
473
|
+
loadPatMeta(gitServerId) {
|
|
474
|
+
const filePath = this.getPatMetaFilePath(gitServerId);
|
|
475
|
+
if (!node_fs.existsSync(filePath)) return null;
|
|
476
|
+
try {
|
|
477
|
+
return JSON.parse(node_fs.readFileSync(filePath, "utf8"));
|
|
478
|
+
} catch {
|
|
479
|
+
return null;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
savePatMeta(gitServerId, meta) {
|
|
483
|
+
this.ensureCredentialsDir();
|
|
484
|
+
node_fs.writeFileSync(this.getPatMetaFilePath(gitServerId), JSON.stringify(meta, null, 2), { mode: 384 });
|
|
485
|
+
}
|
|
486
|
+
savePat(gitServerId, pat, encryptionKey) {
|
|
487
|
+
this.ensureCredentialsDir();
|
|
488
|
+
const iv = node_crypto.randomBytes(16);
|
|
489
|
+
const key = encryptionKey.slice(0, 32);
|
|
490
|
+
const cipher = node_crypto.createCipheriv(ALGORITHM, key, iv);
|
|
491
|
+
let encrypted = cipher.update(pat, "utf8", "hex");
|
|
492
|
+
encrypted += cipher.final("hex");
|
|
493
|
+
const authTag = cipher.getAuthTag();
|
|
494
|
+
const payload = {
|
|
495
|
+
iv: iv.toString("hex"),
|
|
496
|
+
authTag: authTag.toString("hex"),
|
|
497
|
+
encrypted
|
|
498
|
+
};
|
|
499
|
+
node_fs.writeFileSync(this.getPatFilePath(gitServerId), JSON.stringify(payload), { mode: 384 });
|
|
500
|
+
}
|
|
501
|
+
loadPat(gitServerId, encryptionKey) {
|
|
502
|
+
const filePath = this.getPatFilePath(gitServerId);
|
|
503
|
+
if (!node_fs.existsSync(filePath)) return null;
|
|
504
|
+
try {
|
|
505
|
+
const raw = node_fs.readFileSync(filePath, "utf8");
|
|
506
|
+
const { iv, authTag, encrypted } = JSON.parse(raw);
|
|
507
|
+
const key = encryptionKey.slice(0, 32);
|
|
508
|
+
const decipher = node_crypto.createDecipheriv(ALGORITHM, key, Buffer.from(iv, "hex"));
|
|
509
|
+
decipher.setAuthTag(Buffer.from(authTag, "hex"));
|
|
510
|
+
let decrypted = decipher.update(encrypted, "hex", "utf8");
|
|
511
|
+
decrypted += decipher.final("utf8");
|
|
512
|
+
return decrypted;
|
|
513
|
+
} catch {
|
|
514
|
+
return null;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
hasPat(gitServerId) {
|
|
518
|
+
return node_fs.existsSync(this.getPatFilePath(gitServerId));
|
|
519
|
+
}
|
|
520
|
+
deletePat(gitServerId) {
|
|
521
|
+
const filePath = this.getPatFilePath(gitServerId);
|
|
522
|
+
if (node_fs.existsSync(filePath)) {
|
|
523
|
+
node_fs.unlinkSync(filePath);
|
|
524
|
+
}
|
|
525
|
+
const metaPath = this.getPatMetaFilePath(gitServerId);
|
|
526
|
+
if (node_fs.existsSync(metaPath)) {
|
|
527
|
+
node_fs.unlinkSync(metaPath);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
237
532
|
exports.AgentConfigValidationError = errors.AgentConfigValidationError;
|
|
238
533
|
exports.AgentError = errors.AgentError;
|
|
239
534
|
exports.AgentLoadError = errors.AgentLoadError;
|
|
@@ -245,10 +540,16 @@ exports.FrameworkNotSupportedError = errors.FrameworkNotSupportedError;
|
|
|
245
540
|
exports.MissingAgentFileError = errors.MissingAgentFileError;
|
|
246
541
|
exports.getAgentContext = errors.getAgentContext;
|
|
247
542
|
exports.setAgentContext = errors.setAgentContext;
|
|
543
|
+
exports.buildGitLabWebhookEndpointPath = gitlabWebhook.buildGitLabWebhookEndpointPath;
|
|
544
|
+
exports.buildGitLabWebhookUrl = gitlabWebhook.buildGitLabWebhookUrl;
|
|
545
|
+
exports.DEFAULT_GITLAB_PAT_REQUIRED_SCOPES = DEFAULT_GITLAB_PAT_REQUIRED_SCOPES;
|
|
546
|
+
exports.GitServerLocalStore = GitServerLocalStore;
|
|
248
547
|
exports.assertAgentExists = assertAgentExists;
|
|
249
548
|
exports.assertFileExists = assertFileExists;
|
|
549
|
+
exports.deriveLocalGitServerEncryptionKey = deriveLocalGitServerEncryptionKey;
|
|
250
550
|
exports.discoverPlugins = discoverPlugins;
|
|
251
551
|
exports.loadAgentConfig = loadAgentConfig;
|
|
252
552
|
exports.replacePromptPlaceholders = replacePromptPlaceholders;
|
|
253
553
|
exports.validateAgentDirectory = validateAgentDirectory;
|
|
254
554
|
exports.validateFrameworkDirectory = validateFrameworkDirectory;
|
|
555
|
+
exports.validateGitLabPatToken = validateGitLabPatToken;
|
package/dist/node.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { dE as LoadAgentOptions, dC as AgentConfig, dD as ValidationResult, dz as FrameworkType } from './errors-B5CcMP8s.cjs';
|
|
2
|
+
export { dM as AgentConfigValidationError, dv as AgentContext, dK as AgentError, dO as AgentLoadError, dA as AgentMetadata, dI as AgentMetadataSchema, dL as AgentNotFoundError, dw as AgentrixContext, dB as ClaudeAgentConfig, dJ as ClaudeConfigSchema, dH as FRAMEWORK_TYPES, dN as FrameworkNotSupportedError, dG as HookFactory, dP as MissingAgentFileError, dF as RepositoryInitHookInput, dy as getAgentContext, dx as setAgentContext } from './errors-B5CcMP8s.cjs';
|
|
3
|
+
export { buildGitLabWebhookEndpointPath, buildGitLabWebhookUrl } from './gitlabWebhook.cjs';
|
|
3
4
|
import '@anthropic-ai/claude-agent-sdk';
|
|
4
5
|
import 'zod';
|
|
5
6
|
|
|
@@ -49,4 +50,77 @@ declare function assertAgentExists(agentDir: string, agentId: string): void;
|
|
|
49
50
|
*/
|
|
50
51
|
declare function discoverPlugins(pluginsDir: string): string[];
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
declare const DEFAULT_GITLAB_PAT_REQUIRED_SCOPES: readonly ["api", "read_repository", "write_repository"];
|
|
54
|
+
interface GitServerLocalConfig {
|
|
55
|
+
baseUrl?: string;
|
|
56
|
+
apiUrl?: string;
|
|
57
|
+
}
|
|
58
|
+
interface GitLabWebhookBridgeSecrets {
|
|
59
|
+
webhookSecret?: string;
|
|
60
|
+
projectTriggerTokens?: Record<string, string>;
|
|
61
|
+
}
|
|
62
|
+
interface PatMeta {
|
|
63
|
+
username: string;
|
|
64
|
+
email: string;
|
|
65
|
+
lastValidatedAt?: string;
|
|
66
|
+
expiresAt?: string | null;
|
|
67
|
+
}
|
|
68
|
+
interface PatValidationResult {
|
|
69
|
+
valid: boolean;
|
|
70
|
+
status: 'valid' | 'invalid' | 'expired' | 'insufficient_scope' | 'network_error';
|
|
71
|
+
username?: string;
|
|
72
|
+
scopes?: string[];
|
|
73
|
+
missingScopes?: string[];
|
|
74
|
+
expiresAt?: string | null;
|
|
75
|
+
error?: string;
|
|
76
|
+
}
|
|
77
|
+
interface GitServerLocalStoreOptions {
|
|
78
|
+
credentialsDir: string;
|
|
79
|
+
}
|
|
80
|
+
interface GitLabPatValidationOptions {
|
|
81
|
+
requiredScopes?: readonly string[];
|
|
82
|
+
timeoutMs?: number;
|
|
83
|
+
log?: {
|
|
84
|
+
warn?: (message: string, error?: unknown) => void;
|
|
85
|
+
error?: (message: string, error?: unknown) => void;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
declare function deriveLocalGitServerEncryptionKey(masterSecret: string): Uint8Array;
|
|
89
|
+
declare function validateGitLabPatToken(apiUrl: string, pat: string, options?: GitLabPatValidationOptions): Promise<{
|
|
90
|
+
result: PatValidationResult;
|
|
91
|
+
user?: {
|
|
92
|
+
username: string;
|
|
93
|
+
email?: string;
|
|
94
|
+
};
|
|
95
|
+
}>;
|
|
96
|
+
declare class GitServerLocalStore {
|
|
97
|
+
private readonly credentialsDir;
|
|
98
|
+
constructor(options: GitServerLocalStoreOptions);
|
|
99
|
+
private ensureCredentialsDir;
|
|
100
|
+
private getPatFilePath;
|
|
101
|
+
private getPatMetaFilePath;
|
|
102
|
+
private getGitServerConfigFilePath;
|
|
103
|
+
private getGitLabWebhookBridgeFilePath;
|
|
104
|
+
private encryptJsonFile;
|
|
105
|
+
private decryptJsonFile;
|
|
106
|
+
saveGitServerConfig(gitServerId: string, input: GitServerLocalConfig): void;
|
|
107
|
+
loadGitServerConfig(gitServerId: string): GitServerLocalConfig | null;
|
|
108
|
+
deleteGitServerConfig(gitServerId: string): void;
|
|
109
|
+
listGitServerIds(): string[];
|
|
110
|
+
listPats(): Array<{
|
|
111
|
+
gitServerId: string;
|
|
112
|
+
exists: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
loadGitLabWebhookBridgeSecrets(gitServerId: string, encryptionKey: Uint8Array): GitLabWebhookBridgeSecrets | null;
|
|
115
|
+
saveGitLabWebhookBridgeSecrets(gitServerId: string, secrets: GitLabWebhookBridgeSecrets, encryptionKey: Uint8Array): void;
|
|
116
|
+
ensureGitLabWebhookSecret(gitServerId: string, encryptionKey: Uint8Array): string;
|
|
117
|
+
loadPatMeta(gitServerId: string): PatMeta | null;
|
|
118
|
+
savePatMeta(gitServerId: string, meta: PatMeta): void;
|
|
119
|
+
savePat(gitServerId: string, pat: string, encryptionKey: Uint8Array): void;
|
|
120
|
+
loadPat(gitServerId: string, encryptionKey: Uint8Array): string | null;
|
|
121
|
+
hasPat(gitServerId: string): boolean;
|
|
122
|
+
deletePat(gitServerId: string): void;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { AgentConfig, DEFAULT_GITLAB_PAT_REQUIRED_SCOPES, FrameworkType, GitServerLocalStore, LoadAgentOptions, ValidationResult, assertAgentExists, assertFileExists, deriveLocalGitServerEncryptionKey, discoverPlugins, loadAgentConfig, replacePromptPlaceholders, validateAgentDirectory, validateFrameworkDirectory, validateGitLabPatToken };
|
|
126
|
+
export type { GitLabPatValidationOptions, GitLabWebhookBridgeSecrets, GitServerLocalConfig, GitServerLocalStoreOptions, PatMeta, PatValidationResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentrix/shared",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.1",
|
|
4
4
|
"description": "Shared types and schemas for Agentrix projects",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
"./node": {
|
|
13
13
|
"types": "./dist/node.d.cts",
|
|
14
14
|
"default": "./dist/node.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./gitlab-webhook": {
|
|
17
|
+
"types": "./dist/gitlabWebhook.d.cts",
|
|
18
|
+
"import": "./dist/gitlabWebhook.mjs",
|
|
19
|
+
"default": "./dist/gitlabWebhook.cjs"
|
|
15
20
|
}
|
|
16
21
|
},
|
|
17
22
|
"scripts": {
|