@effect-app/vue 4.0.0-beta.27 → 4.0.0-beta.272

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 (111) hide show
  1. package/CHANGELOG.md +2008 -0
  2. package/dist/commander.d.ts +634 -0
  3. package/dist/commander.d.ts.map +1 -0
  4. package/dist/commander.js +1070 -0
  5. package/dist/{experimental/confirm.d.ts → confirm.d.ts} +6 -4
  6. package/dist/confirm.d.ts.map +1 -0
  7. package/dist/confirm.js +26 -0
  8. package/dist/errorReporter.d.ts +6 -4
  9. package/dist/errorReporter.d.ts.map +1 -1
  10. package/dist/errorReporter.js +14 -19
  11. package/dist/form.d.ts +14 -5
  12. package/dist/form.d.ts.map +1 -1
  13. package/dist/form.js +46 -13
  14. package/dist/intl.d.ts +15 -0
  15. package/dist/intl.d.ts.map +1 -0
  16. package/dist/intl.js +9 -0
  17. package/dist/lib.d.ts +7 -9
  18. package/dist/lib.d.ts.map +1 -1
  19. package/dist/lib.js +35 -10
  20. package/dist/makeClient.d.ts +157 -343
  21. package/dist/makeClient.d.ts.map +1 -1
  22. package/dist/makeClient.js +218 -377
  23. package/dist/makeContext.d.ts.map +1 -1
  24. package/dist/makeIntl.d.ts.map +1 -1
  25. package/dist/{experimental/makeUseCommand.d.ts → makeUseCommand.d.ts} +4 -3
  26. package/dist/makeUseCommand.d.ts.map +1 -0
  27. package/dist/makeUseCommand.js +13 -0
  28. package/dist/mutate.d.ts +96 -38
  29. package/dist/mutate.d.ts.map +1 -1
  30. package/dist/mutate.js +177 -49
  31. package/dist/query.d.ts +23 -38
  32. package/dist/query.d.ts.map +1 -1
  33. package/dist/query.js +156 -78
  34. package/dist/routeParams.d.ts +4 -4
  35. package/dist/routeParams.d.ts.map +1 -1
  36. package/dist/routeParams.js +4 -3
  37. package/dist/runtime.d.ts +1 -14
  38. package/dist/runtime.d.ts.map +1 -1
  39. package/dist/runtime.js +2 -26
  40. package/dist/suspense.d.ts +5 -0
  41. package/dist/suspense.d.ts.map +1 -0
  42. package/dist/suspense.js +12 -0
  43. package/dist/toast.d.ts +2 -0
  44. package/dist/toast.d.ts.map +1 -0
  45. package/dist/toast.js +2 -0
  46. package/dist/withToast.d.ts +2 -0
  47. package/dist/withToast.d.ts.map +1 -0
  48. package/dist/withToast.js +2 -0
  49. package/examples/streamMutation.ts +72 -0
  50. package/package.json +30 -91
  51. package/src/commander.ts +3413 -0
  52. package/src/{experimental/confirm.ts → confirm.ts} +13 -15
  53. package/src/errorReporter.ts +65 -75
  54. package/src/form.ts +61 -18
  55. package/src/index.ts +7 -7
  56. package/src/intl.ts +12 -0
  57. package/src/lib.ts +49 -21
  58. package/src/makeClient.ts +586 -1139
  59. package/src/makeIntl.ts +2 -2
  60. package/src/{experimental/makeUseCommand.ts → makeUseCommand.ts} +9 -6
  61. package/src/mutate.ts +335 -134
  62. package/src/query.ts +241 -183
  63. package/src/routeParams.ts +7 -7
  64. package/src/runtime.ts +1 -31
  65. package/src/suspense.ts +17 -0
  66. package/src/toast.ts +1 -0
  67. package/src/withToast.ts +1 -0
  68. package/test/Mutation.test.ts +181 -24
  69. package/test/dist/form.test.d.ts.map +1 -1
  70. package/test/dist/lib.test.d.ts.map +1 -0
  71. package/test/dist/streamFinal.test.d.ts.map +1 -0
  72. package/test/dist/streamFn.test.d.ts.map +1 -0
  73. package/test/dist/stubs.d.ts +3527 -122
  74. package/test/dist/stubs.d.ts.map +1 -1
  75. package/test/dist/stubs.js +187 -32
  76. package/test/dist/suspense.test.d.ts.map +1 -0
  77. package/test/form-validation-errors.test.ts +25 -20
  78. package/test/form.test.ts +22 -3
  79. package/test/lib.test.ts +240 -0
  80. package/test/makeClient.test.ts +327 -38
  81. package/test/streamFinal.test.ts +64 -0
  82. package/test/streamFn.test.ts +457 -0
  83. package/test/stubs.ts +223 -43
  84. package/test/suspense.test.ts +20 -0
  85. package/tsconfig.examples.json +20 -0
  86. package/tsconfig.json +3 -1
  87. package/tsconfig.json.bak +5 -2
  88. package/tsconfig.src.json +34 -34
  89. package/tsconfig.test.json +2 -2
  90. package/vitest.config.ts +5 -5
  91. package/dist/experimental/commander.d.ts +0 -359
  92. package/dist/experimental/commander.d.ts.map +0 -1
  93. package/dist/experimental/commander.js +0 -557
  94. package/dist/experimental/confirm.d.ts.map +0 -1
  95. package/dist/experimental/confirm.js +0 -28
  96. package/dist/experimental/intl.d.ts +0 -16
  97. package/dist/experimental/intl.d.ts.map +0 -1
  98. package/dist/experimental/intl.js +0 -5
  99. package/dist/experimental/makeUseCommand.d.ts.map +0 -1
  100. package/dist/experimental/makeUseCommand.js +0 -13
  101. package/dist/experimental/toast.d.ts +0 -47
  102. package/dist/experimental/toast.d.ts.map +0 -1
  103. package/dist/experimental/toast.js +0 -41
  104. package/dist/experimental/withToast.d.ts +0 -25
  105. package/dist/experimental/withToast.d.ts.map +0 -1
  106. package/dist/experimental/withToast.js +0 -45
  107. package/eslint.config.mjs +0 -24
  108. package/src/experimental/commander.ts +0 -1835
  109. package/src/experimental/intl.ts +0 -9
  110. package/src/experimental/toast.ts +0 -66
  111. package/src/experimental/withToast.ts +0 -99
