@usine/config 0.1.0 → 0.2.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 (82) hide show
  1. package/README.md +22 -4
  2. package/dist/agent.d.ts +23 -0
  3. package/dist/agent.d.ts.map +1 -0
  4. package/dist/agent.js +22 -0
  5. package/dist/agent.js.map +1 -0
  6. package/dist/board.d.ts +31 -0
  7. package/dist/board.d.ts.map +1 -0
  8. package/dist/board.js +32 -0
  9. package/dist/board.js.map +1 -0
  10. package/dist/checks.d.ts +3 -0
  11. package/dist/checks.d.ts.map +1 -0
  12. package/dist/checks.js +3 -0
  13. package/dist/checks.js.map +1 -0
  14. package/dist/factory.d.ts +86 -0
  15. package/dist/factory.d.ts.map +1 -0
  16. package/dist/factory.js +87 -0
  17. package/dist/factory.js.map +1 -0
  18. package/dist/file.d.ts +27 -0
  19. package/dist/file.d.ts.map +1 -0
  20. package/dist/file.js +29 -0
  21. package/dist/file.js.map +1 -0
  22. package/dist/frontmatter.d.ts +2 -2
  23. package/dist/frontmatter.d.ts.map +1 -1
  24. package/dist/frontmatter.js +2 -2
  25. package/dist/frontmatter.js.map +1 -1
  26. package/dist/instance/diagnostics.d.ts +19 -0
  27. package/dist/instance/diagnostics.d.ts.map +1 -0
  28. package/dist/instance/diagnostics.js +22 -0
  29. package/dist/instance/diagnostics.js.map +1 -0
  30. package/dist/instance/instance.d.ts +17 -0
  31. package/dist/instance/instance.d.ts.map +1 -0
  32. package/dist/instance/instance.js +21 -0
  33. package/dist/instance/instance.js.map +1 -0
  34. package/dist/instance/references.d.ts +21 -0
  35. package/dist/instance/references.d.ts.map +1 -0
  36. package/dist/instance/references.js +38 -0
  37. package/dist/instance/references.js.map +1 -0
  38. package/dist/instance-folder.d.ts +5 -4
  39. package/dist/instance-folder.d.ts.map +1 -1
  40. package/dist/instance-folder.js +23 -3
  41. package/dist/instance-folder.js.map +1 -1
  42. package/dist/label.d.ts +22 -0
  43. package/dist/label.d.ts.map +1 -0
  44. package/dist/label.js +25 -0
  45. package/dist/label.js.map +1 -0
  46. package/dist/loop.d.ts +42 -0
  47. package/dist/loop.d.ts.map +1 -0
  48. package/dist/loop.js +36 -0
  49. package/dist/loop.js.map +1 -0
  50. package/dist/parser.d.ts +13 -8
  51. package/dist/parser.d.ts.map +1 -1
  52. package/dist/parser.js +53 -14
  53. package/dist/parser.js.map +1 -1
  54. package/dist/payload-slices.d.ts +8 -7
  55. package/dist/payload-slices.d.ts.map +1 -1
  56. package/dist/payload-slices.js +8 -8
  57. package/dist/payload-slices.js.map +1 -1
  58. package/dist/selector.d.ts +25 -3
  59. package/dist/selector.d.ts.map +1 -1
  60. package/dist/selector.js +14 -2
  61. package/dist/selector.js.map +1 -1
  62. package/dist/trigger.d.ts +37 -0
  63. package/dist/trigger.d.ts.map +1 -0
  64. package/dist/trigger.js +34 -0
  65. package/dist/trigger.js.map +1 -0
  66. package/dist/yaml/document.d.ts +3 -3
  67. package/dist/yaml/document.d.ts.map +1 -1
  68. package/dist/yaml/document.js +3 -3
  69. package/dist/yaml/document.js.map +1 -1
  70. package/dist/yaml/writer.d.ts +5 -3
  71. package/dist/yaml/writer.d.ts.map +1 -1
  72. package/dist/yaml/writer.js +7 -5
  73. package/dist/yaml/writer.js.map +1 -1
  74. package/package.json +54 -6
  75. package/dist/index.d.ts +0 -11
  76. package/dist/index.d.ts.map +0 -1
  77. package/dist/index.js +0 -11
  78. package/dist/index.js.map +0 -1
  79. package/dist/model.d.ts +0 -257
  80. package/dist/model.d.ts.map +0 -1
  81. package/dist/model.js +0 -238
  82. package/dist/model.js.map +0 -1
