@owlmeans/client-flow 0.1.18-rc.2 → 0.1.18-rc.20

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.
package/README.md CHANGED
@@ -12,7 +12,7 @@ Client-side flow orchestration service for managing multi-step workflows in brow
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- bun add @owlmeans/client-flow
15
+ bun add @owlmeans/client-flow@^0.1.18-rc.16
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -75,7 +75,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
75
75
  your project's skill store (`.agents/skills/`):
76
76
 
77
77
  ```sh
78
- npx @owlmeans/agent-skills
78
+ npx @owlmeans/agent-skills@^0.1.18-rc.15
79
79
  ```
80
80
 
81
81
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/client-flow",
4
- "version": "0.1.18-rc.0",
5
- "generatedAt": "2026-08-16T22:20:50.497Z",
4
+ "version": "0.1.18-rc.20",
5
+ "generatedAt": "2026-09-12T08:39:52.712Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: client-flow
3
- description: How to use @owlmeans/client-flow — client-side flow execution service that drives @owlmeans/flow definitions through state transitions. Auto-invoked when importing client flow primitives.
3
+ description: How to use @owlmeans/client-flow — the platform-agnostic flow service (makeBasicFlowService) that loads @owlmeans/flow definitions from config records, and createFlowClient(context, nav), the runner a screen drives to advance a flow and navigate to each step. Auto-invoked when importing client flow primitives, registering a flow service, or moving a screen to the next flow step.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,23 +8,126 @@ user-invocable: false
8
8
  # @owlmeans/client-flow
9
9
 
10
10
  **Layer:** Client
11
- **Install:** `"@owlmeans/client-flow": "^0.1.18-rc.0"` in `dependencies`
11
+ **Install:** `"@owlmeans/client-flow": "^0.1.18-rc.20"` in `dependencies`
12
+
13
+ Two objects, with different lifetimes. The **service** lives on the context and owns the flow
14
+ definitions and the one live `FlowModel`. The **client** is built per screen, wraps that model with
15
+ a `Navigator`, and is what a component actually calls.
12
16
 
13
17
  ## Key Exports
14
18
 
15
19
  | Export | Description |
16
20
  |--------|-------------|
17
- | `makeFlowService()` | Client flow execution service factory |
18
- | `client` helpers | Client-side flow client/runner |
19
- | Constants | Flow service aliases |
21
+ | `makeBasicFlowService(alias?)` | The service factory — the platform-agnostic half. `alias` defaults to `DEFAULT_ALIAS`, which is the only value the runner can find |
22
+ | `FlowService` | `ready()` `state()` `begin(slug?, from?)` `load(token)` `provideFlow` `config()` `proceed(req?, dryRun?)` `resolvePair()` `supplied` `flow` |
23
+ | `createFlowClient(context, nav)` | The runner a screen drives. `nav` is the `Navigator` from `useNavigate()` in `@owlmeans/client` |
24
+ | `FlowClient` | `boot(target: string \| null, from?)` `setup(model)` `flow()` `service()` `proceed(transition, req?)` `persist()` |
25
+ | `StateRecord` / `StateResource` | The `FlowState` stored as a record, and the client resource holding it |
26
+ | `ResolvePair` | The `{ resolve, reject }` behind `service.supplied` |
27
+ | `DEFAULT_ALIAS` (`flow`) | The service alias |
28
+ | `FLOW_STATE` (`state:flow`) | Alias of the client resource the state is persisted in, and the record id inside it |
29
+ | `EXTRA_FLOW` (`extra-flow`) · `REHACK_MOD` (`__redirect`) | Id of the second, side-band state record kept in the same resource, and the alias of the entrypoint synthesized to address a target service |
30
+
31
+ ## Wiring
32
+
33
+ ```typescript
34
+ import { makeBasicFlowService } from '@owlmeans/client-flow'
35
+ context.registerService(makeBasicFlowService())
36
+ ```
37
+
38
+ **Register it under `DEFAULT_ALIAS`, which is what the no-argument call does.** `createFlowClient`
39
+ resolves its service with a hardcoded `context.service(DEFAULT_ALIAS)`, and `useFlow` in
40
+ `@owlmeans/web-flow` looks the same alias up, so a service registered under any other name is never
41
+ reached and the lookup throws `SyntaxError('Service <alias> not found')`. The `alias` argument
42
+ builds a second instance for a caller that addresses it itself — nothing on the runner path can.
43
+
44
+ A browser app registers the web service instead — `appendFlowService` from `@owlmeans/web-flow`,
45
+ which builds on this one and also creates the `FLOW_STATE` resource.
46
+
47
+ ## What the service does
48
+
49
+ Initialization reads every `FLOW_RECORD` config record through the config resource and turns each
50
+ into a `Flow`: `$`-prefixed `service`, `module` and `path` values are resolved against
51
+ `FlowConfig.services` / `modules` / `pathes`, and one serialized entry state is precomputed per
52
+ initial step. `provideFlow` then answers by name out of that table and throws `UnknownFlow` for a
53
+ name it does not hold — which is exactly what `makeFlowModel` needs in order to fall back to
54
+ reading the string as a serialized token.
55
+
56
+ `begin(slug?, from?)` starts a flow — `slug` defaults to `FlowConfig.defaultFlow`, then to
57
+ `STD_AUTH_FLOW`, and `from` names which **initial** step to enter — while `load(token)` restores one.
58
+ Both set `service.flow` and replace `supplied` with an already-resolved promise. `state()` awaits
59
+ `supplied` before answering, so a screen can ask for the state before the URL has been read; the
60
+ platform half is what resolves the original `supplied` (through `resolvePair()`) when there was
61
+ nothing to restore.
62
+
63
+ `proceed` on the basic service throws `FlowUnsupported('service.proceed')`. Leaving the flow for
64
+ another service is platform work, and `@owlmeans/web-flow` is what supplies it.
65
+
66
+ ## What the client does
20
67
 
