cyrus-core 0.2.32 → 0.2.34-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,19 @@ export interface Workspace {
28
28
  isGitWorktree: boolean;
29
29
  historyPath?: string;
30
30
  }
31
+ /**
32
+ * Lightweight repository context carried by each session.
33
+ * Identifies which repository (and branches) the session operates on.
34
+ * 0 entries = chatbot/no-repo session, 1 = single-repo, N = multi-repo.
35
+ */
36
+ export interface RepositoryContext {
37
+ /** The repository config ID (matches RepositoryConfig.id) */
38
+ repositoryId: string;
39
+ /** The git branch the session works on (e.g., derived from issue identifier) */
40
+ branchName?: string;
41
+ /** The base branch for PRs (e.g., "main" or a Graphite parent branch) */
42
+ baseBranchName?: string;
43
+ }
31
44
  export interface CyrusAgentSession {
32
45
  /** Unique session identifier (was linearAgentActivitySessionId in v2.0) */
33
46
  id: string;
@@ -47,6 +60,8 @@ export interface CyrusAgentSession {
47
60
  issueId?: string;
48
61
  /** Minimal issue data - optional for standalone sessions */
49
62
  issue?: IssueMinimal;
63
+ /** Repository contexts for this session (always array, never undefined) */
64
+ repositories: RepositoryContext[];
50
65
  workspace: Workspace;
51
66
  claudeSessionId?: string;
52
67
  geminiSessionId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CyrusAgentSession.d.ts","sourceRoot":"","sources":["../src/CyrusAgentSession.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,wBAAwB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACX,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,YAAY;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED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BAC/B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;aAChC,CAAC,CAAC;YACH,kFAAkF;YAClF,cAAc,CAAC,EAAE;gBAChB,kCAAkC;gBAClC,SAAS,EAAE,MAAM,CAAC;gBAClB,mEAAmE;gBACnE,WAAW,EAAE,OAAO,CAAC;gBACrB,2CAA2C;gBAC3C,QAAQ,EAAE,KAAK,CAAC;oBACf,SAAS,EAAE,MAAM,CAAC;oBAClB,IAAI,EAAE,OAAO,CAAC;oBACd,MAAM,EAAE,MAAM,CAAC;oBACf,SAAS,EAAE,MAAM,CAAC;iBAClB,CAAC,CAAC;aACH,CAAC;SACF,CAAC;KACF,CAAC;CACF;AAED,MAAM,WAAW,sBAAsB;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACV,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,wBAAwB,CAAC;KACpC,CAAC;CACF"}
@@ -1,13 +1,25 @@
1
1
  import type { CyrusAgentSession, CyrusAgentSessionEntry } from "./CyrusAgentSession.js";
2
2
  import { type ILogger } from "./logging/index.js";
3
3
  /** Current persistence format version */
4
- export declare const PERSISTENCE_VERSION = "3.0";
4
+ export declare const PERSISTENCE_VERSION = "4.0";
5
5
  export type SerializedCyrusAgentSession = CyrusAgentSession;
6
6
  export type SerializedCyrusAgentSessionEntry = CyrusAgentSessionEntry;
7
7
  /**
8
8
  * Serializable EdgeWorker state for persistence
9
+ *
10
+ * v4.0: Flat session format - sessions keyed directly by sessionId (no repo nesting)
11
+ * v3.0: Nested format - sessions keyed by [repoId][sessionId]
9
12
  */
10
13
  export interface SerializableEdgeWorkerState {
14
+ agentSessions?: Record<string, SerializedCyrusAgentSession>;
15
+ agentSessionEntries?: Record<string, SerializedCyrusAgentSessionEntry[]>;
16
+ childToParentAgentSession?: Record<string, string>;
17
+ issueRepositoryCache?: Record<string, string[]>;
18
+ }
19
+ /**
20
+ * v3.0 nested state format (for migration purposes)
21
+ */
22
+ export interface V3SerializableEdgeWorkerState {
11
23
  agentSessions?: Record<string, Record<string, SerializedCyrusAgentSession>>;
12
24
  agentSessionEntries?: Record<string, Record<string, SerializedCyrusAgentSessionEntry[]>>;
13
25
  childToParentAgentSession?: Record<string, string>;
@@ -48,6 +60,14 @@ export declare class PersistenceManager {
48
60
  * - issue becomes optional
49
61
  */
50
62
  private migrateV2ToV3;
63
+ /**
64
+ * Migrate v3.0 state format to v4.0 format
65
+ *
66
+ * Changes:
67
+ * - Flatten nested {[repoId]: {[sessionId]: session}} to flat {[sessionId]: session}
68
+ * - Flatten nested entries similarly
69
+ */
70
+ private migrateV3ToV4;
51
71
  /**
52
72
  * Migrate a single session from v2.0 to v3.0 format
53
73
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PersistenceManager.d.ts","sourceRoot":"","sources":["../src/PersistenceManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACX,iBAAiB,EACjB,sBAAsB,EAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEhE,yCAAyC;AACzC,eAAO,MAAM,mBAAmB,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AEG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;CAGxC"}
@@ -4,7 +4,7 @@ import { homedir } from "node:os";
4
4
  import { join } from "node:path";
5
5
  import { createLogger } from "./logging/index.js";
6
6
  /** Current persistence format version */
7
- export const PERSISTENCE_VERSION = "3.0";
7
+ export const PERSISTENCE_VERSION = "4.0";
8
8
  /**
9
9
  * Manages persistence of critical mappings to survive restarts
10
10
  */
@@ -65,9 +65,16 @@ export class PersistenceManager {
65
65
  }
66
66
  // Handle version migration
67
67
  if (stateData.version === "2.0") {
68
- this.logger.info("Migrating state from v2.0 to v3.0");
69
- const migratedState = this.migrateV2ToV3(stateData.state);
70
- // Save the migrated state
68
+ this.logger.info("Migrating state from v2.0 to v3.0 to v4.0");
69
+ const v3State = this.migrateV2ToV3(stateData.state);
70
+ const migratedState = this.migrateV3ToV4(v3State);
71
+ await this.saveEdgeWorkerState(migratedState);
72
+ this.logger.info(`Migration complete, saved as v${PERSISTENCE_VERSION}`);
73
+ return migratedState;
74
+ }
75
+ if (stateData.version === "3.0") {
76
+ this.logger.info("Migrating state from v3.0 to v4.0");
77
+ const migratedState = this.migrateV3ToV4(stateData.state);
71
78
  await this.saveEdgeWorkerState(migratedState);
72
79
  this.logger.info(`Migration complete, saved as v${PERSISTENCE_VERSION}`);
73
80
  return migratedState;
@@ -116,6 +123,56 @@ export class PersistenceManager {
116
123
  // The entries themselves don't need modification
117
124
  return migratedState;
118
125
  }
126
+ /**
127
+ * Migrate v3.0 state format to v4.0 format
128
+ *
129
+ * Changes:
130
+ * - Flatten nested {[repoId]: {[sessionId]: session}} to flat {[sessionId]: session}
131
+ * - Flatten nested entries similarly
132
+ */
133
+ migrateV3ToV4(v3State) {
134
+ const flatSessions = {};
135
+ const flatEntries = {};
136
+ // Flatten sessions: merge all repo-keyed sessions into a single flat map
137
+ // Preserve the repoId key as a RepositoryContext so migrated sessions
138
+ // know which repository they belong to (instead of defaulting to [])
139
+ if (v3State.agentSessions) {
140
+ for (const [repoId, repoSessions] of Object.entries(v3State.agentSessions)) {
141
+ for (const [sessionId, session] of Object.entries(repoSessions)) {
142
+ if (!session.repositories?.length) {
143
+ session.repositories = [
144
+ {
145
+ repositoryId: repoId,
146
+ },
147
+ ];
148
+ }
149
+ flatSessions[sessionId] = session;
150
+ }
151
+ }
152
+ }
153
+ // Flatten entries similarly
154
+ if (v3State.agentSessionEntries) {
155
+ for (const repoEntries of Object.values(v3State.agentSessionEntries)) {
156
+ for (const [sessionId, entries] of Object.entries(repoEntries)) {
157
+ flatEntries[sessionId] = entries;
158
+ }
159
+ }
160
+ }
161
+ // Migrate issueRepositoryCache from old Record<string, string> to Record<string, string[]>
162
+ let migratedCache;
163
+ if (v3State.issueRepositoryCache) {
164
+ migratedCache = {};
165
+ for (const [issueId, repoId] of Object.entries(v3State.issueRepositoryCache)) {
166
+ migratedCache[issueId] = [repoId];
167
+ }
168
+ }
169
+ return {
170
+ agentSessions: flatSessions,
171
+ agentSessionEntries: flatEntries,
172
+ childToParentAgentSession: v3State.childToParentAgentSession,
173
+ issueRepositoryCache: migratedCache,
174
+ };
175
+ }
119
176
  /**
120
177
  * Migrate a single session from v2.0 to v3.0 format
121
178
  */
@@ -147,6 +204,8 @@ export class PersistenceManager {
147
204
  issueId: v2Session.issueId,
148
205
  // Now optional
149
206
  issue: v2Session.issue,
207
+ // New field: empty repositories for migrated sessions
208
+ repositories: [],
150
209
  };
151
210
  }
152
211
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"PersistenceManager.js","sourceRoot":"","sources":["../src/PersistenceManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAA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AO,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAI,GAAW;QAC/B,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAI,KAAU;QAC9B,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CACD"}
@@ -41,6 +41,16 @@ export declare const UserAccessControlConfigSchema: z.ZodObject<{
41
41
  }>>;
42
42
  blockMessage: z.ZodOptional<z.ZodString>;
43
43
  }, z.core.$strip>;
44
+ /**
45
+ * Configuration for a Linear workspace's credentials.
46
+ * Keyed by workspace ID in EdgeConfig.linearWorkspaces.
47
+ */
48
+ export declare const LinearWorkspaceConfigSchema: z.ZodObject<{
49
+ linearToken: z.ZodString;
50
+ linearRefreshToken: z.ZodOptional<z.ZodString>;
51
+ linearWorkspaceSlug: z.ZodOptional<z.ZodString>;
52
+ linearWorkspaceName: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strip>;
44
54
  /**
45
55
  * Configuration for a single repository/workspace pair
46
56
  */
@@ -50,13 +60,13 @@ export declare const RepositoryConfigSchema: z.ZodObject<{
50
60
  repositoryPath: z.ZodString;
51
61
  baseBranch: z.ZodString;
52
62
  githubUrl: z.ZodOptional<z.ZodString>;
53
- linearWorkspaceId: z.ZodString;
54
- linearWorkspaceName: z.ZodOptional<z.ZodString>;
55
- linearToken: z.ZodString;
56
- linearRefreshToken: z.ZodOptional<z.ZodString>;
63
+ linearWorkspaceId: z.ZodOptional<z.ZodString>;
57
64
  teamKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
65
  routingLabels: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
66
  projectKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
+ linearToken: z.ZodOptional<z.ZodString>;
68
+ linearRefreshToken: z.ZodOptional<z.ZodString>;
69
+ linearWorkspaceName: z.ZodOptional<z.ZodString>;
60
70
  workspaceBaseDir: z.ZodString;
61
71
  isActive: z.ZodOptional<z.ZodBoolean>;
62
72
  promptTemplatePath: z.ZodOptional<z.ZodString>;
@@ -128,13 +138,13 @@ export declare const EdgeConfigSchema: z.ZodObject<{
128
138
  repositoryPath: z.ZodString;
129
139
  baseBranch: z.ZodString;
130
140
  githubUrl: z.ZodOptional<z.ZodString>;
131
- linearWorkspaceId: z.ZodString;
132
- linearWorkspaceName: z.ZodOptional<z.ZodString>;
133
- linearToken: z.ZodString;
134
- linearRefreshToken: z.ZodOptional<z.ZodString>;
141
+ linearWorkspaceId: z.ZodOptional<z.ZodString>;
135
142
  teamKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
136
143
  routingLabels: z.ZodOptional<z.ZodArray<z.ZodString>>;
137
144
  projectKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ linearToken: z.ZodOptional<z.ZodString>;
146
+ linearRefreshToken: z.ZodOptional<z.ZodString>;
147
+ linearWorkspaceName: z.ZodOptional<z.ZodString>;
138
148
  workspaceBaseDir: z.ZodString;
139
149
  isActive: z.ZodOptional<z.ZodBoolean>;
140
150
  promptTemplatePath: z.ZodOptional<z.ZodString>;
@@ -192,9 +202,15 @@ export declare const EdgeConfigSchema: z.ZodObject<{
192
202
  blockMessage: z.ZodOptional<z.ZodString>;
193
203
  }, z.core.$strip>>;
194
204
  }, z.core.$strip>>;
205
+ linearWorkspaces: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
206
+ linearToken: z.ZodString;
207
+ linearRefreshToken: z.ZodOptional<z.ZodString>;
208
+ linearWorkspaceSlug: z.ZodOptional<z.ZodString>;
209
+ linearWorkspaceName: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strip>>>;
211
+ linearWorkspaceSlug: z.ZodOptional<z.ZodString>;
195
212
  ngrokAuthToken: z.ZodOptional<z.ZodString>;
196
213
  stripeCustomerId: z.ZodOptional<z.ZodString>;
197
- linearWorkspaceSlug: z.ZodOptional<z.ZodString>;
198
214
  claudeDefaultModel: z.ZodOptional<z.ZodString>;
199
215
  claudeDefaultFallbackModel: z.ZodOptional<z.ZodString>;
200
216
  geminiDefaultModel: z.ZodOptional<z.ZodString>;
@@ -261,13 +277,13 @@ export declare const RepositoryConfigPayloadSchema: z.ZodObject<{
261
277
  repositoryPath: z.ZodString;
262
278
  baseBranch: z.ZodString;
263
279
  githubUrl: z.ZodOptional<z.ZodString>;
264
- linearWorkspaceId: z.ZodString;
265
- linearWorkspaceName: z.ZodOptional<z.ZodString>;
266
- linearToken: z.ZodString;
267
- linearRefreshToken: z.ZodOptional<z.ZodString>;
280
+ linearWorkspaceId: z.ZodOptional<z.ZodString>;
268
281
  teamKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
269
282
  routingLabels: z.ZodOptional<z.ZodArray<z.ZodString>>;
270
283
  projectKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
284
+ linearToken: z.ZodOptional<z.ZodString>;
285
+ linearRefreshToken: z.ZodOptional<z.ZodString>;
286
+ linearWorkspaceName: z.ZodOptional<z.ZodString>;
271
287
  isActive: z.ZodOptional<z.ZodBoolean>;
272
288
  promptTemplatePath: z.ZodOptional<z.ZodString>;
273
289
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -330,9 +346,15 @@ export declare const RepositoryConfigPayloadSchema: z.ZodObject<{
330
346
  * Uses RepositoryConfigPayloadSchema which has optional workspaceBaseDir.
331
347
  */
332
348
  export declare const EdgeConfigPayloadSchema: z.ZodObject<{
349
+ linearWorkspaces: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
350
+ linearToken: z.ZodString;
351
+ linearRefreshToken: z.ZodOptional<z.ZodString>;
352
+ linearWorkspaceSlug: z.ZodOptional<z.ZodString>;
353
+ linearWorkspaceName: z.ZodOptional<z.ZodString>;
354
+ }, z.core.$strip>>>;
355
+ linearWorkspaceSlug: z.ZodOptional<z.ZodString>;
333
356
  ngrokAuthToken: z.ZodOptional<z.ZodString>;
334
357
  stripeCustomerId: z.ZodOptional<z.ZodString>;
335
- linearWorkspaceSlug: z.ZodOptional<z.ZodString>;
336
358
  claudeDefaultModel: z.ZodOptional<z.ZodString>;
337
359
  claudeDefaultFallbackModel: z.ZodOptional<z.ZodString>;
338
360
  geminiDefaultModel: z.ZodOptional<z.ZodString>;
@@ -394,13 +416,13 @@ export declare const EdgeConfigPayloadSchema: z.ZodObject<{
394
416
  repositoryPath: z.ZodString;
395
417
  baseBranch: z.ZodString;
396
418
  githubUrl: z.ZodOptional<z.ZodString>;
397
- linearWorkspaceId: z.ZodString;
398
- linearWorkspaceName: z.ZodOptional<z.ZodString>;
399
- linearToken: z.ZodString;
400
- linearRefreshToken: z.ZodOptional<z.ZodString>;
419
+ linearWorkspaceId: z.ZodOptional<z.ZodString>;
401
420
  teamKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
402
421
  routingLabels: z.ZodOptional<z.ZodArray<z.ZodString>>;
403
422
  projectKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
423
+ linearToken: z.ZodOptional<z.ZodString>;
424
+ linearRefreshToken: z.ZodOptional<z.ZodString>;
425
+ linearWorkspaceName: z.ZodOptional<z.ZodString>;
404
426
  isActive: z.ZodOptional<z.ZodBoolean>;
405
427
  promptTemplatePath: z.ZodOptional<z.ZodString>;
406
428
  allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -459,10 +481,29 @@ export declare const EdgeConfigPayloadSchema: z.ZodObject<{
459
481
  workspaceBaseDir: z.ZodOptional<z.ZodString>;
460
482
  }, z.core.$strip>>;
461
483
  }, z.core.$strip>;
484
+ /**
485
+ * Migrate an EdgeConfig from the legacy per-repo token format to the
486
+ * workspace-keyed format.
487
+ *
488
+ * Old format: each repository has linearToken and linearRefreshToken.
489
+ * New format: linearWorkspaces at EdgeConfig level keyed by workspace ID,
490
+ * repositories no longer carry tokens.
491
+ *
492
+ * This function is idempotent — if linearWorkspaces already exists, it
493
+ * returns the config unchanged.
494
+ */
495
+ export declare function migrateEdgeConfig(raw: Record<string, unknown>): Record<string, unknown>;
462
496
  export type UserIdentifier = z.infer<typeof UserIdentifierSchema>;
463
497
  export type UserAccessControlConfig = z.infer<typeof UserAccessControlConfigSchema>;
498
+ export type LinearWorkspaceConfig = z.infer<typeof LinearWorkspaceConfigSchema>;
464
499
  export type RepositoryConfig = z.infer<typeof RepositoryConfigSchema>;
465
500
  export type EdgeConfig = z.infer<typeof EdgeConfigSchema>;
466
501
  export type RepositoryConfigPayload = z.infer<typeof RepositoryConfigPayloadSchema>;
467
502
  export type EdgeConfigPayload = z.infer<typeof EdgeConfigPayloadSchema>;
503
+ /**
504
+ * Assert that a repository has a Linear workspace ID and return it.
505
+ * Use this in code paths that are only reached for Linear-linked repositories
506
+ * (e.g. webhook handlers routed via workspace ID).
507
+ */
508
+ export declare function requireLinearWorkspaceId(repo: RepositoryConfig): string;
468
509
  //# sourceMappingURL=config-schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-schemas.d.ts","sourceRoot":"","sources":["../src/config-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;EAAkD,CAAC;AAChF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;mBAI/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;iBA4BxC,CAAC;AA0EH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCjC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;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AAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,6BAA6B,CACpC,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAOvE"}
@@ -110,6 +110,18 @@ const PromptDefaultsSchema = z.object({
110
110
  orchestrator: PromptTypeDefaultsSchema.optional(),
111
111
  "graphite-orchestrator": PromptTypeDefaultsSchema.optional(),
112
112
  });
113
+ /**
114
+ * Configuration for a Linear workspace's credentials.
115
+ * Keyed by workspace ID in EdgeConfig.linearWorkspaces.
116
+ */
117
+ export const LinearWorkspaceConfigSchema = z.object({
118
+ linearToken: z.string(),
119
+ linearRefreshToken: z.string().optional(),
120
+ /** Linear workspace URL slug (e.g., "ceedar" from "https://linear.app/ceedar/...") */
121
+ linearWorkspaceSlug: z.string().optional(),
122
+ /** Human-readable workspace name (e.g., "Ceedar") */
123
+ linearWorkspaceName: z.string().optional(),
124
+ });
113
125
  /**
114
126
  * Configuration for a single repository/workspace pair
115
127
  */
@@ -121,14 +133,17 @@ export const RepositoryConfigSchema = z.object({
121
133
  repositoryPath: z.string(),
122
134
  baseBranch: z.string(),
123
135
  githubUrl: z.string().optional(),
124
- // Linear configuration
125
- linearWorkspaceId: z.string(),
126
- linearWorkspaceName: z.string().optional(),
127
- linearToken: z.string(),
128
- linearRefreshToken: z.string().optional(),
136
+ // Linear configuration (optional — repos may operate without Linear, e.g. via Slack or GitHub)
137
+ linearWorkspaceId: z.string().optional(),
129
138
  teamKeys: z.array(z.string()).optional(),
130
139
  routingLabels: z.array(z.string()).optional(),
131
140
  projectKeys: z.array(z.string()).optional(),
141
+ /** @deprecated Use EdgeConfig.linearWorkspaces[workspaceId].linearToken */
142
+ linearToken: z.string().optional(),
143
+ /** @deprecated Use EdgeConfig.linearWorkspaces[workspaceId].linearRefreshToken */
144
+ linearRefreshToken: z.string().optional(),
145
+ /** @deprecated Use EdgeConfig.linearWorkspaces[workspaceId].linearWorkspaceName */
146
+ linearWorkspaceName: z.string().optional(),
132
147
  // Workspace configuration
133
148
  workspaceBaseDir: z.string(),
134
149
  // Optional settings
@@ -155,12 +170,19 @@ export const RepositoryConfigSchema = z.object({
155
170
  export const EdgeConfigSchema = z.object({
156
171
  /** Array of repository configurations */
157
172
  repositories: z.array(RepositoryConfigSchema),
173
+ /**
174
+ * Linear workspace credentials keyed by workspace ID.
175
+ * Centralizes tokens that were previously duplicated per-repository.
176
+ */
177
+ linearWorkspaces: z
178
+ .record(z.string(), LinearWorkspaceConfigSchema)
179
+ .optional(),
180
+ /** @deprecated Migrated into linearWorkspaces entries. */
181
+ linearWorkspaceSlug: z.string().optional(),
158
182
  /** Ngrok auth token for tunnel creation */
159
183
  ngrokAuthToken: z.string().optional(),
160
184
  /** Stripe customer ID for billing */
161
185
  stripeCustomerId: z.string().optional(),
162
- /** Linear workspace URL slug (e.g., "ceedar" from "https://linear.app/ceedar/...") */
163
- linearWorkspaceSlug: z.string().optional(),
164
186
  /** Default Claude model to use across all repositories (e.g., "opus", "sonnet", "haiku") */
165
187
  claudeDefaultModel: z.string().optional(),
166
188
  /** Default Claude fallback model if primary Claude model is unavailable */
@@ -219,4 +241,71 @@ export const RepositoryConfigPayloadSchema = RepositoryConfigSchema.extend({
219
241
  export const EdgeConfigPayloadSchema = EdgeConfigSchema.extend({
220
242
  repositories: z.array(RepositoryConfigPayloadSchema),
221
243
  });
244
+ /**
245
+ * Migrate an EdgeConfig from the legacy per-repo token format to the
246
+ * workspace-keyed format.
247
+ *
248
+ * Old format: each repository has linearToken and linearRefreshToken.
249
+ * New format: linearWorkspaces at EdgeConfig level keyed by workspace ID,
250
+ * repositories no longer carry tokens.
251
+ *
252
+ * This function is idempotent — if linearWorkspaces already exists, it
253
+ * returns the config unchanged.
254
+ */
255
+ export function migrateEdgeConfig(raw) {
256
+ // Already migrated or no repositories — nothing to do
257
+ if (raw.linearWorkspaces || !Array.isArray(raw.repositories)) {
258
+ return raw;
259
+ }
260
+ const repos = raw.repositories;
261
+ const hasLegacyTokens = repos.some((r) => typeof r.linearToken === "string");
262
+ if (!hasLegacyTokens) {
263
+ return raw;
264
+ }
265
+ // Build workspace map from per-repo tokens
266
+ const linearWorkspaces = {};
267
+ // Grab the top-level slug (if present) so it can be folded into each workspace
268
+ const globalSlug = raw.linearWorkspaceSlug;
269
+ for (const repo of repos) {
270
+ const workspaceId = repo.linearWorkspaceId;
271
+ const token = repo.linearToken;
272
+ if (workspaceId && token) {
273
+ // First repo with this workspace wins (they should all have the same token)
274
+ if (!linearWorkspaces[workspaceId]) {
275
+ linearWorkspaces[workspaceId] = {
276
+ linearToken: token,
277
+ ...(typeof repo.linearRefreshToken === "string"
278
+ ? { linearRefreshToken: repo.linearRefreshToken }
279
+ : {}),
280
+ ...(globalSlug ? { linearWorkspaceSlug: globalSlug } : {}),
281
+ ...(typeof repo.linearWorkspaceName === "string"
282
+ ? { linearWorkspaceName: repo.linearWorkspaceName }
283
+ : {}),
284
+ };
285
+ }
286
+ }
287
+ }
288
+ // Strip legacy token fields and workspace name from repositories
289
+ const migratedRepos = repos.map((repo) => {
290
+ const { linearToken: _linearToken, linearRefreshToken: _linearRefreshToken, linearWorkspaceName: _linearWorkspaceName, ...rest } = repo;
291
+ return rest;
292
+ });
293
+ const { linearWorkspaceSlug: _slug, ...rest } = raw;
294
+ return {
295
+ ...rest,
296
+ repositories: migratedRepos,
297
+ linearWorkspaces,
298
+ };
299
+ }
300
+ /**
301
+ * Assert that a repository has a Linear workspace ID and return it.
302
+ * Use this in code paths that are only reached for Linear-linked repositories
303
+ * (e.g. webhook handlers routed via workspace ID).
304
+ */
305
+ export function requireLinearWorkspaceId(repo) {
306
+ if (!repo.linearWorkspaceId) {
307
+ throw new Error(`Repository "${repo.name}" is not linked to a Linear workspace`);
308
+ }
309
+ return repo.linearWorkspaceId;
310
+ }
222
311
  //# sourceMappingURL=config-schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-schemas.js","sourceRoot":"","sources":["../src/config-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGhF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3C,CAAC,CAAC,MAAM,EAAE,EAAE,qBAAqB;IACjC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,mBAAmB;IACjD,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB;CACjD,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD;;;;;OAKG;IACH,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;IAEtD;;;;OAIG;IACH,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;IAEtD;;;;OAIG;IACH,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,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EAAE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE;wBACjD,CAAC,CAAC,EAAE,CAAC;oBACN,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC1D,GAAG,CAAC,OAAO,IAAI,CAAC,mBAAmB,KAAK,QAAQ;wBAC/C,CAAC,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE;wBACnD,CAAC,CAAC,EAAE,CAAC;iBACN,CAAC;YACH,CAAC;QACF,CAAC;IACF,CAAC;IAED,iEAAiE;IACjE,MAAM,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxC,MAAM,EACL,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,mBAAmB,EACvC,mBAAmB,EAAE,oBAAoB,EACzC,GAAG,IAAI,EACP,GAAG,IAAI,CAAC;QACT,OAAO,IAAI,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,CAAC;IAEpD,OAAO;QACN,GAAG,IAAI;QACP,YAAY,EAAE,aAAa;QAC3B,gBAAgB;KAChB,CAAC;AACH,CAAC;AAeD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAsB;IAC9D,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACd,eAAe,IAAI,CAAC,IAAI,uCAAuC,CAC/D,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;AAC/B,CAAC"}
@@ -2,7 +2,7 @@ import type { SDKMessage } from "@anthropic-ai/claude-agent-sdk";
2
2
  import type { Workspace } from "./CyrusAgentSession.js";
3
3
  import type { EdgeConfig, RepositoryConfig } from "./config-schemas.js";
4
4
  import type { Issue } from "./issue-tracker/types.js";
5
- export { type EdgeConfig, type EdgeConfigPayload, EdgeConfigPayloadSchema, EdgeConfigSchema, type RepositoryConfig, type RepositoryConfigPayload, RepositoryConfigPayloadSchema, RepositoryConfigSchema, type RunnerType, RunnerTypeSchema, type UserAccessControlConfig, UserAccessControlConfigSchema, type UserIdentifier, UserIdentifierSchema, } from "./config-schemas.js";
5
+ export { type EdgeConfig, type EdgeConfigPayload, EdgeConfigPayloadSchema, EdgeConfigSchema, type LinearWorkspaceConfig, LinearWorkspaceConfigSchema, migrateEdgeConfig, type RepositoryConfig, type RepositoryConfigPayload, RepositoryConfigPayloadSchema, RepositoryConfigSchema, type RunnerType, RunnerTypeSchema, requireLinearWorkspaceId, type UserAccessControlConfig, UserAccessControlConfigSchema, type UserIdentifier, UserIdentifierSchema, } from "./config-schemas.js";
6
6
  /**
7
7
  * Resolve path with tilde (~) expansion
8
8
  * Expands ~ to the user's home directory and resolves to absolute path
@@ -1 +1 @@
1
- {"version":3,"file":"config-types.d.ts","sourceRoot":"","sources":["../src/config-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAGtD,OAAO,EACN,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,6BAA6B,EAC7B,KAAK,cAAc,EACnB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,IAA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AAE,MAAM,KAChB,IAAI,CAAC;QAEV,uBAAuB;QACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QAEpD,6CAA6C;QAC7C,eAAe,CAAC,EAAE,oBAAoB,CAAC;KACvC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,uBAAuB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { homedir } from "node:os";
2
2
  import { resolve } from "node:path";
3
3
  // Re-export schemas and types from config-schemas
4
- export { EdgeConfigPayloadSchema, EdgeConfigSchema, RepositoryConfigPayloadSchema, RepositoryConfigSchema, RunnerTypeSchema, UserAccessControlConfigSchema, UserIdentifierSchema, } from "./config-schemas.js";
4
+ export { EdgeConfigPayloadSchema, EdgeConfigSchema, LinearWorkspaceConfigSchema, migrateEdgeConfig, RepositoryConfigPayloadSchema, RepositoryConfigSchema, RunnerTypeSchema, requireLinearWorkspaceId, UserAccessControlConfigSchema, UserIdentifierSchema, } from "./config-schemas.js";
5
5
  /**
6
6
  * Resolve path with tilde (~) expansion
7
7
  * Expands ~ to the user's home directory and resolves to absolute path
@@ -1 +1 @@
1
- {"version":3,"file":"config-types.js","sourceRoot":"","sources":["../src/config-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,kDAAkD;AAClD,OAAO,EAGN,uBAAuB,EACvB,gBAAgB,EAGhB,6BAA6B,EAC7B,sBAAsB,EAEtB,gBAAgB,EAEhB,6BAA6B,EAE7B,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACvC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
1
+ {"version":3,"file":"config-types.js","sourceRoot":"","sources":["../src/config-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,kDAAkD;AAClD,OAAO,EAGN,uBAAuB,EACvB,gBAAgB,EAEhB,2BAA2B,EAC3B,iBAAiB,EAGjB,6BAA6B,EAC7B,sBAAsB,EAEtB,gBAAgB,EAChB,wBAAwB,EAExB,6BAA6B,EAE7B,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACvC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  export type { ILogger, LogContext } from "./logging/index.js";
2
2
  export { createLogger, LogLevel } from "./logging/index.js";
3
3
  export type { AgentMessage, AgentRunnerConfig, AgentSessionInfo, AgentUserMessage, AskUserQuestion, AskUserQuestionAnswers, AskUserQuestionInput, AskUserQuestionOption, AskUserQuestionResult, HookCallbackMatcher, HookEvent, IAgentRunner, IMessageFormatter, McpServerConfig, OnAskUserQuestion, SDKAssistantMessage, SDKAssistantMessageError, SDKMessage, SDKResultMessage, SDKUserMessage, } from "./agent-runner-types.js";
4
- export type { CyrusAgentSession, CyrusAgentSessionEntry, IssueContext, IssueMinimal, Workspace, } from "./CyrusAgentSession.js";
5
- export type { EdgeConfig, EdgeConfigPayload, EdgeWorkerConfig, OAuthCallbackHandler, RepositoryConfig, RepositoryConfigPayload, RunnerType, UserAccessControlConfig, UserIdentifier, } from "./config-types.js";
6
- export { EdgeConfigPayloadSchema, EdgeConfigSchema, RepositoryConfigPayloadSchema, RepositoryConfigSchema, RunnerTypeSchema, resolvePath, UserAccessControlConfigSchema, UserIdentifierSchema, } from "./config-types.js";
4
+ export type { CyrusAgentSession, CyrusAgentSessionEntry, IssueContext, IssueMinimal, RepositoryContext, Workspace, } from "./CyrusAgentSession.js";
5
+ export type { EdgeConfig, EdgeConfigPayload, EdgeWorkerConfig, LinearWorkspaceConfig, OAuthCallbackHandler, RepositoryConfig, RepositoryConfigPayload, RunnerType, UserAccessControlConfig, UserIdentifier, } from "./config-types.js";
6
+ export { EdgeConfigPayloadSchema, EdgeConfigSchema, LinearWorkspaceConfigSchema, migrateEdgeConfig, RepositoryConfigPayloadSchema, RepositoryConfigSchema, RunnerTypeSchema, requireLinearWorkspaceId, resolvePath, UserAccessControlConfigSchema, UserIdentifierSchema, } from "./config-types.js";
7
7
  export { DEFAULT_BASE_BRANCH, DEFAULT_CONFIG_FILENAME, DEFAULT_PROXY_URL, DEFAULT_WORKTREES_DIR, } from "./constants.js";
8
8
  export type { AgentActivity, AgentActivityContent, AgentActivityCreateInput, AgentActivityPayload, AgentActivitySDK, AgentEvent, AgentEventTransportConfig, AgentEventTransportEvents, AgentSession, AgentSessionCreatedWebhook, AgentSessionCreateOnCommentInput, AgentSessionCreateOnIssueInput, AgentSessionCreateResponse, AgentSessionPromptedWebhook, AgentSessionSDK, Comment, CommentCreateInput, CommentWithAttachments, Connection, FetchChildrenOptions, FileUploadRequest, FileUploadResponse, GuidanceRule, IAgentEventTransport, IIssueTrackerService, Issue, IssueRelation, IssueUnassignedWebhook, IssueUpdateInput, IssueUpdateWebhook, IssueWithChildren, Label, PaginationOptions, Team, User, Webhook, WebhookAgentSession, WebhookComment, WebhookIssue, WorkflowState, } from "./issue-tracker/index.js";
9
9
  export { AgentActivityContentType, AgentActivitySignal, AgentSessionStatus, AgentSessionType, CLIEventTransport, CLIIssueTrackerService, CLIRPCServer, isAgentSessionCreatedEvent, isAgentSessionCreatedWebhook, isAgentSessionPromptedEvent, isAgentSessionPromptedWebhook, isCommentMentionEvent, isIssueAssignedEvent, isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueTitleOrDescriptionUpdateWebhook, isIssueUnassignedEvent, isIssueUnassignedWebhook, isNewCommentEvent, } from "./issue-tracker/index.js";
10
10
  export type { ContentChanges, ContentUpdateMessage, GitHubPlatformRef, GitHubSessionStartPlatformData, GitHubUserPromptPlatformData, GuidanceItem, IMessageTranslator, InternalMessage, InternalMessageBase, LinearContentUpdatePlatformData, LinearPlatformRef, LinearSessionStartPlatformData, LinearStopSignalPlatformData, LinearUnassignPlatformData, LinearUserPromptPlatformData, MessageAction, MessageAuthor, MessageSource, SessionStartMessage, SlackPlatformRef, SlackSessionStartPlatformData, SlackUserPromptPlatformData, StopSignalMessage, TranslationContext, TranslationResult, UnassignMessage, UserPromptMessage, } from "./messages/index.js";
11
11
  export { hasGitHubSessionStartPlatformData, hasGitHubUserPromptPlatformData, hasLinearSessionStartPlatformData, hasLinearUserPromptPlatformData, hasSlackSessionStartPlatformData, hasSlackUserPromptPlatformData, isContentUpdateMessage, isGitHubMessage, isLinearMessage, isSessionStartMessage, isSlackMessage, isStopSignalMessage, isUnassignMessage, isUserPromptMessage, } from "./messages/index.js";
12
- export type { SerializableEdgeWorkerState, SerializedCyrusAgentSession, SerializedCyrusAgentSessionEntry, } from "./PersistenceManager.js";
12
+ export type { SerializableEdgeWorkerState, SerializedCyrusAgentSession, SerializedCyrusAgentSessionEntry, V3SerializableEdgeWorkerState, } from "./PersistenceManager.js";
13
13
  export { PERSISTENCE_VERSION, PersistenceManager, } from "./PersistenceManager.js";
14
14
  export { StreamingPrompt } from "./StreamingPrompt.js";
15
15
  export type { IAgentProgressEvent, ISimpleAgentQueryOptions, ISimpleAgentResult, ISimpleAgentRunner, ISimpleAgentRunnerConfig, } from "./simple-agent-runner-types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAO5D,YAAY,EACX,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,cAAc,GACd,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,YAAY,EACZ,SAAS,GACT,MAAM,wBAAwB,CAAC;AAGhC,YAAY,EACX,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,uBAAuB,EACvB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,uBAAuB,EAEvB,gBAAgB,EAChB,6BAA6B,EAC7B,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,6BAA6B,EAC7B,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACN,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACX,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,UA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AAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,iCAAiC,EACjC,+BAA+B,EAC/B,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EACX,2BAA2B,EAC3B,2BAA2B,EAC3B,gCAAgC,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,YAAY,EACX,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,GACxB,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAO5D,YAAY,EACX,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,cAAc,GACd,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,SAAS,GACT,MAAM,wBAAwB,CAAC;AAGhC,YAAY,EACX,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,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B,wBAAwB,EACxB,iBAAiB,GACjB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACX,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,8BAA8B,EAC9B,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,+BAA+B,EAC/B,iBAAiB,EACjB,8BAA8B,EAC9B,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,EAC5B,aAAa,EACb,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,6BAA6B,EAC7B,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,iCAAiC,EACjC,+BAA+B,EAC/B,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EACX,2BAA2B,EAC3B,2BAA2B,EAC3B,gCAAgC,EAChC,6BAA6B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,YAAY,EACX,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,GACxB,MAAM,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  export { createLogger, LogLevel } from "./logging/index.js";
3
3
  export { EdgeConfigPayloadSchema,
4
4
  // Zod schemas for runtime validation
5
- EdgeConfigSchema, RepositoryConfigPayloadSchema, RepositoryConfigSchema, RunnerTypeSchema, resolvePath, UserAccessControlConfigSchema, UserIdentifierSchema, } from "./config-types.js";
5
+ EdgeConfigSchema, LinearWorkspaceConfigSchema, migrateEdgeConfig, RepositoryConfigPayloadSchema, RepositoryConfigSchema, RunnerTypeSchema, requireLinearWorkspaceId, resolvePath, UserAccessControlConfigSchema, UserIdentifierSchema, } from "./config-types.js";
6
6
  // Constants
7
7
  export { DEFAULT_BASE_BRANCH, DEFAULT_CONFIG_FILENAME, DEFAULT_PROXY_URL, DEFAULT_WORKTREES_DIR, } from "./constants.js";
8
8
  export { AgentActivityContentType, AgentActivitySignal, AgentSessionStatus, AgentSessionType, CLIEventTransport, CLIIssueTrackerService, CLIRPCServer, isAgentSessionCreatedEvent, isAgentSessionCreatedWebhook, isAgentSessionPromptedEvent, isAgentSessionPromptedWebhook, isCommentMentionEvent, isIssueAssignedEvent, isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueTitleOrDescriptionUpdateWebhook, isIssueUnassignedEvent, isIssueUnassignedWebhook, isNewCommentEvent, } from "./issue-tracker/index.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AAGV,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAiD5D,OAAO,EACN,uBAAuB;AACvB,qCAAqC;AACrC,gBAAgB,EAChB,6BAA6B,EAC7B,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,6BAA6B,EAC7B,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,YAAY;AACZ,OAAO,EACN,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,gBAAgB,CAAC;AA4CxB,OAAO,EACN,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,0BAA0B,EAC1B,4BAA4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qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,sCAAsC,EACtC,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,GACjB,MAAM,0BAA0B,CAAC;AA+BlC,OAAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,iCAAiC,EACjC,+BAA+B,EAC/B,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EACN,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAUvD,uEAAuE;AACvE,yFAAyF;AACzF,gGAAgG"}
@@ -0,0 +1,259 @@
1
+ /**
2
+ * Linear webhook types based on actual webhook payloads
3
+ * These are the exact structures Linear sends in webhooks
4
+ */
5
+ import type { LinearDocument } from "@linear/sdk";
6
+ /**
7
+ * Linear team data from webhooks
8
+ */
9
+ export interface LinearWebhookTeam {
10
+ id: string;
11
+ key: string;
12
+ name: string;
13
+ }
14
+ /**
15
+ * Linear issue data from webhooks
16
+ */
17
+ export interface LinearWebhookIssue {
18
+ id: string;
19
+ title: string;
20
+ teamId: string;
21
+ team: LinearWebhookTeam;
22
+ identifier: string;
23
+ url: string;
24
+ }
25
+ /**
26
+ * Linear comment data from webhooks
27
+ */
28
+ export interface LinearWebhookComment {
29
+ id: string;
30
+ body: string;
31
+ userId: string;
32
+ issueId: string;
33
+ }
34
+ /**
35
+ * Linear actor (user) data from webhooks
36
+ */
37
+ export interface LinearWebhookActor {
38
+ id: string;
39
+ name: string;
40
+ email: string;
41
+ url: string;
42
+ }
43
+ /**
44
+ * Base notification structure common to all webhook notifications
45
+ */
46
+ export interface LinearWebhookNotificationBase {
47
+ id: string;
48
+ createdAt: string;
49
+ updatedAt: string;
50
+ archivedAt: string | null;
51
+ actorId: string;
52
+ externalUserActorId: string | null;
53
+ userId: string;
54
+ issueId: string;
55
+ issue: LinearWebhookIssue;
56
+ actor: LinearWebhookActor;
57
+ }
58
+ /**
59
+ * Issue assignment notification
60
+ */
61
+ export interface LinearIssueAssignedNotification extends LinearWebhookNotificationBase {
62
+ type: "issueAssignedToYou";
63
+ }
64
+ /**
65
+ * Issue comment mention notification
66
+ */
67
+ export interface LinearIssueCommentMentionNotification extends LinearWebhookNotificationBase {
68
+ type: "issueCommentMention";
69
+ commentId: string;
70
+ comment: LinearWebhookComment;
71
+ }
72
+ /**
73
+ * Issue new comment notification (can have parent comment for replies)
74
+ */
75
+ export interface LinearIssueNewCommentNotification extends LinearWebhookNotificationBase {
76
+ type: "issueNewComment";
77
+ commentId: string;
78
+ comment: LinearWebhookComment;
79
+ parentCommentId?: string;
80
+ parentComment?: LinearWebhookComment;
81
+ }
82
+ /**
83
+ * Issue unassignment notification
84
+ */
85
+ export interface LinearIssueUnassignedNotification extends LinearWebhookNotificationBase {
86
+ type: "issueUnassignedFromYou";
87
+ actorId: string;
88
+ externalUserActorId: string | null;
89
+ userId: string;
90
+ issueId: string;
91
+ issue: LinearWebhookIssue;
92
+ actor: LinearWebhookActor;
93
+ }
94
+ /**
95
+ * Union of all notification types
96
+ */
97
+ export type LinearWebhookNotification = LinearIssueAssignedNotification | LinearIssueCommentMentionNotification | LinearIssueNewCommentNotification | LinearIssueUnassignedNotification;
98
+ /**
99
+ * Issue assignment webhook payload
100
+ */
101
+ export interface LinearIssueAssignedWebhook {
102
+ type: "AppUserNotification";
103
+ action: "issueAssignedToYou";
104
+ createdAt: string;
105
+ organizationId: string;
106
+ oauthClientId: string;
107
+ appUserId: string;
108
+ notification: LinearIssueAssignedNotification;
109
+ webhookTimestamp: number;
110
+ webhookId: string;
111
+ }
112
+ /**
113
+ * Issue comment mention webhook payload
114
+ */
115
+ export interface LinearIssueCommentMentionWebhook {
116
+ type: "AppUserNotification";
117
+ action: "issueCommentMention";
118
+ createdAt: string;
119
+ organizationId: string;
120
+ oauthClientId: string;
121
+ appUserId: string;
122
+ notification: LinearIssueCommentMentionNotification;
123
+ webhookTimestamp: number;
124
+ webhookId: string;
125
+ }
126
+ /**
127
+ * Issue new comment webhook payload
128
+ */
129
+ export interface LinearIssueNewCommentWebhook {
130
+ type: "AppUserNotification";
131
+ action: "issueNewComment";
132
+ createdAt: string;
133
+ organizationId: string;
134
+ oauthClientId: string;
135
+ appUserId: string;
136
+ notification: LinearIssueNewCommentNotification;
137
+ webhookTimestamp: number;
138
+ webhookId: string;
139
+ }
140
+ /**
141
+ * Issue unassignment webhook payload
142
+ */
143
+ export interface LinearIssueUnassignedWebhook {
144
+ type: "AppUserNotification";
145
+ action: "issueUnassignedFromYou";
146
+ createdAt: string;
147
+ organizationId: string;
148
+ oauthClientId: string;
149
+ appUserId: string;
150
+ notification: LinearIssueUnassignedNotification;
151
+ webhookTimestamp: number;
152
+ webhookId: string;
153
+ }
154
+ /**
155
+ * Creator data in agent session webhooks
156
+ */
157
+ export interface LinearWebhookCreator {
158
+ id: string;
159
+ name: string;
160
+ email: string;
161
+ avatarUrl: string;
162
+ url: string;
163
+ }
164
+ /**
165
+ * Agent guidance types - re-exported from @linear/sdk for convenience
166
+ */
167
+ export type LinearWebhookGuidanceRule = LinearDocument.GuidanceRuleWebhookPayload;
168
+ export type LinearWebhookOrganizationOrigin = LinearDocument.OrganizationOriginWebhookPayload;
169
+ export type LinearWebhookTeamOrigin = LinearDocument.TeamOriginWebhookPayload;
170
+ export type LinearWebhookTeamWithParent = LinearDocument.TeamWithParentWebhookPayload;
171
+ /**
172
+ * Agent Session data from webhooks
173
+ */
174
+ export interface LinearWebhookAgentSession {
175
+ id: string;
176
+ createdAt: string;
177
+ updatedAt: string;
178
+ archivedAt: string | null;
179
+ creatorId: string;
180
+ appUserId: string;
181
+ commentId: string;
182
+ issueId: string;
183
+ status: "pending" | "active" | "error" | "awaiting-input" | "complete";
184
+ startedAt: string | null;
185
+ endedAt: string | null;
186
+ type: "commentThread";
187
+ summary: string | null;
188
+ sourceMetadata: any | null;
189
+ organizationId: string;
190
+ creator: LinearWebhookCreator;
191
+ comment: LinearWebhookComment;
192
+ issue: LinearWebhookIssue;
193
+ }
194
+ /**
195
+ * Agent Activity content types
196
+ */
197
+ export interface LinearWebhookAgentActivityContent {
198
+ type: "prompt" | "observation" | "action" | "error" | "elicitation" | "response";
199
+ body: string;
200
+ }
201
+ /**
202
+ * Agent Activity data from webhooks
203
+ */
204
+ export interface LinearWebhookAgentActivity {
205
+ id: string;
206
+ createdAt: string;
207
+ updatedAt: string;
208
+ archivedAt: string | null;
209
+ agentContextId: string | null;
210
+ agentSessionId: string;
211
+ sourceCommentId: string;
212
+ content: LinearWebhookAgentActivityContent;
213
+ signal?: "stop";
214
+ }
215
+ /**
216
+ * Agent Session created webhook payload
217
+ */
218
+ export interface LinearAgentSessionCreatedWebhook {
219
+ type: "AgentSessionEvent";
220
+ action: "created";
221
+ createdAt: string;
222
+ organizationId: string;
223
+ oauthClientId: string;
224
+ appUserId: string;
225
+ agentSession: LinearWebhookAgentSession;
226
+ guidance?: LinearWebhookGuidanceRule[];
227
+ webhookTimestamp: string;
228
+ webhookId: string;
229
+ }
230
+ /**
231
+ * Agent Session prompted webhook payload
232
+ */
233
+ export interface LinearAgentSessionPromptedWebhook {
234
+ type: "AgentSessionEvent";
235
+ action: "prompted";
236
+ createdAt: string;
237
+ organizationId: string;
238
+ oauthClientId: string;
239
+ appUserId: string;
240
+ agentSession: LinearWebhookAgentSession;
241
+ agentActivity: LinearWebhookAgentActivity;
242
+ guidance?: LinearWebhookGuidanceRule[];
243
+ webhookTimestamp: string;
244
+ webhookId: string;
245
+ }
246
+ /**
247
+ * Union of all webhook types we handle
248
+ */
249
+ export type LinearWebhook = LinearIssueAssignedWebhook | LinearIssueCommentMentionWebhook | LinearIssueNewCommentWebhook | LinearIssueUnassignedWebhook | LinearAgentSessionCreatedWebhook | LinearAgentSessionPromptedWebhook;
250
+ /**
251
+ * Type guards for webhook discrimination
252
+ */
253
+ export declare function isIssueAssignedWebhook(webhook: LinearWebhook): webhook is LinearIssueAssignedWebhook;
254
+ export declare function isIssueCommentMentionWebhook(webhook: LinearWebhook): webhook is LinearIssueCommentMentionWebhook;
255
+ export declare function isIssueNewCommentWebhook(webhook: LinearWebhook): webhook is LinearIssueNewCommentWebhook;
256
+ export declare function isIssueUnassignedWebhook(webhook: LinearWebhook): webhook is LinearIssueUnassignedWebhook;
257
+ export declare function isAgentSessionCreatedWebhook(webhook: LinearWebhook): webhook is LinearAgentSessionCreatedWebhook;
258
+ export declare function isAgentSessionPromptedWebhook(webhook: LinearWebhook): webhook is LinearAgentSessionPromptedWebhook;
259
+ //# sourceMappingURL=webhook-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-types.d.ts","sourceRoot":"","sources":["../src/webhook-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,EAAE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EAAE,yBAAyB,CAAC;IACxC,aAAa,EAAE,0BAA0B,CAAC;IAC1C,QAAQ,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACvC,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GACtB,0BAA0B,GAC1B,gCAAgC,GAChC,4BAA4B,GAC5B,4BAA4B,GAC5B,gCAAgC,GAChC,iCAAiC,CAAC;AAErC;;GAEG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,0BAA0B,CAEvC;AAED,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,gCAAgC,CAE7C;AAED,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,4BAA4B,CAEzC;AAED,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,4BAA4B,CAEzC;AAED,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,gCAAgC,CAE7C;AAED,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,iCAAiC,CAE9C"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Linear webhook types based on actual webhook payloads
3
+ * These are the exact structures Linear sends in webhooks
4
+ */
5
+ /**
6
+ * Type guards for webhook discrimination
7
+ */
8
+ export function isIssueAssignedWebhook(webhook) {
9
+ return webhook.action === "issueAssignedToYou";
10
+ }
11
+ export function isIssueCommentMentionWebhook(webhook) {
12
+ return webhook.action === "issueCommentMention";
13
+ }
14
+ export function isIssueNewCommentWebhook(webhook) {
15
+ return webhook.action === "issueNewComment";
16
+ }
17
+ export function isIssueUnassignedWebhook(webhook) {
18
+ return webhook.action === "issueUnassignedFromYou";
19
+ }
20
+ export function isAgentSessionCreatedWebhook(webhook) {
21
+ return webhook.type === "AgentSessionEvent" && webhook.action === "created";
22
+ }
23
+ export function isAgentSessionPromptedWebhook(webhook) {
24
+ return webhook.type === "AgentSessionEvent" && webhook.action === "prompted";
25
+ }
26
+ //# sourceMappingURL=webhook-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-types.js","sourceRoot":"","sources":["../src/webhook-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqSH;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACrC,OAAsB;IAEtB,OAAO,OAAO,CAAC,MAAM,KAAK,oBAAoB,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC3C,OAAsB;IAEtB,OAAO,OAAO,CAAC,MAAM,KAAK,qBAAqB,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,wBAAwB,CACvC,OAAsB;IAEtB,OAAO,OAAO,CAAC,MAAM,KAAK,iBAAiB,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,wBAAwB,CACvC,OAAsB;IAEtB,OAAO,OAAO,CAAC,MAAM,KAAK,wBAAwB,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC3C,OAAsB;IAEtB,OAAO,OAAO,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC5C,OAAsB;IAEtB,OAAO,OAAO,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU,CAAC;AAC9E,CAAC"}
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
- "name": "cyrus-core",
3
- "version": "0.2.32",
4
- "description": "Core business logic for Cyrus",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "dependencies": {
12
- "@anthropic-ai/claude-agent-sdk": "^0.2.63",
13
- "@linear/sdk": "^64.0.0",
14
- "zod": "^4.3.6"
15
- },
16
- "devDependencies": {
17
- "@types/node": "^20.0.0",
18
- "fastify": "^5.8.1",
19
- "typescript": "^5.3.3",
20
- "vitest": "^3.1.4"
21
- },
22
- "publishConfig": {
23
- "access": "public"
24
- },
25
- "scripts": {
26
- "build": "tsc",
27
- "dev": "tsc --watch",
28
- "test": "vitest",
29
- "test:run": "vitest run --passWithNoTests",
30
- "typecheck": "tsc --noEmit"
31
- }
32
- }
2
+ "name": "cyrus-core",
3
+ "version": "0.2.34-beta.0",
4
+ "description": "Core business logic for Cyrus",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc",
13
+ "dev": "tsc --watch",
14
+ "test": "vitest",
15
+ "test:run": "vitest run --passWithNoTests",
16
+ "typecheck": "tsc --noEmit"
17
+ },
18
+ "dependencies": {
19
+ "@anthropic-ai/claude-agent-sdk": "^0.2.63",
20
+ "@linear/sdk": "^64.0.0",
21
+ "zod": "^4.3.6"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^20.0.0",
25
+ "fastify": "^5.8.1",
26
+ "typescript": "^5.3.3",
27
+ "vitest": "^3.1.4"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ }
32
+ }
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.