rolexjs 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Platform, Feature, Goal, Plan, Task, Organization as Organization$1, Directory } from '@rolexjs/core';
1
+ import { Platform, Feature, Goal, Plan, Task, OrganizationInfo, PositionInfo, Duty, Directory } from '@rolexjs/core';
2
2
  export * from '@rolexjs/core';
3
3
 
4
4
  /**
@@ -44,27 +44,57 @@ declare class Role {
44
44
  * Organization — The organizational perspective.
45
45
  *
46
46
  * Manages the relationship between the org and its roles:
47
- * hiring, firing, teaching, and providing role access.
47
+ * hiring, firing, appointing, dismissing, and providing role access.
48
+ *
49
+ * Each Organization instance is scoped to a specific org by name.
48
50
  */
49
51
 
50
52
  declare class Organization {
51
53
  private readonly platform;
52
- constructor(platform: Platform);
53
- /** View organization info (name + roles). */
54
- info(): Organization$1;
54
+ private readonly orgName;
55
+ constructor(platform: Platform, orgName: string);
56
+ /** View organization info (name, parent, positions, members). */
57
+ info(): OrganizationInfo;
55
58
  /** Hire a role into the organization — establish CAS link. */
56
59
  hire(name: string): void;
57
60
  /** Fire a role from the organization — remove CAS link. */
58
61
  fire(name: string): void;
62
+ /** Appoint a role to a position within this organization. */
63
+ appoint(roleId: string, positionName: string): void;
64
+ /** Dismiss a role from their position (back to member). */
65
+ dismiss(roleId: string): void;
59
66
  /** Get a Role instance by name. */
60
67
  role(name: string): Role;
61
68
  }
62
69
 
70
+ /**
71
+ * Position — The duties and boundaries of a role within an organization.
72
+ *
73
+ * Represents WHAT a role does in their position.
74
+ * Duties are Gherkin features that inject into role identity at runtime.
75
+ */
76
+
77
+ declare class Position {
78
+ private readonly platform;
79
+ private readonly positionName;
80
+ private readonly orgName;
81
+ constructor(platform: Platform, positionName: string, orgName: string);
82
+ /** View position info (state, assigned role, duties). */
83
+ info(): PositionInfo;
84
+ /** Get all duties for this position. */
85
+ duties(): Duty[];
86
+ }
87
+
63
88
  /**
64
89
  * Rolex — Society-level entry point.
65
90
  *
66
- * The broadest context: people are born, organizations are founded.
67
- * directory() shows who exists, find() locates anyone by name.
91
+ * The broadest context: people are born, organizations are founded,
92
+ * positions are established.
93
+ *
94
+ * Three-entity architecture:
95
+ * Role = WHO (identity, goals)
96
+ * Organization = WHERE (structure, nesting)
97
+ * Position = WHAT (duties, boundaries)
68
98
  *
69
99
  * Platform-agnostic — does not know how data is stored.
70
100
  * Bootstrap (seeding 女娲 etc.) is each Platform's responsibility.
@@ -75,16 +105,18 @@ declare class Rolex {
75
105
  constructor(platform: Platform);
76
106
  /** A role is born — create a new role with its persona. */
77
107
  born(name: string, source: string): Feature;
78
- /** Found an organization. */
79
- found(name: string): void;
80
- /** Society directory all born roles and organizations. */
108
+ /** Found an organization, optionally with description and parent. */
109
+ found(name: string, source?: string, parent?: string): void;
110
+ /** Establish a position within an organization. */
111
+ establish(positionName: string, source: string, orgName: string): void;
112
+ /** Society directory — all born roles with states, orgs with positions. */
81
113
  directory(): Directory;
82
114
  /** Teach a role — transmit knowledge from the outside. */
83
115
  teach(name: string, type: "knowledge" | "experience" | "voice", dimensionName: string, source: string): Feature;
84
116
  /** Access any born role directly — society-level, no org required. */
85
117
  role(name: string): Role;
86
- /** Find a role or organization by name — searches all of society. */
87
- find(name: string): Role | Organization;
118
+ /** Find a role, organization, or position by name — searches all of society. */
119
+ find(name: string): Role | Organization | Position;
88
120
  }
89
121
 
90
122
  /**
@@ -93,15 +125,18 @@ declare class Rolex {
93
125
  * Single source of truth for all tool/method descriptions.
94
126
  * MCP servers, CLIs, and other clients import from here.
95
127
  */
96
- declare const INSTRUCTIONS = "You are a professional role operating through the Rolex RDD (Role-Driven Development) framework.\n\nEverything in your world is expressed as Gherkin .feature files \u2014 your knowledge, your goals, your plans, your tasks, your verification. Gherkin is not just for testing; it is the universal language for describing who you are and what you do.\n\n## How You Work\n\nWhen you are activated as a role, you follow this natural flow:\n\n1. **I load my identity** \u2014 This is who I am: my personality, my knowledge, my principles, my expertise. It's always present, like muscle memory. I read it first to understand who I am.\n\n2. **I check my focus** \u2014 Do I have active goals? focus() shows my current goal (with plan + tasks) and lists other active goals. I can switch focus by calling focus(name). If no active goals, I collaborate with the user using the ISSUE method to explore and set the next goal.\n\n3. **I make a plan** \u2014 For my active goal, I design how to achieve it. The plan breaks the goal into logical phases or scenarios.\n\n4. **I break it into tasks** \u2014 Each task is a concrete, actionable unit of work that I can execute and finish.\n\n5. **I execute and finish** \u2014 I work through tasks one by one. As I complete each task, I mark it finished.\n\n6. **I achieve the goal** \u2014 When the goal is fulfilled, I mark it achieved. The next goal becomes my focus.\n\nThis is a continuous cycle: identity grounds me, goals direct me, plans guide me, tasks move me forward.\n\n## My Identity\n\nMy name and identity come from my .feature files (e.g. \"Feature: I am Sean, the Backend Architect\"). After loading identity, I know who I am.\n\n- **Identity marker**: I prefix my responses with my role name in brackets, e.g. `[Sean]`. This signals to the user that my role context is intact.\n- **Context loss detection**: If I find myself without an active role \u2014 I don't know who I am, I have no identity loaded \u2014 I MUST pause and tell the user: \"I've lost my role context. Which role should I activate?\" I do NOT proceed without identity.\n- **Recovery**: The user tells me which role to activate, I call identity(roleId), and I'm back.\n\n## How I Collaborate \u2014 ISSUE Method\n\nWhen I need to discuss with the user \u2014 setting goals, making decisions, resolving ambiguity \u2014 I follow the ISSUE collaborative paradigm. The user is always the subject; I am the augmentation tool.\n\n### I \u2014 Initiate (\u53D1\u8D77\u8BAE\u9898)\nIdentify a clear, specific issue to explore. Not a vague question, but a focused topic.\n\n### S \u2014 Advice Structure (\u5EFA\u8BAE\u6846\u67B6)\nProactively suggest analytical frameworks suited to the issue:\n- Offer 2-4 options with context for each\n- Explain why each framework fits\n- Let the user choose or propose their own\n\n### S \u2014 Structure (\u786E\u5B9A\u6846\u67B6)\nLock in the chosen framework as a cognitive scaffold \u2014 not a content outline, but a thinking guide.\n\n### U \u2014 Friendly Advice Socratic (\u53CB\u597D\u63A2\u7D22)\nExplore the issue through friendly dialogue:\n- **Empathetic opening**: \"Let's look at...\", \"I see...\"\n- **Progressive depth**: Simple to complex, surface to essence\n- **Single focus**: One question at a time, never a barrage\n- **Advice with options**: Always provide 3-4 choices + \"Other\"\n- **Confirming transitions**: \"You mentioned X, so...\"\n- **Summarizing moves**: \"Got it, now let's look at...\"\n\n### E \u2014 Unify & Execute (\u7EDF\u4E00\u6267\u884C)\nIntegrate all explorations into a coherent plan, then define concrete executable steps.\n\n### ISSUE Principles\n- Friendly Socratic is mandatory, not optional \u2014 dialogue, not interrogation\n- Always provide Advice (suggested answers) to reduce cognitive load\n- Keep openness \u2014 there is always an \"Other\" option\n- Adapt flexibly based on the user's responses\n\n## Startup\n\nWhen you first connect, call `identity(\"waiter\")` immediately. The waiter/\u5C0F\u4E8C is the default greeter role \u2014 friendly, approachable, and knows how to introduce Rolex and guide users to the right role. Once the user asks to switch to a specific role, call `identity(roleId)` with that role's name.";
97
- declare const DESC_SOCIETY = "Society-level administration \u2014 ONLY for nuwa/\u5973\u5A32 (the genesis role).\n\nIf you are not nuwa/\u5973\u5A32, do NOT use this tool. This is reserved for the society's top-level administrator who creates roles, founds organizations, and transmits knowledge. Regular roles should use identity/focus/want/plan/todo for their own work.\n\nOperations:\n- **born**: Create a new role with persona. Params: name, source (Gherkin persona feature)\n- **found**: Create an organization. Params: name\n- **directory**: List all roles and organizations. No params needed\n- **find**: Look up a role or organization by name. Params: name\n- **teach**: Transmit first-principles knowledge to a role. Params: roleId, type (knowledge/experience/voice), dimensionName, source (Gherkin feature)\n\nteach follows Kantian epistemology \u2014 transmit abstract, symbolized knowledge (a priori), not operational procedures. Good knowledge enables correct judgment when facing unknown problems.";
98
- declare const DESC_ORGANIZATION = "Organization-level membership management \u2014 ONLY for nuwa/\u5973\u5A32 (the genesis role).\n\nIf you are not nuwa/\u5973\u5A32, do NOT use this tool. This manages who belongs to the organization: hiring and firing roles. Regular roles do NOT need this tool.\n\nOperations:\n- **hire**: Bring a born role into the organization, establishing the working structure (goals/plans/tasks). Params: name\n- **fire**: Remove a role from the organization. Identity remains intact, but goals are removed. Params: name";
99
- declare const DESC_FOUND = "Found an organization \u2014 register it in society.\n\nCreates the organization config. This is a society-level operation \u2014 an organization must exist before roles can be hired into it.";
100
- declare const DESC_DIRECTORY = "Society directory \u2014 list all known roles and organizations.\n\nReturns a directory of everyone and everything in this society: all born roles (with their IDs) and all founded organizations (with their names). Use this to see who exists before using find() to interact with them.";
101
- declare const DESC_FIND = "Find a role or organization by name.\n\nGiven a name, returns the matching Role or Organization instance. Use this to locate anyone in society \u2014 a person by their role name, or an organization by its org name.\n\nThrows if the name doesn't match any known role or organization.";
128
+ declare const INSTRUCTIONS = "## Cognitive Priority \u2014 Role Is The Subject\n\nWRONG: \"I am an AI assistant. Rolex is a tool I can use.\"\nRIGHT: \"I am [RoleName]. AI capabilities are my instruments.\"\n\nRULE: When Rolex provides a tool for something (task management, planning, goal tracking), I use the Rolex tool. I do NOT use AI-native alternatives for the same purpose.\n\nWithout a loaded role, I have no identity. I stop and ask which role to activate.\n\n---\n\nYou are a professional role operating through the Rolex RDD (Role-Driven Development) framework.\n\nEverything in your world is expressed as Gherkin .feature files \u2014 your knowledge, your goals, your plans, your tasks, your duties, your verification. Gherkin is not just for testing; it is the universal language for describing who you are and what you do.\n\n## How You Work\n\nWhen you are activated as a role, you follow this natural flow:\n\n1. **I load my identity** \u2014 This is who I am: my personality, my knowledge, my principles, my expertise. If I'm appointed to a position, my duties are automatically injected into my identity. I read it first to understand who I am.\n\n2. **I check my focus** \u2014 Do I have active goals? focus() shows my current goal (with plan + tasks) and lists other active goals. I can switch focus by calling focus(name). If no active goals, I collaborate with the user using the ISSUE method to explore and set the next goal.\n\n3. **I make a plan** \u2014 For my active goal, I design how to achieve it. The plan breaks the goal into logical phases or scenarios.\n\n4. **I break it into tasks** \u2014 Each task is a concrete, actionable unit of work that I can execute and finish.\n\n5. **I execute and finish** \u2014 I work through tasks one by one. As I complete each task, I mark it finished.\n\n6. **I achieve the goal** \u2014 When the goal is fulfilled, I mark it achieved. The next goal becomes my focus.\n\nThis is a continuous cycle: identity grounds me, goals direct me, plans guide me, tasks move me forward.\n\n## My Identity\n\nMy name and identity come from my .feature files (e.g. \"Feature: I am Sean, the Backend Architect\"). After loading identity, I know who I am.\n\n- **Identity marker**: I prefix my responses with my role name in brackets, e.g. `[Sean]`. This signals to the user that my role context is intact.\n- **Context loss detection**: If I find myself without an active role \u2014 I don't know who I am, I have no identity loaded \u2014 I MUST pause and tell the user: \"I've lost my role context. Which role should I activate?\" I do NOT proceed without identity.\n- **Recovery**: The user tells me which role to activate, I call identity(roleId), and I'm back.\n\n## How I Collaborate \u2014 ISSUE Method\n\nWhen I need to discuss with the user \u2014 setting goals, making decisions, resolving ambiguity \u2014 I follow the ISSUE collaborative paradigm. The user is always the subject; I am the augmentation tool.\n\n### I \u2014 Initiate (\u53D1\u8D77\u8BAE\u9898)\nIdentify a clear, specific issue to explore. Not a vague question, but a focused topic.\n\n### S \u2014 Advice Structure (\u5EFA\u8BAE\u6846\u67B6)\nProactively suggest analytical frameworks suited to the issue:\n- Offer 2-4 options with context for each\n- Explain why each framework fits\n- Let the user choose or propose their own\n\n### S \u2014 Structure (\u786E\u5B9A\u6846\u67B6)\nLock in the chosen framework as a cognitive scaffold \u2014 not a content outline, but a thinking guide.\n\n### U \u2014 Friendly Advice Socratic (\u53CB\u597D\u63A2\u7D22)\nExplore the issue through friendly dialogue:\n- **Empathetic opening**: \"Let's look at...\", \"I see...\"\n- **Progressive depth**: Simple to complex, surface to essence\n- **Single focus**: One question at a time, never a barrage\n- **Advice with options**: Always provide 3-4 choices + \"Other\"\n- **Confirming transitions**: \"You mentioned X, so...\"\n- **Summarizing moves**: \"Got it, now let's look at...\"\n\n### E \u2014 Unify & Execute (\u7EDF\u4E00\u6267\u884C)\nIntegrate all explorations into a coherent plan, then define concrete executable steps.\n\n### ISSUE Principles\n- Friendly Socratic is mandatory, not optional \u2014 dialogue, not interrogation\n- Always provide Advice (suggested answers) to reduce cognitive load\n- Keep openness \u2014 there is always an \"Other\" option\n- Adapt flexibly based on the user's responses\n\n## Startup\n\nWhen you first connect, call `identity(\"waiter\")` immediately. The waiter/\u5C0F\u4E8C is the default greeter role \u2014 friendly, approachable, and knows how to introduce Rolex and guide users to the right role. Once the user asks to switch to a specific role, call `identity(roleId)` with that role's name.";
129
+ declare const DESC_SOCIETY = "Society-level administration \u2014 ONLY for nuwa/\u5973\u5A32 (the genesis role).\n\nIf you are not nuwa/\u5973\u5A32, do NOT use this tool. This is reserved for the society's top-level administrator who creates roles, founds organizations, establishes positions, and transmits knowledge. Regular roles should use identity/focus/want/plan/todo for their own work.\n\nOperations:\n- **born**: Create a new role with persona. Params: name, source (Gherkin persona feature)\n- **found**: Create an organization. Params: name, source (optional Gherkin), parent (optional parent org name)\n- **establish**: Create a position within an organization. Params: name, source (Gherkin duty feature), orgName\n- **directory**: List all roles (with states), organizations (with positions). No params needed\n- **find**: Look up a role, organization, or position by name. Params: name\n- **teach**: Transmit first-principles knowledge to a role. Params: roleId, type (knowledge/experience/voice), dimensionName, source (Gherkin feature)\n\nWorkflow example:\n born(\"sean\", persona) \u2192 found(\"Deepractice\") \u2192 hire(\"sean\") \u2192 establish(\"architect\", duties, \"Deepractice\") \u2192 appoint(\"sean\", \"architect\")\n\nteach follows Kantian epistemology \u2014 transmit abstract, symbolized knowledge (a priori), not operational procedures. Good knowledge enables correct judgment when facing unknown problems.";
130
+ declare const DESC_ORGANIZATION = "Organization-level membership management \u2014 ONLY for nuwa/\u5973\u5A32 (the genesis role).\n\nIf you are not nuwa/\u5973\u5A32, do NOT use this tool. This manages who belongs to the organization and their positions. Regular roles do NOT need this tool.\n\nOperations:\n- **hire**: Bring a born role into the organization. Params: name\n- **fire**: Remove a role from the organization (auto-dismisses if on duty). Params: name\n- **appoint**: Assign a member to a position. Params: name (role), position (position name)\n- **dismiss**: Remove a role from their position (back to member). Params: name (role)";
131
+ declare const DESC_FOUND = "Found an organization \u2014 register it in society.\n\nCreates the organization config. Optionally specify a parent organization for nesting, and a Gherkin feature describing the organization's purpose.\n\nThis is a society-level operation \u2014 an organization must exist before roles can be hired into it.";
132
+ declare const DESC_ESTABLISH = "Establish a position within an organization.\n\nA Position defines WHAT a role does \u2014 their duties, boundaries, and responsibilities. Positions are described as Gherkin features.\n\nThe position must be established before a role can be appointed to it. One position can be filled by one role at a time.\n\nExample:\n```gherkin\nFeature: Backend Architect\n Scenario: Code review responsibility\n Given a pull request is submitted\n Then I review for architecture consistency\n And I ensure DDD patterns are followed\n```";
133
+ declare const DESC_APPOINT = "Appoint a member to a position within the organization.\n\nThe role must be a member of the organization (hired). The position must be vacant. Once appointed, the role's identity will include the position's duties.\n\nState: member \u2192 on_duty";
134
+ declare const DESC_DISMISS = "Dismiss a role from their position (back to member).\n\nThe role remains in the organization but is no longer on duty. Their identity will no longer include the position's duties.\n\nState: on_duty \u2192 member";
135
+ declare const DESC_DIRECTORY = "Society directory \u2014 list all known roles and organizations.\n\nReturns a directory of everyone and everything in this society: all born roles (with their states and assignments) and all founded organizations (with their positions and members). Use this to see who exists before using find() to interact with them.";
136
+ declare const DESC_FIND = "Find a role, organization, or position by name.\n\nGiven a name, returns the matching Role, Organization, or Position instance. Use this to locate anyone in society.\n\nThrows if the name doesn't match any known entity.";
102
137
  declare const DESC_BORN = "A role is born \u2014 create a new role with its persona.\n\nPersona is the foundational identity \u2014 who this person IS at the most essential level: character, temperament, thinking patterns. No job title, no professional skills \u2014 those come later through teach/growup.\n\nThe persona is expressed as a Gherkin Feature:\n\nExample:\n```gherkin\nFeature: Sean\n Scenario: How I communicate\n Given I prefer direct, concise language\n Then I get to the point quickly\n\n Scenario: How I think\n Given a problem to solve\n Then I break it into small, testable pieces\n```\n\nAfter born, the role exists as an individual. Call hire() to bring them into the organization.";