21
- ## Usage
68
+ `createFlowClient` needs a `Navigator` — the one `useNavigate()` from `@owlmeans/client` returns.
69
+ In a browser `useFlow()` from `@owlmeans/web-flow` builds the whole thing for the rendering screen;
70
+ build it by hand only outside that.
22
71
 
23
72
  ```typescript
24
- import { makeFlowService } from '@owlmeans/client-flow'
25
- context.registerService(makeFlowService())
73
+ import { useContext, useNavigate } from '@owlmeans/client'
74
+ import { createFlowClient } from '@owlmeans/client-flow'
75
+
76
+ const context = useContext()
77
+ const nav = useNavigate()
78
+
79
+ const client = await createFlowClient(context, nav).boot(targetServiceAlias) // `null` for none
80
+ // ...or createFlowClient(context, nav).setup(model) when a model is already loaded
81
+
82
+ await client.proceed(client.flow().next()) // advance and go to the next step
83
+ await client.persist() // survive a reload
26
84
  ```
27
85
 
86
+ `boot(target, from?)` takes `string | null`, and `null` is a meaningful argument — it says "no
87
+ target named", which is what the browser hook passes when no `service` query parameter is present.
88
+
89
+ It waits for the service and asks for the state it already holds. **A live model is adopted as it
90
+ is and nothing else runs** — no target is recorded on that path, and `FlowTargetError` cannot be
91
+ raised from it. Everything below happens only when the service holds no model:
92
+
93
+ 1. When `FLOW_STATE` is registered and holds a record, its flow is begun and the record set as the
94
+ model's state; a `null` `target` argument then falls back to `record.service`.
95
+ 2. With no such record, a fresh flow is begun (`begin(undefined, from)`).
96
+ 3. If a target alias resolved by then, `cfg.shortAlias` is translated to `cfg.service`, the alias is
97
+ looked up with `context.serviceRoute`, and a lookup that throws is re-raised as
98
+ `FlowTargetError`. The resolved service is recorded on the model with `target()`.
99
+
100
+ With no alias and no restored record, step 3 is skipped and the state's `service` stays the empty
101
+ string it starts as — `client.service()` then asks `context.serviceRoute('')`, which throws. That
102
+ is the shape of "this flow was booted without a target".
103
+
104
+ `proceed(transition, req?)` looks the transition's **destination** step up first and raises
105
+ `FlowStepMissconfigured(<that step>)` when it carries no `module` — the check is on the step being
106
+ entered, not the one being left. It then transits the model, merging the previous payload with
107
+ `req.params` and `req.query`, and addresses the destination's entrypoint. When that step's `service`
108
+ is `TARGET_SERVICE`, an entrypoint is synthesized under `REHACK_MOD` pointing at the dispatcher path
109
+ of the state's own target service, so "go back to whoever started this" needs no declaration.
110
+
111
+ A **relative** URL is an in-app `nav.navigate`: the document stays and nothing serializes the flow
112
+ onto the URL — the live model on the service is what carries it, which is why `persist()` exists.
113
+ Only a URL starting with `http` is handed on to `service.proceed`, the browser redirect that puts
114
+ the serialized flow in the query string. There is no `dryRun` on this method; that argument belongs
115
+ to the service's own `proceed`.
116
+
117
+ `persist()` saves the state under `FLOW_STATE` and answers `false` when no such resource is
118
+ registered, so persistence is opt-in rather than a hard requirement.
119
+
28
120
  ## Depends On
