@aigile/core 0.2.3 → 0.4.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.
Files changed (176) hide show
  1. package/dist/agent-config.d.ts +850 -0
  2. package/dist/agent-config.d.ts.map +1 -0
  3. package/dist/agent-config.js +111 -0
  4. package/dist/agent-config.js.map +1 -0
  5. package/dist/collections.d.ts +33 -1
  6. package/dist/collections.d.ts.map +1 -1
  7. package/dist/collections.js +33 -1
  8. package/dist/collections.js.map +1 -1
  9. package/dist/config-sections.d.ts +78 -0
  10. package/dist/config-sections.d.ts.map +1 -0
  11. package/dist/config-sections.js +42 -0
  12. package/dist/config-sections.js.map +1 -0
  13. package/dist/config.d.ts +6795 -445
  14. package/dist/config.d.ts.map +1 -1
  15. package/dist/config.js +724 -87
  16. package/dist/config.js.map +1 -1
  17. package/dist/domain/action-item.d.ts +409 -0
  18. package/dist/domain/action-item.d.ts.map +1 -0
  19. package/dist/domain/action-item.js +155 -0
  20. package/dist/domain/action-item.js.map +1 -0
  21. package/dist/domain/ai-call.d.ts +15 -11
  22. package/dist/domain/ai-call.d.ts.map +1 -1
  23. package/dist/domain/ai-call.js +2 -0
  24. package/dist/domain/ai-call.js.map +1 -1
  25. package/dist/domain/build.d.ts +47 -5
  26. package/dist/domain/build.d.ts.map +1 -1
  27. package/dist/domain/build.js +6 -0
  28. package/dist/domain/build.js.map +1 -1
  29. package/dist/domain/change-set.d.ts +216 -0
  30. package/dist/domain/change-set.d.ts.map +1 -0
  31. package/dist/domain/change-set.js +48 -0
  32. package/dist/domain/change-set.js.map +1 -0
  33. package/dist/domain/common.d.ts +6 -3
  34. package/dist/domain/common.d.ts.map +1 -1
  35. package/dist/domain/common.js +4 -1
  36. package/dist/domain/common.js.map +1 -1
  37. package/dist/domain/conflict.d.ts +8 -8
  38. package/dist/domain/conversation.d.ts +78 -8
  39. package/dist/domain/conversation.d.ts.map +1 -1
  40. package/dist/domain/conversation.js +2 -0
  41. package/dist/domain/conversation.js.map +1 -1
  42. package/dist/domain/deliverable.d.ts +235 -0
  43. package/dist/domain/deliverable.d.ts.map +1 -0
  44. package/dist/domain/deliverable.js +76 -0
  45. package/dist/domain/deliverable.js.map +1 -0
  46. package/dist/domain/index.d.ts +4 -1
  47. package/dist/domain/index.d.ts.map +1 -1
  48. package/dist/domain/index.js +4 -1
  49. package/dist/domain/index.js.map +1 -1
  50. package/dist/domain/message.d.ts +7 -7
  51. package/dist/domain/milestone.d.ts +11 -11
  52. package/dist/domain/organization.d.ts +2 -2
  53. package/dist/domain/project.d.ts +524 -3
  54. package/dist/domain/project.d.ts.map +1 -1
  55. package/dist/domain/project.js +38 -1
  56. package/dist/domain/project.js.map +1 -1
  57. package/dist/domain/question.d.ts +238 -26
  58. package/dist/domain/question.d.ts.map +1 -1
  59. package/dist/domain/question.js +49 -4
  60. package/dist/domain/question.js.map +1 -1
  61. package/dist/domain/reassignment.d.ts +23 -18
  62. package/dist/domain/reassignment.d.ts.map +1 -1
  63. package/dist/domain/reassignment.js +14 -6
  64. package/dist/domain/reassignment.js.map +1 -1
  65. package/dist/domain/reference.d.ts +595 -0
  66. package/dist/domain/reference.d.ts.map +1 -0
  67. package/dist/domain/reference.js +180 -0
  68. package/dist/domain/reference.js.map +1 -0
  69. package/dist/domain/release.d.ts +246 -10
  70. package/dist/domain/release.d.ts.map +1 -1
  71. package/dist/domain/release.js +6 -0
  72. package/dist/domain/release.js.map +1 -1
  73. package/dist/domain/review.d.ts +11 -11
  74. package/dist/domain/role-assignment.d.ts +5 -5
  75. package/dist/domain/role-assignment.js +1 -1
  76. package/dist/domain/role.d.ts +41 -6
  77. package/dist/domain/role.d.ts.map +1 -1
  78. package/dist/domain/role.js +12 -0
  79. package/dist/domain/role.js.map +1 -1
  80. package/dist/domain/spec.d.ts +197 -6
  81. package/dist/domain/spec.d.ts.map +1 -1
  82. package/dist/domain/spec.js +73 -1
  83. package/dist/domain/spec.js.map +1 -1
  84. package/dist/domain/sweep.d.ts +11 -11
  85. package/dist/domain/sweep.d.ts.map +1 -1
  86. package/dist/domain/sweep.js +1 -1
  87. package/dist/domain/sweep.js.map +1 -1
  88. package/dist/domain/track.d.ts +16 -16
  89. package/dist/domain/user.d.ts +50 -2
  90. package/dist/domain/user.d.ts.map +1 -1
  91. package/dist/domain/user.js +13 -0
  92. package/dist/domain/user.js.map +1 -1
  93. package/dist/domain/verification.d.ts +4 -4
  94. package/dist/id.d.ts +114 -0
  95. package/dist/id.d.ts.map +1 -0
  96. package/dist/id.js +204 -0
  97. package/dist/id.js.map +1 -0
  98. package/dist/ids.d.ts +0 -2
  99. package/dist/ids.d.ts.map +1 -1
  100. package/dist/ids.js +0 -5
  101. package/dist/ids.js.map +1 -1
  102. package/dist/index.d.ts +7 -0
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +7 -0
  105. package/dist/index.js.map +1 -1
  106. package/dist/jira.d.ts +26 -0
  107. package/dist/jira.d.ts.map +1 -0
  108. package/dist/jira.js +37 -0
  109. package/dist/jira.js.map +1 -0
  110. package/dist/outline.d.ts +64 -0
  111. package/dist/outline.d.ts.map +1 -0
  112. package/dist/outline.js +127 -0
  113. package/dist/outline.js.map +1 -0
  114. package/dist/plugins/action-source.d.ts +44 -0
  115. package/dist/plugins/action-source.d.ts.map +1 -0
  116. package/dist/plugins/action-source.js +2 -0
  117. package/dist/plugins/action-source.js.map +1 -0
  118. package/dist/plugins/ai.d.ts +5 -0
  119. package/dist/plugins/ai.d.ts.map +1 -1
  120. package/dist/plugins/blob-store.d.ts +36 -0
  121. package/dist/plugins/blob-store.d.ts.map +1 -0
  122. package/dist/plugins/blob-store.js +11 -0
  123. package/dist/plugins/blob-store.js.map +1 -0
  124. package/dist/plugins/datastore.d.ts +6 -0
  125. package/dist/plugins/datastore.d.ts.map +1 -1
  126. package/dist/plugins/design.d.ts +62 -0
  127. package/dist/plugins/design.d.ts.map +1 -0
  128. package/dist/plugins/design.js +2 -0
  129. package/dist/plugins/design.js.map +1 -0
  130. package/dist/plugins/git-host.d.ts +35 -0
  131. package/dist/plugins/git-host.d.ts.map +1 -0
  132. package/dist/plugins/git-host.js +2 -0
  133. package/dist/plugins/git-host.js.map +1 -0
  134. package/dist/plugins/index.d.ts +9 -0
  135. package/dist/plugins/index.d.ts.map +1 -1
  136. package/dist/plugins/index.js +9 -0
  137. package/dist/plugins/index.js.map +1 -1
  138. package/dist/plugins/registry.d.ts +360 -0
  139. package/dist/plugins/registry.d.ts.map +1 -0
  140. package/dist/plugins/registry.js +218 -0
  141. package/dist/plugins/registry.js.map +1 -0
  142. package/dist/plugins/release-gate.d.ts +53 -0
  143. package/dist/plugins/release-gate.d.ts.map +1 -0
  144. package/dist/plugins/release-gate.js +2 -0
  145. package/dist/plugins/release-gate.js.map +1 -0
  146. package/dist/plugins/spec-cache.d.ts +23 -0
  147. package/dist/plugins/spec-cache.d.ts.map +1 -0
  148. package/dist/plugins/spec-cache.js +2 -0
  149. package/dist/plugins/spec-cache.js.map +1 -0
  150. package/dist/plugins/spec-source.d.ts +177 -0
  151. package/dist/plugins/spec-source.d.ts.map +1 -0
  152. package/dist/plugins/spec-source.js +31 -0
  153. package/dist/plugins/spec-source.js.map +1 -0
  154. package/dist/plugins/test-runner.d.ts +68 -0
  155. package/dist/plugins/test-runner.d.ts.map +1 -0
  156. package/dist/plugins/test-runner.js +14 -0
  157. package/dist/plugins/test-runner.js.map +1 -0
  158. package/dist/preamble.d.ts +11 -0
  159. package/dist/preamble.d.ts.map +1 -0
  160. package/dist/preamble.js +12 -0
  161. package/dist/preamble.js.map +1 -0
  162. package/dist/prompts.d.ts +8 -0
  163. package/dist/prompts.d.ts.map +1 -0
  164. package/dist/prompts.js +13 -0
  165. package/dist/prompts.js.map +1 -0
  166. package/dist/settings.d.ts +90 -0
  167. package/dist/settings.d.ts.map +1 -0
  168. package/dist/settings.js +120 -0
  169. package/dist/settings.js.map +1 -0
  170. package/dist/template.d.ts +89 -0
  171. package/dist/template.d.ts.map +1 -0
  172. package/dist/template.js +9 -0
  173. package/dist/template.js.map +1 -0
  174. package/package.json +9 -3
  175. package/prompts/mission.md +3 -0
  176. package/prompts/preamble.md +37 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira.d.ts","sourceRoot":"","sources":["../src/jira.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,kIAAkI;AAClI,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAEzE,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAAkD,CAAC;AAEnG,wCAAwC;AACxC,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAiG,CAAC;AAE9J,KAAK,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,WAAW,CAQpI;AAED,8IAA8I;AAC9I,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,GAAE,MAAM,GAAG,IAAW,GAAG,CAAC,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,IAAI,CAKnI;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGxD"}
