@happyvertical/smrt-personas 0.38.19 → 0.38.21

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.
Files changed (39) hide show
  1. package/AGENTS.md +119 -7
  2. package/dist/__smrt-register__.d.ts +2 -0
  3. package/dist/__smrt-register__.d.ts.map +1 -0
  4. package/dist/agent-persona.d.ts +161 -0
  5. package/dist/agent-persona.d.ts.map +1 -0
  6. package/dist/directive-approval.d.ts +94 -0
  7. package/dist/directive-approval.d.ts.map +1 -0
  8. package/dist/directive-principal.d.ts +56 -0
  9. package/dist/directive-principal.d.ts.map +1 -0
  10. package/dist/directive-proposal.d.ts +103 -0
  11. package/dist/directive-proposal.d.ts.map +1 -0
  12. package/dist/feedback.d.ts +127 -0
  13. package/dist/feedback.d.ts.map +1 -0
  14. package/dist/index.d.ts +11 -294
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +829 -19
  17. package/dist/index.js.map +1 -1
  18. package/dist/manifest.json +919 -3
  19. package/dist/persona-instance.d.ts +249 -0
  20. package/dist/persona-instance.d.ts.map +1 -0
  21. package/dist/persona-memory.d.ts +45 -0
  22. package/dist/persona-memory.d.ts.map +1 -0
  23. package/dist/persona-prompt.d.ts +77 -0
  24. package/dist/persona-prompt.d.ts.map +1 -0
  25. package/dist/persona-resolver.d.ts +134 -0
  26. package/dist/persona-resolver.d.ts.map +1 -0
  27. package/dist/reflection-runner.d.ts +113 -0
  28. package/dist/reflection-runner.d.ts.map +1 -0
  29. package/dist/smrt-knowledge.json +519 -11
  30. package/dist/svelte/components/DirectiveReviewQueue.svelte +185 -0
  31. package/dist/svelte/components/DirectiveReviewQueue.svelte.d.ts +15 -0
  32. package/dist/svelte/components/DirectiveReviewQueue.svelte.d.ts.map +1 -0
  33. package/dist/svelte/index.d.ts +16 -0
  34. package/dist/svelte/index.d.ts.map +1 -0
  35. package/dist/svelte/index.js +13 -0
  36. package/dist/svelte/types.d.ts +46 -0
  37. package/dist/svelte/types.d.ts.map +1 -0
  38. package/dist/svelte/types.js +39 -0
  39. package/package.json +23 -7