29
121
 
30
- - `@owlmeans/flow`, `@owlmeans/client-context`, `@owlmeans/client-entrypoint`
122
+ - `@owlmeans/flow` the definitions, the model and the error family
123
+ - `@owlmeans/client`, `@owlmeans/client-context`, `@owlmeans/client-entrypoint`,
124
+ `@owlmeans/client-resource`
125
+ - `@owlmeans/config` (the config resource the definitions are read from), `@owlmeans/auth-common`
126
+ (the dispatcher path), `@owlmeans/context`, `@owlmeans/entrypoint`, `@owlmeans/error`,
127
+ `@owlmeans/resource`, `@owlmeans/route`
128
+ - `react` (peer)
129
+
130
+ ## Related
131
+
132
+ - [[flow]] — the definition, state and serialization contract
133
+ - [[web-flow]] — the browser service that supplies `proceed` and `goHome`
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAQ5D,OAAO,KAAK,EAAE,UAAU,EAA8B,MAAM,YAAY,CAAA;AAIxE,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,SAAS,KAAG,UAgHjH,CAAA"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAS5D,OAAO,KAAK,EAAE,UAAU,EAA8B,MAAM,YAAY,CAAA;AAIxE,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,SAAS,KAAG,UAiHjH,CAAA"}
package/build/client.js CHANGED
@@ -1,4 +1,5 @@
1
- import { entrypoint, stab } from '@owlmeans/client-entrypoint';
1
+ import { bindScreen, stab } from '@owlmeans/client-entrypoint';
2
+ import { openProtocol } from '@owlmeans/entrypoint';
2
3
  import { route, frontend } from '@owlmeans/route';
3
4
  import { FlowStepMissconfigured, FlowTargetError, TARGET_SERVICE } from '@owlmeans/flow';
4
5
  import { ResilientError } from '@owlmeans/error';
