@rolexjs/core 1.4.0-dev-20260306081757 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -115,6 +115,11 @@ declare const scope: _rolexjs_system.Structure;
115
115
  declare const milestone: _rolexjs_system.Structure;
116
116
  declare const deliverable: _rolexjs_system.Structure;
117
117
  declare const wiki: _rolexjs_system.Structure;
118
+ declare const product: _rolexjs_system.Structure;
119
+ declare const strategy: _rolexjs_system.Structure;
120
+ declare const spec: _rolexjs_system.Structure;
121
+ declare const release: _rolexjs_system.Structure;
122
+ declare const channel: _rolexjs_system.Structure;
118
123
 
119
124
  declare const activate: _rolexjs_system.Process;
120
125
  declare const want: _rolexjs_system.Process;
@@ -142,13 +147,22 @@ declare const milestoneProject: _rolexjs_system.Process;
142
147
  declare const deliverProject: _rolexjs_system.Process;
143
148
  declare const wikiProject: _rolexjs_system.Process;
144
149
 
150
+ declare const ownProduct: _rolexjs_system.Process;
151
+ declare const disownProduct: _rolexjs_system.Process;
152
+ declare const strategyProduct: _rolexjs_system.Process;
153
+ declare const specProduct: _rolexjs_system.Process;
154
+ declare const releaseProduct: _rolexjs_system.Process;
155
+ declare const channelProduct: _rolexjs_system.Process;
156
+
145
157
  declare const born: _rolexjs_system.Process;
146
158
  declare const found: _rolexjs_system.Process;
147
159
  declare const establish: _rolexjs_system.Process;
148
160
  declare const launch: _rolexjs_system.Process;
161
+ declare const publish: _rolexjs_system.Process;
149
162
  declare const retire: _rolexjs_system.Process;
150
163
  declare const die: _rolexjs_system.Process;
151
164
  declare const archive: _rolexjs_system.Process;
165
+ declare const deprecate: _rolexjs_system.Process;
152
166
  declare const dissolve: _rolexjs_system.Process;
153
167
  declare const abolish: _rolexjs_system.Process;
154
168
  declare const rehire: _rolexjs_system.Process;
