@owlmeans/server-planning 0.1.18-rc.22 → 0.1.18-rc.23

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
@@ -10,7 +10,7 @@ the `@owlmeans/server-planning/store` subpath.
10
10
  ## Installation
11
11
 
12
12
  ```sh
13
- bun add @owlmeans/server-planning@^0.1.18-rc.22 @owlmeans/planning@^0.1.18-rc.19 ajv
13
+ bun add @owlmeans/server-planning@^0.1.18-rc.23 @owlmeans/planning@^0.1.18-rc.20 ajv
14
14
  ```
15
15
 
16
16
  ## Concepts
@@ -176,7 +176,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
176
176
  your project's skill store (`.agents/skills/`):
177
177
 
178
178
  ```sh
179
- npx @owlmeans/agent-skills@^0.1.18-rc.49
179
+ npx @owlmeans/agent-skills@^0.1.18-rc.51
180
180
  ```
181
181
 
182
182
  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/server-planning",
4
- "version": "0.1.18-rc.22",
5
- "generatedAt": "2026-10-05T21:03:06.363Z",
4
+ "version": "0.1.18-rc.23",
5
+ "generatedAt": "2026-10-06T11:45:57.652Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/server-planning
9
9
 
10
10
  **Layer:** Server
11
- **Install:** `"@owlmeans/server-planning": "^0.1.18-rc.22"` in `dependencies` (`ajv` is a peer)
11
+ **Install:** `"@owlmeans/server-planning": "^0.1.18-rc.23"` in `dependencies` (`ajv` is a peer)
12
12
 
13
13
  The general implementation of `@owlmeans/planning`: the planning service (a plugin host), the
14
14
  scoped facade, the executor every write goes through, the in-memory reference store, the commit
