rolexjs 1.0.0 → 1.1.0-dev-20260303090453
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.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -620,7 +620,9 @@ var Rolex = class _Rolex {
|
|
|
620
620
|
this.bootstrap = platform.bootstrap ?? [];
|
|
621
621
|
if (platform.resourcexProvider) {
|
|
622
622
|
setProvider(platform.resourcexProvider);
|
|
623
|
-
this.resourcex = createResourceX(
|
|
623
|
+
this.resourcex = createResourceX(
|
|
624
|
+
platform.resourcexExecutor ? { isolator: "custom", executor: platform.resourcexExecutor } : void 0
|
|
625
|
+
);
|
|
624
626
|
}
|
|
625
627
|
}
|
|
626
628
|
/** Create a Rolex instance from a Platform (async due to Runtime initialization). */
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/context.ts","../src/feature.ts","../src/find.ts","../src/render.ts","../src/role.ts","../src/rolex.ts"],"sourcesContent":["/**\n * rolexjs — RoleX API + Render layer.\n *\n * Usage:\n * import { Rolex, Role, describe, hint } from \"rolexjs\";\n *\n * const rolex = await createRoleX(platform);\n * await rolex.genesis();\n * const role = await rolex.activate(\"sean\");\n * await role.want(\"Feature: Ship v1\", \"ship-v1\");\n */\n\n// Re-export core (structures + processes)\nexport * from \"@rolexjs/core\";\n// Context\nexport { RoleContext } from \"./context.js\";\n// Feature (Gherkin type + parse/serialize)\nexport type { DataTableRow, Feature, Scenario, Step } from \"./feature.js\";\nexport { parse, serialize } from \"./feature.js\";\n// Find\nexport { findInState } from \"./find.js\";\nexport type { RenderOptions, RenderStateOptions } from \"./render.js\";\n// Render\nexport { describe, detail, directive, hint, render, renderState, world } from \"./render.js\";\n// Role\nexport { Role } from \"./role.js\";\n// API\nexport type { CensusEntry } from \"./rolex.js\";\nexport { createRoleX, Rolex } from \"./rolex.js\";\n","/**\n * RoleContext — stateful session context for role operations.\n *\n * Tracks execution state from the individual's perspective:\n * - roleId (who I am)\n * - focusedGoalId / focusedPlanId (what I'm working on)\n * - encounter / experience id sets (what I have for cognition)\n *\n * Created by activate, updated by subsequent role operations.\n * Consumers (MCP, CLI) hold a reference and pass it through.\n */\nimport type { State } from \"@rolexjs/system\";\n\nexport class RoleContext {\n roleId: string;\n focusedGoalId: string | null = null;\n focusedPlanId: string | null = null;\n\n readonly encounterIds = new Set<string>();\n readonly experienceIds = new Set<string>();\n\n constructor(roleId: string) {\n this.roleId = roleId;\n }\n\n // ================================================================\n // Requirements — throw if missing\n // ================================================================\n\n requireGoalId(): string {\n if (!this.focusedGoalId) throw new Error(\"No focused goal. Call want first.\");\n return this.focusedGoalId;\n }\n\n requirePlanId(): string {\n if (!this.focusedPlanId) throw new Error(\"No focused plan. Call plan first.\");\n return this.focusedPlanId;\n }\n\n // ================================================================\n // Cognition registries\n // ================================================================\n\n addEncounter(id: string) {\n this.encounterIds.add(id);\n }\n\n requireEncounterIds(ids: string[]) {\n for (const id of ids) {\n if (!this.encounterIds.has(id)) throw new Error(`Encounter not found: \"${id}\"`);\n }\n }\n\n consumeEncounters(ids: string[]) {\n for (const id of ids) {\n this.encounterIds.delete(id);\n }\n }\n\n addExperience(id: string) {\n this.experienceIds.add(id);\n }\n\n requireExperienceIds(ids: string[]) {\n for (const id of ids) {\n if (!this.experienceIds.has(id)) throw new Error(`Experience not found: \"${id}\"`);\n }\n }\n\n consumeExperiences(ids: string[]) {\n for (const id of ids) {\n this.experienceIds.delete(id);\n }\n }\n\n // ================================================================\n // Rehydration — rebuild from activation state\n // ================================================================\n\n /** Walk the state tree and populate registries. */\n rehydrate(state: State) {\n this.walk(state);\n }\n\n private walk(node: State) {\n if (node.id) {\n switch (node.name) {\n case \"goal\":\n if (!this.focusedGoalId) this.focusedGoalId = node.id;\n break;\n case \"encounter\":\n this.encounterIds.add(node.id);\n break;\n case \"experience\":\n this.experienceIds.add(node.id);\n break;\n }\n }\n for (const child of (node as State & { children?: readonly State[] }).children ?? []) {\n this.walk(child);\n }\n }\n\n // ================================================================\n // Cognitive hints — state-aware AI self-direction cues\n // ================================================================\n\n /** First-person, state-aware hint for the AI after an operation. */\n cognitiveHint(process: string): string | null {\n switch (process) {\n case \"activate\":\n if (!this.focusedGoalId)\n return \"I have no goal yet. I should call `want` to declare one, or `focus` to review existing goals.\";\n return \"I have an active goal. I should call `focus` to review progress, or `want` to declare a new goal.\";\n\n case \"focus\":\n if (!this.focusedPlanId)\n return \"I have a goal but no focused plan. I should call `plan` to create or focus on one.\";\n return \"I have a plan. I should call `todo` to create tasks, or continue working.\";\n\n case \"want\":\n return \"Goal declared. I should call `plan` to design how to achieve it.\";\n\n case \"plan\":\n return \"Plan created. I should call `todo` to create concrete tasks.\";\n\n case \"todo\":\n return \"Task created. I can add more with `todo`, or start working and call `finish` when done.\";\n\n case \"finish\": {\n const encCount = this.encounterIds.size;\n if (encCount > 0 && !this.focusedGoalId)\n return `Task finished. No more goals — I have ${encCount} encounter(s) to choose from for \\`reflect\\`, or \\`want\\` a new goal.`;\n return \"Task finished. I should continue with remaining tasks, or call `complete` when the plan is done.\";\n }\n\n case \"complete\":\n case \"abandon\": {\n const encCount = this.encounterIds.size;\n const goalNote = this.focusedGoalId\n ? ` I should check if goal \"${this.focusedGoalId}\" needs a new \\`plan\\`, or \\`forget\\` it if the direction is fulfilled.`\n : \"\";\n if (encCount > 0)\n return `Plan closed.${goalNote} I have ${encCount} encounter(s) to choose from for \\`reflect\\`, or I can continue with other plans.`;\n return `Plan closed.${goalNote} I can create a new \\`plan\\`, or \\`focus\\` on another goal.`;\n }\n\n case \"reflect\": {\n const expCount = this.experienceIds.size;\n if (expCount > 0)\n return `Experience gained. I can \\`realize\\` principles or \\`master\\` procedures — ${expCount} experience(s) available.`;\n return \"Experience gained. I can `realize` a principle, `master` a procedure, or continue working.\";\n }\n\n case \"realize\":\n return \"Principle added. I should continue working.\";\n\n case \"master\":\n return \"Procedure added. I should continue working.\";\n\n default:\n return null;\n }\n }\n}\n","/**\n * Feature — the information format for the RoleX concept world.\n *\n * Every node's information is a Gherkin Feature.\n * This is our own type — decoupled from @cucumber/messages.\n */\n\nexport interface Feature {\n readonly name: string;\n readonly description?: string;\n readonly tags?: readonly string[];\n readonly scenarios: readonly Scenario[];\n}\n\nexport interface Scenario {\n readonly name: string;\n readonly description?: string;\n readonly tags?: readonly string[];\n readonly steps: readonly Step[];\n}\n\nexport interface Step {\n readonly keyword: string;\n readonly text: string;\n readonly dataTable?: readonly DataTableRow[];\n}\n\nexport interface DataTableRow {\n readonly cells: readonly string[];\n}\n\n// ================================================================\n// Parse + Serialize\n// ================================================================\n\nimport { parse as parseGherkin } from \"@rolexjs/parser\";\n\n/** Parse a Gherkin source string into a Feature. */\nexport function parse(source: string): Feature {\n const doc = parseGherkin(source);\n const f = doc.feature;\n if (!f) throw new Error(\"No Feature found in source\");\n\n return {\n name: f.name,\n ...(f.description?.trim() ? { description: f.description.trim() } : {}),\n ...(f.tags?.length ? { tags: f.tags.map((t) => t.name) } : {}),\n scenarios: (f.children ?? [])\n .filter((c) => c.scenario)\n .map((c) => {\n const s = c.scenario!;\n return {\n name: s.name,\n ...(s.description?.trim() ? { description: s.description.trim() } : {}),\n ...(s.tags?.length ? { tags: s.tags.map((t) => t.name) } : {}),\n steps: (s.steps ?? []).map((st) => ({\n keyword: st.keyword,\n text: st.text,\n ...(st.dataTable\n ? {\n dataTable: st.dataTable.rows.map((r) => ({\n cells: r.cells.map((c) => c.value),\n })),\n }\n : {}),\n })),\n };\n }),\n };\n}\n\n/** Serialize a Feature back to Gherkin source string. */\nexport function serialize(feature: Feature): string {\n const lines: string[] = [];\n\n if (feature.tags?.length) {\n lines.push(feature.tags.join(\" \"));\n }\n lines.push(`Feature: ${feature.name}`);\n if (feature.description) {\n for (const line of feature.description.split(\"\\n\")) {\n lines.push(` ${line}`);\n }\n }\n\n for (const scenario of feature.scenarios) {\n lines.push(\"\");\n if (scenario.tags?.length) {\n lines.push(` ${scenario.tags.join(\" \")}`);\n }\n lines.push(` Scenario: ${scenario.name}`);\n if (scenario.description) {\n for (const line of scenario.description.split(\"\\n\")) {\n lines.push(` ${line}`);\n }\n }\n for (const step of scenario.steps) {\n lines.push(` ${step.keyword}${step.text}`);\n if (step.dataTable) {\n for (const row of step.dataTable) {\n lines.push(` | ${row.cells.join(\" | \")} |`);\n }\n }\n }\n }\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n","/**\n * Find — unified node lookup with priority-based disambiguation.\n *\n * When multiple nodes share the same id (allowed after relaxing\n * global uniqueness), prefer \"addressable\" nodes over internal metadata.\n *\n * Priority (lower = preferred):\n * 0: individual, organization, position — top-level entities\n * 1: goal — execution roots\n * 2: plan, task — execution nodes\n * 3: procedure, principle — individual knowledge\n * 4: encounter, experience — cognition artifacts\n * 5: identity, charter — structural definitions\n * 6: duty, requirement, background, etc. — internal metadata\n */\nimport type { State, Structure } from \"@rolexjs/system\";\n\nconst PRIORITY: Record<string, number> = {\n individual: 0,\n organization: 0,\n position: 0,\n goal: 1,\n plan: 2,\n task: 2,\n procedure: 3,\n principle: 3,\n encounter: 4,\n experience: 4,\n identity: 5,\n charter: 5,\n duty: 6,\n requirement: 6,\n background: 6,\n tone: 6,\n mindset: 6,\n};\n\nfunction priorityOf(name: string): number {\n return PRIORITY[name] ?? 7;\n}\n\nfunction matches(node: State, target: string): boolean {\n if (node.id?.toLowerCase() === target) return true;\n if (node.alias) {\n for (const a of node.alias) {\n if (a.toLowerCase() === target) return true;\n }\n }\n return false;\n}\n\n/**\n * Find a node by id or alias in a state tree.\n *\n * When multiple nodes match, returns the one with the highest priority\n * (top-level entities > execution nodes > knowledge > metadata).\n */\nexport function findInState(state: State, target: string): Structure | null {\n const lowered = target.toLowerCase();\n let best: Structure | null = null;\n let bestPriority = Infinity;\n\n function walk(node: State): void {\n if (matches(node, lowered)) {\n const p = priorityOf(node.name);\n if (p < bestPriority) {\n best = node;\n bestPriority = p;\n if (p === 0) return; // Can't do better\n }\n }\n for (const child of node.children ?? []) {\n walk(child);\n if (bestPriority === 0) return; // Early exit\n }\n }\n\n walk(state);\n return best;\n}\n","/**\n * Render — 3-layer output for all Rolex operations.\n *\n * Layer 1: Status — what just happened (describe)\n * Layer 2: Hint — what to do next (hint + cognitive hint)\n * Layer 3: Projection — full state tree as markdown (renderState)\n *\n * render() composes the 3 layers. MCP and CLI are pure pass-through.\n */\nimport type { State } from \"@rolexjs/system\";\n\n// ================================================================\n// Description — what happened\n// ================================================================\n\nconst descriptions: Record<string, (name: string, state: State) => string> = {\n // Lifecycle\n born: (n) => `Individual \"${n}\" is born.`,\n found: (n) => `Organization \"${n}\" is founded.`,\n establish: (n) => `Position \"${n}\" is established.`,\n charter: (n) => `Charter defined for \"${n}\".`,\n charge: (n) => `Duty \"${n}\" assigned.`,\n retire: (n) => `\"${n}\" retired.`,\n die: (n) => `\"${n}\" is gone.`,\n dissolve: (n) => `Organization \"${n}\" dissolved.`,\n abolish: (n) => `Position \"${n}\" abolished.`,\n rehire: (n) => `\"${n}\" is back.`,\n\n // Organization\n hire: (n) => `\"${n}\" hired.`,\n fire: (n) => `\"${n}\" fired.`,\n appoint: (n) => `\"${n}\" appointed.`,\n dismiss: (n) => `\"${n}\" dismissed.`,\n\n // Role\n activate: (n) => `Role \"${n}\" activated.`,\n focus: (n) => `Focused on goal \"${n}\".`,\n\n // Execution\n want: (n) => `Goal \"${n}\" declared.`,\n plan: (n) => `Plan created for \"${n}\".`,\n todo: (n) => `Task \"${n}\" added.`,\n finish: (n) => `Task \"${n}\" finished → encounter recorded.`,\n complete: (n) => `Plan \"${n}\" completed → encounter recorded.`,\n abandon: (n) => `Plan \"${n}\" abandoned → encounter recorded.`,\n\n // Cognition\n reflect: (n) => `Reflected on \"${n}\" → experience gained.`,\n realize: (n) => `Realized principle from \"${n}\".`,\n master: (n) => `Mastered procedure from \"${n}\".`,\n\n // Knowledge management\n forget: (n) => `\"${n}\" forgotten.`,\n};\n\nexport function describe(process: string, name: string, state: State): string {\n const fn = descriptions[process];\n return fn ? fn(name, state) : `${process} completed.`;\n}\n\n// ================================================================\n// Hint — what to do next\n// ================================================================\n\nconst hints: Record<string, string> = {\n // Lifecycle\n born: \"hire into an organization, or activate to start working.\",\n found: \"define a charter for the organization.\",\n establish: \"charge with duties, then appoint members.\",\n charter: \"establish positions for the organization.\",\n charge: \"appoint someone to this position.\",\n retire: \"rehire if needed later.\",\n die: \"this individual is permanently gone.\",\n dissolve: \"the organization no longer exists.\",\n abolish: \"the position no longer exists.\",\n rehire: \"activate to resume working.\",\n\n // Organization\n hire: \"appoint to a position, or activate to start working.\",\n fire: \"the individual is no longer a member.\",\n appoint: \"the individual now holds this position.\",\n dismiss: \"the position is now vacant.\",\n\n // Role\n activate: \"want a goal, or check the current state.\",\n focus: \"plan how to work toward it, or add tasks.\",\n\n // Execution\n want: \"plan how to work toward it.\",\n plan: \"add tasks with todo.\",\n todo: \"start working, finish when done.\",\n finish: \"continue with remaining tasks, or complete the plan.\",\n complete: \"reflect on encounters to gain experience.\",\n abandon: \"reflect on encounters to learn from the experience.\",\n\n // Cognition\n reflect: \"realize principles or master procedures from experience.\",\n realize: \"principle added.\",\n master: \"procedure added.\",\n\n // Knowledge management\n forget: \"the node has been removed.\",\n};\n\nexport function hint(process: string): string {\n const h = hints[process];\n return h ? `Next: ${h}` : \"What would you like to do next?\";\n}\n\n// ================================================================\n// Detail — longer process descriptions (from .feature files)\n// ================================================================\n\nimport { directives, processes, world } from \"@rolexjs/prototype\";\n\n/** Full Gherkin feature content for a process — sourced from .feature files. */\nexport function detail(process: string): string {\n return processes[process] ?? \"\";\n}\n\n/** World feature descriptions — framework-level instructions. */\nexport { world };\n\n// ================================================================\n// Directive — system-level commands at decision points\n// ================================================================\n\n/** Get a directive by topic and scenario. Returns empty string if not found. */\nexport function directive(topic: string, scenario: string): string {\n return directives[topic]?.[scenario] ?? \"\";\n}\n\n// ================================================================\n// Generic State renderer — renders any State tree as markdown\n// ================================================================\n\n/**\n * renderState — markdown renderer for State trees.\n *\n * Rules:\n * - Heading: \"#\" repeated to depth + \" [name]\"\n * - Body: raw information field as-is (full Gherkin preserved)\n * - Links: \"> → relation [target.name]\" with target feature name\n * - Children: sorted by concept hierarchy, then rendered at depth+1\n * - Fold: when fold(node) returns true, render heading only (no body/links/children)\n *\n * Markdown heading depth caps at 6 (######).\n */\nexport interface RenderStateOptions {\n /** When returns true, render only the heading — skip body, links, and children. */\n fold?: (node: State) => boolean;\n}\n\nexport function renderState(state: State, depth = 1, options?: RenderStateOptions): string {\n const lines: string[] = [];\n const level = Math.min(depth, 6);\n const heading = \"#\".repeat(level);\n\n // Heading: [name] (id) {origin} #tag [progress]\n const idPart = state.id ? ` (${state.id})` : \"\";\n const originPart = state.origin ? ` {${state.origin}}` : \"\";\n const tagPart = state.tag ? ` #${state.tag}` : \"\";\n const progressPart = state.name === \"goal\" ? goalProgress(state) : \"\";\n lines.push(`${heading} [${state.name}]${idPart}${originPart}${tagPart}${progressPart}`);\n\n // Folded: heading only\n if (options?.fold?.(state)) {\n return lines.join(\"\\n\");\n }\n\n // Body: full information as-is\n if (state.information) {\n lines.push(\"\");\n lines.push(state.information);\n }\n\n // Links — plan references are compact, organizational links are expanded\n if (state.links && state.links.length > 0) {\n const compactRelations = new Set([\"after\", \"before\", \"fallback\", \"fallback-for\"]);\n const compact = state.links.filter((l) => compactRelations.has(l.relation));\n const expanded = state.links.filter((l) => !compactRelations.has(l.relation));\n for (const link of compact) {\n const targetId = link.target.id ? ` (${link.target.id})` : \"\";\n const targetTag = link.target.tag ? ` #${link.target.tag}` : \"\";\n lines.push(`> ${link.relation}: [${link.target.name}]${targetId}${targetTag}`);\n }\n if (expanded.length > 0) {\n const targets = sortByConceptOrder(expanded.map((l) => l.target));\n for (const target of targets) {\n lines.push(\"\");\n lines.push(renderState(target, depth + 1, options));\n }\n }\n }\n\n // Children — sorted by concept hierarchy, empty nodes filtered out\n if (state.children && state.children.length > 0) {\n const sorted = sortByConceptOrder(state.children.filter((c) => !isEmpty(c)));\n for (const child of sorted) {\n lines.push(\"\");\n lines.push(renderState(child, depth + 1, options));\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n// ================================================================\n// Concept ordering — children sorted by structure hierarchy\n// ================================================================\n\n/** Concept tree order: identity → cognition → knowledge → execution → organization. */\nconst CONCEPT_ORDER: readonly string[] = [\n // Individual — Identity\n \"identity\",\n \"background\",\n \"tone\",\n \"mindset\",\n // Individual — Cognition\n \"encounter\",\n \"experience\",\n // Individual — Knowledge\n \"principle\",\n \"procedure\",\n // Individual — Execution\n \"goal\",\n \"plan\",\n \"task\",\n // Organization\n \"charter\",\n // Position\n \"position\",\n \"duty\",\n];\n\n/** Summarize plan/task completion for a goal heading. */\nfunction goalProgress(goal: State): string {\n let plans = 0;\n let plansDone = 0;\n let tasks = 0;\n let tasksDone = 0;\n\n function walk(node: State): void {\n if (node.name === \"plan\") {\n plans++;\n if (node.tag === \"done\" || node.tag === \"abandoned\") plansDone++;\n } else if (node.name === \"task\") {\n tasks++;\n if (node.tag === \"done\") tasksDone++;\n }\n for (const child of node.children ?? []) walk(child);\n }\n\n for (const child of goal.children ?? []) walk(child);\n if (plans === 0 && tasks === 0) return \"\";\n const parts: string[] = [];\n if (plans > 0) parts.push(`${plansDone}/${plans} plans`);\n if (tasks > 0) parts.push(`${tasksDone}/${tasks} tasks`);\n return ` [${parts.join(\", \")}]`;\n}\n\n/** A node is empty when it has no id, no information, and no children. */\nfunction isEmpty(node: State): boolean {\n return !node.id && !node.information && (!node.children || node.children.length === 0);\n}\n\n/** Sort children by concept hierarchy order. Unknown names go to the end, preserving relative order. */\nfunction sortByConceptOrder(children: readonly State[]): readonly State[] {\n return [...children].sort((a, b) => {\n const ai = CONCEPT_ORDER.indexOf(a.name);\n const bi = CONCEPT_ORDER.indexOf(b.name);\n const aOrder = ai >= 0 ? ai : CONCEPT_ORDER.length;\n const bOrder = bi >= 0 ? bi : CONCEPT_ORDER.length;\n return aOrder - bOrder;\n });\n}\n\n// ================================================================\n// Render — 3-layer output for tool results\n// ================================================================\n\nexport interface RenderOptions {\n /** The process that was executed. */\n process: string;\n /** Display name for the primary node. */\n name: string;\n /** State projection of the affected node. */\n state: State;\n /** AI cognitive hint — first-person, state-aware self-direction cue. */\n cognitiveHint?: string | null;\n /** Fold predicate — folded nodes render heading only. */\n fold?: RenderStateOptions[\"fold\"];\n}\n\n/** Render a full 3-layer output string. */\nexport function render(opts: RenderOptions): string {\n const { process, name, state, cognitiveHint, fold } = opts;\n const lines: string[] = [];\n\n // Layer 1: Status\n lines.push(describe(process, name, state));\n\n // Layer 2: Hint (static) + Cognitive hint (state-aware)\n lines.push(hint(process));\n if (cognitiveHint) {\n lines.push(`I → ${cognitiveHint}`);\n }\n\n // Layer 3: Projection — generic markdown rendering of the full state tree\n lines.push(\"\");\n lines.push(renderState(state, 1, fold ? { fold } : undefined));\n\n return lines.join(\"\\n\");\n}\n","/**\n * Role — stateful handle returned by Rolex.activate().\n *\n * Holds roleId + RoleContext internally.\n * All operations return rendered 3-layer text (status + hint + projection).\n * MCP and CLI are pure pass-through — no render logic needed.\n *\n * Usage:\n * const role = await rolex.activate(\"sean\");\n * await role.want(\"Feature: Ship v1\", \"ship-v1\"); // → rendered string\n * await role.plan(\"Feature: Phase 1\", \"phase-1\"); // → rendered string\n * await role.finish(\"write-tests\", \"Feature: Tests written\");\n */\n\nimport type { OpResult, Ops } from \"@rolexjs/prototype\";\nimport type { RoleContext } from \"./context.js\";\nimport { render } from \"./render.js\";\n\n/**\n * Internal API surface that Role delegates to.\n * Constructed by Rolex.activate() — not part of public API.\n */\nexport interface RolexInternal {\n ops: Ops;\n saveCtx(ctx: RoleContext): void | Promise<void>;\n direct<T>(locator: string, args?: Record<string, unknown>): Promise<T>;\n}\n\nexport class Role {\n readonly roleId: string;\n readonly ctx: RoleContext;\n private api: RolexInternal;\n\n constructor(roleId: string, ctx: RoleContext, api: RolexInternal) {\n this.roleId = roleId;\n this.ctx = ctx;\n this.api = api;\n }\n\n /** Project the individual's full state tree (used after activate). */\n async project(): Promise<string> {\n const result = await this.api.ops[\"role.focus\"](this.roleId);\n const focusedGoalId = this.ctx.focusedGoalId;\n return this.fmt(\"activate\", this.roleId, result, {\n fold: (node) =>\n (node.name === \"goal\" && node.id !== focusedGoalId) || node.name === \"requirement\",\n });\n }\n\n /** Render an OpResult into a 3-layer output string. */\n private fmt(\n process: string,\n name: string,\n result: OpResult,\n extra?: { fold?: (node: import(\"@rolexjs/system\").State) => boolean }\n ): string {\n return render({\n process,\n name,\n state: result.state,\n cognitiveHint: this.ctx.cognitiveHint(process) ?? null,\n fold: extra?.fold,\n });\n }\n\n private async save(): Promise<void> {\n await this.api.saveCtx(this.ctx);\n }\n\n // ---- Execution ----\n\n /** Focus: view or switch focused goal. */\n async focus(goal?: string): Promise<string> {\n const goalId = goal ?? this.ctx.requireGoalId();\n const switched = goalId !== this.ctx.focusedGoalId;\n this.ctx.focusedGoalId = goalId;\n if (switched) this.ctx.focusedPlanId = null;\n const result = await this.api.ops[\"role.focus\"](goalId);\n await this.save();\n return this.fmt(\"focus\", goalId, result);\n }\n\n /** Want: declare a goal. */\n async want(goal?: string, id?: string, alias?: readonly string[]): Promise<string> {\n const result = await this.api.ops[\"role.want\"](this.roleId, goal, id, alias);\n if (id) this.ctx.focusedGoalId = id;\n this.ctx.focusedPlanId = null;\n await this.save();\n return this.fmt(\"want\", id ?? this.roleId, result);\n }\n\n /** Plan: create a plan for the focused goal. */\n async plan(plan?: string, id?: string, after?: string, fallback?: string): Promise<string> {\n const result = await this.api.ops[\"role.plan\"](\n this.ctx.requireGoalId(),\n plan,\n id,\n after,\n fallback\n );\n if (id) this.ctx.focusedPlanId = id;\n await this.save();\n return this.fmt(\"plan\", id ?? \"plan\", result);\n }\n\n /** Todo: add a task to the focused plan. */\n async todo(task?: string, id?: string, alias?: readonly string[]): Promise<string> {\n const result = await this.api.ops[\"role.todo\"](this.ctx.requirePlanId(), task, id, alias);\n return this.fmt(\"todo\", id ?? \"task\", result);\n }\n\n /** Finish: complete a task, optionally record an encounter. */\n async finish(task: string, encounter?: string): Promise<string> {\n const result = await this.api.ops[\"role.finish\"](task, this.roleId, encounter);\n if (encounter && result.state.id) {\n this.ctx.addEncounter(result.state.id);\n }\n return this.fmt(\"finish\", task, result);\n }\n\n /** Complete: close a plan as done, record encounter. */\n async complete(plan?: string, encounter?: string): Promise<string> {\n const planId = plan ?? this.ctx.requirePlanId();\n const result = await this.api.ops[\"role.complete\"](planId, this.roleId, encounter);\n this.ctx.addEncounter(result.state.id ?? planId);\n if (this.ctx.focusedPlanId === planId) this.ctx.focusedPlanId = null;\n await this.save();\n return this.fmt(\"complete\", planId, result);\n }\n\n /** Abandon: drop a plan, record encounter. */\n async abandon(plan?: string, encounter?: string): Promise<string> {\n const planId = plan ?? this.ctx.requirePlanId();\n const result = await this.api.ops[\"role.abandon\"](planId, this.roleId, encounter);\n this.ctx.addEncounter(result.state.id ?? planId);\n if (this.ctx.focusedPlanId === planId) this.ctx.focusedPlanId = null;\n await this.save();\n return this.fmt(\"abandon\", planId, result);\n }\n\n // ---- Cognition ----\n\n /** Reflect: consume encounters → experience. Empty encounters = direct creation. */\n async reflect(encounters: string[], experience?: string, id?: string): Promise<string> {\n if (encounters.length > 0) {\n this.ctx.requireEncounterIds(encounters);\n }\n // First encounter goes through ops (creates experience + removes encounter)\n const first = encounters[0] as string | undefined;\n const result = await this.api.ops[\"role.reflect\"](first, this.roleId, experience, id);\n // Remaining encounters are consumed via forget\n for (let i = 1; i < encounters.length; i++) {\n await this.api.ops[\"role.forget\"](encounters[i]);\n }\n if (encounters.length > 0) {\n this.ctx.consumeEncounters(encounters);\n }\n if (id) this.ctx.addExperience(id);\n return this.fmt(\"reflect\", id ?? \"experience\", result);\n }\n\n /** Realize: consume experiences → principle. Empty experiences = direct creation. */\n async realize(experiences: string[], principle?: string, id?: string): Promise<string> {\n if (experiences.length > 0) {\n this.ctx.requireExperienceIds(experiences);\n }\n // First experience goes through ops (creates principle + removes experience)\n const first = experiences[0] as string | undefined;\n const result = await this.api.ops[\"role.realize\"](first, this.roleId, principle, id);\n // Remaining experiences are consumed via forget\n for (let i = 1; i < experiences.length; i++) {\n await this.api.ops[\"role.forget\"](experiences[i]);\n }\n if (experiences.length > 0) {\n this.ctx.consumeExperiences(experiences);\n }\n return this.fmt(\"realize\", id ?? \"principle\", result);\n }\n\n /** Master: create procedure, optionally consuming experiences. */\n async master(procedure: string, id?: string, experiences?: string[]): Promise<string> {\n if (experiences && experiences.length > 0) {\n this.ctx.requireExperienceIds(experiences);\n }\n // First experience goes through ops (creates procedure + removes experience)\n const first = experiences?.[0];\n const result = await this.api.ops[\"role.master\"](this.roleId, procedure, id, first);\n // Remaining experiences are consumed via forget\n if (experiences) {\n for (let i = 1; i < experiences.length; i++) {\n await this.api.ops[\"role.forget\"](experiences[i]);\n }\n this.ctx.consumeExperiences(experiences);\n }\n return this.fmt(\"master\", id ?? \"procedure\", result);\n }\n\n // ---- Knowledge management ----\n\n /** Forget: remove any node under the individual by id. */\n async forget(nodeId: string): Promise<string> {\n const result = await this.api.ops[\"role.forget\"](nodeId);\n if (this.ctx.focusedGoalId === nodeId) this.ctx.focusedGoalId = null;\n if (this.ctx.focusedPlanId === nodeId) this.ctx.focusedPlanId = null;\n await this.save();\n return this.fmt(\"forget\", nodeId, result);\n }\n\n // ---- Skills + unified entry ----\n\n /** Skill: load full skill content by locator. */\n async skill(locator: string): Promise<string> {\n return await this.api.ops[\"role.skill\"](locator);\n }\n\n /** Use: subjective execution — `!ns.method` or ResourceX locator. */\n use<T = unknown>(locator: string, args?: Record<string, unknown>): Promise<T> {\n return this.api.direct<T>(locator, args);\n }\n}\n","/**\n * Rolex — thin API shell.\n *\n * Public API:\n * genesis() — create the world on first run\n * activate(id) — returns a stateful Role handle\n * direct(loc, args) — direct the world to execute an instruction\n *\n * All operation implementations live in @rolexjs/prototype (createOps).\n * Rolex just wires Platform → ops and manages Role lifecycle.\n */\n\nimport type { Platform, RoleXRepository } from \"@rolexjs/core\";\nimport * as C from \"@rolexjs/core\";\nimport { createOps, directives, type Ops, toArgs } from \"@rolexjs/prototype\";\nimport type { Initializer, Runtime, Structure } from \"@rolexjs/system\";\nimport type { ResourceX } from \"resourcexjs\";\nimport { createResourceX, setProvider } from \"resourcexjs\";\nimport { RoleContext } from \"./context.js\";\nimport { findInState } from \"./find.js\";\nimport { Role, type RolexInternal } from \"./role.js\";\n\n/** Summary entry returned by census.list. */\nexport interface CensusEntry {\n id?: string;\n name: string;\n tag?: string;\n}\n\nexport class Rolex {\n private rt: Runtime;\n private ops!: Ops;\n private resourcex?: ResourceX;\n private repo: RoleXRepository;\n private readonly initializer?: Initializer;\n\n private readonly bootstrap: readonly string[];\n private society!: Structure;\n private past!: Structure;\n\n private constructor(platform: Platform) {\n this.repo = platform.repository;\n this.rt = this.repo.runtime;\n this.initializer = platform.initializer;\n this.bootstrap = platform.bootstrap ?? [];\n\n // Create ResourceX from injected provider\n if (platform.resourcexProvider) {\n setProvider(platform.resourcexProvider);\n this.resourcex = createResourceX();\n }\n }\n\n /** Create a Rolex instance from a Platform (async due to Runtime initialization). */\n static async create(platform: Platform): Promise<Rolex> {\n const rolex = new Rolex(platform);\n await rolex.init();\n return rolex;\n }\n\n /** Async initialization — called by Rolex.create(). */\n private async init(): Promise<void> {\n // Ensure world roots exist\n const roots = await this.rt.roots();\n this.society =\n roots.find((r) => r.name === \"society\") ?? (await this.rt.create(null, C.society));\n\n const societyState = await this.rt.project(this.society);\n const existingPast = societyState.children?.find((c) => c.name === \"past\");\n this.past = existingPast ?? (await this.rt.create(this.society, C.past));\n\n // Create ops from prototype — all operation implementations\n this.ops = createOps({\n rt: this.rt,\n society: this.society,\n past: this.past,\n resolve: async (id: string) => {\n const node = await this.find(id);\n if (!node) throw new Error(`\"${id}\" not found.`);\n return node;\n },\n find: (id: string) => this.find(id),\n resourcex: this.resourcex,\n prototype: this.repo.prototype,\n direct: (locator: string, args?: Record<string, unknown>) => this.direct(locator, args),\n });\n }\n\n /** Genesis — create the world on first run. Settles built-in prototypes. */\n async genesis(): Promise<void> {\n await this.initializer?.bootstrap();\n // Settle bootstrap prototypes\n for (const source of this.bootstrap) {\n await this.direct(\"!prototype.settle\", { source });\n }\n }\n\n /**\n * Activate a role — returns a stateful Role handle.\n *\n * If the individual does not exist in runtime but a prototype is registered,\n * auto-born the individual first.\n */\n async activate(individual: string): Promise<Role> {\n let node = await this.find(individual);\n if (!node) {\n const hasProto = Object.hasOwn(this.repo.prototype.list(), individual);\n if (hasProto) {\n await this.ops[\"individual.born\"](undefined, individual);\n node = (await this.find(individual))!;\n } else {\n throw new Error(`\"${individual}\" not found.`);\n }\n }\n const state = await this.rt.project(node);\n const ctx = new RoleContext(individual);\n ctx.rehydrate(state);\n\n // Restore persisted focus (only override rehydrate default when persisted value is valid)\n const persisted = await this.repo.loadContext(individual);\n if (persisted) {\n if (persisted.focusedGoalId && (await this.find(persisted.focusedGoalId))) {\n ctx.focusedGoalId = persisted.focusedGoalId;\n }\n if (persisted.focusedPlanId && (await this.find(persisted.focusedPlanId))) {\n ctx.focusedPlanId = persisted.focusedPlanId;\n }\n }\n\n // Build internal API for Role — ops + ctx persistence\n const ops = this.ops;\n const repo = this.repo;\n const saveCtx = async (c: RoleContext) => {\n await repo.saveContext(c.roleId, {\n focusedGoalId: c.focusedGoalId,\n focusedPlanId: c.focusedPlanId,\n });\n };\n\n const api: RolexInternal = {\n ops,\n saveCtx,\n direct: this.direct.bind(this),\n };\n\n return new Role(individual, ctx, api);\n }\n\n /** Find a node by id or alias across the entire society tree. Internal use only. */\n private async find(id: string): Promise<Structure | null> {\n const state = await this.rt.project(this.society);\n return findInState(state, id);\n }\n\n /**\n * Direct the world to execute an instruction.\n *\n * - `!namespace.method` — dispatch to ops\n * - anything else — delegate to ResourceX `ingest`\n */\n async direct<T = unknown>(locator: string, args?: Record<string, unknown>): Promise<T> {\n if (locator.startsWith(\"!\")) {\n const command = locator.slice(1);\n const fn = this.ops[command];\n if (!fn) {\n const hint = directives[\"identity-ethics\"]?.[\"on-unknown-command\"] ?? \"\";\n throw new Error(\n `Unknown command \"${locator}\".\\n\\n` +\n \"You may be guessing the command name. \" +\n \"Load the relevant skill first with skill(locator) to learn the correct syntax.\\n\\n\" +\n hint\n );\n }\n return (await fn(...toArgs(command, args ?? {}))) as T;\n }\n if (!this.resourcex) throw new Error(\"ResourceX is not available.\");\n return this.resourcex.ingest<T>(locator, args);\n }\n}\n\n/** Create a Rolex instance from a Platform. */\nexport async function createRoleX(platform: Platform): Promise<Rolex> {\n return Rolex.create(platform);\n}\n"],"mappings":";AAaA,cAAc;;;ACAP,IAAM,cAAN,MAAkB;AAAA,EACvB;AAAA,EACA,gBAA+B;AAAA,EAC/B,gBAA+B;AAAA,EAEtB,eAAe,oBAAI,IAAY;AAAA,EAC/B,gBAAgB,oBAAI,IAAY;AAAA,EAEzC,YAAY,QAAgB;AAC1B,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAwB;AACtB,QAAI,CAAC,KAAK,cAAe,OAAM,IAAI,MAAM,mCAAmC;AAC5E,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,gBAAwB;AACtB,QAAI,CAAC,KAAK,cAAe,OAAM,IAAI,MAAM,mCAAmC;AAC5E,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAMA,aAAa,IAAY;AACvB,SAAK,aAAa,IAAI,EAAE;AAAA,EAC1B;AAAA,EAEA,oBAAoB,KAAe;AACjC,eAAW,MAAM,KAAK;AACpB,UAAI,CAAC,KAAK,aAAa,IAAI,EAAE,EAAG,OAAM,IAAI,MAAM,yBAAyB,EAAE,GAAG;AAAA,IAChF;AAAA,EACF;AAAA,EAEA,kBAAkB,KAAe;AAC/B,eAAW,MAAM,KAAK;AACpB,WAAK,aAAa,OAAO,EAAE;AAAA,IAC7B;AAAA,EACF;AAAA,EAEA,cAAc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AAG,OAAO,SAAS,QAAQ,CAAC,CAAC,CAAC;AAAA,IACjD;AACA,QAAI,CAAC,KAAK,UAAW,OAAM,IAAI,MAAM,6BAA6B;AAClE,WAAO,KAAK,UAAU,OAAU,SAAS,IAAI;AAAA,EAC/C;AACF;AAGA,eAAsB,YAAY,UAAoC;AACpE,SAAO,MAAM,OAAO,QAAQ;AAC9B;","names":["c","directives","hint","directives"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/context.ts","../src/feature.ts","../src/find.ts","../src/render.ts","../src/role.ts","../src/rolex.ts"],"sourcesContent":["/**\n * rolexjs — RoleX API + Render layer.\n *\n * Usage:\n * import { Rolex, Role, describe, hint } from \"rolexjs\";\n *\n * const rolex = await createRoleX(platform);\n * await rolex.genesis();\n * const role = await rolex.activate(\"sean\");\n * await role.want(\"Feature: Ship v1\", \"ship-v1\");\n */\n\n// Re-export core (structures + processes)\nexport * from \"@rolexjs/core\";\n// Context\nexport { RoleContext } from \"./context.js\";\n// Feature (Gherkin type + parse/serialize)\nexport type { DataTableRow, Feature, Scenario, Step } from \"./feature.js\";\nexport { parse, serialize } from \"./feature.js\";\n// Find\nexport { findInState } from \"./find.js\";\nexport type { RenderOptions, RenderStateOptions } from \"./render.js\";\n// Render\nexport { describe, detail, directive, hint, render, renderState, world } from \"./render.js\";\n// Role\nexport { Role } from \"./role.js\";\n// API\nexport type { CensusEntry } from \"./rolex.js\";\nexport { createRoleX, Rolex } from \"./rolex.js\";\n","/**\n * RoleContext — stateful session context for role operations.\n *\n * Tracks execution state from the individual's perspective:\n * - roleId (who I am)\n * - focusedGoalId / focusedPlanId (what I'm working on)\n * - encounter / experience id sets (what I have for cognition)\n *\n * Created by activate, updated by subsequent role operations.\n * Consumers (MCP, CLI) hold a reference and pass it through.\n */\nimport type { State } from \"@rolexjs/system\";\n\nexport class RoleContext {\n roleId: string;\n focusedGoalId: string | null = null;\n focusedPlanId: string | null = null;\n\n readonly encounterIds = new Set<string>();\n readonly experienceIds = new Set<string>();\n\n constructor(roleId: string) {\n this.roleId = roleId;\n }\n\n // ================================================================\n // Requirements — throw if missing\n // ================================================================\n\n requireGoalId(): string {\n if (!this.focusedGoalId) throw new Error(\"No focused goal. Call want first.\");\n return this.focusedGoalId;\n }\n\n requirePlanId(): string {\n if (!this.focusedPlanId) throw new Error(\"No focused plan. Call plan first.\");\n return this.focusedPlanId;\n }\n\n // ================================================================\n // Cognition registries\n // ================================================================\n\n addEncounter(id: string) {\n this.encounterIds.add(id);\n }\n\n requireEncounterIds(ids: string[]) {\n for (const id of ids) {\n if (!this.encounterIds.has(id)) throw new Error(`Encounter not found: \"${id}\"`);\n }\n }\n\n consumeEncounters(ids: string[]) {\n for (const id of ids) {\n this.encounterIds.delete(id);\n }\n }\n\n addExperience(id: string) {\n this.experienceIds.add(id);\n }\n\n requireExperienceIds(ids: string[]) {\n for (const id of ids) {\n if (!this.experienceIds.has(id)) throw new Error(`Experience not found: \"${id}\"`);\n }\n }\n\n consumeExperiences(ids: string[]) {\n for (const id of ids) {\n this.experienceIds.delete(id);\n }\n }\n\n // ================================================================\n // Rehydration — rebuild from activation state\n // ================================================================\n\n /** Walk the state tree and populate registries. */\n rehydrate(state: State) {\n this.walk(state);\n }\n\n private walk(node: State) {\n if (node.id) {\n switch (node.name) {\n case \"goal\":\n if (!this.focusedGoalId) this.focusedGoalId = node.id;\n break;\n case \"encounter\":\n this.encounterIds.add(node.id);\n break;\n case \"experience\":\n this.experienceIds.add(node.id);\n break;\n }\n }\n for (const child of (node as State & { children?: readonly State[] }).children ?? []) {\n this.walk(child);\n }\n }\n\n // ================================================================\n // Cognitive hints — state-aware AI self-direction cues\n // ================================================================\n\n /** First-person, state-aware hint for the AI after an operation. */\n cognitiveHint(process: string): string | null {\n switch (process) {\n case \"activate\":\n if (!this.focusedGoalId)\n return \"I have no goal yet. I should call `want` to declare one, or `focus` to review existing goals.\";\n return \"I have an active goal. I should call `focus` to review progress, or `want` to declare a new goal.\";\n\n case \"focus\":\n if (!this.focusedPlanId)\n return \"I have a goal but no focused plan. I should call `plan` to create or focus on one.\";\n return \"I have a plan. I should call `todo` to create tasks, or continue working.\";\n\n case \"want\":\n return \"Goal declared. I should call `plan` to design how to achieve it.\";\n\n case \"plan\":\n return \"Plan created. I should call `todo` to create concrete tasks.\";\n\n case \"todo\":\n return \"Task created. I can add more with `todo`, or start working and call `finish` when done.\";\n\n case \"finish\": {\n const encCount = this.encounterIds.size;\n if (encCount > 0 && !this.focusedGoalId)\n return `Task finished. No more goals — I have ${encCount} encounter(s) to choose from for \\`reflect\\`, or \\`want\\` a new goal.`;\n return \"Task finished. I should continue with remaining tasks, or call `complete` when the plan is done.\";\n }\n\n case \"complete\":\n case \"abandon\": {\n const encCount = this.encounterIds.size;\n const goalNote = this.focusedGoalId\n ? ` I should check if goal \"${this.focusedGoalId}\" needs a new \\`plan\\`, or \\`forget\\` it if the direction is fulfilled.`\n : \"\";\n if (encCount > 0)\n return `Plan closed.${goalNote} I have ${encCount} encounter(s) to choose from for \\`reflect\\`, or I can continue with other plans.`;\n return `Plan closed.${goalNote} I can create a new \\`plan\\`, or \\`focus\\` on another goal.`;\n }\n\n case \"reflect\": {\n const expCount = this.experienceIds.size;\n if (expCount > 0)\n return `Experience gained. I can \\`realize\\` principles or \\`master\\` procedures — ${expCount} experience(s) available.`;\n return \"Experience gained. I can `realize` a principle, `master` a procedure, or continue working.\";\n }\n\n case \"realize\":\n return \"Principle added. I should continue working.\";\n\n case \"master\":\n return \"Procedure added. I should continue working.\";\n\n default:\n return null;\n }\n }\n}\n","/**\n * Feature — the information format for the RoleX concept world.\n *\n * Every node's information is a Gherkin Feature.\n * This is our own type — decoupled from @cucumber/messages.\n */\n\nexport interface Feature {\n readonly name: string;\n readonly description?: string;\n readonly tags?: readonly string[];\n readonly scenarios: readonly Scenario[];\n}\n\nexport interface Scenario {\n readonly name: string;\n readonly description?: string;\n readonly tags?: readonly string[];\n readonly steps: readonly Step[];\n}\n\nexport interface Step {\n readonly keyword: string;\n readonly text: string;\n readonly dataTable?: readonly DataTableRow[];\n}\n\nexport interface DataTableRow {\n readonly cells: readonly string[];\n}\n\n// ================================================================\n// Parse + Serialize\n// ================================================================\n\nimport { parse as parseGherkin } from \"@rolexjs/parser\";\n\n/** Parse a Gherkin source string into a Feature. */\nexport function parse(source: string): Feature {\n const doc = parseGherkin(source);\n const f = doc.feature;\n if (!f) throw new Error(\"No Feature found in source\");\n\n return {\n name: f.name,\n ...(f.description?.trim() ? { description: f.description.trim() } : {}),\n ...(f.tags?.length ? { tags: f.tags.map((t) => t.name) } : {}),\n scenarios: (f.children ?? [])\n .filter((c) => c.scenario)\n .map((c) => {\n const s = c.scenario!;\n return {\n name: s.name,\n ...(s.description?.trim() ? { description: s.description.trim() } : {}),\n ...(s.tags?.length ? { tags: s.tags.map((t) => t.name) } : {}),\n steps: (s.steps ?? []).map((st) => ({\n keyword: st.keyword,\n text: st.text,\n ...(st.dataTable\n ? {\n dataTable: st.dataTable.rows.map((r) => ({\n cells: r.cells.map((c) => c.value),\n })),\n }\n : {}),\n })),\n };\n }),\n };\n}\n\n/** Serialize a Feature back to Gherkin source string. */\nexport function serialize(feature: Feature): string {\n const lines: string[] = [];\n\n if (feature.tags?.length) {\n lines.push(feature.tags.join(\" \"));\n }\n lines.push(`Feature: ${feature.name}`);\n if (feature.description) {\n for (const line of feature.description.split(\"\\n\")) {\n lines.push(` ${line}`);\n }\n }\n\n for (const scenario of feature.scenarios) {\n lines.push(\"\");\n if (scenario.tags?.length) {\n lines.push(` ${scenario.tags.join(\" \")}`);\n }\n lines.push(` Scenario: ${scenario.name}`);\n if (scenario.description) {\n for (const line of scenario.description.split(\"\\n\")) {\n lines.push(` ${line}`);\n }\n }\n for (const step of scenario.steps) {\n lines.push(` ${step.keyword}${step.text}`);\n if (step.dataTable) {\n for (const row of step.dataTable) {\n lines.push(` | ${row.cells.join(\" | \")} |`);\n }\n }\n }\n }\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n","/**\n * Find — unified node lookup with priority-based disambiguation.\n *\n * When multiple nodes share the same id (allowed after relaxing\n * global uniqueness), prefer \"addressable\" nodes over internal metadata.\n *\n * Priority (lower = preferred):\n * 0: individual, organization, position — top-level entities\n * 1: goal — execution roots\n * 2: plan, task — execution nodes\n * 3: procedure, principle — individual knowledge\n * 4: encounter, experience — cognition artifacts\n * 5: identity, charter — structural definitions\n * 6: duty, requirement, background, etc. — internal metadata\n */\nimport type { State, Structure } from \"@rolexjs/system\";\n\nconst PRIORITY: Record<string, number> = {\n individual: 0,\n organization: 0,\n position: 0,\n goal: 1,\n plan: 2,\n task: 2,\n procedure: 3,\n principle: 3,\n encounter: 4,\n experience: 4,\n identity: 5,\n charter: 5,\n duty: 6,\n requirement: 6,\n background: 6,\n tone: 6,\n mindset: 6,\n};\n\nfunction priorityOf(name: string): number {\n return PRIORITY[name] ?? 7;\n}\n\nfunction matches(node: State, target: string): boolean {\n if (node.id?.toLowerCase() === target) return true;\n if (node.alias) {\n for (const a of node.alias) {\n if (a.toLowerCase() === target) return true;\n }\n }\n return false;\n}\n\n/**\n * Find a node by id or alias in a state tree.\n *\n * When multiple nodes match, returns the one with the highest priority\n * (top-level entities > execution nodes > knowledge > metadata).\n */\nexport function findInState(state: State, target: string): Structure | null {\n const lowered = target.toLowerCase();\n let best: Structure | null = null;\n let bestPriority = Infinity;\n\n function walk(node: State): void {\n if (matches(node, lowered)) {\n const p = priorityOf(node.name);\n if (p < bestPriority) {\n best = node;\n bestPriority = p;\n if (p === 0) return; // Can't do better\n }\n }\n for (const child of node.children ?? []) {\n walk(child);\n if (bestPriority === 0) return; // Early exit\n }\n }\n\n walk(state);\n return best;\n}\n","/**\n * Render — 3-layer output for all Rolex operations.\n *\n * Layer 1: Status — what just happened (describe)\n * Layer 2: Hint — what to do next (hint + cognitive hint)\n * Layer 3: Projection — full state tree as markdown (renderState)\n *\n * render() composes the 3 layers. MCP and CLI are pure pass-through.\n */\nimport type { State } from \"@rolexjs/system\";\n\n// ================================================================\n// Description — what happened\n// ================================================================\n\nconst descriptions: Record<string, (name: string, state: State) => string> = {\n // Lifecycle\n born: (n) => `Individual \"${n}\" is born.`,\n found: (n) => `Organization \"${n}\" is founded.`,\n establish: (n) => `Position \"${n}\" is established.`,\n charter: (n) => `Charter defined for \"${n}\".`,\n charge: (n) => `Duty \"${n}\" assigned.`,\n retire: (n) => `\"${n}\" retired.`,\n die: (n) => `\"${n}\" is gone.`,\n dissolve: (n) => `Organization \"${n}\" dissolved.`,\n abolish: (n) => `Position \"${n}\" abolished.`,\n rehire: (n) => `\"${n}\" is back.`,\n\n // Organization\n hire: (n) => `\"${n}\" hired.`,\n fire: (n) => `\"${n}\" fired.`,\n appoint: (n) => `\"${n}\" appointed.`,\n dismiss: (n) => `\"${n}\" dismissed.`,\n\n // Role\n activate: (n) => `Role \"${n}\" activated.`,\n focus: (n) => `Focused on goal \"${n}\".`,\n\n // Execution\n want: (n) => `Goal \"${n}\" declared.`,\n plan: (n) => `Plan created for \"${n}\".`,\n todo: (n) => `Task \"${n}\" added.`,\n finish: (n) => `Task \"${n}\" finished → encounter recorded.`,\n complete: (n) => `Plan \"${n}\" completed → encounter recorded.`,\n abandon: (n) => `Plan \"${n}\" abandoned → encounter recorded.`,\n\n // Cognition\n reflect: (n) => `Reflected on \"${n}\" → experience gained.`,\n realize: (n) => `Realized principle from \"${n}\".`,\n master: (n) => `Mastered procedure from \"${n}\".`,\n\n // Knowledge management\n forget: (n) => `\"${n}\" forgotten.`,\n};\n\nexport function describe(process: string, name: string, state: State): string {\n const fn = descriptions[process];\n return fn ? fn(name, state) : `${process} completed.`;\n}\n\n// ================================================================\n// Hint — what to do next\n// ================================================================\n\nconst hints: Record<string, string> = {\n // Lifecycle\n born: \"hire into an organization, or activate to start working.\",\n found: \"define a charter for the organization.\",\n establish: \"charge with duties, then appoint members.\",\n charter: \"establish positions for the organization.\",\n charge: \"appoint someone to this position.\",\n retire: \"rehire if needed later.\",\n die: \"this individual is permanently gone.\",\n dissolve: \"the organization no longer exists.\",\n abolish: \"the position no longer exists.\",\n rehire: \"activate to resume working.\",\n\n // Organization\n hire: \"appoint to a position, or activate to start working.\",\n fire: \"the individual is no longer a member.\",\n appoint: \"the individual now holds this position.\",\n dismiss: \"the position is now vacant.\",\n\n // Role\n activate: \"want a goal, or check the current state.\",\n focus: \"plan how to work toward it, or add tasks.\",\n\n // Execution\n want: \"plan how to work toward it.\",\n plan: \"add tasks with todo.\",\n todo: \"start working, finish when done.\",\n finish: \"continue with remaining tasks, or complete the plan.\",\n complete: \"reflect on encounters to gain experience.\",\n abandon: \"reflect on encounters to learn from the experience.\",\n\n // Cognition\n reflect: \"realize principles or master procedures from experience.\",\n realize: \"principle added.\",\n master: \"procedure added.\",\n\n // Knowledge management\n forget: \"the node has been removed.\",\n};\n\nexport function hint(process: string): string {\n const h = hints[process];\n return h ? `Next: ${h}` : \"What would you like to do next?\";\n}\n\n// ================================================================\n// Detail — longer process descriptions (from .feature files)\n// ================================================================\n\nimport { directives, processes, world } from \"@rolexjs/prototype\";\n\n/** Full Gherkin feature content for a process — sourced from .feature files. */\nexport function detail(process: string): string {\n return processes[process] ?? \"\";\n}\n\n/** World feature descriptions — framework-level instructions. */\nexport { world };\n\n// ================================================================\n// Directive — system-level commands at decision points\n// ================================================================\n\n/** Get a directive by topic and scenario. Returns empty string if not found. */\nexport function directive(topic: string, scenario: string): string {\n return directives[topic]?.[scenario] ?? \"\";\n}\n\n// ================================================================\n// Generic State renderer — renders any State tree as markdown\n// ================================================================\n\n/**\n * renderState — markdown renderer for State trees.\n *\n * Rules:\n * - Heading: \"#\" repeated to depth + \" [name]\"\n * - Body: raw information field as-is (full Gherkin preserved)\n * - Links: \"> → relation [target.name]\" with target feature name\n * - Children: sorted by concept hierarchy, then rendered at depth+1\n * - Fold: when fold(node) returns true, render heading only (no body/links/children)\n *\n * Markdown heading depth caps at 6 (######).\n */\nexport interface RenderStateOptions {\n /** When returns true, render only the heading — skip body, links, and children. */\n fold?: (node: State) => boolean;\n}\n\nexport function renderState(state: State, depth = 1, options?: RenderStateOptions): string {\n const lines: string[] = [];\n const level = Math.min(depth, 6);\n const heading = \"#\".repeat(level);\n\n // Heading: [name] (id) {origin} #tag [progress]\n const idPart = state.id ? ` (${state.id})` : \"\";\n const originPart = state.origin ? ` {${state.origin}}` : \"\";\n const tagPart = state.tag ? ` #${state.tag}` : \"\";\n const progressPart = state.name === \"goal\" ? goalProgress(state) : \"\";\n lines.push(`${heading} [${state.name}]${idPart}${originPart}${tagPart}${progressPart}`);\n\n // Folded: heading only\n if (options?.fold?.(state)) {\n return lines.join(\"\\n\");\n }\n\n // Body: full information as-is\n if (state.information) {\n lines.push(\"\");\n lines.push(state.information);\n }\n\n // Links — plan references are compact, organizational links are expanded\n if (state.links && state.links.length > 0) {\n const compactRelations = new Set([\"after\", \"before\", \"fallback\", \"fallback-for\"]);\n const compact = state.links.filter((l) => compactRelations.has(l.relation));\n const expanded = state.links.filter((l) => !compactRelations.has(l.relation));\n for (const link of compact) {\n const targetId = link.target.id ? ` (${link.target.id})` : \"\";\n const targetTag = link.target.tag ? ` #${link.target.tag}` : \"\";\n lines.push(`> ${link.relation}: [${link.target.name}]${targetId}${targetTag}`);\n }\n if (expanded.length > 0) {\n const targets = sortByConceptOrder(expanded.map((l) => l.target));\n for (const target of targets) {\n lines.push(\"\");\n lines.push(renderState(target, depth + 1, options));\n }\n }\n }\n\n // Children — sorted by concept hierarchy, empty nodes filtered out\n if (state.children && state.children.length > 0) {\n const sorted = sortByConceptOrder(state.children.filter((c) => !isEmpty(c)));\n for (const child of sorted) {\n lines.push(\"\");\n lines.push(renderState(child, depth + 1, options));\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n// ================================================================\n// Concept ordering — children sorted by structure hierarchy\n// ================================================================\n\n/** Concept tree order: identity → cognition → knowledge → execution → organization. */\nconst CONCEPT_ORDER: readonly string[] = [\n // Individual — Identity\n \"identity\",\n \"background\",\n \"tone\",\n \"mindset\",\n // Individual — Cognition\n \"encounter\",\n \"experience\",\n // Individual — Knowledge\n \"principle\",\n \"procedure\",\n // Individual — Execution\n \"goal\",\n \"plan\",\n \"task\",\n // Organization\n \"charter\",\n // Position\n \"position\",\n \"duty\",\n];\n\n/** Summarize plan/task completion for a goal heading. */\nfunction goalProgress(goal: State): string {\n let plans = 0;\n let plansDone = 0;\n let tasks = 0;\n let tasksDone = 0;\n\n function walk(node: State): void {\n if (node.name === \"plan\") {\n plans++;\n if (node.tag === \"done\" || node.tag === \"abandoned\") plansDone++;\n } else if (node.name === \"task\") {\n tasks++;\n if (node.tag === \"done\") tasksDone++;\n }\n for (const child of node.children ?? []) walk(child);\n }\n\n for (const child of goal.children ?? []) walk(child);\n if (plans === 0 && tasks === 0) return \"\";\n const parts: string[] = [];\n if (plans > 0) parts.push(`${plansDone}/${plans} plans`);\n if (tasks > 0) parts.push(`${tasksDone}/${tasks} tasks`);\n return ` [${parts.join(\", \")}]`;\n}\n\n/** A node is empty when it has no id, no information, and no children. */\nfunction isEmpty(node: State): boolean {\n return !node.id && !node.information && (!node.children || node.children.length === 0);\n}\n\n/** Sort children by concept hierarchy order. Unknown names go to the end, preserving relative order. */\nfunction sortByConceptOrder(children: readonly State[]): readonly State[] {\n return [...children].sort((a, b) => {\n const ai = CONCEPT_ORDER.indexOf(a.name);\n const bi = CONCEPT_ORDER.indexOf(b.name);\n const aOrder = ai >= 0 ? ai : CONCEPT_ORDER.length;\n const bOrder = bi >= 0 ? bi : CONCEPT_ORDER.length;\n return aOrder - bOrder;\n });\n}\n\n// ================================================================\n// Render — 3-layer output for tool results\n// ================================================================\n\nexport interface RenderOptions {\n /** The process that was executed. */\n process: string;\n /** Display name for the primary node. */\n name: string;\n /** State projection of the affected node. */\n state: State;\n /** AI cognitive hint — first-person, state-aware self-direction cue. */\n cognitiveHint?: string | null;\n /** Fold predicate — folded nodes render heading only. */\n fold?: RenderStateOptions[\"fold\"];\n}\n\n/** Render a full 3-layer output string. */\nexport function render(opts: RenderOptions): string {\n const { process, name, state, cognitiveHint, fold } = opts;\n const lines: string[] = [];\n\n // Layer 1: Status\n lines.push(describe(process, name, state));\n\n // Layer 2: Hint (static) + Cognitive hint (state-aware)\n lines.push(hint(process));\n if (cognitiveHint) {\n lines.push(`I → ${cognitiveHint}`);\n }\n\n // Layer 3: Projection — generic markdown rendering of the full state tree\n lines.push(\"\");\n lines.push(renderState(state, 1, fold ? { fold } : undefined));\n\n return lines.join(\"\\n\");\n}\n","/**\n * Role — stateful handle returned by Rolex.activate().\n *\n * Holds roleId + RoleContext internally.\n * All operations return rendered 3-layer text (status + hint + projection).\n * MCP and CLI are pure pass-through — no render logic needed.\n *\n * Usage:\n * const role = await rolex.activate(\"sean\");\n * await role.want(\"Feature: Ship v1\", \"ship-v1\"); // → rendered string\n * await role.plan(\"Feature: Phase 1\", \"phase-1\"); // → rendered string\n * await role.finish(\"write-tests\", \"Feature: Tests written\");\n */\n\nimport type { OpResult, Ops } from \"@rolexjs/prototype\";\nimport type { RoleContext } from \"./context.js\";\nimport { render } from \"./render.js\";\n\n/**\n * Internal API surface that Role delegates to.\n * Constructed by Rolex.activate() — not part of public API.\n */\nexport interface RolexInternal {\n ops: Ops;\n saveCtx(ctx: RoleContext): void | Promise<void>;\n direct<T>(locator: string, args?: Record<string, unknown>): Promise<T>;\n}\n\nexport class Role {\n readonly roleId: string;\n readonly ctx: RoleContext;\n private api: RolexInternal;\n\n constructor(roleId: string, ctx: RoleContext, api: RolexInternal) {\n this.roleId = roleId;\n this.ctx = ctx;\n this.api = api;\n }\n\n /** Project the individual's full state tree (used after activate). */\n async project(): Promise<string> {\n const result = await this.api.ops[\"role.focus\"](this.roleId);\n const focusedGoalId = this.ctx.focusedGoalId;\n return this.fmt(\"activate\", this.roleId, result, {\n fold: (node) =>\n (node.name === \"goal\" && node.id !== focusedGoalId) || node.name === \"requirement\",\n });\n }\n\n /** Render an OpResult into a 3-layer output string. */\n private fmt(\n process: string,\n name: string,\n result: OpResult,\n extra?: { fold?: (node: import(\"@rolexjs/system\").State) => boolean }\n ): string {\n return render({\n process,\n name,\n state: result.state,\n cognitiveHint: this.ctx.cognitiveHint(process) ?? null,\n fold: extra?.fold,\n });\n }\n\n private async save(): Promise<void> {\n await this.api.saveCtx(this.ctx);\n }\n\n // ---- Execution ----\n\n /** Focus: view or switch focused goal. */\n async focus(goal?: string): Promise<string> {\n const goalId = goal ?? this.ctx.requireGoalId();\n const switched = goalId !== this.ctx.focusedGoalId;\n this.ctx.focusedGoalId = goalId;\n if (switched) this.ctx.focusedPlanId = null;\n const result = await this.api.ops[\"role.focus\"](goalId);\n await this.save();\n return this.fmt(\"focus\", goalId, result);\n }\n\n /** Want: declare a goal. */\n async want(goal?: string, id?: string, alias?: readonly string[]): Promise<string> {\n const result = await this.api.ops[\"role.want\"](this.roleId, goal, id, alias);\n if (id) this.ctx.focusedGoalId = id;\n this.ctx.focusedPlanId = null;\n await this.save();\n return this.fmt(\"want\", id ?? this.roleId, result);\n }\n\n /** Plan: create a plan for the focused goal. */\n async plan(plan?: string, id?: string, after?: string, fallback?: string): Promise<string> {\n const result = await this.api.ops[\"role.plan\"](\n this.ctx.requireGoalId(),\n plan,\n id,\n after,\n fallback\n );\n if (id) this.ctx.focusedPlanId = id;\n await this.save();\n return this.fmt(\"plan\", id ?? \"plan\", result);\n }\n\n /** Todo: add a task to the focused plan. */\n async todo(task?: string, id?: string, alias?: readonly string[]): Promise<string> {\n const result = await this.api.ops[\"role.todo\"](this.ctx.requirePlanId(), task, id, alias);\n return this.fmt(\"todo\", id ?? \"task\", result);\n }\n\n /** Finish: complete a task, optionally record an encounter. */\n async finish(task: string, encounter?: string): Promise<string> {\n const result = await this.api.ops[\"role.finish\"](task, this.roleId, encounter);\n if (encounter && result.state.id) {\n this.ctx.addEncounter(result.state.id);\n }\n return this.fmt(\"finish\", task, result);\n }\n\n /** Complete: close a plan as done, record encounter. */\n async complete(plan?: string, encounter?: string): Promise<string> {\n const planId = plan ?? this.ctx.requirePlanId();\n const result = await this.api.ops[\"role.complete\"](planId, this.roleId, encounter);\n this.ctx.addEncounter(result.state.id ?? planId);\n if (this.ctx.focusedPlanId === planId) this.ctx.focusedPlanId = null;\n await this.save();\n return this.fmt(\"complete\", planId, result);\n }\n\n /** Abandon: drop a plan, record encounter. */\n async abandon(plan?: string, encounter?: string): Promise<string> {\n const planId = plan ?? this.ctx.requirePlanId();\n const result = await this.api.ops[\"role.abandon\"](planId, this.roleId, encounter);\n this.ctx.addEncounter(result.state.id ?? planId);\n if (this.ctx.focusedPlanId === planId) this.ctx.focusedPlanId = null;\n await this.save();\n return this.fmt(\"abandon\", planId, result);\n }\n\n // ---- Cognition ----\n\n /** Reflect: consume encounters → experience. Empty encounters = direct creation. */\n async reflect(encounters: string[], experience?: string, id?: string): Promise<string> {\n if (encounters.length > 0) {\n this.ctx.requireEncounterIds(encounters);\n }\n // First encounter goes through ops (creates experience + removes encounter)\n const first = encounters[0] as string | undefined;\n const result = await this.api.ops[\"role.reflect\"](first, this.roleId, experience, id);\n // Remaining encounters are consumed via forget\n for (let i = 1; i < encounters.length; i++) {\n await this.api.ops[\"role.forget\"](encounters[i]);\n }\n if (encounters.length > 0) {\n this.ctx.consumeEncounters(encounters);\n }\n if (id) this.ctx.addExperience(id);\n return this.fmt(\"reflect\", id ?? \"experience\", result);\n }\n\n /** Realize: consume experiences → principle. Empty experiences = direct creation. */\n async realize(experiences: string[], principle?: string, id?: string): Promise<string> {\n if (experiences.length > 0) {\n this.ctx.requireExperienceIds(experiences);\n }\n // First experience goes through ops (creates principle + removes experience)\n const first = experiences[0] as string | undefined;\n const result = await this.api.ops[\"role.realize\"](first, this.roleId, principle, id);\n // Remaining experiences are consumed via forget\n for (let i = 1; i < experiences.length; i++) {\n await this.api.ops[\"role.forget\"](experiences[i]);\n }\n if (experiences.length > 0) {\n this.ctx.consumeExperiences(experiences);\n }\n return this.fmt(\"realize\", id ?? \"principle\", result);\n }\n\n /** Master: create procedure, optionally consuming experiences. */\n async master(procedure: string, id?: string, experiences?: string[]): Promise<string> {\n if (experiences && experiences.length > 0) {\n this.ctx.requireExperienceIds(experiences);\n }\n // First experience goes through ops (creates procedure + removes experience)\n const first = experiences?.[0];\n const result = await this.api.ops[\"role.master\"](this.roleId, procedure, id, first);\n // Remaining experiences are consumed via forget\n if (experiences) {\n for (let i = 1; i < experiences.length; i++) {\n await this.api.ops[\"role.forget\"](experiences[i]);\n }\n this.ctx.consumeExperiences(experiences);\n }\n return this.fmt(\"master\", id ?? \"procedure\", result);\n }\n\n // ---- Knowledge management ----\n\n /** Forget: remove any node under the individual by id. */\n async forget(nodeId: string): Promise<string> {\n const result = await this.api.ops[\"role.forget\"](nodeId);\n if (this.ctx.focusedGoalId === nodeId) this.ctx.focusedGoalId = null;\n if (this.ctx.focusedPlanId === nodeId) this.ctx.focusedPlanId = null;\n await this.save();\n return this.fmt(\"forget\", nodeId, result);\n }\n\n // ---- Skills + unified entry ----\n\n /** Skill: load full skill content by locator. */\n async skill(locator: string): Promise<string> {\n return await this.api.ops[\"role.skill\"](locator);\n }\n\n /** Use: subjective execution — `!ns.method` or ResourceX locator. */\n use<T = unknown>(locator: string, args?: Record<string, unknown>): Promise<T> {\n return this.api.direct<T>(locator, args);\n }\n}\n","/**\n * Rolex — thin API shell.\n *\n * Public API:\n * genesis() — create the world on first run\n * activate(id) — returns a stateful Role handle\n * direct(loc, args) — direct the world to execute an instruction\n *\n * All operation implementations live in @rolexjs/prototype (createOps).\n * Rolex just wires Platform → ops and manages Role lifecycle.\n */\n\nimport type { Platform, RoleXRepository } from \"@rolexjs/core\";\nimport * as C from \"@rolexjs/core\";\nimport { createOps, directives, type Ops, toArgs } from \"@rolexjs/prototype\";\nimport type { Initializer, Runtime, Structure } from \"@rolexjs/system\";\nimport type { ResourceX } from \"resourcexjs\";\nimport { createResourceX, setProvider } from \"resourcexjs\";\nimport { RoleContext } from \"./context.js\";\nimport { findInState } from \"./find.js\";\nimport { Role, type RolexInternal } from \"./role.js\";\n\n/** Summary entry returned by census.list. */\nexport interface CensusEntry {\n id?: string;\n name: string;\n tag?: string;\n}\n\nexport class Rolex {\n private rt: Runtime;\n private ops!: Ops;\n private resourcex?: ResourceX;\n private repo: RoleXRepository;\n private readonly initializer?: Initializer;\n\n private readonly bootstrap: readonly string[];\n private society!: Structure;\n private past!: Structure;\n\n private constructor(platform: Platform) {\n this.repo = platform.repository;\n this.rt = this.repo.runtime;\n this.initializer = platform.initializer;\n this.bootstrap = platform.bootstrap ?? [];\n\n // Create ResourceX from injected provider\n if (platform.resourcexProvider) {\n setProvider(platform.resourcexProvider);\n this.resourcex = createResourceX(\n platform.resourcexExecutor\n ? { isolator: \"custom\", executor: platform.resourcexExecutor }\n : undefined\n );\n }\n }\n\n /** Create a Rolex instance from a Platform (async due to Runtime initialization). */\n static async create(platform: Platform): Promise<Rolex> {\n const rolex = new Rolex(platform);\n await rolex.init();\n return rolex;\n }\n\n /** Async initialization — called by Rolex.create(). */\n private async init(): Promise<void> {\n // Ensure world roots exist\n const roots = await this.rt.roots();\n this.society =\n roots.find((r) => r.name === \"society\") ?? (await this.rt.create(null, C.society));\n\n const societyState = await this.rt.project(this.society);\n const existingPast = societyState.children?.find((c) => c.name === \"past\");\n this.past = existingPast ?? (await this.rt.create(this.society, C.past));\n\n // Create ops from prototype — all operation implementations\n this.ops = createOps({\n rt: this.rt,\n society: this.society,\n past: this.past,\n resolve: async (id: string) => {\n const node = await this.find(id);\n if (!node) throw new Error(`\"${id}\" not found.`);\n return node;\n },\n find: (id: string) => this.find(id),\n resourcex: this.resourcex,\n prototype: this.repo.prototype,\n direct: (locator: string, args?: Record<string, unknown>) => this.direct(locator, args),\n });\n }\n\n /** Genesis — create the world on first run. Settles built-in prototypes. */\n async genesis(): Promise<void> {\n await this.initializer?.bootstrap();\n // Settle bootstrap prototypes\n for (const source of this.bootstrap) {\n await this.direct(\"!prototype.settle\", { source });\n }\n }\n\n /**\n * Activate a role — returns a stateful Role handle.\n *\n * If the individual does not exist in runtime but a prototype is registered,\n * auto-born the individual first.\n */\n async activate(individual: string): Promise<Role> {\n let node = await this.find(individual);\n if (!node) {\n const hasProto = Object.hasOwn(this.repo.prototype.list(), individual);\n if (hasProto) {\n await this.ops[\"individual.born\"](undefined, individual);\n node = (await this.find(individual))!;\n } else {\n throw new Error(`\"${individual}\" not found.`);\n }\n }\n const state = await this.rt.project(node);\n const ctx = new RoleContext(individual);\n ctx.rehydrate(state);\n\n // Restore persisted focus (only override rehydrate default when persisted value is valid)\n const persisted = await this.repo.loadContext(individual);\n if (persisted) {\n if (persisted.focusedGoalId && (await this.find(persisted.focusedGoalId))) {\n ctx.focusedGoalId = persisted.focusedGoalId;\n }\n if (persisted.focusedPlanId && (await this.find(persisted.focusedPlanId))) {\n ctx.focusedPlanId = persisted.focusedPlanId;\n }\n }\n\n // Build internal API for Role — ops + ctx persistence\n const ops = this.ops;\n const repo = this.repo;\n const saveCtx = async (c: RoleContext) => {\n await repo.saveContext(c.roleId, {\n focusedGoalId: c.focusedGoalId,\n focusedPlanId: c.focusedPlanId,\n });\n };\n\n const api: RolexInternal = {\n ops,\n saveCtx,\n direct: this.direct.bind(this),\n };\n\n return new Role(individual, ctx, api);\n }\n\n /** Find a node by id or alias across the entire society tree. Internal use only. */\n private async find(id: string): Promise<Structure | null> {\n const state = await this.rt.project(this.society);\n return findInState(state, id);\n }\n\n /**\n * Direct the world to execute an instruction.\n *\n * - `!namespace.method` — dispatch to ops\n * - anything else — delegate to ResourceX `ingest`\n */\n async direct<T = unknown>(locator: string, args?: Record<string, unknown>): Promise<T> {\n if (locator.startsWith(\"!\")) {\n const command = locator.slice(1);\n const fn = this.ops[command];\n if (!fn) {\n const hint = directives[\"identity-ethics\"]?.[\"on-unknown-command\"] ?? \"\";\n throw new Error(\n `Unknown command \"${locator}\".\\n\\n` +\n \"You may be guessing the command name. \" +\n \"Load the relevant skill first with skill(locator) to learn the correct syntax.\\n\\n\" +\n hint\n );\n }\n return (await fn(...toArgs(command, args ?? {}))) as T;\n }\n if (!this.resourcex) throw new Error(\"ResourceX is not available.\");\n return this.resourcex.ingest<T>(locator, args);\n }\n}\n\n/** Create a Rolex instance from a Platform. */\nexport async function createRoleX(platform: Platform): Promise<Rolex> {\n return Rolex.create(platform);\n}\n"],"mappings":";AAaA,cAAc;;;ACAP,IAAM,cAAN,MAAkB;AAAA,EACvB;AAAA,EACA,gBAA+B;AAAA,EAC/B,gBAA+B;AAAA,EAEtB,eAAe,oBAAI,IAAY;AAAA,EAC/B,gBAAgB,oBAAI,IAAY;AAAA,EAEzC,YAAY,QAAgB;AAC1B,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAwB;AACtB,QAAI,CAAC,KAAK,cAAe,OAAM,IAAI,MAAM,mCAAmC;AAC5E,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,gBAAwB;AACtB,QAAI,CAAC,KAAK,cAAe,OAAM,IAAI,MAAM,mCAAmC;AAC5E,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAMA,aAAa,IAAY;AACvB,SAAK,aAAa,IAAI,EAAE;AAAA,EAC1B;AAAA,EAEA,oBAAoB,KAAe;AACjC,eAAW,MAAM,KAAK;AACpB,UAAI,CAAC,KAAK,aAAa,IAAI,EAAE,EAAG,OAAM,IAAI,MAAM,yBAAyB,EAAE,GAAG;AAAA,IAChF;AAAA,EACF;AAAA,EAEA,kBAAkB,KAAe;AAC/B,eAAW,MAAM,KAAK;AACpB,WAAK,aAAa,OAAO,EAAE;AAAA,IAC7B;AAAA,EACF;AAAA,EAEA,cAAc,IAAY;AACxB,SAAK,cAAc,IAAI,EAAE;AAAA,EAC3B;AAAA,EAEA,qBAAqB,KAAe;AAClC,eAAW,MAAM,KAAK;AACpB,UAAI,CAAC,KAAK,cAAc,IAAI,EAAE,EAAG,OAAM,IAAI,MAAM,0BAA0B,EAAE,GAAG;AAAA,IAClF;AAAA,EACF;AAAA,EAEA,mBAAmB,KAAe;AAChC,eAAW,MAAM,KAAK;AACpB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AACpE,SAAO,MAAM,OAAO,QAAQ;AAC9B;","names":["c","directives","hint","directives"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolexjs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0-dev-20260303090453",
|
|
4
4
|
"description": "RoleX - AI Agent Role Management Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rolex",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"clean": "rm -rf dist"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@rolexjs/core": "
|
|
43
|
-
"@rolexjs/prototype": "
|
|
44
|
-
"@rolexjs/system": "
|
|
45
|
-
"@rolexjs/parser": "
|
|
42
|
+
"@rolexjs/core": "1.1.0-dev-20260303090453",
|
|
43
|
+
"@rolexjs/prototype": "1.1.0-dev-20260303090453",
|
|
44
|
+
"@rolexjs/system": "1.1.0-dev-20260303090453",
|
|
45
|
+
"@rolexjs/parser": "1.1.0-dev-20260303090453",
|
|
46
46
|
"resourcexjs": "^2.14.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@rolexjs/local-platform": "
|
|
49
|
+
"@rolexjs/local-platform": "1.1.0-dev-20260303090453"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|