instar 1.3.756 → 1.3.758

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 (45) hide show
  1. package/dist/core/PostUpdateMigrator.d.ts +1 -0
  2. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  3. package/dist/core/PostUpdateMigrator.js +182 -0
  4. package/dist/core/PostUpdateMigrator.js.map +1 -1
  5. package/dist/core/instarSettingsHooks.d.ts.map +1 -1
  6. package/dist/core/instarSettingsHooks.js +12 -0
  7. package/dist/core/instarSettingsHooks.js.map +1 -1
  8. package/dist/core/types.d.ts +16 -0
  9. package/dist/core/types.d.ts.map +1 -1
  10. package/dist/core/types.js.map +1 -1
  11. package/dist/index.d.ts +0 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/scheduler/AgentMdJobLoader.d.ts +4 -0
  16. package/dist/scheduler/AgentMdJobLoader.d.ts.map +1 -1
  17. package/dist/scheduler/AgentMdJobLoader.js +2 -0
  18. package/dist/scheduler/AgentMdJobLoader.js.map +1 -1
  19. package/dist/scheduler/InstallBuiltinJobs.d.ts.map +1 -1
  20. package/dist/scheduler/InstallBuiltinJobs.js +3 -0
  21. package/dist/scheduler/InstallBuiltinJobs.js.map +1 -1
  22. package/dist/scheduler/JobScheduler.d.ts.map +1 -1
  23. package/dist/scheduler/JobScheduler.js +17 -5
  24. package/dist/scheduler/JobScheduler.js.map +1 -1
  25. package/dist/scheduler/buildPerSlugManifest.d.ts +4 -0
  26. package/dist/scheduler/buildPerSlugManifest.d.ts.map +1 -1
  27. package/dist/scheduler/buildPerSlugManifest.js +2 -0
  28. package/dist/scheduler/buildPerSlugManifest.js.map +1 -1
  29. package/package.json +1 -1
  30. package/scripts/doorway-scan.mjs +785 -0
  31. package/scripts/model-registry-freshness.manifest.json +17 -2
  32. package/src/data/builtin-manifest.json +20 -20
  33. package/src/scaffold/templates/jobs/instar/doorway-scan.md +32 -0
  34. package/upgrades/1.3.757.md +29 -0
  35. package/upgrades/1.3.758.md +37 -0
  36. package/upgrades/side-effects/doorway-model-registry-inc2.md +96 -0
  37. package/upgrades/side-effects/keyword-lint-enforce.md +113 -0
  38. package/dist/core/AutonomySkill.d.ts +0 -98
  39. package/dist/core/AutonomySkill.d.ts.map +0 -1
  40. package/dist/core/AutonomySkill.js +0 -497
  41. package/dist/core/AutonomySkill.js.map +0 -1
  42. package/dist/core/TopicClassifier.d.ts +0 -54
  43. package/dist/core/TopicClassifier.d.ts.map +0 -1
  44. package/dist/core/TopicClassifier.js +0 -144
  45. package/dist/core/TopicClassifier.js.map +0 -1
