@aigile/core 0.2.1 → 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,53 @@
1
+ /**
2
+ * Release gates (documentation/plugins.md "Release gates"): whether a release
3
+ * may move to an environment now (a release calendar's windows and blackout
4
+ * dates). The Release Manager asks every configured gate before a phase's go;
5
+ * a gate that holds refuses the go with its reason, and a person may override
6
+ * it with an explicit action that is recorded.
7
+ */
8
+ export interface ReleaseGateQuery {
9
+ /** The environment the release would go to ("prod"). */
10
+ environment: string;
11
+ /** When it would go. */
12
+ at: Date;
13
+ /** The release asking, when the Release Manager asks (a gate about the release, not the time, needs it: approvals, a change freeze on its projects). */
14
+ release?: ReleaseGateSubject;
15
+ }
16
+ /** What a gate is told of a release. */
17
+ export interface ReleaseGateSubject {
18
+ id: string;
19
+ number: number;
20
+ name: string;
21
+ /** The projects its builds belong to. */
22
+ projectIds: string[];
23
+ /** Its phases' environments, in order. */
24
+ environments: string[];
25
+ cutAt: string;
26
+ /** Who cut it (a user id), when a person did. */
27
+ requestedBy: string | null;
28
+ /** Its notes (Markdown), as the Release Manager wrote them; a change request is described from them and may be named in them (CHG0031234). */
29
+ notes?: string;
30
+ /** The builds it carries: their project, branch and commit. */
31
+ builds?: ReleaseGateBuild[];
32
+ }
33
+ /** One build a release carries, as a gate is told of it. */
34
+ export interface ReleaseGateBuild {
35
+ id: string;
36
+ projectId: string;
37
+ branch: string | null;
38
+ commit: string | null;
39
+ }
40
+ export interface ReleaseGateDecision {
41
+ /** May proceed; false: held. */
42
+ allowed: boolean;
43
+ /** Why, in one line ("outside the release windows (Mon–Thu 09:00–16:00 America/Los_Angeles); next opens Tue 2 Dec 09:00"). */
44
+ reason: string;
45
+ }
46
+ export interface ReleaseGate {
47
+ readonly id: string;
48
+ readonly kind: string;
49
+ check(query: ReleaseGateQuery): Promise<ReleaseGateDecision>;
50
+ /** Told when a release is cut, before any go (release approvals open their requests then); a failure is logged on the release, never stops the cut. */
51
+ cut?(release: ReleaseGateSubject): Promise<void>;
52
+ }
53
+ //# sourceMappingURL=release-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-gate.d.ts","sourceRoot":"","sources":["../../src/plugins/release-gate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,EAAE,EAAE,IAAI,CAAC;IACT,wJAAwJ;IACxJ,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,8IAA8I;IAC9I,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,8HAA8H;IAC9H,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC7D,uJAAuJ;IACvJ,GAAG,CAAC,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=release-gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-gate.js","sourceRoot":"","sources":["../../src/plugins/release-gate.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * SpecCache plugin contract: where aigile keeps the spec versions it has
3
+ * read from the sources, and nothing it cannot read again. The sources are
4
+ * the truth and keep the history (documentation/sources.md "The model"); a
5
+ * cache may lose any entry at any time and aigile re-reads from the source.
6
+ * A plain key-value store: memory for a laptop, a directory for a volume
7
+ * (EFS, a PVC), redis for a cluster, or the datastore itself so one
8
+ * configuration serves both. Keys are `kind:sourceId:externalId:version`
9
+ * and the like; values are JSON.
10
+ */
11
+ export interface SpecCache {
12
+ readonly id: string;
13
+ init(): Promise<void>;
14
+ get<T>(key: string): Promise<T | null>;
15
+ set<T>(key: string, value: T): Promise<void>;
16
+ delete(key: string): Promise<void>;
17
+ /** The keys under a prefix, in no particular order. */
18
+ keys(prefix: string): Promise<string[]>;
19
+ /** Drop everything under a prefix (everything when none). */
20
+ clear(prefix?: string): Promise<void>;
21
+ close(): Promise<void>;
22
+ }
23
+ //# sourceMappingURL=spec-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-cache.d.ts","sourceRoot":"","sources":["../../src/plugins/spec-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACvC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,uDAAuD;IACvD,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,6DAA6D;IAC7D,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=spec-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-cache.js","sourceRoot":"","sources":["../../src/plugins/spec-cache.ts"],"names":[],"mappings":""}
@@ -0,0 +1,177 @@
1
+ /**
2
+ * SpecSource plugin contract: a place outside aigile where specs are written
3
+ * (a Git repository of Markdown, a wiki, a document store), mirrored into the
4
+ * datastore as specs that carry their provenance (`Spec.source`). Git stays
5
+ * the source of truth and the history: every mirrored change is a revision of
6
+ * the spec in the datastore, reviewed by the Spec Analyst and resolved for
7
+ * builds like any other. A mirrored spec is read-only in aigile apart from its
8
+ * mappings; it is edited where it came from.
9
+ *
10
+ * `changes(cursor)` is incremental: the cursor the adapter returned last time
11
+ * comes back on the next call, and `null` means "everything" (first sync, or
12
+ * a reset). When the adapter cannot tell what changed since the cursor it
13
+ * returns `full: true` with every item, and the sync removes the mirrored
14
+ * specs that are no longer there.
15
+ */
16
+ import type { ReferenceTarget, SourceAttachment, SourceReference } from '../domain/reference.js';
17
+ export interface SourceAuthor {
18
+ name: string;
19
+ /** Matched to a user by email when known; the write is then recorded for that person. */
20
+ email: string | null;
21
+ }
22
+ export interface SourceMappings {
23
+ organizationIds?: string[];
24
+ projectIds?: string[];
25
+ roleIds?: string[];
26
+ }
27
+ export interface SourceItem {
28
+ /** The adapter's stable identifier for the document (a path, a page id); the key the mirror is matched on. */
29
+ externalId: string;
30
+ title: string;
31
+ /** Markdown. */
32
+ content: string;
33
+ author: SourceAuthor | null;
34
+ /** The document's version at the source (a commit sha, a page version); the mirror is rewritten only when this changes. */
35
+ version: string;
36
+ /** When this version was written at the source (ISO-8601). */
37
+ updatedAt: string;
38
+ /** Where to read or edit the document at the source, when it has a web address. */
39
+ url: string | null;
40
+ /**
41
+ * The mappings the document asks for (its front matter, its labels). `null`
42
+ * keeps what aigile has: the source's defaults for a new spec, and whatever
43
+ * a person set in aigile since for an existing one.
44
+ */
45
+ mappings: SourceMappings | null;
46
+ /**
47
+ * The document it sits under at the source (a page's parent page or
48
+ * folder, a folder's index file), as that document's external id; null for
49
+ * a top document; left out by a source that has no outline, which keeps
50
+ * whatever parent the spec has (documentation/sources.md "Outlines").
51
+ */
52
+ parentExternalId?: string | null;
53
+ /** Its place among its siblings at the source (a page's position); left out to keep what the spec has. */
54
+ order?: number | null;
55
+ /** Facts the source keeps about it, kept on the spec's provenance (a Jira issue's type, status and feature flag). */
56
+ meta?: Record<string, string>;
57
+ /**
58
+ * What the document points at (other pages, issues, web addresses, files;
59
+ * documentation/sources.md "Links and attachments"). Left out by a source
60
+ * that does not report them, which keeps what the spec has.
61
+ */
62
+ references?: SourceReference[];
63
+ /** Every file attached to the document at the source; left out to keep what the spec has. */
64
+ attachments?: SourceAttachment[];
65
+ /** The document in the terms references use (its space and title, its key), so references from other documents find it. */
66
+ self?: ReferenceTarget;
67
+ }
68
+ /** An attachment's bytes as the source served them. */
69
+ export interface SourceAttachmentContent {
70
+ bytes: Uint8Array;
71
+ /** The media type the source served, when it said. */
72
+ mediaType: string | null;
73
+ }
74
+ export interface SourceChanges {
75
+ items: SourceItem[];
76
+ /** Documents gone from the source since the cursor (external ids); unused when `full`. */
77
+ removed: string[];
78
+ /** When true `items` is the whole source, and anything mirrored that is missing from it was removed. */
79
+ full: boolean;
80
+ /** What to hand back next time; `null` when the adapter keeps no position. */
81
+ cursor: string | null;
82
+ }
83
+ /** One version of a document at the source, newest first in a list. */
84
+ export interface SourceVersion {
85
+ version: string;
86
+ timestamp: string;
87
+ author: SourceAuthor | null;
88
+ message: string;
89
+ }
90
+ /** What a save sends to a writable source. */
91
+ export interface SourceWrite {
92
+ /** The document to replace, or null to create one (the adapter chooses where from the title). */
93
+ externalId: string | null;
94
+ title: string;
95
+ content: string;
96
+ /** The version the edit was based on; a source that can tell refuses a save over a newer version. */
97
+ baseVersion: string | null;
98
+ author: SourceAuthor | null;
99
+ message: string;
100
+ /** Remove the document instead of writing it (`externalId` required). */
101
+ remove?: boolean;
102
+ }
103
+ export interface SourceWriteResult {
104
+ externalId: string;
105
+ /** The version the save produced; for a removal, the version of the change that removed it. */
106
+ version: string;
107
+ url: string | null;
108
+ }
109
+ export interface SourceCapabilities {
110
+ /** The source serves any past version it reported (`read` with a version, `versions`). */
111
+ history: boolean;
112
+ /** The source takes saves (`write`). */
113
+ write: boolean;
114
+ /** The source moves a document in its own outline (`move`): a page under another, before or after a sibling. */
115
+ move?: boolean;
116
+ }
117
+ /** Where `move` puts a document: before or after a sibling (under the same parent), or as the last child of the target. */
118
+ export type SourceMovePosition = 'before' | 'after' | 'append';
119
+ /**
120
+ * A source of truth for specs. `changes` is the sync; `read` and `versions`
121
+ * serve the history (a source without them is read through the cache alone);
122
+ * `write` takes a save from the workspace.
123
+ */
124
+ export interface SpecSource {
125
+ /**
126
+ * Where the source's documents apply when they do not say (the source's
127
+ * `organizationIds` and `projectIds` in the config). The sync puts them on
128
+ * the source's top documents only; the rest inherit through the outline.
129
+ */
130
+ defaults?: SourceMappings;
131
+ /**
132
+ * The spec the source's top documents sit under (its config `under`: a
133
+ * document of another source, such as a Confluence page): they inherit its
134
+ * placement instead of the defaults.
135
+ */
136
+ anchor?: {
137
+ sourceId: string;
138
+ externalId: string;
139
+ } | {
140
+ specId: string;
141
+ };
142
+ /** Unique within the installation; part of every mirrored spec's provenance. */
143
+ readonly id: string;
144
+ /** The adapter kind (`git`, `confluence`, …). */
145
+ readonly kind: string;
146
+ readonly capabilities: SourceCapabilities;
147
+ /** Prepare the source (a clone, a connection test). Idempotent. */
148
+ init(): Promise<void>;
149
+ /** What changed since `cursor` (everything when `null`). */
150
+ changes(cursor: string | null): Promise<SourceChanges>;
151
+ /** One document at a version (the current one when omitted); null when the source has no such version. */
152
+ read?(externalId: string, version?: string): Promise<SourceItem | null>;
153
+ /** Move a document in the source's outline, relative to another of its documents (documentation/sources.md "Outlines"). */
154
+ move?(externalId: string, position: SourceMovePosition, targetExternalId: string): Promise<void>;
155
+ /** The document's versions, newest first. */
156
+ versions?(externalId: string): Promise<SourceVersion[]>;
157
+ /** Save a document; the version the source gave it comes back. */
158
+ write?(doc: SourceWrite): Promise<SourceWriteResult>;
159
+ /**
160
+ * Download a file attached to one of the source's documents through the
161
+ * source's own credentials (documentation/sources.md "Links and
162
+ * attachments"). A source without it has its attachments kept as metadata.
163
+ */
164
+ fetchAttachment?(documentExternalId: string, attachment: SourceAttachment): Promise<SourceAttachmentContent>;
165
+ /** Save several documents as one change (one commit) under one message; results in the docs' order. */
166
+ writeMany?(docs: SourceWrite[], message: string, author: SourceAuthor | null): Promise<SourceWriteResult[]>;
167
+ }
168
+ /** The capabilities of a source that only syncs. */
169
+ export declare const SYNC_ONLY: SourceCapabilities;
170
+ /** A conflict on save: the source moved past the version the edit was based on. */
171
+ export declare class SourceConflictError extends Error {
172
+ readonly externalId: string;
173
+ readonly baseVersion: string | null;
174
+ readonly currentVersion: string;
175
+ constructor(externalId: string, baseVersion: string | null, currentVersion: string);
176
+ }
177
+ //# sourceMappingURL=spec-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-source.d.ts","sourceRoot":"","sources":["../../src/plugins/spec-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;A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,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;CAC7G;AAED,oDAAoD;AACpD,eAAO,MAAM,SAAS,EAAE,kBAAqD,CAAC;AAE9E,mFAAmF;AACnF,qBAAa,mBAAoB,SAAQ,KAAK;IAE1C,QAAQ,CAAC,UAAU,EAAE,MAAM;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM;gBAFtB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,cAAc,EAAE,MAAM;CAKlC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * SpecSource plugin contract: a place outside aigile where specs are written
3
+ * (a Git repository of Markdown, a wiki, a document store), mirrored into the
4
+ * datastore as specs that carry their provenance (`Spec.source`). Git stays
5
+ * the source of truth and the history: every mirrored change is a revision of
6
+ * the spec in the datastore, reviewed by the Spec Analyst and resolved for
7
+ * builds like any other. A mirrored spec is read-only in aigile apart from its
8
+ * mappings; it is edited where it came from.
9
+ *
10
+ * `changes(cursor)` is incremental: the cursor the adapter returned last time
11
+ * comes back on the next call, and `null` means "everything" (first sync, or
12
+ * a reset). When the adapter cannot tell what changed since the cursor it
13
+ * returns `full: true` with every item, and the sync removes the mirrored
14
+ * specs that are no longer there.
15
+ */
16
+ /** The capabilities of a source that only syncs. */
17
+ export const SYNC_ONLY = { history: false, write: false };
18
+ /** A conflict on save: the source moved past the version the edit was based on. */
19
+ export class SourceConflictError extends Error {
20
+ externalId;
21
+ baseVersion;
22
+ currentVersion;
23
+ constructor(externalId, baseVersion, currentVersion) {
24
+ super(`the document moved at the source (now at ${currentVersion.slice(0, 12)}, the edit was based on ${baseVersion?.slice(0, 12) ?? 'nothing'})`);
25
+ this.externalId = externalId;
26
+ this.baseVersion = baseVersion;
27
+ this.currentVersion = currentVersion;
28
+ this.name = 'SourceConflictError';
29
+ }
30
+ }
31
+ //# sourceMappingURL=spec-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-source.js","sourceRoot":"","sources":["../../src/plugins/spec-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiKH,oDAAoD;AACpD,MAAM,CAAC,MAAM,SAAS,GAAuB,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAE9E,mFAAmF;AACnF,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAEjC;IACA;IACA;IAHX,YACW,UAAkB,EAClB,WAA0B,EAC1B,cAAsB;QAE/B,KAAK,CAAC,4CAA4C,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,2BAA2B,WAAW,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC;QAJ1I,eAAU,GAAV,UAAU,CAAQ;QAClB,gBAAW,GAAX,WAAW,CAAe;QAC1B,mBAAc,GAAd,cAAc,CAAQ;QAG/B,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Running testers' tests (documentation/tests.md, plugins.md "Test runners"): a
3
+ * test runner plugin runs one test file in a checkout against an environment,
4
+ * reporting each step as it happens. Playwright is the first
5
+ * (`@aigile/tests-playwright`).
6
+ *
7
+ * The kind stays here, in the platform, as a neutral extension point: a plugin
8
+ * package depends only on `@aigile/core`, the plugin registry types its kinds
9
+ * here, and any template may drive a runner. What uses it (test cases, their
10
+ * runs, the Tests window, the Verifier writing a test from a tester's steps) is
11
+ * the software template's (`@aigile/template-software`).
12
+ */
13
+ /** One step's outcome in a run. */
14
+ export interface TestStepResult {
15
+ title: string;
16
+ status: 'passed' | 'failed' | 'skipped';
17
+ durationMs: number;
18
+ error: string | null;
19
+ }
20
+ export type TestStepEvent = {
21
+ kind: 'step-begin';
22
+ title: string;
23
+ depth: number;
24
+ } | {
25
+ kind: 'step-end';
26
+ title: string;
27
+ depth: number;
28
+ durationMs: number;
29
+ error: string | null;
30
+ };
31
+ export interface TestRunOptions {
32
+ /** The test repository's checkout. */
33
+ checkoutDir: string;
34
+ /** The test file, relative to the checkout. */
35
+ file: string;
36
+ /** The environment it runs against (qa), given to the run in `environmentVar`. */
37
+ environment: string;
38
+ environmentVar: string;
39
+ /** The sign-in values the run gets (name → value), resolved by aigile for the environment; the runner redacts them from what it returns. */
40
+ secrets: Record<string, string>;
41
+ /** The environment the run's process starts from: a few safe variables, never aigile's secrets. */
42
+ baseEnv: NodeJS.ProcessEnv;
43
+ /** Where the run keeps its trace and screenshot. */
44
+ outDir: string;
45
+ onStep?: (event: TestStepEvent) => void;
46
+ /** A browser server to run in (the live view's), instead of launching one. */
47
+ wsEndpoint?: string;
48
+ timeoutMs?: number;
49
+ }
50
+ export interface TestRunResult {
51
+ status: 'passed' | 'failed' | 'error';
52
+ durationMs: number;
53
+ /** The top-level steps, in order. */
54
+ steps: TestStepResult[];
55
+ error: string | null;
56
+ trace: boolean;
57
+ screenshot: boolean;
58
+ /** The run's own output (redacted), its last lines, for when it could not run at all. */
59
+ output: string;
60
+ }
61
+ export interface TestRunner {
62
+ readonly id: string;
63
+ readonly kind: string;
64
+ /** Ready the checkout once its packages are installed (download the browser its own version expects). */
65
+ prepare(checkoutDir: string, baseEnv: NodeJS.ProcessEnv): Promise<void>;
66
+ run(options: TestRunOptions): Promise<TestRunResult>;
67
+ }
68
+ //# sourceMappingURL=test-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-runner.d.ts","sourceRoot":"","sources":["../../src/plugins/test-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE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AAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yGAAyG;IACzG,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,GAAG,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACtD"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Running testers' tests (documentation/tests.md, plugins.md "Test runners"): a
3
+ * test runner plugin runs one test file in a checkout against an environment,
4
+ * reporting each step as it happens. Playwright is the first
5
+ * (`@aigile/tests-playwright`).
6
+ *
7
+ * The kind stays here, in the platform, as a neutral extension point: a plugin
8
+ * package depends only on `@aigile/core`, the plugin registry types its kinds
9
+ * here, and any template may drive a runner. What uses it (test cases, their
10
+ * runs, the Tests window, the Verifier writing a test from a tester's steps) is
11
+ * the software template's (`@aigile/template-software`).
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=test-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-runner.js","sourceRoot":"","sources":["../../src/plugins/test-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The Preamble (documentation/agents.md §6): what aigile is, what it is for
3
+ * and how its agents work, opening every agent's prompt before the
4
+ * organization's Charter and the agent's own brief. It ships with the
5
+ * package and is never editable in an installation. `prompts/preamble.md`
6
+ * is the text, with `{{MISSION}}` standing for `prompts/mission.md` (which
7
+ * `documentation/mission.md` links to), both Markdown a person edits.
8
+ */
9
+ export declare const MISSION: string;
10
+ export declare const PREAMBLE: string;
11
+ //# sourceMappingURL=preamble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preamble.d.ts","sourceRoot":"","sources":["../src/preamble.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,QAAsG,CAAC;AAE3H,eAAO,MAAM,QAAQ,QAAwF,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { readPrompt } from './prompts.js';
2
+ /**
3
+ * The Preamble (documentation/agents.md §6): what aigile is, what it is for
4
+ * and how its agents work, opening every agent's prompt before the
5
+ * organization's Charter and the agent's own brief. It ships with the
6
+ * package and is never editable in an installation. `prompts/preamble.md`
7
+ * is the text, with `{{MISSION}}` standing for `prompts/mission.md` (which
8
+ * `documentation/mission.md` links to), both Markdown a person edits.
9
+ */
10
+ export const MISSION = readPrompt(import.meta.url, '../prompts/mission.md').replace(/^\s*\*{3}\s*Mission\s*\*{3}\s*/i, '');
11
+ export const PREAMBLE = readPrompt(import.meta.url, '../prompts/preamble.md').replace('{{MISSION}}', MISSION);
12
+ //# sourceMappingURL=preamble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preamble.js","sourceRoot":"","sources":["../src/preamble.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC,OAAO,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;AAE3H,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,wBAAwB,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A built-in prompt from a package's `prompts/` folder (documentation/agents.md
3
+ * §6): the Preamble, each agent's contract and default brief, each human
4
+ * seat's brief, all Markdown a person edits in the repository and the
5
+ * package ships. Read once at module load, relative to the calling module.
6
+ */
7
+ export declare function readPrompt(metaUrl: string, relative: string): string;
8
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpE"}
@@ -0,0 +1,13 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ /**
5
+ * A built-in prompt from a package's `prompts/` folder (documentation/agents.md
6
+ * §6): the Preamble, each agent's contract and default brief, each human
7
+ * seat's brief, all Markdown a person edits in the repository and the
8
+ * package ships. Read once at module load, relative to the calling module.
9
+ */
10
+ export function readPrompt(metaUrl, relative) {
11
+ return readFileSync(join(dirname(fileURLToPath(metaUrl)), relative), 'utf8').replace(/\s+$/, '');
12
+ }
13
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,QAAgB;IAC1D,OAAO,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACnG,CAAC"}
@@ -0,0 +1,90 @@
1
+ import type { AppConfig } from './config.js';
2
+ /**
3
+ * The installation's settings as people see them (documentation/settings.md):
4
+ * each with what it does, where it lives in the JSON config, the environment
5
+ * variable that sets it, and whether owners may change it in the Settings
6
+ * window. A value comes from, in order: the default, the config file, the
7
+ * Settings window (kept in the datastore), the environment. The environment
8
+ * always wins, so a deployment can pin a value. Secrets are never stored or
9
+ * shown: they come from the environment (or a configuration source), and the
10
+ * window says only whether each is set.
11
+ */
12
+ export interface SettingDefinition {
13
+ /** Its path in the JSON config ("ai.monthlyCostCapUsd"; a template's: "templateSettings.software.dir"). */
14
+ path: string;
15
+ /** Where the value lived before (a template's setting that was a platform one: "tests.dir"): a stored value or the file's value there still counts. */
16
+ legacyPath?: string;
17
+ group: string;
18
+ label: string;
19
+ description: string;
20
+ /** The environment variable that sets it, if one does. */
21
+ env: string | null;
22
+ kind: 'string' | 'number' | 'boolean' | 'list' | 'select' | 'secret';
23
+ options?: readonly string[];
24
+ /** Owners may change it in the Settings window (plain, and not needed before the datastore opens). */
25
+ editable: boolean;
26
+ /** A change takes effect after a restart (a value read once at start). */
27
+ restart?: boolean;
28
+ }
29
+ export declare const SETTINGS: readonly SettingDefinition[];
30
+ /** The value at a dotted path, or undefined. */
31
+ export declare function getPath(value: unknown, path: string): unknown;
32
+ /** Set the value at a dotted path, creating objects on the way. */
33
+ export declare function setPath(target: Record<string, unknown>, path: string, value: unknown): void;
34
+ /** What the Settings window keeps in the datastore (collection `settings`, record `installation`): values by path. */
35
+ export interface StoredSettings {
36
+ values: Record<string, unknown>;
37
+ /** Plugin instances added in the window (a template's recommendation, the Plugins window); their secrets still come from the environment. */
38
+ plugins?: Array<{
39
+ plugin: string;
40
+ id: string;
41
+ config?: Record<string, unknown>;
42
+ secrets?: Record<string, string>;
43
+ target?: string | null;
44
+ }>;
45
+ /**
46
+ * Plugin instance ids disabled in the Plugins window: the config file's, the
47
+ * older sections' and default instances (Figma, git hosts, templates,
48
+ * Playwright), which cannot be deleted from the file. Not started while
49
+ * listed (`pluginInstancesOf`); enabling one again removes its id.
50
+ */
51
+ disabled?: string[];
52
+ updatedAt: string | null;
53
+ updatedBy: string | null;
54
+ }
55
+ export declare const SETTINGS_COLLECTION = "settings";
56
+ export declare const SETTINGS_RECORD = "installation";
57
+ /**
58
+ * The platform's settings and the installed templates' (documentation/settings.md
59
+ * "Template settings"): `extra` is what the templates contribute
60
+ * (`TemplateModule.settingsCatalog`).
61
+ */
62
+ export declare function settingsCatalog(extra?: readonly SettingDefinition[]): SettingDefinition[];
63
+ /** The setting at a path, or at its older path (a stored `tests.dir` finds `templateSettings.software.dir`). */
64
+ export declare function findSetting(path: string, catalog?: readonly SettingDefinition[]): SettingDefinition | undefined;
65
+ /** The settings a stored value may set: editable, and not pinned by an environment variable that is set. */
66
+ export declare function storableSetting(path: string, env: Record<string, string | undefined>, catalog?: readonly SettingDefinition[]): SettingDefinition | null;
67
+ /**
68
+ * Lay the stored settings over a config, in place (so services holding it see
69
+ * the change): each value that is storable and not pinned by the environment.
70
+ * Values that are not storable are ignored.
71
+ */
72
+ export declare function applyStoredSettings(config: AppConfig, stored: StoredSettings | null, env: Record<string, string | undefined>, catalog?: readonly SettingDefinition[]): string[];
73
+ /** The plugin instance ids disabled in the Plugins window, as applyStoredSettings laid them on the config. */
74
+ export declare function disabledPluginInstances(config: AppConfig): string[];
75
+ /** The stored settings with these instance ids disabled (`disabled`), or enabled again (their ids removed). */
76
+ export declare function withPluginInstancesDisabled(stored: StoredSettings, ids: readonly string[], disabled: boolean): StoredSettings;
77
+ /** Where a setting's value comes from. */
78
+ export type SettingSource = 'default' | 'file' | 'settings' | 'environment';
79
+ /** A setting as the Settings window shows it: its definition, its value (never a secret's) and where that comes from. */
80
+ export interface SettingView extends SettingDefinition {
81
+ value: unknown;
82
+ source: SettingSource;
83
+ /** A secret: whether its variable is set. */
84
+ set?: boolean;
85
+ /** The environment pins it, so it cannot be changed here. */
86
+ pinned: boolean;
87
+ }
88
+ /** Every setting with its effective value and source, from the config in force, the file's raw values, the stored settings and the environment. */
89
+ export declare function viewSettings(config: AppConfig, fileValues: Record<string, unknown>, stored: StoredSettings | null, env: Record<string, string | undefined>, catalog?: readonly SettingDefinition[]): SettingView[];
90
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","s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