@rolexjs/core 1.5.0-dev-20260312083443 → 1.5.0-dev-20260312103329
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 +14 -19
- package/dist/index.js +32 -37
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -268,7 +268,7 @@ interface CommandResultMap {
|
|
|
268
268
|
"position.dismiss": CommandResult;
|
|
269
269
|
"society.crown": CommandResult;
|
|
270
270
|
"society.uncrown": CommandResult;
|
|
271
|
-
"
|
|
271
|
+
"survey.list": CommandResult;
|
|
272
272
|
"issue.publish": Issue;
|
|
273
273
|
"issue.get": Issue | null;
|
|
274
274
|
"issue.list": Issue[];
|
|
@@ -560,16 +560,10 @@ interface SocietyNamespace {
|
|
|
560
560
|
individual: string;
|
|
561
561
|
}): Promise<CommandResult>;
|
|
562
562
|
}
|
|
563
|
-
interface
|
|
563
|
+
interface IndividualNamespace {
|
|
564
564
|
activate(params: {
|
|
565
565
|
individual: string;
|
|
566
566
|
}): Promise<Role>;
|
|
567
|
-
inspect(params: {
|
|
568
|
-
id: string;
|
|
569
|
-
}): Promise<string>;
|
|
570
|
-
survey(params?: {
|
|
571
|
-
type?: string;
|
|
572
|
-
}): Promise<string>;
|
|
573
567
|
}
|
|
574
568
|
interface OrgNamespace {
|
|
575
569
|
charter(params: {
|
|
@@ -713,11 +707,6 @@ interface ProductNamespace {
|
|
|
713
707
|
product: string;
|
|
714
708
|
}): Promise<CommandResult>;
|
|
715
709
|
}
|
|
716
|
-
interface CensusNamespace {
|
|
717
|
-
list(params?: {
|
|
718
|
-
type?: string;
|
|
719
|
-
}): Promise<CommandResult>;
|
|
720
|
-
}
|
|
721
710
|
interface IssueNamespace {
|
|
722
711
|
publish(params: {
|
|
723
712
|
title: string;
|
|
@@ -866,7 +855,7 @@ declare const protocol: Protocol;
|
|
|
866
855
|
*
|
|
867
856
|
* Usage:
|
|
868
857
|
* const rx = createBuilder({ platform, renderer });
|
|
869
|
-
* const role = await rx.
|
|
858
|
+
* const role = await rx.individual.activate({ individual: "sean" });
|
|
870
859
|
* await rx.society.born({ id: "alice", content: "Feature: Alice" });
|
|
871
860
|
*/
|
|
872
861
|
|
|
@@ -876,8 +865,8 @@ interface RoleXInternal {
|
|
|
876
865
|
interface RoleXBuilder {
|
|
877
866
|
/** Society-level operations — born, retire, crown, teach, train, found, dissolve. */
|
|
878
867
|
readonly society: SocietyNamespace;
|
|
879
|
-
/**
|
|
880
|
-
readonly
|
|
868
|
+
/** Individual operations — activate. */
|
|
869
|
+
readonly individual: IndividualNamespace;
|
|
881
870
|
/** Organization operations — charter, hire, fire, admin, launch, establish. */
|
|
882
871
|
readonly org: OrgNamespace;
|
|
883
872
|
/** Position operations — charge, require, appoint, dismiss. */
|
|
@@ -886,12 +875,18 @@ interface RoleXBuilder {
|
|
|
886
875
|
readonly project: ProjectNamespace;
|
|
887
876
|
/** Product operations — strategy, spec, release, channel, own. */
|
|
888
877
|
readonly product: ProductNamespace;
|
|
889
|
-
/** Census — world-level queries. */
|
|
890
|
-
readonly census: CensusNamespace;
|
|
891
878
|
/** Issue tracking integration. */
|
|
892
879
|
readonly issue: IssueNamespace;
|
|
893
880
|
/** Resource management integration. */
|
|
894
881
|
readonly resource: ResourceNamespace;
|
|
882
|
+
/** Inspect any node's full state — world-level observation. */
|
|
883
|
+
inspect(params: {
|
|
884
|
+
id: string;
|
|
885
|
+
}): Promise<string>;
|
|
886
|
+
/** Survey the world — list individuals, organizations, positions. */
|
|
887
|
+
survey(params?: {
|
|
888
|
+
type?: string;
|
|
889
|
+
}): Promise<string>;
|
|
895
890
|
/** Tool schemas + world instructions — the unified contract for any channel adapter. */
|
|
896
891
|
readonly protocol: Protocol;
|
|
897
892
|
/** Universal JSON-RPC 2.0 dispatch. */
|
|
@@ -991,4 +986,4 @@ declare function toArgs(op: string, args: Record<string, unknown>): unknown[];
|
|
|
991
986
|
|
|
992
987
|
declare const instructions: Record<string, InstructionDef>;
|
|
993
988
|
|
|
994
|
-
export { type ApplyResult, type ArgEntry, type BuilderConfig, type Caller, type
|
|
989
|
+
export { type ApplyResult, type ArgEntry, type BuilderConfig, type Caller, type CommandContext, type CommandResult, type CommandResultMap, type Commands, type ContextData, type IndividualNamespace, type InstructionDef, type IssueNamespace, type JsonRpcError, type JsonRpcRequest, type JsonRpcResponse, type Migration, type MigrationRecord, type OrgNamespace, type ParamDef, type ParamType, type Platform, type PositionNamespace, type ProductNamespace, type ProjectNamespace, type Protocol, type PrototypeData, type PrototypeRepository, type Renderer, RendererRouter, type ResourceNamespace, Role, type RoleDeps, type RoleSnapshot, type RoleX, type RoleXBuilder, type RoleXInternal, type RoleXRepository, RoleXService, RpcHandler, type SocietyNamespace, type ToolDef, abandon, abolish, activate, applyPrototype, appoint, archive, background, born, channel, channelProduct, charge, charter, charterOrg, complete, createBuilder, createCommands, deliverProject, deliverable, deprecate, die, directives, dismiss, disownProduct, dissolve, duty, encounter, enroll, establish, experience, findInState, finish, fire, found, goal, hire, identity, individual, instructions, launch, master, milestone, milestoneProject, mindset, organization, ownProduct, past, plan, planGoal, position, principle, procedure, processes, produceProject, product, project, protocol, realize, reflect, rehire, release, releaseProduct, removeParticipant, requirement, retire, scope, scopeProject, society, spec, specProduct, strategy, strategyProduct, task, toArgs, todo, tone, want, wiki, wikiProject, world };
|
package/dist/index.js
CHANGED
|
@@ -650,21 +650,6 @@ async function applyPrototype(data, repo, direct) {
|
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
652
|
|
|
653
|
-
// src/commands/census.ts
|
|
654
|
-
function censusCommands(ctx, _helpers) {
|
|
655
|
-
const { past: past2, project: project2 } = ctx;
|
|
656
|
-
const societyNode = ctx.society;
|
|
657
|
-
return {
|
|
658
|
-
async "census.list"(type) {
|
|
659
|
-
const target = type === "past" ? past2 : societyNode;
|
|
660
|
-
const state = await project2(target);
|
|
661
|
-
const children = state.children ?? [];
|
|
662
|
-
const filtered = type === "past" ? children : children.filter((c) => type ? c.name === type : c.name !== "past");
|
|
663
|
-
return { state: { ...state, children: filtered }, process: "list" };
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
|
|
668
653
|
// src/commands/helpers.ts
|
|
669
654
|
import { parse } from "@rolexjs/parser";
|
|
670
655
|
import { structure as structure2 } from "@rolexjs/system";
|
|
@@ -1216,6 +1201,21 @@ function societyCommands(ctx, helpers) {
|
|
|
1216
1201
|
};
|
|
1217
1202
|
}
|
|
1218
1203
|
|
|
1204
|
+
// src/commands/survey.ts
|
|
1205
|
+
function surveyCommands(ctx, _helpers) {
|
|
1206
|
+
const { past: past2, project: project2 } = ctx;
|
|
1207
|
+
const societyNode = ctx.society;
|
|
1208
|
+
return {
|
|
1209
|
+
async "survey.list"(type) {
|
|
1210
|
+
const target = type === "past" ? past2 : societyNode;
|
|
1211
|
+
const state = await project2(target);
|
|
1212
|
+
const children = state.children ?? [];
|
|
1213
|
+
const filtered = type === "past" ? children : children.filter((c) => type ? c.name === type : c.name !== "past");
|
|
1214
|
+
return { state: { ...state, children: filtered }, process: "list" };
|
|
1215
|
+
}
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
1219
|
// src/commands/index.ts
|
|
1220
1220
|
function createCommands(ctx) {
|
|
1221
1221
|
const helpers = createHelpers(ctx);
|
|
@@ -1225,7 +1225,7 @@ function createCommands(ctx) {
|
|
|
1225
1225
|
...positionCommands(ctx, helpers),
|
|
1226
1226
|
...projectCommands(ctx, helpers),
|
|
1227
1227
|
...productCommands(ctx, helpers),
|
|
1228
|
-
...
|
|
1228
|
+
...surveyCommands(ctx, helpers),
|
|
1229
1229
|
...resourceCommands(ctx, helpers),
|
|
1230
1230
|
...issueCommands(ctx, helpers)
|
|
1231
1231
|
};
|
|
@@ -2120,8 +2120,8 @@ var societyUncrown = def(
|
|
|
2120
2120
|
);
|
|
2121
2121
|
|
|
2122
2122
|
// src/instructions/index.ts
|
|
2123
|
-
var
|
|
2124
|
-
"
|
|
2123
|
+
var surveyList = def(
|
|
2124
|
+
"survey",
|
|
2125
2125
|
"list",
|
|
2126
2126
|
{
|
|
2127
2127
|
type: {
|
|
@@ -2201,8 +2201,8 @@ var instructions = {
|
|
|
2201
2201
|
// society — internal
|
|
2202
2202
|
"society.crown": societyCrown,
|
|
2203
2203
|
"society.uncrown": societyUncrown,
|
|
2204
|
-
//
|
|
2205
|
-
"
|
|
2204
|
+
// survey
|
|
2205
|
+
"survey.list": surveyList,
|
|
2206
2206
|
// prototype
|
|
2207
2207
|
"prototype.evict": prototypeEvict,
|
|
2208
2208
|
// resource
|
|
@@ -3133,7 +3133,7 @@ var RoleXService = class _RoleXService {
|
|
|
3133
3133
|
const children = state.children ?? [];
|
|
3134
3134
|
const filtered = type === "past" ? children : children.filter((c) => type ? c.name === type : c.name !== "past");
|
|
3135
3135
|
const result = { state: { ...state, children: filtered }, process: "list" };
|
|
3136
|
-
return this.renderer.render("
|
|
3136
|
+
return this.renderer.render("survey.list", result);
|
|
3137
3137
|
}
|
|
3138
3138
|
// ================================================================
|
|
3139
3139
|
// direct — world-level command dispatch
|
|
@@ -3228,11 +3228,9 @@ function createSocietyNamespace(call) {
|
|
|
3228
3228
|
uncrown: (p5) => call("society.uncrown", p5)
|
|
3229
3229
|
};
|
|
3230
3230
|
}
|
|
3231
|
-
function
|
|
3231
|
+
function createIndividualNamespace(call) {
|
|
3232
3232
|
return {
|
|
3233
|
-
activate: (p5) => call("role.activate", p5)
|
|
3234
|
-
inspect: (p5) => call("inspect", p5),
|
|
3235
|
-
survey: (p5) => call("survey", p5)
|
|
3233
|
+
activate: (p5) => call("role.activate", p5)
|
|
3236
3234
|
};
|
|
3237
3235
|
}
|
|
3238
3236
|
function createOrgNamespace(call) {
|
|
@@ -3281,11 +3279,6 @@ function createProductNamespace(call) {
|
|
|
3281
3279
|
deprecate: (p5) => call("product.deprecate", p5)
|
|
3282
3280
|
};
|
|
3283
3281
|
}
|
|
3284
|
-
function createCensusNamespace(call) {
|
|
3285
|
-
return {
|
|
3286
|
-
list: (p5) => call("census.list", p5)
|
|
3287
|
-
};
|
|
3288
|
-
}
|
|
3289
3282
|
function createIssueNamespace(call) {
|
|
3290
3283
|
return {
|
|
3291
3284
|
publish: (p5) => call("issue.publish", p5),
|
|
@@ -3617,20 +3610,19 @@ function createBuilder(config) {
|
|
|
3617
3610
|
return response.result;
|
|
3618
3611
|
};
|
|
3619
3612
|
const _society = createSocietyNamespace(call);
|
|
3620
|
-
const
|
|
3613
|
+
const _individual = createIndividualNamespace(call);
|
|
3621
3614
|
const _org = createOrgNamespace(call);
|
|
3622
3615
|
const _position = createPositionNamespace(call);
|
|
3623
3616
|
const _project = createProjectNamespace(call);
|
|
3624
3617
|
const _product = createProductNamespace(call);
|
|
3625
|
-
const _census = createCensusNamespace(call);
|
|
3626
3618
|
const _issue = createIssueNamespace(call);
|
|
3627
3619
|
const _resource = createResourceNamespace(call);
|
|
3628
3620
|
return {
|
|
3629
3621
|
get society() {
|
|
3630
3622
|
return _society;
|
|
3631
3623
|
},
|
|
3632
|
-
get
|
|
3633
|
-
return
|
|
3624
|
+
get individual() {
|
|
3625
|
+
return _individual;
|
|
3634
3626
|
},
|
|
3635
3627
|
get org() {
|
|
3636
3628
|
return _org;
|
|
@@ -3644,15 +3636,18 @@ function createBuilder(config) {
|
|
|
3644
3636
|
get product() {
|
|
3645
3637
|
return _product;
|
|
3646
3638
|
},
|
|
3647
|
-
get census() {
|
|
3648
|
-
return _census;
|
|
3649
|
-
},
|
|
3650
3639
|
get issue() {
|
|
3651
3640
|
return _issue;
|
|
3652
3641
|
},
|
|
3653
3642
|
get resource() {
|
|
3654
3643
|
return _resource;
|
|
3655
3644
|
},
|
|
3645
|
+
async inspect({ id }) {
|
|
3646
|
+
return call("inspect", { id });
|
|
3647
|
+
},
|
|
3648
|
+
async survey(params) {
|
|
3649
|
+
return call("survey", params);
|
|
3650
|
+
},
|
|
3656
3651
|
protocol,
|
|
3657
3652
|
async rpc(request) {
|
|
3658
3653
|
const { handler } = await ensureInit();
|