@@ -67,15 +68,16 @@ export const createFlowClient = (context, nav) => {
67
68
  let redirectTo;
68
69
  // @TODO Properly use target service - as a way to build the redirect URL
69
70
  if (step.service === TARGET_SERVICE) {
70
- context.registerEntrypoint(entrypoint(route(REHACK_MOD, DISPATCHER_PATH, frontend({ service: model.state().service })), stab));
71
- redirectTo = context.entrypoint(REHACK_MOD);
72
- await redirectTo.resolve();
71
+ const redirectProtocol = openProtocol(route(REHACK_MOD, DISPATCHER_PATH, frontend({ service: model.state().service })));
72
+ const bound = bindScreen(redirectProtocol, stab);
73
+ context.registerEntrypoint(bound);
74
+ redirectTo = bound;
73
75
  step.module = REHACK_MOD;
74
76
  }
75
77
  else {
76
78
  redirectTo = context.entrypoint(step.module);
77
79
  }
78
- const [url] = await redirectTo.call(req);
80
+ const url = await redirectTo.url(req);
79
81
  if (url.startsWith('http')) {
80
82
  await service.proceed(req);
81
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAE9D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAExF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC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AAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;gBACjC,UAAU,GAAG,KAA4C,CAAA;gBACzD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA;YAC1B,CAAC;iBAAM,CAAC;gBACN,UAAU,GAAG,OAAO,CAAC,UAAU,CAAmB,IAAI,CAAC,MAAM,CAAC,CAAA;YAChE,CAAC;YAED,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAErC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC3B,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC5B,CAAC;iBAAM,CAAC;gBACN,MAAM,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;YACrC,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC;gBACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAgB,UAAU,CAAC,CAAA;gBAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;gBAC5B,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAA;gBAElD,OAAO,IAAI,CAAA;YACb,CAAC;YAED,OAAO,KAAK,CAAA;QACd,CAAC;KACF,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/client-flow",
3
- "version": "0.1.18-rc.2",
3
+ "version": "0.1.18-rc.20",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,18 +21,18 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@owlmeans/auth-common": "^0.1.18-rc.2",
25
- "@owlmeans/client": "^0.1.18-rc.2",
26
- "@owlmeans/client-context": "^0.1.18-rc.2",
27
- "@owlmeans/client-entrypoint": "^0.1.18-rc.2",
28
- "@owlmeans/client-resource": "^0.1.18-rc.2",
29
- "@owlmeans/config": "^0.1.18-rc.2",
30
- "@owlmeans/context": "^0.1.18-rc.2",
31
- "@owlmeans/error": "^0.1.18-rc.2",
32
- "@owlmeans/flow": "^0.1.18-rc.2",
33
- "@owlmeans/entrypoint": "^0.1.18-rc.2",
34
- "@owlmeans/resource": "^0.1.18-rc.2",
35
- "@owlmeans/route": "^0.1.18-rc.2"
24
+ "@owlmeans/auth-common": "^0.1.18-rc.16",
25
+ "@owlmeans/client": "^0.1.18-rc.19",
26
+ "@owlmeans/client-context": "^0.1.18-rc.16",
27
+ "@owlmeans/client-entrypoint": "^0.1.18-rc.16",
28
+ "@owlmeans/client-resource": "^0.1.18-rc.16",
29
+ "@owlmeans/config": "^0.1.18-rc.15",
30
+ "@owlmeans/context": "^0.1.18-rc.11",
31
+ "@owlmeans/error": "^0.1.18-rc.11",
32
+ "@owlmeans/flow": "^0.1.18-rc.17",
33
+ "@owlmeans/entrypoint": "^0.1.18-rc.14",
34
+ "@owlmeans/resource": "^0.1.18-rc.12",
35
+ "@owlmeans/route": "^0.1.18-rc.12"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "react": "*"
package/src/client.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import type { ClientContext, Navigator } from '@owlmeans/client'
2
2
  import type { ClientConfig } from '@owlmeans/client-context'
3
3
  import type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
4
- import { entrypoint, stab } from '@owlmeans/client-entrypoint'
4
+ import { bindScreen, stab } from '@owlmeans/client-entrypoint'
5
+ import { openProtocol } from '@owlmeans/entrypoint'
5
6
  import type { ResolvedServiceRoute } from '@owlmeans/route'
6
7
  import { route, frontend } from '@owlmeans/route'
7
8
  import { FlowStepMissconfigured, FlowTargetError, TARGET_SERVICE } from '@owlmeans/flow'
@@ -90,17 +91,18 @@ export const createFlowClient = <C extends ClientConfig, T extends ClientContext
90
91
  let redirectTo: ClientEntrypoint<string>
91
92
  // @TODO Properly use target service - as a way to build the redirect URL
92
93
  if (step.service === TARGET_SERVICE) {
93
- context.registerEntrypoint(entrypoint(
94
- route(REHACK_MOD, DISPATCHER_PATH, frontend({ service: model.state().service })), stab
95
- ))
96
- redirectTo = context.entrypoint<ClientEntrypoint<string>>(REHACK_MOD)
97
- await redirectTo.resolve()
94
+ const redirectProtocol = openProtocol(
95
+ route(REHACK_MOD, DISPATCHER_PATH, frontend({ service: model.state().service })),
96
+ )
97
+ const bound = bindScreen(redirectProtocol, stab)
98
+ context.registerEntrypoint(bound)
99
+ redirectTo = bound as unknown as ClientEntrypoint<string>
98
100
  step.module = REHACK_MOD
99
101
  } else {
100
102
  redirectTo = context.entrypoint<ClientEntrypoint>(step.module)
101
103
  }
102
104
 
103
- const [url] = await redirectTo.call<string>(req)
105
+ const url = await redirectTo.url(req)
104
106
 
105
107
  if (url.startsWith('http')) {
106
108
  await service.proceed(req)
package/build/.gitkeep DELETED
File without changes