@@ -0,0 +1,16 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import type { PlanningProtocols } from '@owlmeans/planning';
3
+ import type { Context, PlanningHandlerOptions } from '../types.js';
4
+ type RequestHandler = ReturnType<ReturnType<typeof handlers<Context>>['request']>;
5
+ /** Cards of the caller's entity; the query arrives in its wire shape and is decoded here. */
6
+ export declare const listCards: (protocol: PlanningProtocols['card']['list'], opts?: PlanningHandlerOptions) => RequestHandler;
7
+ /** Intrinsic counts of DIRECT children per parent. */
8
+ export declare const summarizeCards: (protocol: PlanningProtocols['card']['summary'], opts?: PlanningHandlerOptions) => RequestHandler;
9
+ /** @throws {WorkcardNotFound} for an absent card and for another entity's alike */
10
+ export declare const getCard: (protocol: PlanningProtocols['card']['get'], opts?: PlanningHandlerOptions) => RequestHandler;
11
+ /** One card's log. */
12
+ export declare const listCardTransitions: (protocol: PlanningProtocols['card']['transitions'], opts?: PlanningHandlerOptions) => RequestHandler;
13
+ /** One card's specifications — the current document per category unless `all`. */
14
+ export declare const listCardSpecifications: (protocol: PlanningProtocols['card']['specifications'], opts?: PlanningHandlerOptions) => RequestHandler;
15
+ export {};
16
+ //# sourceMappingURL=cards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../src/actions/cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAI/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,KAAK,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAEjF,6FAA6F;AAC7F,eAAO,MAAM,SAAS,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,sBAAsB,KAAG,cAKlG,CAAA;AAEL,sDAAsD;AACtD,eAAO,MAAM,cAAc,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,SAAS,sBAAsB,KAAG,cAM1G,CAAA;AAEL,mFAAmF;AACnF,eAAO,MAAM,OAAO,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,sBAAsB,KAAG,cAK/F,CAAA;AAEL,sBAAsB;AACtB,eAAO,MAAM,mBAAmB,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,SAAS,sBAAsB,KAAG,cAMnH,CAAA;AAEL,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC,SAAS,sBAAsB,KAAG,cAMzH,CAAA"}
@@ -0,0 +1,32 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { decodeSpecificationQuery, decodeSummaryQuery, decodeTransitionQuery, decodeWorkcardQuery, } from '@owlmeans/planning';
3
+ import { concealed, handlerFacade } from '../utils/index.js';
4
+ /** Cards of the caller's entity; the query arrives in its wire shape and is decoded here. */
5
+ export const listCards = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
6
+ const facade = await handlerFacade(ctx, req, opts);
7
+ return await facade.cards.list(decodeWorkcardQuery(req.query));
8
+ }));
9
+ /** Intrinsic counts of DIRECT children per parent. */
10
+ export const summarizeCards = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
11
+ const facade = await handlerFacade(ctx, req, opts);
12
+ const { parents, ...query } = decodeSummaryQuery(req.query);
13
+ return await facade.cards.summary(parents, query);
14
+ }));
15
+ /** @throws {WorkcardNotFound} for an absent card and for another entity's alike */
16
+ export const getCard = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
17
+ const facade = await handlerFacade(ctx, req, opts);
18
+ return await facade.cards.get(`${req.params.id}`);
19
+ }));
20
+ /** One card's log. */
21
+ export const listCardTransitions = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
22
+ const facade = await handlerFacade(ctx, req, opts);
23
+ const card = await facade.cards.get(`${req.params.id}`);
24
+ return await facade.transitions.list({ ...decodeTransitionQuery(req.query), card: card.id });
25
+ }));
26
+ /** One card's specifications — the current document per category unless `all`. */
27
+ export const listCardSpecifications = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
28
+ const facade = await handlerFacade(ctx, req, opts);
29
+ const card = await facade.cards.get(`${req.params.id}`);
30
+ return await facade.specifications.list(card.id, decodeSpecificationQuery(req.query));
31
+ }));
32
+ //# sourceMappingURL=cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cards.js","sourceRoot":"","sources":["../../src/actions/cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EACL,wBAAwB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,mBAAmB,GACzF,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAI5D,6FAA6F;AAC7F,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAA2C,EAAE,IAA6B,EAAkB,EAAE,CACtH,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IAC7E,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAElD,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AAChE,CAAC,CAAC,CAAC,CAAA;AAEL,sDAAsD;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAA8C,EAAE,IAA6B,EAAkB,EAAE,CAC9H,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAA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CAAA;IAEvD,OAAO,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;AAC9F,CAAC,CAAC,CAAC,CAAA;AAEL,kFAAkF;AAClF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAqD,EAAE,IAA6B,EAAkB,EAAE,CAC7I,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IAC7E,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;IAEvD,OAAO,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAG,EAAE,wBAAwB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AACxF,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,30 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import type { PlanningDefinitions, PlanningProtocols, SchemaDefineReply, SchemaDefineRequest } from '@owlmeans/planning';
3
+ import type { Context, PlanningHandlerOptions } from '../types.js';
4
+ type RequestHandler = ReturnType<ReturnType<typeof handlers<Context>>['request']>;
5
+ /**
6
+ * The schema bundle — what a client loads to answer `can()` with no round trip. Scoped like every
7
+ * other leaf (no organization, no bundle). Where the store holds data-defined schemas it is the
8
+ * resolved layer of the organization, or of the project the `project` query names (a project this
9
+ * scope can see); otherwise the service's code bundle.
10
+ *
11
+ * @throws {WorkcardNotFound} for a project this scope cannot see
12
+ */
13
+ export declare const listSchemas: (protocol: PlanningProtocols['schema']['list'], opts?: PlanningHandlerOptions) => RequestHandler;
14
+ /**
15
+ * Apply one `schema.define` request to a facade's definitions: the declarations in the request's
16
+ * mode (flows before types), then the retirements — answering what was written and the layer as it
17
+ * resolves afterwards.
18
+ */
19
+ export declare const applySchemaRequest: (definitions: PlanningDefinitions, request: SchemaDefineRequest) => Promise<SchemaDefineReply>;
20
+ /**
21
+ * The write of data-defined types and flows. A project layer needs the project in the access's
22
+ * `writes` when the resolver answers it; then `grants.defineSchemas` gates when the resolver answers
23
+ * grants (the organization-wide layer needs `true`, a project layer its id).
24
+ *
25
+ * @throws {PlanningUnsupported} where the store holds no data-defined schemas
26
+ * @throws {PlanningForbidden | SchemaConflict | SchemaSealed | SchemaInvalid | SchemaInUse | WorkcardNotFound}
27
+ */
28
+ export declare const defineSchemas: (protocol: NonNullable<PlanningProtocols['schema']['define']>, opts?: PlanningHandlerOptions) => RequestHandler;
29
+ export {};
30
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/actions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,KAAK,EACV,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAC/E,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,KAAK,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAKjF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,aACZ,iBAAiB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,sBAAsB,KAC3E,cAQE,CAAA;AAEL;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,gBAChB,mBAAmB,WAAW,mBAAmB,KAC7D,OAAO,CAAC,iBAAiB,CAyB3B,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,aACd,WAAW,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,sBAAsB,KAC1F,cAaE,CAAA"}
@@ -0,0 +1,69 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { PlanningUnsupported, SchemaWriteMode } from '@owlmeans/planning';
3
+ import { assertGranted, assertWrites, concealed, handlerScopeOf } from '../utils/index.js';
4
+ const text = (value) => value == null || value === '' ? undefined : `${Array.isArray(value) ? value[0] : value}`;
5
+ /**
6
+ * The schema bundle — what a client loads to answer `can()` with no round trip. Scoped like every
7
+ * other leaf (no organization, no bundle). Where the store holds data-defined schemas it is the
8
+ * resolved layer of the organization, or of the project the `project` query names (a project this
9
+ * scope can see); otherwise the service's code bundle.
10
+ *
11
+ * @throws {WorkcardNotFound} for a project this scope cannot see
12
+ */
13
+ export const listSchemas = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
14
+ const { facade } = await handlerScopeOf(ctx, req, opts);
15
+ if (facade.definitions == null) {
16
+ return facade.schemas.bundle();
17
+ }
18
+ return await facade.definitions.bundle(text(req.query?.project));
19
+ }));
20
+ /**
21
+ * Apply one `schema.define` request to a facade's definitions: the declarations in the request's
22
+ * mode (flows before types), then the retirements — answering what was written and the layer as it
23
+ * resolves afterwards.
24
+ */
25
+ export const applySchemaRequest = async (definitions, request) => {
26
+ const layer = request.project != null ? { project: request.project } : {};
27
+ const declarations = { types: request.types ?? [], flows: request.flows ?? [] };
28
+ const records = [];
29
+ switch (request.mode ?? SchemaWriteMode.Define) {
30
+ case SchemaWriteMode.Put:
31
+ for (const flow of declarations.flows) {
32
+ records.push(await definitions.putFlow(flow, layer));
33
+ }
34
+ for (const type of declarations.types) {
35
+ records.push(await definitions.putType(type, layer));
36
+ }
37
+ break;
38
+ case SchemaWriteMode.Seed:
39
+ records.push(...await definitions.seed(declarations, layer));
40
+ break;
41
+ default:
42
+ records.push(...await definitions.define(declarations, layer));
43
+ }
44
+ for (const key of request.retire ?? []) {
45
+ records.push(await definitions.retire(key.kind, key.key, layer));
46
+ }
47
+ return { records, bundle: await definitions.bundle(request.project) };
48
+ };
49
+ /**
50
+ * The write of data-defined types and flows. A project layer needs the project in the access's
51
+ * `writes` when the resolver answers it; then `grants.defineSchemas` gates when the resolver answers
52
+ * grants (the organization-wide layer needs `true`, a project layer its id).
53
+ *
54
+ * @throws {PlanningUnsupported} where the store holds no data-defined schemas
55
+ * @throws {PlanningForbidden | SchemaConflict | SchemaSealed | SchemaInvalid | SchemaInUse | WorkcardNotFound}
56
+ */
57
+ export const defineSchemas = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
58
+ const { facade, access } = await handlerScopeOf(ctx, req, opts);
59
+ const request = (req.body ?? {});
60
+ if (facade.definitions == null) {
61
+ throw new PlanningUnsupported('definitions');
62
+ }
63
+ if (request.project != null) {
64
+ assertWrites(access, request.project);
65
+ }
66
+ assertGranted(access, 'defineSchemas', request.project);
67
+ return await applySchemaRequest(facade.definitions, request);
68
+ }));
69
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/actions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAKzE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAI1F,MAAM,IAAI,GAAG,CAAC,KAAc,EAAsB,EAAE,CAClD,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAA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;IAC/D,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAwB,CAAA;IACvD,IAAI,MAAM,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,IAAI,mBAAmB,CAAC,aAAa,CAAC,CAAA;IAC9C,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;QAC5B,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IACvC,CAAC;IACD,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IAEvD,OAAO,MAAM,kBAAkB,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;AAC9D,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import type { PlanningProtocols } from '@owlmeans/planning';
3
+ import type { Context, PlanningHandlerOptions } from '../types.js';
4
+ type RequestHandler = ReturnType<ReturnType<typeof handlers<Context>>['request']>;
5
+ /** @throws {WorkcardNotFound} */
6
+ export declare const getSpecification: (protocol: PlanningProtocols['spec']['get'], opts?: PlanningHandlerOptions) => RequestHandler;
7
+ /** A document's history, newest first, replayed from its log. */
8
+ export declare const listSpecificationRevisions: (protocol: PlanningProtocols['spec']['revisions'], opts?: PlanningHandlerOptions) => RequestHandler;
9
+ export {};
10
+ //# sourceMappingURL=specs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../src/actions/specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,KAAK,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAEjF,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,sBAAsB,KAAG,cAKxG,CAAA;AAEL,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,sBAAsB,KAAG,cAMxH,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { concealed, handlerFacade } from '../utils/index.js';
3
+ /** @throws {WorkcardNotFound} */
4
+ export const getSpecification = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
5
+ const facade = await handlerFacade(ctx, req, opts);
6
+ return await facade.specifications.get(`${req.params.id}`);
7
+ }));
8
+ /** A document's history, newest first, replayed from its log. */
9
+ export const listSpecificationRevisions = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
10
+ const facade = await handlerFacade(ctx, req, opts);
11
+ const limit = req.query?.limit == null ? undefined : Number(req.query.limit);
12
+ return { items: await facade.specifications.revisions(`${req.params.id}`, Number.isFinite(limit) ? limit : undefined) };
13
+ }));
14
+ //# sourceMappingURL=specs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specs.js","sourceRoot":"","sources":["../../src/actions/specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAI5D,iCAAiC;AACjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA0C,EAAE,IAA6B,EAAkB,EAAE,CAC5H,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IAC7E,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAElD,OAAO,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;AAC5D,CAAC,CAAC,CAAC,CAAA;AAEL,iEAAiE;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAAgD,EAAE,IAA6B,EAAkB,EAAE,CAC5I,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IAC7E,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAE5E,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAA;AACzH,CAAC,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/server-planning",
3
- "version": "0.1.18-rc.22",
3
+ "version": "0.1.18-rc.23",
4
4
  "license": "MIT",