@@ -213,6 +227,14 @@ interface CommandResultMap {
213
227
  "project.deliver": CommandResult;
214
228
  "project.wiki": CommandResult;
215
229
  "project.archive": CommandResult;
230
+ "product.create": CommandResult;
231
+ "product.strategy": CommandResult;
232
+ "product.spec": CommandResult;
233
+ "product.release": CommandResult;
234
+ "product.channel": CommandResult;
235
+ "product.own": CommandResult;
236
+ "product.disown": CommandResult;
237
+ "product.deprecate": CommandResult;
216
238
  "org.found": CommandResult;
217
239
  "org.charter": CommandResult;
218
240
  "org.dissolve": CommandResult;
@@ -546,4 +568,4 @@ interface Protocol {
546
568
  /** The protocol instance — single source of truth for all channel adapters. */
547
569
  declare const protocol: Protocol;
548
570
 
549
- export { type ApplyResult, type ArgEntry, type CommandContext, type CommandResult, type CommandResultMap, type Commands, type ContextData, type InstructionDef, type Migration, type MigrationRecord, type ParamDef, type ParamType, type Platform, type Protocol, type PrototypeData, type PrototypeRepository, type Renderer, RendererRouter, Role, type RoleDeps, type RoleSnapshot, type RoleX, type RoleXRepository, RoleXService, type ToolDef, abandon, abolish, activate, applyPrototype, appoint, archive, background, born, charge, charter, charterOrg, complete, createCommands, deliverProject, deliverable, die, directives, dismiss, dissolve, duty, encounter, enroll, establish, experience, findInState, finish, fire, found, goal, hire, identity, individual, instructions, launch, master, milestone, milestoneProject, mindset, organization, past, plan, planGoal, position, principle, procedure, processes, project, protocol, realize, reflect, rehire, removeParticipant, requirement, retire, scope, scopeProject, society, task, toArgs, todo, tone, want, wiki, wikiProject, world };
571
+ export { type ApplyResult, type ArgEntry, type CommandContext, type CommandResult, type CommandResultMap, type Commands, type ContextData, type InstructionDef, type Migration, type MigrationRecord, type ParamDef, type ParamType, type Platform, type Protocol, type PrototypeData, type PrototypeRepository, type Renderer, RendererRouter, Role, type RoleDeps, type RoleSnapshot, type RoleX, type RoleXRepository, RoleXService, type ToolDef, abandon, abolish, activate, applyPrototype, appoint, archive, background, born, channel, channelProduct, charge, charter, charterOrg, complete, createCommands, deliverProject, deliverable, deprecate, die, directives, dismiss, disownProduct, dissolve, duty, encounter, enroll, establish, experience, findInState, finish, fire, found, goal, hire, identity, individual, instructions, launch, master, milestone, milestoneProject, mindset, organization, ownProduct, past, plan, planGoal, position, principle, procedure, processes, product, project, protocol, publish, realize, reflect, rehire, release, releaseProduct, removeParticipant, requirement, retire, scope, scopeProject, society, spec, specProduct, strategy, strategyProduct, task, toArgs, todo, tone, want, wiki, wikiProject, world };
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  // src/index.ts
2
2
  import {
3
- create as create5,
3
+ create as create6,
4
4
  createRuntime,
5
- link as link3,
6
- process as process6,
5
+ link as link4,
6
+ process as process7,
7
7
  relation as relation2,
8
8
  remove,
9
9
  structure as structure3,
10
10
  transform as transform4,
11
- unlink as unlink3
11
+ unlink as unlink4
12
12
  } from "@rolexjs/system";
13
13
 
14
14
  // src/structures.ts
@@ -52,6 +52,16 @@ var milestone = structure(
52
52
  );
53
53
  var deliverable = structure("deliverable", "Project output and delivery", project);
54
54
  var wiki = structure("wiki", "Project-level knowledge base entry", project);
55
+ var product = structure(
56
+ "product",
57
+ "A product with vision, contracts, and releases",
58
+ society,
59
+ [relation("ownership", "Who owns this product", individual)]
60
+ );
61
+ var strategy = structure("strategy", "Product strategy \u2014 how to win", product);
62
+ var spec = structure("spec", "Product behavior contract \u2014 BDD specification", product);
63
+ var release = structure("release", "Product version release", product);
64
+ var channel = structure("channel", "Product distribution channel", product);
55
65
 
56
66
  // src/execution.ts
57
67
  import { create, process, transform } from "@rolexjs/system";
@@ -171,38 +181,84 @@ var deliverProject = process4(
171
181
  );
172
182
  var wikiProject = process4("wiki", "Add a wiki entry to a project", project, create3(wiki));
173
183
 
184
+ // src/product.ts
185
+ import { create as create4, link as link3, process as process5, unlink as unlink3 } from "@rolexjs/system";
186
+ var ownProduct = process5(
187
+ "own",
188
+ "Assign an owner to the product",
189
+ product,
190
+ link3(product, "ownership")
191
+ );
192
+ var disownProduct = process5(
193
+ "disown",
194
+ "Remove an owner from the product",
195
+ product,
196
+ unlink3(product, "ownership")
197
+ );
198
+ var strategyProduct = process5(
199
+ "strategy",
200
+ "Define the strategy for a product",
201
+ product,
202
+ create4(strategy)
203
+ );
204
+ var specProduct = process5(
205
+ "spec",
206
+ "Add a behavior contract to a product",
207
+ product,
208
+ create4(spec)
209
+ );
210
+ var releaseProduct = process5(
211
+ "release",
212
+ "Add a version release to a product",
213
+ product,
214
+ create4(release)
215
+ );
216
+ var channelProduct = process5(
217
+ "channel",
218
+ "Add a distribution channel to a product",
219
+ product,
220
+ create4(channel)
221
+ );
222
+
174
223
  // src/lifecycle.ts
175
- import { create as create4, process as process5, transform as transform3 } from "@rolexjs/system";
176
- var born = process5(
224
+ import { create as create5, process as process6, transform as transform3 } from "@rolexjs/system";
225
+ var born = process6(
177
226
  "born",
178
227
  "An individual is born into society",
179
228
  society,
180
- create4(individual)
229
+ create5(individual)
181
230
  );
182
- var found = process5("found", "Found an organization", society, create4(organization));
183
- var establish = process5("establish", "Establish a position", society, create4(position));
184
- var launch = process5("launch", "Launch a project", society, create4(project));
185
- var retire = process5(
231
+ var found = process6("found", "Found an organization", society, create5(organization));
232
+ var establish = process6("establish", "Establish a position", society, create5(position));
233
+ var launch = process6("launch", "Launch a project", society, create5(project));
234
+ var publish = process6("publish", "Publish a product", society, create5(product));
235
+ var retire = process6(
186
236
  "retire",
187
237
  "Retire an individual",
188
238
  individual,
189
239
  transform3(individual, past)
190
240
  );
191
- var die = process5("die", "An individual dies", individual, transform3(individual, past));
192
- var archive = process5("archive", "Archive a project", project, transform3(project, past));
193
- var dissolve = process5(
241
+ var die = process6("die", "An individual dies", individual, transform3(individual, past));
242
+ var archive = process6("archive", "Archive a project", project, transform3(project, past));
243
+ var deprecate = process6(
244
+ "deprecate",
245
+ "Deprecate a product",
246
+ product,
247
+ transform3(product, past)
248
+ );
249
+ var dissolve = process6(
194
250
  "dissolve",
195
251
  "Dissolve an organization",
196
252
  organization,
197
253
  transform3(organization, past)
198
254
  );
199
- var abolish = process5(
255
+ var abolish = process6(
200
256
  "abolish",
201
257
  "Abolish a position",
202
258
  position,
203
259
  transform3(position, past)
204
260
  );
205
- var rehire = process5(
261
+ var rehire = process6(
206
262
  "rehire",
207
263
  "Rehire a retired individual",
208
264
  past,
@@ -280,8 +336,8 @@ var Role = class {
280
336
  // ================================================================
281
337
  fmt(command, result) {
282
338
  const rendered = this.deps.renderer.render(command, result);
283
- const process7 = command.includes(".") ? command.slice(command.indexOf(".") + 1) : command;
284
- const ch = this.cognitiveHint(process7);
339
+ const process8 = command.includes(".") ? command.slice(command.indexOf(".") + 1) : command;
340
+ const ch = this.cognitiveHint(process8);
285
341
  if (!ch) return rendered;
286
342
  const lines = rendered.split("\n");
287
343
  lines.splice(2, 0, `I \u2192 ${ch}`);
@@ -510,8 +566,8 @@ var Role = class {
510
566
  // ================================================================
511
567
  // Cognitive hints
512
568
  // ================================================================
513
- cognitiveHint(process7) {
514
- switch (process7) {
569
+ cognitiveHint(process8) {
570
+ switch (process8) {
515
571
  case "activate":
516
572
  if (!this.focusedGoalId)
517
573
  return "I have no goal yet. I should call `want` to declare one, or `focus` to review existing goals.";
@@ -590,13 +646,13 @@ import { parse } from "@rolexjs/parser";
590
646
  import { structure as structure2 } from "@rolexjs/system";
591
647
  function createCommands(ctx) {
592
648
  const { rt, society: society2, past: past2, resolve, resourcex, issuex } = ctx;
593
- async function ok(node, process7) {
594
- return { state: await rt.project(node), process: process7 };
649
+ async function ok(node, process8) {
650
+ return { state: await rt.project(node), process: process8 };
595
651
  }
596
- async function archive2(node, process7) {
652
+ async function archive2(node, process8) {
597
653
  const target = structure2(node.name, node.description ?? "", past);
598
654
  const archived = await rt.transform(node, target);
599
- return ok(archived, process7);
655
+ return ok(archived, process8);
600
656
  }
601
657
  function validateGherkin(source) {
602
658
  if (!source) return;
@@ -821,6 +877,45 @@ ${text}`;
821
877
  async "project.archive"(project2) {
822
878
  return archive2(await resolve(project2), "archive");
823
879
  },
880
+ // ---- Product ----
881
+ async "product.create"(content, id, alias) {
882
+ validateGherkin(content);
883
+ const node = await rt.create(society2, product, content, id, alias);
884
+ return ok(node, "create");
885
+ },
886
+ async "product.strategy"(product2, strategy2, id) {
887
+ validateGherkin(strategy2);
888
+ const node = await rt.create(await resolve(product2), strategy, strategy2, id);
889
+ return ok(node, "strategy");
890
+ },
891
+ async "product.spec"(product2, spec2, id) {
892
+ validateGherkin(spec2);
893
+ const node = await rt.create(await resolve(product2), spec, spec2, id);
894
+ return ok(node, "spec");
895
+ },
896
+ async "product.release"(product2, release2, id) {
897
+ validateGherkin(release2);
898
+ const node = await rt.create(await resolve(product2), release, release2, id);
899
+ return ok(node, "release");
900
+ },
901
+ async "product.channel"(product2, channel2, id) {
902
+ validateGherkin(channel2);
903
+ const node = await rt.create(await resolve(product2), channel, channel2, id);
904
+ return ok(node, "channel");
905
+ },
906
+ async "product.own"(product2, individual2) {
907
+ const prodNode = await resolve(product2);
908
+ await rt.link(prodNode, await resolve(individual2), "ownership", "own");
909
+ return ok(prodNode, "own");
910
+ },
911
+ async "product.disown"(product2, individual2) {
912
+ const prodNode = await resolve(product2);
913
+ await rt.unlink(prodNode, await resolve(individual2), "ownership", "own");
914
+ return ok(prodNode, "disown");
915
+ },
916
+ async "product.deprecate"(product2) {
917
+ return archive2(await resolve(product2), "deprecate");
918
+ },
824
919
  // ---- Org ----
825
920
  async "org.found"(content, id, alias) {
826
921
  validateGherkin(content);
@@ -1549,6 +1644,114 @@ var projectArchive = def(
1549
1644
  },
1550
1645
  ["project"]
1551
1646
  );
1647
+ var productCreate = def(
1648
+ "product",
1649
+ "create",
1650
+ {
1651
+ content: {
1652
+ type: "gherkin",
1653
+ required: false,
1654
+ description: "Gherkin Feature source for the product (vision)"
1655
+ },
1656
+ id: { type: "string", required: true, description: "User-facing identifier (kebab-case)" },
1657
+ alias: { type: "string[]", required: false, description: "Alternative names" }
1658
+ },
1659
+ ["content", "id", "alias"]
1660
+ );
1661
+ var productStrategy = def(
1662
+ "product",
1663
+ "strategy",
1664
+ {
1665
+ product: { type: "string", required: true, description: "Product id" },
1666
+ content: {
1667
+ type: "gherkin",
1668
+ required: true,
1669
+ description: "Gherkin Feature source for the strategy"
1670
+ },
1671
+ id: { type: "string", required: true, description: "Strategy id" }
1672
+ },
1673
+ ["product", "content", "id"]
1674
+ );
1675
+ var productSpec = def(
1676
+ "product",
1677
+ "spec",
1678
+ {
1679
+ product: { type: "string", required: true, description: "Product id" },
1680
+ content: {
1681
+ type: "gherkin",
1682
+ required: true,
1683
+ description: "Gherkin Feature source for the behavior contract (BDD specification)"
1684
+ },
1685
+ id: {
1686
+ type: "string",
1687
+ required: true,
1688
+ description: "Spec id (keywords joined by hyphens)"
1689
+ }
1690
+ },
1691
+ ["product", "content", "id"]
1692
+ );
1693
+ var productRelease = def(
1694
+ "product",
1695
+ "release",
1696
+ {
1697
+ product: { type: "string", required: true, description: "Product id" },
1698
+ content: {
1699
+ type: "gherkin",
1700
+ required: true,
1701
+ description: "Gherkin Feature source for the release"
1702
+ },
1703
+ id: {
1704
+ type: "string",
1705
+ required: true,
1706
+ description: "Release id (e.g. v1.0.0)"
1707
+ }
1708
+ },
1709
+ ["product", "content", "id"]
1710
+ );
1711
+ var productChannel = def(
1712
+ "product",
1713
+ "channel",
1714
+ {
1715
+ product: { type: "string", required: true, description: "Product id" },
1716
+ content: {
1717
+ type: "gherkin",
1718
+ required: true,
1719
+ description: "Gherkin Feature source for the distribution channel"
1720
+ },
1721
+ id: {
1722
+ type: "string",
1723
+ required: true,
1724
+ description: "Channel id (e.g. npm, cloud-platform)"
1725
+ }
1726
+ },
1727
+ ["product", "content", "id"]
1728
+ );
1729
+ var productOwn = def(
1730
+ "product",
1731
+ "own",
1732
+ {
1733
+ product: { type: "string", required: true, description: "Product id" },
1734
+ individual: { type: "string", required: true, description: "Individual id (owner)" }
1735
+ },
1736
+ ["product", "individual"]
1737
+ );
1738
+ var productDisown = def(
1739
+ "product",
1740
+ "disown",
1741
+ {
1742
+ product: { type: "string", required: true, description: "Product id" },
1743
+ individual: { type: "string", required: true, description: "Individual id (owner to remove)" }
1744
+ },
1745
+ ["product", "individual"]
1746
+ );
1747
+ var productDeprecate = def(
1748
+ "product",
1749
+ "deprecate",
1750
+ {
1751
+ product: { type: "string", required: true, description: "Product id" }
1752
+ },
1753
+ ["product"]
1754
+ );
1552
1755
  var censusList = def(
1553
1756
  "census",
1554
1757
  "list",
@@ -1556,7 +1759,7 @@ var censusList = def(
1556
1759
  type: {
1557
1760
  type: "string",
1558
1761
  required: false,
1559
- description: "Filter by type (individual, organization, position, project, past)"
1762
+ description: "Filter by type (individual, organization, position, project, product, past)"
1560
1763
  }
1561
1764
  },
1562
1765
  ["type"]
@@ -1782,6 +1985,15 @@ var instructions = {
1782
1985
  "project.deliver": projectDeliver,
1783
1986
  "project.wiki": projectWiki,
1784
1987
  "project.archive": projectArchive,
1988
+ // product
1989
+ "product.create": productCreate,
1990
+ "product.strategy": productStrategy,
1991
+ "product.spec": productSpec,
1992
+ "product.release": productRelease,
1993
+ "product.channel": productChannel,
1994
+ "product.own": productOwn,
1995
+ "product.disown": productDisown,
1996
+ "product.deprecate": productDeprecate,
1785
1997
  // census
1786
1998
  "census.list": censusList,
1787
1999
  // prototype
@@ -2699,18 +2911,22 @@ export {
2699
2911
  archive,
2700
2912
  background,
2701
2913
  born,
2914
+ channel,
2915
+ channelProduct,
2702
2916
  charge,
2703
2917
  charter,
2704
2918
  charterOrg,
2705
2919
  complete,
2706
- create5 as create,
2920
+ create6 as create,
2707
2921
  createCommands,
2708
2922
  createRuntime,
2709
2923
  deliverProject,
2710
2924
  deliverable,
2925
+ deprecate,
2711
2926
  die,
2712
2927
  directives,
2713
2928
  dismiss,
2929
+ disownProduct,
2714
2930
  dissolve,
2715
2931
  duty,
2716
2932
  encounter,
@@ -2727,26 +2943,31 @@ export {
2727
2943
  individual,
2728
2944
  instructions,
2729
2945
  launch,
2730
- link3 as link,
2946
+ link4 as link,
2731
2947
  master,
2732
2948
  milestone,
2733
2949
  milestoneProject,
2734
2950
  mindset,
2735
2951
  organization,
2952
+ ownProduct,
2736
2953
  past,
2737
2954
  plan,
2738
2955
  planGoal,
2739
2956
  position,
2740
2957
  principle,
2741
2958
  procedure,
2742
- process6 as process,
2959
+ process7 as process,
2743
2960
  processes,
2961
+ product,
2744
2962
  project,
2745
2963
  protocol,
2964
+ publish,
2746
2965
  realize,
2747
2966
  reflect,
2748
2967
  rehire,
2749
2968
  relation2 as relation,
2969
+ release,
2970
+ releaseProduct,
2750
2971
  remove,
2751
2972
  removeParticipant,
2752
2973
  requirement,
@@ -2754,13 +2975,17 @@ export {
2754
2975
  scope,
2755
2976
  scopeProject,
2756
2977
  society,
2978
+ spec,
2979
+ specProduct,
2980
+ strategy,
2981
+ strategyProduct,
2757
2982
  structure3 as structure,
2758
2983
  task,
2759
2984
  toArgs,
2760
2985
  todo,
2761
2986
  tone,
2762
2987
  transform4 as transform,
2763
- unlink3 as unlink,
2988
+ unlink4 as unlink,
2764
2989
  want,
2765
2990
  wiki,
2766
2991
  wikiProject,