@siduri-x/core 1.0.4 → 1.0.5
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/package.json +1 -1
- package/dist/action-policy.d.ts +0 -45
- package/dist/action-policy.js +0 -224
- package/dist/action-policy.test.d.ts +0 -1
- package/dist/action-policy.test.js +0 -194
- package/dist/action.d.ts +0 -72
- package/dist/action.js +0 -2
- package/dist/adversarial.test.d.ts +0 -1
- package/dist/adversarial.test.js +0 -493
- package/dist/architecture-boundary.test.d.ts +0 -1
- package/dist/architecture-boundary.test.js +0 -116
- package/dist/capability.d.ts +0 -57
- package/dist/capability.js +0 -130
- package/dist/capability.test.d.ts +0 -1
- package/dist/capability.test.js +0 -269
- package/dist/chat-contract.d.ts +0 -77
- package/dist/chat-contract.js +0 -65
- package/dist/context.d.ts +0 -47
- package/dist/context.js +0 -92
- package/dist/context.test.d.ts +0 -1
- package/dist/context.test.js +0 -109
- package/dist/dispatcher.d.ts +0 -14
- package/dist/dispatcher.js +0 -40
- package/dist/dispatcher.test.d.ts +0 -1
- package/dist/dispatcher.test.js +0 -60
- package/dist/ear-types.d.ts +0 -33
- package/dist/ear-types.js +0 -2
- package/dist/evidence.d.ts +0 -72
- package/dist/evidence.js +0 -45
- package/dist/evidence.test.d.ts +0 -1
- package/dist/evidence.test.js +0 -101
- package/dist/experience.d.ts +0 -56
- package/dist/experience.js +0 -78
- package/dist/experience.test.d.ts +0 -1
- package/dist/experience.test.js +0 -58
- package/dist/gating.d.ts +0 -45
- package/dist/gating.js +0 -189
- package/dist/gating.test.d.ts +0 -1
- package/dist/gating.test.js +0 -190
- package/dist/index.d.ts +0 -266
- package/dist/index.js +0 -29
- package/dist/runtime.d.ts +0 -50
- package/dist/runtime.js +0 -411
- package/dist/teaching.d.ts +0 -15
- package/dist/teaching.js +0 -159
package/dist/index.d.ts
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
export * from './context';
|
|
2
|
-
export * from './evidence';
|
|
3
|
-
export * from './gating';
|
|
4
|
-
export * from './experience';
|
|
5
|
-
export * from './dispatcher';
|
|
6
|
-
export * from './action';
|
|
7
|
-
export * from './action-policy';
|
|
8
|
-
export * from './ear-types';
|
|
9
|
-
export * from './capability';
|
|
10
|
-
export * from './teaching';
|
|
11
|
-
export * from './runtime';
|
|
12
|
-
export * from './chat-contract';
|
|
13
|
-
import { ActionIntent } from './action';
|
|
14
|
-
import { EarIngestOptions } from './ear-types';
|
|
15
|
-
export interface OrganConfig {
|
|
16
|
-
provider: string;
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
}
|
|
19
|
-
export interface CompanionConfig {
|
|
20
|
-
id: string;
|
|
21
|
-
name: string;
|
|
22
|
-
brain: OrganConfig;
|
|
23
|
-
voice: OrganConfig;
|
|
24
|
-
memory: OrganConfig;
|
|
25
|
-
knowledge: OrganConfig;
|
|
26
|
-
behavior: OrganConfig;
|
|
27
|
-
body: OrganConfig;
|
|
28
|
-
vision: OrganConfig;
|
|
29
|
-
}
|
|
30
|
-
export interface Message {
|
|
31
|
-
role: 'user' | 'assistant' | 'system';
|
|
32
|
-
content: string;
|
|
33
|
-
name?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface BrainContext {
|
|
36
|
-
systemPrompt: string;
|
|
37
|
-
contextPrompt: string;
|
|
38
|
-
recentMessages: Message[];
|
|
39
|
-
recipient?: MemoryScope;
|
|
40
|
-
}
|
|
41
|
-
export type ClaimType = 'semantic' | 'preference' | 'episodic' | 'relationship';
|
|
42
|
-
export type ClaimAuthority = 'user_explicit' | 'user_correction' | 'import' | 'repeated_dialogue' | 'inference' | 'observation';
|
|
43
|
-
export type ClaimStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'SESSION_ONLY' | 'EXPIRED' | 'SUPERSEDED' | 'REVOKED';
|
|
44
|
-
export interface SourceEvent {
|
|
45
|
-
id: string;
|
|
46
|
-
sourceType: string;
|
|
47
|
-
occurredAt: string;
|
|
48
|
-
payload: Record<string, unknown>;
|
|
49
|
-
schemaVersion?: number;
|
|
50
|
-
}
|
|
51
|
-
export interface MemoryProposal {
|
|
52
|
-
subject: string;
|
|
53
|
-
predicate: string;
|
|
54
|
-
value: string;
|
|
55
|
-
content?: string;
|
|
56
|
-
provenance?: string;
|
|
57
|
-
claimType?: ClaimType;
|
|
58
|
-
sensitivity?: string;
|
|
59
|
-
allowedAudiences?: string[];
|
|
60
|
-
sourceEventId?: string;
|
|
61
|
-
}
|
|
62
|
-
export interface BehaviorProposal {
|
|
63
|
-
directive: string;
|
|
64
|
-
priority: number;
|
|
65
|
-
subject?: string;
|
|
66
|
-
predicate?: string;
|
|
67
|
-
value?: string;
|
|
68
|
-
memoryClass?: 'identity' | 'relationship' | 'behavioral' | 'semantic' | 'episodic';
|
|
69
|
-
sourceEventId?: string;
|
|
70
|
-
}
|
|
71
|
-
export interface ResponsePlan {
|
|
72
|
-
speech: string;
|
|
73
|
-
language: string;
|
|
74
|
-
memoryProposals?: MemoryProposal[];
|
|
75
|
-
behaviorProposals?: BehaviorProposal[];
|
|
76
|
-
actionIntents?: ActionIntent[];
|
|
77
|
-
internalMonologue?: string;
|
|
78
|
-
}
|
|
79
|
-
export interface BrainOrgan {
|
|
80
|
-
generatePlan(context: BrainContext): Promise<ResponsePlan>;
|
|
81
|
-
}
|
|
82
|
-
export type MemoryScope = 'OWNER' | 'VIEWER' | 'OPERATOR' | 'PUBLIC';
|
|
83
|
-
export interface Claim {
|
|
84
|
-
id: string;
|
|
85
|
-
subject: string;
|
|
86
|
-
predicate: string;
|
|
87
|
-
value: string;
|
|
88
|
-
status: ClaimStatus;
|
|
89
|
-
evidence?: string[];
|
|
90
|
-
scope: MemoryScope;
|
|
91
|
-
companionId: string;
|
|
92
|
-
provenance?: string;
|
|
93
|
-
sourceEventId?: string;
|
|
94
|
-
claimType?: ClaimType;
|
|
95
|
-
authority?: ClaimAuthority;
|
|
96
|
-
userConfirmation?: 'explicit' | 'implied' | 'none';
|
|
97
|
-
sensitivity?: string;
|
|
98
|
-
allowedAudiences?: string[];
|
|
99
|
-
confidence?: number;
|
|
100
|
-
assertedAt?: string;
|
|
101
|
-
validFrom?: string;
|
|
102
|
-
validUntil?: string;
|
|
103
|
-
supersedes?: string;
|
|
104
|
-
replaces?: string;
|
|
105
|
-
}
|
|
106
|
-
export interface BehaviorDirective {
|
|
107
|
-
id: string;
|
|
108
|
-
companionId: string;
|
|
109
|
-
directive: string;
|
|
110
|
-
scopeMatcher: string[];
|
|
111
|
-
priority: number;
|
|
112
|
-
status: 'PENDING' | 'ACTIVE' | 'DISABLED' | 'SUPERSEDED' | 'REJECTED' | 'REVOKED' | 'EXPIRED';
|
|
113
|
-
supersedesId?: string;
|
|
114
|
-
memoryClass?: 'identity' | 'relationship' | 'behavioral';
|
|
115
|
-
subject?: string;
|
|
116
|
-
predicate?: string;
|
|
117
|
-
value?: string;
|
|
118
|
-
allowedAudiences?: string[];
|
|
119
|
-
validFrom?: string;
|
|
120
|
-
validUntil?: string;
|
|
121
|
-
}
|
|
122
|
-
export interface MemoryQueryOptions {
|
|
123
|
-
channel?: 'public' | 'direct' | 'private' | 'operator';
|
|
124
|
-
audienceId?: string;
|
|
125
|
-
sensitivity?: string;
|
|
126
|
-
limit?: number;
|
|
127
|
-
minConfidence?: number;
|
|
128
|
-
now?: string | Date;
|
|
129
|
-
}
|
|
130
|
-
export interface MemoryOrgan {
|
|
131
|
-
initialize(companionId: string): Promise<void>;
|
|
132
|
-
proposeClaim(claim: Omit<Claim, 'id' | 'status' | 'companionId'>): Promise<Claim>;
|
|
133
|
-
searchClaims(query: string, scopeOrOptions: MemoryScope | MemoryQueryOptions, limit?: number): Promise<Claim[]>;
|
|
134
|
-
getClaims(limit?: number): Promise<Claim[]>;
|
|
135
|
-
getPendingClaims(limit?: number): Promise<Claim[]>;
|
|
136
|
-
approveClaim(id: string): Promise<void>;
|
|
137
|
-
rejectClaim(id: string): Promise<void>;
|
|
138
|
-
markClaimSessionOnly?(id: string): Promise<void>;
|
|
139
|
-
expireClaim?(id: string): Promise<void>;
|
|
140
|
-
revokeClaim?(id: string, reason?: string): Promise<void>;
|
|
141
|
-
getDirectives(): Promise<BehaviorDirective[]>;
|
|
142
|
-
proposeDirective(directiveData: Omit<BehaviorDirective, 'id' | 'status' | 'companionId'>): Promise<BehaviorDirective>;
|
|
143
|
-
approveDirective(id: string): Promise<void>;
|
|
144
|
-
rejectDirective(id: string): Promise<void>;
|
|
145
|
-
revokeDirective(id: string): Promise<void>;
|
|
146
|
-
disableDirective(id: string): Promise<void>;
|
|
147
|
-
expireDirective?(id: string): Promise<void>;
|
|
148
|
-
supersedeClaim?(id: string, replacement: Omit<Claim, 'id' | 'status' | 'companionId'>): Promise<Claim>;
|
|
149
|
-
updateClaim?(id: string, updates: Partial<Pick<Claim, 'subject' | 'predicate' | 'value' | 'scope' | 'sensitivity' | 'confidence' | 'validFrom' | 'validUntil' | 'allowedAudiences'>>): Promise<Claim>;
|
|
150
|
-
resetMemory?(): Promise<void>;
|
|
151
|
-
addSourceEvent?(event: SourceEvent): Promise<SourceEvent>;
|
|
152
|
-
getSourceEvent?(id: string): Promise<SourceEvent | undefined>;
|
|
153
|
-
}
|
|
154
|
-
export interface AudioEvent {
|
|
155
|
-
type: 'STARTED' | 'COMPLETED' | 'FAILED';
|
|
156
|
-
speechId: string;
|
|
157
|
-
text?: string;
|
|
158
|
-
language?: string;
|
|
159
|
-
audioBuffer?: Uint8Array;
|
|
160
|
-
}
|
|
161
|
-
export interface VoiceOrgan {
|
|
162
|
-
enqueueSpeech(text: string, language: string, priority?: number): string;
|
|
163
|
-
onLifecycleEvent(callback: (event: AudioEvent) => void): void;
|
|
164
|
-
getQueueStatus(): {
|
|
165
|
-
pending: number;
|
|
166
|
-
current?: string;
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
export interface VisionOrgan {
|
|
170
|
-
analyze(imageUrl: string, prompt: string): Promise<string>;
|
|
171
|
-
}
|
|
172
|
-
export interface ActiveSelfProjection {
|
|
173
|
-
identityFacts: string[];
|
|
174
|
-
relationshipFacts: string[];
|
|
175
|
-
behavioralRules: string[];
|
|
176
|
-
activeIds: string[];
|
|
177
|
-
excludedIds: string[];
|
|
178
|
-
diagnostics: Record<string, string>;
|
|
179
|
-
render(): string;
|
|
180
|
-
}
|
|
181
|
-
export interface BehaviorContext {
|
|
182
|
-
activeRole: string;
|
|
183
|
-
directives: BehaviorDirective[];
|
|
184
|
-
companionId?: string;
|
|
185
|
-
channel?: 'public' | 'direct' | 'private' | 'operator';
|
|
186
|
-
audienceId?: string;
|
|
187
|
-
actorId?: string;
|
|
188
|
-
sessionId?: string;
|
|
189
|
-
now?: string;
|
|
190
|
-
}
|
|
191
|
-
export interface BehaviorOrgan {
|
|
192
|
-
compile(context: BehaviorContext): Promise<string>;
|
|
193
|
-
compileProjection?(context: BehaviorContext): Promise<ActiveSelfProjection>;
|
|
194
|
-
}
|
|
195
|
-
export interface KnowledgeItem {
|
|
196
|
-
content: string;
|
|
197
|
-
provenance: string;
|
|
198
|
-
revision: string;
|
|
199
|
-
citations: KnowledgeCitation[];
|
|
200
|
-
}
|
|
201
|
-
export interface KnowledgeCitation {
|
|
202
|
-
sourceId: string;
|
|
203
|
-
documentId?: string;
|
|
204
|
-
chunkId?: string;
|
|
205
|
-
locator?: string;
|
|
206
|
-
}
|
|
207
|
-
export interface KnowledgeOrgan {
|
|
208
|
-
search(query: string): Promise<KnowledgeItem[]>;
|
|
209
|
-
}
|
|
210
|
-
export interface EarPerception {
|
|
211
|
-
id: string;
|
|
212
|
-
source: string;
|
|
213
|
-
text?: string;
|
|
214
|
-
audioBuffer?: Uint8Array;
|
|
215
|
-
metadata?: Record<string, unknown>;
|
|
216
|
-
timestamp: string;
|
|
217
|
-
}
|
|
218
|
-
export interface EarOrgan {
|
|
219
|
-
listen(source: string, payload: unknown, options?: EarIngestOptions): Promise<EarPerception>;
|
|
220
|
-
transcribeAudio?(audio: Uint8Array): Promise<string>;
|
|
221
|
-
}
|
|
222
|
-
export interface BodyOrgan {
|
|
223
|
-
setExpression(expression: string): void;
|
|
224
|
-
speak(speechId: string, text?: string, language?: string): void;
|
|
225
|
-
act(action: string): void;
|
|
226
|
-
completeAction?(): void;
|
|
227
|
-
}
|
|
228
|
-
export interface ObservationReading {
|
|
229
|
-
entity: string;
|
|
230
|
-
value: string;
|
|
231
|
-
confidence: number;
|
|
232
|
-
sourceCrop?: string;
|
|
233
|
-
ocrText?: string;
|
|
234
|
-
competingInterpretations?: string[];
|
|
235
|
-
}
|
|
236
|
-
export interface Observation {
|
|
237
|
-
observationId: string;
|
|
238
|
-
evidenceId: string;
|
|
239
|
-
sourceName: string;
|
|
240
|
-
providerId: string;
|
|
241
|
-
readings: ObservationReading[];
|
|
242
|
-
confidence: number;
|
|
243
|
-
createdAt: string;
|
|
244
|
-
expiresAt: string;
|
|
245
|
-
frameDigest: string;
|
|
246
|
-
}
|
|
247
|
-
export interface ObservationResult {
|
|
248
|
-
observation?: Observation;
|
|
249
|
-
duplicate: boolean;
|
|
250
|
-
reason?: 'empty_frame' | 'duplicate_frame' | 'invalid_reading' | 'provider_failure';
|
|
251
|
-
}
|
|
252
|
-
export interface ObservationOrgan {
|
|
253
|
-
ingest(frame: Uint8Array, sourceName: string, providerId?: string): Promise<ObservationResult>;
|
|
254
|
-
current(now?: Date): Observation[];
|
|
255
|
-
clearExpired(now?: Date): number;
|
|
256
|
-
}
|
|
257
|
-
export interface HealthProbeContext {
|
|
258
|
-
config: unknown;
|
|
259
|
-
env: NodeJS.ProcessEnv | Record<string, string | undefined>;
|
|
260
|
-
}
|
|
261
|
-
export interface HealthProbeResult {
|
|
262
|
-
ok: boolean;
|
|
263
|
-
message?: string;
|
|
264
|
-
details?: Record<string, unknown>;
|
|
265
|
-
}
|
|
266
|
-
export type HealthProbeFn = (context: HealthProbeContext) => Promise<HealthProbeResult> | HealthProbeResult;
|
package/dist/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Export neutral context types and validator
|
|
18
|
-
__exportStar(require("./context"), exports);
|
|
19
|
-
__exportStar(require("./evidence"), exports);
|
|
20
|
-
__exportStar(require("./gating"), exports);
|
|
21
|
-
__exportStar(require("./experience"), exports);
|
|
22
|
-
__exportStar(require("./dispatcher"), exports);
|
|
23
|
-
__exportStar(require("./action"), exports);
|
|
24
|
-
__exportStar(require("./action-policy"), exports);
|
|
25
|
-
__exportStar(require("./ear-types"), exports);
|
|
26
|
-
__exportStar(require("./capability"), exports);
|
|
27
|
-
__exportStar(require("./teaching"), exports);
|
|
28
|
-
__exportStar(require("./runtime"), exports);
|
|
29
|
-
__exportStar(require("./chat-contract"), exports);
|
package/dist/runtime.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { BrainOrgan, MemoryOrgan, VoiceOrgan, KnowledgeOrgan, VisionOrgan, BehaviorOrgan, BodyOrgan, HandsOrgan, EarOrgan, ObservationOrgan, Message, ActionPolicyEngine, RequestContext, ResponseGatingEngine, ExperienceDispatcher, ExperienceAdapter } from './index';
|
|
2
|
-
export interface SiduriRuntimeConfig {
|
|
3
|
-
name: string;
|
|
4
|
-
brain?: any;
|
|
5
|
-
voice?: any;
|
|
6
|
-
memory?: any;
|
|
7
|
-
knowledge?: any;
|
|
8
|
-
behavior?: any;
|
|
9
|
-
body?: any;
|
|
10
|
-
vision?: any;
|
|
11
|
-
hands?: any;
|
|
12
|
-
ear?: any;
|
|
13
|
-
observation?: any;
|
|
14
|
-
actionPolicy?: any;
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}
|
|
17
|
-
export interface RuntimeOrgans {
|
|
18
|
-
brain?: BrainOrgan;
|
|
19
|
-
memory?: MemoryOrgan;
|
|
20
|
-
voice?: VoiceOrgan | ExperienceAdapter;
|
|
21
|
-
knowledge?: KnowledgeOrgan;
|
|
22
|
-
vision?: VisionOrgan;
|
|
23
|
-
behavior?: BehaviorOrgan;
|
|
24
|
-
body?: BodyOrgan | ExperienceAdapter;
|
|
25
|
-
hands?: HandsOrgan;
|
|
26
|
-
ear?: EarOrgan;
|
|
27
|
-
observation?: ObservationOrgan;
|
|
28
|
-
actionPolicy?: ActionPolicyEngine;
|
|
29
|
-
}
|
|
30
|
-
export declare class SiduriRuntime {
|
|
31
|
-
id: string;
|
|
32
|
-
config: SiduriRuntimeConfig;
|
|
33
|
-
brain?: BrainOrgan;
|
|
34
|
-
memory?: MemoryOrgan;
|
|
35
|
-
voice?: VoiceOrgan | ExperienceAdapter;
|
|
36
|
-
knowledge?: KnowledgeOrgan;
|
|
37
|
-
vision?: VisionOrgan;
|
|
38
|
-
behavior?: BehaviorOrgan;
|
|
39
|
-
body?: BodyOrgan | ExperienceAdapter;
|
|
40
|
-
hands?: HandsOrgan;
|
|
41
|
-
ear?: EarOrgan;
|
|
42
|
-
observation?: ObservationOrgan;
|
|
43
|
-
gating: ResponseGatingEngine;
|
|
44
|
-
actionPolicy: ActionPolicyEngine;
|
|
45
|
-
dispatcher: ExperienceDispatcher;
|
|
46
|
-
private conversationHistory;
|
|
47
|
-
constructor(id: string, config: SiduriRuntimeConfig, organs?: RuntimeOrgans);
|
|
48
|
-
initialize(): Promise<void>;
|
|
49
|
-
handleUserMessage(message: string, roleOrContext: 'OWNER' | 'VIEWER' | 'OPERATOR' | RequestContext, history?: Message[]): Promise<any>;
|
|
50
|
-
}
|