package/dist/jira.js ADDED
@@ -0,0 +1,37 @@
1
+ export const TICKET_GROUPS = ['actionable', 'inFlight', 'done', 'unknown'];
2
+ /** How each group reads to a person. */
3
+ export const TICKET_GROUP_LABELS = { actionable: 'actionable', inFlight: 'in flight', done: 'done', unknown: 'status not read' };
4
+ /**
5
+ * A status's group: by its name first (case-insensitive), then by its category
6
+ * (a category name such as `In Progress`, or a key such as `indeterminate`).
7
+ * A status the config names in no list and whose category it names in none either is `unknown`.
8
+ */
9
+ export function ticketGroup(status, states) {
10
+ const name = status?.name.trim().toLowerCase() ?? '';
11
+ if (!name)
12
+ return 'unknown';
13
+ const has = (list, v) => list.some((x) => x.trim().toLowerCase() === v);
14
+ for (const g of ['actionable', 'inFlight', 'done'])
15
+ if (has(states[g], name))
16
+ return g;
17
+ const category = status?.category?.trim().toLowerCase() ?? '';
18
+ if (category)
19
+ for (const g of ['actionable', 'inFlight', 'done'])
20
+ if (has(states.categories[g], category))
21
+ return g;
22
+ return 'unknown';
23
+ }
24
+ /** The installation's Jira connection: the Jira spec source or action source with this id, else the first Jira one; null when it has none. */
25
+ export function jiraConnectionOf(config, id = null) {
26
+ const all = [...config.sources.filter((s) => s.kind === 'jira'), ...config.actionSources];
27
+ const from = (id ? all.find((s) => s.id === id) : undefined) ?? all[0];
28
+ if (!from || from.kind !== 'jira')
29
+ return null;
30
+ return { id: from.id, baseUrl: from.baseUrl, cloudId: from.cloudId, tokenEnv: from.tokenEnv, emailEnv: from.emailEnv, jql: from.jql };
31
+ }
32
+ /** The Jira project a JQL names (`project = WF`, `project in (WF)`, `project = "WF"`), or null. */
33
+ export function jiraProjectOf(jql) {
34
+ const m = /\bproject\s*(?:=|in\s*\()\s*"?([A-Za-z][A-Za-z0-9_]*)"?/i.exec(jql);
35
+ return m ? m[1].toUpperCase() : null;
36
+ }
37
+ //# sourceMappingURL=jira.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira.js","sourceRoot":"","sources":["../src/jira.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAEnG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,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;IAC1F,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;IACvE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAC/C,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;AACxI,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,MAAM,CAAC,GAAG,0DAA0D,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/E,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Spec outlines (documentation/sources.md "Outlines"): a spec may name one
3
+ * parent, and its children are found by looking for specs that name it, so
4
+ * adding a child never changes its parent. The outline is separate from where
5
+ * a spec applies, but a spec with no organization or project of its own
6
+ * applies wherever its nearest ancestor does. No imports beyond types, so the
7
+ * browser can use these too (`@aigile/core/outline`).
8
+ */
9
+ export interface OutlineSpec {
10
+ id: string;
11
+ title: string;
12
+ parentId?: string | null;
13
+ order?: number | null;
14
+ organizationIds: string[];
15
+ projectIds: string[];
16
+ }
17
+ /** True when the spec names an organization or a project of its own. */
18
+ export declare function hasOwnPlacement(spec: Pick<OutlineSpec, 'organizationIds' | 'projectIds'>): boolean;
19
+ /** The spec's parent when it exists in `byId`; a parent that was deleted makes the spec a top one. */
20
+ export declare function parentOf<T extends OutlineSpec>(spec: T, byId: ReadonlyMap<string, T>): T | null;
21
+ /** The spec's ancestors, nearest first, guarded against cycles. */
22
+ export declare function ancestorsOf<T extends OutlineSpec>(spec: T, byId: ReadonlyMap<string, T>): T[];
23
+ /**
24
+ * Where a spec applies: its own organizations and projects, or else those of
25
+ * its nearest ancestor that has some. `from` is that ancestor's id, or null
26
+ * when the spec places itself (or nothing above it does).
27
+ */
28
+ export declare function effectivePlacement<T extends OutlineSpec>(spec: T, byId: ReadonlyMap<string, T>): {
29
+ organizationIds: string[];
30
+ projectIds: string[];
31
+ from: string | null;
32
+ };
33
+ /** The titles above a spec, outermost first: the path an agent reads with it. */
34
+ export declare function pathOf<T extends OutlineSpec>(spec: T, byId: ReadonlyMap<string, T>): string[];
35
+ /** Siblings in outline order: by `order` where set (those first), then by title. */
36
+ export declare function compareOutline(a: Pick<OutlineSpec, 'order' | 'title'>, b: Pick<OutlineSpec, 'order' | 'title'>): number;
37
+ /** Each spec's children in outline order, keyed by parent id (children of a missing parent are not listed). */
38
+ export declare function childrenByParent<T extends OutlineSpec>(specs: readonly T[]): Map<string, T[]>;
39
+ /** True when making `parentId` the parent of `specId` would put the spec under itself. */
40
+ export declare function wouldCycle<T extends OutlineSpec>(specId: string, parentId: string, byId: ReadonlyMap<string, T>): boolean;
41
+ /**
42
+ * The specs to list at one level: those with no ancestor also in the list
43
+ * (they show nested under it instead). `all` is every spec, for walking up
44
+ * through ancestors that are not in the list themselves.
45
+ */
46
+ export declare function topOf<T extends OutlineSpec>(specs: readonly T[], all?: readonly T[]): T[];
47
+ /**
48
+ * The `order` that puts a spec at `index` among `siblings` (in outline order,
49
+ * without the spec itself): halfway between its new neighbours when both
50
+ * have one, one past or before the single neighbour, or `renumber` when the
51
+ * neighbours sort by title (no order) and every movable sibling needs one.
52
+ * `movable` says which siblings may be renumbered (a mirrored spec's order
53
+ * is its source's).
54
+ */
55
+ export declare function orderAt<T extends Pick<OutlineSpec, 'id' | 'order' | 'title'>>(siblings: readonly T[], index: number, movable?: (s: T) => boolean): {
56
+ order: number;
57
+ } | {
58
+ renumber: Array<{
59
+ id: string;
60
+ order: number;
61
+ }>;
62
+ order: number;
63
+ };
64
+ //# sourceMappingURL=outline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outline.d.ts","sourceRoot":"","sources":["../src/outline.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,iBAAiB,GAAG,YAAY,CAAC,GAAG,OAAO,CAElG;AAED,sGAAsG;AACtG,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAE/F;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAU7F;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM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,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAiBpP"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Spec outlines (documentation/sources.md "Outlines"): a spec may name one
3
+ * parent, and its children are found by looking for specs that name it, so
4
+ * adding a child never changes its parent. The outline is separate from where
5
+ * a spec applies, but a spec with no organization or project of its own
6
+ * applies wherever its nearest ancestor does. No imports beyond types, so the
7
+ * browser can use these too (`@aigile/core/outline`).
8
+ */
9
+ /** True when the spec names an organization or a project of its own. */
10
+ export function hasOwnPlacement(spec) {
11
+ return spec.organizationIds.length + spec.projectIds.length > 0;
12
+ }
13
+ /** The spec's parent when it exists in `byId`; a parent that was deleted makes the spec a top one. */
14
+ export function parentOf(spec, byId) {
15
+ return spec.parentId ? (byId.get(spec.parentId) ?? null) : null;
16
+ }
17
+ /** The spec's ancestors, nearest first, guarded against cycles. */
18
+ export function ancestorsOf(spec, byId) {
19
+ const out = [];
20
+ const seen = new Set([spec.id]);
21
+ let current = parentOf(spec, byId);
22
+ while (current && !seen.has(current.id)) {
23
+ seen.add(current.id);
24
+ out.push(current);
25
+ current = parentOf(current, byId);
26
+ }
27
+ return out;
28
+ }
29
+ /**
30
+ * Where a spec applies: its own organizations and projects, or else those of
31
+ * its nearest ancestor that has some. `from` is that ancestor's id, or null
32
+ * when the spec places itself (or nothing above it does).
33
+ */
34
+ export function effectivePlacement(spec, byId) {
35
+ if (hasOwnPlacement(spec))
36
+ return { organizationIds: spec.organizationIds, projectIds: spec.projectIds, from: null };
37
+ for (const ancestor of ancestorsOf(spec, byId)) {
38
+ if (hasOwnPlacement(ancestor))
39
+ return { organizationIds: ancestor.organizationIds, projectIds: ancestor.projectIds, from: ancestor.id };
40
+ }
41
+ return { organizationIds: [], projectIds: [], from: null };
42
+ }
43
+ /** The titles above a spec, outermost first: the path an agent reads with it. */
44
+ export function pathOf(spec, byId) {
45
+ return ancestorsOf(spec, byId)
46
+ .map((a) => a.title)
47
+ .reverse();
48
+ }
49
+ /** Siblings in outline order: by `order` where set (those first), then by title. */
50
+ export function compareOutline(a, b) {
51
+ const oa = a.order ?? null;
52
+ const ob = b.order ?? null;
53
+ if (oa !== null && ob !== null && oa !== ob)
54
+ return oa - ob;
55
+ if (oa !== null && ob === null)
56
+ return -1;
57
+ if (oa === null && ob !== null)
58
+ return 1;
59
+ return a.title.localeCompare(b.title);
60
+ }
61
+ /** Each spec's children in outline order, keyed by parent id (children of a missing parent are not listed). */
62
+ export function childrenByParent(specs) {
63
+ const ids = new Set(specs.map((s) => s.id));
64
+ const out = new Map();
65
+ for (const s of specs) {
66
+ if (!s.parentId || !ids.has(s.parentId) || s.parentId === s.id)
67
+ continue;
68
+ const list = out.get(s.parentId) ?? [];
69
+ list.push(s);
70
+ out.set(s.parentId, list);
71
+ }
72
+ for (const list of out.values())
73
+ list.sort(compareOutline);
74
+ return out;
75
+ }
76
+ /** True when making `parentId` the parent of `specId` would put the spec under itself. */
77
+ export function wouldCycle(specId, parentId, byId) {
78
+ if (specId === parentId)
79
+ return true;
80
+ const parent = byId.get(parentId);
81
+ return parent ? ancestorsOf(parent, byId).some((a) => a.id === specId) : false;
82
+ }
83
+ /**
84
+ * The specs to list at one level: those with no ancestor also in the list
85
+ * (they show nested under it instead). `all` is every spec, for walking up
86
+ * through ancestors that are not in the list themselves.
87
+ */
88
+ export function topOf(specs, all = specs) {
89
+ const ids = new Set(specs.map((s) => s.id));
90
+ const byId = new Map(all.map((s) => [s.id, s]));
91
+ for (const s of specs)
92
+ if (!byId.has(s.id))
93
+ byId.set(s.id, s);
94
+ return specs.filter((s) => !ancestorsOf(s, byId).some((a) => ids.has(a.id))).sort(compareOutline);
95
+ }
96
+ /**
97
+ * The `order` that puts a spec at `index` among `siblings` (in outline order,
98
+ * without the spec itself): halfway between its new neighbours when both
99
+ * have one, one past or before the single neighbour, or `renumber` when the
100
+ * neighbours sort by title (no order) and every movable sibling needs one.
101
+ * `movable` says which siblings may be renumbered (a mirrored spec's order
102
+ * is its source's).
103
+ */
104
+ export function orderAt(siblings, index, movable = () => true) {
105
+ const prev = index > 0 ? siblings[index - 1] : undefined;
106
+ const next = index < siblings.length ? siblings[index] : undefined;
107
+ const p = prev?.order ?? null;
108
+ const n = next?.order ?? null;
109
+ if (prev && next && p !== null && n !== null)
110
+ return { order: (p + n) / 2 };
111
+ if (!prev && next && n !== null)
112
+ return { order: n - 1 };
113
+ if (prev && !next && p !== null)
114
+ return { order: p + 1 };
115
+ if (!prev && !next)
116
+ return { order: 0 };
117
+ // Neighbours without an order: number the list in its shown order, leaving the spec's place free.
118
+ const STEP = 1000;
119
+ const renumber = [];
120
+ siblings.forEach((s, i) => {
121
+ const order = (i < index ? i : i + 1) * STEP;
122
+ if (movable(s) && s.order !== order)
123
+ renumber.push({ id: s.id, order });
124
+ });
125
+ return { renumber, order: index * STEP };
126
+ }
127
+ //# sourceMappingURL=outline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outline.js","sourceRoot":"","sources":["../src/outline.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,wEAAwE;AACxE,MAAM,UAAU,eAAe,CAAC,IAAyD;IACvF,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;AAClE,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,QAAQ,CAAwB,IAAO,EAAE,IAA4B;IACnF,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,WAAW,CAAwB,IAAO,EAAE,I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QAAQ,GAAyC,EAAE,CAAC;IAC1D,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACxB,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;QAC7C,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK;YAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Outside work as action items (documentation/action-items.md "Action
3
+ * sources"): an action source reads the items it holds (Jira issues), and,
4
+ * when its write-back is on, records a resolution made in aigile back where
5
+ * the item lives.
6
+ */
7
+ export interface ExternalAction {
8
+ /** The item's key there ("WF-123"). */
9
+ key: string;
10
+ url: string | null;
11
+ title: string;
12
+ summary: string;
13
+ /** Its status there ("In Progress"). */
14
+ status: string;
15
+ /** Done there (Jira's done status category). */
16
+ done: boolean;
17
+ /** Keys of the items it waits on (Jira's "is blocked by" links). */
18
+ blockedByKeys: string[];
19
+ /** Keys a feature may link to: its own, its parent's (an epic). */
20
+ featureKeys: string[];
21
+ updatedAt: string;
22
+ }
23
+ export interface ActionSource {
24
+ readonly id: string;
25
+ readonly kind: string;
26
+ /** The action type its items become. */
27
+ readonly type: string;
28
+ readonly projectId: string | null;
29
+ /** The agent its items are for ("engineer"); they arrive held until a person queues them. Null: nobody until someone takes them. */
30
+ readonly agentKey: string | null;
31
+ /** Whether a resolution made in aigile is written back. */
32
+ readonly writesBack: boolean;
33
+ init(): Promise<void>;
34
+ /** Every item the source holds now. */
35
+ pull(): Promise<ExternalAction[]>;
36
+ /** Record a resolution made in aigile (only called when `writesBack`); `context.url` links the item in aigile when the workspace's address is known. */
37
+ resolve(key: string, note: string, context?: ResolveContext): Promise<void>;
38
+ }
39
+ /** What a write-back may say besides the resolution's note. */
40
+ export interface ResolveContext {
41
+ /** The item in aigile (`publicUrl`), or null when the address is not configured. */
42
+ url: string | null;
43
+ }
44
+ //# sourceMappingURL=action-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-source.d.ts","sourceRoot":"","sources":["../../src/plugins/action-source.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,oEAAoE;IACpE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,mEAAmE;IACnE,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oIAAoI;IACpI,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,uCAAuC;IACvC,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAClC,wJAAwJ;IACxJ,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7E;AAED,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=action-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-source.js","sourceRoot":"","sources":["../../src/plugins/action-source.ts"],"names":[],"mappings":""}
@@ -60,6 +60,11 @@ export interface AiProvider {
60
60
  export interface AiToolResult {
61
61
  output: string;
62
62
  isError?: boolean;
63
+ /** Images the model should see with the output (a design to compare against, a screenshot), base64. */
64
+ images?: Array<{
65
+ mediaType: 'image/png' | 'image/jpeg';
66
+ data: string;
67
+ }>;
63
68
  }
64
69
  /** A tool of the caller's own: a name, what it does, a JSON Schema for its input, and the function. */
65
70
  export interface AiCustomTool {
@@ -1 +1 @@
1
- {"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/plugins/ai.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,UAAU,oDAAqD,CAAC;AAC7E,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAA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AE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACvE,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,cAAc,CAAC;IACtB,uFAAuF;IACvF,YAAY,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC5G;AAED,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,KAAK,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * File storage (documentation/plugins.md "File storage"): where kept files
3
+ * live outside the datastore, by content. A blob store keeps bytes under
4
+ * their sha256 (hex), so the same file is kept once; the datastore records
5
+ * only the hash and where it went. The first user is attachment originals
6
+ * (documentation/sources.md "Links and attachments"); exactly one blob store
7
+ * instance is used.
8
+ */
9
+ /** What a blob store knows of one kept file. */
10
+ export interface BlobStat {
11
+ hash: string;
12
+ size: number;
13
+ mediaType: string | null;
14
+ /** Where it is, as the store names it (`s3://bucket/prefix/ab/abcd…`), for records and messages. */
15
+ location: string;
16
+ }
17
+ export interface BlobStore {
18
+ readonly id: string;
19
+ readonly kind: string;
20
+ /** Keep the bytes under their hash; refused when the bytes do not hash to it. Keeping the same hash again is harmless. */
21
+ put(hash: string, bytes: Uint8Array, mediaType: string | null): Promise<{
22
+ location: string;
23
+ }>;
24
+ /** The bytes kept under the hash, or null when none are. */
25
+ get(hash: string): Promise<{
26
+ bytes: Buffer;
27
+ mediaType: string | null;
28
+ } | null>;
29
+ has(hash: string): Promise<boolean>;
30
+ /** Forget the bytes; nothing happens when none are kept. */
31
+ delete(hash: string): Promise<void>;
32
+ stat(hash: string): Promise<BlobStat | null>;
33
+ }
34
+ /** A sha256 in hex, the only key a blob store takes. */
35
+ export declare const BLOB_HASH: RegExp;
36
+ //# sourceMappingURL=blob-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob-store.d.ts","sourceRoot":"","sources":["../../src/plugins/blob-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gDAAgD;AAChD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,oGAAoG;IACpG,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0HAA0H;IAC1H,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9F,4DAA4D;IAC5D,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IAC/E,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,4DAA4D;IAC5D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CAC9C;AAED,wDAAwD;AACxD,eAAO,MAAM,SAAS,QAAmB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * File storage (documentation/plugins.md "File storage"): where kept files
3
+ * live outside the datastore, by content. A blob store keeps bytes under
4
+ * their sha256 (hex), so the same file is kept once; the datastore records
5
+ * only the hash and where it went. The first user is attachment originals
6
+ * (documentation/sources.md "Links and attachments"); exactly one blob store
7
+ * instance is used.
8
+ */
9
+ /** A sha256 in hex, the only key a blob store takes. */
10
+ export const BLOB_HASH = /^[a-f0-9]{64}$/;
11
+ //# sourceMappingURL=blob-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob-store.js","sourceRoot":"","sources":["../../src/plugins/blob-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAwBH,wDAAwD;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC"}
@@ -45,6 +45,12 @@ export interface DataStore {
45
45
  delete(collection: string, id: string, opts?: WriteOptions): Promise<void>;
46
46
  /** Revision history for a single entity, newest first. */
47
47
  history(collection: string, id: string): Promise<RevisionMeta[]>;
48
+ /**
49
+ * Take the remote's changes (a push from another aigile, a hand edit): true
50
+ * when something arrived. Stores without a remote, or without the notion,
51
+ * leave it out; the caller treats that as nothing to do.
52
+ */
53
+ pull?(): Promise<boolean>;
48
54
  /** Fetch an entity's value as of a specific revision. */
49
55
  getAtRevision<T>(collection: string, id: string, revision: string): Promise<T | null>;
50
56
  /** Release any held resources. */
@@ -1 +1 @@
1
- {"version":3,"file":"datastore.d.ts","sourceRoot":"","sources":["../../src/plugins/datastore.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,YAAY;IAC3B,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,2EAA2E;IAC3E,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB,+DAA+D;IAC/D,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAE1D,gFAAgF;IAChF,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAE1C,4DAA4D;IAC5D,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE/C,mEAAmE;IACnE,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EA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AAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAE1D,gFAAgF;IAChF,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAE1C,4DAA4D;IAC5D,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE/C,mEAAmE;IACnE,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAE5F,6EAA6E;IAC7E,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3E,0DAA0D;IAC1D,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAEjE;;;;OAIG;IACH,IAAI,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1B,yDAAyD;IACzD,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAEtF,kCAAkC;IAClC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Designs (documentation/designs.md): a design source finds links to its
3
+ * designs in text (a spec's content, wherever the spec came from) and renders
4
+ * one as an image for people and agents to compare with what was built. Figma
5
+ * is the first (`@aigile/design-figma`); nothing outside the plugin knows a
6
+ * Figma URL.
7
+ */
8
+ export interface DesignLink {
9
+ /** The design source that recognised it. */
10
+ sourceId: string;
11
+ url: string;
12
+ /** The file it is in, as the source names it. */
13
+ fileKey: string;
14
+ /** The frame or node, when the link names one. */
15
+ nodeId: string | null;
16
+ /** What to call it before its name is known ("Figma: Editor"). */
17
+ label: string;
18
+ }
19
+ export interface DesignImage {
20
+ mediaType: 'image/png' | 'image/jpeg';
21
+ /** The image, base64. */
22
+ data: string;
23
+ /** Its name in the source ("Revision marks / Desktop"). */
24
+ name: string | null;
25
+ }
26
+ /** How much of a design an outline covers (documentation/designs.md "Outline"). */
27
+ export interface DesignInspectOptions {
28
+ /** A node inside the linked design to outline instead (one an earlier outline cut short). */
29
+ nodeId?: string;
30
+ /** Characters at most (the source's configured cap when omitted). */
31
+ maxChars?: number;
32
+ /** Levels of nesting at most below the node. */
33
+ maxDepth?: number;
34
+ }
35
+ /** One exported asset (an icon or vector), as text. */
36
+ export interface DesignAsset {
37
+ mediaType: 'image/svg+xml';
38
+ /** The SVG markup. */
39
+ svg: string;
40
+ /** Its name in the source. */
41
+ name: string | null;
42
+ }
43
+ export interface DesignSource {
44
+ readonly id: string;
45
+ readonly kind: string;
46
+ /** Every link to one of its designs in this text, once each. */
47
+ find(text: string): DesignLink[];
48
+ /** Why it cannot render now (no token), or null. Finding links works regardless. */
49
+ unavailable(): string | null;
50
+ /** The design (the frame the link names, else the file's first page) as an image. */
51
+ render(link: DesignLink): Promise<DesignImage>;
52
+ /**
53
+ * The design as a text outline an engineer can build from, parsed by code:
54
+ * layers and nesting, layout, sizes, text and type, colours, radii,
55
+ * effects, components and variables, and the exportable assets with their
56
+ * ids. Optional: a source without it is seen only as an image.
57
+ */
58
+ inspect?(link: DesignLink, options?: DesignInspectOptions): Promise<string>;
59
+ /** One node of the design (an icon, a vector) as SVG. Optional, like inspect. */
60
+ exportAsset?(link: DesignLink, nodeId: string): Promise<DesignAsset>;
61
+ }
62
+ //# sourceMappingURL=design.d.ts.map
@@ -0,0 +1 @@
1
+ {"version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ACH,OAAO,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5E,iFAAiF;IACjF,WAAW,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACtE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=design.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design.js","sourceRoot":"","sources":["../../src/plugins/design.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Git hosts (documentation/plugins.md): where a build's branch becomes a pull
3
+ * request, and how aigile learns it was merged. Bitbucket, GitHub and GitLab
4
+ * are built in; an installation may add another.
5
+ */
6
+ export interface GitRemote {
7
+ /** The provider's kind ("bitbucket"). */
8
+ host: string;
9
+ /** The repository's owner (workspace, organization, group path). */
10
+ owner: string;
11
+ repo: string;
12
+ /** The host name the remote lives on (a self-hosted GitLab keeps its own API). */
13
+ hostName?: string;
14
+ }
15
+ export interface PullRequestInput {
16
+ title: string;
17
+ body: string;
18
+ source: string;
19
+ target: string;
20
+ }
21
+ export interface OpenedPullRequest {
22
+ url: string;
23
+ number: number | null;
24
+ }
25
+ export type PullRequestStatus = 'open' | 'merged' | 'declined';
26
+ export interface GitHostProvider {
27
+ readonly kind: string;
28
+ /** The environment variable this instance's token is read from (AIGILE_BITBUCKET_TOKEN unless the instance names another). */
29
+ readonly tokenEnv: string;
30
+ /** The remote this URL names on this host, or null when it is another host's. */
31
+ parse(url: string): GitRemote | null;
32
+ openPullRequest(remote: GitRemote, input: PullRequestInput, token: string): Promise<OpenedPullRequest>;
33
+ pullRequestState(remote: GitRemote, number: number, token: string): Promise<PullRequestStatus>;
34
+ }
35
+ //# sourceMappingURL=git-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-host.d.ts","sourceRoot":"","sources":["../../src/plugins/git-host.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8HAA8H;IAC9H,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACvG,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAChG"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=git-host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-host.js","sourceRoot":"","sources":["../../src/plugins/git-host.ts"],"names":[],"mappings":""}
@@ -1,4 +1,13 @@
1
1
  export * from './datastore.js';
2
2
  export * from './auth.js';
3
3
  export * from './ai.js';
4
+ export * from './spec-source.js';
5
+ export * from './spec-cache.js';
6
+ export * from './action-source.js';
7
+ export * from './design.js';
8
+ export * from './registry.js';
9
+ export * from './test-runner.js';
10
+ export * from './git-host.js';
11
+ export * from './release-gate.js';
12
+ export * from './blob-store.js';
4
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -1,4 +1,13 @@
1
1
  export * from './datastore.js';
2
2
  export * from './auth.js';
3
3
  export * from './ai.js';
4
+ export * from './spec-source.js';
5
+ export * from './spec-cache.js';
6
+ export * from './action-source.js';
7
+ export * from './design.js';
8
+ export * from './registry.js';
9
+ export * from './test-runner.js';
10
+ export * from './git-host.js';
11
+ export * from './release-gate.js';
12
+ export * from './blob-store.js';
4
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}