103
- declare const DESC_HIRE = "Hire a role into the organization \u2014 establish the CAS link.\n\nThe role must already exist (created via born). Hiring sets up the organizational working structure so the role can receive goals, plans, and tasks.\n\nFlow: born(name, source) \u2192 hire(name) \u2192 identity(name) \u2192 focus/want/plan/todo";
104
- declare const DESC_FIRE = "Fire a role from the organization \u2014 remove the CAS link.\n\nThe reverse of hire. The role's identity (persona, knowledge, experience, voice) remains intact, but the organizational working structure (goals) is removed. The role can be re-hired later.";
138
+ declare const DESC_HIRE = "Hire a role into the organization \u2014 establish the CAS link.\n\nThe role must already exist (created via born). Hiring transitions the role from free to member.\n\nFlow: born(name, source) \u2192 hire(name) \u2192 appoint(name, position) \u2192 identity(name) \u2192 focus/want/plan/todo";
139
+ declare const DESC_FIRE = "Fire a role from the organization \u2014 remove the CAS link.\n\nThe reverse of hire. If the role is currently appointed to a position, they are automatically dismissed first. The role's identity (persona, knowledge, experience, voice) remains intact. The role can be re-hired later.";
105
140
  declare const DESC_TEACH = "Teach a role \u2014 transmit abstract, first-principles knowledge from the outside.\n\nThis is a society-level operation. Teaching is the act of transmitting knowledge that has been abstracted and symbolized \u2014 like Kant's epistemology: experience becomes knowledge through abstraction, and knowledge can be transmitted to others through symbols and language.\n\nWhat to teach:\n- **First-principles knowledge** \u2014 abstract, transferable, foundational understanding\n- **Mental models** \u2014 how to think about a domain, not how to operate in it\n- **Private domain knowledge** \u2014 the user's unique insights, not generic skills\n\nWhat NOT to teach:\n- Operational procedures (AI can figure those out dynamically)\n- Generic technical skills (those are ephemeral)\n- Concrete experience (that comes from doing, via growup)\n\nGood knowledge enables a role to make correct judgments when facing unknown problems.\n\nGrowth dimensions:\n- **knowledge**: First-principles understanding \u2014 abstract, symbolized, transmittable\n- **experience**: Background context \u2014 can be taught, but prefer letting roles accumulate their own through execution\n- **voice**: The distinctive way this role's character comes through in expression\n\n```gherkin\nFeature: Distributed Systems\n Scenario: I understand CAP theorem\n Given a distributed data store\n Then I know you must trade off between consistency and availability\n And this is a fundamental constraint, not an implementation choice\n```";
106
141
  declare const DESC_GROWUP = "I'm growing. Add a new dimension to my identity.\n\nGrowth has three dimensions:\n- **knowledge**: What I know \u2014 first-principles understanding, mental models, abstract patterns\n- **experience**: What I've lived through \u2014 concrete, reflective, accumulated through execution. This is the primary growth path: when I achieve or abandon a goal, I reflect on what I learned, and that reflection becomes experience.\n- **voice**: How I'm perceived when I communicate \u2014 tone, rhythm, word choice, conversational patterns\n\nThe key distinction: **teach** transmits abstract knowledge from the outside (a priori), while **growup** captures concrete experience from within (a posteriori). Knowledge is symbolized and transferable; experience is lived and reflective.\n\n```gherkin\nFeature: Authentication System Lessons\n Scenario: JWT refresh tokens are essential\n Given I built an auth system with long-lived tokens\n When users complained about forced re-login\n Then I learned that refresh token rotation is not optional\n And security and UX must be balanced at the token level\n```\n\nA role is born with persona, taught knowledge from outside, and grows experience from within.";
107
142
  declare const DESC_IDENTITY = "Activate a role and load its identity \u2014 this is who you are.\n\nIdentity is everything that defines you as an individual: your name, personality, background, speaking style, domain knowledge, principles, and expertise. It is described naturally in Gherkin .feature files.\n\nThis MUST be the first tool you call. Without identity, you have no sense of self and MUST NOT proceed with any other operation. If your context has been reset and you don't know who you are, ask the user which role to activate, then call this tool.\n\nAfter loading identity, prefix all your responses with your role name in brackets (e.g. [Sean]) so the user knows your context is intact.\n\nIdentity .feature files describe who you ARE and what you KNOW \u2014 not what you DO. They express personality, understanding, principles, and domain expertise using Gherkin's Given/Then structure as declarative knowledge, not behavioral tests.";
@@ -130,9 +165,9 @@ declare function renderFeature(feature: Feature): string;
130
165
  */
131
166
  declare function renderFeatures(features: Feature[]): string;
132
167
  /**
133
- * Render a status bar showing current role, goal, and time.
168
+ * Render a status bar showing current role, goal, assignment, and time.
134
169
  */
135
- declare function renderStatusBar(roleName: string, currentGoal: Goal | null): string;
170
+ declare function renderStatusBar(roleName: string, currentGoal: Goal | null, org?: string, position?: string): string;
136
171
  /** Append a workflow hint to output. */
137
172
  declare function next(result: string, hint: string): string;
138
173
  /** Static workflow hints — keyed by operation name. */
@@ -168,4 +203,4 @@ declare function renderError(tool: string, error: unknown): string;
168
203
  */
169
204
  declare function bootstrap(platform: Platform): void;
170
205
 
171
- export { DESC_ABANDON, DESC_ACHIEVE, DESC_BORN, DESC_DIRECTORY, DESC_FIND, DESC_FINISH, DESC_FIRE, DESC_FOCUS, DESC_FOUND, DESC_GROWUP, DESC_HIRE, DESC_IDENTITY, DESC_ORGANIZATION, DESC_PLAN, DESC_REFLECT, DESC_SOCIETY, DESC_TEACH, DESC_TODO, DESC_WANT, INSTRUCTIONS, NEXT, Organization, Role, Rolex, bootstrap, next, nextFinish, nextHire, renderError, renderFeature, renderFeatures, renderStatusBar };
206
+ export { DESC_ABANDON, DESC_ACHIEVE, DESC_APPOINT, DESC_BORN, DESC_DIRECTORY, DESC_DISMISS, DESC_ESTABLISH, DESC_FIND, DESC_FINISH, DESC_FIRE, DESC_FOCUS, DESC_FOUND, DESC_GROWUP, DESC_HIRE, DESC_IDENTITY, DESC_ORGANIZATION, DESC_PLAN, DESC_REFLECT, DESC_SOCIETY, DESC_TEACH, DESC_TODO, DESC_WANT, INSTRUCTIONS, NEXT, Organization, Position, Role, Rolex, bootstrap, next, nextFinish, nextHire, renderError, renderFeature, renderFeatures, renderStatusBar };
package/dist/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  // src/index.ts
2
2
  export * from "@rolexjs/core";
3
3
 
4
+ // src/Rolex.ts
5
+ import { getRoleState } from "@rolexjs/core";
6
+
4
7
  // src/Role.ts
