@agents-uni/core 0.1.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/DESIGN.md +283 -0
- package/LICENSE +21 -0
- package/README.en.md +589 -0
- package/README.md +589 -0
- package/dist/bridge/config-sync.d.ts +24 -0
- package/dist/bridge/config-sync.d.ts.map +1 -0
- package/dist/bridge/config-sync.js +39 -0
- package/dist/bridge/config-sync.js.map +1 -0
- package/dist/bridge/index.d.ts +7 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +7 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/bridge/openclaw-adapter.d.ts +49 -0
- package/dist/bridge/openclaw-adapter.d.ts.map +1 -0
- package/dist/bridge/openclaw-adapter.js +151 -0
- package/dist/bridge/openclaw-adapter.js.map +1 -0
- package/dist/bridge/soul-generator.d.ts +34 -0
- package/dist/bridge/soul-generator.d.ts.map +1 -0
- package/dist/bridge/soul-generator.js +149 -0
- package/dist/bridge/soul-generator.js.map +1 -0
- package/dist/bridge/task-dispatcher.d.ts +107 -0
- package/dist/bridge/task-dispatcher.d.ts.map +1 -0
- package/dist/bridge/task-dispatcher.js +217 -0
- package/dist/bridge/task-dispatcher.js.map +1 -0
- package/dist/bridge/uni-registry.d.ts +82 -0
- package/dist/bridge/uni-registry.d.ts.map +1 -0
- package/dist/bridge/uni-registry.js +261 -0
- package/dist/bridge/uni-registry.js.map +1 -0
- package/dist/bridge/workspace-io.d.ts +64 -0
- package/dist/bridge/workspace-io.d.ts.map +1 -0
- package/dist/bridge/workspace-io.js +99 -0
- package/dist/bridge/workspace-io.js.map +1 -0
- package/dist/cli/commands/deploy.d.ts +6 -0
- package/dist/cli/commands/deploy.d.ts.map +1 -0
- package/dist/cli/commands/deploy.js +48 -0
- package/dist/cli/commands/deploy.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +137 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/inspect.d.ts +4 -0
- package/dist/cli/commands/inspect.d.ts.map +1 -0
- package/dist/cli/commands/inspect.js +77 -0
- package/dist/cli/commands/inspect.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +2 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +30 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/commands/visualize.d.ts +2 -0
- package/dist/cli/commands/visualize.d.ts.map +1 -0
- package/dist/cli/commands/visualize.js +69 -0
- package/dist/cli/commands/visualize.js.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +132 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/agent-registry.d.ts +37 -0
- package/dist/core/agent-registry.d.ts.map +1 -0
- package/dist/core/agent-registry.js +97 -0
- package/dist/core/agent-registry.js.map +1 -0
- package/dist/core/event-bus.d.ts +34 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +96 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +8 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/permission-matrix.d.ts +35 -0
- package/dist/core/permission-matrix.d.ts.map +1 -0
- package/dist/core/permission-matrix.js +95 -0
- package/dist/core/permission-matrix.js.map +1 -0
- package/dist/core/relationship-graph.d.ts +50 -0
- package/dist/core/relationship-graph.d.ts.map +1 -0
- package/dist/core/relationship-graph.js +150 -0
- package/dist/core/relationship-graph.js.map +1 -0
- package/dist/core/resource-pool.d.ts +48 -0
- package/dist/core/resource-pool.d.ts.map +1 -0
- package/dist/core/resource-pool.js +205 -0
- package/dist/core/resource-pool.js.map +1 -0
- package/dist/core/state-machine.d.ts +47 -0
- package/dist/core/state-machine.d.ts.map +1 -0
- package/dist/core/state-machine.js +110 -0
- package/dist/core/state-machine.js.map +1 -0
- package/dist/core/universe.d.ts +38 -0
- package/dist/core/universe.d.ts.map +1 -0
- package/dist/core/universe.js +101 -0
- package/dist/core/universe.js.map +1 -0
- package/dist/dashboard/api.d.ts +10 -0
- package/dist/dashboard/api.d.ts.map +1 -0
- package/dist/dashboard/api.js +237 -0
- package/dist/dashboard/api.js.map +1 -0
- package/dist/dashboard/index.d.ts +3 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +3 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/dashboard/server.d.ts +31 -0
- package/dist/dashboard/server.d.ts.map +1 -0
- package/dist/dashboard/server.js +44 -0
- package/dist/dashboard/server.js.map +1 -0
- package/dist/dashboard/templates.d.ts +47 -0
- package/dist/dashboard/templates.d.ts.map +1 -0
- package/dist/dashboard/templates.js +1481 -0
- package/dist/dashboard/templates.js.map +1 -0
- package/dist/evolution/index.d.ts +5 -0
- package/dist/evolution/index.d.ts.map +1 -0
- package/dist/evolution/index.js +5 -0
- package/dist/evolution/index.js.map +1 -0
- package/dist/evolution/memory-consolidator.d.ts +28 -0
- package/dist/evolution/memory-consolidator.d.ts.map +1 -0
- package/dist/evolution/memory-consolidator.js +84 -0
- package/dist/evolution/memory-consolidator.js.map +1 -0
- package/dist/evolution/performance-tracker.d.ts +29 -0
- package/dist/evolution/performance-tracker.d.ts.map +1 -0
- package/dist/evolution/performance-tracker.js +90 -0
- package/dist/evolution/performance-tracker.js.map +1 -0
- package/dist/evolution/promotion-engine.d.ts +32 -0
- package/dist/evolution/promotion-engine.d.ts.map +1 -0
- package/dist/evolution/promotion-engine.js +117 -0
- package/dist/evolution/promotion-engine.js.map +1 -0
- package/dist/evolution/relationship-evolver.d.ts +40 -0
- package/dist/evolution/relationship-evolver.d.ts.map +1 -0
- package/dist/evolution/relationship-evolver.js +105 -0
- package/dist/evolution/relationship-evolver.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/index.d.ts +13 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +18 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/universe.schema.json +214 -0
- package/dist/spec/compiler.d.ts +16 -0
- package/dist/spec/compiler.d.ts.map +1 -0
- package/dist/spec/compiler.js +26 -0
- package/dist/spec/compiler.js.map +1 -0
- package/dist/spec/index.d.ts +4 -0
- package/dist/spec/index.d.ts.map +1 -0
- package/dist/spec/index.js +4 -0
- package/dist/spec/index.js.map +1 -0
- package/dist/spec/parser.d.ts +11 -0
- package/dist/spec/parser.d.ts.map +1 -0
- package/dist/spec/parser.js +89 -0
- package/dist/spec/parser.js.map +1 -0
- package/dist/spec/validator.d.ts +9 -0
- package/dist/spec/validator.d.ts.map +1 -0
- package/dist/spec/validator.js +105 -0
- package/dist/spec/validator.js.map +1 -0
- package/dist/types/agent.d.ts +56 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +8 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/event.d.ts +34 -0
- package/dist/types/event.d.ts.map +1 -0
- package/dist/types/event.js +11 -0
- package/dist/types/event.js.map +1 -0
- package/dist/types/governance.d.ts +48 -0
- package/dist/types/governance.d.ts.map +1 -0
- package/dist/types/governance.js +9 -0
- package/dist/types/governance.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +9 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/memory.d.ts +73 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/memory.js +9 -0
- package/dist/types/memory.js.map +1 -0
- package/dist/types/protocol.d.ts +48 -0
- package/dist/types/protocol.d.ts.map +1 -0
- package/dist/types/protocol.js +9 -0
- package/dist/types/protocol.js.map +1 -0
- package/dist/types/relationship.d.ts +40 -0
- package/dist/types/relationship.d.ts.map +1 -0
- package/dist/types/relationship.js +9 -0
- package/dist/types/relationship.js.map +1 -0
- package/dist/types/resource.d.ts +52 -0
- package/dist/types/resource.d.ts.map +1 -0
- package/dist/types/resource.js +9 -0
- package/dist/types/resource.js.map +1 -0
- package/dist/types/universe.d.ts +71 -0
- package/dist/types/universe.d.ts.map +1 -0
- package/dist/types/universe.js +9 -0
- package/dist/types/universe.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent and Role definitions — the fundamental unit of a Universe.
|
|
3
|
+
*
|
|
4
|
+
* An Agent is not just an LLM wrapper; it is a *citizen* with identity,
|
|
5
|
+
* position, responsibilities, and social standing within an organization.
|
|
6
|
+
*/
|
|
7
|
+
export interface AgentDefinition {
|
|
8
|
+
/** Unique identifier within the universe */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Display name */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Role this agent fulfills */
|
|
13
|
+
role: RoleDefinition;
|
|
14
|
+
/** Hierarchical rank (higher = more authority). 0-100 scale. */
|
|
15
|
+
rank?: number;
|
|
16
|
+
/** Personality dimensions (0-1 scale). Used for SOUL.md generation. */
|
|
17
|
+
traits?: Record<string, number>;
|
|
18
|
+
/** What this agent can do (skill names, tool names) */
|
|
19
|
+
capabilities?: string[];
|
|
20
|
+
/** Hard constraints on behavior */
|
|
21
|
+
constraints?: string[];
|
|
22
|
+
/** Custom metadata */
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface RoleDefinition {
|
|
26
|
+
/** Role title (e.g., "中书令", "CEO", "皇贵妃") */
|
|
27
|
+
title: string;
|
|
28
|
+
/** Department or faction this role belongs to */
|
|
29
|
+
department?: string;
|
|
30
|
+
/** What this role is responsible for */
|
|
31
|
+
duties: string[];
|
|
32
|
+
/** Permitted actions (used by PermissionMatrix) */
|
|
33
|
+
permissions: string[];
|
|
34
|
+
/** SOUL.md template name for OpenClaw integration */
|
|
35
|
+
soulTemplate?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Runtime representation of an agent within a live Universe.
|
|
39
|
+
* Extends the static definition with mutable state.
|
|
40
|
+
*/
|
|
41
|
+
export interface Citizen {
|
|
42
|
+
/** The underlying definition */
|
|
43
|
+
definition: AgentDefinition;
|
|
44
|
+
/** Current status */
|
|
45
|
+
status: CitizenStatus;
|
|
46
|
+
/** Performance score (0-100, rolling average) */
|
|
47
|
+
performanceScore: number;
|
|
48
|
+
/** Accumulated resources */
|
|
49
|
+
resources: Record<string, number>;
|
|
50
|
+
/** When this citizen joined the universe */
|
|
51
|
+
joinedAt: string;
|
|
52
|
+
/** Custom runtime state */
|
|
53
|
+
state: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
export type CitizenStatus = 'active' | 'idle' | 'suspended' | 'eliminated' | 'probation';
|
|
56
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,mDAAmD;IACnD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,gCAAgC;IAChC,UAAU,EAAE,eAAe,CAAC;IAC5B,qBAAqB;IACrB,MAAM,EAAE,aAAa,CAAC;IACtB,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,CAAC;IACzB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,MAAM,GACN,WAAW,GACX,YAAY,GACZ,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent and Role definitions — the fundamental unit of a Universe.
|
|
3
|
+
*
|
|
4
|
+
* An Agent is not just an LLM wrapper; it is a *citizen* with identity,
|
|
5
|
+
* position, responsibilities, and social standing within an organization.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organization Events — the observable side effects of organizational life.
|
|
3
|
+
*
|
|
4
|
+
* Events are first-class citizens, not an afterthought. Every meaningful
|
|
5
|
+
* change in the universe emits an event. This enables:
|
|
6
|
+
* 1. Complete audit trail
|
|
7
|
+
* 2. Reactive evolution (relationships change in response to events)
|
|
8
|
+
* 3. Narrative generation (events → human-readable story)
|
|
9
|
+
*/
|
|
10
|
+
export type OrganizationEventType = 'agent.joined' | 'agent.promoted' | 'agent.demoted' | 'agent.suspended' | 'agent.eliminated' | 'agent.reinstated' | 'alliance.formed' | 'alliance.broken' | 'rivalry.started' | 'rivalry.resolved' | 'resource.allocated' | 'resource.transferred' | 'resource.decayed' | 'task.created' | 'task.assigned' | 'task.completed' | 'task.failed' | 'review.approved' | 'review.rejected' | 'protocol.stateChanged' | 'governance.changed' | 'evolution.cycleCompleted' | 'race.dispatched' | 'race.submitted' | 'race.collected' | 'race.judged' | 'custom';
|
|
11
|
+
export interface OrganizationEvent {
|
|
12
|
+
/** Unique event ID */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Event classification */
|
|
15
|
+
type: OrganizationEventType;
|
|
16
|
+
/** When this event occurred */
|
|
17
|
+
timestamp: string;
|
|
18
|
+
/** Agents involved in this event */
|
|
19
|
+
actors: string[];
|
|
20
|
+
/** Event-specific payload */
|
|
21
|
+
data: Record<string, unknown>;
|
|
22
|
+
/** Human-readable narrative of what happened */
|
|
23
|
+
narrative: string;
|
|
24
|
+
}
|
|
25
|
+
export type EventHandler = (event: OrganizationEvent) => void | Promise<void>;
|
|
26
|
+
export interface EventSubscription {
|
|
27
|
+
/** Event types to listen for (empty = all) */
|
|
28
|
+
types: OrganizationEventType[];
|
|
29
|
+
/** Handler function */
|
|
30
|
+
handler: EventHandler;
|
|
31
|
+
/** Unique subscription ID */
|
|
32
|
+
id: string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/types/event.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,qBAAqB,GAC7B,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,sBAAsB,GACtB,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,aAAa,GACb,iBAAiB,GACjB,iBAAiB,GACjB,uBAAuB,GACvB,oBAAoB,GACpB,0BAA0B,GAC1B,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,aAAa,GACb,QAAQ,CAAC;AAEb,MAAM,WAAW,iBAAiB;IAChC,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9E,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,uBAAuB;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organization Events — the observable side effects of organizational life.
|
|
3
|
+
*
|
|
4
|
+
* Events are first-class citizens, not an afterthought. Every meaningful
|
|
5
|
+
* change in the universe emits an event. This enables:
|
|
6
|
+
* 1. Complete audit trail
|
|
7
|
+
* 2. Reactive evolution (relationships change in response to events)
|
|
8
|
+
* 3. Narrative generation (events → human-readable story)
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/types/event.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Governance — the rules by which an organization makes decisions.
|
|
3
|
+
*
|
|
4
|
+
* Key insight: mandatory institutional review
|
|
5
|
+
* prevents hallucination propagation. The governance model defines
|
|
6
|
+
* WHO reviews WHOM, WHO can promote/demote, and HOW decisions are made.
|
|
7
|
+
*/
|
|
8
|
+
export type DecisionModel = 'autocratic' | 'democratic' | 'consensus' | 'meritocratic';
|
|
9
|
+
export interface GovernanceConfig {
|
|
10
|
+
/** How decisions are made in this organization */
|
|
11
|
+
decisionModel: DecisionModel;
|
|
12
|
+
/** Explicit permission entries (who can do what to whom) */
|
|
13
|
+
permissionMatrix: PermissionEntry[];
|
|
14
|
+
/** Review/approval policy */
|
|
15
|
+
reviewPolicy: ReviewPolicy;
|
|
16
|
+
/** What happens when things go wrong or stall */
|
|
17
|
+
escalationRules: EscalationRule[];
|
|
18
|
+
}
|
|
19
|
+
export interface PermissionEntry {
|
|
20
|
+
/** Who is acting (agent ID or role title) */
|
|
21
|
+
actor: string;
|
|
22
|
+
/** Who is being acted upon (agent ID or role title) */
|
|
23
|
+
target: string;
|
|
24
|
+
/** What actions are permitted */
|
|
25
|
+
actions: PermissionAction[];
|
|
26
|
+
}
|
|
27
|
+
export type PermissionAction = 'call' | 'assign' | 'review' | 'approve' | 'reject' | 'promote' | 'demote' | 'suspend' | 'eliminate' | 'allocate';
|
|
28
|
+
export interface ReviewPolicy {
|
|
29
|
+
/** Is review mandatory before work proceeds? */
|
|
30
|
+
mandatory: boolean;
|
|
31
|
+
/** Which roles can serve as reviewers */
|
|
32
|
+
reviewers: string[];
|
|
33
|
+
/** Maximum review rounds before auto-approve */
|
|
34
|
+
maxRounds: number;
|
|
35
|
+
/** Auto-approve after N rounds if still unresolved */
|
|
36
|
+
autoApproveAfter?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface EscalationRule {
|
|
39
|
+
/** Condition that triggers escalation */
|
|
40
|
+
trigger: string;
|
|
41
|
+
/** Who to escalate to (agent ID or role) */
|
|
42
|
+
escalateTo: string;
|
|
43
|
+
/** Action to take */
|
|
44
|
+
action: 'notify' | 'reassign' | 'override' | 'cancel';
|
|
45
|
+
/** Timeout before escalation kicks in (ms) */
|
|
46
|
+
timeoutMs?: number;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=governance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance.d.ts","sourceRoot":"","sources":["../../src/types/governance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,cAAc,CAAC;AAEnB,MAAM,WAAW,gBAAgB;IAC/B,kDAAkD;IAClD,aAAa,EAAE,aAAa,CAAC;IAC7B,4DAA4D;IAC5D,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,6BAA6B;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,iDAAiD;IACjD,eAAe,EAAE,cAAc,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,WAAW,GACX,UAAU,CAAC;AAEf,MAAM,WAAW,YAAY;IAC3B,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;IACtD,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Governance — the rules by which an organization makes decisions.
|
|
3
|
+
*
|
|
4
|
+
* Key insight: mandatory institutional review
|
|
5
|
+
* prevents hallucination propagation. The governance model defines
|
|
6
|
+
* WHO reviews WHOM, WHO can promote/demote, and HOW decisions are made.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=governance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance.js","sourceRoot":"","sources":["../../src/types/governance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './agent.js';
|
|
2
|
+
export * from './relationship.js';
|
|
3
|
+
export * from './protocol.js';
|
|
4
|
+
export * from './governance.js';
|
|
5
|
+
export * from './resource.js';
|
|
6
|
+
export * from './memory.js';
|
|
7
|
+
export * from './event.js';
|
|
8
|
+
export * from './universe.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './agent.js';
|
|
2
|
+
export * from './relationship.js';
|
|
3
|
+
export * from './protocol.js';
|
|
4
|
+
export * from './governance.js';
|
|
5
|
+
export * from './resource.js';
|
|
6
|
+
export * from './memory.js';
|
|
7
|
+
export * from './event.js';
|
|
8
|
+
export * from './universe.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organization Memory and Evolution — how organizations learn and adapt.
|
|
3
|
+
*
|
|
4
|
+
* Individual agents have their own memory (via OpenClaw). But organizations
|
|
5
|
+
* also need collective memory: what strategies worked, which agents excel
|
|
6
|
+
* at what, how relationships evolved over time.
|
|
7
|
+
*/
|
|
8
|
+
export interface EvolutionConfig {
|
|
9
|
+
/** How many recent tasks to consider for performance evaluation */
|
|
10
|
+
performanceWindow: number;
|
|
11
|
+
/** Score threshold to earn promotion (0-100) */
|
|
12
|
+
promotionThreshold: number;
|
|
13
|
+
/** Score below which demotion occurs (0-100) */
|
|
14
|
+
demotionThreshold: number;
|
|
15
|
+
/** Maximum events to keep in organization memory */
|
|
16
|
+
memoryRetention: number;
|
|
17
|
+
/** How often to run evolution cycle (ms). 0 = manual only. */
|
|
18
|
+
evolutionInterval?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface OrganizationMemory {
|
|
21
|
+
/** Key lessons the organization has learned */
|
|
22
|
+
lessons: Lesson[];
|
|
23
|
+
/** Performance history per agent */
|
|
24
|
+
performanceHistory: Record<string, PerformanceRecord[]>;
|
|
25
|
+
/** Relationship evolution timeline */
|
|
26
|
+
relationshipTimeline: RelationshipSnapshot[];
|
|
27
|
+
/** Resource distribution history */
|
|
28
|
+
resourceHistory: ResourceSnapshot[];
|
|
29
|
+
}
|
|
30
|
+
export interface Lesson {
|
|
31
|
+
/** Unique identifier */
|
|
32
|
+
id: string;
|
|
33
|
+
/** What was learned */
|
|
34
|
+
content: string;
|
|
35
|
+
/** Context in which it was learned */
|
|
36
|
+
context: string;
|
|
37
|
+
/** Which agents were involved */
|
|
38
|
+
agents: string[];
|
|
39
|
+
/** When this lesson was recorded */
|
|
40
|
+
learnedAt: string;
|
|
41
|
+
/** How many times this lesson has been reinforced */
|
|
42
|
+
reinforcements: number;
|
|
43
|
+
}
|
|
44
|
+
export interface PerformanceRecord {
|
|
45
|
+
/** Agent being evaluated */
|
|
46
|
+
agentId: string;
|
|
47
|
+
/** Task or match that was evaluated */
|
|
48
|
+
taskId: string;
|
|
49
|
+
/** Overall score (0-100) */
|
|
50
|
+
score: number;
|
|
51
|
+
/** Breakdown by dimension */
|
|
52
|
+
dimensions: Record<string, number>;
|
|
53
|
+
/** When this was recorded */
|
|
54
|
+
evaluatedAt: string;
|
|
55
|
+
}
|
|
56
|
+
export interface RelationshipSnapshot {
|
|
57
|
+
/** Timestamp of snapshot */
|
|
58
|
+
timestamp: string;
|
|
59
|
+
/** All relationships at this point in time */
|
|
60
|
+
relationships: Array<{
|
|
61
|
+
from: string;
|
|
62
|
+
to: string;
|
|
63
|
+
type: string;
|
|
64
|
+
weight: number;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
export interface ResourceSnapshot {
|
|
68
|
+
/** Timestamp of snapshot */
|
|
69
|
+
timestamp: string;
|
|
70
|
+
/** Resource allocations at this point */
|
|
71
|
+
allocations: Record<string, Record<string, number>>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/types/memory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gDAAgD;IAChD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,eAAe,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oCAAoC;IACpC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACxD,sCAAsC;IACtC,oBAAoB,EAAE,oBAAoB,EAAE,CAAC;IAC7C,oCAAoC;IACpC,eAAe,EAAE,gBAAgB,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,MAAM;IACrB,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,aAAa,EAAE,KAAK,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,gBAAgB;IAC/B,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organization Memory and Evolution — how organizations learn and adapt.
|
|
3
|
+
*
|
|
4
|
+
* Individual agents have their own memory (via OpenClaw). But organizations
|
|
5
|
+
* also need collective memory: what strategies worked, which agents excel
|
|
6
|
+
* at what, how relationships evolved over time.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/types/memory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol definitions — state machines that govern organizational workflows.
|
|
3
|
+
*
|
|
4
|
+
* Every organizational process (task dispatch, competition, promotion)
|
|
5
|
+
* reduces to a state machine with role-gated transitions.
|
|
6
|
+
* This is the universal primitive that makes organizations predictable.
|
|
7
|
+
*/
|
|
8
|
+
export interface ProtocolDefinition {
|
|
9
|
+
/** Protocol identifier */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Human-readable description */
|
|
12
|
+
description: string;
|
|
13
|
+
/** All possible states in this protocol */
|
|
14
|
+
states: StateDefinition[];
|
|
15
|
+
/** Rules for moving between states */
|
|
16
|
+
transitions: TransitionRule[];
|
|
17
|
+
/** Which roles can act in which states */
|
|
18
|
+
roles: Record<string, string[]>;
|
|
19
|
+
}
|
|
20
|
+
export interface StateDefinition {
|
|
21
|
+
/** State identifier */
|
|
22
|
+
name: string;
|
|
23
|
+
/** Display label */
|
|
24
|
+
label: string;
|
|
25
|
+
/** Which role "owns" this state (responsible for advancing it) */
|
|
26
|
+
owner?: string;
|
|
27
|
+
/** Is this a terminal state? (No outgoing transitions) */
|
|
28
|
+
terminal?: boolean;
|
|
29
|
+
/** Maximum time allowed in this state (ms) before escalation */
|
|
30
|
+
timeout?: number;
|
|
31
|
+
/** Icon or emoji for visualization */
|
|
32
|
+
icon?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface TransitionRule {
|
|
35
|
+
/** Source state */
|
|
36
|
+
from: string;
|
|
37
|
+
/** Target state */
|
|
38
|
+
to: string;
|
|
39
|
+
/** Condition expression (simple DSL: "review.approved", "score > 80") */
|
|
40
|
+
guard?: string;
|
|
41
|
+
/** Side effect to trigger on transition */
|
|
42
|
+
action?: string;
|
|
43
|
+
/** Which role is required to trigger this transition */
|
|
44
|
+
requiredRole?: string;
|
|
45
|
+
/** Human-readable label for this transition */
|
|
46
|
+
label?: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/types/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,sCAAsC;IACtC,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol definitions — state machines that govern organizational workflows.
|
|
3
|
+
*
|
|
4
|
+
* Every organizational process (task dispatch, competition, promotion)
|
|
5
|
+
* reduces to a state machine with role-gated transitions.
|
|
6
|
+
* This is the universal primitive that makes organizations predictable.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/types/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relationship types — the social fabric of a Universe.
|
|
3
|
+
*
|
|
4
|
+
* Key insight: agent collaboration quality is determined not by individual
|
|
5
|
+
* capability, but by the structure of relationships between agents.
|
|
6
|
+
* A well-designed relationship graph IS the production relationship.
|
|
7
|
+
*/
|
|
8
|
+
export type RelationshipType = 'superior' | 'subordinate' | 'peer' | 'competitive' | 'reviewer' | 'advisor' | 'ally' | 'rival' | 'mentor' | 'delegate' | 'serves';
|
|
9
|
+
export interface RelationshipDefinition {
|
|
10
|
+
/** Source agent ID */
|
|
11
|
+
from: string;
|
|
12
|
+
/** Target agent ID */
|
|
13
|
+
to: string;
|
|
14
|
+
/** Nature of the relationship */
|
|
15
|
+
type: RelationshipType;
|
|
16
|
+
/** Strength of the relationship (0-1). Higher = stronger bond/rivalry. */
|
|
17
|
+
weight?: number;
|
|
18
|
+
/** Can this relationship change during universe evolution? */
|
|
19
|
+
mutable?: boolean;
|
|
20
|
+
/** Relationship-specific metadata */
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Runtime relationship with mutable state for evolution tracking.
|
|
25
|
+
*/
|
|
26
|
+
export interface LiveRelationship extends RelationshipDefinition {
|
|
27
|
+
/** Current weight (may differ from initial if mutable) */
|
|
28
|
+
currentWeight: number;
|
|
29
|
+
/** When this relationship was established */
|
|
30
|
+
establishedAt: string;
|
|
31
|
+
/** History of weight changes */
|
|
32
|
+
history: RelationshipEvent[];
|
|
33
|
+
}
|
|
34
|
+
export interface RelationshipEvent {
|
|
35
|
+
timestamp: string;
|
|
36
|
+
previousWeight: number;
|
|
37
|
+
newWeight: number;
|
|
38
|
+
reason: string;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=relationship.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationship.d.ts","sourceRoot":"","sources":["../../src/types/relationship.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,aAAa,GACb,MAAM,GACN,aAAa,GACb,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,WAAW,sBAAsB;IACrC,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC9D,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relationship types — the social fabric of a Universe.
|
|
3
|
+
*
|
|
4
|
+
* Key insight: agent collaboration quality is determined not by individual
|
|
5
|
+
* capability, but by the structure of relationships between agents.
|
|
6
|
+
* A well-designed relationship graph IS the production relationship.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=relationship.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationship.js","sourceRoot":"","sources":["../../src/types/relationship.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource definitions — the alignment mechanism for agent behavior.
|
|
3
|
+
*
|
|
4
|
+
* Key insight: agents optimize for resource acquisition. By designing
|
|
5
|
+
* the resource structure, you align agent behavior with organizational goals.
|
|
6
|
+
* Finite resources create competition; renewable resources create cooperation.
|
|
7
|
+
*/
|
|
8
|
+
export type ResourceType = 'finite' | 'renewable' | 'positional';
|
|
9
|
+
export type DistributionStrategy = 'equal' | 'merit' | 'hierarchy' | 'competitive';
|
|
10
|
+
export interface ResourceDefinition {
|
|
11
|
+
/** Resource identifier */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Resource behavior type */
|
|
14
|
+
type: ResourceType;
|
|
15
|
+
/** Total amount available in the universe */
|
|
16
|
+
total: number;
|
|
17
|
+
/** How this resource is distributed */
|
|
18
|
+
distribution: DistributionStrategy;
|
|
19
|
+
/** For renewable resources: refresh interval in ms */
|
|
20
|
+
refreshInterval?: number;
|
|
21
|
+
/** Decay rate per cycle (0-1). 0 = no decay, 1 = fully decays. */
|
|
22
|
+
decayRate?: number;
|
|
23
|
+
/** Human-readable description */
|
|
24
|
+
description?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ResourceAllocation {
|
|
27
|
+
/** Which agent holds this allocation */
|
|
28
|
+
agentId: string;
|
|
29
|
+
/** Resource name */
|
|
30
|
+
resource: string;
|
|
31
|
+
/** Amount allocated */
|
|
32
|
+
amount: number;
|
|
33
|
+
/** When this allocation was made */
|
|
34
|
+
acquiredAt: string;
|
|
35
|
+
/** When this allocation expires (for renewable/positional) */
|
|
36
|
+
expiresAt?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ResourceTransfer {
|
|
39
|
+
/** Source agent (or 'system' for system grants) */
|
|
40
|
+
from: string;
|
|
41
|
+
/** Target agent */
|
|
42
|
+
to: string;
|
|
43
|
+
/** Resource name */
|
|
44
|
+
resource: string;
|
|
45
|
+
/** Amount transferred */
|
|
46
|
+
amount: number;
|
|
47
|
+
/** Reason for transfer */
|
|
48
|
+
reason: string;
|
|
49
|
+
/** Timestamp */
|
|
50
|
+
timestamp: string;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/types/resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,WAAW,GACX,YAAY,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAC5B,OAAO,GACP,OAAO,GACP,WAAW,GACX,aAAa,CAAC;AAElB,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,YAAY,EAAE,oBAAoB,CAAC;IACnC,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource definitions — the alignment mechanism for agent behavior.
|
|
3
|
+
*
|
|
4
|
+
* Key insight: agents optimize for resource acquisition. By designing
|
|
5
|
+
* the resource structure, you align agent behavior with organizational goals.
|
|
6
|
+
* Finite resources create competition; renewable resources create cooperation.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../src/types/resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universe — the top-level container for an agent organization.
|
|
3
|
+
*
|
|
4
|
+
* A Universe is to agents what a society is to people:
|
|
5
|
+
* it defines the rules, relationships, resources, and evolutionary
|
|
6
|
+
* pressures that shape how agents collaborate or compete.
|
|
7
|
+
*/
|
|
8
|
+
import type { AgentDefinition } from './agent.js';
|
|
9
|
+
import type { RelationshipDefinition } from './relationship.js';
|
|
10
|
+
import type { ProtocolDefinition } from './protocol.js';
|
|
11
|
+
import type { GovernanceConfig } from './governance.js';
|
|
12
|
+
import type { ResourceDefinition } from './resource.js';
|
|
13
|
+
import type { EvolutionConfig } from './memory.js';
|
|
14
|
+
/** The user/ruler at the center of the agent network */
|
|
15
|
+
export interface RulerDefinition {
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
permissions?: string[];
|
|
19
|
+
}
|
|
20
|
+
export type UniverseType = 'hierarchical' | 'flat' | 'competitive' | 'hybrid';
|
|
21
|
+
export interface UniverseConfig {
|
|
22
|
+
/** Universe name (kebab-case identifier) */
|
|
23
|
+
name: string;
|
|
24
|
+
/** Semantic version */
|
|
25
|
+
version: string;
|
|
26
|
+
/** Human-readable description */
|
|
27
|
+
description: string;
|
|
28
|
+
/** Organizational model */
|
|
29
|
+
type: UniverseType;
|
|
30
|
+
/** The user/ruler definition — the human at the center of the agent network (optional) */
|
|
31
|
+
ruler?: RulerDefinition;
|
|
32
|
+
/** All agents in this universe */
|
|
33
|
+
agents: AgentDefinition[];
|
|
34
|
+
/** Relationships between agents */
|
|
35
|
+
relationships: RelationshipDefinition[];
|
|
36
|
+
/** Workflow protocols (state machines) */
|
|
37
|
+
protocols: ProtocolDefinition[];
|
|
38
|
+
/** Decision-making and permission rules */
|
|
39
|
+
governance: GovernanceConfig;
|
|
40
|
+
/** Shared resources (optional) */
|
|
41
|
+
resources?: ResourceDefinition[];
|
|
42
|
+
/** Evolution/adaptation rules (optional) */
|
|
43
|
+
evolution?: EvolutionConfig;
|
|
44
|
+
/** Custom universe-level metadata */
|
|
45
|
+
metadata?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Snapshot of a Universe at a point in time.
|
|
49
|
+
* Used for persistence, replay, and time-travel debugging.
|
|
50
|
+
*/
|
|
51
|
+
export interface UniverseSnapshot {
|
|
52
|
+
/** The config that created this universe */
|
|
53
|
+
config: UniverseConfig;
|
|
54
|
+
/** Current tick/cycle number */
|
|
55
|
+
tick: number;
|
|
56
|
+
/** Timestamp of snapshot */
|
|
57
|
+
timestamp: string;
|
|
58
|
+
/** Agent runtime states */
|
|
59
|
+
agentStates: Record<string, Record<string, unknown>>;
|
|
60
|
+
/** Current resource allocations */
|
|
61
|
+
resourceAllocations: Record<string, Record<string, number>>;
|
|
62
|
+
/** Active protocol states */
|
|
63
|
+
protocolStates: Record<string, string>;
|
|
64
|
+
/** Relationship current weights */
|
|
65
|
+
relationshipWeights: Array<{
|
|
66
|
+
from: string;
|
|
67
|
+
to: string;
|
|
68
|
+
weight: number;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=universe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"universe.d.ts","sourceRoot":"","sources":["../../src/types/universe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,MAAM,GACN,aAAa,GACb,QAAQ,CAAC;AAEb,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,0FAA0F;IAC1F,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,kCAAkC;IAClC,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,mCAAmC;IACnC,aAAa,EAAE,sBAAsB,EAAE,CAAC;IACxC,0CAA0C;IAC1C,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,2CAA2C;IAC3C,UAAU,EAAE,gBAAgB,CAAC;IAC7B,kCAAkC;IAClC,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACjC,4CAA4C;IAC5C,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,MAAM,EAAE,cAAc,CAAC;IACvB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,mCAAmC;IACnC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5D,6BAA6B;IAC7B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,mCAAmC;IACnC,mBAAmB,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universe — the top-level container for an agent organization.
|
|
3
|
+
*
|
|
4
|
+
* A Universe is to agents what a society is to people:
|
|
5
|
+
* it defines the rules, relationships, resources, and evolutionary
|
|
6
|
+
* pressures that shape how agents collaborate or compete.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=universe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"universe.js","sourceRoot":"","sources":["../../src/types/universe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|