@@ -0,0 +1,127 @@
1
+ import { LearningOutcome, SmrtCollection, SmrtObject } from '@happyvertical/smrt-core';
2
+ /**
3
+ * The kind of reinforcement signal a {@link Feedback} row carries.
4
+ *
5
+ * `accept` / `reject` / `correction` / `rating` are human judgements;
6
+ * `outcome` / `metric` are machine-observed autonomous signals.
7
+ */
8
+ export type FeedbackSignalType = 'accept' | 'reject' | 'correction' | 'rating' | 'outcome' | 'metric';
9
+ /** Whether a signal originated from a person or an autonomous observation. */
10
+ export type FeedbackSource = 'human' | 'autonomous';
11
+ /** The human-authored signal types. */
12
+ export declare const HUMAN_SIGNAL_TYPES: readonly FeedbackSignalType[];
13
+ /**
14
+ * Return the natural source for a signal type: the human judgement types are
15
+ * `'human'`; `outcome` / `metric` are `'autonomous'`.
16
+ */
17
+ export declare function feedbackSourceFor(signal: FeedbackSignalType): FeedbackSource;
18
+ /** Options for {@link Feedback.toLearningOutcome}. */
19
+ export interface FeedbackOutcomeOptions {
20
+ /**
21
+ * The neutral point of a `rating` scale. A rating strictly above the neutral
22
+ * reinforces as a success; at or below it decays as a failure. Default `0`
23
+ * (any positive rating is a success), matching {@link LearningOutcome}'s
24
+ * metric convention. Pass e.g. `3` for a 1–5 star scale.
25
+ */
26
+ ratingNeutral?: number;
27
+ }
28
+ /**
29
+ * A single reinforcement signal against a persona and a learning episode.
30
+ */
31
+ export declare class Feedback extends SmrtObject {
32
+ /** Owning tenant (optional — autonomous signals may be tenant-less). */
33
+ tenantId: string | null;
34
+ /** The persona this signal judges. */
35
+ personaId: string;
36
+ /** Canonical agent class the persona configures (denormalised for queries). */
37
+ agentClass: string;
38
+ /**
39
+ * Memory scope the signal reinforces — the partition key routing it to the
40
+ * right {@link LearningMemory} so different personas reinforce independently.
41
+ */
42
+ memoryScope: string;
43
+ /** Learning episode scope this signal pertains to (`LearningEpisode.scope`). */
44
+ scope: string;
45
+ /** Learning episode key this signal pertains to (`LearningEpisode.key`). */
46
+ key: string;
47
+ /** The kind of signal (see {@link FeedbackSignalType}). */
48
+ signalType: FeedbackSignalType;
49
+ /** Whether the signal is human or autonomous. */
50
+ source: FeedbackSource;
51
+ /**
52
+ * Correlation-id back to the thing this signal judges — the AI call,
53
+ * dispatch, or job id. Required so a signal is always traceable to its cause.
54
+ */
55
+ correlationId: string;
56
+ /**
57
+ * What kind of thing {@link correlationId} names (e.g. `'ai_call'`,
58
+ * `'dispatch'`, `'job'`). `null` when the namespace is implicit.
59
+ */
60
+ correlationType: string | null;
61
+ /** Numeric rating for a `rating` signal (scale is caller-defined). */
62
+ rating: number | null;
63
+ /** Observed measurement for a `metric` signal. */
64
+ metric: number | null;
65
+ /** Observed boolean result for an `outcome` signal. */
66
+ success: boolean | null;
67
+ /**
68
+ * Corrected instructions/value for a `correction` signal — the human-supplied
69
+ * replacement that should supersede the strategy that was judged wrong.
70
+ */
71
+ correction: string | null;
72
+ /** Freeform note attached to the signal. */
73
+ comment: string | null;
74
+ /** The user id that authored a human signal (`null` for autonomous). */
75
+ actorId: string | null;
76
+ /** Arbitrary structured metadata, stored as a JSON string. */
77
+ metadata: string;
78
+ /**
79
+ * When this signal was applied to memory as reinforcement. `null` until a
80
+ * reflection pass consumes it. Gates exactly-once reinforcement so a scheduled
81
+ * runner never re-applies the same signal (which would amplify a single
82
+ * accept/reject into many outcomes).
83
+ */
84
+ reinforcedAt: Date | null;
85
+ /** Whether this is a human-authored signal. */
86
+ isHuman(): boolean;
87
+ /** Parse {@link metadata}, tolerating malformed JSON. */
88
+ getMetadata(): Record<string, unknown>;
89
+ /** Replace {@link metadata}. */
90
+ setMetadata(value: Record<string, unknown>): void;
91
+ /** Shallow-merge into {@link metadata}. */
92
+ updateMetadata(patch: Record<string, unknown>): void;
93
+ /**
94
+ * The strategy value a `correction` signal should persist into memory, so a
95
+ * regenerated (corrected) strategy supersedes the one that was judged wrong.
96
+ * `undefined` for non-correction signals (reinforce confidence only).
97
+ */
98
+ getCorrectionValue(): string | undefined;
99
+ /**
100
+ * Map this signal onto a {@link LearningOutcome} for reinforcement, or `null`
101
+ * when the signal carries no reinforcement value:
102
+ *
103
+ * - `accept` → success; `reject` / `correction` → failure.
104
+ * - `outcome` → the recorded boolean `success`.
105
+ * - `metric` → the recorded `metric` (positive → success).
106
+ * - `rating` → `{ metric: rating - ratingNeutral }`.
107
+ */
108
+ toLearningOutcome(options?: FeedbackOutcomeOptions): LearningOutcome | null;
109
+ }
110
+ /**
111
+ * Collection for {@link Feedback} rows.
112
+ */
113
+ export declare class FeedbackCollection extends SmrtCollection<Feedback> {
114
+ static readonly _itemClass: typeof Feedback;
115
+ /** All signals for a persona, newest first. */
116
+ forPersona(personaId: string, options?: {
117
+ limit?: number;
118
+ }): Promise<Feedback[]>;
119
+ /** All signals filed under a memory scope, newest first. */
120
+ forScope(memoryScope: string, options?: {
121
+ limit?: number;
122
+ }): Promise<Feedback[]>;
123
+ /** Every signal correlated to a given AI call / dispatch / job id. */
124
+ byCorrelation(correlationId: string): Promise<Feedback[]>;
125
+ }
126
+ export default Feedback;
127
+ //# sourceMappingURL=feedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../src/feedback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAGL,KAAK,eAAe,EACpB,cAAc,EACd,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,SAAS,GACT,QAAQ,CAAC;AAEb,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,YAAY,CAAC;AAEpD,uCAAuC;AACvC,eAAO,MAAM,kBAAkB,EAAE,SAAS,kBAAkB,EAK3D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MA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,EAAE,OAAO,CAAC;IAItC,gCAAgC;IAChC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIjD,2CAA2C;IAC3C,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIpD;;;;OAIG;IACH,kBAAkB,IAAI,MAAM,GAAG,SAAS;IAMxC;;;;;;;;OAQG;IACH,iBAAiB,CACf,OAAO,GAAE,sBAA2B,GACnC,eAAe,GAAG,IAAI;CAqB1B;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9D,MAAM,CAAC,QAAQ,CAAC,UAAU,kBAAY;IAEtC,+CAA+C;IACzC,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAC/B,OAAO,CAAC,QAAQ,EAAE,CAAC;IAQtB,4DAA4D;IACtD,QAAQ,CACZ,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAC/B,OAAO,CAAC,QAAQ,EAAE,CAAC;IAQtB,sEAAsE;IAChE,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAMhE;AAED,eAAe,QAAQ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,294 +1,11 @@
1
- import { ResolvedAgentAvailability } from '@happyvertical/smrt-agents';
2
- import { SmrtCollection } from '@happyvertical/smrt-core';
3
- import { SmrtObject } from '@happyvertical/smrt-core';
4
-
5
- /**
6
- * AgentPersona SmrtObject a tenant/context-scoped behavioral profile for an
7
- * agent class.
8
- */
9
- export declare class AgentPersona extends SmrtObject {
10
- /** Owning tenant (required personas are never global). */
11
- tenantId: string;
12
- /**
13
- * Canonical qualified agent type this persona configures
14
- * (e.g. `@happyvertical/smrt-agents:Praeco`). Stored in canonical form so it
15
- * lines up with `TenantAgent.agentClass`.
16
- */
17
- agentClass: string;
18
- /**
19
- * Human-readable persona name, unique per `(tenant, agentClass)`
20
- * (see `conflictColumns`). Inherited `name` from {@link SmrtObject} is the
21
- * conflict column; declared here for documentation and typing clarity.
22
- */
23
- name: string;
24
- /**
25
- * Optional context dimension type this persona is scoped to
26
- * (e.g. `'site'`, `'property'`, `'chatRoom'`). `null` means the persona is a
27
- * tenant-wide default that applies to every context for its agent class.
28
- */
29
- contextType: string | null;
30
- /**
31
- * Optional context dimension id. Only meaningful alongside `contextType`:
32
- * when set, the persona targets one specific context row; when `null` (with
33
- * a `contextType` set) it applies to every context of that type.
34
- */
35
- contextId: string | null;
36
- /** System prompt / behavioral instructions layered onto the agent. */
37
- instructions: string;
38
- /**
39
- * Allowed tool identifiers, stored as a JSON array string. Use
40
- * {@link getAllowedTools} / {@link setAllowedTools} rather than reading this
41
- * field directly. Empty array (`'[]'`) means "no persona-specific tools"
42
- * (the resolver then falls back to manifest defaults, capped by the
43
- * `TenantAgent` ceiling).
44
- */
45
- allowedTools: string;
46
- /**
47
- * The user whose principal this persona runs as (cross-package reference to
48
- * `@happyvertical/smrt-users:User`). Required — a persona always runs as a
49
- * concrete principal. Stored as a plain id column; no DDL FK constraint is
50
- * emitted (cross-package).
51
- */
52
- runAsUserId: string;
53
- /**
54
- * Optional `Bot` profile the persona acts as for identity/audit
55
- * (cross-package reference to `@happyvertical/smrt-profiles:Profile`).
56
- * `null` when the persona has no distinct acting identity.
57
- */
58
- actsAsProfileId: string | null;
59
- /**
60
- * Memory scope key controlling how the agent's memory/reflection is
61
- * partitioned for this persona. Empty string means "use a resolver-derived
62
- * default".
63
- */
64
- memoryScope: string;
65
- /**
66
- * Resolution priority — higher wins when several personas apply to the same
67
- * context at the same tenant level. Integer.
68
- */
69
- priority: number;
70
- /** Whether this persona is active and eligible for resolution. */
71
- enabled: boolean;
72
- /**
73
- * Allowed tool identifiers as an array.
74
- *
75
- * Tolerates malformed stored JSON by returning an empty array.
76
- */
77
- getAllowedTools(): string[];
78
- /**
79
- * Replace the allowed tool identifiers.
80
- */
81
- setAllowedTools(tools: string[]): void;
82
- }
83
-
84
- /**
85
- * Collection for managing {@link AgentPersona} records.
86
- */
87
- export declare class AgentPersonaCollection extends SmrtCollection<AgentPersona> {
88
- static readonly _itemClass: typeof AgentPersona;
89
- /**
90
- * List personas for a tenant + agent class, matching either the canonical
91
- * qualified name or the simple class name (see {@link agentClassAliases}).
92
- *
93
- * Ordered by descending priority then name.
94
- *
95
- * @param extraWhere - Additional equality filters merged into the query
96
- * (e.g. `{ enabled: true }`).
97
- */
98
- private listForClass;
99
- /**
100
- * List every persona bound to a tenant + agent class.
101
- *
102
- * Ordered by descending priority then name so callers that don't need the
103
- * full resolver still get a deterministic, priority-first ordering.
104
- */
105
- byTenantAndClass(tenantId: string, agentClass: string): Promise<AgentPersona[]>;
106
- /**
107
- * List the enabled personas for a tenant + agent class, filtered to those
108
- * applicable to a context.
109
- *
110
- * `enabled` is filtered in the query; the context predicate (tenant-wide vs
111
- * type-scoped vs exact) is applied in memory since it is an OR over several
112
- * columns. A persona is applicable when it is a tenant-wide default (no
113
- * `contextType`) or its context matches the requested one. Ordered by
114
- * descending priority then name.
115
- *
116
- * @param context - Optional `{ contextType, contextId }` to filter by.
117
- */
118
- findActive(tenantId: string, agentClass: string, context?: {
119
- contextType?: string | null;
120
- contextId?: string | null;
121
- }): Promise<AgentPersona[]>;
122
- }
123
-
124
- /**
125
- * Project a `TenantAgent` resolution into a {@link PersonaAvailabilityGate}.
126
- *
127
- * This is the concrete bridge between the `@happyvertical/smrt-agents`
128
- * availability layer and the persona layer. Pass `toolPermissionPrefix` to
129
- * derive a tool ceiling from granted permission ids (permissions whose id
130
- * starts with the prefix become the ceiling, with the prefix stripped); omit it
131
- * to leave the ceiling open.
132
- *
133
- * @param resolved - A `ResolvedAgentAvailability` (or `null`/`undefined`).
134
- * @param options.toolPermissionPrefix - Permission-id prefix that marks
135
- * tool grants (e.g. `'tool:'`).
136
- * @returns A gate, or `null` when `resolved` is nullish.
137
- */
138
- export declare function availabilityFromResolvedAgent(resolved: ResolvedAgentAvailability | null | undefined, options?: {
139
- toolPermissionPrefix?: string;
140
- }): PersonaAvailabilityGate | null;
141
-
142
- /**
143
- * Return the canonical agent type identifier for storage and lookup.
144
- *
145
- * Uses the registry's qualified name when the class is registered and falls
146
- * back to the raw input for dynamically defined or unregistered classes. This
147
- * mirrors `getAgentTypeName()` in `@happyvertical/smrt-agents` without reaching
148
- * into that package's internal module — personas store the same canonical form
149
- * that `TenantAgent` does so the two layers line up.
150
- */
151
- export declare function canonicalAgentClass(name: string): string;
152
-
153
- /**
154
- * Bottom-layer defaults for an agent class, typically derived from its build
155
- * manifest.
156
- */
157
- export declare interface ManifestPersonaDefaults {
158
- /** Default system instructions when no persona overrides them. */
159
- instructions?: string;
160
- /** Default tool identifiers, capped by the availability ceiling. */
161
- allowedTools?: string[];
162
- /** Default memory scope. */
163
- memoryScope?: string;
164
- }
165
-
166
- /**
167
- * Whether a persona applies to a requested context.
168
- *
169
- * - No `contextType` on the persona → tenant-wide default, applies to all.
170
- * - `contextType` set, `contextId` null → type-scoped, applies when the
171
- * requested `contextType` matches.
172
- * - Both set → exact, applies when both match.
173
- */
174
- export declare function personaAppliesToContext(persona: Pick<AgentPersona, 'contextType' | 'contextId'>, context: {
175
- contextType?: string | null;
176
- contextId?: string | null;
177
- }): boolean;
178
-
179
- /**
180
- * Middle-layer availability + capability ceiling, projected from a
181
- * `TenantAgent` resolution.
182
- */
183
- export declare interface PersonaAvailabilityGate {
184
- /** Resolved `TenantAgent` status. `'disabled'` marks the persona unavailable. */
185
- status: 'active' | 'disabled';
186
- /**
187
- * Tool identifiers the tenant is permitted to grant. When set, resolved
188
- * `allowedTools` are intersected with this ceiling. `undefined` means no
189
- * ceiling (tools pass through unchanged).
190
- */
191
- toolCeiling?: string[];
192
- /** Tenant the binding was resolved from (provenance only). */
193
- sourceTenantId?: string;
194
- }
195
-
196
- /**
197
- * The context a persona is being resolved for.
198
- */
199
- export declare interface PersonaContext {
200
- /** Context dimension type (e.g. `'site'`). */
201
- contextType?: string | null;
202
- /** Context dimension id within `contextType`. */
203
- contextId?: string | null;
204
- }
205
-
206
- /**
207
- * Context-specificity rank used for resolution ordering.
208
- *
209
- * - `2` exact `(contextType, contextId)` match
210
- * - `1` type-scoped match (`contextType` matches, persona `contextId` null)
211
- * - `0` tenant-wide default (persona has no `contextType`)
212
- */
213
- export declare function personaContextRank(persona: Pick<AgentPersona, 'contextType' | 'contextId'>): number;
214
-
215
- /**
216
- * Resolves the active persona for a `(tenant, agentClass, context)` request.
217
- */
218
- export declare class PersonaResolver {
219
- private readonly personas;
220
- constructor(personas: AgentPersonaCollection);
221
- /**
222
- * Resolve the active persona.
223
- *
224
- * @param tenantId - Requesting tenant.
225
- * @param agentClass - Agent class (canonicalized internally).
226
- * @param context - Context dimension being resolved for.
227
- * @param options - Hierarchy walk, manifest defaults, and availability gate.
228
- * @returns The layered {@link ResolvedPersona} — either a matched persona or
229
- * the defined default fallback.
230
- */
231
- resolve(tenantId: string, agentClass: string, context?: PersonaContext, options?: ResolvePersonaOptions): Promise<ResolvedPersona>;
232
- private layerPersona;
233
- private defaultResolution;
234
- }
235
-
236
- /**
237
- * A fully resolved persona: the layered, ready-to-use configuration plus
238
- * provenance describing how it was resolved.
239
- */
240
- export declare interface ResolvedPersona {
241
- /** Canonical qualified agent type the resolution was for. */
242
- agentClass: string;
243
- /** Tenant the resolution was requested for. */
244
- tenantId: string;
245
- /** Id of the selected persona, or `undefined` for the default fallback. */
246
- personaId?: string;
247
- /** Selected persona name, or `'default'` for the fallback. */
248
- name: string;
249
- /** Layered instructions (persona → manifest default). */
250
- instructions: string;
251
- /** Layered tool ids (persona/manifest tools, capped by the ceiling). */
252
- allowedTools: string[];
253
- /** Run-as user principal, if the selected persona sets one. */
254
- runAsUserId?: string;
255
- /** Acting `Bot` profile id, if the selected persona sets one. */
256
- actsAsProfileId?: string | null;
257
- /** Resolved memory scope (persona → manifest default → derived default). */
258
- memoryScope: string;
259
- /** Selected persona priority (`0` for the default fallback). */
260
- priority: number;
261
- /** Context type the resolution was requested for. */
262
- contextType?: string | null;
263
- /** Context id the resolution was requested for. */
264
- contextId?: string | null;
265
- /** Whether a persona matched (`'persona'`) or the default was used (`'default'`). */
266
- source: 'persona' | 'default';
267
- /** For a matched persona, whether it was the tenant's own or inherited. */
268
- personaSource?: 'explicit' | 'inherited';
269
- /** Tenant the matched persona came from (own tenant or an ancestor). */
270
- sourceTenantId?: string;
271
- /** Whether the `TenantAgent` gate reports the agent as available. */
272
- available: boolean;
273
- }
274
-
275
- /**
276
- * Options for {@link PersonaResolver.resolve}.
277
- */
278
- export declare interface ResolvePersonaOptions {
279
- /**
280
- * Return ancestor tenant ids for a tenant, nearest parent first through to
281
- * the root — mirrors `TenantAgentCollection.resolveForTenant`. Omit for a
282
- * single-tenant resolution with no inheritance.
283
- */
284
- getAncestorIds?: (tenantId: string) => Promise<string[]>;
285
- /** Bottom-layer manifest defaults for the agent class. */
286
- manifestDefaults?: ManifestPersonaDefaults;
287
- /**
288
- * Middle-layer `TenantAgent` availability + ceiling. Omit to skip gating
289
- * (the result is always `available: true` with no tool ceiling).
290
- */
291
- availability?: PersonaAvailabilityGate | null;
292
- }
293
-
294
- export { }
1
+ export { AgentPersona, AgentPersonaCollection, canonicalAgentClass, personaAppliesToContext, personaContextRank, } from './agent-persona.js';
2
+ export { DirectiveActivationDeniedError, type DirectiveApprovalResult, DirectiveApprovalService, type DirectiveApprovalServiceOptions, DirectiveNotPendingError, type DirectiveRejectionResult, type ProposalRef, } from './directive-approval.js';
3
+ export { ACTIVATE_DIRECTIVE_PERMISSION, DIRECTIVE_ACTIVATION_PERMISSION_DEF, type DirectivePrincipal, ensurePersonaPermissionsRegistered, principalFromPermissions, registerPersonaPermissions, resolveDirectivePrincipal, } from './directive-principal.js';
4
+ export { computeDirectiveFingerprint, type DirectiveEvidence, DirectiveProposal, DirectiveProposalCollection, type DirectiveProposalStatus, } from './directive-proposal.js';
5
+ export { Feedback, FeedbackCollection, type FeedbackOutcomeOptions, type FeedbackSignalType, type FeedbackSource, feedbackSourceFor, HUMAN_SIGNAL_TYPES, } from './feedback.js';
6
+ export { type PersonaMemoryLike, personaLearningMemory, personaMemoryScope, reinforceFromFeedback, } from './persona-memory.js';
7
+ export { applyPersonaInstructions, ensurePersonaInstructionsPrompt, type PersonaLike, personaInstructionsPromptKey, resolvePersonaInstructions, upsertPromptTemplateOverride, } from './persona-prompt.js';
8
+ export { type AddPersonaInstanceOptions, addPersonaInstance, agentOptionsForPersona, type BuildPersonaInstanceAdminOptions, buildPersonaInstanceAdmin, DEFAULT_PERSONA_NAME, isDefaultPersona, type PersonaAgentOptions, type PersonaInstanceAdminView, type PersonaInstanceView, personaInstanceKey, removePersonaInstance, type SchedulePersonaInstanceOptions, schedulePersonaInstance, type UpgradeSingletonOptions, type UpgradeSingletonResult, upgradeSingletonToDefaultPersona, } from './persona-instance.js';
9
+ export { availabilityFromResolvedAgent, type ManifestPersonaDefaults, type PersonaAvailabilityGate, type PersonaContext, PersonaResolver, type ResolvedPersona, type ResolvePersonaOptions, } from './persona-resolver.js';
10
+ export { type DirectiveDraft, type DirectiveReflector, type ReflectionInput, type ReflectionPersona, type ReflectionPersonaInput, ReflectionRunner, type ReflectionRunnerOptions, type ReflectionRunOptions, type ReflectionRunResult, } from './reflection-runner.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,wBAAwB,CAAC;AAIhC,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,8BAA8B,EAC9B,KAAK,uBA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