@rolexjs/core 1.5.0-dev-20260312103654 → 1.5.0-dev-20260313095759

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
@@ -433,8 +433,12 @@ declare class Role {
433
433
 
434
434
  interface RoleX {
435
435
  activate(individual: string): Promise<Role>;
436
- inspect(id: string): Promise<string>;
437
- survey(type?: string): Promise<string>;
436
+ inspect(id: string, options?: {
437
+ raw?: boolean;
438
+ }): Promise<string | State>;
439
+ survey(type?: string, options?: {
440
+ raw?: boolean;
441
+ }): Promise<string | readonly State[]>;
438
442
  direct<T = unknown>(locator: string, args?: Record<string, unknown>, options?: {
439
443
  raw?: boolean;
440
444
  }): Promise<T>;
@@ -464,8 +468,12 @@ declare class RoleXService implements RoleX {
464
468
  private findOrAutoBorn;
465
469
  private saveSnapshot;
466
470
  private restoreSnapshot;
467
- inspect(id: string): Promise<string>;
468
- survey(type?: string): Promise<string>;
471
+ inspect(id: string, options?: {
472
+ raw?: boolean;
473
+ }): Promise<string | State>;
474
+ survey(type?: string, options?: {
475
+ raw?: boolean;
476
+ }): Promise<string | readonly State[]>;
469
477
  direct<T = unknown>(locator: string, args?: Record<string, unknown>, options?: {
470
478
  raw?: boolean;
471
479
  }): Promise<T>;
@@ -882,11 +890,13 @@ interface RoleXBuilder {
882
890
  /** Inspect any node's full state — world-level observation. */
883
891
  inspect(params: {
884
892
  id: string;
885
- }): Promise<string>;
893
+ raw?: boolean;
894
+ }): Promise<string | State>;
886
895
  /** Survey the world — list individuals, organizations, positions. */
887
896
  survey(params?: {
888
897
  type?: string;
889
- }): Promise<string>;
898
+ raw?: boolean;
899
+ }): Promise<string | readonly State[]>;
890
900
  /** Tool schemas + world instructions — the unified contract for any channel adapter. */
891
901
  readonly protocol: Protocol;
892
902
  /** Universal JSON-RPC 2.0 dispatch. */
package/dist/index.js CHANGED
@@ -3117,21 +3117,23 @@ var RoleXService = class _RoleXService {
3117
3117
  // ================================================================
3118
3118
  // inspect — project any node's subtree
3119
3119
  // ================================================================
3120
- async inspect(id) {
3120
+ async inspect(id, options) {
3121
3121
  const node = await this.find(id);
3122
3122
  if (!node) throw new Error(`"${id}" not found.`);
3123
3123
  const state = await this.project(node);
3124
+ if (options?.raw) return state;
3124
3125
  const result = { state, process: "inspect" };
3125
3126
  return this.renderer.render("inspect", result);
3126
3127
  }
3127
3128
  // ================================================================
3128
3129
  // survey — world-level overview
3129
3130
  // ================================================================
3130
- async survey(type) {
3131
+ async survey(type, options) {
3131
3132
  const target = type === "past" ? this.past : this.society;
3132
3133
  const state = await this.project(target);
3133
3134
  const children = state.children ?? [];
3134
3135
  const filtered = type === "past" ? children : children.filter((c) => type ? c.name === type : c.name !== "past");
3136
+ if (options?.raw) return filtered;
3135
3137
  const result = { state: { ...state, children: filtered }, process: "list" };
3136
3138
  return this.renderer.render("survey.list", result);
3137
3139
  }
@@ -3584,10 +3586,14 @@ function createBuilder(config) {
3584
3586
  return service.activate(params.individual);
3585
3587
  },
3586
3588
  inspect: async (params) => {
3587
- return service.inspect(params.id);
3589
+ return service.inspect(params.id, {
3590
+ raw: params.raw
3591
+ });
3588
3592
  },
3589
3593
  survey: async (params) => {
3590
- return service.survey(params.type);
3594
+ return service.survey(params.type, {
3595
+ raw: params.raw
3596
+ });
3591
3597
  }
3592
3598
  }
3593
3599
  });
@@ -3642,8 +3648,8 @@ function createBuilder(config) {
3642
3648
  get resource() {
3643
3649
  return _resource;
3644
3650
  },
3645
- async inspect({ id }) {
3646
- return call("inspect", { id });
3651
+ async inspect({ id, raw }) {
3652
+ return call("inspect", { id, raw });
3647
3653
  },
3648
3654
  async survey(params) {
3649
3655
  return call("survey", params);