package/dist/model.d.ts DELETED
@@ -1,257 +0,0 @@
1
- import { Agent as CoreAgent, Repository, Worker as CoreWorker } from "@usine/core";
2
- import { Option, Schema } from "effect";
3
- /** Instance-relative path of one authored file (`usine.yaml`, `loops/x.md`). */
4
- export declare const InstancePath: Schema.brand<Schema.NonEmptyString, "InstancePath">;
5
- export type InstancePath = typeof InstancePath.Type;
6
- export declare const FileStage: Schema.Literals<readonly ["expression", "frontmatter", "read", "reference", "schema", "yaml"]>;
7
- export type FileStage = typeof FileStage.Type;
8
- declare const ConfigFileError_base: Schema.Class<ConfigFileError, Schema.TaggedStruct<"ConfigFileError", {
9
- readonly file: Schema.brand<Schema.NonEmptyString, "InstancePath">;
10
- readonly stage: Schema.Literals<readonly ["expression", "frontmatter", "read", "reference", "schema", "yaml"]>;
11
- readonly expression: Schema.OptionFromOptionalKey<Schema.brand<Schema.String, "ExpressionSource">>;
12
- readonly message: Schema.NonEmptyString;
13
- }>, import("effect/Cause").YieldableError>;
14
- /** One precise, file-owned config failure suitable for quarantine UI. */
15
- export declare class ConfigFileError extends ConfigFileError_base {
16
- }
17
- declare const FactoryConfigError_base: Schema.Class<FactoryConfigError, Schema.TaggedStruct<"FactoryConfigError", {
18
- readonly file: Schema.brand<Schema.NonEmptyString, "InstancePath">;
19
- readonly stage: Schema.Literals<readonly ["expression", "frontmatter", "read", "reference", "schema", "yaml"]>;
20
- readonly message: Schema.NonEmptyString;
21
- }>, import("effect/Cause").YieldableError>;
22
- /** A factory-level failure: the registry/settings boundary could not be loaded. */
23
- export declare class FactoryConfigError extends FactoryConfigError_base {
24
- }
25
- /** Every failure mode this package's parsers and loaders can produce. */
26
- export declare const ConfigError: Schema.Union<readonly [typeof ConfigFileError, typeof FactoryConfigError]>;
27
- export type ConfigError = typeof ConfigError.Type;
28
- export declare const AgentName: Schema.brand<Schema.String, "AgentName">;
29
- export type AgentName = CoreAgent.Name;
30
- export declare const LoopName: Schema.brand<Schema.NonEmptyString, "LoopName">;
31
- export type LoopName = typeof LoopName.Type;
32
- export declare const WorkerName: Schema.brand<Schema.String, "WorkerName">;
33
- export type WorkerName = CoreWorker.Name;
34
- export declare const RepoName: Schema.brand<Schema.String, "RepoName">;
35
- export type RepoName = Repository.Name;
36
- export declare const RegistryTag: Schema.brand<Schema.String, "RegistryTag">;
37
- export type RegistryTag = typeof RegistryTag.Type;
38
- export declare const LaneName: Schema.brand<Schema.String, "LaneName">;
39
- export type LaneName = typeof LaneName.Type;
40
- export declare const GitHubLabelName: Schema.brand<Schema.String, "GitHubLabelName">;
41
- export type GitHubLabelName = typeof GitHubLabelName.Type;
42
- export declare const LaneItemState: Schema.Literals<readonly ["issue-open", "issue-closed", "pr-open", "pr-closed", "pr-merged"]>;
43
- export type LaneItemState = typeof LaneItemState.Type;
44
- declare const LabelLaneSource_base: Schema.Class<LabelLaneSource, Schema.Struct<{
45
- readonly label: Schema.brand<Schema.String, "GitHubLabelName">;
46
- }>, {}>;
47
- export declare class LabelLaneSource extends LabelLaneSource_base {
48
- }
49
- declare const StateLaneSource_base: Schema.Class<StateLaneSource, Schema.Struct<{
50
- readonly state: Schema.Literals<readonly ["issue-open", "issue-closed", "pr-open", "pr-closed", "pr-merged"]>;
51
- }>, {}>;
52
- export declare class StateLaneSource extends StateLaneSource_base {
53
- }
54
- export declare const LaneSource: Schema.Union<readonly [typeof LabelLaneSource, typeof StateLaneSource]>;
55
- export type LaneSource = typeof LaneSource.Type;
56
- declare const Lane_base: Schema.Class<Lane, Schema.Struct<{
57
- readonly name: Schema.brand<Schema.String, "LaneName">;
58
- readonly sources: Schema.$Array<Schema.Union<readonly [typeof LabelLaneSource, typeof StateLaneSource]>>;
59
- }>, {}>;
60
- export declare class Lane extends Lane_base {
61
- }
62
- export declare const ModelId: Schema.brand<Schema.String, "ModelId">;
63
- export type ModelId = CoreAgent.ModelId;
64
- export declare const OperatorLogin: Schema.brand<Schema.String, "OperatorLogin">;
65
- export type OperatorLogin = typeof OperatorLogin.Type;
66
- export declare const PromptTemplate: Schema.brand<Schema.String, "PromptTemplate">;
67
- export type PromptTemplate = typeof PromptTemplate.Type;
68
- export declare const Persona: Schema.brand<Schema.String, "AgentPersona">;
69
- export type Persona = CoreAgent.Persona;
70
- declare const ManagedRepo_base: Schema.Class<ManagedRepo, Schema.Struct<{
71
- readonly name: Schema.brand<Schema.String, "RepoName">;
72
- readonly tags: Schema.withDecodingDefaultKey<Schema.$Array<Schema.brand<Schema.String, "RegistryTag">>, never>;
73
- readonly lanes: Schema.withDecodingDefaultKey<Schema.$Array<typeof Lane>, never>;
74
- }>, {}>;
75
- export declare class ManagedRepo extends ManagedRepo_base {
76
- }
77
- export declare const WorkerKind: Schema.Literals<readonly ["local", "exe.dev"]>;
78
- export type WorkerKind = CoreWorker.Kind;
79
- declare const Worker_base: Schema.Class<Worker, Schema.Struct<{
80
- readonly name: Schema.brand<Schema.String, "WorkerName">;
81
- readonly kind: Schema.Literals<readonly ["local", "exe.dev"]>;
82
- readonly maxConcurrentAttempts: Schema.withDecodingDefaultKey<Schema.Int, never>;
83
- }>, {}>;
84
- export declare class Worker extends Worker_base {
85
- }
86
- declare const Settings_base: Schema.Class<Settings, Schema.Struct<{
87
- readonly pollInterval: Schema.withDecodingDefaultKey<Schema.Int, never>;
88
- readonly maxChildren: Schema.withDecodingDefaultKey<Schema.Int, never>;
89
- readonly maxAttemptMinutes: Schema.withDecodingDefaultKey<Schema.Int, never>;
90
- readonly maxAttemptTokens: Schema.withDecodingDefaultKey<Schema.Int, never>;
91
- readonly parentModel: Schema.OptionFromOptionalKey<Schema.brand<Schema.String, "ModelId">>;
92
- }>, {}>;
93
- export declare class Settings extends Settings_base {
94
- }
95
- export declare const Webhooks: Schema.Union<readonly [Schema.Struct<{
96
- readonly mode: Schema.Literal<"off">;
97
- }>, Schema.Struct<{
98
- readonly mode: Schema.Literal<"deliveries">;
99
- }>, Schema.encodeKeys<Schema.Struct<{
100
- readonly mode: Schema.Literal<"endpoint">;
101
- readonly publicUrl: Schema.URLFromString;
102
- }>, {
103
- readonly publicUrl: "public_url";
104
- }>]>;
105
- export type Webhooks = typeof Webhooks.Type;
106
- declare const UsineConfig_base: Schema.Class<UsineConfig, Schema.Struct<{
107
- readonly version: Schema.Literal<1>;
108
- readonly repos: Schema.$Array<typeof ManagedRepo>;
109
- readonly settings: Schema.withDecodingDefaultKey<Schema.encodeKeys<typeof Settings, {
110
- readonly pollInterval: "poll_interval";
111
- readonly maxChildren: "max_children";
112
- readonly maxAttemptMinutes: "max_attempt_minutes";
113
- readonly maxAttemptTokens: "max_attempt_tokens";
114
- readonly parentModel: "parent_model";
115
- }>, never>;
116
- readonly workers: Schema.withDecodingDefaultKey<Schema.$Array<Schema.encodeKeys<typeof Worker, {
117
- readonly maxConcurrentAttempts: "max_concurrent_attempts";
118
- }>>, never>;
119
- readonly webhooks: Schema.withDecodingDefaultKey<Schema.Union<readonly [Schema.Struct<{
120
- readonly mode: Schema.Literal<"off">;
121
- }>, Schema.Struct<{
122
- readonly mode: Schema.Literal<"deliveries">;
123
- }>, Schema.encodeKeys<Schema.Struct<{
124
- readonly mode: Schema.Literal<"endpoint">;
125
- readonly publicUrl: Schema.URLFromString;
126
- }>, {
127
- readonly publicUrl: "public_url";
128
- }>]>, never>;
129
- readonly operator: Schema.OptionFromOptionalKey<Schema.brand<Schema.String, "OperatorLogin">>;
130
- }>, {}>;
131
- /** Strict, factory-wide authored config from usine.yaml. */
132
- export declare class UsineConfig extends UsineConfig_base {
133
- }
134
- declare const Selector_base: Schema.Class<Selector, Schema.Struct<{
135
- readonly repos: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RepoName">>>;
136
- readonly tags: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RegistryTag">>>;
137
- }>, {}>;
138
- export declare class Selector extends Selector_base {
139
- }
140
- export declare const ValidSelector: Schema.decodeTo<Schema.declareConstructor<Selector, {
141
- readonly repos?: readonly string[];
142
- readonly tags?: readonly string[];
143
- }, readonly [Schema.Struct<{
144
- readonly repos: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RepoName">>>;
145
- readonly tags: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RegistryTag">>>;
146
- }>], {
147
- readonly repos: Schema.OptionIso<Schema.toType<Schema.$Array<Schema.brand<Schema.String, "RepoName">>>>;
148
- readonly tags: Schema.OptionIso<Schema.toType<Schema.$Array<Schema.brand<Schema.String, "RegistryTag">>>>;
149
- }>, Schema.Struct<{
150
- readonly repos: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RepoName">>>;
151
- readonly tags: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RegistryTag">>>;
152
- }>, never, never>;
153
- export declare const Cron: Schema.brand<Schema.String, "Cron">;
154
- export type Cron = typeof Cron.Type;
155
- export declare const TimeZone: Schema.brand<Schema.String, "TimeZone">;
156
- export type TimeZone = typeof TimeZone.Type;
157
- declare const IssueTrigger_base: Schema.Class<IssueTrigger, Schema.Struct<{
158
- readonly on: Schema.Literal<"issue">;
159
- readonly if: Schema.brand<Schema.String, "ExpressionSource">;
160
- }>, {}>;
161
- export declare class IssueTrigger extends IssueTrigger_base {
162
- }
163
- declare const PullRequestTrigger_base: Schema.Class<PullRequestTrigger, Schema.Struct<{
164
- readonly on: Schema.Literal<"pr">;
165
- readonly if: Schema.brand<Schema.String, "ExpressionSource">;
166
- }>, {}>;
167
- export declare class PullRequestTrigger extends PullRequestTrigger_base {
168
- }
169
- declare const ScheduleTrigger_base: Schema.Class<ScheduleTrigger, Schema.Struct<{
170
- readonly on: Schema.Literal<"schedule">;
171
- readonly if: Schema.brand<Schema.String, "ExpressionSource">;
172
- readonly cron: Schema.brand<Schema.String, "Cron">;
173
- readonly tz: Schema.withDecodingDefaultKey<Schema.brand<Schema.String, "TimeZone">, never>;
174
- }>, {}>;
175
- export declare class ScheduleTrigger extends ScheduleTrigger_base {
176
- }
177
- export declare const Trigger: Schema.Union<readonly [typeof IssueTrigger, typeof PullRequestTrigger, typeof ScheduleTrigger]>;
178
- export type Trigger = typeof Trigger.Type;
179
- /** The watched streams, derived from the Trigger union so the set has one owner. */
180
- export type Stream = Trigger["on"];
181
- declare const LoopFile_base: Schema.Class<LoopFile, Schema.Struct<{
182
- readonly name: Schema.brand<Schema.NonEmptyString, "LoopName">;
183
- readonly trigger: Schema.Union<readonly [typeof IssueTrigger, typeof PullRequestTrigger, typeof ScheduleTrigger]>;
184
- readonly selector: Schema.Option<Schema.decodeTo<Schema.declareConstructor<Selector, {
185
- readonly repos?: readonly string[];
186
- readonly tags?: readonly string[];
187
- }, readonly [Schema.Struct<{
188
- readonly repos: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RepoName">>>;
189
- readonly tags: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RegistryTag">>>;
190
- }>], {
191
- readonly repos: Schema.OptionIso<Schema.toType<Schema.$Array<Schema.brand<Schema.String, "RepoName">>>>;
192
- readonly tags: Schema.OptionIso<Schema.toType<Schema.$Array<Schema.brand<Schema.String, "RegistryTag">>>>;
193
- }>, Schema.Struct<{
194
- readonly repos: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RepoName">>>;
195
- readonly tags: Schema.OptionFromOptionalKey<Schema.$Array<Schema.brand<Schema.String, "RegistryTag">>>;
196
- }>, never, never>>;
197
- readonly approval: Schema.Literals<readonly ["none", "required"]>;
198
- readonly step: Schema.brand<Schema.NonEmptyString, "StepName">;
199
- readonly agent: Schema.brand<Schema.String, "AgentName">;
200
- readonly body: Schema.brand<Schema.String, "PromptTemplate">;
201
- }>, {}>;
202
- export declare class LoopFile extends LoopFile_base {
203
- }
204
- export declare const Harness: Schema.Literals<readonly ["claude", "codex", "pi"]>;
205
- export type Harness = CoreAgent.Harness;
206
- export declare const Effort: Schema.Literals<readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
207
- export type Effort = CoreAgent.Effort;
208
- declare const AgentFile_base: Schema.Class<AgentFile, Schema.Struct<{
209
- readonly name: Schema.brand<Schema.String, "AgentName">;
210
- readonly harness: Schema.Literals<readonly ["claude", "codex", "pi"]>;
211
- readonly model: Schema.brand<Schema.String, "ModelId">;
212
- readonly effort: Schema.Literals<readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
213
- readonly parentModel: Schema.Option<Schema.brand<Schema.String, "ModelId">>;
214
- readonly persona: Schema.brand<Schema.String, "AgentPersona">;
215
- }>, {}>;
216
- export declare class AgentFile extends AgentFile_base {
217
- }
218
- declare const InvalidAgent_base: Schema.Class<InvalidAgent, Schema.Struct<{
219
- readonly file: Schema.brand<Schema.NonEmptyString, "InstancePath">;
220
- readonly error: typeof ConfigFileError;
221
- }>, {}>;
222
- export declare class InvalidAgent extends InvalidAgent_base {
223
- }
224
- declare const QuarantinedLoop_base: Schema.Class<QuarantinedLoop, Schema.Struct<{
225
- readonly file: Schema.brand<Schema.NonEmptyString, "InstancePath">;
226
- readonly error: typeof ConfigFileError;
227
- }>, {}>;
228
- export declare class QuarantinedLoop extends QuarantinedLoop_base {
229
- }
230
- /** The instance-relative path a loop's filename identity maps back to. */
231
- export declare const loopPath: (name: LoopName) => InstancePath;
232
- /** The names a loop may reference, drawn from one loaded roster and registry. */
233
- export interface ReferenceIndex {
234
- readonly agentNames: ReadonlySet<AgentName>;
235
- readonly registryTags: ReadonlySet<RegistryTag>;
236
- readonly repoNames: ReadonlySet<RepoName>;
237
- }
238
- export declare const referenceIndex: (config: UsineConfig, agents: ReadonlyArray<AgentFile>) => ReferenceIndex;
239
- /**
240
- * Pure deriver: the reference failure quarantining one loop against the
241
- * loaded roster and registry, if any. The single owner of the reference rule
242
- * — the folder loader reports it per file, LoadedInstance enforces it at
243
- * construction.
244
- */
245
- export declare const loopReferenceFailure: (file: InstancePath, loop: LoopFile, references: ReferenceIndex) => Option.Option<ConfigFileError>;
246
- declare const LoadedInstance_base: Schema.Class<LoadedInstance, Schema.Struct<{
247
- readonly config: typeof UsineConfig;
248
- readonly agents: Schema.$Array<typeof AgentFile>;
249
- readonly invalidAgents: Schema.$Array<typeof InvalidAgent>;
250
- readonly loops: Schema.$Array<typeof LoopFile>;
251
- readonly quarantinedLoops: Schema.$Array<typeof QuarantinedLoop>;
252
- }>, {}>;
253
- /** One atomic snapshot of an instance folder. Loops with unresolved references are unconstructible. */
254
- export declare class LoadedInstance extends LoadedInstance_base {
255
- }
256
- export {};
257
- //# sourceMappingURL=model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,SAAS,EAElB,UAAU,EAEV,MAAM,IAAI,UAAU,EACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAwC,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEtF,gFAAgF;AAChF,eAAO,MAAM,YAAY,qDAA2D,CAAC;AACrF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAC;AAEpD,eAAO,MAAM,SAAS,gGAOpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;;;;;;;AAE9C,yEAAyE;AACzE,qBAAa,eAAgB,SAAQ,oBAOnC;CAAG;;;;;;AAEL,mFAAmF;AACnF,qBAAa,kBAAmB,SAAQ,uBAMtC;CAAG;AAEL,yEAAyE;AACzE,eAAO,MAAM,WAAW,4EAAsD,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;AASlD,eAAO,MAAM,SAAS,0CAAiB,CAAC;AACxC,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;AAEvC,eAAO,MAAM,QAAQ,iDAAqC,CAAC;AAC3D,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;AAE5C,eAAO,MAAM,UAAU,2CAAkB,CAAC;AAC1C,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC;AAEzC,eAAO,MAAM,QAAQ,yCAAkB,CAAC;AACxC,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;AAEvC,eAAO,MAAM,WAAW,4CAEvB,CAAC;AACF,MAAM,MAAM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Q,KAAG,YAAqD,CAAC;AAEhG,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC5C,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CAC3C;AAED,eAAO,MAAM,cAAc,WACjB,WAAW,UACX,aAAa,CAAC,SAAS,CAAC,KAC/B,cAID,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,SACzB,YAAY,QACZ,QAAQ,cACF,cAAc,KACzB,MAAM,CAAC,MAAM,CAAC,eAAe,CA4B/B,CAAC;;;;;;;;AAEF,uGAAuG;AACvG,qBAAa,cAAe,SAAQ,mBAkBnC;CAAG"}
package/dist/model.js DELETED
@@ -1,238 +0,0 @@
1
- import { Agent as CoreAgent, Loop as CoreLoop, Repository, Step, Worker as CoreWorker, } from "@usine/core";
2
- import { Source } from "@usine/expression";
3
- import { Cron as EffectCron, DateTime, Effect, Option, Result, Schema } from "effect";
4
- /** Instance-relative path of one authored file (`usine.yaml`, `loops/x.md`). */
5
- export const InstancePath = Schema.NonEmptyString.pipe(Schema.brand("InstancePath"));
6
- export const FileStage = Schema.Literals([
7
- "expression",
8
- "frontmatter",
9
- "read",
10
- "reference",
11
- "schema",
12
- "yaml",
13
- ]);
14
- /** One precise, file-owned config failure suitable for quarantine UI. */
15
- export class ConfigFileError extends Schema.TaggedError("@usine/config/ConfigFileError")("ConfigFileError", {
16
- file: InstancePath,
17
- stage: FileStage,
18
- expression: Schema.OptionFromOptionalKey(Source),
19
- message: Schema.NonEmptyString,
20
- }) {
21
- }
22
- /** A factory-level failure: the registry/settings boundary could not be loaded. */
23
- export class FactoryConfigError extends Schema.TaggedError("@usine/config/FactoryConfigError")("FactoryConfigError", {
24
- file: InstancePath,
25
- stage: FileStage,
26
- message: Schema.NonEmptyString,
27
- }) {
28
- }
29
- /** Every failure mode this package's parsers and loaders can produce. */
30
- export const ConfigError = Schema.Union([ConfigFileError, FactoryConfigError]);
31
- const KebabCase = Schema.isPattern(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u, {
32
- message: "Expected a kebab-case filename identity",
33
- });
34
- const nonBlankString = (message) => Schema.String.check(Schema.isPattern(/\S/u, { message }));
35
- export const AgentName = CoreAgent.Name;
36
- export const LoopName = CoreLoop.LoopName.check(KebabCase);
37
- export const WorkerName = CoreWorker.Name;
38
- export const RepoName = Repository.Name;
39
- export const RegistryTag = nonBlankString("Expected a non-blank registry tag").pipe(Schema.brand("RegistryTag"));
40
- export const LaneName = nonBlankString("Expected a non-blank lane name").pipe(Schema.brand("LaneName"));
41
- export const GitHubLabelName = nonBlankString("Expected a non-blank GitHub label name").pipe(Schema.brand("GitHubLabelName"));
42
- export const LaneItemState = Schema.Literals([
43
- "issue-open",
44
- "issue-closed",
45
- "pr-open",
46
- "pr-closed",
47
- "pr-merged",
48
- ]);
49
- export class LabelLaneSource extends Schema.Class("@usine/config/LabelLaneSource")({
50
- label: GitHubLabelName,
51
- }) {
52
- }
53
- export class StateLaneSource extends Schema.Class("@usine/config/StateLaneSource")({
54
- state: LaneItemState,
55
- }) {
56
- }
57
- export const LaneSource = Schema.Union([LabelLaneSource, StateLaneSource]);
58
- export class Lane extends Schema.Class("@usine/config/Lane")({
59
- name: LaneName,
60
- sources: Schema.Array(LaneSource).check(Schema.isNonEmpty()),
61
- }) {
62
- }
63
- export const ModelId = CoreAgent.ModelId;
64
- export const OperatorLogin = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/u, {
65
- message: "Expected a GitHub login",
66
- })).pipe(Schema.brand("OperatorLogin"));
67
- export const PromptTemplate = nonBlankString("Expected a non-blank Markdown prompt").pipe(Schema.brand("PromptTemplate"));
68
- export const Persona = CoreAgent.Persona;
69
- const PositiveInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
70
- const uniqueNames = Schema.makeFilter((values) => new Set(values.map(({ name }) => name)).size === values.length, { message: "Expected unique names" });
71
- const laneSourceKey = (source) => "label" in source ? `label:${source.label}` : `state:${source.state}`;
72
- const uniqueLaneSources = Schema.makeFilter((lanes) => {
73
- const keys = lanes.flatMap(({ sources }) => sources.map(laneSourceKey));
74
- return new Set(keys).size === keys.length;
75
- }, { message: "Expected every lane source to be mapped once" });
76
- const Lanes = Schema.Array(Lane).check(uniqueNames, uniqueLaneSources);
77
- export class ManagedRepo extends Schema.Class("@usine/config/ManagedRepo")({
78
- name: RepoName,
79
- tags: Schema.Array(RegistryTag)
80
- .check(Schema.isUnique())
81
- .pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
82
- lanes: Lanes.pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
83
- }) {
84
- }
85
- export const WorkerKind = CoreWorker.Kind;
86
- export class Worker extends Schema.Class("@usine/config/Worker")({
87
- name: WorkerName,
88
- kind: WorkerKind,
89
- maxConcurrentAttempts: PositiveInt.pipe(Schema.withDecodingDefaultKey(Effect.succeed(1))),
90
- }) {
91
- }
92
- export class Settings extends Schema.Class("@usine/config/Settings")({
93
- pollInterval: PositiveInt.pipe(Schema.withDecodingDefaultKey(Effect.succeed(60))),
94
- maxChildren: PositiveInt.pipe(Schema.withDecodingDefaultKey(Effect.succeed(4))),
95
- maxAttemptMinutes: PositiveInt.pipe(Schema.withDecodingDefaultKey(Effect.succeed(60))),
96
- maxAttemptTokens: PositiveInt.pipe(Schema.withDecodingDefaultKey(Effect.succeed(10_000_000))),
97
- parentModel: Schema.OptionFromOptionalKey(ModelId),
98
- }) {
99
- }
100
- export const Webhooks = Schema.Union([
101
- Schema.Struct({ mode: Schema.Literal("off") }),
102
- Schema.Struct({ mode: Schema.Literal("deliveries") }),
103
- Schema.Struct({ mode: Schema.Literal("endpoint"), publicUrl: Schema.URLFromString }).pipe(Schema.encodeKeys({ publicUrl: "public_url" })),
104
- ]);
105
- // The authored YAML surface is snake_case; domain fields are camelCase. The
106
- // renames live here, at the parse boundary, and encode back for edits.
107
- const SettingsFromYaml = Settings.pipe(Schema.encodeKeys({
108
- pollInterval: "poll_interval",
109
- maxChildren: "max_children",
110
- maxAttemptMinutes: "max_attempt_minutes",
111
- maxAttemptTokens: "max_attempt_tokens",
112
- parentModel: "parent_model",
113
- }));
114
- const WorkerFromYaml = Worker.pipe(Schema.encodeKeys({ maxConcurrentAttempts: "max_concurrent_attempts" }));
115
- const ManagedRepos = Schema.Array(ManagedRepo).check(uniqueNames);
116
- const Workers = Schema.Array(WorkerFromYaml).check(Schema.isNonEmpty(), uniqueNames);
117
- /** Strict, factory-wide authored config from usine.yaml. */
118
- export class UsineConfig extends Schema.Class("@usine/config/UsineConfig")({
119
- version: Schema.Literal(1),
120
- repos: ManagedRepos,
121
- settings: SettingsFromYaml.pipe(Schema.withDecodingDefaultKey(Effect.succeed({}))),
122
- workers: Workers.pipe(Schema.withDecodingDefaultKey(Effect.succeed([{ name: "local", kind: "local" }]))),
123
- webhooks: Webhooks.pipe(Schema.withDecodingDefaultKey(Effect.succeed({ mode: "off" }))),
124
- operator: Schema.OptionFromOptionalKey(OperatorLogin),
125
- }) {
126
- }
127
- export class Selector extends Schema.Class("@usine/config/Selector")({
128
- repos: Schema.OptionFromOptionalKey(Schema.Array(RepoName).check(Schema.isNonEmpty(), Schema.isUnique())),
129
- tags: Schema.OptionFromOptionalKey(Schema.Array(RegistryTag).check(Schema.isNonEmpty(), Schema.isUnique())),
130
- }) {
131
- }
132
- export const ValidSelector = Selector.check(Schema.makeFilter((selector) => Option.isSome(selector.repos) || Option.isSome(selector.tags), {
133
- message: "Expected selector.repos, selector.tags, or both",
134
- }));
135
- // Validated by the same effect Cron parser the engine's scheduler evaluates
136
- // with, so a cron that parses here parses at tick time too. Evaluation is a
137
- // weaker guarantee: Cron.prev/next can still fail inside a DST gap, which the
138
- // scheduler isolates per schedule.
139
- const isFiveFieldCron = (value) => value.trim().split(/\s+/u).length === 5 && Result.isSuccess(EffectCron.parse(value));
140
- export const Cron = Schema.String.check(Schema.makeFilter(isFiveFieldCron, { message: "Expected a valid five-field cron expression" })).pipe(Schema.brand("Cron"));
141
- const isTimeZone = (value) => Option.isSome(DateTime.zoneMakeNamed(value));
142
- export const TimeZone = Schema.String.check(Schema.makeFilter(isTimeZone, { message: "Expected an IANA time-zone name" })).pipe(Schema.brand("TimeZone"));
143
- export class IssueTrigger extends Schema.Class("@usine/config/IssueTrigger")({
144
- on: Schema.Literal("issue"),
145
- if: Source,
146
- }) {
147
- }
148
- export class PullRequestTrigger extends Schema.Class("@usine/config/PullRequestTrigger")({
149
- on: Schema.Literal("pr"),
150
- if: Source,
151
- }) {
152
- }
153
- export class ScheduleTrigger extends Schema.Class("@usine/config/ScheduleTrigger")({
154
- on: Schema.Literal("schedule"),
155
- if: Source,
156
- cron: Cron,
157
- tz: TimeZone.pipe(Schema.withDecodingDefaultKey(Effect.succeed("UTC"))),
158
- }) {
159
- }
160
- export const Trigger = Schema.Union([IssueTrigger, PullRequestTrigger, ScheduleTrigger]);
161
- export class LoopFile extends Schema.Class("@usine/config/LoopFile")({
162
- name: LoopName,
163
- trigger: Trigger,
164
- selector: Schema.Option(ValidSelector),
165
- approval: CoreLoop.ApprovalRequirement,
166
- step: Step.StepName,
167
- agent: AgentName,
168
- body: PromptTemplate,
169
- }) {
170
- }
171
- export const Harness = CoreAgent.Harness;
172
- export const Effort = CoreAgent.Effort;
173
- export class AgentFile extends Schema.Class("@usine/config/AgentFile")({
174
- name: AgentName,
175
- harness: Harness,
176
- model: ModelId,
177
- effort: Effort,
178
- parentModel: Schema.Option(ModelId),
179
- persona: Persona,
180
- }) {
181
- }
182
- export class InvalidAgent extends Schema.Class("@usine/config/InvalidAgent")({
183
- file: InstancePath,
184
- error: ConfigFileError,
185
- }) {
186
- }
187
- export class QuarantinedLoop extends Schema.Class("@usine/config/QuarantinedLoop")({
188
- file: InstancePath,
189
- error: ConfigFileError,
190
- }) {
191
- }
192
- /** The instance-relative path a loop's filename identity maps back to. */
193
- export const loopPath = (name) => InstancePath.make(`loops/${name}.md`);
194
- export const referenceIndex = (config, agents) => ({
195
- agentNames: new Set(agents.map(({ name }) => name)),
196
- registryTags: new Set(config.repos.flatMap(({ tags }) => tags)),
197
- repoNames: new Set(config.repos.map(({ name }) => name)),
198
- });
199
- /**
200
- * Pure deriver: the reference failure quarantining one loop against the
201
- * loaded roster and registry, if any. The single owner of the reference rule
202
- * — the folder loader reports it per file, LoadedInstance enforces it at
203
- * construction.
204
- */
205
- export const loopReferenceFailure = (file, loop, references) => {
206
- const referenceError = (message) => Option.some(new ConfigFileError({ file, stage: "reference", expression: Option.none(), message }));
207
- if (!references.agentNames.has(loop.agent)) {
208
- return referenceError(`Unknown agent: ${loop.agent}`);
209
- }
210
- if (Option.isNone(loop.selector))
211
- return Option.none();
212
- if (Option.isSome(loop.selector.value.repos)) {
213
- const missing = loop.selector.value.repos.value.filter((name) => !references.repoNames.has(name));
214
- if (missing.length > 0) {
215
- return referenceError(`Unknown selector repos: ${missing.join(", ")}`);
216
- }
217
- }
218
- if (Option.isSome(loop.selector.value.tags)) {
219
- const missing = loop.selector.value.tags.value.filter((tag) => !references.registryTags.has(tag));
220
- if (missing.length > 0) {
221
- return referenceError(`Unknown selector tags: ${missing.join(", ")}`);
222
- }
223
- }
224
- return Option.none();
225
- };
226
- /** One atomic snapshot of an instance folder. Loops with unresolved references are unconstructible. */
227
- export class LoadedInstance extends Schema.Class("@usine/config/LoadedInstance")(Schema.Struct({
228
- config: UsineConfig,
229
- agents: Schema.Array(AgentFile),
230
- invalidAgents: Schema.Array(InvalidAgent),
231
- loops: Schema.Array(LoopFile),
232
- quarantinedLoops: Schema.Array(QuarantinedLoop),
233
- }).check(Schema.makeFilter(({ agents, config, loops }) => {
234
- const references = referenceIndex(config, agents);
235
- return loops.every((loop) => Option.isNone(loopReferenceFailure(loopPath(loop.name), loop, references)));
236
- }, { message: "Expected every loop to reference the loaded roster and registry" }))) {
237
- }
238
- //# sourceMappingURL=model.js.map
package/dist/model.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,SAAS,EAClB,IAAI,IAAI,QAAQ,EAChB,UAAU,EACV,IAAI,EACJ,MAAM,IAAI,UAAU,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEtF,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAGrF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IACvC,YAAY;IACZ,aAAa;IACb,MAAM;IACN,WAAW;IACX,QAAQ;IACR,MAAM;CACP,CAAC,CAAC;AAGH,yEAAyE;AACzE,MAAM,OAAO,eAAgB,SAAQ,MAAM,CAAC,WAAW,CACrD,+BAA+B,CAChC,CAAC,iBAAiB,EAAE;IACnB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC;CAAG;AAEL,mFAAmF;AACnF,MAAM,OAAO,kBAAmB,SAAQ,MAAM,CAAC,WAAW,CACxD,kCAAkC,CACnC,CAAC,oBAAoB,EAAE;IACtB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC;CAAG;AAEL,yE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