@collective-intelligence/external-apps-client-sdk-react 0.2.10 → 0.2.11

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 (2) hide show
  1. package/dist/effect.d.ts +13 -26
  2. package/package.json +3 -3
package/dist/effect.d.ts CHANGED
@@ -7,7 +7,7 @@ import * as Effect from 'effect/Effect';
7
7
  import * as Layer from 'effect/Layer';
8
8
  import * as ManagedRuntime from 'effect/ManagedRuntime';
9
9
  import { ReactNode } from 'react';
10
- import { PromiseActorLogic } from 'xstate';
10
+ import { ActorRefFromLogic, MetaObject, PromiseActorLogic, StateMachine } from 'xstate';
11
11
 
12
12
  /** What runs an effect for an actor: a `ManagedRuntime` that provides `R`. */
13
13
  export type EffectRunner<R> = Pick<ManagedRuntime.ManagedRuntime<R, never>, "runPromise">;
@@ -57,38 +57,25 @@ export type EffectTaskContext<A, R> = Readonly<{
57
57
  * A flow with steps of its own, such as a form that saves and then confirms,
58
58
  * is its own machine with `fromEffect` actors, not a task.
59
59
  */
60
- export declare const effectTask: <Input, A, E, R = never>(run: (input: Input) => Effect.Effect<A, E, R>) => import("xstate").StateMachine<Readonly<{
61
- /** The typed error or the defect of the last run, while the task is `failed`. */
62
- error: unknown;
63
- /** The value of the last run, while the task is `done`. */
64
- output: A | undefined;
60
+ export declare const effectTask: <Input, A, E, R = never>(run: (input: Input) => Effect.Effect<A, E, R>) => StateMachine<EffectTaskContext<A, R>, EffectTaskEvent<Input>, Record<string, ActorRefFromLogic<PromiseActorLogic<A, Readonly<{
65
61
  runtime: EffectRunner<R>;
66
- }>, Readonly<{
67
- input: Input;
68
- type: "RUN";
69
- }>, {
70
- [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<A, Readonly<{
71
- runtime: EffectRunner<R>;
72
- task: Input;
73
- }>>> | undefined;
74
- }, {
75
- src: "run";
76
- logic: import("xstate").PromiseActorLogic<A, Readonly<{
62
+ task: Input;
63
+ }>>> | undefined>, {
64
+ id: string | undefined;
65
+ logic: PromiseActorLogic<A, Readonly<{
77
66
  runtime: EffectRunner<R>;
78
67
  task: Input;
79
68
  }>>;
80
- id: string | undefined;
81
- }, never, never, never, "done" | "failed" | "idle" | "running", string, Readonly<{
82
- runtime: EffectRunner<R>;
83
- }>, undefined, EffectTaskEmitted<A>, import("xstate").MetaObject, {
69
+ src: "run";
70
+ }, never, never, never, "done" | "failed" | "idle" | "running", string, EffectTaskInput<R>, undefined, EffectTaskEmitted<A>, MetaObject, {
84
71
  id: "effectTask";
85
72
  states: {
86
- readonly done: {};
87
- readonly failed: {};
88
- readonly idle: {};
89
- readonly running: {};
73
+ readonly done: Record<never, never>;
74
+ readonly failed: Record<never, never>;
75
+ readonly idle: Record<never, never>;
76
+ readonly running: Record<never, never>;
90
77
  };
91
- }, import("xstate").MetaObject>;
78
+ }>;
92
79
  /** The machine `effectTask(run)` makes. */
93
80
  export type EffectTask<Input, A, E = never, R = never> = ReturnType<typeof effectTask<Input, A, E, R>>;
94
81
  export type QueryCacheFetchOptions<Data> = Readonly<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collective-intelligence/external-apps-client-sdk-react",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "React bindings for Collective Intelligence external applications.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -57,7 +57,7 @@
57
57
  "effect": "^4.1.0",
58
58
  "react": ">=18.2 <20",
59
59
  "react-dom": ">=18.2 <20",
60
- "xstate": "^5.32.6"
60
+ "xstate": "^5.33.3"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public"
@@ -88,5 +88,5 @@
88
88
  "vitest": "4.1.10",
89
89
  "xstate": "5.33.3"
90
90
  },
91
- "gitHead": "7972d94333f423906752b69ac20d4ffc44e5d841"
91
+ "gitHead": "6eb615293703ba8e92c566d40ce637fcd6adf7d7"
92
92
  }