5
5
  "description": "The general planning implementation — the planning service and its plugin/middleware registry, the transition executor, the in-memory store, the protocol handlers and the commit feed.",
6
6
  "type": "module",
@@ -45,21 +45,21 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@owlmeans/auth": "^0.1.18-rc.40",
48
- "@owlmeans/auth-common": "^0.1.18-rc.47",
49
- "@owlmeans/basic-ids": "^0.1.18-rc.37",
48
+ "@owlmeans/auth-common": "^0.1.18-rc.48",
49
+ "@owlmeans/basic-ids": "^0.1.18-rc.38",
50
50
  "@owlmeans/context": "^0.1.18-rc.34",
51
51
  "@owlmeans/entrypoint": "^0.1.18-rc.41",
52
52
  "@owlmeans/error": "^0.1.18-rc.38",
53
- "@owlmeans/planning": "^0.1.18-rc.19",
54
- "@owlmeans/queue": "^0.1.18-rc.41",
53
+ "@owlmeans/planning": "^0.1.18-rc.20",
54
+ "@owlmeans/queue": "^0.1.18-rc.42",
55
55
  "@owlmeans/resource": "^0.1.18-rc.40",
56
56
  "@owlmeans/log": "^0.1.18-rc.2",
57
57
  "@owlmeans/route": "^0.1.18-rc.35",
58
- "@owlmeans/server-api": "^0.1.18-rc.51",
58
+ "@owlmeans/server-api": "^0.1.18-rc.52",
59
59
  "@owlmeans/server-context": "^0.1.18-rc.43",
60
60
  "@owlmeans/server-entrypoint": "^0.1.18-rc.40",
61
- "@owlmeans/server-socket": "^0.1.18-rc.54",
62
- "@owlmeans/socket": "^0.1.18-rc.40"
61
+ "@owlmeans/server-socket": "^0.1.18-rc.55",
62
+ "@owlmeans/socket": "^0.1.18-rc.41"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "ajv": "*",