@rolexjs/core 0.10.0 → 0.11.0-dev.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 +71 -339
- package/dist/index.js +220 -62
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,347 +1,79 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _rolexjs_system from '@rolexjs/system';
|
|
2
|
+
import { Runtime, Prototype } from '@rolexjs/system';
|
|
3
|
+
export { Create, GraphOp, Link, Process, Prototype, Relation, Remove, Runtime, State, Structure, Transform, Unlink, create, createPrototype, createRuntime, link, mergeState, process, relation, remove, structure, transform, unlink } from '@rolexjs/system';
|
|
4
|
+
import { ResourceX } from 'resourcexjs';
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
|
-
*
|
|
7
|
+
* Platform — external integration point for RoleX.
|
|
5
8
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Non-verifiable scenarios are one-time acceptance criteria.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* A Gherkin Scenario enriched with verification metadata.
|
|
13
|
-
*/
|
|
14
|
-
interface Scenario extends Scenario$1 {
|
|
15
|
-
readonly verifiable: boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Feature — The atomic unit in the RDD model.
|
|
20
|
-
*
|
|
21
|
-
* Extends Gherkin's Feature with RDD dimension classification
|
|
22
|
-
* and explicit Scenario relationship.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* A Gherkin Feature enriched with RDD semantics.
|
|
27
|
-
*/
|
|
28
|
-
interface Feature extends Feature$1 {
|
|
29
|
-
readonly type: "persona" | "knowledge" | "experience" | "voice" | "goal" | "plan" | "task" | "duty";
|
|
30
|
-
readonly scenarios: Scenario[];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Identity — The role's complete self.
|
|
35
|
-
*
|
|
36
|
-
* NOT a Feature itself — it is a container that wraps
|
|
37
|
-
* multiple Features (*.identity.feature files).
|
|
38
|
-
* Always loaded, independent of any goal.
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The identity foundation of a role. Wraps many Features.
|
|
43
|
-
*/
|
|
44
|
-
interface Identity {
|
|
45
|
-
readonly features: Feature[];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Goal — The driver of action.
|
|
50
|
-
*
|
|
51
|
-
* A Goal IS-A Feature with type='goal'.
|
|
52
|
-
* Dynamic and phase-specific. What the role wants to achieve.
|
|
53
|
-
* Expressed as *.goal.feature files.
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* A goal that a role wants to achieve in a given phase.
|
|
58
|
-
*/
|
|
59
|
-
interface Goal extends Feature {
|
|
60
|
-
readonly type: "goal";
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Role — The primary organizing unit in RDD.
|
|
65
|
-
*
|
|
66
|
-
* Every role operates through dimensions:
|
|
67
|
-
* Identity → Goal → Plan → Task/Skill
|
|
68
|
-
*
|
|
69
|
-
* Identity is static (always present).
|
|
70
|
-
* Goals are dynamic (change per phase).
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* A role in the RDD (Role-Driven Development) model.
|
|
75
|
-
*/
|
|
76
|
-
interface Role {
|
|
77
|
-
readonly name: string;
|
|
78
|
-
readonly identity: Identity;
|
|
79
|
-
readonly goals: Goal[];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Plan — The bridge between goal and execution.
|
|
84
|
-
*
|
|
85
|
-
* A Plan IS-A Feature with type='plan'.
|
|
86
|
-
* Expressed as *.plan.feature files.
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* A plan that decomposes a goal into executable tasks.
|
|
91
|
-
*/
|
|
92
|
-
interface Plan extends Feature {
|
|
93
|
-
readonly type: "plan";
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Task — Concrete unit of work within a plan.
|
|
98
|
-
*
|
|
99
|
-
* A Task IS-A Feature with type='task'.
|
|
100
|
-
* Expressed as *.task.feature files.
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* A concrete unit of work.
|
|
105
|
-
*/
|
|
106
|
-
interface Task extends Feature {
|
|
107
|
-
readonly type: "task";
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Duty — Responsibilities defined by a Position.
|
|
112
|
-
*
|
|
113
|
-
* A Duty IS-A Feature with type='duty'.
|
|
114
|
-
* Expressed as *.duty.feature files within a position directory.
|
|
115
|
-
* Injected into role identity when the role is on_duty.
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* A duty (responsibility) assigned through a position.
|
|
120
|
-
*/
|
|
121
|
-
interface Duty extends Feature {
|
|
122
|
-
readonly type: "duty";
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Skill — Execution capability for a task.
|
|
127
|
-
*
|
|
128
|
-
* Compatible with existing skill systems:
|
|
129
|
-
* Claude Code skills, ResourceX resources, MCP tools, etc.
|
|
130
|
-
*/
|
|
131
|
-
/**
|
|
132
|
-
* A capability that a role uses to execute a task.
|
|
133
|
-
*/
|
|
134
|
-
interface Skill {
|
|
135
|
-
/** Skill identifier, e.g. "commit", "bdd", "dev-flow" */
|
|
136
|
-
readonly name: string;
|
|
137
|
-
/** Reference to the concrete implementation: skill path, resource locator, tool URI */
|
|
138
|
-
readonly reference: string;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* states.ts — Role and Position state definitions.
|
|
143
|
-
*
|
|
144
|
-
* Role: free → member → on_duty
|
|
145
|
-
* Position: vacant → filled
|
|
146
|
-
*/
|
|
147
|
-
type RoleState = "free" | "member" | "on_duty";
|
|
148
|
-
type PositionState = "vacant" | "filled";
|
|
149
|
-
/**
|
|
150
|
-
* Derive a role's state from assignment data.
|
|
151
|
-
*/
|
|
152
|
-
declare function getRoleState(assignment: {
|
|
153
|
-
org: string;
|
|
154
|
-
position?: string;
|
|
155
|
-
} | null): RoleState;
|
|
156
|
-
/**
|
|
157
|
-
* Derive a position's state from assignment data.
|
|
158
|
-
*/
|
|
159
|
-
declare function getPositionState(assignedRole: string | null): PositionState;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Platform — The abstraction layer for role storage.
|
|
9
|
+
* A Platform provides the runtime environment that Rolex operates in.
|
|
10
|
+
* Different platforms serve different deployment contexts:
|
|
163
11
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* Future platforms could use databases, cloud storage, etc.
|
|
12
|
+
* LocalPlatform — filesystem persistence (development, local agents)
|
|
13
|
+
* CloudPlatform — remote storage (future)
|
|
167
14
|
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* Organization = WHERE (structure, nesting)
|
|
171
|
-
* Position = WHAT (duties, boundaries)
|
|
172
|
-
*
|
|
173
|
-
* All methods are stateless — entity names are passed per call.
|
|
15
|
+
* Platform holds the Runtime (graph engine) and will hold additional
|
|
16
|
+
* services as the framework grows (auth, events, plugins, etc.).
|
|
174
17
|
*/
|
|
175
18
|
|
|
176
|
-
/**
|
|
177
|
-
* Assignment — tracks which org/position a role is assigned to.
|
|
178
|
-
*/
|
|
179
|
-
interface Assignment {
|
|
180
|
-
readonly org: string;
|
|
181
|
-
readonly position?: string;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* OrganizationConfig — stored config for an organization.
|
|
185
|
-
*/
|
|
186
|
-
interface OrganizationConfig {
|
|
187
|
-
readonly parent?: string;
|
|
188
|
-
readonly positions: string[];
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* RolexConfig — The single source of truth for society state.
|
|
192
|
-
*
|
|
193
|
-
* Always exists. Defined in core, persisted by Platform.
|
|
194
|
-
*/
|
|
195
|
-
interface RolexConfig {
|
|
196
|
-
roles: string[];
|
|
197
|
-
organizations: Record<string, OrganizationConfig>;
|
|
198
|
-
assignments: Record<string, Assignment>;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Organization info (runtime view).
|
|
202
|
-
*/
|
|
203
|
-
interface OrganizationInfo {
|
|
204
|
-
readonly name: string;
|
|
205
|
-
readonly parent?: string;
|
|
206
|
-
readonly positions: string[];
|
|
207
|
-
readonly members: string[];
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Position info (runtime view).
|
|
211
|
-
*/
|
|
212
|
-
interface PositionInfo {
|
|
213
|
-
readonly name: string;
|
|
214
|
-
readonly org: string;
|
|
215
|
-
readonly state: PositionState;
|
|
216
|
-
readonly assignedRole: string | null;
|
|
217
|
-
readonly duties: Duty[];
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Role directory entry with state information.
|
|
221
|
-
*/
|
|
222
|
-
interface RoleEntry {
|
|
223
|
-
readonly name: string;
|
|
224
|
-
readonly state: RoleState;
|
|
225
|
-
readonly org?: string;
|
|
226
|
-
readonly position?: string;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Society directory — all known roles, organizations, and positions.
|
|
230
|
-
*/
|
|
231
|
-
interface Directory {
|
|
232
|
-
readonly roles: readonly RoleEntry[];
|
|
233
|
-
readonly organizations: readonly OrganizationInfo[];
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Platform interface — abstracts entity storage and retrieval.
|
|
237
|
-
*/
|
|
238
19
|
interface Platform {
|
|
239
|
-
/**
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
* Role transitions:
|
|
300
|
-
* free --(hire)--> member --(appoint)--> on_duty
|
|
301
|
-
* on_duty --(dismiss)--> member --(fire)--> free
|
|
302
|
-
* on_duty --(fire)--> free (auto-dismiss)
|
|
303
|
-
*
|
|
304
|
-
* Position transitions:
|
|
305
|
-
* vacant --(appoint)--> filled --(dismiss)--> vacant
|
|
306
|
-
*/
|
|
307
|
-
|
|
308
|
-
interface Transition<S extends string> {
|
|
309
|
-
readonly from: S;
|
|
310
|
-
readonly to: S;
|
|
311
|
-
readonly action: string;
|
|
312
|
-
}
|
|
313
|
-
declare const ROLE_MACHINE: Transition<RoleState>[];
|
|
314
|
-
declare const POSITION_MACHINE: Transition<PositionState>[];
|
|
315
|
-
/**
|
|
316
|
-
* Find a transition by current state and action.
|
|
317
|
-
*/
|
|
318
|
-
declare function findTransition<S extends string>(machine: Transition<S>[], from: S, action: string): Transition<S> | null;
|
|
319
|
-
/**
|
|
320
|
-
* Check if a transition is valid.
|
|
321
|
-
*/
|
|
322
|
-
declare function canTransition<S extends string>(machine: Transition<S>[], from: S, action: string): boolean;
|
|
323
|
-
/**
|
|
324
|
-
* Execute a transition — returns new state or throws.
|
|
325
|
-
*/
|
|
326
|
-
declare function transition<S extends string>(machine: Transition<S>[], from: S, action: string): S;
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* relations.ts — One-to-one relationship constraints.
|
|
330
|
-
*
|
|
331
|
-
* - A role can belong to at most one organization
|
|
332
|
-
* - A role can hold at most one position
|
|
333
|
-
* - A position can be held by at most one role
|
|
334
|
-
*/
|
|
335
|
-
interface OneToOneConstraint {
|
|
336
|
-
readonly entity: string;
|
|
337
|
-
readonly relation: string;
|
|
338
|
-
readonly description: string;
|
|
339
|
-
}
|
|
340
|
-
declare const RELATIONS: OneToOneConstraint[];
|
|
341
|
-
/**
|
|
342
|
-
* Validate that a one-to-one assignment does not conflict.
|
|
343
|
-
* Throws if the entity is already assigned.
|
|
344
|
-
*/
|
|
345
|
-
declare function validateOneToOne(entityName: string, currentValue: string | null, newValue: string, constraintDesc: string): void;
|
|
346
|
-
|
|
347
|
-
export { type Assignment, type Directory, type Duty, type Feature, type Goal, type Identity, type OneToOneConstraint, type OrganizationConfig, type OrganizationInfo, POSITION_MACHINE, type Plan, type Platform, type PositionInfo, type PositionState, RELATIONS, ROLE_MACHINE, type Role, type RoleEntry, type RoleState, type RolexConfig, type Scenario, type Skill, type Task, type Transition, canTransition, findTransition, getPositionState, getRoleState, transition, validateOneToOne };
|
|
20
|
+
/** Graph operation engine (may include transparent persistence). */
|
|
21
|
+
readonly runtime: Runtime;
|
|
22
|
+
/** Prototype source for merging base State into instances on activate. */
|
|
23
|
+
readonly prototype?: Prototype;
|
|
24
|
+
/** Resource management capability (optional — requires resourcexjs). */
|
|
25
|
+
readonly resourcex?: ResourceX;
|
|
26
|
+
/** Register a prototype: bind id to a ResourceX source (path or locator). */
|
|
27
|
+
registerPrototype?(id: string, source: string): void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare const society: _rolexjs_system.Structure;
|
|
31
|
+
declare const individual: _rolexjs_system.Structure;
|
|
32
|
+
declare const organization: _rolexjs_system.Structure;
|
|
33
|
+
declare const past: _rolexjs_system.Structure;
|
|
34
|
+
declare const identity: _rolexjs_system.Structure;
|
|
35
|
+
declare const background: _rolexjs_system.Structure;
|
|
36
|
+
declare const tone: _rolexjs_system.Structure;
|
|
37
|
+
declare const mindset: _rolexjs_system.Structure;
|
|
38
|
+
declare const encounter: _rolexjs_system.Structure;
|
|
39
|
+
declare const experience: _rolexjs_system.Structure;
|
|
40
|
+
declare const knowledge: _rolexjs_system.Structure;
|
|
41
|
+
declare const principle: _rolexjs_system.Structure;
|
|
42
|
+
declare const procedure: _rolexjs_system.Structure;
|
|
43
|
+
declare const goal: _rolexjs_system.Structure;
|
|
44
|
+
declare const plan: _rolexjs_system.Structure;
|
|
45
|
+
declare const task: _rolexjs_system.Structure;
|
|
46
|
+
declare const charter: _rolexjs_system.Structure;
|
|
47
|
+
declare const position: _rolexjs_system.Structure;
|
|
48
|
+
declare const duty: _rolexjs_system.Structure;
|
|
49
|
+
|
|
50
|
+
declare const want: _rolexjs_system.Process;
|
|
51
|
+
declare const planGoal: _rolexjs_system.Process;
|
|
52
|
+
declare const todo: _rolexjs_system.Process;
|
|
53
|
+
declare const finish: _rolexjs_system.Process;
|
|
54
|
+
declare const complete: _rolexjs_system.Process;
|
|
55
|
+
declare const abandon: _rolexjs_system.Process;
|
|
56
|
+
|
|
57
|
+
declare const reflect: _rolexjs_system.Process;
|
|
58
|
+
declare const realize: _rolexjs_system.Process;
|
|
59
|
+
declare const master: _rolexjs_system.Process;
|
|
60
|
+
|
|
61
|
+
declare const hire: _rolexjs_system.Process;
|
|
62
|
+
declare const fire: _rolexjs_system.Process;
|
|
63
|
+
declare const appoint: _rolexjs_system.Process;
|
|
64
|
+
declare const dismiss: _rolexjs_system.Process;
|
|
65
|
+
declare const charterOrg: _rolexjs_system.Process;
|
|
66
|
+
declare const charge: _rolexjs_system.Process;
|
|
67
|
+
|
|
68
|
+
declare const born: _rolexjs_system.Process;
|
|
69
|
+
declare const found: _rolexjs_system.Process;
|
|
70
|
+
declare const establish: _rolexjs_system.Process;
|
|
71
|
+
declare const retire: _rolexjs_system.Process;
|
|
72
|
+
declare const die: _rolexjs_system.Process;
|
|
73
|
+
declare const dissolve: _rolexjs_system.Process;
|
|
74
|
+
declare const abolish: _rolexjs_system.Process;
|
|
75
|
+
declare const rehire: _rolexjs_system.Process;
|
|
76
|
+
|
|
77
|
+
declare const activate: _rolexjs_system.Process;
|
|
78
|
+
|
|
79
|
+
export { type Platform, abandon, abolish, activate, appoint, background, born, charge, charter, charterOrg, complete, die, dismiss, dissolve, duty, encounter, establish, experience, finish, fire, found, goal, hire, identity, individual, knowledge, master, mindset, organization, past, plan, planGoal, position, principle, procedure, realize, reflect, rehire, retire, society, task, todo, tone, want };
|
package/dist/index.js
CHANGED
|
@@ -1,67 +1,225 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
create as create4,
|
|
4
|
+
createPrototype,
|
|
5
|
+
createRuntime,
|
|
6
|
+
link as link2,
|
|
7
|
+
mergeState,
|
|
8
|
+
process as process6,
|
|
9
|
+
relation as relation2,
|
|
10
|
+
remove,
|
|
11
|
+
structure as structure2,
|
|
12
|
+
transform as transform4,
|
|
13
|
+
unlink as unlink2
|
|
14
|
+
} from "@rolexjs/system";
|
|
10
15
|
|
|
11
|
-
// src/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
// src/structures.ts
|
|
17
|
+
import { relation, structure } from "@rolexjs/system";
|
|
18
|
+
var society = structure("society", "The RoleX world", null);
|
|
19
|
+
var individual = structure("individual", "A single agent in society", society);
|
|
20
|
+
var organization = structure("organization", "A group of individuals", society, [
|
|
21
|
+
relation("membership", "Who belongs to this organization", individual)
|
|
22
|
+
]);
|
|
23
|
+
var past = structure("past", "Things no longer active", society);
|
|
24
|
+
var identity = structure("identity", "Who I am", individual);
|
|
25
|
+
var background = structure("background", "My personal background", identity);
|
|
26
|
+
var tone = structure("tone", "My tone of communication", identity);
|
|
27
|
+
var mindset = structure("mindset", "How I think and approach problems", identity);
|
|
28
|
+
var encounter = structure("encounter", "A specific event I went through", individual);
|
|
29
|
+
var experience = structure("experience", "What I learned from encounters", individual);
|
|
30
|
+
var knowledge = structure("knowledge", "What I know", individual);
|
|
31
|
+
var principle = structure("principle", "My rules of conduct", knowledge);
|
|
32
|
+
var procedure = structure("procedure", "My skill references and metadata", knowledge);
|
|
33
|
+
var goal = structure("goal", "What I am pursuing", individual);
|
|
34
|
+
var plan = structure("plan", "How to achieve a goal", goal);
|
|
35
|
+
var task = structure("task", "Concrete unit of work", plan);
|
|
36
|
+
var charter = structure("charter", "The rules and mission", organization);
|
|
37
|
+
var position = structure("position", "A role held by an individual", organization, [
|
|
38
|
+
relation("appointment", "Who holds this position", individual)
|
|
39
|
+
]);
|
|
40
|
+
var duty = structure("duty", "Responsibilities of this position", position);
|
|
36
41
|
|
|
37
|
-
// src/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
// src/execution.ts
|
|
43
|
+
import { create, process, transform } from "@rolexjs/system";
|
|
44
|
+
var want = process("want", "Declare a goal", individual, create(goal));
|
|
45
|
+
var planGoal = process("plan", "Create a plan for a goal", goal, create(plan));
|
|
46
|
+
var todo = process("todo", "Create a task in a plan", plan, create(task));
|
|
47
|
+
var finish = process(
|
|
48
|
+
"finish",
|
|
49
|
+
"Complete a task, record as encounter",
|
|
50
|
+
task,
|
|
51
|
+
transform(task, encounter)
|
|
52
|
+
);
|
|
53
|
+
var complete = process(
|
|
54
|
+
"complete",
|
|
55
|
+
"Complete a plan, record as encounter",
|
|
56
|
+
plan,
|
|
57
|
+
transform(plan, encounter)
|
|
58
|
+
);
|
|
59
|
+
var abandon = process(
|
|
60
|
+
"abandon",
|
|
61
|
+
"Abandon a plan, record as encounter",
|
|
62
|
+
plan,
|
|
63
|
+
transform(plan, encounter)
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
// src/cognition.ts
|
|
67
|
+
import { process as process2, transform as transform2 } from "@rolexjs/system";
|
|
68
|
+
var reflect = process2(
|
|
69
|
+
"reflect",
|
|
70
|
+
"Reflect on encounters, distill into experience",
|
|
71
|
+
encounter,
|
|
72
|
+
transform2(encounter, experience)
|
|
73
|
+
);
|
|
74
|
+
var realize = process2(
|
|
75
|
+
"realize",
|
|
76
|
+
"Realize a principle from experience",
|
|
77
|
+
experience,
|
|
78
|
+
transform2(experience, principle)
|
|
79
|
+
);
|
|
80
|
+
var master = process2(
|
|
81
|
+
"master",
|
|
82
|
+
"Master a procedure from experience",
|
|
83
|
+
experience,
|
|
84
|
+
transform2(experience, procedure)
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// src/organization.ts
|
|
88
|
+
import { create as create2, link, process as process3, unlink } from "@rolexjs/system";
|
|
89
|
+
var hire = process3(
|
|
90
|
+
"hire",
|
|
91
|
+
"Hire an individual into the organization",
|
|
92
|
+
organization,
|
|
93
|
+
link(organization, "membership")
|
|
94
|
+
);
|
|
95
|
+
var fire = process3(
|
|
96
|
+
"fire",
|
|
97
|
+
"Fire an individual from the organization",
|
|
98
|
+
organization,
|
|
99
|
+
unlink(organization, "membership")
|
|
100
|
+
);
|
|
101
|
+
var appoint = process3(
|
|
102
|
+
"appoint",
|
|
103
|
+
"Appoint a member to a position",
|
|
104
|
+
position,
|
|
105
|
+
link(position, "appointment")
|
|
106
|
+
);
|
|
107
|
+
var dismiss = process3(
|
|
108
|
+
"dismiss",
|
|
109
|
+
"Dismiss from a position",
|
|
110
|
+
position,
|
|
111
|
+
unlink(position, "appointment")
|
|
112
|
+
);
|
|
113
|
+
var charterOrg = process3(
|
|
114
|
+
"charter",
|
|
115
|
+
"Define the charter for an organization",
|
|
116
|
+
organization,
|
|
117
|
+
create2(charter)
|
|
118
|
+
);
|
|
119
|
+
var charge = process3("charge", "Add a duty to a position", position, create2(duty));
|
|
120
|
+
|
|
121
|
+
// src/lifecycle.ts
|
|
122
|
+
import { create as create3, process as process4, transform as transform3 } from "@rolexjs/system";
|
|
123
|
+
var born = process4(
|
|
124
|
+
"born",
|
|
125
|
+
"An individual is born into society",
|
|
126
|
+
society,
|
|
127
|
+
create3(individual)
|
|
128
|
+
);
|
|
129
|
+
var found = process4("found", "Found an organization", society, create3(organization));
|
|
130
|
+
var establish = process4(
|
|
131
|
+
"establish",
|
|
132
|
+
"Establish a position in an organization",
|
|
133
|
+
organization,
|
|
134
|
+
create3(position)
|
|
135
|
+
);
|
|
136
|
+
var retire = process4(
|
|
137
|
+
"retire",
|
|
138
|
+
"Retire an individual",
|
|
139
|
+
individual,
|
|
140
|
+
transform3(individual, past)
|
|
141
|
+
);
|
|
142
|
+
var die = process4("die", "An individual dies", individual, transform3(individual, past));
|
|
143
|
+
var dissolve = process4(
|
|
144
|
+
"dissolve",
|
|
145
|
+
"Dissolve an organization",
|
|
146
|
+
organization,
|
|
147
|
+
transform3(organization, past)
|
|
148
|
+
);
|
|
149
|
+
var abolish = process4(
|
|
150
|
+
"abolish",
|
|
151
|
+
"Abolish a position",
|
|
152
|
+
position,
|
|
153
|
+
transform3(position, past)
|
|
154
|
+
);
|
|
155
|
+
var rehire = process4(
|
|
156
|
+
"rehire",
|
|
157
|
+
"Rehire a retired individual",
|
|
158
|
+
past,
|
|
159
|
+
transform3(past, individual)
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
// src/role.ts
|
|
163
|
+
import { process as process5 } from "@rolexjs/system";
|
|
164
|
+
var activate = process5(
|
|
165
|
+
"activate",
|
|
166
|
+
"Activate a role \u2014 load cognition into context",
|
|
167
|
+
individual
|
|
168
|
+
);
|
|
56
169
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
170
|
+
abandon,
|
|
171
|
+
abolish,
|
|
172
|
+
activate,
|
|
173
|
+
appoint,
|
|
174
|
+
background,
|
|
175
|
+
born,
|
|
176
|
+
charge,
|
|
177
|
+
charter,
|
|
178
|
+
charterOrg,
|
|
179
|
+
complete,
|
|
180
|
+
create4 as create,
|
|
181
|
+
createPrototype,
|
|
182
|
+
createRuntime,
|
|
183
|
+
die,
|
|
184
|
+
dismiss,
|
|
185
|
+
dissolve,
|
|
186
|
+
duty,
|
|
187
|
+
encounter,
|
|
188
|
+
establish,
|
|
189
|
+
experience,
|
|
190
|
+
finish,
|
|
191
|
+
fire,
|
|
192
|
+
found,
|
|
193
|
+
goal,
|
|
194
|
+
hire,
|
|
195
|
+
identity,
|
|
196
|
+
individual,
|
|
197
|
+
knowledge,
|
|
198
|
+
link2 as link,
|
|
199
|
+
master,
|
|
200
|
+
mergeState,
|
|
201
|
+
mindset,
|
|
202
|
+
organization,
|
|
203
|
+
past,
|
|
204
|
+
plan,
|
|
205
|
+
planGoal,
|
|
206
|
+
position,
|
|
207
|
+
principle,
|
|
208
|
+
procedure,
|
|
209
|
+
process6 as process,
|
|
210
|
+
realize,
|
|
211
|
+
reflect,
|
|
212
|
+
rehire,
|
|
213
|
+
relation2 as relation,
|
|
214
|
+
remove,
|
|
215
|
+
retire,
|
|
216
|
+
society,
|
|
217
|
+
structure2 as structure,
|
|
218
|
+
task,
|
|
219
|
+
todo,
|
|
220
|
+
tone,
|
|
221
|
+
transform4 as transform,
|
|
222
|
+
unlink2 as unlink,
|
|
223
|
+
want
|
|
66
224
|
};
|
|
67
225
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/model/states.ts","../src/model/transitions.ts","../src/model/relations.ts"],"sourcesContent":["/**\n * states.ts — Role and Position state definitions.\n *\n * Role: free → member → on_duty\n * Position: vacant → filled\n */\n\nexport type RoleState = \"free\" | \"member\" | \"on_duty\";\nexport type PositionState = \"vacant\" | \"filled\";\n\n/**\n * Derive a role's state from assignment data.\n */\nexport function getRoleState(assignment: { org: string; position?: string } | null): RoleState {\n if (!assignment) return \"free\";\n if (assignment.position) return \"on_duty\";\n return \"member\";\n}\n\n/**\n * Derive a position's state from assignment data.\n */\nexport function getPositionState(assignedRole: string | null): PositionState {\n return assignedRole ? \"filled\" : \"vacant\";\n}\n","/**\n * transitions.ts — State machine definitions and transition logic.\n *\n * Role transitions:\n * free --(hire)--> member --(appoint)--> on_duty\n * on_duty --(dismiss)--> member --(fire)--> free\n * on_duty --(fire)--> free (auto-dismiss)\n *\n * Position transitions:\n * vacant --(appoint)--> filled --(dismiss)--> vacant\n */\n\nimport type { RoleState, PositionState } from \"./states.js\";\n\nexport interface Transition<S extends string> {\n readonly from: S;\n readonly to: S;\n readonly action: string;\n}\n\nexport const ROLE_MACHINE: Transition<RoleState>[] = [\n { from: \"free\", to: \"member\", action: \"hire\" },\n { from: \"member\", to: \"on_duty\", action: \"appoint\" },\n { from: \"on_duty\", to: \"member\", action: \"dismiss\" },\n { from: \"member\", to: \"free\", action: \"fire\" },\n { from: \"on_duty\", to: \"free\", action: \"fire\" },\n];\n\nexport const POSITION_MACHINE: Transition<PositionState>[] = [\n { from: \"vacant\", to: \"filled\", action: \"appoint\" },\n { from: \"filled\", to: \"vacant\", action: \"dismiss\" },\n];\n\n/**\n * Find a transition by current state and action.\n */\nexport function findTransition<S extends string>(\n machine: Transition<S>[],\n from: S,\n action: string\n): Transition<S> | null {\n return machine.find((t) => t.from === from && t.action === action) ?? null;\n}\n\n/**\n * Check if a transition is valid.\n */\nexport function canTransition<S extends string>(\n machine: Transition<S>[],\n from: S,\n action: string\n): boolean {\n return findTransition(machine, from, action) !== null;\n}\n\n/**\n * Execute a transition — returns new state or throws.\n */\nexport function transition<S extends string>(machine: Transition<S>[], from: S, action: string): S {\n const t = findTransition(machine, from, action);\n if (!t) {\n throw new Error(`Invalid transition: cannot \"${action}\" from state \"${from}\"`);\n }\n return t.to;\n}\n","/**\n * relations.ts — One-to-one relationship constraints.\n *\n * - A role can belong to at most one organization\n * - A role can hold at most one position\n * - A position can be held by at most one role\n */\n\nexport interface OneToOneConstraint {\n readonly entity: string;\n readonly relation: string;\n readonly description: string;\n}\n\nexport const RELATIONS: OneToOneConstraint[] = [\n {\n entity: \"role\",\n relation: \"organization\",\n description: \"A role can belong to at most one organization\",\n },\n { entity: \"role\", relation: \"position\", description: \"A role can hold at most one position\" },\n {\n entity: \"position\",\n relation: \"role\",\n description: \"A position can be held by at most one role\",\n },\n];\n\n/**\n * Validate that a one-to-one assignment does not conflict.\n * Throws if the entity is already assigned.\n */\nexport function validateOneToOne(\n entityName: string,\n currentValue: string | null,\n newValue: string,\n constraintDesc: string\n): void {\n if (currentValue && currentValue !== newValue) {\n throw new Error(`${constraintDesc}: \"${entityName}\" is already assigned to \"${currentValue}\"`);\n }\n}\n"],"mappings":";AAaO,SAAS,aAAa,YAAkE;AAC7F,MAAI,CAAC,WAAY,QAAO;AACxB,MAAI,WAAW,SAAU,QAAO;AAChC,SAAO;AACT;AAKO,SAA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G,cAAc,MAAM,UAAU,6BAA6B,YAAY,GAAG;AAAA,EAC/F;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/structures.ts","../src/execution.ts","../src/cognition.ts","../src/organization.ts","../src/lifecycle.ts","../src/role.ts"],"sourcesContent":["/**\n * @rolexjs/core — RoleX Concept World\n *\n * Domain-specific structures and processes built on @rolexjs/system.\n *\n * Structures — the concept tree (19 concepts, 2 relations)\n * Processes — how the world changes (24 processes, 4 layers)\n *\n * Layer 1: Execution — want, plan, todo, finish, complete, abandon\n * Layer 2: Cognition — reflect, realize, master\n * Layer 3: Organization — hire, fire, appoint, dismiss, charter, charge\n * Layer 4: Lifecycle — born, found, establish, retire, die, dissolve, abolish, rehire\n * + Role: activate\n */\n\n// Re-export system primitives\nexport {\n type Create,\n create,\n createPrototype,\n createRuntime,\n type GraphOp,\n type Link,\n link,\n mergeState,\n type Process,\n type Prototype,\n process,\n type Relation,\n type Remove,\n type Runtime,\n relation,\n remove,\n type State,\n type Structure,\n structure,\n type Transform,\n transform,\n type Unlink,\n unlink,\n} from \"@rolexjs/system\";\n\n// Platform\nexport type { Platform } from \"./platform.js\";\n\n// ===== Structures =====\n\nexport {\n background,\n // Organization\n charter,\n duty,\n // Individual — Cognition\n encounter,\n experience,\n // Individual — Execution\n goal,\n // Individual — Identity\n identity,\n // Level 1\n individual,\n // Individual — Knowledge\n knowledge,\n mindset,\n organization,\n past,\n plan,\n position,\n principle,\n procedure,\n // Level 0\n society,\n task,\n tone,\n} from \"./structures.js\";\n\n// ===== Processes — Layer 1: Execution =====\n\nexport { abandon, complete, finish, planGoal, todo, want } from \"./execution.js\";\n\n// ===== Processes — Layer 2: Cognition =====\n\nexport { master, realize, reflect } from \"./cognition.js\";\n\n// ===== Processes — Layer 3: Organization =====\n\nexport { appoint, charge, charterOrg, dismiss, fire, hire } from \"./organization.js\";\n\n// ===== Processes — Layer 4: Lifecycle =====\n\nexport { abolish, born, die, dissolve, establish, found, rehire, retire } from \"./lifecycle.js\";\n\n// ===== Role =====\n\nexport { activate } from \"./role.js\";\n","/**\n * RoleX Concept World — all structure definitions.\n *\n * Every node is a Structure — simultaneously concept, container,\n * and information carrier. Tree (parent-child) provides the\n * hierarchical backbone. Relations provide cross-branch links.\n *\n * ┌─────────────────────────────────────────────────────────┐\n * │ society │\n * │ ├── individual \"A single agent in society\" │\n * │ │ ├── identity \"Who I am\" │\n * │ │ │ ├── background \"My personal background\" │\n * │ │ │ ├── tone \"My tone of communication\" │\n * │ │ │ └── mindset \"How I think\" │\n * │ │ ├── encounter \"A specific event I went through\"│\n * │ │ ├── experience \"What I learned from encounters\" │\n * │ │ ├── knowledge \"What I know\" │\n * │ │ │ ├── principle \"My rules of conduct\" │\n * │ │ │ └── procedure \"My skill references and metadata\"│\n * │ │ └── goal \"What I am pursuing\" │\n * │ │ └── plan \"How to achieve a goal\" │\n * │ │ └── task \"Concrete unit of work\" │\n * │ ├── organization \"A group of individuals\" │\n * │ │ │ ∿ membership → individual │\n * │ │ ├── charter \"The rules and mission\" │\n * │ │ └── position \"A role held by an individual\" │\n * │ │ │ ∿ appointment → individual │\n * │ │ └── duty \"Responsibilities of position\" │\n * │ └── past \"Things no longer active\" │\n * └─────────────────────────────────────────────────────────┘\n */\nimport { relation, structure } from \"@rolexjs/system\";\n\n// ================================================================\n// Level 0 — Root\n// ================================================================\n\nexport const society = structure(\"society\", \"The RoleX world\", null);\n\n// ================================================================\n// Level 1 — Three pillars\n// ================================================================\n\nexport const individual = structure(\"individual\", \"A single agent in society\", society);\nexport const organization = structure(\"organization\", \"A group of individuals\", society, [\n relation(\"membership\", \"Who belongs to this organization\", individual),\n]);\nexport const past = structure(\"past\", \"Things no longer active\", society);\n\n// ================================================================\n// Individual — Identity\n// ================================================================\n\nexport const identity = structure(\"identity\", \"Who I am\", individual);\nexport const background = structure(\"background\", \"My personal background\", identity);\nexport const tone = structure(\"tone\", \"My tone of communication\", identity);\nexport const mindset = structure(\"mindset\", \"How I think and approach problems\", identity);\n\n// ================================================================\n// Individual — Cognition\n// ================================================================\n\nexport const encounter = structure(\"encounter\", \"A specific event I went through\", individual);\nexport const experience = structure(\"experience\", \"What I learned from encounters\", individual);\n\n// ================================================================\n// Individual — Knowledge\n// ================================================================\n\nexport const knowledge = structure(\"knowledge\", \"What I know\", individual);\nexport const principle = structure(\"principle\", \"My rules of conduct\", knowledge);\nexport const procedure = structure(\"procedure\", \"My skill references and metadata\", knowledge);\n\n// ================================================================\n// Individual — Execution\n// ================================================================\n\nexport const goal = structure(\"goal\", \"What I am pursuing\", individual);\nexport const plan = structure(\"plan\", \"How to achieve a goal\", goal);\nexport const task = structure(\"task\", \"Concrete unit of work\", plan);\n\n// ================================================================\n// Organization\n// ================================================================\n\nexport const charter = structure(\"charter\", \"The rules and mission\", organization);\nexport const position = structure(\"position\", \"A role held by an individual\", organization, [\n relation(\"appointment\", \"Who holds this position\", individual),\n]);\nexport const duty = structure(\"duty\", \"Responsibilities of this position\", position);\n","/**\n * Execution cycle — the doing loop.\n *\n * want → plan → todo → finish → (encounter) → want → ...\n * plan → complete → (encounter)\n * plan → abandon → (encounter)\n *\n * Goals are long-term directions. Plans are the completable unit —\n * they can be completed or abandoned. Tasks finish individually.\n * All transforms produce encounters — feeding the cognition cycle.\n */\nimport { create, process, transform } from \"@rolexjs/system\";\nimport { encounter, goal, individual, plan, task } from \"./structures.js\";\n\nexport const want = process(\"want\", \"Declare a goal\", individual, create(goal));\nexport const planGoal = process(\"plan\", \"Create a plan for a goal\", goal, create(plan));\nexport const todo = process(\"todo\", \"Create a task in a plan\", plan, create(task));\n\nexport const finish = process(\n \"finish\",\n \"Complete a task, record as encounter\",\n task,\n transform(task, encounter)\n);\nexport const complete = process(\n \"complete\",\n \"Complete a plan, record as encounter\",\n plan,\n transform(plan, encounter)\n);\nexport const abandon = process(\n \"abandon\",\n \"Abandon a plan, record as encounter\",\n plan,\n transform(plan, encounter)\n);\n","/**\n * Cognition cycle — the learning loop.\n *\n * encounter → reflect → experience → realize → principle\n * → master → procedure\n *\n * Encounters are raw events (produced by the execution cycle).\n * Reflection distills them into experience. From experience,\n * principles are realized and procedures are mastered.\n */\nimport { process, transform } from \"@rolexjs/system\";\nimport { encounter, experience, principle, procedure } from \"./structures.js\";\n\nexport const reflect = process(\n \"reflect\",\n \"Reflect on encounters, distill into experience\",\n encounter,\n transform(encounter, experience)\n);\nexport const realize = process(\n \"realize\",\n \"Realize a principle from experience\",\n experience,\n transform(experience, principle)\n);\nexport const master = process(\n \"master\",\n \"Master a procedure from experience\",\n experience,\n transform(experience, procedure)\n);\n","/**\n * Organization management — hiring, firing, and structuring.\n *\n * hire / fire — membership (who belongs)\n * appoint / dismiss — appointment (who holds a position)\n * charter — define org rules and mission\n * charge — add duties to a position\n */\nimport { create, link, process, unlink } from \"@rolexjs/system\";\nimport { charter, duty, organization, position } from \"./structures.js\";\n\n// Membership\nexport const hire = process(\n \"hire\",\n \"Hire an individual into the organization\",\n organization,\n link(organization, \"membership\")\n);\nexport const fire = process(\n \"fire\",\n \"Fire an individual from the organization\",\n organization,\n unlink(organization, \"membership\")\n);\n\n// Appointment\nexport const appoint = process(\n \"appoint\",\n \"Appoint a member to a position\",\n position,\n link(position, \"appointment\")\n);\nexport const dismiss = process(\n \"dismiss\",\n \"Dismiss from a position\",\n position,\n unlink(position, \"appointment\")\n);\n\n// Structure\nexport const charterOrg = process(\n \"charter\",\n \"Define the charter for an organization\",\n organization,\n create(charter)\n);\nexport const charge = process(\"charge\", \"Add a duty to a position\", position, create(duty));\n","/**\n * Lifecycle — creation, retirement, and dissolution.\n *\n * born / found / establish — bring things into existence\n * retire / die — individual → past\n * dissolve — organization → past\n * abolish — position → past\n * rehire — past → individual (return from retirement)\n *\n * No real deletion — everything transforms to the \"past\" branch.\n */\nimport { create, process, transform } from \"@rolexjs/system\";\nimport { individual, organization, past, position, society } from \"./structures.js\";\n\n// Creation\nexport const born = process(\n \"born\",\n \"An individual is born into society\",\n society,\n create(individual)\n);\nexport const found = process(\"found\", \"Found an organization\", society, create(organization));\nexport const establish = process(\n \"establish\",\n \"Establish a position in an organization\",\n organization,\n create(position)\n);\n\n// Retirement & death\nexport const retire = process(\n \"retire\",\n \"Retire an individual\",\n individual,\n transform(individual, past)\n);\nexport const die = process(\"die\", \"An individual dies\", individual, transform(individual, past));\n\n// Dissolution\nexport const dissolve = process(\n \"dissolve\",\n \"Dissolve an organization\",\n organization,\n transform(organization, past)\n);\nexport const abolish = process(\n \"abolish\",\n \"Abolish a position\",\n position,\n transform(position, past)\n);\n\n// Return\nexport const rehire = process(\n \"rehire\",\n \"Rehire a retired individual\",\n past,\n transform(past, individual)\n);\n","/**\n * Role projection — activating a role loads cognition into context.\n *\n * A role is not a Structure — it is a State (projection).\n * What to load is defined by the upper layer.\n */\nimport { process } from \"@rolexjs/system\";\nimport { individual } from \"./structures.js\";\n\nexport const activate = process(\n \"activate\",\n \"Activate a role — load cognition into context\",\n individual\n);\n"],"mappings":";AAgBA;AAAA,EAEE,UAAAA;AAAA,EACA;AAAA,EACA;AAAA,EAGA,QAAAC;AAAA,EACA;AAAA,EAGA,WAAAC;AAAA,EAIA,YAAAC;AAAA,EACA;AAAA,EAGA,aAAAC;AAAA,EAEA,aAAAC;AAAA,EAEA,UAAAC;AAAA,OACK;;;ACTP,SAAS,UAAU,iBAAiB;AAM7B,IAAM,UAAU,UAAU,WAAW,mBAAmB,IAAI;AAM5D,IAAM,aAAa,UAAU,cAAc,6BAA6B,OAAO;AAC/E,IAAM,eAAe,UAAU,gBAAgB,0BAA0B,SAAS;AAAA,EACvF,SAAS,cAAc,oCAAoC,UAAU;AACvE,CAAC;AACM,IAAM,OAAO,UAAU,QAAQ,2BAA2B,OAAO;AAMjE,IAAM,WAAW,UAAU,YAAY,YAAY,UAAU;AAC7D,IAAM,aAAa,UAAU,cAAc,0BAA0B,QAAQ;AAC7E,IAAM,OAAO,UAAU,QAAQ,4BAA4B,QAAQ;AACnE,IAAM,UAAU,UAAU,WAAW,qCAAqC,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;AACO,IAAM,UAAUF;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACAE,WAAU,UAAU,IAAI;AAC1B;AAGO,IAAM,SAASF;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACAE,WAAU,MAAM,UAAU;AAC5B;;;ACpDA,SAAS,WAAAC,gBAAe;AAGjB,IAAM,WAAWC;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AACF;","names":["create","link","process","relation","structure","transform","unlink","process","transform","process","transform","create","process","process","create","create","process","transform","process","create","transform","process","process"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolexjs/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0-dev.0",
|
|
4
4
|
"description": "RoleX Core - AI Agent Role Management Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rolex",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
|
+
"bun": "./src/index.ts",
|
|
26
27
|
"default": "./dist/index.js"
|
|
27
28
|
}
|
|
28
29
|
},
|
|
@@ -32,15 +33,16 @@
|
|
|
32
33
|
],
|
|
33
34
|
"scripts": {
|
|
34
35
|
"build": "tsup",
|
|
35
|
-
"test": "
|
|
36
|
-
"lint": "
|
|
36
|
+
"test": "echo 'no tests yet'",
|
|
37
|
+
"lint": "biome lint .",
|
|
37
38
|
"typecheck": "tsc --noEmit",
|
|
38
39
|
"clean": "rm -rf dist"
|
|
39
40
|
},
|
|
40
|
-
"dependencies": {
|
|
41
|
-
|
|
42
|
-
"
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@rolexjs/system": "workspace:*",
|
|
43
|
+
"resourcexjs": "^2.8.0"
|
|
43
44
|
},
|
|
45
|
+
"devDependencies": {},
|
|
44
46
|
"publishConfig": {
|
|
45
47
|
"access": "public"
|
|
46
48
|
}
|