@@ -0,0 +1,634 @@
1
+ import { type MissingDependencies } from "@effect-app/vue/makeClient";
2
+ import * as Context from "effect-app/Context";
3
+ import * as Effect from "effect-app/Effect";
4
+ import * as Layer from "effect-app/Layer";
5
+ import * as Option from "effect-app/Option";
6
+ import type * as Exit from "effect/Exit";
7
+ import type * as Fiber from "effect/Fiber";
8
+ import * as Predicate from "effect/Predicate";
9
+ import { type Refinement } from "effect/Predicate";
10
+ import * as Stream from "effect/Stream";
11
+ import * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
12
+ import { type FormatXMLElementFn, type PrimitiveType } from "intl-messageformat";
13
+ import { type ComputedRef } from "vue";
14
+ import { Confirm } from "./confirm.js";
15
+ import { I18n } from "./intl.js";
16
+ import { Toast } from "./toast.js";
17
+ import { WithToast } from "./withToast.js";
18
+ type IntlRecord = Record<string, PrimitiveType | FormatXMLElementFn<string, string>>;
19
+ /**
20
+ * Progress information surfaced by a stream command. Either a plain text label
21
+ * or a `{ text, percentage }` pair when concrete progress is known.
22
+ */
23
+ export type Progress = string | {
24
+ readonly text: string;
25
+ readonly percentage: number;
26
+ };
27
+ type FnOptions<Id extends string, I18nCustomKey extends string, State extends IntlRecord | undefined> = {
28
+ i18nCustomKey?: I18nCustomKey;
29
+ /**
30
+ * passed to the i18n formatMessage calls so you can use it in translation messagee
31
+ * including the Command `action` string.
32
+ * Automatically wrapped with Computed if just a thunk.
33
+ * provided as Command.state tag, so you can access it in the function.
34
+ */
35
+ state?: ComputedRef<State> | (() => State);
36
+ blockKey?: (id: Id) => string | undefined;
37
+ waitKey?: (id: Id) => string | undefined;
38
+ allowed?: (id: Id, state: ComputedRef<State>) => boolean;
39
+ };
40
+ type FnOptionsInternal<I18nCustomKey extends string> = {
41
+ i18nCustomKey?: I18nCustomKey | undefined;
42
+ state?: IntlRecord | undefined;
43
+ };
44
+ export declare const DefaultIntl: {
45
+ de: {
46
+ "handle.confirmation": string;
47
+ "handle.waiting": string;
48
+ "handle.success": string;
49
+ "handle.with_errors": string;
50
+ "handle.with_warnings": string;
51
+ "handle.error_response": string;
52
+ "handle.response_error": string;
53
+ "handle.request_error": string;
54
+ "handle.unexpected_error2": string;
55
+ "handle.unexpected_error": string;
56
+ "handle.not_found": string;
57
+ };
58
+ en: {
59
+ "handle.confirmation": string;
60
+ "handle.waiting": string;
61
+ "handle.success": string;
62
+ "handle.with_errors": string;
63
+ "handle.with_warnings": string;
64
+ "handle.error_response": string;
65
+ "handle.request_error": string;
66
+ "handle.response_error": string;
67
+ "handle.unexpected_error2": string;
68
+ "handle.unexpected_error": string;
69
+ "handle.not_found": string;
70
+ };
71
+ };
72
+ declare const CommandContext_base: Context.ServiceClass<CommandContext, "CommandContext", {
73
+ id: string;
74
+ i18nKey: string;
75
+ action: string;
76
+ label: string;
77
+ namespace: string;
78
+ namespaced: (key: string) => string;
79
+ state?: IntlRecord | undefined;
80
+ }>;
81
+ export declare class CommandContext extends CommandContext_base {
82
+ }
83
+ declare const CommandProgress_base: Context.Reference<{
84
+ readonly update: (progress: Progress | undefined) => Effect.Effect<void>;
85
+ }>;
86
+ /**
87
+ * Service available inside `streamFn` stream handlers that lets you imperatively push
88
+ * progress updates to the command's reactive `progress` ref.
89
+ *
90
+ * Use `Command.mapProgress(fn)` or `Command.updateProgress(progress)` to interact with this service.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * // Using mapProgress (recommended) — applied as a stream pipe operator:
95
+ * const exportCmd = Command.streamFn("exportData")(
96
+ * function*(arg, ctx) {
97
+ * return makeExportStream(arg.id).pipe(
98
+ * Command.mapProgress((r) =>
99
+ * AsyncResult.isSuccess(r) && r.value._tag === "OperationProgress"
100
+ * ? { text: `${r.value.completed}/${r.value.total}`, percentage: r.value.completed / r.value.total * 100 }
101
+ * : undefined
102
+ * )
103
+ * )
104
+ * }
105
+ * )
106
+ * // exportCmd.progress is updated for every OperationProgress event
107
+ * ```
108
+ */
109
+ export declare class CommandProgress extends CommandProgress_base {
110
+ }
111
+ export type EmitWithCallback<A, Event extends string> = (event: Event, value: A, onDone: () => void) => void;
112
+ /**
113
+ * Use to wrap emit calls with a callback to signal completion.
114
+ * Useful when the publisher wants to wait for the subscriber to finish processing.
115
+ */
116
+ export declare const wrapEmit: <A, Event extends string>(emit: EmitWithCallback<A, NoInfer<Event>>, event: Event) => (value: A) => Promise<void>;
117
+ export declare namespace Commander {
118
+ type IntlRecord = Record<string, PrimitiveType | FormatXMLElementFn<string, string>>;
119
+ type FnOptions<Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = {
120
+ i18nCustomKey?: I18nKey;
121
+ state?: ComputedRef<State> | (() => State);
122
+ blockKey?: (id: Id) => string | undefined;
123
+ waitKey?: (id: Id) => string | undefined;
124
+ allowed?: (id: Id, state: ComputedRef<State>) => boolean;
125
+ };
126
+ type CommanderBase<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = Gen<RT, Id, I18nKey, State> & NonGen<RT, Id, I18nKey, State> & CommandContextLocal<Id, I18nKey> & {
127
+ state: Context.Service<`Commander.Command.${Id}.state`, State>;
128
+ };
129
+ type CommanderFn<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = CommanderBase<RT, Id, I18nKey, State>;
130
+ type CommanderWrap<RT, Id extends string, I18nCustomKey extends string, State extends IntlRecord | undefined, I, A, E, R> = CommandContextLocal<Id, I18nCustomKey> & GenWrap<RT, Id, I18nCustomKey, I, A, E, R, State> & NonGenWrap<RT, Id, I18nCustomKey, I, A, E, R, State> & {
131
+ state: Context.Service<`Commander.Command.${Id}.state`, State>;
132
+ };
133
+ interface CommandContextLocal<Id extends string, I18nKey extends string> {
134
+ id: Id;
135
+ i18nKey: I18nKey;
136
+ namespace: `action.${I18nKey}`;
137
+ namespaced: <K extends string>(k: K) => `action.${I18nKey}.${K}`;
138
+ }
139
+ interface CommandProps<A, E, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> extends CommandContextLocal<Id, I18nKey> {
140
+ /** reactive */
141
+ action: string;
142
+ /** reactive */
143
+ label: string;
144
+ /** reactive */
145
+ result: AsyncResult.AsyncResult<A, E>;
146
+ /**
147
+ * reactive – formatted progress info driven by `Command.mapProgress` or `Command.updateProgress`
148
+ * inside a `streamFn` handler. Undefined for non-stream commands.
149
+ */
150
+ progress: Progress | undefined;
151
+ /** reactive */
152
+ waiting: boolean;
153
+ /** reactive */
154
+ blocked: boolean;
155
+ /** reactive */
156
+ allowed: boolean;
157
+ /** reactive */
158
+ state: State;
159
+ }
160
+ interface CommandOut<Arg, A, E, R, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> extends CommandProps<A, E, Id, I18nKey, State> {
161
+ new (): {};
162
+ /** click handlers */
163
+ handle: ((arg: Arg) => Fiber.Fiber<Exit.Exit<A, E>>) & {
164
+ /** @deprecated don't exist */
165
+ effect: (arg: Arg) => Effect.Effect<A, E, R>;
166
+ };
167
+ }
168
+ interface CommandContextLocal2<Id extends string, I18nKey extends string, State extends IntlRecord | undefined> extends CommandContextLocal<Id, I18nKey> {
169
+ state: State;
170
+ }
171
+ type ArgForCombinator<Arg> = [Arg] extends [void] ? undefined : NoInfer<Arg>;
172
+ type CommandOutHelper<Arg, Eff extends Effect.Effect<any, any, any>, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = CommandOut<Arg, Effect.Success<Eff>, Effect.Error<Eff>, Effect.Services<Eff>, Id, I18nKey, State>;
173
+ type Gen<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = {
174
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, AEff, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>): CommandOut<Arg, AEff, [
175
+ Eff
176
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
177
+ Eff
178
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never, Id, I18nKey, State>;
179
+ <Eff extends Effect.Effect<any, any, any>, AEff, A extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
180
+ Eff
181
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
182
+ Eff
183
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A): CommandOutHelper<Arg, A, Id, I18nKey, State>;
184
+ <Eff extends Effect.Effect<any, any, any>, AEff, A, B extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
185
+ Eff
186
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
187
+ Eff
188
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B): CommandOutHelper<Arg, B, Id, I18nKey, State>;
189
+ <Eff extends Effect.Effect<any, any, any>, AEff, A, B, C extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
190
+ Eff
191
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
192
+ Eff
193
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C): CommandOutHelper<Arg, C, Id, I18nKey, State>;
194
+ <Eff extends Effect.Effect<any, any, any>, AEff, A, B, C, D extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
195
+ Eff
196
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
197
+ Eff
198
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D): CommandOutHelper<Arg, D, Id, I18nKey, State>;
199
+ <Eff extends Effect.Effect<any, any, any>, AEff, A, B, C, D, E extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
200
+ Eff
201
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
202
+ Eff
203
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E): CommandOutHelper<Arg, E, Id, I18nKey, State>;
204
+ <Eff extends Effect.Effect<any, any, any>, AEff, A, B, C, D, E, F extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
205
+ Eff
206
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
207
+ Eff
208
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F): CommandOutHelper<Arg, F, Id, I18nKey, State>;
209
+ <Eff extends Effect.Effect<any, any, any>, AEff, A, B, C, D, E, F, G extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
210
+ Eff
211
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
212
+ Eff
213
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G): CommandOutHelper<Arg, G, Id, I18nKey, State>;
214
+ <Eff extends Effect.Effect<any, any, any>, AEff, A, B, C, D, E, F, G, H extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
215
+ Eff
216
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
217
+ Eff
218
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, h: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H): CommandOutHelper<Arg, H, Id, I18nKey, State>;
219
+ <Eff extends Effect.Effect<any, any, any>, AEff, A, B, C, D, E, F, G, H, I extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, AEff, never>, a: (_: Effect.Effect<AEff, [
220
+ Eff
221
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [
222
+ Eff
223
+ ] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, h: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, i: (_: H, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I): CommandOutHelper<Arg, I, Id, I18nKey, State>;
224
+ };
225
+ type NonGen<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = {
226
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
227
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
228
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
229
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
230
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
231
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
232
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, F, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
233
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, F, G, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
234
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, F, G, H, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, h: (_: H, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
235
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, A, B, C, D, E, F, G, H, I, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => A, a: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, h: (_: H, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I, i: (_: H, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
236
+ };
237
+ type GenWrap<RT, Id extends string, I18nKey extends string, Arg, AEff, EEff, REff, State extends IntlRecord | undefined> = {
238
+ (): Exclude<REff, RT> extends never ? CommandOut<Arg, AEff, EEff, REff, Id, I18nKey, State> : MissingDependencies<RT, REff> & {};
239
+ <A extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A): CommandOutHelper<Arg, A, Id, I18nKey, State>;
240
+ <A, B extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B): CommandOutHelper<Arg, B, Id, I18nKey, State>;
241
+ <A, B, C extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C): CommandOutHelper<Arg, C, Id, I18nKey, State>;
242
+ <A, B, C, D extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D): CommandOutHelper<Arg, D, Id, I18nKey, State>;
243
+ <A, B, C, D, E extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E): CommandOutHelper<Arg, E, Id, I18nKey, State>;
244
+ <A, B, C, D, E, F extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F): CommandOutHelper<Arg, F, Id, I18nKey, State>;
245
+ <A, B, C, D, E, F, G extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G): CommandOutHelper<Arg, G, Id, I18nKey, State>;
246
+ <A, B, C, D, E, F, G, H extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, h: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H): CommandOutHelper<Arg, H, Id, I18nKey, State>;
247
+ <A, B, C, D, E, F, G, H, I extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A, b: (_: A, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, c: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, d: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, e: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, f: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, g: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, h: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, i: (_: H, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I): CommandOutHelper<Arg, I, Id, I18nKey, State>;
248
+ };
249
+ type NonGenWrap<RT, Id extends string, I18nKey extends string, Arg, AEff, EEff, REff, State extends IntlRecord | undefined> = {
250
+ (): Exclude<REff, RT> extends never ? CommandOutHelper<Arg, Effect.Effect<AEff, EEff, REff>, Id, I18nKey, State> : MissingDependencies<RT, REff> & {};
251
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
252
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
253
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
254
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
255
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
256
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, F, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
257
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, F, G, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
258
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, F, G, H, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, h: (_: H, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
259
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, B, C, D, E, F, G, H, I, Arg>(a: (_: Effect.Effect<AEff, EEff, REff>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => E, e: (_: E, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => F, f: (_: F, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => G, g: (_: G, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => H, h: (_: H, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => I, i: (_: H, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => Eff): CommandOutHelper<Arg, Eff, Id, I18nKey, State>;
260
+ };
261
+ /**
262
+ * Type for `streamFn` — generator overload where the body yields Effects and returns a `Stream`.
263
+ * `waiting` stays `true` while the stream is running, and updates the `result` ref per emitted value.
264
+ */
265
+ type StreamGen<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = {
266
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, SA, SE, SR, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, Stream.Stream<SA, SE, SR>, never>): CommandOut<Arg, SA, SE | ([Eff] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never), SR | ([Eff] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never), Id, I18nKey, State>;
267
+ <Eff extends Effect.Effect<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, SA, SE, SR, B, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Generator<Eff, Stream.Stream<SA, SE, SR>, never>, a: (_: Effect.Effect<Stream.Stream<SA, SE, SR>, ([Eff] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never), ([Eff] extends [never] ? never : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R : never)>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B): B extends Stream.Stream<infer SA2, infer SE2, infer SR2> ? CommandOut<Arg, SA2, SE2, SR2, Id, I18nKey, State> : B extends Effect.Effect<Stream.Stream<infer SA2, infer SE2, infer SR2>, infer EE2, infer ER2> ? CommandOut<Arg, SA2, SE2 | EE2, SR2 | ER2, Id, I18nKey, State> : never;
268
+ };
269
+ /**
270
+ * Type for `streamFn` — non-generator overload accepting a function that returns a `Stream` directly,
271
+ * or an `Effect` that resolves to a `Stream`.
272
+ */
273
+ type NonGenStream<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined> = {
274
+ <SA, SE, SR extends RT | CommandContext | `Commander.Command.${Id}.state`, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Stream.Stream<SA, SE, SR>): CommandOut<Arg, SA, SE, SR, Id, I18nKey, State>;
275
+ <SA, SE, SR, A extends Stream.Stream<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Stream.Stream<SA, SE, SR>, a: (_: Stream.Stream<SA, SE, SR>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A): CommandOut<Arg, Stream.Success<A>, Stream.Error<A>, Stream.Services<A>, Id, I18nKey, State>;
276
+ <SA, SE, SR, EE, ER extends RT | CommandContext | `Commander.Command.${Id}.state`, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<Stream.Stream<SA, SE, SR>, EE, ER>): CommandOut<Arg, SA, SE | EE, SR | ER, Id, I18nKey, State>;
277
+ <SA, SE, SR, EE, ER, B, Arg = void>(body: (arg: Arg, ctx: CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<Stream.Stream<SA, SE, SR>, EE, ER>, a: (_: Effect.Effect<Stream.Stream<SA, SE, SR>, EE, ER>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B): B extends Stream.Stream<infer SA2, infer SE2, infer SR2> ? CommandOut<Arg, SA2, SE2, SR2, Id, I18nKey, State> : B extends Effect.Effect<Stream.Stream<infer SA2, infer SE2, infer SR2>, infer EE2, infer ER2> ? CommandOut<Arg, SA2, SE2 | EE2, SR2 | ER2, Id, I18nKey, State> : never;
278
+ };
279
+ /**
280
+ * Type returned by `mutate.wrap` on a stream handler — analogous to `CommanderWrap` but for streams.
281
+ * The handler is pre-baked (from the stream mutation), so this is called with only optional combinators.
282
+ */
283
+ type StreamerWrap<RT, Id extends string, I18nKey extends string, State extends IntlRecord | undefined, Arg, SA, SE, SR> = CommandContextLocal<Id, I18nKey> & {
284
+ readonly state: Context.Service<`Commander.Command.${Id}.state`, State>;
285
+ } & {
286
+ (): Exclude<SR, RT> extends never ? CommandOut<Arg, SA, SE, SR, Id, I18nKey, State> : MissingDependencies<RT, SR> & {};
287
+ <A extends Stream.Stream<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Stream.Stream<SA, SE, SR>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A): CommandOut<Arg, Stream.Success<A>, Stream.Error<A>, Stream.Services<A>, Id, I18nKey, State>;
288
+ <B, A extends Stream.Stream<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Stream.Stream<SA, SE, SR>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A): CommandOut<Arg, Stream.Success<A>, Stream.Error<A>, Stream.Services<A>, Id, I18nKey, State>;
289
+ <B, C, A extends Stream.Stream<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Stream.Stream<SA, SE, SR>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A): CommandOut<Arg, Stream.Success<A>, Stream.Error<A>, Stream.Services<A>, Id, I18nKey, State>;
290
+ <B, C, D, A extends Stream.Stream<any, any, RT | CommandContext | `Commander.Command.${Id}.state`>>(a: (_: Stream.Stream<SA, SE, SR>, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => B, b: (_: B, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => C, c: (_: C, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => D, d: (_: D, arg: ArgForCombinator<Arg>, ctx: CommandContextLocal2<NoInfer<Id>, NoInfer<I18nKey>, NoInfer<State>>) => A): CommandOut<Arg, Stream.Success<A>, Stream.Error<A>, Stream.Services<A>, Id, I18nKey, State>;
291
+ };
292
+ }
293
+ type ErrorRenderer<E, Args extends readonly any[]> = (e: E, action: string, ...args: Args) => string | undefined;
294
+ type RegisteredErrorRenderer<A> = {
295
+ guard: Refinement<unknown, A>;
296
+ render: (guarded: A) => string | undefined;
297
+ };
298
+ declare const CommanderErrorRenderers_base: Context.Reference<RegisteredErrorRenderer<any>[]>;
299
+ export declare class CommanderErrorRenderers extends CommanderErrorRenderers_base {
300
+ }
301
+ export declare const makeRegisteredErrorRenderer: <A>(guard: Predicate.Refinement<unknown, A>, render: (guarded: A) => string | undefined) => RegisteredErrorRenderer<A>;
302
+ export declare const CommanderStatic: {
303
+ accessArgs: <In, Out, Arg2, Arg = void>(cb: (a: NoInfer<Arg>, b: NoInfer<Arg2>) => (self: NoInfer<In>) => Out) => (self: In, arg: Arg, arg2: Arg2) => Out;
304
+ /**
305
+ * Stream pipe operator that maps each emitted value to a `Progress` entry and updates the
306
+ * command's reactive `progress` ref via the `CommandProgress` service.
307
+ *
308
+ * The mapper receives an `AsyncResult<A, E>` (each emitted value wrapped as
309
+ * `AsyncResult.success(value, { waiting: true })`), matching the same shape used by
310
+ * `CommandButton`'s `:progress-map` prop.
311
+ *
312
+ * Designed to be used inside a `streamFn` handler (either directly with `.pipe()`, or as
313
+ * a combinator argument):
314
+ *
315
+ * @example
316
+ * ```ts
317
+ * // Inside the handler body:
318
+ * Command.streamFn("exportData")(function*(arg, ctx) {
319
+ * return makeExportStream(arg.id).pipe(
320
+ * Command.mapProgress((r) =>
321
+ * AsyncResult.isSuccess(r) && r.value._tag === "OperationProgress"
322
+ * ? { text: `${r.value.completed}/${r.value.total}`, percentage: r.value.completed / r.value.total * 100 }
323
+ * : undefined
324
+ * )
325
+ * )
326
+ * })
327
+ *
328
+ * // Or as a stream combinator argument:
329
+ * Command.streamFn("exportData")(
330
+ * function*(arg, ctx) { return makeExportStream(arg.id) },
331
+ * (s) => s.pipe(Command.mapProgress((r) => AsyncResult.isSuccess(r) && r.value._tag === "OperationProgress" ? { text: `${r.value.completed}/${r.value.total}` } : undefined))
332
+ * )
333
+ * ```
334
+ */
335
+ mapProgress: <A, E>(fn: (result: AsyncResult.AsyncResult<A, E>) => Progress | undefined) => <R>(stream: Stream.Stream<A, E, R>) => Stream.Stream<A, E, R>;
336
+ /**
337
+ * Imperatively push a progress update from inside a `streamFn` handler.
338
+ * Requires `CommandProgress` to be in context — provided automatically for all `streamFn` streams.
339
+ *
340
+ * @example
341
+ * ```ts
342
+ * // In a streamFn handler:
343
+ * stream.pipe(
344
+ * Stream.tap((event) =>
345
+ * event._tag === "OperationProgress"
346
+ * ? Command.updateProgress({ text: `${event.completed}/${event.total}`, percentage: event.completed / event.total * 100 })
347
+ * : Effect.void
348
+ * )
349
+ * )
350
+ * ```
351
+ */
352
+ updateProgress: (progress: Progress | undefined) => Effect.Effect<void>;
353
+ /** Version of @see confirmOrInterrupt that automatically includes the action name in the default messages */
354
+ confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, CommandContext | Confirm | I18n>;
355
+ /** Version of @see confirm that automatically includes the action name in the default messages */
356
+ confirm: (message?: string | undefined) => Effect.Effect<boolean, never, CommandContext | Confirm | I18n>;
357
+ updateAction: <Args extends Array<unknown>>(update: (currentActionId: string, ...args: Args) => string) => <A, E, R>(_: Effect.Effect<A, E, R>, ...input: Args) => Effect.Effect<A, E, R | CommandContext>;
358
+ registerErrorRenderer: <A>(guard: Predicate.Refinement<unknown, A>, render: (guarded: A) => string | undefined) => Layer.Layer<never, never, never>;
359
+ defaultFailureMessageHandler: <E, Args extends Array<unknown>, AME, AMR>(actionMaker: string | ((o: Option.Option<E>, ...args: Args) => string) | ((o: Option.Option<E>, ...args: Args) => Effect.Effect<string, AME, AMR>), errorRenderer?: ErrorRenderer<E, Args>) => (o: Option.Option<E>, ...args: Args) => Effect.Effect<string | {
360
+ level: "warn";
361
+ message: string;
362
+ }, AME, AMR | I18n>;
363
+ renderError: Effect.Effect<<E, Args extends readonly any[]>(action: string, errorRenderer?: ErrorRenderer<E, Args>) => (e: E, ...args: Args) => string, never, I18n>;
364
+ /**
365
+ * Version of withDefaultToast that automatically includes the action name in the default messages and uses intl.
366
+ * uses the Command id as i18n namespace. `action.{id}` is the main action name,
367
+ * and `action.{id}.waiting`, `action.{id}.success`, `action.{id}.failure` can be used to override the default messages for the respective states.
368
+ *
369
+ * the computed `state` provided to the Command can be used for interpolation in the i18n messages. (the state is captured at the start of each command execution and remains stable throughout)
370
+ *
371
+ * Note: if you provide `onWaiting` or `onSuccess` as `null`, no toast will be shown for that state.
372
+ * If you provide a string or function, it will be used instead of the i18n message.
373
+ * If you provide an `errorRenderer`, it will be used to render errors in the failure message.
374
+ */
375
+ withDefaultToast: <A, E, R, Args extends Array<unknown>>(options?: {
376
+ /**
377
+ * if true, previous toasts with this key will be replaced
378
+ */
379
+ stableToastId?: undefined | true | string | ((id: string, arg: NoInfer<Args>[0], ctx: NoInfer<Args>[1]) => true | string | undefined);
380
+ errorRenderer?: (e: E, action: string, arg: NoInfer<Args>[0], ctx: NoInfer<Args>[1]) => string | undefined;
381
+ showSpanInfo?: false;
382
+ onWaiting?: null | undefined | string | ((id: string, arg: NoInfer<Args>[0], ctx: NoInfer<Args>[1]) => string | null | undefined);
383
+ onSuccess?: null | undefined | string | ((a: A, action: string, arg: NoInfer<Args>[0], ctx: NoInfer<Args>[1]) => string | null | undefined);
384
+ }) => (self: Effect.Effect<A, E, R>, ...args: Args) => Effect.Effect<A, E, R | CommandContext | I18n | WithToast>;
385
+ /**
386
+ * Stream-aware version of `withDefaultToast`. Use this as a combinator inside `streamFn`
387
+ * (or anywhere a `Stream` needs toast lifecycle handling) instead of `withDefaultToast`.
388
+ *
389
+ * Unlike `withDefaultToast` (which only wraps the initial `Effect`), this combinator:
390
+ * - Shows the "waiting" toast **before** the stream starts
391
+ * - Updates the waiting toast with progress text when `progress` is set and a new element arrives
392
+ * - Shows the "success" toast only **after** the stream drains fully without error
393
+ * - Shows the "failure" toast if the stream errors or fails
394
+ *
395
+ * Accepts either a `Stream<A, E, R>` or an `Effect<Stream<A, E, R>, EE, ER>` as input,
396
+ * so it works in both the `NonGenStream` and `StreamGen` overloads of `streamFn`.
397
+ *
398
+ * @example
399
+ * ```ts
400
+ * Command.streamFn("exportData")(
401
+ * function*(arg, ctx) { return makeExportStream(arg.id) },
402
+ * Command.withDefaultToastStream({
403
+ * progress: (r) =>
404
+ * AsyncResult.isSuccess(r) && r.value._tag === "OperationProgress"
405
+ * ? { text: `${r.value.completed}/${r.value.total}`, percentage: r.value.completed / r.value.total * 100 }
406
+ * : undefined
407
+ * })
408
+ * )
409
+ * ```
410
+ */
411
+ withDefaultToastStream: <A, E, R, Args extends Array<unknown>>(options?: {
412
+ stableToastId?: undefined | true | string | ((id: string, arg: NoInfer<Args>[0], ctx: NoInfer<Args>[1]) => true | string | undefined);
413
+ errorRenderer?: (e: E, action: string, arg: NoInfer<Args>[0], ctx: NoInfer<Args>[1]) => string | undefined;
414
+ showSpanInfo?: false;
415
+ onWaiting?: null | undefined | string | ((id: string, arg: NoInfer<Args>[0], ctx: NoInfer<Args>[1]) => string | null | undefined);
416
+ onSuccess?: null | undefined | string | ((a: A, action: string, arg: NoInfer<Args>[0], ctx: NoInfer<Args>[1]) => string | null | undefined);
417
+ /** Map each stream element to a progress label. When non-`undefined`, updates both the active waiting toast and the `CommandProgress` service (for CommandButton progress display). */
418
+ progress?: (result: AsyncResult.AsyncResult<A, E>) => Progress | undefined;
419
+ }) => (self: Stream.Stream<A, E, R> | Effect.Effect<Stream.Stream<A, E, R>, any, any>, ...args: Args) => Stream.Stream<A, E, R | I18n | Toast | CommandContext>;
420
+ /** borrowing the idea from Families in Effect Atom */
421
+ family: <T extends object, Arg, ArgIn = Arg>(maker: (arg: Arg) => T, keyMaker?: (arg: ArgIn) => Arg) => (arg: ArgIn) => T;
422
+ };
423
+ export declare class CommanderImpl<RT, RTHooks> {
424
+ private readonly rt;
425
+ private readonly intl;
426
+ private readonly hooks;
427
+ constructor(rt: Context.Context<RT>, intl: I18n, hooks: Layer.Layer<RTHooks, never, RT>);
428
+ readonly makeContext: <const Id extends string, const I18nKey extends string = Id>(id: Id, options?: FnOptionsInternal<I18nKey>) => {
429
+ id: string;
430
+ i18nKey: string;
431
+ action: string;
432
+ label: string;
433
+ namespace: string;
434
+ namespaced: (key: string) => string;
435
+ state?: IntlRecord | undefined;
436
+ };
437
+ readonly makeCommand: <const Id extends string, const State extends IntlRecord | undefined, const I18nKey extends string = Id>(id_: Id | {
438
+ id: Id;
439
+ }, options?: FnOptions<Id, I18nKey, State>, errorDef?: Error) => (<Arg, A, E, R extends RT | RTHooks | CommandContext | `Commander.Command.${Id}.state`>(handler: (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<A, E, R>) => {
440
+ id: import("vue").UnwrapRef<Id>;
441
+ i18nKey: string;
442
+ namespace: string;
443
+ namespaced: (key: string) => string;
444
+ result: AsyncResult.AsyncResult<A, E>;
445
+ progress: undefined;
446
+ waiting: boolean;
447
+ blocked: boolean;
448
+ allowed: boolean;
449
+ action: string;
450
+ label: string;
451
+ state: State;
452
+ handle: ((arg: Arg) => Fiber.Fiber<Exit.Exit<A, E>, never>) & {
453
+ action: ComputedRef<string>;
454
+ label: ComputedRef<string>;
455
+ };
456
+ }) & {
457
+ id: Id;
458
+ };
459
+ /**
460
+ * Define a Command for handling user actions with built-in error reporting and state management.
461
+ *
462
+ * @param id The internal identifier for the action. Used as a tracing span and to lookup
463
+ * the user-facing name via internationalization (`action.${id}`).
464
+ * @param options Optional configuration for internationalization and state.
465
+ * @param options.i18nCustomKey Custom i18n key to use instead of `id` (e.g., for grouping similar actions)
466
+ * @param options.state Optional reactive state object (or function returning one) that is
467
+ * made available to the command effects and can be used for i18n interpolation.
468
+ * The state is captured at the start of each command execution and remains stable throughout.
469
+ * @returns A function that executes the command when called (e.g., directly in `@click` handlers).
470
+ * Built-in error reporting handles failures automatically.
471
+ *
472
+ * **Effect Context**: Effects have access to the `CommandContext` service, which provides
473
+ * the user-facing action name.
474
+ *
475
+ * **Returned Properties**:
476
+ * - `action`: User-facing action name from intl messages (useful for button labels)
477
+ * - `result`: The command result state
478
+ * - `waiting`: Boolean indicating if the command is in progress (shorthand for `result.waiting`)
479
+ * - `handle`: Function to execute the command
480
+ * - `exec`: The raw Effect that will be executed when calling `handle` (for advanced use cases)
481
+ * - `i18nKey`, `namespace`, `namespaced`: Helpers for internationalization keys
482
+ *
483
+ * **User Feedback**: Use the `withDefaultToast` helper for status notifications, or render
484
+ * the `result` inline for custom UI feedback.
485
+ */
486
+ fn: <const Id extends string, const State extends IntlRecord = IntlRecord, const I18nKey extends string = Id>(id: Id | {
487
+ id: Id;
488
+ }, options?: FnOptions<Id, I18nKey, State>) => Commander.Gen<RT | RTHooks, Id, I18nKey, State> & Commander.NonGen<RT | RTHooks, Id, I18nKey, State> & {
489
+ state: Context.Service<`Commander.Command.${Id}.state`, State>;
490
+ };
491
+ /**
492
+ * Internal factory for stream-backed commands. Accepts a handler that returns a `Stream` directly.
493
+ * Services (`CommandContext`, `stateTag`) are provided to the stream via `Stream.provideServiceEffect`.
494
+ */
495
+ readonly makeStreamCommand: <const Id extends string, const State extends IntlRecord | undefined, const I18nKey extends string = Id>(id_: Id | {
496
+ id: Id;
497
+ }, options?: FnOptions<Id, I18nKey, State>, errorDef?: Error) => (<Arg, SA, SE, SR>(handler: (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Stream.Stream<SA, SE, SR>) => {
498
+ id: import("vue").UnwrapRef<Id>;
499
+ i18nKey: string;
500
+ namespace: string;
501
+ namespaced: (key: string) => string;
502
+ result: AsyncResult.AsyncResult<SA, SE>;
503
+ progress: string | {
504
+ readonly text: string;
505
+ readonly percentage: number;
506
+ } | undefined;
507
+ waiting: boolean;
508
+ blocked: boolean;
509
+ allowed: boolean;
510
+ action: string;
511
+ label: string;
512
+ state: State;
513
+ handle: ((arg: Arg) => Fiber.Fiber<unknown, unknown>) & {
514
+ action: ComputedRef<string>;
515
+ label: ComputedRef<string>;
516
+ };
517
+ }) & {
518
+ id: Id;
519
+ };
520
+ /**
521
+ * Define a stream-backed Command for handling user actions.
522
+ *
523
+ * Like `fn`, but the body generator (or function) must **return** a `Stream` rather than
524
+ * an `Effect`. The command's `waiting` state stays `true` while the stream is running and
525
+ * is set to `false` once it terminates. The reactive `result` ref is updated for every
526
+ * value emitted by the stream.
527
+ *
528
+ * Three handler shapes are accepted:
529
+ * 1. **Generator returning a Stream** (primary) — may yield Effects freely before returning the stream:
530
+ * ```ts
531
+ * Command.streamFn("exportData")(
532
+ * function*(arg, ctx) {
533
+ * const token = yield* getAuthToken
534
+ * return Stream.fromEffect(startExport(token, arg.id)).pipe(
535
+ * Stream.flatMap((job) => pollProgress(job.id))
536
+ * )
537
+ * }
538
+ * )
539
+ * ```
540
+ * 2. **Function returning a Stream directly**: `(arg, ctx) => Stream.make(1, 2, 3)`
541
+ * 3. **Function returning `Effect<Stream>`**: `(arg, ctx) => Effect.map(setup, (s) => s.stream)`
542
+ *
543
+ * @param id The internal identifier for the action (used for tracing and i18n lookup).
544
+ * @param options Same options as `fn` (`state`, `blockKey`, `waitKey`, `allowed`, `i18nCustomKey`).
545
+ *
546
+ * **Progress** — use `Command.mapProgress(fn)` as a stream pipe operator; the mapper receives
547
+ * `AsyncResult<A, E>` (each value wrapped as `AsyncResult.success(v, { waiting: true })`),
548
+ * matching the same shape as CommandButton’s `:progress-map` prop. Or call
549
+ * `Command.updateProgress(p)` for imperative control:
550
+ *
551
+ * ```ts
552
+ * // mapProgress as a combinator arg (outside the handler):
553
+ * Command.streamFn("exportData")(
554
+ * function*(arg, ctx) { return makeExportStream(arg.id) },
555
+ * (s) => s.pipe(Command.mapProgress((r) => AsyncResult.isSuccess(r) && r.value._tag === "OperationProgress" ? { text: `${r.value.completed}/${r.value.total}` } : undefined))
556
+ * )
557
+ *
558
+ * // Or inline inside the handler body:
559
+ * Command.streamFn("exportData")(function*(arg, ctx) {
560
+ * return makeExportStream(arg.id).pipe(Command.mapProgress((r) => AsyncResult.isSuccess(r) ? ... : undefined))
561
+ * })
562
+ * ```
563
+ *
564
+ * **Pipeable combinators** — the 2nd–Nth args follow the same pattern as `fn`: each combinator
565
+ * receives `(stream, arg, ctx)` and returns a transformed stream:
566
+ * ```ts
567
+ * Command.streamFn("exportData")(
568
+ * handler,
569
+ * (s, arg, ctx) => s.pipe(Command.mapProgress(fn), Stream.take(100))
570
+ * )
571
+ * ```
572
+ *
573
+ * **Returned Properties**: `action`, `label`, `result`, `progress`, `waiting`, `blocked`,
574
+ * `allowed`, `handle`, `i18nKey`, `namespace`, `namespaced`.
575
+ */
576
+ streamFn: <const Id extends string, const State extends IntlRecord = IntlRecord, const I18nKey extends string = Id>(id: Id | {
577
+ id: Id;
578
+ }, options?: FnOptions<Id, I18nKey, State>) => Commander.StreamGen<RT | RTHooks, Id, I18nKey, State> & Commander.NonGenStream<RT | RTHooks, Id, I18nKey, State> & {
579
+ state: Context.Service<`Commander.Command.${Id}.state`, State>;
580
+ };
581
+ /** @deprecated */
582
+ alt2: <const Id extends string, MutArg, MutA, MutE, MutR, const I18nKey extends string = Id, State extends IntlRecord | undefined = undefined>(id: Id | {
583
+ id: Id;
584
+ mutate: (arg: MutArg) => Effect.Effect<MutA, MutE, MutR>;
585
+ } | (((arg: MutArg) => Effect.Effect<MutA, MutE, MutR>) & {
586
+ id: Id;
587
+ }), options?: FnOptions<Id, I18nKey, State>) => Commander.CommandContextLocal<Id, I18nKey> & (<A, E, R extends RT | RTHooks | CommandContext | `Commander.Command.${Id}.state`, Arg = void>(handler: (ctx: Effect.fn.Traced & Effect.fn.Untraced & Commander.CommandContextLocal<Id, I18nKey> & {
588
+ mutate: (arg: Arg) => Effect.Effect<MutA, MutE, MutR>;
589
+ }) => (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<A, E, R>) => Commander.CommandOut<Arg, A, E, R, Id, I18nKey, State>);
590
+ alt: <const Id extends string, const I18nKey extends string = Id, State extends IntlRecord | undefined = undefined>(id: Id, customI18nKey?: I18nKey) => Commander.CommandContextLocal<Id, I18nKey> & (<A, E, R extends RT | CommandContext | `Commander.Command.${Id}.state`, Arg = void>(handler: (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Effect.Effect<A, E, R>) => Commander.CommandOut<Arg, A, E, R, Id, I18nKey, State>);
591
+ /**
592
+ * Define a Command for handling user actions with built-in error reporting and state management.
593
+ *
594
+ * @param mutation The mutation function to take the identifier and initial handler from. Used as a tracing span and to lookup
595
+ * the user-facing name via internationalization (`action.${id}`).
596
+ * @param options Optional configuration for internationalization and state.
597
+ * @param options.i18nCustomKey Custom i18n key to use instead of `id` (e.g., for grouping similar actions)
598
+ * @param options.state Optional reactive state object (or function returning one) that is
599
+ * made available to the command effects and can be used for i18n interpolation.
600
+ * The state is captured at the start of each command execution and remains stable throughout.
601
+ * @returns A function that executes the command when called (e.g., directly in `@click` handlers).
602
+ * Built-in error reporting handles failures automatically.
603
+ *
604
+ * **Effect Context**: Effects have access to the `CommandContext` service, which provides
605
+ * the user-facing action name.
606
+ *
607
+ * **Returned Properties**:
608
+ * - `action`: User-facing action name from intl messages (useful for button labels)
609
+ * - `result`: The command result state
610
+ * - `waiting`: Boolean indicating if the command is in progress (shorthand for `result.waiting`)
611
+ * - `handle`: Function to execute the command
612
+ * - `exec`: The raw Effect that will be executed when calling `handle` (for advanced use cases)
613
+ * - `i18nKey`, `namespace`, `namespaced`: Helpers for internationalization keys
614
+ *
615
+ * **User Feedback**: Use the `withDefaultToast` helper for status notifications, or render
616
+ * the `result` inline for custom UI feedback.
617
+ */
618
+ streamWrap: <const Id extends string, Arg, SA, SE, SR, const State extends IntlRecord = IntlRecord, I18nKey extends string = Id>(handler: (arg: Arg, ctx: Commander.CommandContextLocal2<Id, I18nKey, State>) => Stream.Stream<SA, SE, SR>, id: Id, options?: FnOptions<Id, I18nKey, State>) => Commander.StreamerWrap<RT | RTHooks, Id, I18nKey, State, Arg, SA, SE, SR>;
619
+ wrap: <const Id extends string, Arg, A, E, R, const State extends IntlRecord = IntlRecord, I18nKey extends string = Id>(mutation: {
620
+ mutate: (arg: Arg) => Effect.Effect<A, E, R>;
621
+ id: Id;
622
+ } | (((arg: Arg) => Effect.Effect<A, E, R>) & {
623
+ id: Id;
624
+ }), options?: FnOptions<Id, I18nKey, State>) => Commander.CommanderWrap<RT | RTHooks, Id, I18nKey, State, Arg, A, E, R>;
625
+ }
626
+ declare const Commander_base: Context.ServiceClass<Commander, "Commander", <RT, RTHooks>(rt: Context.Context<RT>, rtHooks: Layer.Layer<RTHooks, never, RT>) => CommanderImpl<RT, RTHooks>> & {
627
+ readonly make: Effect.Effect<<RT, RTHooks>(rt: Context.Context<RT>, rtHooks: Layer.Layer<RTHooks, never, RT>) => CommanderImpl<RT, RTHooks>, never, I18n>;
628
+ };
629
+ export declare class Commander extends Commander_base {
630
+ static readonly DefaultWithoutDependencies: Layer.Layer<Commander, never, I18n>;
631
+ static readonly Default: Layer.Layer<Commander, never, I18n>;
632
+ }
633
+ export {};
634
+ //# sourceMappingURL=commander.d.ts.map