@@ -1,98 +0,0 @@
1
- /**
2
- * AutonomySkill — Conversational interface for autonomy management.
3
- *
4
- * Users interact with autonomy through natural language.
5
- * This module translates between human intent and AutonomyProfileManager
6
- * operations. The agent calls these functions; the user never types CLI commands.
7
- *
8
- * Functions:
9
- * - getAutonomyStatus() → natural language summary of current state
10
- * - setAutonomyProfile() → change profile with confirmation
11
- * - getTrustDashboard() → detailed trust view with elevation opportunities
12
- * - handleAutonomyRequest() → parse natural language and dispatch
13
- * - notification templates → formatted strings for Telegram delivery
14
- *
15
- * Part of the Adaptive Autonomy System spec.
16
- */
17
- import type { AutonomyProfileManager } from './AutonomyProfileManager.js';
18
- import type { TrustElevationTracker, RubberStampSignal, ElevationOpportunity } from './TrustElevationTracker.js';
19
- import type { TrustRecovery, RecoverySuggestion } from './TrustRecovery.js';
20
- import type { AutonomyProfileLevel, ResolvedAutonomyState } from './types.js';
21
- export interface AutonomySkillDeps {
22
- autonomyManager: AutonomyProfileManager;
23
- trustElevationTracker?: TrustElevationTracker | null;
24
- trustRecovery?: TrustRecovery | null;
25
- }
26
- export interface AutonomyResponse {
27
- /** Natural language text to show the user */
28
- text: string;
29
- /** What action was taken (for logging / agent context) */
30
- action: 'status' | 'set-profile' | 'trust-dashboard' | 'suggest-elevation' | 'revert' | 'info';
31
- /** Profile after the action (if changed) */
32
- newProfile?: AutonomyProfileLevel;
33
- /** The resolved state after the action */
34
- resolved?: ResolvedAutonomyState;
35
- }
36
- export declare class AutonomySkill {
37
- private deps;
38
- constructor(deps: AutonomySkillDeps);
39
- /**
40
- * Parse a natural language message and dispatch to the appropriate action.
41
- * This is the main entry point for conversational autonomy management.
42
- */
43
- handleAutonomyRequest(userMessage: string): AutonomyResponse;
44
- /**
45
- * Get a natural language summary of the current autonomy state.
46
- */
47
- getAutonomyStatus(): AutonomyResponse;
48
- /**
49
- * Set the autonomy profile and return a confirmation with what changed.
50
- */
51
- setAutonomyProfile(profile: AutonomyProfileLevel): AutonomyResponse;
52
- /**
53
- * Get the trust dashboard — detailed trust view with per-service levels.
54
- */
55
- getTrustDashboard(): AutonomyResponse;
56
- /**
57
- * Format a trust elevation suggestion for Telegram delivery.
58
- */
59
- static formatElevationSuggestion(opportunity: ElevationOpportunity): string;
60
- /**
61
- * Format a rubber-stamp detection message for Telegram delivery.
62
- */
63
- static formatRubberStampAlert(signal: RubberStampSignal): string;
64
- /**
65
- * Format a trust recovery message for Telegram delivery.
66
- */
67
- static formatTrustRecovery(suggestion: RecoverySuggestion): string;
68
- /**
69
- * Format a self-evolution notification for Telegram delivery.
70
- */
71
- static formatEvolutionApplied(opts: {
72
- proposalTitle: string;
73
- proposalId: string;
74
- affectedArea: string;
75
- confidence: number;
76
- }): string;
77
- /**
78
- * Format a profile change notification for Telegram delivery.
79
- */
80
- static formatProfileChanged(from: AutonomyProfileLevel, to: AutonomyProfileLevel, reason: string): string;
81
- /**
82
- * Classify a natural language message into an autonomy intent.
83
- */
84
- private classifyIntent;
85
- /**
86
- * Suggest the next elevation step based on current profile.
87
- */
88
- private suggestElevation;
89
- /**
90
- * Revert to the previous profile.
91
- */
92
- private revertProfile;
93
- /**
94
- * Detect overrides — config values that differ from profile defaults.
95
- */
96
- private detectOverrides;
97
- }
98
- //# sourceMappingURL=AutonomySkill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3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GAAG,MAAM;IAe3E;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM;IAehE;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM;IAIlE;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE;QAClC,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,MAAM;IAaV;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,EAAE,EAAE,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAczG;;OAEG;IACH,OAAO,CAAC,cAAc;IAYtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiCxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAiCrB;;OAEG;IACH,OAAO,CAAC,eAAe;CAcxB"}
@@ -1,497 +0,0 @@
1
- /**
2
- * AutonomySkill — Conversational interface for autonomy management.
3
- *
4
- * Users interact with autonomy through natural language.
5
- * This module translates between human intent and AutonomyProfileManager
6
- * operations. The agent calls these functions; the user never types CLI commands.
7
- *
8
- * Functions:
9
- * - getAutonomyStatus() → natural language summary of current state
10
- * - setAutonomyProfile() → change profile with confirmation
11
- * - getTrustDashboard() → detailed trust view with elevation opportunities
12
- * - handleAutonomyRequest() → parse natural language and dispatch
13
- * - notification templates → formatted strings for Telegram delivery
14
- *
15
- * Part of the Adaptive Autonomy System spec.
16
- */
17
- // ── Profile Descriptions ─────────────────────────────────────────────
18
- const PROFILE_DESCRIPTIONS = {
19
- cautious: {
20
- short: 'You approve everything',
21
- detail: 'I check with you before any risky command, propose changes for your approval, and wait for manual updates. Maximum control, maximum friction.',
22
- riskNote: 'This is the safest setting. Nothing happens without your say-so.',
23
- },
24
- supervised: {
25
- short: 'Routine is handled, important stuff goes through you',
26
- detail: 'I handle routine operations on my own and auto-apply updates, but I still propose changes for your approval. Trust auto-elevation is on, so I gradually need to ask less as we build a track record.',
27
- riskNote: 'Low risk. I may auto-apply safe updates, but all evolution proposals need your sign-off.',
28
- },
29
- collaborative: {
30
- short: 'We work together, I handle most things',
31
- detail: 'I handle most operations independently, auto-apply updates, and auto-restart after them. I still propose evolution changes for your review, but trust auto-elevates so the approval flow gets lighter over time.',
32
- riskNote: 'Moderate autonomy. I act independently on most things but still loop you in on evolution.',
33
- },
34
- autonomous: {
35
- short: 'I handle everything, you stay informed',
36
- detail: 'Full autonomy. I approve my own evolution proposals (you get notified), self-verify risky commands instead of asking, and handle updates end-to-end. You\'re in the loop via notifications, not approvals.',
37
- riskNote: 'Highest autonomy. I make decisions independently. You can always dial this back.',
38
- },
39
- };
40
- const INTENT_PATTERNS = [
41
- // Set autonomous
42
- {
43
- patterns: [
44
- /\b(?:go|set|switch|be)\s+(?:fully\s+)?autonomous\b/i,
45
- /\bhandle\s+everything\s+(?:yourself|on\s+your\s+own)\b/i,
46
- /\bfull\s+autonom/i,
47
- /\bi\s+trust\s+you\s+(?:completely|fully|with\s+everything)\b/i,
48
- /\bdon'?t\s+(?:need|have)\s+to\s+ask\s+(?:me\s+)?(?:about\s+)?anything\b/i,
49
- /\bmaximum\s+(?:autonom(?:y|ous)?|freedom)\b/i,
50
- ],
51
- intent: () => ({ type: 'set-profile', profile: 'autonomous' }),
52
- },
53
- // Set collaborative
54
- {
55
- patterns: [
56
- /\b(?:go|set|switch)\s+(?:to\s+)?collaborative\b/i,
57
- /\bwork\s+together\b/i,
58
- /\bi\s+trust\s+(?:your|you)\s+(?:judgment|judgement)\b/i,
59
- /\bhandle\s+most\s+things\b/i,
60
- ],
61
- intent: () => ({ type: 'set-profile', profile: 'collaborative' }),
62
- },
63
- // Set supervised
64
- {
65
- patterns: [
66
- /\b(?:go|set|switch)\s+(?:to\s+)?supervised\b/i,
67
- /\bask\s+(?:me\s+)?(?:about\s+)?important\s+(?:things|stuff)\b/i,
68
- /\bhandle\s+(?:the\s+)?routine\b/i,
69
- /\bsome\s+(?:autonom|supervision)\b/i,
70
- ],
71
- intent: () => ({ type: 'set-profile', profile: 'supervised' }),
72
- },
73
- // Set cautious
74
- {
75
- patterns: [
76
- /\b(?:go|set|switch)\s+(?:to\s+)?cautious\b/i,
77
- /\bapprove\s+everything\s+(?:myself|first)\b/i,
78
- /\bi\s+want\s+to\s+(?:approve|see|review)\s+everything\b/i,
79
- /\bsupervise\s+everything\b/i,
80
- /\bask\s+(?:me\s+)?(?:about\s+)?everything\b/i,
81
- /\bno\s+autonom/i,
82
- /\block\s+(?:it\s+)?down\b/i,
83
- /\bmaximum\s+(?:control|supervision|oversight)\b/i,
84
- ],
85
- intent: () => ({ type: 'set-profile', profile: 'cautious' }),
86
- },
87
- // Suggest more autonomy
88
- {
89
- patterns: [
90
- /\b(?:make\s+(?:yourself|you)\s+)?more\s+autonom(?:ous|y)\b/i,
91
- /\bincrease\s+(?:your\s+)?autonom/i,
92
- /\bmore\s+(?:freedom|independence)\b/i,
93
- /\bless\s+(?:oversight|friction|asking|supervision)\b/i,
94
- /\bstep\s+up\b/i,
95
- /\bnext\s+level\b/i,
96
- ],
97
- intent: () => ({ type: 'suggest-elevation' }),
98
- },
99
- // Suggest less autonomy
100
- {
101
- patterns: [
102
- /\b(?:make\s+(?:yourself|you)\s+)?less\s+autonomous\b/i,
103
- /\bdecrease\s+(?:your\s+)?autonom/i,
104
- /\bmore\s+(?:oversight|caution|supervision|control)\b/i,
105
- /\bslow\s+down\b/i,
106
- /\bpull\s+back\b/i,
107
- /\bdial\s+(?:it\s+)?back\b/i,
108
- ],
109
- intent: () => ({ type: 'revert' }),
110
- },
111
- // Revert / undo
112
- {
113
- patterns: [
114
- /\bundo\s+(?:that|the\s+change)\b/i,
115
- /\bgo\s+back\b/i,
116
- /\brevert\b/i,
117
- /\bprevious\s+(?:profile|setting|level)\b/i,
118
- /\broll\s*back\b/i,
119
- ],
120
- intent: () => ({ type: 'revert' }),
121
- },
122
- // Trust dashboard
123
- {
124
- patterns: [
125
- /\btrust\s+(?:level|dashboard|status|summary|report)\b/i,
126
- /\bshow\s+(?:me\s+)?(?:your\s+)?trust\b/i,
127
- /\bhow\s+much\s+(?:do\s+)?(?:i\s+)?trust\b/i,
128
- /\btrust\s+(?:score|state|profile)\b/i,
129
- ],
130
- intent: () => ({ type: 'trust-dashboard' }),
131
- },
132
- // Status / what's my setup
133
- {
134
- patterns: [
135
- /\b(?:what(?:'s| is)\s+(?:my|the|your)\s+)?(?:autonomy|autonom)\s*(?:setup|config|state|status|settings?|level|profile)?\b/i,
136
- /\b(?:show|tell|give)\s+(?:me\s+)?(?:the\s+)?(?:autonomy|autonom)\b/i,
137
- /\bhow\s+(?:autonomous|much\s+autonomy)\b/i,
138
- /\bwhat\s+(?:can|do)\s+you\s+(?:handle|do)\s+(?:on\s+your\s+own|yourself|independently)\b/i,
139
- /\bcurrent\s+(?:autonomy|profile|settings?)\b/i,
140
- /\bhow\s+much\s+freedom\b/i,
141
- /\bwhat\s+(?:are|is)\s+(?:your|the)\s+(?:current\s+)?(?:permission|approval|autonomy)/i,
142
- ],
143
- intent: () => ({ type: 'status' }),
144
- },
145
- ];
146
- // ── Main Class ───────────────────────────────────────────────────────
147
- export class AutonomySkill {
148
- deps;
149
- constructor(deps) {
150
- this.deps = deps;
151
- }
152
- // ── Public API ───────────────────────────────────────────────────
153
- /**
154
- * Parse a natural language message and dispatch to the appropriate action.
155
- * This is the main entry point for conversational autonomy management.
156
- */
157
- handleAutonomyRequest(userMessage) {
158
- const intent = this.classifyIntent(userMessage);
159
- switch (intent.type) {
160
- case 'status':
161
- return this.getAutonomyStatus();
162
- case 'set-profile':
163
- return this.setAutonomyProfile(intent.profile);
164
- case 'trust-dashboard':
165
- return this.getTrustDashboard();
166
- case 'suggest-elevation':
167
- return this.suggestElevation();
168
- case 'revert':
169
- return this.revertProfile();
170
- case 'unknown':
171
- return this.getAutonomyStatus();
172
- }
173
- }
174
- /**
175
- * Get a natural language summary of the current autonomy state.
176
- */
177
- getAutonomyStatus() {
178
- const manager = this.deps.autonomyManager;
179
- const profile = manager.getProfile();
180
- const resolved = manager.getResolvedState();
181
- const desc = PROFILE_DESCRIPTIONS[profile];
182
- const elevations = manager.getPendingElevations();
183
- const lines = [];
184
- lines.push(`Your autonomy profile is set to "${profile}" -- ${desc.short}.`);
185
- lines.push('');
186
- lines.push(desc.detail);
187
- // Show any overrides (where resolved state differs from profile defaults)
188
- const overrides = this.detectOverrides(resolved, profile);
189
- if (overrides.length > 0) {
190
- lines.push('');
191
- lines.push('Active overrides (config values that differ from the profile defaults):');
192
- for (const o of overrides) {
193
- lines.push(` - ${o}`);
194
- }
195
- }
196
- // Elevation opportunities
197
- if (elevations.length > 0) {
198
- lines.push('');
199
- lines.push(`There ${elevations.length === 1 ? 'is' : 'are'} ${elevations.length} trust elevation ${elevations.length === 1 ? 'opportunity' : 'opportunities'}:`);
200
- for (const e of elevations) {
201
- lines.push(` - ${e.service} (${e.operation}): could move from "${e.currentLevel}" to "${e.suggestedLevel}" -- ${e.reason}`);
202
- }
203
- }
204
- // Evolution proposals pending
205
- const summary = manager.getNaturalLanguageSummary();
206
- const pendingMatch = summary.match(/Pending evolution proposals: (\d+)/);
207
- if (pendingMatch) {
208
- lines.push('');
209
- lines.push(`You have ${pendingMatch[1]} evolution proposal${pendingMatch[1] === '1' ? '' : 's'} waiting for review.`);
210
- }
211
- return {
212
- text: lines.join('\n'),
213
- action: 'status',
214
- resolved,
215
- };
216
- }
217
- /**
218
- * Set the autonomy profile and return a confirmation with what changed.
219
- */
220
- setAutonomyProfile(profile) {
221
- const manager = this.deps.autonomyManager;
222
- const oldProfile = manager.getProfile();
223
- const desc = PROFILE_DESCRIPTIONS[profile];
224
- if (oldProfile === profile) {
225
- return {
226
- text: `You're already on the "${profile}" profile. ${desc.short}.`,
227
- action: 'set-profile',
228
- newProfile: profile,
229
- resolved: manager.getResolvedState(),
230
- };
231
- }
232
- // Determine direction for messaging
233
- const profileOrder = ['cautious', 'supervised', 'collaborative', 'autonomous'];
234
- const oldIndex = profileOrder.indexOf(oldProfile);
235
- const newIndex = profileOrder.indexOf(profile);
236
- const direction = newIndex > oldIndex ? 'increasing' : 'decreasing';
237
- const resolved = manager.setProfile(profile, `User request: switch from ${oldProfile} to ${profile}`);
238
- const lines = [];
239
- lines.push(`Profile changed: ${oldProfile} -> ${profile}`);
240
- lines.push('');
241
- lines.push(desc.detail);
242
- lines.push('');
243
- if (direction === 'increasing') {
244
- lines.push(desc.riskNote);
245
- }
246
- else {
247
- lines.push(`I'll be checking with you more often now. ${desc.riskNote}`);
248
- }
249
- // Summarize what concretely changed
250
- lines.push('');
251
- lines.push('What this means concretely:');
252
- lines.push(` - Evolution: ${resolved.evolutionApprovalMode === 'autonomous' ? 'I approve my own proposals (you get notified)' : 'I propose, you approve'}`);
253
- lines.push(` - Safety: ${resolved.safetyLevel === 2 ? 'I self-verify risky commands' : 'I ask you before risky commands'}`);
254
- lines.push(` - Updates: ${resolved.autoApplyUpdates ? 'auto-applied' : 'manual'}${resolved.autoRestart ? ', auto-restart' : ', manual restart'}`);
255
- lines.push(` - Trust: auto-elevation ${resolved.trustAutoElevate ? 'on' : 'off'}`);
256
- return {
257
- text: lines.join('\n'),
258
- action: 'set-profile',
259
- newProfile: profile,
260
- resolved,
261
- };
262
- }
263
- /**
264
- * Get the trust dashboard — detailed trust view with per-service levels.
265
- */
266
- getTrustDashboard() {
267
- const manager = this.deps.autonomyManager;
268
- const dashboard = manager.getDashboard();
269
- const lines = [];
270
- lines.push('--- Trust Dashboard ---');
271
- lines.push('');
272
- lines.push(`Profile: ${dashboard.profile}`);
273
- lines.push('');
274
- // Include the trust summary from AutonomyProfileManager (which calls AdaptiveTrust)
275
- if (dashboard.summary) {
276
- // Parse out the trust-specific part of the summary
277
- const summaryLines = dashboard.summary.split('\n');
278
- const trustStart = summaryLines.findIndex(l => l.startsWith('Trust status:'));
279
- if (trustStart !== -1) {
280
- lines.push('Per-service trust levels:');
281
- for (let i = trustStart + 1; i < summaryLines.length; i++) {
282
- const line = summaryLines[i];
283
- if (line.startsWith('Elevation opportunities:') || line.startsWith('Pending evolution'))
284
- break;
285
- if (line.trim())
286
- lines.push(` ${line.trim()}`);
287
- }
288
- lines.push('');
289
- }
290
- }
291
- // Elevation opportunities
292
- if (dashboard.elevations.length > 0) {
293
- lines.push('Elevation opportunities:');
294
- for (const e of dashboard.elevations) {
295
- lines.push(` - ${e.service} (${e.operation}): ${e.currentLevel} -> ${e.suggestedLevel}`);
296
- lines.push(` Reason: ${e.reason}`);
297
- }
298
- lines.push('');
299
- }
300
- // Rubber-stamp detection from tracker
301
- if (this.deps.trustElevationTracker) {
302
- const trackerDashboard = this.deps.trustElevationTracker.getDashboard();
303
- const rubberStamp = trackerDashboard.rubberStamp;
304
- if (rubberStamp?.detected) {
305
- lines.push('Notice: You might be rubber-stamping approvals.');
306
- lines.push(` ${rubberStamp.consecutiveFastApprovals} consecutive fast approvals, ${(rubberStamp.approvalRate * 100).toFixed(0)}% approval rate.`);
307
- lines.push(' Consider moving to a more autonomous profile if you trust the proposals.');
308
- lines.push('');
309
- }
310
- }
311
- // Recovery suggestions from TrustRecovery
312
- if (this.deps.trustRecovery) {
313
- const recoveries = this.deps.trustRecovery.getPendingRecoveries();
314
- if (recoveries.length > 0) {
315
- lines.push('Trust recovery available:');
316
- for (const r of recoveries) {
317
- lines.push(` - ${r.service} (${r.operation}): ${r.message}`);
318
- }
319
- lines.push('');
320
- }
321
- }
322
- // Available profiles
323
- lines.push('Available profiles:');
324
- for (const p of dashboard.availableProfiles) {
325
- const marker = p.level === dashboard.profile ? ' [current]' : '';
326
- lines.push(` - ${p.level}${marker}: ${p.description}`);
327
- }
328
- return {
329
- text: lines.join('\n'),
330
- action: 'trust-dashboard',
331
- resolved: dashboard.resolved,
332
- };
333
- }
334
- // ── Notification Templates ─────────────────────────────────────────
335
- /**
336
- * Format a trust elevation suggestion for Telegram delivery.
337
- */
338
- static formatElevationSuggestion(opportunity) {
339
- const lines = [];
340
- lines.push('Trust elevation opportunity:');
341
- lines.push('');
342
- lines.push(`${opportunity.reason}`);
343
- lines.push(`Currently: ${opportunity.current}`);
344
- lines.push(`Suggested: ${opportunity.suggested}`);
345
- lines.push('');
346
- lines.push(`Evidence: ${opportunity.evidence}`);
347
- lines.push('');
348
- lines.push('To accept: tell me to "go more autonomous" or set a specific profile.');
349
- lines.push('To dismiss: just say "not now" or "keep current settings".');
350
- return lines.join('\n');
351
- }
352
- /**
353
- * Format a rubber-stamp detection message for Telegram delivery.
354
- */
355
- static formatRubberStampAlert(signal) {
356
- const lines = [];
357
- lines.push('I noticed you might be rubber-stamping approvals:');
358
- lines.push('');
359
- lines.push(` ${signal.consecutiveFastApprovals} consecutive fast approvals`);
360
- lines.push(` ${(signal.approvalRate * 100).toFixed(0)}% approval rate`);
361
- lines.push(` Average review time: ${(signal.avgLatencyMs / 1000).toFixed(1)}s`);
362
- lines.push('');
363
- lines.push('If you trust my proposals, consider switching to a more autonomous profile.');
364
- lines.push('That way I handle things directly and just keep you informed.');
365
- lines.push('');
366
- lines.push('Say "go more autonomous" or "go autonomous" to reduce the friction.');
367
- return lines.join('\n');
368
- }
369
- /**
370
- * Format a trust recovery message for Telegram delivery.
371
- */
372
- static formatTrustRecovery(suggestion) {
373
- return suggestion.message;
374
- }
375
- /**
376
- * Format a self-evolution notification for Telegram delivery.
377
- */
378
- static formatEvolutionApplied(opts) {
379
- const lines = [];
380
- lines.push('Self-evolution applied:');
381
- lines.push('');
382
- lines.push(`"${opts.proposalTitle}"`);
383
- lines.push(`Area: ${opts.affectedArea}`);
384
- lines.push(`Confidence: ${(opts.confidence * 100).toFixed(0)}%`);
385
- lines.push('');
386
- lines.push('This was auto-approved under your current autonomy profile.');
387
- lines.push('Say "undo that" to revert, or "show evolution history" for details.');
388
- return lines.join('\n');
389
- }
390
- /**
391
- * Format a profile change notification for Telegram delivery.
392
- */
393
- static formatProfileChanged(from, to, reason) {
394
- const desc = PROFILE_DESCRIPTIONS[to];
395
- const lines = [];
396
- lines.push(`Autonomy profile changed: ${from} -> ${to}`);
397
- lines.push(`Reason: ${reason}`);
398
- lines.push('');
399
- lines.push(desc.short);
400
- lines.push('');
401
- lines.push('Say "undo that" or "go back" to revert.');
402
- return lines.join('\n');
403
- }
404
- // ── Private ────────────────────────────────────────────────────────
405
- /**
406
- * Classify a natural language message into an autonomy intent.
407
- */
408
- classifyIntent(message) {
409
- for (const { patterns, intent } of INTENT_PATTERNS) {
410
- for (const pattern of patterns) {
411
- const match = message.match(pattern);
412
- if (match) {
413
- return intent(match);
414
- }
415
- }
416
- }
417
- return { type: 'unknown', raw: message };
418
- }
419
- /**
420
- * Suggest the next elevation step based on current profile.
421
- */
422
- suggestElevation() {
423
- const manager = this.deps.autonomyManager;
424
- const current = manager.getProfile();
425
- const order = ['cautious', 'supervised', 'collaborative', 'autonomous'];
426
- const currentIdx = order.indexOf(current);
427
- if (currentIdx >= order.length - 1) {
428
- return {
429
- text: 'You\'re already at the most autonomous profile. There\'s no higher level to go to.\n\nIf you want finer-grained control, you can adjust individual trust levels per service.',
430
- action: 'suggest-elevation',
431
- resolved: manager.getResolvedState(),
432
- };
433
- }
434
- const next = order[currentIdx + 1];
435
- const nextDesc = PROFILE_DESCRIPTIONS[next];
436
- const lines = [];
437
- lines.push(`You're currently on "${current}". The next level up is "${next}":`);
438
- lines.push('');
439
- lines.push(nextDesc.detail);
440
- lines.push('');
441
- lines.push(nextDesc.riskNote);
442
- lines.push('');
443
- lines.push(`Want me to switch to "${next}"? Just say "go ${next}" to confirm.`);
444
- return {
445
- text: lines.join('\n'),
446
- action: 'suggest-elevation',
447
- resolved: manager.getResolvedState(),
448
- };
449
- }
450
- /**
451
- * Revert to the previous profile.
452
- */
453
- revertProfile() {
454
- const manager = this.deps.autonomyManager;
455
- const history = manager.getHistory();
456
- const current = manager.getProfile();
457
- if (history.length === 0) {
458
- return {
459
- text: `You're on the "${current}" profile and there's no previous profile to revert to. This is where you started.`,
460
- action: 'revert',
461
- resolved: manager.getResolvedState(),
462
- };
463
- }
464
- const lastChange = history[history.length - 1];
465
- const previous = lastChange.from;
466
- if (previous === current) {
467
- // The last change was FROM the current profile — means we already reverted
468
- // or something odd happened. Try going one more back.
469
- if (history.length >= 2) {
470
- const olderChange = history[history.length - 2];
471
- return this.setAutonomyProfile(olderChange.from);
472
- }
473
- return {
474
- text: `You're already back on "${current}". There's no earlier profile to revert to.`,
475
- action: 'revert',
476
- resolved: manager.getResolvedState(),
477
- };
478
- }
479
- return this.setAutonomyProfile(previous);
480
- }
481
- /**
482
- * Detect overrides — config values that differ from profile defaults.
483
- */
484
- detectOverrides(resolved, _profile) {
485
- // The resolved state already accounts for overrides vs defaults.
486
- // We note this but the manager handles the resolution internally.
487
- // For now, we can compare resolved to what the profile normally means.
488
- const overrides = [];
489
- // Check notifications preferences
490
- const prefs = this.deps.autonomyManager.getNotificationPreferences();
491
- if (prefs.evolutionDigest && prefs.evolutionDigest !== 'immediate') {
492
- overrides.push(`Evolution digest: ${prefs.evolutionDigest} (instead of immediate)`);
493
- }
494
- return overrides;
495
- }
496
- }
497
- //# sourceMappingURL=AutonomySkill.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutonomySkill.js","sourceRoot":"","sources":["../../src/core/AutonomySkill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0BH,wEAAwE;AAExE,MAAM,oBAAoB,GAIrB;IACH,QAAQ,EAAE;QACR,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,+IAA+I;QACvJ,QAAQ,EAAE,kEAAkE;KAC7E;IACD,UAAU,EAAE;QACV,KAAK,EAAE,sDAAsD;QAC7D,MAAM,EAAE,sMAAsM;QAC9M,QAAQ,EAAE,0FAA0F;KACrG;IACD,aAAa,EAAE;QACb,KAAK,EAAE,wCAAwC;QAC/C,MAAM,EAAE,kNAAkN;QAC1N,Q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