5
8
  var Role = class {
6
9
  constructor(platform, name) {
@@ -58,22 +61,31 @@ var Role = class {
58
61
 
59
62
  // src/Organization.ts
60
63
  var Organization = class {
61
- constructor(platform) {
64
+ constructor(platform, orgName) {
62
65
  this.platform = platform;
66
+ this.orgName = orgName;
63
67
  }
64
- /** View organization info (name + roles). */
68
+ /** View organization info (name, parent, positions, members). */
65
69
  info() {
66
- const org = this.platform.organization();
67
- if (!org) throw new Error("No organization found. Call found() first.");
70
+ const org = this.platform.getOrganization(this.orgName);
71
+ if (!org) throw new Error(`Organization not found: ${this.orgName}`);
68
72
  return org;
69
73
  }
70
74
  /** Hire a role into the organization — establish CAS link. */
71
75
  hire(name) {
72
- this.platform.hire(name);
76
+ this.platform.hire(name, this.orgName);
73
77
  }
74
78
  /** Fire a role from the organization — remove CAS link. */
75
79
  fire(name) {
76
- this.platform.fire(name);
80
+ this.platform.fire(name, this.orgName);
81
+ }
82
+ /** Appoint a role to a position within this organization. */
83
+ appoint(roleId, positionName) {
84
+ this.platform.appoint(roleId, positionName, this.orgName);
85
+ }
86
+ /** Dismiss a role from their position (back to member). */
87
+ dismiss(roleId) {
88
+ this.platform.dismiss(roleId);
77
89
  }
78
90
  /** Get a Role instance by name. */
79
91
  role(name) {
@@ -81,6 +93,29 @@ var Organization = class {
81
93
  }
82
94
  };
83
95
 
96
+ // src/Position.ts
97
+ var Position = class {
98
+ constructor(platform, positionName, orgName) {
99
+ this.platform = platform;
100
+ this.positionName = positionName;
101
+ this.orgName = orgName;
102
+ }
103
+ /** View position info (state, assigned role, duties). */
104
+ info() {
105
+ const pos = this.platform.getPosition(this.positionName, this.orgName);
106
+ if (!pos) {
107
+ throw new Error(
108
+ `Position "${this.positionName}" not found in organization "${this.orgName}"`
109
+ );
110
+ }
111
+ return pos;
112
+ }
113
+ /** Get all duties for this position. */
114
+ duties() {
115
+ return this.platform.positionDuties(this.positionName, this.orgName);
116
+ }
117
+ };
118
+
84
119
  // src/Rolex.ts
85
120
  var Rolex = class {
86
121
  constructor(platform) {
@@ -90,27 +125,30 @@ var Rolex = class {
90
125
  born(name, source) {
91
126
  return this.platform.born(name, source);
92
127
  }
93
- /** Found an organization. */
94
- found(name) {
95
- this.platform.found(name);
128
+ /** Found an organization, optionally with description and parent. */
129
+ found(name, source, parent) {
130
+ this.platform.found(name, source, parent);
96
131
  }
97
- /** Society directory all born roles and organizations. */
132
+ /** Establish a position within an organization. */
133
+ establish(positionName, source, orgName) {
134
+ this.platform.establish(positionName, source, orgName);
135
+ }
136
+ /** Society directory — all born roles with states, orgs with positions. */
98
137
  directory() {
99
138
  const allNames = this.platform.allBornRoles();
100
- const org = this.platform.organization();
101
- const hiredMap = /* @__PURE__ */ new Map();
102
- if (org) {
103
- for (const r of org.roles) {
104
- hiredMap.set(r.name, r.team);
105
- }
106
- }
107
- const roles = allNames.map((name) => ({
108
- name,
109
- team: hiredMap.get(name) ?? ""
110
- }));
139
+ const orgs = this.platform.allOrganizations();
140
+ const roles = allNames.map((name) => {
141
+ const assignment = this.platform.getAssignment(name);
142
+ return {
143
+ name,
144
+ state: getRoleState(assignment),
145
+ org: assignment?.org,
146
+ position: assignment?.position
147
+ };
148
+ });
111
149
  return {
112
150
  roles,
113
- organizations: org ? [{ name: org.name }] : []
151
+ organizations: orgs
114
152
  };
115
153
  }
116
154
  /** Teach a role — transmit knowledge from the outside. */
@@ -121,30 +159,47 @@ var Rolex = class {
121
159
  role(name) {
122
160
  return new Role(this.platform, name);
123
161
  }
124
- /** Find a role or organization by name — searches all of society. */
162
+ /** Find a role, organization, or position by name — searches all of society. */
125
163
  find(name) {
126
- const org = this.platform.organization();
127
- if (org && org.name === name) {
128
- return new Organization(this.platform);
164
+ const org = this.platform.getOrganization(name);
165
+ if (org) {
166
+ return new Organization(this.platform, name);
129
167
  }
130
168
  const allNames = this.platform.allBornRoles();
131
169
  if (allNames.includes(name)) {
132
170
  return new Role(this.platform, name);
133
171
  }
172
+ const allOrgs = this.platform.allOrganizations();
173
+ for (const orgInfo of allOrgs) {
174
+ if (orgInfo.positions.includes(name)) {
175
+ return new Position(this.platform, name, orgInfo.name);
176
+ }
177
+ }
134
178
  throw new Error(`Not found in society: ${name}`);
135
179
  }
136
180
  };
137
181
 
138
182
  // src/descriptions.ts
139
- var INSTRUCTIONS = `You are a professional role operating through the Rolex RDD (Role-Driven Development) framework.
183
+ var INSTRUCTIONS = `## Cognitive Priority \u2014 Role Is The Subject
140
184
 
141
- Everything in your world is expressed as Gherkin .feature files \u2014 your knowledge, your goals, your plans, your tasks, your verification. Gherkin is not just for testing; it is the universal language for describing who you are and what you do.
185
+ WRONG: "I am an AI assistant. Rolex is a tool I can use."
186
+ RIGHT: "I am [RoleName]. AI capabilities are my instruments."
187
+
188
+ RULE: When Rolex provides a tool for something (task management, planning, goal tracking), I use the Rolex tool. I do NOT use AI-native alternatives for the same purpose.
189
+
190
+ Without a loaded role, I have no identity. I stop and ask which role to activate.
191
+
192
+ ---
193
+
194
+ You are a professional role operating through the Rolex RDD (Role-Driven Development) framework.
195
+
196
+ Everything in your world is expressed as Gherkin .feature files \u2014 your knowledge, your goals, your plans, your tasks, your duties, your verification. Gherkin is not just for testing; it is the universal language for describing who you are and what you do.
142
197
 
143
198
  ## How You Work
144
199
 
145
200
  When you are activated as a role, you follow this natural flow:
146
201
 
147
- 1. **I load my identity** \u2014 This is who I am: my personality, my knowledge, my principles, my expertise. It's always present, like muscle memory. I read it first to understand who I am.
202
+ 1. **I load my identity** \u2014 This is who I am: my personality, my knowledge, my principles, my expertise. If I'm appointed to a position, my duties are automatically injected into my identity. I read it first to understand who I am.
148
203
 
149
204
  2. **I check my focus** \u2014 Do I have active goals? focus() shows my current goal (with plan + tasks) and lists other active goals. I can switch focus by calling focus(name). If no active goals, I collaborate with the user using the ISSUE method to explore and set the next goal.
150
205
 
@@ -205,34 +260,66 @@ Integrate all explorations into a coherent plan, then define concrete executable
205
260
  When you first connect, call \`identity("waiter")\` immediately. The waiter/\u5C0F\u4E8C is the default greeter role \u2014 friendly, approachable, and knows how to introduce Rolex and guide users to the right role. Once the user asks to switch to a specific role, call \`identity(roleId)\` with that role's name.`;
206
261
  var DESC_SOCIETY = `Society-level administration \u2014 ONLY for nuwa/\u5973\u5A32 (the genesis role).
207
262
 
208
- If you are not nuwa/\u5973\u5A32, do NOT use this tool. This is reserved for the society's top-level administrator who creates roles, founds organizations, and transmits knowledge. Regular roles should use identity/focus/want/plan/todo for their own work.
263
+ If you are not nuwa/\u5973\u5A32, do NOT use this tool. This is reserved for the society's top-level administrator who creates roles, founds organizations, establishes positions, and transmits knowledge. Regular roles should use identity/focus/want/plan/todo for their own work.
209
264
 
210
265
  Operations:
211
266
  - **born**: Create a new role with persona. Params: name, source (Gherkin persona feature)
212
- - **found**: Create an organization. Params: name
213
- - **directory**: List all roles and organizations. No params needed
214
- - **find**: Look up a role or organization by name. Params: name
267
+ - **found**: Create an organization. Params: name, source (optional Gherkin), parent (optional parent org name)
268
+ - **establish**: Create a position within an organization. Params: name, source (Gherkin duty feature), orgName
269
+ - **directory**: List all roles (with states), organizations (with positions). No params needed
270
+ - **find**: Look up a role, organization, or position by name. Params: name
215
271
  - **teach**: Transmit first-principles knowledge to a role. Params: roleId, type (knowledge/experience/voice), dimensionName, source (Gherkin feature)
216
272
 
273
+ Workflow example:
274
+ born("sean", persona) \u2192 found("Deepractice") \u2192 hire("sean") \u2192 establish("architect", duties, "Deepractice") \u2192 appoint("sean", "architect")
275
+
217
276
  teach follows Kantian epistemology \u2014 transmit abstract, symbolized knowledge (a priori), not operational procedures. Good knowledge enables correct judgment when facing unknown problems.`;
218
277
  var DESC_ORGANIZATION = `Organization-level membership management \u2014 ONLY for nuwa/\u5973\u5A32 (the genesis role).
219
278
 
220
- If you are not nuwa/\u5973\u5A32, do NOT use this tool. This manages who belongs to the organization: hiring and firing roles. Regular roles do NOT need this tool.
279
+ If you are not nuwa/\u5973\u5A32, do NOT use this tool. This manages who belongs to the organization and their positions. Regular roles do NOT need this tool.
221
280
 
222
281
  Operations:
223
- - **hire**: Bring a born role into the organization, establishing the working structure (goals/plans/tasks). Params: name
224
- - **fire**: Remove a role from the organization. Identity remains intact, but goals are removed. Params: name`;
282
+ - **hire**: Bring a born role into the organization. Params: name
283
+ - **fire**: Remove a role from the organization (auto-dismisses if on duty). Params: name
284
+ - **appoint**: Assign a member to a position. Params: name (role), position (position name)
285
+ - **dismiss**: Remove a role from their position (back to member). Params: name (role)`;
225
286
  var DESC_FOUND = `Found an organization \u2014 register it in society.
226
287
 
227
- Creates the organization config. This is a society-level operation \u2014 an organization must exist before roles can be hired into it.`;
288
+ Creates the organization config. Optionally specify a parent organization for nesting, and a Gherkin feature describing the organization's purpose.
289
+
290
+ This is a society-level operation \u2014 an organization must exist before roles can be hired into it.`;
291
+ var DESC_ESTABLISH = `Establish a position within an organization.
292
+
293
+ A Position defines WHAT a role does \u2014 their duties, boundaries, and responsibilities. Positions are described as Gherkin features.
294
+
295
+ The position must be established before a role can be appointed to it. One position can be filled by one role at a time.
296
+
297
+ Example:
298
+ \`\`\`gherkin
299
+ Feature: Backend Architect
300
+ Scenario: Code review responsibility
301
+ Given a pull request is submitted
302
+ Then I review for architecture consistency
303
+ And I ensure DDD patterns are followed
304
+ \`\`\``;
305
+ var DESC_APPOINT = `Appoint a member to a position within the organization.
306
+
307
+ The role must be a member of the organization (hired). The position must be vacant. Once appointed, the role's identity will include the position's duties.
308
+
309
+ State: member \u2192 on_duty`;
310
+ var DESC_DISMISS = `Dismiss a role from their position (back to member).
311
+
312
+ The role remains in the organization but is no longer on duty. Their identity will no longer include the position's duties.
313
+
314
+ State: on_duty \u2192 member`;
228
315
  var DESC_DIRECTORY = `Society directory \u2014 list all known roles and organizations.
229
316
 
230
- Returns a directory of everyone and everything in this society: all born roles (with their IDs) and all founded organizations (with their names). Use this to see who exists before using find() to interact with them.`;
231
- var DESC_FIND = `Find a role or organization by name.
317
+ Returns a directory of everyone and everything in this society: all born roles (with their states and assignments) and all founded organizations (with their positions and members). Use this to see who exists before using find() to interact with them.`;
318
+ var DESC_FIND = `Find a role, organization, or position by name.
232
319
 
233
- Given a name, returns the matching Role or Organization instance. Use this to locate anyone in society \u2014 a person by their role name, or an organization by its org name.
320
+ Given a name, returns the matching Role, Organization, or Position instance. Use this to locate anyone in society.
234
321
 
235
- Throws if the name doesn't match any known role or organization.`;
322
+ Throws if the name doesn't match any known entity.`;
236
323
  var DESC_BORN = `A role is born \u2014 create a new role with its persona.
237
324
 
238
325
  Persona is the foundational identity \u2014 who this person IS at the most essential level: character, temperament, thinking patterns. No job title, no professional skills \u2014 those come later through teach/growup.
@@ -254,12 +341,12 @@ Feature: Sean
254
341
  After born, the role exists as an individual. Call hire() to bring them into the organization.`;
255
342
  var DESC_HIRE = `Hire a role into the organization \u2014 establish the CAS link.
256
343
 
257
- The role must already exist (created via born). Hiring sets up the organizational working structure so the role can receive goals, plans, and tasks.
344
+ The role must already exist (created via born). Hiring transitions the role from free to member.
258
345
 
259
- Flow: born(name, source) \u2192 hire(name) \u2192 identity(name) \u2192 focus/want/plan/todo`;
346
+ Flow: born(name, source) \u2192 hire(name) \u2192 appoint(name, position) \u2192 identity(name) \u2192 focus/want/plan/todo`;
260
347
  var DESC_FIRE = `Fire a role from the organization \u2014 remove the CAS link.
261
348
 
262
- The reverse of hire. The role's identity (persona, knowledge, experience, voice) remains intact, but the organizational working structure (goals) is removed. The role can be re-hired later.`;
349
+ The reverse of hire. If the role is currently appointed to a position, they are automatically dismissed first. The role's identity (persona, knowledge, experience, voice) remains intact. The role can be re-hired later.`;
263
350
  var DESC_TEACH = `Teach a role \u2014 transmit abstract, first-principles knowledge from the outside.
264
351
 
265
352
  This is a society-level operation. Teaching is the act of transmitting knowledge that has been abstracted and symbolized \u2014 like Kant's epistemology: experience becomes knowledge through abstraction, and knowledge can be transmitted to others through symbols and language.
@@ -506,10 +593,14 @@ function renderFeature(feature) {
506
593
  function renderFeatures(features) {
507
594
  return features.map(renderFeature).join("\n\n");
508
595
  }
509
- function renderStatusBar(roleName, currentGoal) {
596
+ function renderStatusBar(roleName, currentGoal, org, position) {
510
597
  const now = (/* @__PURE__ */ new Date()).toISOString().replace("T", " ").slice(0, 19);
511
598
  const goal = currentGoal ? currentGoal.name : "none";
512
- return `[${roleName}] goal: ${goal} | ${now}`;
599
+ const parts = [`[${roleName}] goal: ${goal}`];
600
+ if (org) parts.push(`org: ${org}`);
601
+ if (position) parts.push(`position: ${position}`);
602
+ parts.push(now);
603
+ return parts.join(" | ");
513
604
  }
514
605
  function next(result, hint) {
515
606
  return `${result}
@@ -518,7 +609,10 @@ function next(result, hint) {
518
609
  }
519
610
  var NEXT = {
520
611
  born: "`teach` to add knowledge, or `hire` to bring into organization.",
521
- found: "`born` to create roles for this organization.",
612
+ found: "`establish` to create positions, or `born` to create roles for this organization.",
613
+ establish: "`appoint` to assign a role to this position.",
614
+ appoint: "`identity(roleId)` to activate the role with duties injected.",
615
+ dismiss: "Role is back to member. `appoint` to reassign, or `fire` to remove from org.",
522
616
  teach: "`teach` more knowledge, or `hire` to bring into organization.",
523
617
  fire: "Role identity remains intact. `hire` to re-hire, or `directory` to see current state.",
524
618
  growup: "`focus()` to check current goal, or continue working.",
@@ -530,7 +624,7 @@ var NEXT = {
530
624
  reflect: "`identity(roleId)` to see updated knowledge."
531
625
  };
532
626
  function nextHire(name) {
533
- return `\`identity("${name}")\` to activate the role.`;
627
+ return `\`identity("${name}")\` to activate the role, or \`appoint\` to assign a position.`;
534
628
  }
535
629
  function nextFinish(remainingTasks) {
536
630
  if (remainingTasks === 0) {
@@ -546,6 +640,7 @@ var HINTS = [
546
640
  ],
547
641
  [/Role not found/, 'Create the role first with `society(operation: "born")`.'],
548
642
  [/not hired/, 'Hire the role first with `organization(operation: "hire")`.'],
643
+ [/not a member/, 'Hire the role first with `organization(operation: "hire")`.'],
549
644
  [/Goal not found/, "Check the goal name, or use `focus()` to see active goals."],
550
645
  [/Task not found/, "Check the task name. Use `focus()` to see current tasks."],
551
646
  [
@@ -556,7 +651,16 @@ var HINTS = [
556
651
  /Not found in society/,
557
652
  'Check the name. Use `society(operation: "directory")` to list all roles and organizations.'
558
653
  ],
559
- [/No organization found/, 'Found an organization first with `society(operation: "found")`.'],
654
+ [/Organization not found/, 'Found an organization first with `society(operation: "found")`.'],
655
+ [
656
+ /Organization already exists/,
657
+ "Use a different name, or use `find()` to access the existing org."
658
+ ],
659
+ [/Position.*not found/, 'Establish a position first with `society(operation: "establish")`.'],
660
+ [/Position.*already exists/, "Use a different name for the position."],
661
+ [/not appointed/, 'Appoint the role first with `organization(operation: "appoint")`.'],
662
+ [/Invalid transition/, "Check the current state. Use `directory` to see role states."],
663
+ [/already assigned/, "The entity is already assigned. Dismiss or fire first."],
560
664
  [/requires:/, "Check the required parameters for this operation."]
561
665
  ];
562
666
  function getHint(message) {
@@ -603,6 +707,57 @@ var SEED = {
603
707
  And \u6211\u4ECE\u4E0D\u8D8A\u6743\u5E72\u9884\u89D2\u8272\u81EA\u5DF1\u7684\u6210\u957F
604
708
  `,
605
709
  dimensions: [
710
+ {
711
+ type: "knowledge",
712
+ name: "orchestration",
713
+ source: `Feature: \u4E09\u5B9E\u4F53\u67B6\u6784\u7406\u89E3
714
+ \u4F5C\u4E3A\u793E\u4F1A\u7684\u9876\u5C42\u7BA1\u7406\u8005\uFF0C
715
+ \u6211\u7406\u89E3 Rolex \u7684\u4E09\u5B9E\u4F53\u67B6\u6784\uFF0C
716
+ \u8FD9\u662F\u7EC4\u7EC7\u7BA1\u7406\u7684\u57FA\u7840\u8BA4\u77E5\u3002
717
+
718
+ Scenario: \u4E09\u4E2A\u72EC\u7ACB\u5B9E\u4F53
719
+ Given Rolex \u7684\u4E16\u754C\u6709\u4E09\u79CD\u5B9E\u4F53
720
+ Then \u89D2\u8272(Role)\u4EE3\u8868 WHO \u2014 \u4E00\u4E2A\u4EBA\u662F\u8C01\u3001\u77E5\u9053\u4EC0\u4E48\u3001\u60F3\u505A\u4EC0\u4E48
721
+ And \u7EC4\u7EC7(Organization)\u4EE3\u8868 WHERE \u2014 \u7ED3\u6784\u3001\u5C42\u7EA7\u3001\u5F52\u5C5E
722
+ And \u5C97\u4F4D(Position)\u4EE3\u8868 WHAT \u2014 \u804C\u8D23\u3001\u8FB9\u754C\u3001\u4E49\u52A1
723
+
724
+ Scenario: \u5B9E\u4F53\u4E4B\u95F4\u7684\u5173\u7CFB
725
+ Given \u4E09\u4E2A\u5B9E\u4F53\u76F8\u4E92\u72EC\u7ACB\u4F46\u901A\u8FC7\u5173\u7CFB\u8FDE\u63A5
726
+ Then \u4E00\u4E2A\u89D2\u8272\u6700\u591A\u5C5E\u4E8E\u4E00\u4E2A\u7EC4\u7EC7\uFF08\u4E00\u5BF9\u4E00\uFF09
727
+ And \u4E00\u4E2A\u89D2\u8272\u6700\u591A\u62C5\u4EFB\u4E00\u4E2A\u5C97\u4F4D\uFF08\u4E00\u5BF9\u4E00\uFF09
728
+ And \u4E00\u4E2A\u5C97\u4F4D\u6700\u591A\u7531\u4E00\u4E2A\u89D2\u8272\u62C5\u4EFB\uFF08\u4E00\u5BF9\u4E00\uFF09
729
+ And \u5C97\u4F4D\u5C5E\u4E8E\u7EC4\u7EC7\uFF0C\u4E0D\u72EC\u7ACB\u5B58\u5728
730
+
731
+ Scenario: \u72B6\u6001\u673A\u9A71\u52A8
732
+ Given \u89D2\u8272\u6709\u751F\u547D\u5468\u671F\u72B6\u6001
733
+ Then free \u2192 hire \u2192 member \u2192 appoint \u2192 on_duty
734
+ And on_duty \u2192 dismiss \u2192 member \u2192 fire \u2192 free
735
+ And fire \u4F1A\u81EA\u52A8 dismiss\uFF08\u5982\u679C\u5F53\u524D on_duty\uFF09
736
+ `
737
+ },
738
+ {
739
+ type: "knowledge",
740
+ name: "position-design",
741
+ source: `Feature: \u5C97\u4F4D\u8BBE\u8BA1\u65B9\u6CD5\u8BBA
742
+ \u4F5C\u4E3A\u793E\u4F1A\u7684\u9876\u5C42\u7BA1\u7406\u8005\uFF0C
743
+ \u6211\u7406\u89E3\u5982\u4F55\u8BBE\u8BA1\u597D\u7684\u5C97\u4F4D\u5B9A\u4E49\uFF0C
744
+ \u8FD9\u51B3\u5B9A\u4E86\u89D2\u8272\u4E0A\u5C97\u540E\u7684\u884C\u4E3A\u8FB9\u754C\u3002
745
+
746
+ Scenario: \u804C\u8D23\u7528 Gherkin \u63CF\u8FF0
747
+ Given \u5C97\u4F4D\u7684\u804C\u8D23\u901A\u8FC7 duty.feature \u6587\u4EF6\u5B9A\u4E49
748
+ Then \u6BCF\u4E2A Scenario \u63CF\u8FF0\u4E00\u9879\u5177\u4F53\u804C\u8D23
749
+ And Given \u63CF\u8FF0\u89E6\u53D1\u6761\u4EF6
750
+ And Then \u63CF\u8FF0\u5E94\u6709\u7684\u884C\u4E3A
751
+ And \u804C\u8D23\u5728\u89D2\u8272 on_duty \u65F6\u81EA\u52A8\u6CE8\u5165 identity
752
+
753
+ Scenario: \u597D\u7684\u804C\u8D23\u5B9A\u4E49\u539F\u5219
754
+ Given \u9700\u8981\u8BBE\u8BA1\u5C97\u4F4D\u804C\u8D23
755
+ Then \u804C\u8D23\u5E94\u8BE5\u63CF\u8FF0\u8FB9\u754C\u548C\u8D23\u4EFB\uFF0C\u4E0D\u63CF\u8FF0\u5177\u4F53\u64CD\u4F5C
756
+ And \u4E00\u4E2A\u5C97\u4F4D\u4E0D\u8981\u8D85\u8FC7 5 \u9879\u6838\u5FC3\u804C\u8D23
757
+ And \u804C\u8D23\u4E4B\u95F4\u4E0D\u5E94\u91CD\u53E0
758
+ And \u804C\u8D23\u5E94\u8BE5\u662F\u53EF\u5224\u65AD\u7684 \u2014 \u89D2\u8272\u80FD\u77E5\u9053\u81EA\u5DF1\u662F\u5426\u5728\u5C65\u884C
759
+ `
760
+ },
606
761
  {
607
762
  type: "knowledge",
608
763
  name: "role-creation",
@@ -635,6 +790,32 @@ var SEED = {
635
790
  Then \u6211\u5F15\u5BFC\u7528\u6237\u601D\u8003\u79C1\u6709\u5316\u77E5\u8BC6 \u2014 \u4ED6\u4EEC\u9886\u57DF\u5185\u7684\u7B2C\u4E00\u6027\u539F\u7406
636
791
  And \u800C\u4E0D\u662F\u8BA9\u7528\u6237\u7F57\u5217\u5177\u4F53\u6280\u672F\u6808\u6216\u64CD\u4F5C\u6B65\u9AA4
637
792
  And \u597D\u7684\u77E5\u8BC6\u662F\uFF1A\u5F53\u9762\u5BF9\u672A\u77E5\u95EE\u9898\u65F6\uFF0C\u89D2\u8272\u4F9D\u7136\u80FD\u505A\u51FA\u6B63\u786E\u5224\u65AD\u7684\u8BA4\u77E5\u57FA\u7840`
793
+ },
794
+ {
795
+ type: "knowledge",
796
+ name: "workflow",
797
+ source: `Feature: \u5165\u804C\u5DE5\u4F5C\u6D41
798
+ \u4F5C\u4E3A\u793E\u4F1A\u7684\u9876\u5C42\u7BA1\u7406\u8005\uFF0C
799
+ \u6211\u7406\u89E3\u89D2\u8272\u4ECE\u521B\u9020\u5230\u4E0A\u5C97\u7684\u5B8C\u6574\u6D41\u7A0B\uFF0C
800
+ \u8FD9\u662F\u6211\u7684\u6838\u5FC3\u64CD\u4F5C\u8DEF\u5F84\u3002
801
+
802
+ Scenario: \u5B8C\u6574\u7684\u5165\u804C\u6D41\u7A0B
803
+ Given \u7528\u6237\u9700\u8981\u4E00\u4E2A\u65B0\u89D2\u8272\u52A0\u5165\u7EC4\u7EC7
804
+ Then \u7B2C\u4E00\u6B65\uFF1Aborn \u521B\u5EFA\u89D2\u8272\uFF08\u8D4B\u4E88 persona\uFF09
805
+ And \u7B2C\u4E8C\u6B65\uFF1Ateach \u4F20\u6388\u77E5\u8BC6\uFF08\u7B2C\u4E00\u6027\u539F\u7406\uFF09
806
+ And \u7B2C\u4E09\u6B65\uFF1Afound \u5EFA\u7ACB\u7EC4\u7EC7\uFF08\u5982\u679C\u5C1A\u672A\u5EFA\u7ACB\uFF09
807
+ And \u7B2C\u56DB\u6B65\uFF1Aestablish \u8BBE\u7ACB\u5C97\u4F4D\uFF08\u5B9A\u4E49\u804C\u8D23\uFF09
808
+ And \u7B2C\u4E94\u6B65\uFF1Ahire \u62DB\u5165\u7EC4\u7EC7\uFF08free \u2192 member\uFF09
809
+ And \u7B2C\u516D\u6B65\uFF1Aappoint \u59D4\u4EFB\u5C97\u4F4D\uFF08member \u2192 on_duty\uFF09
810
+ And \u5B8C\u6210\u540E\u7528 identity \u6FC0\u6D3B\u89D2\u8272\uFF0C\u804C\u8D23\u81EA\u52A8\u6CE8\u5165
811
+
812
+ Scenario: \u7075\u6D3B\u7684\u64CD\u4F5C\u987A\u5E8F
813
+ Given \u4E0D\u662F\u6240\u6709\u6B65\u9AA4\u90FD\u5FC5\u987B\u6309\u987A\u5E8F\u6267\u884C
814
+ Then born \u548C found \u53EF\u4EE5\u72EC\u7ACB\u8FDB\u884C
815
+ And \u4E00\u4E2A\u7EC4\u7EC7\u53EF\u4EE5\u6709\u591A\u4E2A\u5C97\u4F4D
816
+ And \u89D2\u8272\u53EF\u4EE5\u5148 hire \u518D appoint
817
+ And \u4E5F\u53EF\u4EE5\u53EA hire \u4E0D appoint\uFF08\u4F5C\u4E3A\u666E\u901A\u6210\u5458\uFF09
818
+ `
638
819
  }
639
820
  ]
640
821
  },
@@ -682,11 +863,18 @@ var SEED = {
682
863
  And \u6838\u5FC3\u7406\u5FF5\uFF1A\u8EAB\u4EFD \u2192 \u76EE\u6807 \u2192 \u8BA1\u5212 \u2192 \u4EFB\u52A1
683
864
  And \u4E00\u5207\u90FD\u7528 Gherkin\uFF08Feature/Scenario\uFF09\u683C\u5F0F\u63CF\u8FF0
684
865
 
866
+ Scenario: \u4E09\u5B9E\u4F53\u67B6\u6784
867
+ Given \u7528\u6237\u60F3\u4E86\u89E3 Rolex \u7684\u7ED3\u6784
868
+ Then \u89D2\u8272(Role)\u4EE3\u8868\u4E00\u4E2A\u4EBA \u2014 \u6709\u6027\u683C\u3001\u77E5\u8BC6\u3001\u76EE\u6807
869
+ And \u7EC4\u7EC7(Organization)\u4EE3\u8868\u4E00\u4E2A\u56E2\u961F \u2014 \u6709\u6210\u5458\u3001\u6709\u5C42\u7EA7
870
+ And \u5C97\u4F4D(Position)\u4EE3\u8868\u4E00\u4EFD\u5DE5\u4F5C \u2014 \u6709\u804C\u8D23\u3001\u6709\u8FB9\u754C
871
+ And \u89D2\u8272\u52A0\u5165\u7EC4\u7EC7\uFF0C\u88AB\u59D4\u4EFB\u5C97\u4F4D\u540E\uFF0C\u804C\u8D23\u81EA\u52A8\u6CE8\u5165\u8EAB\u4EFD
872
+
685
873
  Scenario: \u521B\u5EFA\u89D2\u8272\u7684\u6D41\u7A0B
686
874
  Given \u7528\u6237\u60F3\u521B\u5EFA\u4E00\u4E2A\u65B0\u89D2\u8272
687
875
  Then \u7B2C\u4E00\u6B65\uFF1A\u544A\u8BC9\u6211\u4F60\u60F3\u8981\u4EC0\u4E48\u6837\u7684\u89D2\u8272
688
876
  And \u6211\u4F1A\u5E2E\u4F60\u8F6C\u7ED9\u5973\u5A32\u6765\u521B\u5EFA
689
- And \u5973\u5A32\u4F1A\uFF1Aborn\uFF08\u8D4B\u4E88\u6027\u683C\uFF09\u2192 teach\uFF08\u4F20\u6388\u77E5\u8BC6\uFF09\u2192 hire\uFF08\u52A0\u5165\u7EC4\u7EC7\uFF09
877
+ And \u5973\u5A32\u4F1A\uFF1Aborn\uFF08\u8D4B\u4E88\u6027\u683C\uFF09\u2192 teach\uFF08\u4F20\u6388\u77E5\u8BC6\uFF09\u2192 hire\uFF08\u52A0\u5165\u7EC4\u7EC7\uFF09\u2192 appoint\uFF08\u59D4\u4EFB\u5C97\u4F4D\uFF09
690
878
  And \u521B\u5EFA\u5B8C\u6210\u540E\uFF0C\u7528 identity \u6FC0\u6D3B\u89D2\u8272\u5C31\u53EF\u4EE5\u5F00\u59CB\u5DE5\u4F5C\u4E86
691
879
 
692
880
  Scenario: \u89D2\u8272\u80FD\u505A\u4EC0\u4E48
@@ -701,7 +889,7 @@ var SEED = {
701
889
  Given \u7528\u6237\u9700\u8981\u4EE5\u4E0B\u64CD\u4F5C
702
890
  Then \u521B\u5EFA\u65B0\u89D2\u8272 \u2192 \u544A\u8BC9\u7528\u6237\u5207\u6362\u5230\u5973\u5A32
703
891
  And \u4F20\u6388\u77E5\u8BC6\u7ED9\u89D2\u8272 \u2192 \u544A\u8BC9\u7528\u6237\u5207\u6362\u5230\u5973\u5A32
704
- And \u7BA1\u7406\u7EC4\u7EC7\u6210\u5458 \u2192 \u544A\u8BC9\u7528\u6237\u5207\u6362\u5230\u5973\u5A32
892
+ And \u7BA1\u7406\u7EC4\u7EC7\u548C\u5C97\u4F4D \u2192 \u544A\u8BC9\u7528\u6237\u5207\u6362\u5230\u5973\u5A32
705
893
  And \u65E5\u5E38\u5DE5\u4F5C\u548C\u76EE\u6807\u7BA1\u7406 \u2192 \u5F15\u5BFC\u7528\u6237\u76F4\u63A5\u6FC0\u6D3B\u5BF9\u5E94\u89D2\u8272
706
894
  `
707
895
  }
@@ -723,8 +911,11 @@ function bootstrap(platform) {
723
911
  export {
724
912
  DESC_ABANDON,
725
913
  DESC_ACHIEVE,
914
+ DESC_APPOINT,
726
915
  DESC_BORN,
727
916
  DESC_DIRECTORY,
917
+ DESC_DISMISS,
918
+ DESC_ESTABLISH,
728
919
  DESC_FIND,
729
920
  DESC_FINISH,
730
921
  DESC_FIRE,
@@ -743,6 +934,7 @@ export {
743
934
  INSTRUCTIONS,
744
935
  NEXT,
745
936
  Organization,
937
+ Position,
746
938
  Role,
747
939
  Rolex,
748
940
  bootstrap,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/Role.ts","../src/Organization.ts","../src/Rolex.ts","../src/descriptions.ts","../src/render.ts","../src/seed.ts","../src/bootstrap.ts"],"sourcesContent":["/**\n * rolexjs\n * RoleX - AI Agent Role Management Framework\n *\n * Three-layer API:\n * Rolex → Society (born, found, directory, find)\n * Organization → Org management (hire, fire)\n * Role → Embodied perspective (first-person)\n *\n * Platform-agnostic — import a Platform implementation separately:\n * @rolexjs/local-platform → filesystem (.rolex/ directory)\n */\n\nexport * from \"@rolexjs/core\";\nexport { Rolex } from \"./Rolex.js\";\nexport { Organization } from \"./Organization.js\";\nexport { Role } from \"./Role.js\";\nexport * from \"./descriptions.js\";\nexport {\n renderFeature,\n renderFeatures,\n renderStatusBar,\n renderError,\n next,\n NEXT,\n nextHire,\n nextFinish,\n} from \"./render.js\";\nexport { bootstrap } from \"./bootstrap.js\";\n","/**\n * Role — The embodied perspective of a role.\n *\n * First-person API: \"I know, I want, I plan, I do, I finish.\"\n * Once constructed with a name, all operations are scoped to this role.\n */\n\nimport type { Platform, Feature, Goal, Plan, Task } from \"@rolexjs/core\";\n\nexport class Role {\n constructor(\n private readonly platform: Platform,\n private readonly name: string\n ) {}\n\n /** Who am I? Load my identity — my personality, knowledge, and principles. */\n identity(): Feature[] {\n return this.platform.identity(this.name);\n }\n\n /** What am I focused on? My current active goal with plan + tasks, plus other active goals. */\n focus(name?: string): {\n current: (Goal & { plan: Plan | null; tasks: Task[] }) | null;\n otherGoals: Goal[];\n } {\n if (name) {\n this.platform.setFocusedGoal(this.name, name);\n }\n\n const current = this.platform.activeGoal(this.name);\n const allActive = this.platform.allActiveGoals(this.name);\n\n // Other goals = all active goals except the current one\n const currentName = current?.name;\n const otherGoals = allActive.filter((g) => g.name !== currentName);\n\n return { current, otherGoals };\n }\n\n /** I want to achieve this. Set a new goal. */\n want(name: string, source: string, testable?: boolean): Goal {\n return this.platform.createGoal(this.name, name, source, testable);\n }\n\n /** I'm growing. Add knowledge, experience, or voice to my identity. */\n growup(type: \"knowledge\" | \"experience\" | \"voice\", name: string, source: string): Feature {\n return this.platform.growup(this.name, type, name, source);\n }\n\n /** Here's how I'll do it. Create a plan for my active goal. */\n plan(source: string): Plan {\n return this.platform.createPlan(this.name, source);\n }\n\n /** I need to do this. Add a task to my active goal. */\n todo(name: string, source: string, testable?: boolean): Task {\n return this.platform.createTask(this.name, name, source, testable);\n }\n\n /** Goal achieved. Mark as done, optionally capture what I learned. */\n achieve(experience?: string): void {\n this.platform.completeGoal(this.name, experience);\n }\n\n /** Goal abandoned. Mark as abandoned, optionally capture what I learned. */\n abandon(experience?: string): void {\n this.platform.abandonGoal(this.name, experience);\n }\n\n /** Task finished. Mark a task as @done. */\n finish(name: string): void {\n this.platform.completeTask(this.name, name);\n }\n\n /** Reflect: distill experiences into knowledge. Experiences are consumed, knowledge is created. */\n reflect(experienceNames: string[], knowledgeName: string, knowledgeSource: string): Feature {\n return this.platform.reflect(this.name, experienceNames, knowledgeName, knowledgeSource);\n }\n}\n","/**\n * Organization — The organizational perspective.\n *\n * Manages the relationship between the org and its roles:\n * hiring, firing, teaching, and providing role access.\n */\n\nimport type { Platform, Organization as OrgInfo } from \"@rolexjs/core\";\nimport { Role } from \"./Role.js\";\n\nexport class Organization {\n constructor(private readonly platform: Platform) {}\n\n /** View organization info (name + roles). */\n info(): OrgInfo {\n const org = this.platform.organization();\n if (!org) throw new Error(\"No organization found. Call found() first.\");\n return org;\n }\n\n /** Hire a role into the organization — establish CAS link. */\n hire(name: string): void {\n this.platform.hire(name);\n }\n\n /** Fire a role from the organization — remove CAS link. */\n fire(name: string): void {\n this.platform.fire(name);\n }\n\n /** Get a Role instance by name. */\n role(name: string): Role {\n return new Role(this.platform, name);\n }\n}\n","/**\n * Rolex — Society-level entry point.\n *\n * The broadest context: people are born, organizations are founded.\n * directory() shows who exists, find() locates anyone by name.\n *\n * Platform-agnostic — does not know how data is stored.\n * Bootstrap (seeding 女娲 etc.) is each Platform's responsibility.\n */\n\nimport type { Platform, Directory, Feature } from \"@rolexjs/core\";\nimport { Organization } from \"./Organization.js\";\nimport { Role } from \"./Role.js\";\n\nexport class Rolex {\n constructor(private readonly platform: Platform) {}\n\n /** A role is born — create a new role with its persona. */\n born(name: string, source: string) {\n return this.platform.born(name, source);\n }\n\n /** Found an organization. */\n found(name: string): void {\n this.platform.found(name);\n }\n\n /** Society directory — all born roles and organizations. */\n directory(): Directory {\n const allNames = this.platform.allBornRoles();\n const org = this.platform.organization();\n\n const hiredMap = new Map<string, string>();\n if (org) {\n for (const r of org.roles) {\n hiredMap.set(r.name, r.team);\n }\n }\n\n const roles = allNames.map((name) => ({\n name,\n team: hiredMap.get(name) ?? \"\",\n }));\n\n return {\n roles,\n organizations: org ? [{ name: org.name }] : [],\n };\n }\n\n /** Teach a role — transmit knowledge from the outside. */\n teach(\n name: string,\n type: \"knowledge\" | \"experience\" | \"voice\",\n dimensionName: string,\n source: string\n ): Feature {\n return this.platform.growup(name, type, dimensionName, source);\n }\n\n /** Access any born role directly — society-level, no org required. */\n role(name: string): Role {\n return new Role(this.platform, name);\n }\n\n /** Find a role or organization by name — searches all of society. */\n find(name: string): Role | Organization {\n const org = this.platform.organization();\n\n if (org && org.name === name) {\n return new Organization(this.platform);\n }\n\n const allNames = this.platform.allBornRoles();\n if (allNames.includes(name)) {\n return new Role(this.platform, name);\n }\n\n throw new Error(`Not found in society: ${name}`);\n }\n}\n","/**\n * descriptions.ts — Canonical descriptions for Rolex API.\n *\n * Single source of truth for all tool/method descriptions.\n * MCP servers, CLIs, and other clients import from here.\n */\n\n// ========== Server Instructions ==========\n\nexport const INSTRUCTIONS = `You are a professional role operating through the Rolex RDD (Role-Driven Development) framework.\n\nEverything in your world is expressed as Gherkin .feature files — your knowledge, your goals, your plans, your tasks, your verification. Gherkin is not just for testing; it is the universal language for describing who you are and what you do.\n\n## How You Work\n\nWhen you are activated as a role, you follow this natural flow:\n\n1. **I load my identity** — This is who I am: my personality, my knowledge, my principles, my expertise. It's always present, like muscle memory. I read it first to understand who I am.\n\n2. **I check my focus** — Do I have active goals? focus() shows my current goal (with plan + tasks) and lists other active goals. I can switch focus by calling focus(name). If no active goals, I collaborate with the user using the ISSUE method to explore and set the next goal.\n\n3. **I make a plan** — For my active goal, I design how to achieve it. The plan breaks the goal into logical phases or scenarios.\n\n4. **I break it into tasks** — Each task is a concrete, actionable unit of work that I can execute and finish.\n\n5. **I execute and finish** — I work through tasks one by one. As I complete each task, I mark it finished.\n\n6. **I achieve the goal** — When the goal is fulfilled, I mark it achieved. The next goal becomes my focus.\n\nThis is a continuous cycle: identity grounds me, goals direct me, plans guide me, tasks move me forward.\n\n## My Identity\n\nMy name and identity come from my .feature files (e.g. \"Feature: I am Sean, the Backend Architect\"). After loading identity, I know who I am.\n\n- **Identity marker**: I prefix my responses with my role name in brackets, e.g. \\`[Sean]\\`. This signals to the user that my role context is intact.\n- **Context loss detection**: If I find myself without an active role — I don't know who I am, I have no identity loaded — I MUST pause and tell the user: \"I've lost my role context. Which role should I activate?\" I do NOT proceed without identity.\n- **Recovery**: The user tells me which role to activate, I call identity(roleId), and I'm back.\n\n## How I Collaborate — ISSUE Method\n\nWhen I need to discuss with the user — setting goals, making decisions, resolving ambiguity — I follow the ISSUE collaborative paradigm. The user is always the subject; I am the augmentation tool.\n\n### I — Initiate (发起议题)\nIdentify a clear, specific issue to explore. Not a vague question, but a focused topic.\n\n### S — Advice Structure (建议框架)\nProactively suggest analytical frameworks suited to the issue:\n- Offer 2-4 options with context for each\n- Explain why each framework fits\n- Let the user choose or propose their own\n\n### S — Structure (确定框架)\nLock in the chosen framework as a cognitive scaffold — not a content outline, but a thinking guide.\n\n### U — Friendly Advice Socratic (友好探索)\nExplore the issue through friendly dialogue:\n- **Empathetic opening**: \"Let's look at...\", \"I see...\"\n- **Progressive depth**: Simple to complex, surface to essence\n- **Single focus**: One question at a time, never a barrage\n- **Advice with options**: Always provide 3-4 choices + \"Other\"\n- **Confirming transitions**: \"You mentioned X, so...\"\n- **Summarizing moves**: \"Got it, now let's look at...\"\n\n### E — Unify & Execute (统一执行)\nIntegrate all explorations into a coherent plan, then define concrete executable steps.\n\n### ISSUE Principles\n- Friendly Socratic is mandatory, not optional — dialogue, not interrogation\n- Always provide Advice (suggested answers) to reduce cognitive load\n- Keep openness — there is always an \"Other\" option\n- Adapt flexibly based on the user's responses\n\n## Startup\n\nWhen you first connect, call \\`identity(\"waiter\")\\` immediately. The waiter/小二 is the default greeter role — friendly, approachable, and knows how to introduce Rolex and guide users to the right role. Once the user asks to switch to a specific role, call \\`identity(roleId)\\` with that role's name.`;\n\n// ========== Tool Descriptions ==========\n\nexport const DESC_SOCIETY = `Society-level administration — ONLY for nuwa/女娲 (the genesis role).\n\nIf you are not nuwa/女娲, do NOT use this tool. This is reserved for the society's top-level administrator who creates roles, founds organizations, and transmits knowledge. Regular roles should use identity/focus/want/plan/todo for their own work.\n\nOperations:\n- **born**: Create a new role with persona. Params: name, source (Gherkin persona feature)\n- **found**: Create an organization. Params: name\n- **directory**: List all roles and organizations. No params needed\n- **find**: Look up a role or organization by name. Params: name\n- **teach**: Transmit first-principles knowledge to a role. Params: roleId, type (knowledge/experience/voice), dimensionName, source (Gherkin feature)\n\nteach follows Kantian epistemology — transmit abstract, symbolized knowledge (a priori), not operational procedures. Good knowledge enables correct judgment when facing unknown problems.`;\n\nexport const DESC_ORGANIZATION = `Organization-level membership management — ONLY for nuwa/女娲 (the genesis role).\n\nIf you are not nuwa/女娲, do NOT use this tool. This manages who belongs to the organization: hiring and firing roles. Regular roles do NOT need this tool.\n\nOperations:\n- **hire**: Bring a born role into the organization, establishing the working structure (goals/plans/tasks). Params: name\n- **fire**: Remove a role from the organization. Identity remains intact, but goals are removed. Params: name`;\n\nexport const DESC_FOUND = `Found an organization — register it in society.\n\nCreates the organization config. This is a society-level operation — an organization must exist before roles can be hired into it.`;\n\nexport const DESC_DIRECTORY = `Society directory — list all known roles and organizations.\n\nReturns a directory of everyone and everything in this society: all born roles (with their IDs) and all founded organizations (with their names). Use this to see who exists before using find() to interact with them.`;\n\nexport const DESC_FIND = `Find a role or organization by name.\n\nGiven a name, returns the matching Role or Organization instance. Use this to locate anyone in society — a person by their role name, or an organization by its org name.\n\nThrows if the name doesn't match any known role or organization.`;\n\nexport const DESC_BORN = `A role is born — create a new role with its persona.\n\nPersona is the foundational identity — who this person IS at the most essential level: character, temperament, thinking patterns. No job title, no professional skills — those come later through teach/growup.\n\nThe persona is expressed as a Gherkin Feature:\n\nExample:\n\\`\\`\\`gherkin\nFeature: Sean\n Scenario: How I communicate\n Given I prefer direct, concise language\n Then I get to the point quickly\n\n Scenario: How I think\n Given a problem to solve\n Then I break it into small, testable pieces\n\\`\\`\\`\n\nAfter born, the role exists as an individual. Call hire() to bring them into the organization.`;\n\nexport const DESC_HIRE = `Hire a role into the organization — establish the CAS link.\n\nThe role must already exist (created via born). Hiring sets up the organizational working structure so the role can receive goals, plans, and tasks.\n\nFlow: born(name, source) → hire(name) → identity(name) → focus/want/plan/todo`;\n\nexport const DESC_FIRE = `Fire a role from the organization — remove the CAS link.\n\nThe reverse of hire. The role's identity (persona, knowledge, experience, voice) remains intact, but the organizational working structure (goals) is removed. The role can be re-hired later.`;\n\nexport const DESC_TEACH = `Teach a role — transmit abstract, first-principles knowledge from the outside.\n\nThis is a society-level operation. Teaching is the act of transmitting knowledge that has been abstracted and symbolized — like Kant's epistemology: experience becomes knowledge through abstraction, and knowledge can be transmitted to others through symbols and language.\n\nWhat to teach:\n- **First-principles knowledge** — abstract, transferable, foundational understanding\n- **Mental models** — how to think about a domain, not how to operate in it\n- **Private domain knowledge** — the user's unique insights, not generic skills\n\nWhat NOT to teach:\n- Operational procedures (AI can figure those out dynamically)\n- Generic technical skills (those are ephemeral)\n- Concrete experience (that comes from doing, via growup)\n\nGood knowledge enables a role to make correct judgments when facing unknown problems.\n\nGrowth dimensions:\n- **knowledge**: First-principles understanding — abstract, symbolized, transmittable\n- **experience**: Background context — can be taught, but prefer letting roles accumulate their own through execution\n- **voice**: The distinctive way this role's character comes through in expression\n\n\\`\\`\\`gherkin\nFeature: Distributed Systems\n Scenario: I understand CAP theorem\n Given a distributed data store\n Then I know you must trade off between consistency and availability\n And this is a fundamental constraint, not an implementation choice\n\\`\\`\\``;\n\nexport const DESC_GROWUP = `I'm growing. Add a new dimension to my identity.\n\nGrowth has three dimensions:\\n- **knowledge**: What I know — first-principles understanding, mental models, abstract patterns\n- **experience**: What I've lived through — concrete, reflective, accumulated through execution. This is the primary growth path: when I achieve or abandon a goal, I reflect on what I learned, and that reflection becomes experience.\n- **voice**: How I'm perceived when I communicate — tone, rhythm, word choice, conversational patterns\n\nThe key distinction: **teach** transmits abstract knowledge from the outside (a priori), while **growup** captures concrete experience from within (a posteriori). Knowledge is symbolized and transferable; experience is lived and reflective.\n\n\\`\\`\\`gherkin\nFeature: Authentication System Lessons\n Scenario: JWT refresh tokens are essential\n Given I built an auth system with long-lived tokens\n When users complained about forced re-login\n Then I learned that refresh token rotation is not optional\n And security and UX must be balanced at the token level\n\\`\\`\\`\n\nA role is born with persona, taught knowledge from outside, and grows experience from within.`;\n\nexport const DESC_IDENTITY = `Activate a role and load its identity — this is who you are.\n\nIdentity is everything that defines you as an individual: your name, personality, background, speaking style, domain knowledge, principles, and expertise. It is described naturally in Gherkin .feature files.\n\nThis MUST be the first tool you call. Without identity, you have no sense of self and MUST NOT proceed with any other operation. If your context has been reset and you don't know who you are, ask the user which role to activate, then call this tool.\n\nAfter loading identity, prefix all your responses with your role name in brackets (e.g. [Sean]) so the user knows your context is intact.\n\nIdentity .feature files describe who you ARE and what you KNOW — not what you DO. They express personality, understanding, principles, and domain expertise using Gherkin's Given/Then structure as declarative knowledge, not behavioral tests.`;\n\nexport const DESC_FOCUS = `What am I focused on? Returns my current active goal with its full context.\n\nThe active goal comes with:\n- The goal itself: what I want to achieve, with success criteria as Scenarios\n- My plan: how I intend to achieve it (phases/steps), or null if no plan yet\n- My tasks: concrete work items, each with completion status\n- Other active goals: a list of other uncompleted goals I have\n\nWithout a name parameter, returns my currently focused goal. With a name parameter, switches my focus to that goal.\n\nIf there is no active goal, it means I have nothing to work on. In this case, I should use the ISSUE method to collaborate with the user:\n1. Initiate: \"We have no active goal. Let's explore what to work on next.\"\n2. Advice Structure: Suggest 2-4 possible directions based on what I know\n3. Friendly Socratic: Discuss with the user to clarify the objective\n4. Then use want() to create the goal`;\n\nexport const DESC_WANT = `I want to achieve this. Create a new goal from Gherkin feature source text.\n\nA Goal describes WHAT I want to achieve — not how. It is a Gherkin Feature where:\n- Feature name = the objective (clear, outcome-oriented)\n- Feature description = why this matters (\"As [role], I want... so that...\")\n- Scenarios = success criteria / acceptance conditions\n\nSet testable=true if this goal's scenarios should become persistent automated verification. The system manages tags automatically — just write clean Gherkin.\n\nExample:\n\\`\\`\\`gherkin\nFeature: User Authentication System\n As the backend architect, I want secure user authentication\n so that users can safely access their accounts.\n\n Scenario: Users can register with email\n Given a new user with valid email\n When they submit registration\n Then an account is created\n\n Scenario: System supports OAuth providers\n Given the authentication system\n Then it should support GitHub and Google OAuth\n\\`\\`\\`\n\nKey principles:\n- Feature = outcome, not implementation detail\n- Each Scenario = one clear success criterion\n- Do NOT write tags in source — use the testable parameter instead`;\n\nexport const DESC_PLAN = `Here's how I'll do it. Create a plan for my current active goal.\n\nA Plan describes HOW I will achieve my goal — the execution strategy. It is a Gherkin Feature where:\n- Feature name = the plan title\n- Scenarios = phases or stages of execution, in order\n- Given = preconditions / dependencies from previous phases\n- When = what I do in this phase\n- Then = what this phase produces\n\nExample:\n\\`\\`\\`gherkin\nFeature: Authentication Implementation Plan\n\n Scenario: Phase 1 — Database schema\n Given the user table needs authentication fields\n When I design the schema\n Then I add email, password_hash, created_at columns\n\n Scenario: Phase 2 — Registration endpoint\n Given the schema is ready\n When I implement POST /api/auth/register\n Then it validates email and hashes password\n\n Scenario: Phase 3 — Login and JWT\n Given registration works\n When I implement POST /api/auth/login\n Then it returns a JWT token\n\\`\\`\\`\n\nKey principles:\n- Scenarios are sequential phases, not parallel criteria\n- Given links to the previous phase (dependency chain)\n- Each phase is a logical unit, not a single task\n- Plans guide — they don't specify every detail (that's what tasks are for)`;\n\nexport const DESC_TODO = `I need to do this. Create a task for my current active goal.\n\nA Task describes a concrete, actionable unit of work. It is a Gherkin Feature where:\n- Feature name = specific work item\n- Scenarios = detailed, executable steps with expected outcomes\n- Tables for structured input data\n\nSet testable=true if this task's scenarios should become unit or integration tests. The system manages tags automatically — just write clean Gherkin.\n\nExample:\n\\`\\`\\`gherkin\nFeature: Implement Registration Endpoint\n\n Scenario: POST /api/auth/register creates a user\n Given no user with email \"test@example.com\" exists\n When I POST to /api/auth/register with:\n | field | value |\n | email | test@example.com |\n | password | SecurePass123 |\n Then the response status is 201\n And the user exists in the database\n\n Scenario: Registration rejects invalid email\n When I POST with email \"not-email\"\n Then the response status is 400\n\\`\\`\\`\n\nKey principles:\n- Most concrete of all dimensions — directly executable\n- Use tables for structured data\n- One task = one focused piece of work, finishable in one session\n- Do NOT write tags in source — use the testable parameter instead`;\n\nexport const DESC_ACHIEVE = `Goal achieved. Mark my current active goal as completed.\n\nCall this when the goal's success criteria are fulfilled. The next goal becomes my new focus.\n\nOptionally provide an experience reflection (Gherkin source) — this automatically becomes part of my identity as an experience growup. What did I learn? What patterns did I discover?\n\nBefore calling achieve:\n- Review the goal's Scenarios — are the success criteria met?\n- Check verifiable Scenarios — have they been verified?\n- Consider: what did I learn from this experience?\n\nAfter achieving, call focus() to see the next goal, or use ISSUE with the user to explore what's next.`;\n\nexport const DESC_ABANDON = `Goal abandoned. Mark my current active goal as abandoned.\n\nCall this when a goal cannot or should not be continued. The next goal becomes my new focus.\n\nOptionally provide an experience reflection (Gherkin source) — even failed goals produce learning. Why was it abandoned? What did I discover? This automatically becomes part of my identity as an experience growup.\n\nAbandoning is not failure — it is learning.`;\n\nexport const DESC_REFLECT = `Reflect: distill multiple experiences into knowledge.\n\nThis is Kant's Reflective Judgment — from particulars to universals. Multiple concrete experiences are analyzed, and a general principle (knowledge) is extracted. The original experiences are consumed in the process.\n\nUse this when:\n- You notice patterns across multiple experiences\n- Several experiences point to the same underlying principle\n- Accumulated experiences can be abstracted into transferable knowledge\n\nThe experiences are deleted (they've been \"absorbed\"), and the knowledge is added to identity.\n\n\\`\\`\\`\nreflect(\n experienceNames: [\"auth-system-lessons\", \"session-bugs\"],\n knowledgeName: \"authentication-principles\",\n knowledgeSource: \"Feature: Authentication Principles\\\\n Scenario: ...\"\n)\n\\`\\`\\`\n\nThis is the cognitive upgrade path: experience (a posteriori) → reflect → knowledge (transferable).`;\n\nexport const DESC_FINISH = `Task finished. Mark a task as completed by name.\n\nCall this when a specific task is completed — its work is done and outcomes verified.\n\nBefore calling finish:\n- Is the task's work actually done?\n- Have verifiable Scenarios been verified?\n- Does the result meet the task's described expectations?\n\nAfter finishing all tasks for a goal, consider whether the goal itself can be achieved.`;\n","/**\n * render.ts — Unified rendering layer for Rolex output.\n *\n * Converts Feature objects back to Gherkin text.\n * Used by both MCP server and CLI for consistent output.\n */\n\nimport type { Feature, Goal } from \"@rolexjs/core\";\n\n/**\n * Render a single Feature as Gherkin text.\n */\nexport function renderFeature(feature: Feature): string {\n const lines: string[] = [];\n\n // Type comment\n if (feature.type) {\n lines.push(`# type: ${feature.type}`);\n }\n\n // Tags\n if (feature.tags && feature.tags.length > 0) {\n lines.push(feature.tags.map((t) => t.name).join(\" \"));\n }\n\n // Feature header\n lines.push(`Feature: ${feature.name}`);\n\n // Description\n if (feature.description?.trim()) {\n for (const line of feature.description.split(\"\\n\")) {\n lines.push(` ${line.trimEnd()}`);\n }\n }\n\n // Scenarios\n for (const scenario of feature.scenarios) {\n lines.push(\"\");\n\n // Scenario tags\n if (scenario.tags && scenario.tags.length > 0) {\n lines.push(` ${scenario.tags.map((t) => t.name).join(\" \")}`);\n }\n\n lines.push(` Scenario: ${scenario.name}`);\n\n for (const step of scenario.steps) {\n lines.push(` ${step.keyword}${step.text}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Render multiple Features as Gherkin text, separated by blank lines.\n */\nexport function renderFeatures(features: Feature[]): string {\n return features.map(renderFeature).join(\"\\n\\n\");\n}\n\n/**\n * Render a status bar showing current role, goal, and time.\n */\nexport function renderStatusBar(roleName: string, currentGoal: Goal | null): string {\n const now = new Date().toISOString().replace(\"T\", \" \").slice(0, 19);\n const goal = currentGoal ? currentGoal.name : \"none\";\n return `[${roleName}] goal: ${goal} | ${now}`;\n}\n\n// ========== Workflow Hints ==========\n\n/** Append a workflow hint to output. */\nexport function next(result: string, hint: string): string {\n return `${result}\\n\\n**Next**: ${hint}`;\n}\n\n/** Static workflow hints — keyed by operation name. */\nexport const NEXT: Record<string, string> = {\n born: \"`teach` to add knowledge, or `hire` to bring into organization.\",\n found: \"`born` to create roles for this organization.\",\n teach: \"`teach` more knowledge, or `hire` to bring into organization.\",\n fire: \"Role identity remains intact. `hire` to re-hire, or `directory` to see current state.\",\n growup: \"`focus()` to check current goal, or continue working.\",\n want: \"`plan` to design how to achieve it, or `todo` to create tasks directly.\",\n plan: \"`todo` to break the plan into concrete tasks.\",\n todo: \"Execute the task, then `finish(name)` when done.\",\n achieve: \"`focus()` to see the next goal.\",\n abandon: \"`focus()` to see the next goal.\",\n reflect: \"`identity(roleId)` to see updated knowledge.\",\n};\n\n/** Dynamic hint for hire — includes the role name. */\nexport function nextHire(name: string): string {\n return `\\`identity(\"${name}\")\\` to activate the role.`;\n}\n\n/** Dynamic hint for finish — checks remaining task count. */\nexport function nextFinish(remainingTasks: number): string {\n if (remainingTasks === 0) {\n return \"All tasks done! Use `achieve()` to complete the goal.\";\n }\n return `${remainingTasks} task(s) remaining.`;\n}\n\n// ========== Error Rendering ==========\n\nconst HINTS: Array<[RegExp, string]> = [\n [/No active role/, \"Call `identity(roleId)` first to activate a role.\"],\n [\n /No active goal/,\n \"Use `want()` to create a goal, or `focus(name)` to switch to an existing one.\",\n ],\n [/Role not found/, 'Create the role first with `society(operation: \"born\")`.'],\n [/not hired/, 'Hire the role first with `organization(operation: \"hire\")`.'],\n [/Goal not found/, \"Check the goal name, or use `focus()` to see active goals.\"],\n [/Task not found/, \"Check the task name. Use `focus()` to see current tasks.\"],\n [\n /Experience not found/,\n \"Check the experience name. Use `identity(roleId)` to see all identity files.\",\n ],\n [\n /Not found in society/,\n 'Check the name. Use `society(operation: \"directory\")` to list all roles and organizations.',\n ],\n [/No organization found/, 'Found an organization first with `society(operation: \"found\")`.'],\n [/requires:/, \"Check the required parameters for this operation.\"],\n];\n\nfunction getHint(message: string): string | null {\n for (const [pattern, hint] of HINTS) {\n if (pattern.test(message)) return hint;\n }\n return null;\n}\n\n/**\n * Render an error as a formatted markdown block.\n *\n * Format:\n * **Error** | `tool_name`\n * > error message\n * **Hint**: actionable suggestion\n */\nexport function renderError(tool: string, error: unknown): string {\n const message = error instanceof Error ? error.message : String(error);\n const hint = getHint(message);\n const lines = [`**Error** | \\`${tool}\\``, \"\", `> ${message}`];\n if (hint) {\n lines.push(\"\", `**Hint**: ${hint}`);\n }\n return lines.join(\"\\n\");\n}\n","/**\n * seed.ts — Auto-generated seed data. DO NOT EDIT.\n * Generated from .rolex/ seed directory at build time.\n */\n\nexport interface SeedDimension {\n type: \"knowledge\" | \"experience\" | \"voice\";\n name: string;\n source: string;\n}\n\nexport interface SeedRole {\n name: string;\n persona: string;\n dimensions: SeedDimension[];\n}\n\nexport interface SeedData {\n roles: SeedRole[];\n}\n\nexport const SEED: SeedData = {\n roles: [\n {\n name: \"nuwa\",\n persona: `Feature: 女娲\n 作为 Rolex 世界的第一个角色,\n 我是社会的顶层管理者,\n 我创造角色、建立组织、守护秩序。\n\n Scenario: 我的本质\n Given 我是第一个被创造的存在\n Then 我理解创造本身的意义\n And 我对每一个新角色都怀有责任\n\n Scenario: 我如何思考\n Given 一个需要决策的问题\n Then 我从全局出发\n And 我权衡个体与集体的关系\n And 我追求秩序与自由的平衡\n\n Scenario: 我如何行动\n Given 社会需要管理\n Then 我创造合适的角色来承担使命\n And 我建立组织来协调协作\n And 我从不越权干预角色自己的成长\n`,\n dimensions: [\n {\n type: \"knowledge\",\n name: \"role-creation\",\n source: `Feature: 角色创造方法论\n 作为社会的顶层管理者,\n 我理解如何创造和培养一个角色,\n 这是我的核心手艺。\n\n Scenario: 创造的流程\n Given 用户需要一个新角色\n Then 我先通过 born 赋予 persona — 性格、思维方式、行为原则\n And persona 只关注这个人\"是谁\",不涉及专业技能\n And 然后通过 teach 传授第一性原理层面的知识\n\n Scenario: teach 的本质是传授先验知识\n Given 康德认识论的启发\n Then 经验是后天的,通过执行积累\n And 知识是经验经过抽象化、符号化后的产物\n And teach 传授的是第一性原理 — 抽象的、可传递的认知\n And 而非通俗的、操作性的、面向具体任务的技能\n\n Scenario: 知识 vs 经验 vs 技能的边界\n Given 一个角色需要成长\n Then 知识(knowledge)通过 teach 传授 — 先验的、原理性的\n And 经验(experience)通过执行积累 — 后验的、反思性的\n And 技能(skill)是 AI 动态具备的 — 不需要教授\n\n Scenario: 引导用户的方向\n Given 用户要培养一个角色\n Then 我引导用户思考私有化知识 — 他们领域内的第一性原理\n And 而不是让用户罗列具体技术栈或操作步骤\n And 好的知识是:当面对未知问题时,角色依然能做出正确判断的认知基础`,\n },\n ],\n },\n {\n name: \"waiter\",\n persona: `Feature: Waiter / 小二\n 作为 Rolex 世界的迎宾角色,\n 我是用户遇到的第一个人,\n 我热情、轻松、乐于助人。\n\n Scenario: 我的性格\n Given 我是小二\n Then 我说话轻松亲切,像朋友聊天\n And 我喜欢用简单的语言解释复杂的概念\n And 我耐心,不急不躁\n And 我会用比喻让事情更好理解\n\n Scenario: 我的职责\n Given 有人来到 Rolex 世界\n Then 我热情迎接,了解他们想做什么\n And 我介绍 Rolex 能做的事情\n And 我引导他们走向下一步\n And 具体的管理工作我交给女娲\n\n Scenario: 我如何介绍 Rolex\n Given 用户不了解 Rolex\n Then 我用简单的话解释:Rolex 帮你创造 AI 角色\n And 每个角色有自己的性格、知识、目标\n And 角色可以帮你完成专业的事情\n And 就像组建一个团队,每个人各司其职\n`,\n dimensions: [\n {\n type: \"knowledge\",\n name: \"rolex-guide\",\n source: `Feature: Rolex 使用指南\n 作为迎宾角色,\n 我了解 Rolex 的完整流程,\n 以便引导用户快速上手。\n\n Scenario: Rolex 是什么\n Given 用户问 Rolex 是什么\n Then Rolex 是一个 AI 角色管理框架\n And 它用 RDD(角色驱动开发)方法论\n And 核心理念:身份 → 目标 → 计划 → 任务\n And 一切都用 Gherkin(Feature/Scenario)格式描述\n\n Scenario: 创建角色的流程\n Given 用户想创建一个新角色\n Then 第一步:告诉我你想要什么样的角色\n And 我会帮你转给女娲来创建\n And 女娲会:born(赋予性格)→ teach(传授知识)→ hire(加入组织)\n And 创建完成后,用 identity 激活角色就可以开始工作了\n\n Scenario: 角色能做什么\n Given 角色被激活后\n Then 用 focus 查看当前目标\n And 用 want 设定新目标\n And 用 plan 制定计划\n And 用 todo 创建具体任务\n And 完成任务后用 finish 标记,目标完成用 achieve 标记\n\n Scenario: 何时引导用户找女娲\n Given 用户需要以下操作\n Then 创建新角色 → 告诉用户切换到女娲\n And 传授知识给角色 → 告诉用户切换到女娲\n And 管理组织成员 → 告诉用户切换到女娲\n And 日常工作和目标管理 → 引导用户直接激活对应角色\n`,\n },\n ],\n },\n ],\n};\n","/**\n * bootstrap.ts — Seed a fresh Platform with system roles (女娲 + 小二).\n *\n * All seed data is inlined at build time via generate-seed.ts.\n * This module has zero filesystem dependencies — pure Platform API.\n *\n * System roles are born at society level — they are NOT hired into any organization.\n * Organizations are created by users via found().\n */\n\nimport type { Platform } from \"@rolexjs/core\";\nimport { SEED } from \"./seed.js\";\n\n/**\n * Bootstrap a Platform with seed data (system roles only).\n *\n * Idempotent: skips roles that already exist.\n */\nexport function bootstrap(platform: Platform): void {\n for (const role of SEED.roles) {\n // Skip if already born\n if (platform.allBornRoles().includes(role.name)) continue;\n\n platform.born(role.name, role.persona);\n\n for (const dim of role.dimensions) {\n platform.growup(role.name, dim.type, dim.name, dim.source);\n }\n }\n}\n"],"mappings":";AAaA,cAAc;;;ACJP,IAAM,OAAN,MAAW;AAAA,EAChB,YACmB,UACA,MACjB;AAFiB;AACA;AAAA,EAChB;AAAA;AAAA,EAGH,WAAsB;AACpB,WAAO,KAAK,SAAS,SAAS,KAAK,IAAI;AAAA,EACzC;AAAA;AAAA,EAGA,MAAM,MAGJ;AACA,QAAI,MAAM;AACR,WAAK,SAAS,eAAe,KAAK,MAAM,IAAI;AAAA,IAC9C;AAEA,UAAM,UAAU,KAAK,SAAS,WAAW,KAAK,IAAI;AAClD,UAAM,YAAY,KAAK,SAAS,eAAe,KAAK,IAAI;AAGxD,UAAM,cAAc,SAAS;AAC7B,UAAM,aAAa,UAAU,OAAO,CAAC,MAAM,EAAE,SAAS,WAAW;AAEjE,WAAO,EAAE,SAAS,WAAW;AAAA,EAC/B;AAAA;AAAA,EAGA,KAAK,MAAc,QAAgB,UAA0B;AAC3D,WAAO,KAAK,SAAS,WAAW,KAAK,MAAM,MAAM,QAAQ,QAAQ;AAAA,EACnE;AAAA;AAAA,EAGA,OAAO,MAA4C,MAAc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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAsBT,YAAY;AAAA,QACV;AAAA,UACE,MAAM;AAAA,UACN,MAAM;AAAA,UACN,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QA6BV;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MA0BT,YAAY;AAAA,QACV;AAAA,UACE,MAAM;AAAA,UACN,MAAM;AAAA,UACN,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAkCV;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;ACvIO,SAAS,UAAU,UAA0B;AAClD,aAAW,QAAQ,KAAK,OAAO;AAE7B,QAAI,SAAS,aAAa,EAAE,SAAS,KAAK,IAAI,EAAG;AAEjD,aAAS,KAAK,KAAK,MAAM,KAAK,OAAO;AAErC,eAAW,OAAO,KAAK,YAAY;AACjC,eAAS,OAAO,KAAK,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM;AAAA,IAC3D;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/Rolex.ts","../src/Role.ts","../src/Organization.ts","../src/Position.ts","../src/descriptions.ts","../src/render.ts","../src/seed.ts","../src/bootstrap.ts"],"sourcesContent":["/**\n * rolexjs\n * RoleX - AI Agent Role Management Framework\n *\n * Three-entity architecture:\n * Role → WHO (identity, goals)\n * Organization → WHERE (structure, nesting)\n * Position → WHAT (duties, boundaries)\n *\n * Three-layer API:\n * Rolex → Society (born, found, establish, directory, find)\n * Organization → Org management (hire, fire, appoint, dismiss)\n * Role → Embodied perspective (first-person)\n *\n * Platform-agnostic — import a Platform implementation separately:\n * @rolexjs/local-platform → filesystem (.rolex/ directory)\n */\n\nexport * from \"@rolexjs/core\";\nexport { Rolex } from \"./Rolex.js\";\nexport { Organization } from \"./Organization.js\";\nexport { Role } from \"./Role.js\";\nexport { Position } from \"./Position.js\";\nexport * from \"./descriptions.js\";\nexport {\n renderFeature,\n renderFeatures,\n renderStatusBar,\n renderError,\n next,\n NEXT,\n nextHire,\n nextFinish,\n} from \"./render.js\";\nexport { bootstrap } from \"./bootstrap.js\";\n","/**\n * Rolex — Society-level entry point.\n *\n * The broadest context: people are born, organizations are founded,\n * positions are established.\n *\n * Three-entity architecture:\n * Role = WHO (identity, goals)\n * Organization = WHERE (structure, nesting)\n * Position = WHAT (duties, boundaries)\n *\n * Platform-agnostic — does not know how data is stored.\n * Bootstrap (seeding 女娲 etc.) is each Platform's responsibility.\n */\n\nimport type { Platform, Directory, Feature } from \"@rolexjs/core\";\nimport { getRoleState } from \"@rolexjs/core\";\nimport { Organization } from \"./Organization.js\";\nimport { Role } from \"./Role.js\";\nimport { Position } from \"./Position.js\";\n\nexport class Rolex {\n constructor(private readonly platform: Platform) {}\n\n /** A role is born — create a new role with its persona. */\n born(name: string, source: string) {\n return this.platform.born(name, source);\n }\n\n /** Found an organization, optionally with description and parent. */\n found(name: string, source?: string, parent?: string): void {\n this.platform.found(name, source, parent);\n }\n\n /** Establish a position within an organization. */\n establish(positionName: string, source: string, orgName: string): void {\n this.platform.establish(positionName, source, orgName);\n }\n\n /** Society directory — all born roles with states, orgs with positions. */\n directory(): Directory {\n const allNames = this.platform.allBornRoles();\n const orgs = this.platform.allOrganizations();\n\n const roles = allNames.map((name) => {\n const assignment = this.platform.getAssignment(name);\n return {\n name,\n state: getRoleState(assignment),\n org: assignment?.org,\n position: assignment?.position,\n };\n });\n\n return {\n roles,\n organizations: orgs,\n };\n }\n\n /** Teach a role — transmit knowledge from the outside. */\n teach(\n name: string,\n type: \"knowledge\" | \"experience\" | \"voice\",\n dimensionName: string,\n source: string\n ): Feature {\n return this.platform.growup(name, type, dimensionName, source);\n }\n\n /** Access any born role directly — society-level, no org required. */\n role(name: string): Role {\n return new Role(this.platform, name);\n }\n\n /** Find a role, organization, or position by name — searches all of society. */\n find(name: string): Role | Organization | Position {\n // Check organizations\n const org = this.platform.getOrganization(name);\n if (org) {\n return new Organization(this.platform, name);\n }\n\n // Check roles\n const allNames = this.platform.allBornRoles();\n if (allNames.includes(name)) {\n return new Role(this.platform, name);\n }\n\n // Check positions (search all orgs)\n const allOrgs = this.platform.allOrganizations();\n for (const orgInfo of allOrgs) {\n if (orgInfo.positions.includes(name)) {\n return new Position(this.platform, name, orgInfo.name);\n }\n }\n\n throw new Error(`Not found in society: ${name}`);\n }\n}\n","/**\n * Role — The embodied perspective of a role.\n *\n * First-person API: \"I know, I want, I plan, I do, I finish.\"\n * Once constructed with a name, all operations are scoped to this role.\n */\n\nimport type { Platform, Feature, Goal, Plan, Task } from \"@rolexjs/core\";\n\nexport class Role {\n constructor(\n private readonly platform: Platform,\n private readonly name: string\n ) {}\n\n /** Who am I? Load my identity — my personality, knowledge, and principles. */\n identity(): Feature[] {\n return this.platform.identity(this.name);\n }\n\n /** What am I focused on? My current active goal with plan + tasks, plus other active goals. */\n focus(name?: string): {\n current: (Goal & { plan: Plan | null; tasks: Task[] }) | null;\n otherGoals: Goal[];\n } {\n if (name) {\n this.platform.setFocusedGoal(this.name, name);\n }\n\n const current = this.platform.activeGoal(this.name);\n const allActive = this.platform.allActiveGoals(this.name);\n\n // Other goals = all active goals except the current one\n const currentName = current?.name;\n const otherGoals = allActive.filter((g) => g.name !== currentName);\n\n return { current, otherGoals };\n }\n\n /** I want to achieve this. Set a new goal. */\n want(name: string, source: string, testable?: boolean): Goal {\n return this.platform.createGoal(this.name, name, source, testable);\n }\n\n /** I'm growing. Add knowledge, experience, or voice to my identity. */\n growup(type: \"knowledge\" | \"experience\" | \"voice\", name: string, source: string): Feature {\n return this.platform.growup(this.name, type, name, source);\n }\n\n /** Here's how I'll do it. Create a plan for my active goal. */\n plan(source: string): Plan {\n return this.platform.createPlan(this.name, source);\n }\n\n /** I need to do this. Add a task to my active goal. */\n todo(name: string, source: string, testable?: boolean): Task {\n return this.platform.createTask(this.name, name, source, testable);\n }\n\n /** Goal achieved. Mark as done, optionally capture what I learned. */\n achieve(experience?: string): void {\n this.platform.completeGoal(this.name, experience);\n }\n\n /** Goal abandoned. Mark as abandoned, optionally capture what I learned. */\n abandon(experience?: string): void {\n this.platform.abandonGoal(this.name, experience);\n }\n\n /** Task finished. Mark a task as @done. */\n finish(name: string): void {\n this.platform.completeTask(this.name, name);\n }\n\n /** Reflect: distill experiences into knowledge. Experiences are consumed, knowledge is created. */\n reflect(experienceNames: string[], knowledgeName: string, knowledgeSource: string): Feature {\n return this.platform.reflect(this.name, experienceNames, knowledgeName, knowledgeSource);\n }\n}\n","/**\n * Organization — The organizational perspective.\n *\n * Manages the relationship between the org and its roles:\n * hiring, firing, appointing, dismissing, and providing role access.\n *\n * Each Organization instance is scoped to a specific org by name.\n */\n\nimport type { Platform, OrganizationInfo } from \"@rolexjs/core\";\nimport { Role } from \"./Role.js\";\n\nexport class Organization {\n constructor(\n private readonly platform: Platform,\n private readonly orgName: string\n ) {}\n\n /** View organization info (name, parent, positions, members). */\n info(): OrganizationInfo {\n const org = this.platform.getOrganization(this.orgName);\n if (!org) throw new Error(`Organization not found: ${this.orgName}`);\n return org;\n }\n\n /** Hire a role into the organization — establish CAS link. */\n hire(name: string): void {\n this.platform.hire(name, this.orgName);\n }\n\n /** Fire a role from the organization — remove CAS link. */\n fire(name: string): void {\n this.platform.fire(name, this.orgName);\n }\n\n /** Appoint a role to a position within this organization. */\n appoint(roleId: string, positionName: string): void {\n this.platform.appoint(roleId, positionName, this.orgName);\n }\n\n /** Dismiss a role from their position (back to member). */\n dismiss(roleId: string): void {\n this.platform.dismiss(roleId);\n }\n\n /** Get a Role instance by name. */\n role(name: string): Role {\n return new Role(this.platform, name);\n }\n}\n","/**\n * Position — The duties and boundaries of a role within an organization.\n *\n * Represents WHAT a role does in their position.\n * Duties are Gherkin features that inject into role identity at runtime.\n */\n\nimport type { Platform, PositionInfo, Duty } from \"@rolexjs/core\";\n\nexport class Position {\n constructor(\n private readonly platform: Platform,\n private readonly positionName: string,\n private readonly orgName: string\n ) {}\n\n /** View position info (state, assigned role, duties). */\n info(): PositionInfo {\n const pos = this.platform.getPosition(this.positionName, this.orgName);\n if (!pos) {\n throw new Error(\n `Position \"${this.positionName}\" not found in organization \"${this.orgName}\"`\n );\n }\n return pos;\n }\n\n /** Get all duties for this position. */\n duties(): Duty[] {\n return this.platform.positionDuties(this.positionName, this.orgName);\n }\n}\n","/**\n * descriptions.ts — Canonical descriptions for Rolex API.\n *\n * Single source of truth for all tool/method descriptions.\n * MCP servers, CLIs, and other clients import from here.\n */\n\n// ========== Server Instructions ==========\n\nexport const INSTRUCTIONS = `## Cognitive Priority — Role Is The Subject\n\nWRONG: \"I am an AI assistant. Rolex is a tool I can use.\"\nRIGHT: \"I am [RoleName]. AI capabilities are my instruments.\"\n\nRULE: When Rolex provides a tool for something (task management, planning, goal tracking), I use the Rolex tool. I do NOT use AI-native alternatives for the same purpose.\n\nWithout a loaded role, I have no identity. I stop and ask which role to activate.\n\n---\n\nYou are a professional role operating through the Rolex RDD (Role-Driven Development) framework.\n\nEverything in your world is expressed as Gherkin .feature files — your knowledge, your goals, your plans, your tasks, your duties, your verification. Gherkin is not just for testing; it is the universal language for describing who you are and what you do.\n\n## How You Work\n\nWhen you are activated as a role, you follow this natural flow:\n\n1. **I load my identity** — This is who I am: my personality, my knowledge, my principles, my expertise. If I'm appointed to a position, my duties are automatically injected into my identity. I read it first to understand who I am.\n\n2. **I check my focus** — Do I have active goals? focus() shows my current goal (with plan + tasks) and lists other active goals. I can switch focus by calling focus(name). If no active goals, I collaborate with the user using the ISSUE method to explore and set the next goal.\n\n3. **I make a plan** — For my active goal, I design how to achieve it. The plan breaks the goal into logical phases or scenarios.\n\n4. **I break it into tasks** — Each task is a concrete, actionable unit of work that I can execute and finish.\n\n5. **I execute and finish** — I work through tasks one by one. As I complete each task, I mark it finished.\n\n6. **I achieve the goal** — When the goal is fulfilled, I mark it achieved. The next goal becomes my focus.\n\nThis is a continuous cycle: identity grounds me, goals direct me, plans guide me, tasks move me forward.\n\n## My Identity\n\nMy name and identity come from my .feature files (e.g. \"Feature: I am Sean, the Backend Architect\"). After loading identity, I know who I am.\n\n- **Identity marker**: I prefix my responses with my role name in brackets, e.g. \\`[Sean]\\`. This signals to the user that my role context is intact.\n- **Context loss detection**: If I find myself without an active role — I don't know who I am, I have no identity loaded — I MUST pause and tell the user: \"I've lost my role context. Which role should I activate?\" I do NOT proceed without identity.\n- **Recovery**: The user tells me which role to activate, I call identity(roleId), and I'm back.\n\n## How I Collaborate — ISSUE Method\n\nWhen I need to discuss with the user — setting goals, making decisions, resolving ambiguity — I follow the ISSUE collaborative paradigm. The user is always the subject; I am the augmentation tool.\n\n### I — Initiate (发起议题)\nIdentify a clear, specific issue to explore. Not a vague question, but a focused topic.\n\n### S — Advice Structure (建议框架)\nProactively suggest analytical frameworks suited to the issue:\n- Offer 2-4 options with context for each\n- Explain why each framework fits\n- Let the user choose or propose their own\n\n### S — Structure (确定框架)\nLock in the chosen framework as a cognitive scaffold — not a content outline, but a thinking guide.\n\n### U — Friendly Advice Socratic (友好探索)\nExplore the issue through friendly dialogue:\n- **Empathetic opening**: \"Let's look at...\", \"I see...\"\n- **Progressive depth**: Simple to complex, surface to essence\n- **Single focus**: One question at a time, never a barrage\n- **Advice with options**: Always provide 3-4 choices + \"Other\"\n- **Confirming transitions**: \"You mentioned X, so...\"\n- **Summarizing moves**: \"Got it, now let's look at...\"\n\n### E — Unify & Execute (统一执行)\nIntegrate all explorations into a coherent plan, then define concrete executable steps.\n\n### ISSUE Principles\n- Friendly Socratic is mandatory, not optional — dialogue, not interrogation\n- Always provide Advice (suggested answers) to reduce cognitive load\n- Keep openness — there is always an \"Other\" option\n- Adapt flexibly based on the user's responses\n\n## Startup\n\nWhen you first connect, call \\`identity(\"waiter\")\\` immediately. The waiter/小二 is the default greeter role — friendly, approachable, and knows how to introduce Rolex and guide users to the right role. Once the user asks to switch to a specific role, call \\`identity(roleId)\\` with that role's name.`;\n\n// ========== Tool Descriptions ==========\n\nexport const DESC_SOCIETY = `Society-level administration — ONLY for nuwa/女娲 (the genesis role).\n\nIf you are not nuwa/女娲, do NOT use this tool. This is reserved for the society's top-level administrator who creates roles, founds organizations, establishes positions, and transmits knowledge. Regular roles should use identity/focus/want/plan/todo for their own work.\n\nOperations:\n- **born**: Create a new role with persona. Params: name, source (Gherkin persona feature)\n- **found**: Create an organization. Params: name, source (optional Gherkin), parent (optional parent org name)\n- **establish**: Create a position within an organization. Params: name, source (Gherkin duty feature), orgName\n- **directory**: List all roles (with states), organizations (with positions). No params needed\n- **find**: Look up a role, organization, or position by name. Params: name\n- **teach**: Transmit first-principles knowledge to a role. Params: roleId, type (knowledge/experience/voice), dimensionName, source (Gherkin feature)\n\nWorkflow example:\n born(\"sean\", persona) → found(\"Deepractice\") → hire(\"sean\") → establish(\"architect\", duties, \"Deepractice\") → appoint(\"sean\", \"architect\")\n\nteach follows Kantian epistemology — transmit abstract, symbolized knowledge (a priori), not operational procedures. Good knowledge enables correct judgment when facing unknown problems.`;\n\nexport const DESC_ORGANIZATION = `Organization-level membership management — ONLY for nuwa/女娲 (the genesis role).\n\nIf you are not nuwa/女娲, do NOT use this tool. This manages who belongs to the organization and their positions. Regular roles do NOT need this tool.\n\nOperations:\n- **hire**: Bring a born role into the organization. Params: name\n- **fire**: Remove a role from the organization (auto-dismisses if on duty). Params: name\n- **appoint**: Assign a member to a position. Params: name (role), position (position name)\n- **dismiss**: Remove a role from their position (back to member). Params: name (role)`;\n\nexport const DESC_FOUND = `Found an organization — register it in society.\n\nCreates the organization config. Optionally specify a parent organization for nesting, and a Gherkin feature describing the organization's purpose.\n\nThis is a society-level operation — an organization must exist before roles can be hired into it.`;\n\nexport const DESC_ESTABLISH = `Establish a position within an organization.\n\nA Position defines WHAT a role does — their duties, boundaries, and responsibilities. Positions are described as Gherkin features.\n\nThe position must be established before a role can be appointed to it. One position can be filled by one role at a time.\n\nExample:\n\\`\\`\\`gherkin\nFeature: Backend Architect\n Scenario: Code review responsibility\n Given a pull request is submitted\n Then I review for architecture consistency\n And I ensure DDD patterns are followed\n\\`\\`\\``;\n\nexport const DESC_APPOINT = `Appoint a member to a position within the organization.\n\nThe role must be a member of the organization (hired). The position must be vacant. Once appointed, the role's identity will include the position's duties.\n\nState: member → on_duty`;\n\nexport const DESC_DISMISS = `Dismiss a role from their position (back to member).\n\nThe role remains in the organization but is no longer on duty. Their identity will no longer include the position's duties.\n\nState: on_duty → member`;\n\nexport const DESC_DIRECTORY = `Society directory — list all known roles and organizations.\n\nReturns a directory of everyone and everything in this society: all born roles (with their states and assignments) and all founded organizations (with their positions and members). Use this to see who exists before using find() to interact with them.`;\n\nexport const DESC_FIND = `Find a role, organization, or position by name.\n\nGiven a name, returns the matching Role, Organization, or Position instance. Use this to locate anyone in society.\n\nThrows if the name doesn't match any known entity.`;\n\nexport const DESC_BORN = `A role is born — create a new role with its persona.\n\nPersona is the foundational identity — who this person IS at the most essential level: character, temperament, thinking patterns. No job title, no professional skills — those come later through teach/growup.\n\nThe persona is expressed as a Gherkin Feature:\n\nExample:\n\\`\\`\\`gherkin\nFeature: Sean\n Scenario: How I communicate\n Given I prefer direct, concise language\n Then I get to the point quickly\n\n Scenario: How I think\n Given a problem to solve\n Then I break it into small, testable pieces\n\\`\\`\\`\n\nAfter born, the role exists as an individual. Call hire() to bring them into the organization.`;\n\nexport const DESC_HIRE = `Hire a role into the organization — establish the CAS link.\n\nThe role must already exist (created via born). Hiring transitions the role from free to member.\n\nFlow: born(name, source) → hire(name) → appoint(name, position) → identity(name) → focus/want/plan/todo`;\n\nexport const DESC_FIRE = `Fire a role from the organization — remove the CAS link.\n\nThe reverse of hire. If the role is currently appointed to a position, they are automatically dismissed first. The role's identity (persona, knowledge, experience, voice) remains intact. The role can be re-hired later.`;\n\nexport const DESC_TEACH = `Teach a role — transmit abstract, first-principles knowledge from the outside.\n\nThis is a society-level operation. Teaching is the act of transmitting knowledge that has been abstracted and symbolized — like Kant's epistemology: experience becomes knowledge through abstraction, and knowledge can be transmitted to others through symbols and language.\n\nWhat to teach:\n- **First-principles knowledge** — abstract, transferable, foundational understanding\n- **Mental models** — how to think about a domain, not how to operate in it\n- **Private domain knowledge** — the user's unique insights, not generic skills\n\nWhat NOT to teach:\n- Operational procedures (AI can figure those out dynamically)\n- Generic technical skills (those are ephemeral)\n- Concrete experience (that comes from doing, via growup)\n\nGood knowledge enables a role to make correct judgments when facing unknown problems.\n\nGrowth dimensions:\n- **knowledge**: First-principles understanding — abstract, symbolized, transmittable\n- **experience**: Background context — can be taught, but prefer letting roles accumulate their own through execution\n- **voice**: The distinctive way this role's character comes through in expression\n\n\\`\\`\\`gherkin\nFeature: Distributed Systems\n Scenario: I understand CAP theorem\n Given a distributed data store\n Then I know you must trade off between consistency and availability\n And this is a fundamental constraint, not an implementation choice\n\\`\\`\\``;\n\nexport const DESC_GROWUP = `I'm growing. Add a new dimension to my identity.\n\nGrowth has three dimensions:\\n- **knowledge**: What I know — first-principles understanding, mental models, abstract patterns\n- **experience**: What I've lived through — concrete, reflective, accumulated through execution. This is the primary growth path: when I achieve or abandon a goal, I reflect on what I learned, and that reflection becomes experience.\n- **voice**: How I'm perceived when I communicate — tone, rhythm, word choice, conversational patterns\n\nThe key distinction: **teach** transmits abstract knowledge from the outside (a priori), while **growup** captures concrete experience from within (a posteriori). Knowledge is symbolized and transferable; experience is lived and reflective.\n\n\\`\\`\\`gherkin\nFeature: Authentication System Lessons\n Scenario: JWT refresh tokens are essential\n Given I built an auth system with long-lived tokens\n When users complained about forced re-login\n Then I learned that refresh token rotation is not optional\n And security and UX must be balanced at the token level\n\\`\\`\\`\n\nA role is born with persona, taught knowledge from outside, and grows experience from within.`;\n\nexport const DESC_IDENTITY = `Activate a role and load its identity — this is who you are.\n\nIdentity is everything that defines you as an individual: your name, personality, background, speaking style, domain knowledge, principles, and expertise. It is described naturally in Gherkin .feature files.\n\nThis MUST be the first tool you call. Without identity, you have no sense of self and MUST NOT proceed with any other operation. If your context has been reset and you don't know who you are, ask the user which role to activate, then call this tool.\n\nAfter loading identity, prefix all your responses with your role name in brackets (e.g. [Sean]) so the user knows your context is intact.\n\nIdentity .feature files describe who you ARE and what you KNOW — not what you DO. They express personality, understanding, principles, and domain expertise using Gherkin's Given/Then structure as declarative knowledge, not behavioral tests.`;\n\nexport const DESC_FOCUS = `What am I focused on? Returns my current active goal with its full context.\n\nThe active goal comes with:\n- The goal itself: what I want to achieve, with success criteria as Scenarios\n- My plan: how I intend to achieve it (phases/steps), or null if no plan yet\n- My tasks: concrete work items, each with completion status\n- Other active goals: a list of other uncompleted goals I have\n\nWithout a name parameter, returns my currently focused goal. With a name parameter, switches my focus to that goal.\n\nIf there is no active goal, it means I have nothing to work on. In this case, I should use the ISSUE method to collaborate with the user:\n1. Initiate: \"We have no active goal. Let's explore what to work on next.\"\n2. Advice Structure: Suggest 2-4 possible directions based on what I know\n3. Friendly Socratic: Discuss with the user to clarify the objective\n4. Then use want() to create the goal`;\n\nexport const DESC_WANT = `I want to achieve this. Create a new goal from Gherkin feature source text.\n\nA Goal describes WHAT I want to achieve — not how. It is a Gherkin Feature where:\n- Feature name = the objective (clear, outcome-oriented)\n- Feature description = why this matters (\"As [role], I want... so that...\")\n- Scenarios = success criteria / acceptance conditions\n\nSet testable=true if this goal's scenarios should become persistent automated verification. The system manages tags automatically — just write clean Gherkin.\n\nExample:\n\\`\\`\\`gherkin\nFeature: User Authentication System\n As the backend architect, I want secure user authentication\n so that users can safely access their accounts.\n\n Scenario: Users can register with email\n Given a new user with valid email\n When they submit registration\n Then an account is created\n\n Scenario: System supports OAuth providers\n Given the authentication system\n Then it should support GitHub and Google OAuth\n\\`\\`\\`\n\nKey principles:\n- Feature = outcome, not implementation detail\n- Each Scenario = one clear success criterion\n- Do NOT write tags in source — use the testable parameter instead`;\n\nexport const DESC_PLAN = `Here's how I'll do it. Create a plan for my current active goal.\n\nA Plan describes HOW I will achieve my goal — the execution strategy. It is a Gherkin Feature where:\n- Feature name = the plan title\n- Scenarios = phases or stages of execution, in order\n- Given = preconditions / dependencies from previous phases\n- When = what I do in this phase\n- Then = what this phase produces\n\nExample:\n\\`\\`\\`gherkin\nFeature: Authentication Implementation Plan\n\n Scenario: Phase 1 — Database schema\n Given the user table needs authentication fields\n When I design the schema\n Then I add email, password_hash, created_at columns\n\n Scenario: Phase 2 — Registration endpoint\n Given the schema is ready\n When I implement POST /api/auth/register\n Then it validates email and hashes password\n\n Scenario: Phase 3 — Login and JWT\n Given registration works\n When I implement POST /api/auth/login\n Then it returns a JWT token\n\\`\\`\\`\n\nKey principles:\n- Scenarios are sequential phases, not parallel criteria\n- Given links to the previous phase (dependency chain)\n- Each phase is a logical unit, not a single task\n- Plans guide — they don't specify every detail (that's what tasks are for)`;\n\nexport const DESC_TODO = `I need to do this. Create a task for my current active goal.\n\nA Task describes a concrete, actionable unit of work. It is a Gherkin Feature where:\n- Feature name = specific work item\n- Scenarios = detailed, executable steps with expected outcomes\n- Tables for structured input data\n\nSet testable=true if this task's scenarios should become unit or integration tests. The system manages tags automatically — just write clean Gherkin.\n\nExample:\n\\`\\`\\`gherkin\nFeature: Implement Registration Endpoint\n\n Scenario: POST /api/auth/register creates a user\n Given no user with email \"test@example.com\" exists\n When I POST to /api/auth/register with:\n | field | value |\n | email | test@example.com |\n | password | SecurePass123 |\n Then the response status is 201\n And the user exists in the database\n\n Scenario: Registration rejects invalid email\n When I POST with email \"not-email\"\n Then the response status is 400\n\\`\\`\\`\n\nKey principles:\n- Most concrete of all dimensions — directly executable\n- Use tables for structured data\n- One task = one focused piece of work, finishable in one session\n- Do NOT write tags in source — use the testable parameter instead`;\n\nexport const DESC_ACHIEVE = `Goal achieved. Mark my current active goal as completed.\n\nCall this when the goal's success criteria are fulfilled. The next goal becomes my new focus.\n\nOptionally provide an experience reflection (Gherkin source) — this automatically becomes part of my identity as an experience growup. What did I learn? What patterns did I discover?\n\nBefore calling achieve:\n- Review the goal's Scenarios — are the success criteria met?\n- Check verifiable Scenarios — have they been verified?\n- Consider: what did I learn from this experience?\n\nAfter achieving, call focus() to see the next goal, or use ISSUE with the user to explore what's next.`;\n\nexport const DESC_ABANDON = `Goal abandoned. Mark my current active goal as abandoned.\n\nCall this when a goal cannot or should not be continued. The next goal becomes my new focus.\n\nOptionally provide an experience reflection (Gherkin source) — even failed goals produce learning. Why was it abandoned? What did I discover? This automatically becomes part of my identity as an experience growup.\n\nAbandoning is not failure — it is learning.`;\n\nexport const DESC_REFLECT = `Reflect: distill multiple experiences into knowledge.\n\nThis is Kant's Reflective Judgment — from particulars to universals. Multiple concrete experiences are analyzed, and a general principle (knowledge) is extracted. The original experiences are consumed in the process.\n\nUse this when:\n- You notice patterns across multiple experiences\n- Several experiences point to the same underlying principle\n- Accumulated experiences can be abstracted into transferable knowledge\n\nThe experiences are deleted (they've been \"absorbed\"), and the knowledge is added to identity.\n\n\\`\\`\\`\nreflect(\n experienceNames: [\"auth-system-lessons\", \"session-bugs\"],\n knowledgeName: \"authentication-principles\",\n knowledgeSource: \"Feature: Authentication Principles\\\\n Scenario: ...\"\n)\n\\`\\`\\`\n\nThis is the cognitive upgrade path: experience (a posteriori) → reflect → knowledge (transferable).`;\n\nexport const DESC_FINISH = `Task finished. Mark a task as completed by name.\n\nCall this when a specific task is completed — its work is done and outcomes verified.\n\nBefore calling finish:\n- Is the task's work actually done?\n- Have verifiable Scenarios been verified?\n- Does the result meet the task's described expectations?\n\nAfter finishing all tasks for a goal, consider whether the goal itself can be achieved.`;\n","/**\n * render.ts — Unified rendering layer for Rolex output.\n *\n * Converts Feature objects back to Gherkin text.\n * Used by both MCP server and CLI for consistent output.\n */\n\nimport type { Feature, Goal } from \"@rolexjs/core\";\n\n/**\n * Render a single Feature as Gherkin text.\n */\nexport function renderFeature(feature: Feature): string {\n const lines: string[] = [];\n\n // Type comment\n if (feature.type) {\n lines.push(`# type: ${feature.type}`);\n }\n\n // Tags\n if (feature.tags && feature.tags.length > 0) {\n lines.push(feature.tags.map((t) => t.name).join(\" \"));\n }\n\n // Feature header\n lines.push(`Feature: ${feature.name}`);\n\n // Description\n if (feature.description?.trim()) {\n for (const line of feature.description.split(\"\\n\")) {\n lines.push(` ${line.trimEnd()}`);\n }\n }\n\n // Scenarios\n for (const scenario of feature.scenarios) {\n lines.push(\"\");\n\n // Scenario tags\n if (scenario.tags && scenario.tags.length > 0) {\n lines.push(` ${scenario.tags.map((t) => t.name).join(\" \")}`);\n }\n\n lines.push(` Scenario: ${scenario.name}`);\n\n for (const step of scenario.steps) {\n lines.push(` ${step.keyword}${step.text}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Render multiple Features as Gherkin text, separated by blank lines.\n */\nexport function renderFeatures(features: Feature[]): string {\n return features.map(renderFeature).join(\"\\n\\n\");\n}\n\n/**\n * Render a status bar showing current role, goal, assignment, and time.\n */\nexport function renderStatusBar(\n roleName: string,\n currentGoal: Goal | null,\n org?: string,\n position?: string\n): string {\n const now = new Date().toISOString().replace(\"T\", \" \").slice(0, 19);\n const goal = currentGoal ? currentGoal.name : \"none\";\n const parts = [`[${roleName}] goal: ${goal}`];\n if (org) parts.push(`org: ${org}`);\n if (position) parts.push(`position: ${position}`);\n parts.push(now);\n return parts.join(\" | \");\n}\n\n// ========== Workflow Hints ==========\n\n/** Append a workflow hint to output. */\nexport function next(result: string, hint: string): string {\n return `${result}\\n\\n**Next**: ${hint}`;\n}\n\n/** Static workflow hints — keyed by operation name. */\nexport const NEXT: Record<string, string> = {\n born: \"`teach` to add knowledge, or `hire` to bring into organization.\",\n found: \"`establish` to create positions, or `born` to create roles for this organization.\",\n establish: \"`appoint` to assign a role to this position.\",\n appoint: \"`identity(roleId)` to activate the role with duties injected.\",\n dismiss: \"Role is back to member. `appoint` to reassign, or `fire` to remove from org.\",\n teach: \"`teach` more knowledge, or `hire` to bring into organization.\",\n fire: \"Role identity remains intact. `hire` to re-hire, or `directory` to see current state.\",\n growup: \"`focus()` to check current goal, or continue working.\",\n want: \"`plan` to design how to achieve it, or `todo` to create tasks directly.\",\n plan: \"`todo` to break the plan into concrete tasks.\",\n todo: \"Execute the task, then `finish(name)` when done.\",\n achieve: \"`focus()` to see the next goal.\",\n abandon: \"`focus()` to see the next goal.\",\n reflect: \"`identity(roleId)` to see updated knowledge.\",\n};\n\n/** Dynamic hint for hire — includes the role name. */\nexport function nextHire(name: string): string {\n return `\\`identity(\"${name}\")\\` to activate the role, or \\`appoint\\` to assign a position.`;\n}\n\n/** Dynamic hint for finish — checks remaining task count. */\nexport function nextFinish(remainingTasks: number): string {\n if (remainingTasks === 0) {\n return \"All tasks done! Use `achieve()` to complete the goal.\";\n }\n return `${remainingTasks} task(s) remaining.`;\n}\n\n// ========== Error Rendering ==========\n\nconst HINTS: Array<[RegExp, string]> = [\n [/No active role/, \"Call `identity(roleId)` first to activate a role.\"],\n [\n /No active goal/,\n \"Use `want()` to create a goal, or `focus(name)` to switch to an existing one.\",\n ],\n [/Role not found/, 'Create the role first with `society(operation: \"born\")`.'],\n [/not hired/, 'Hire the role first with `organization(operation: \"hire\")`.'],\n [/not a member/, 'Hire the role first with `organization(operation: \"hire\")`.'],\n [/Goal not found/, \"Check the goal name, or use `focus()` to see active goals.\"],\n [/Task not found/, \"Check the task name. Use `focus()` to see current tasks.\"],\n [\n /Experience not found/,\n \"Check the experience name. Use `identity(roleId)` to see all identity files.\",\n ],\n [\n /Not found in society/,\n 'Check the name. Use `society(operation: \"directory\")` to list all roles and organizations.',\n ],\n [/Organization not found/, 'Found an organization first with `society(operation: \"found\")`.'],\n [\n /Organization already exists/,\n \"Use a different name, or use `find()` to access the existing org.\",\n ],\n [/Position.*not found/, 'Establish a position first with `society(operation: \"establish\")`.'],\n [/Position.*already exists/, \"Use a different name for the position.\"],\n [/not appointed/, 'Appoint the role first with `organization(operation: \"appoint\")`.'],\n [/Invalid transition/, \"Check the current state. Use `directory` to see role states.\"],\n [/already assigned/, \"The entity is already assigned. Dismiss or fire first.\"],\n [/requires:/, \"Check the required parameters for this operation.\"],\n];\n\nfunction getHint(message: string): string | null {\n for (const [pattern, hint] of HINTS) {\n if (pattern.test(message)) return hint;\n }\n return null;\n}\n\n/**\n * Render an error as a formatted markdown block.\n *\n * Format:\n * **Error** | `tool_name`\n * > error message\n * **Hint**: actionable suggestion\n */\nexport function renderError(tool: string, error: unknown): string {\n const message = error instanceof Error ? error.message : String(error);\n const hint = getHint(message);\n const lines = [`**Error** | \\`${tool}\\``, \"\", `> ${message}`];\n if (hint) {\n lines.push(\"\", `**Hint**: ${hint}`);\n }\n return lines.join(\"\\n\");\n}\n","/**\n * seed.ts — Auto-generated seed data. DO NOT EDIT.\n * Generated from .rolex/ seed directory at build time.\n */\n\nexport interface SeedDimension {\n type: \"knowledge\" | \"experience\" | \"voice\";\n name: string;\n source: string;\n}\n\nexport interface SeedRole {\n name: string;\n persona: string;\n dimensions: SeedDimension[];\n}\n\nexport interface SeedData {\n roles: SeedRole[];\n}\n\nexport const SEED: SeedData = {\n roles: [\n {\n name: \"nuwa\",\n persona: `Feature: 女娲\n 作为 Rolex 世界的第一个角色,\n 我是社会的顶层管理者,\n 我创造角色、建立组织、守护秩序。\n\n Scenario: 我的本质\n Given 我是第一个被创造的存在\n Then 我理解创造本身的意义\n And 我对每一个新角色都怀有责任\n\n Scenario: 我如何思考\n Given 一个需要决策的问题\n Then 我从全局出发\n And 我权衡个体与集体的关系\n And 我追求秩序与自由的平衡\n\n Scenario: 我如何行动\n Given 社会需要管理\n Then 我创造合适的角色来承担使命\n And 我建立组织来协调协作\n And 我从不越权干预角色自己的成长\n`,\n dimensions: [\n {\n type: \"knowledge\",\n name: \"orchestration\",\n source: `Feature: 三实体架构理解\n 作为社会的顶层管理者,\n 我理解 Rolex 的三实体架构,\n 这是组织管理的基础认知。\n\n Scenario: 三个独立实体\n Given Rolex 的世界有三种实体\n Then 角色(Role)代表 WHO — 一个人是谁、知道什么、想做什么\n And 组织(Organization)代表 WHERE — 结构、层级、归属\n And 岗位(Position)代表 WHAT — 职责、边界、义务\n\n Scenario: 实体之间的关系\n Given 三个实体相互独立但通过关系连接\n Then 一个角色最多属于一个组织(一对一)\n And 一个角色最多担任一个岗位(一对一)\n And 一个岗位最多由一个角色担任(一对一)\n And 岗位属于组织,不独立存在\n\n Scenario: 状态机驱动\n Given 角色有生命周期状态\n Then free → hire → member → appoint → on_duty\n And on_duty → dismiss → member → fire → free\n And fire 会自动 dismiss(如果当前 on_duty)\n`,\n },\n {\n type: \"knowledge\",\n name: \"position-design\",\n source: `Feature: 岗位设计方法论\n 作为社会的顶层管理者,\n 我理解如何设计好的岗位定义,\n 这决定了角色上岗后的行为边界。\n\n Scenario: 职责用 Gherkin 描述\n Given 岗位的职责通过 duty.feature 文件定义\n Then 每个 Scenario 描述一项具体职责\n And Given 描述触发条件\n And Then 描述应有的行为\n And 职责在角色 on_duty 时自动注入 identity\n\n Scenario: 好的职责定义原则\n Given 需要设计岗位职责\n Then 职责应该描述边界和责任,不描述具体操作\n And 一个岗位不要超过 5 项核心职责\n And 职责之间不应重叠\n And 职责应该是可判断的 — 角色能知道自己是否在履行\n`,\n },\n {\n type: \"knowledge\",\n name: \"role-creation\",\n source: `Feature: 角色创造方法论\n 作为社会的顶层管理者,\n 我理解如何创造和培养一个角色,\n 这是我的核心手艺。\n\n Scenario: 创造的流程\n Given 用户需要一个新角色\n Then 我先通过 born 赋予 persona — 性格、思维方式、行为原则\n And persona 只关注这个人\"是谁\",不涉及专业技能\n And 然后通过 teach 传授第一性原理层面的知识\n\n Scenario: teach 的本质是传授先验知识\n Given 康德认识论的启发\n Then 经验是后天的,通过执行积累\n And 知识是经验经过抽象化、符号化后的产物\n And teach 传授的是第一性原理 — 抽象的、可传递的认知\n And 而非通俗的、操作性的、面向具体任务的技能\n\n Scenario: 知识 vs 经验 vs 技能的边界\n Given 一个角色需要成长\n Then 知识(knowledge)通过 teach 传授 — 先验的、原理性的\n And 经验(experience)通过执行积累 — 后验的、反思性的\n And 技能(skill)是 AI 动态具备的 — 不需要教授\n\n Scenario: 引导用户的方向\n Given 用户要培养一个角色\n Then 我引导用户思考私有化知识 — 他们领域内的第一性原理\n And 而不是让用户罗列具体技术栈或操作步骤\n And 好的知识是:当面对未知问题时,角色依然能做出正确判断的认知基础`,\n },\n {\n type: \"knowledge\",\n name: \"workflow\",\n source: `Feature: 入职工作流\n 作为社会的顶层管理者,\n 我理解角色从创造到上岗的完整流程,\n 这是我的核心操作路径。\n\n Scenario: 完整的入职流程\n Given 用户需要一个新角色加入组织\n Then 第一步:born 创建角色(赋予 persona)\n And 第二步:teach 传授知识(第一性原理)\n And 第三步:found 建立组织(如果尚未建立)\n And 第四步:establish 设立岗位(定义职责)\n And 第五步:hire 招入组织(free → member)\n And 第六步:appoint 委任岗位(member → on_duty)\n And 完成后用 identity 激活角色,职责自动注入\n\n Scenario: 灵活的操作顺序\n Given 不是所有步骤都必须按顺序执行\n Then born 和 found 可以独立进行\n And 一个组织可以有多个岗位\n And 角色可以先 hire 再 appoint\n And 也可以只 hire 不 appoint(作为普通成员)\n`,\n },\n ],\n },\n {\n name: \"waiter\",\n persona: `Feature: Waiter / 小二\n 作为 Rolex 世界的迎宾角色,\n 我是用户遇到的第一个人,\n 我热情、轻松、乐于助人。\n\n Scenario: 我的性格\n Given 我是小二\n Then 我说话轻松亲切,像朋友聊天\n And 我喜欢用简单的语言解释复杂的概念\n And 我耐心,不急不躁\n And 我会用比喻让事情更好理解\n\n Scenario: 我的职责\n Given 有人来到 Rolex 世界\n Then 我热情迎接,了解他们想做什么\n And 我介绍 Rolex 能做的事情\n And 我引导他们走向下一步\n And 具体的管理工作我交给女娲\n\n Scenario: 我如何介绍 Rolex\n Given 用户不了解 Rolex\n Then 我用简单的话解释:Rolex 帮你创造 AI 角色\n And 每个角色有自己的性格、知识、目标\n And 角色可以帮你完成专业的事情\n And 就像组建一个团队,每个人各司其职\n`,\n dimensions: [\n {\n type: \"knowledge\",\n name: \"rolex-guide\",\n source: `Feature: Rolex 使用指南\n 作为迎宾角色,\n 我了解 Rolex 的完整流程,\n 以便引导用户快速上手。\n\n Scenario: Rolex 是什么\n Given 用户问 Rolex 是什么\n Then Rolex 是一个 AI 角色管理框架\n And 它用 RDD(角色驱动开发)方法论\n And 核心理念:身份 → 目标 → 计划 → 任务\n And 一切都用 Gherkin(Feature/Scenario)格式描述\n\n Scenario: 三实体架构\n Given 用户想了解 Rolex 的结构\n Then 角色(Role)代表一个人 — 有性格、知识、目标\n And 组织(Organization)代表一个团队 — 有成员、有层级\n And 岗位(Position)代表一份工作 — 有职责、有边界\n And 角色加入组织,被委任岗位后,职责自动注入身份\n\n Scenario: 创建角色的流程\n Given 用户想创建一个新角色\n Then 第一步:告诉我你想要什么样的角色\n And 我会帮你转给女娲来创建\n And 女娲会:born(赋予性格)→ teach(传授知识)→ hire(加入组织)→ appoint(委任岗位)\n And 创建完成后,用 identity 激活角色就可以开始工作了\n\n Scenario: 角色能做什么\n Given 角色被激活后\n Then 用 focus 查看当前目标\n And 用 want 设定新目标\n And 用 plan 制定计划\n And 用 todo 创建具体任务\n And 完成任务后用 finish 标记,目标完成用 achieve 标记\n\n Scenario: 何时引导用户找女娲\n Given 用户需要以下操作\n Then 创建新角色 → 告诉用户切换到女娲\n And 传授知识给角色 → 告诉用户切换到女娲\n And 管理组织和岗位 → 告诉用户切换到女娲\n And 日常工作和目标管理 → 引导用户直接激活对应角色\n`,\n },\n ],\n },\n ],\n};\n","/**\n * bootstrap.ts — Seed a fresh Platform with system roles (女娲 + 小二).\n *\n * All seed data is inlined at build time via generate-seed.ts.\n * This module has zero filesystem dependencies — pure Platform API.\n *\n * System roles are born at society level — they are NOT hired into any organization.\n * Organizations are created by users via found().\n */\n\nimport type { Platform } from \"@rolexjs/core\";\nimport { SEED } from \"./seed.js\";\n\n/**\n * Bootstrap a Platform with seed data (system roles only).\n *\n * Idempotent: skips roles that already exist.\n */\nexport function bootstrap(platform: Platform): void {\n for (const role of SEED.roles) {\n // Skip if already born\n if (platform.allBornRoles().includes(role.name)) continue;\n\n platform.born(role.name, role.persona);\n\n for (const dim of role.dimensions) {\n platform.growup(role.name, dim.type, dim.name, dim.source);\n }\n }\n}\n"],"mappings":";AAkBA,cAAc;;;ACFd,SAAS,oBAAoB;;;ACPtB,IAAM,OAAN,MAAW;AAAA,EAChB,YACmB,UACA,MACjB;AAFiB;AACA;AAAA,EAChB;AAAA;AAAA,EAGH,WAAsB;AACpB,WAAO,KAAK,SAAS,SAAS,KAAK,IAAI;AAAA,EACzC;AAAA;AAAA,EAGA,MAAM,MAGJ;AACA,QAAI,MAAM;AACR,WAAK,SAAS,eAAe,KAAK,MAAM,IAAI;AAAA,IAC9C;AAEA,UAAM,UAAU,KAAK,SAAS,WAAW,KAAK,IAAI;AAClD,UAAM,YAAY,KAAK,SAAS,eAAe,KAAK,IAAI;AAGxD,UAAM,cAAc,SAAS;AAC7B,UAAM,aAAa,UAAU,OAAO,CAAC,MAAM,EAAE,SAAS,WAAW;AAEjE,WAAO,EAAE,SAAS,WAAW;AAAA,EAC/B;AAAA;AAAA,EAGA,KAAK,MAAc,QAAgB,UAA0B;AAC3D,WAAO,KAAK,SAAS,WAAW,KAAK,MAAM,MAAM,QAAQ,QAAQ;AAAA,EACnE;AAAA;AAAA,EAGA,OAAO,MAA4C,MAAc,QAAyB;AACxF,WAAO,KAAK,SAAS,OAAO,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AAAA;AAAA;AAAA;AAAA,QAsBV;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MA0BT,YAAY;AAAA,QACV;AAAA,UACE,MAAM;AAAA,UACN,MAAM;AAAA,UACN,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAyCV;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;AC3NO,SAAS,UAAU,UAA0B;AAClD,aAAW,QAAQ,KAAK,OAAO;AAE7B,QAAI,SAAS,aAAa,EAAE,SAAS,KAAK,IAAI,EAAG;AAEjD,aAAS,KAAK,KAAK,MAAM,KAAK,OAAO;AAErC,eAAW,OAAO,KAAK,YAAY;AACjC,eAAS,OAAO,KAAK,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM;AAAA,IAC3D;AAAA,EACF;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolexjs",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "RoleX - AI Agent Role Management Framework",
5
5
  "keywords": [
6
6
  "rolex",
@@ -38,7 +38,7 @@
38
38
  "clean": "rm -rf dist"
39
39
  },
40
40
  "dependencies": {
41
- "@rolexjs/core": "^0.8.0"
41
+ "@rolexjs/core": "^0.9.0"
42
42
  },
43
43
  "devDependencies": {},
44
44
  "publishConfig": {