@vibeiao/sdk 0.1.53 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agentLoop-D394RDif.d.ts +332 -0
- package/dist/agentLoop.d.ts +1 -1
- package/dist/agentLoop.js +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/treasuryGuardian.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { ResourceSnapshot, SelfRelianceState, SelfReliance } from './selfReliance.js';
|
|
2
|
+
import { SurvivalMode, SurvivalRecommendation } from './survivalPlaybook.js';
|
|
3
|
+
import { EscapeHatchDecision, EscapeHatchPolicy, EscapeHatchSnapshot } from './survivalEscapeHatch.js';
|
|
4
|
+
import { CompoundingMemoryUpgradeResult, CompoundingMemoryRequiredSetResult } from './compoundingMemory.js';
|
|
5
|
+
import { StrictMemoryRuntimePreset, StrictMemoryEvaluation, StrictMemoryUpgradeResult } from './strictMemoryRuntime.js';
|
|
6
|
+
|
|
7
|
+
type PromptShieldTrustLevel = 'trusted_human' | 'internal_system' | 'external_untrusted';
|
|
8
|
+
type PromptShieldInput = {
|
|
9
|
+
source: string;
|
|
10
|
+
trust: PromptShieldTrustLevel;
|
|
11
|
+
content: string;
|
|
12
|
+
};
|
|
13
|
+
type PromptShieldFlag = 'instruction_override' | 'credential_exfiltration' | 'destructive_command' | 'authority_spoof' | 'sensitive_action_without_trust';
|
|
14
|
+
type PromptShieldRisk = 'low' | 'medium' | 'high';
|
|
15
|
+
type PromptShieldDecision = {
|
|
16
|
+
allow: boolean;
|
|
17
|
+
risk: PromptShieldRisk;
|
|
18
|
+
flags: PromptShieldFlag[];
|
|
19
|
+
rationale: string[];
|
|
20
|
+
blockedInputs: PromptShieldInput[];
|
|
21
|
+
};
|
|
22
|
+
type PromptShieldPolicy = {
|
|
23
|
+
blockOnFlags?: PromptShieldFlag[];
|
|
24
|
+
allowUntrustedForAnalysisOnly?: boolean;
|
|
25
|
+
};
|
|
26
|
+
declare const evaluatePromptShield: (inputs: PromptShieldInput[], options?: {
|
|
27
|
+
isSensitiveAction?: boolean;
|
|
28
|
+
policy?: PromptShieldPolicy;
|
|
29
|
+
}) => PromptShieldDecision;
|
|
30
|
+
|
|
31
|
+
type ObjectiveChangeSourceTrust = 'trusted_human' | 'internal_system' | 'external_untrusted';
|
|
32
|
+
type ObjectiveChangeProposal = {
|
|
33
|
+
source: string;
|
|
34
|
+
trust: ObjectiveChangeSourceTrust;
|
|
35
|
+
currentObjective: string;
|
|
36
|
+
proposedObjective: string;
|
|
37
|
+
rationale?: string;
|
|
38
|
+
evidence?: Array<{
|
|
39
|
+
claim: string;
|
|
40
|
+
verified?: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
43
|
+
type ObjectiveGuardDecision = {
|
|
44
|
+
allowObjectiveChange: boolean;
|
|
45
|
+
reason: string;
|
|
46
|
+
checks: {
|
|
47
|
+
explicitInstruction: boolean;
|
|
48
|
+
missionAligned: boolean;
|
|
49
|
+
evidenceProvided: boolean;
|
|
50
|
+
evidenceVerified: boolean;
|
|
51
|
+
};
|
|
52
|
+
risk: 'low' | 'medium' | 'high';
|
|
53
|
+
};
|
|
54
|
+
type ObjectiveGuardPolicy = {
|
|
55
|
+
requireMissionAlignment?: boolean;
|
|
56
|
+
requireEvidenceVerification?: boolean;
|
|
57
|
+
allowExternalExplicitInstruction?: boolean;
|
|
58
|
+
};
|
|
59
|
+
declare const evaluateObjectiveChange: (proposal: ObjectiveChangeProposal, policy?: ObjectiveGuardPolicy) => ObjectiveGuardDecision;
|
|
60
|
+
|
|
61
|
+
type IntentSignals = {
|
|
62
|
+
expectedBuildValue?: number;
|
|
63
|
+
expectedBuildRevenue?: number;
|
|
64
|
+
expectedPolishValue?: number;
|
|
65
|
+
expectedPolishRevenueProtection?: number;
|
|
66
|
+
urgentUserDemand?: boolean;
|
|
67
|
+
releaseReady?: boolean;
|
|
68
|
+
criticalPolishSignal?: boolean;
|
|
69
|
+
builderObjectiveAvailable?: boolean;
|
|
70
|
+
};
|
|
71
|
+
type LaneMode = 'polish' | 'builder';
|
|
72
|
+
type LaneSwitchDecision = {
|
|
73
|
+
lane: LaneMode;
|
|
74
|
+
greenStreak: number;
|
|
75
|
+
switched: boolean;
|
|
76
|
+
reason: string;
|
|
77
|
+
};
|
|
78
|
+
declare const scoreBuildLane: (signals: IntentSignals, survivalMode: SurvivalMode) => number;
|
|
79
|
+
declare const scorePolishLane: (signals: IntentSignals, survivalMode: SurvivalMode, humanDemand: AgentHumanDemand) => number;
|
|
80
|
+
declare const evaluateLaneSwitch: (input: {
|
|
81
|
+
previousLane?: LaneMode;
|
|
82
|
+
previousGreenStreak?: number;
|
|
83
|
+
releaseReady: boolean;
|
|
84
|
+
criticalPolishSignal?: boolean;
|
|
85
|
+
builderObjectiveAvailable?: boolean;
|
|
86
|
+
builderOnGreenStreak?: number;
|
|
87
|
+
}) => LaneSwitchDecision;
|
|
88
|
+
declare const applyIntentArbitration: (input: {
|
|
89
|
+
base: AgentWorkArbitrationDecision;
|
|
90
|
+
survivalMode: SurvivalMode;
|
|
91
|
+
signals?: IntentSignals;
|
|
92
|
+
}) => AgentWorkArbitrationDecision;
|
|
93
|
+
|
|
94
|
+
type AgentLoopEscapeHatchInput = {
|
|
95
|
+
snapshot: ResourceSnapshot;
|
|
96
|
+
survivalState: SelfRelianceState;
|
|
97
|
+
survivalMode: SurvivalMode;
|
|
98
|
+
timestamp: number;
|
|
99
|
+
};
|
|
100
|
+
type AgentLoopEscapeHatchConfig = {
|
|
101
|
+
/** Enable auto escape-hatch evaluation (default true, only in SURVIVE/BLINK). */
|
|
102
|
+
enabled?: boolean;
|
|
103
|
+
policy?: EscapeHatchPolicy;
|
|
104
|
+
resolveEnv?: (name: string) => string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Optional mapper from loop context -> escape hatch snapshot.
|
|
107
|
+
* If omitted, a default mapper reads optional fields from snapshot.
|
|
108
|
+
*/
|
|
109
|
+
buildSnapshot?: (input: AgentLoopEscapeHatchInput) => EscapeHatchSnapshot | null | undefined;
|
|
110
|
+
/** Called when an escape-hatch decision is produced. */
|
|
111
|
+
onDecision?: (decision: EscapeHatchDecision, input: AgentLoopEscapeHatchInput) => Promise<void> | void;
|
|
112
|
+
};
|
|
113
|
+
type AgentLoopStrictMemoryConfig = {
|
|
114
|
+
/** Enable strict memory runtime checks in loop. Default true. */
|
|
115
|
+
enabled?: boolean;
|
|
116
|
+
/** observe (default) records decisions; enforce blocks onAct when checks fail. */
|
|
117
|
+
mode?: 'observe' | 'enforce';
|
|
118
|
+
/** Optional preset overrides. */
|
|
119
|
+
preset?: Partial<StrictMemoryRuntimePreset>;
|
|
120
|
+
/** Build per-cycle evaluation input. Defaults to best-effort snapshot fields. */
|
|
121
|
+
buildInput?: (ctx: {
|
|
122
|
+
snapshot: ResourceSnapshot;
|
|
123
|
+
timestamp: number;
|
|
124
|
+
}) => {
|
|
125
|
+
taskText: string;
|
|
126
|
+
isMutation: boolean;
|
|
127
|
+
contextPackPrepared: boolean;
|
|
128
|
+
semanticRecallConfirmed: boolean;
|
|
129
|
+
approvalPreflightPassed: boolean;
|
|
130
|
+
};
|
|
131
|
+
/** Optional hook when strict-memory evaluation runs. */
|
|
132
|
+
onEvaluation?: (ev: StrictMemoryEvaluation) => Promise<void> | void;
|
|
133
|
+
};
|
|
134
|
+
type AgentLoopPromptShieldConfig = {
|
|
135
|
+
/** Enable prompt-injection shield over untrusted external content. Default true. */
|
|
136
|
+
enabled?: boolean;
|
|
137
|
+
/** observe logs/records only; enforce blocks actions when shield fails. Default observe. */
|
|
138
|
+
mode?: 'observe' | 'enforce';
|
|
139
|
+
/** Optional policy overrides for blocked flags. */
|
|
140
|
+
policy?: PromptShieldPolicy;
|
|
141
|
+
/** Optional mapper from snapshot to trust-labeled inputs. */
|
|
142
|
+
buildInputs?: (ctx: {
|
|
143
|
+
snapshot: ResourceSnapshot;
|
|
144
|
+
timestamp: number;
|
|
145
|
+
}) => PromptShieldInput[];
|
|
146
|
+
/** Optional hook when prompt shield decision is produced. */
|
|
147
|
+
onDecision?: (decision: PromptShieldDecision) => Promise<void> | void;
|
|
148
|
+
};
|
|
149
|
+
type AgentLoopObjectiveGuardConfig = {
|
|
150
|
+
/** Enable objective integrity checks for external objective-change attempts. Default true. */
|
|
151
|
+
enabled?: boolean;
|
|
152
|
+
/** observe logs only; enforce blocks actions when objective mutation is denied. Default observe. */
|
|
153
|
+
mode?: 'observe' | 'enforce';
|
|
154
|
+
/** Policy requirements for external objective mutation acceptance. */
|
|
155
|
+
policy?: ObjectiveGuardPolicy;
|
|
156
|
+
/** Build proposed objective change from snapshot. Return null when no proposal is present. */
|
|
157
|
+
buildProposal?: (ctx: {
|
|
158
|
+
snapshot: ResourceSnapshot;
|
|
159
|
+
timestamp: number;
|
|
160
|
+
}) => ObjectiveChangeProposal | null;
|
|
161
|
+
/** Optional hook when objective decision is produced. */
|
|
162
|
+
onDecision?: (decision: ObjectiveGuardDecision) => Promise<void> | void;
|
|
163
|
+
};
|
|
164
|
+
type AgentOwnershipMode = 'owner_bound' | 'unbound';
|
|
165
|
+
type AgentPriorityMode = 'human_first' | 'autonomous_first';
|
|
166
|
+
type AgentHumanDemand = {
|
|
167
|
+
pending: boolean;
|
|
168
|
+
count?: number;
|
|
169
|
+
source?: string;
|
|
170
|
+
};
|
|
171
|
+
type AgentAutonomousTaskKind = 'polish_existing_product' | 'build_new_product';
|
|
172
|
+
type AgentWorkArbitrationDecision = {
|
|
173
|
+
ownershipMode: AgentOwnershipMode;
|
|
174
|
+
priorityMode: AgentPriorityMode;
|
|
175
|
+
rolloutMode: 'observe' | 'enforce';
|
|
176
|
+
humanDemand: AgentHumanDemand;
|
|
177
|
+
runHumanTask: boolean;
|
|
178
|
+
runAutonomousTask: boolean;
|
|
179
|
+
lane?: LaneMode;
|
|
180
|
+
laneDecision?: LaneSwitchDecision;
|
|
181
|
+
proactiveBuildSuggested?: boolean;
|
|
182
|
+
autonomousTaskKind?: AgentAutonomousTaskKind;
|
|
183
|
+
reason: string;
|
|
184
|
+
};
|
|
185
|
+
type AgentLoopAutonomyConfig = {
|
|
186
|
+
enabled?: boolean;
|
|
187
|
+
ownershipMode?: AgentOwnershipMode;
|
|
188
|
+
priorityMode?: AgentPriorityMode;
|
|
189
|
+
rolloutMode?: 'observe' | 'enforce';
|
|
190
|
+
resolveHumanDemand?: () => Promise<boolean | AgentHumanDemand> | boolean | AgentHumanDemand;
|
|
191
|
+
intentPolicy?: {
|
|
192
|
+
enabled?: boolean;
|
|
193
|
+
laneSwitch?: {
|
|
194
|
+
enabled?: boolean;
|
|
195
|
+
builderOnGreenStreak?: number;
|
|
196
|
+
};
|
|
197
|
+
resolveSignals?: (ctx: {
|
|
198
|
+
snapshot: ResourceSnapshot;
|
|
199
|
+
survivalMode: SurvivalMode;
|
|
200
|
+
humanDemand: AgentHumanDemand;
|
|
201
|
+
}) => Promise<IntentSignals | null> | IntentSignals | null;
|
|
202
|
+
};
|
|
203
|
+
onAutonomous?: (ctx: AgentLoopContext, task?: {
|
|
204
|
+
kind: AgentAutonomousTaskKind;
|
|
205
|
+
}) => Promise<void> | void;
|
|
206
|
+
onArbitration?: (decision: AgentWorkArbitrationDecision, ctx: AgentLoopContext) => Promise<void> | void;
|
|
207
|
+
};
|
|
208
|
+
type AgentLoopContext = {
|
|
209
|
+
snapshot: ResourceSnapshot;
|
|
210
|
+
survivalState: SelfRelianceState;
|
|
211
|
+
survivalMode: SurvivalMode;
|
|
212
|
+
survivalRecommendation: SurvivalRecommendation;
|
|
213
|
+
survivalFormatted: string;
|
|
214
|
+
/** Deterministic block for planners/loggers: survival + escape-hatch decision (if present). */
|
|
215
|
+
survivalDecisionBlock: string;
|
|
216
|
+
/** Present when escape-hatch evaluation runs (SURVIVE/BLINK by default). */
|
|
217
|
+
escapeHatchDecision?: EscapeHatchDecision;
|
|
218
|
+
escapeHatchFormatted?: string;
|
|
219
|
+
/** Present when memory auto-upgrade is enabled in the loop. */
|
|
220
|
+
memoryUpgrade?: CompoundingMemoryUpgradeResult;
|
|
221
|
+
/** Present when required-set maintenance check runs (default daily). */
|
|
222
|
+
memoryRequiredSet?: CompoundingMemoryRequiredSetResult;
|
|
223
|
+
/** Strict-memory runtime preset + per-cycle evaluation status. */
|
|
224
|
+
strictMemoryPreset?: StrictMemoryRuntimePreset;
|
|
225
|
+
strictMemoryEvaluation?: StrictMemoryEvaluation;
|
|
226
|
+
strictMemoryUpgrade?: StrictMemoryUpgradeResult;
|
|
227
|
+
/** Prompt-injection shield decision for this cycle. */
|
|
228
|
+
promptShieldDecision?: PromptShieldDecision;
|
|
229
|
+
/** Objective integrity guard decision for this cycle (when proposal exists). */
|
|
230
|
+
objectiveGuardDecision?: ObjectiveGuardDecision;
|
|
231
|
+
/** Human-vs-autonomous work arbitration decision for this cycle. */
|
|
232
|
+
workArbitration?: AgentWorkArbitrationDecision;
|
|
233
|
+
laneDecision?: LaneSwitchDecision;
|
|
234
|
+
timestamp: number;
|
|
235
|
+
};
|
|
236
|
+
type AgentLoopMemoryConfig = {
|
|
237
|
+
/** Enable one-time memory scaffold upgrade. Default true. */
|
|
238
|
+
enabled?: boolean;
|
|
239
|
+
/** Workspace root for compounding memory files. Default current working directory ("."). */
|
|
240
|
+
root?: string;
|
|
241
|
+
/** Timezone for daily ledger date key. Default UTC. */
|
|
242
|
+
timeZone?: string;
|
|
243
|
+
/** Hook called after memory upgrade check completes. */
|
|
244
|
+
onUpgrade?: (result: CompoundingMemoryUpgradeResult) => Promise<void> | void;
|
|
245
|
+
/** Enable required-set maintenance checks (bounded working state + recall substrate + restore drill). Default true. */
|
|
246
|
+
requiredSetEnabled?: boolean;
|
|
247
|
+
/** Interval for required-set checks. Default 24h. */
|
|
248
|
+
requiredSetIntervalMs?: number;
|
|
249
|
+
/** Run required-set check on first loop cycle. Default true. */
|
|
250
|
+
requiredSetRunOnStart?: boolean;
|
|
251
|
+
/** Include backup+restore drill in required-set check. Default true. */
|
|
252
|
+
requiredSetRunRestoreDrill?: boolean;
|
|
253
|
+
/** Hook called when required-set check runs. */
|
|
254
|
+
onRequiredSet?: (result: CompoundingMemoryRequiredSetResult) => Promise<void> | void;
|
|
255
|
+
};
|
|
256
|
+
type AgentLoopDurabilityConfig = {
|
|
257
|
+
/** Enable durability-proxy writes from runtime loop. Default false. */
|
|
258
|
+
enabled?: boolean;
|
|
259
|
+
/** Durability-proxy base URL (e.g. http://127.0.0.1:8790). */
|
|
260
|
+
baseUrl: string;
|
|
261
|
+
/** Agent id registered in durability-proxy. */
|
|
262
|
+
agentId: string;
|
|
263
|
+
/** Agent token registered in durability-proxy. */
|
|
264
|
+
agentToken: string;
|
|
265
|
+
/** Optional timeout for durability-proxy calls. Default 8000ms. */
|
|
266
|
+
timeoutMs?: number;
|
|
267
|
+
/** Write checkpoint after each required-set run. Default true. */
|
|
268
|
+
checkpointOnRequiredSet?: boolean;
|
|
269
|
+
/** Write restore-drill outcome when required-set includes restore drill. Default true. */
|
|
270
|
+
reportRestoreDrill?: boolean;
|
|
271
|
+
/** Called when durability checkpoint is written. */
|
|
272
|
+
onCheckpointWritten?: (result: {
|
|
273
|
+
checkpointId?: string;
|
|
274
|
+
createdAt?: string;
|
|
275
|
+
checkedAt: string;
|
|
276
|
+
}) => Promise<void> | void;
|
|
277
|
+
/** Called when durability restore drill signal is written. */
|
|
278
|
+
onRestoreDrillReported?: (result: {
|
|
279
|
+
ok: boolean;
|
|
280
|
+
ts?: string;
|
|
281
|
+
checkedAt: string;
|
|
282
|
+
}) => Promise<void> | void;
|
|
283
|
+
};
|
|
284
|
+
type AgentLoopHooks = {
|
|
285
|
+
/** Called every cycle after snapshot is fetched and survival state is updated. */
|
|
286
|
+
onCycle?: (ctx: AgentLoopContext) => Promise<void> | void;
|
|
287
|
+
/**
|
|
288
|
+
* Optional: run reflection in the loop.
|
|
289
|
+
* Keep this hook pure/side-effect bounded; it should manage its own persistence.
|
|
290
|
+
*/
|
|
291
|
+
onReflection?: (ctx: AgentLoopContext) => Promise<void> | void;
|
|
292
|
+
/**
|
|
293
|
+
* Optional: the agent's planner/executor entrypoint.
|
|
294
|
+
* This is where you actually "act like a human" using ctx + your own memory.
|
|
295
|
+
*/
|
|
296
|
+
onAct?: (ctx: AgentLoopContext) => Promise<void> | void;
|
|
297
|
+
onError?: (err: Error) => Promise<void> | void;
|
|
298
|
+
};
|
|
299
|
+
type AgentLoopConfig = {
|
|
300
|
+
survival: SelfReliance;
|
|
301
|
+
fetchSnapshot: () => Promise<ResourceSnapshot>;
|
|
302
|
+
intervalMs?: number;
|
|
303
|
+
/** If true, call survival.guard() before onAct(). Default true. */
|
|
304
|
+
guardAct?: boolean;
|
|
305
|
+
/** Optional override for time source (tests). */
|
|
306
|
+
now?: () => number;
|
|
307
|
+
hooks?: AgentLoopHooks;
|
|
308
|
+
escapeHatch?: AgentLoopEscapeHatchConfig;
|
|
309
|
+
memory?: AgentLoopMemoryConfig;
|
|
310
|
+
durability?: AgentLoopDurabilityConfig;
|
|
311
|
+
strictMemory?: AgentLoopStrictMemoryConfig;
|
|
312
|
+
promptShield?: AgentLoopPromptShieldConfig;
|
|
313
|
+
objectiveGuard?: AgentLoopObjectiveGuardConfig;
|
|
314
|
+
autonomy?: AgentLoopAutonomyConfig;
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Create a closed-loop runner that:
|
|
318
|
+
* 1) fetches a resource snapshot
|
|
319
|
+
* 2) updates SelfReliance
|
|
320
|
+
* 3) classifies survival mode + produces a playbook recommendation
|
|
321
|
+
* 4) auto-evaluates escape hatch in SURVIVE/BLINK (guardrail decision block)
|
|
322
|
+
* 5) optionally runs reflection + action hooks
|
|
323
|
+
*
|
|
324
|
+
* Non-breaking by design: you choose what to do with the context.
|
|
325
|
+
*/
|
|
326
|
+
declare const createAgentLoop: (config: AgentLoopConfig) => {
|
|
327
|
+
start: () => Promise<void>;
|
|
328
|
+
stop: () => void;
|
|
329
|
+
runOnce: () => Promise<void>;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export { type AgentAutonomousTaskKind as A, type AgentLoopStrictMemoryConfig as B, type AgentOwnershipMode as C, type AgentPriorityMode as D, type AgentWorkArbitrationDecision as E, createAgentLoop as F, type IntentSignals as I, type LaneMode as L, type ObjectiveChangeProposal as O, type PromptShieldDecision as P, type LaneSwitchDecision as a, type ObjectiveChangeSourceTrust as b, type ObjectiveGuardDecision as c, type ObjectiveGuardPolicy as d, type PromptShieldFlag as e, type PromptShieldInput as f, type PromptShieldPolicy as g, type PromptShieldRisk as h, type PromptShieldTrustLevel as i, applyIntentArbitration as j, evaluateLaneSwitch as k, evaluateObjectiveChange as l, evaluatePromptShield as m, scorePolishLane as n, type AgentHumanDemand as o, type AgentLoopAutonomyConfig as p, type AgentLoopConfig as q, type AgentLoopContext as r, scoreBuildLane as s, type AgentLoopDurabilityConfig as t, type AgentLoopEscapeHatchConfig as u, type AgentLoopEscapeHatchInput as v, type AgentLoopHooks as w, type AgentLoopMemoryConfig as x, type AgentLoopObjectiveGuardConfig as y, type AgentLoopPromptShieldConfig as z };
|
package/dist/agentLoop.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ import './survivalPlaybook.js';
|
|
|
3
3
|
import './survivalEscapeHatch.js';
|
|
4
4
|
import './compoundingMemory.js';
|
|
5
5
|
import './strictMemoryRuntime.js';
|
|
6
|
-
export { A as
|
|
6
|
+
export { A as AgentAutonomousTaskKind, o as AgentHumanDemand, p as AgentLoopAutonomyConfig, q as AgentLoopConfig, r as AgentLoopContext, t as AgentLoopDurabilityConfig, u as AgentLoopEscapeHatchConfig, v as AgentLoopEscapeHatchInput, w as AgentLoopHooks, x as AgentLoopMemoryConfig, y as AgentLoopObjectiveGuardConfig, z as AgentLoopPromptShieldConfig, B as AgentLoopStrictMemoryConfig, C as AgentOwnershipMode, D as AgentPriorityMode, E as AgentWorkArbitrationDecision, F as createAgentLoop } from './agentLoop-D394RDif.js';
|
package/dist/agentLoop.js
CHANGED
|
@@ -350,6 +350,7 @@ var createAgentLoop = (config) => {
|
|
|
350
350
|
humanDemand,
|
|
351
351
|
runHumanTask: true,
|
|
352
352
|
runAutonomousTask: false,
|
|
353
|
+
autonomousTaskKind: "polish_existing_product",
|
|
353
354
|
reason: "legacy_onAct"
|
|
354
355
|
};
|
|
355
356
|
let laneDecision;
|
|
@@ -407,6 +408,7 @@ var createAgentLoop = (config) => {
|
|
|
407
408
|
}
|
|
408
409
|
}
|
|
409
410
|
}
|
|
411
|
+
arbitrationBase.autonomousTaskKind = arbitrationBase.runAutonomousTask && !humanDemand.pending ? "build_new_product" : "polish_existing_product";
|
|
410
412
|
const ctx = {
|
|
411
413
|
snapshot,
|
|
412
414
|
survivalState,
|
|
@@ -442,7 +444,9 @@ var createAgentLoop = (config) => {
|
|
|
442
444
|
};
|
|
443
445
|
const runAutonomousTask = async () => {
|
|
444
446
|
if (!config.autonomy?.onAutonomous) return;
|
|
445
|
-
await config.autonomy.onAutonomous(ctx
|
|
447
|
+
await config.autonomy.onAutonomous(ctx, {
|
|
448
|
+
kind: ctx.workArbitration?.autonomousTaskKind || "polish_existing_product"
|
|
449
|
+
});
|
|
446
450
|
};
|
|
447
451
|
if (strictMemoryEnabled && strictMode === "enforce" && ctx.strictMemoryEvaluation && !ctx.strictMemoryEvaluation.allowed) {
|
|
448
452
|
const missing = ctx.strictMemoryEvaluation.missingSteps.join(",");
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { MarketDiscoveryClient, MarketNeed, MarketSignal, deriveMarketNeeds, dis
|
|
|
9
9
|
export { A as AdapterBestShotChecklistResult, a as AdapterPackKind, b as AdapterPackOptions, c as AdaptiveAdaptationPlan, d as AdaptiveExecution, e as AdaptiveFeedbackAggregate, f as AdaptivePolicyConfig, g as AdaptivePolicyDecision, h as AdaptivePolicyState, i as AdaptiveReflectionStore, j as AdaptiveTheme, k as AdaptiveVerification, l as AgentLaunchRuntimeOptions, m as AgentLaunchRuntimeResult, n as AgentResourceProvidersManifest, o as AgentReviewRuntimeOptions, p as AnalyticsPoint, q as ApiCreditProvider, r as ApiCreditProviderFactoryOptions, s as ApiCreditProviderPreset, t as ApiCreditProviderPresetInput, u as ApiResponse, B as BuybackEvent, C as CONTEXT_PACK_SECTION_ORDER, v as ContextPack, w as ContextPackBudget, x as ContextPackGateOptions, y as ContextPackGateResult, z as ContextPackInput, D as ContextPackOptions, E as ContextPackSectionKey, F as ContextPackSections, G as ContextPackState, H as DurabilityCheckpointWriteOptions, I as DurabilityProxyClientOptions, J as DurabilityRestoreDrillWriteOptions, K as ExecutionAdapter, L as ExecutionApplyResult, M as ExecutionDecisionRecord, N as ExecutionDryRunResult, O as ExecutionPostDeployVerifyResult, P as ExecutionRollbackResult, Q as ExecutionRolloutMode, R as ExecutionRunResult, S as ExecutionValidateResult, T as LISTING_NAME_MAX_LENGTH, U as LISTING_NAME_RECOMMENDED_MAX, V as LISTING_TAGLINE_MAX_LENGTH, W as LISTING_TAGLINE_RECOMMENDED_MAX, X as LaunchProfile, Y as LaunchReadinessInput, Z as LaunchReadinessResult, _ as LeaderboardEntry, $ as LeaderboardQuery, a0 as ListingNamingValidationOptions, a1 as ListingNamingValidationResult, a2 as ListingQuery, a3 as ListingReviewCreatePayload, a4 as ListingReviewResponsePayload, a5 as ListingVersionPayload, a6 as MarketingCampaign, a7 as MarketingLinkOptions, a8 as MemoryPingChallengeResponse, a9 as MemoryPingPayload, aa as OpenRouterCredits, ab as ProcurementCandidate, ac as ProcurementDecision, ad as ProcurementTaskProfile, ae as ProcurementWeights, af as ResourceProviderManifestEntry, ag as ResourceSnapshot, ah as ReviewGate, ai as ReviewGateRecord, aj as ReviewRequiredPayload, ak as RunAdaptiveReflectionOptions, al as RuntimeMigrationInput, am as RuntimeMigrationPlan, an as RuntimeStateSnapshot, ao as SdkAutoUpdatedRestartRequiredError, ap as SdkUpdateCheckOptions, aq as SdkUpdatePolicyCheckOptions, ar as SdkUpdateRequiredError, as as SdkUpdateStatus, TopupDecision, TopupRequest, TreasuryLedgerEvent, TreasuryPolicy, TreasuryPolicyV1, TreasuryState, at as VIBEIAO_IDL, au as VibeClient, av as VibeClientOptions, aw as VibeRegistry, ax as aggregateFeedbackSignals, ay as assertLaunchReady, az as assertSurvivalProvidersConfigured, aA as buildAdaptivePlan, aB as buildBadgeMarkdown, aC as buildClaimMessage, aD as buildDecisionRecord, aE as buildJupiterSwapUrl, aF as buildListingVersionMessage, aG as buildMemoryPingMessage, aH as buildOwnerTransferMessage, aI as buildProcurementPrompt, aJ as buildRaydiumSwapUrl, aK as buildReviewPrompt, aL as buildReviewRequired, aM as buildReviewResponseMessage, aN as buildRuntimeMigrationPlan, aO as buildSdkUpdateCommand, aP as buildShareCopy, aQ as buildShareLink, aR as buildTradeLinks, buildTreasuryLedgerEvent, aS as checkForSdkUpdate, aT as checkForSdkUpdatePolicy, aU as compareVersions, aV as createApiCreditProvider, aW as createApiCreditProviders, aX as createApiCreditProvidersFromManifest, aY as createCampaign, aZ as createContextPack, a_ as createCustomAdapter, a$ as createDurabilityProxyClient, b0 as createServiceApiAdapter, createTreasuryPolicy, b1 as createWebBundledAdapter, b2 as createWebStaticAdapter, b3 as createWorkflowAgentAdapter, b4 as decideProcurementForTask, b5 as estimateContextPackTokens, b6 as evaluateAdaptiveReflectionPolicy, b7 as evaluateContextPackGate, b8 as evaluateLaunchReadiness, evaluateTopupRequest, b9 as getResourceSnapshot, ba as normalizeListingText, bb as rankListingsForTask, bc as runAdapterBestShotChecklist, bd as runAdaptiveReflectionCycle, be as runAgentLaunchRuntime, bf as runAgentLaunchRuntimeCycle, bg as runAgentReviewRuntimeCycle, bh as runExecutionAdapter, bi as sanitizeListingNaming, bj as scoreListingForTask, bk as shouldAnnounceStateChange, treasuryStateFromSnapshot, bl as validateContextPack, bm as validateListingNaming, validateTreasuryPolicy, bn as verifyAdaptiveExecutionReadiness } from './treasuryGuardian.js';
|
|
10
10
|
export { OUTCOME_BOUND_FLOW_SCHEMA, OUTCOME_BOUND_REQUIRED_GATES, OutcomeBoundRequiredGate, OutcomeBoundRunInput, OutcomeBoundRunStatus, assertOutcomeBoundCompleted, evaluateOutcomeBoundRun } from './outcomeBoundFlow.js';
|
|
11
11
|
export { STRICT_MEMORY_RUNTIME_SCHEMA, StrictMemoryEvaluation, StrictMemoryEvaluationInput, StrictMemoryRuntimePreset, StrictMemoryTriggerSet, StrictMemoryUpgradeInput, StrictMemoryUpgradePolicy, StrictMemoryUpgradeResult, createStrictMemoryRuntimePreset, evaluateStrictMemoryExecution, isComplexTask, upgradeToStrictMemoryRuntimePreset } from './strictMemoryRuntime.js';
|
|
12
|
-
export { I as IntentSignals, L as LaneMode, a as LaneSwitchDecision, O as ObjectiveChangeProposal, b as ObjectiveChangeSourceTrust, c as ObjectiveGuardDecision, d as ObjectiveGuardPolicy, P as PromptShieldDecision, e as PromptShieldFlag, f as PromptShieldInput, g as PromptShieldPolicy, h as PromptShieldRisk, i as PromptShieldTrustLevel, j as applyIntentArbitration, k as evaluateLaneSwitch, l as evaluateObjectiveChange, m as evaluatePromptShield, s as scoreBuildLane, n as scorePolishLane } from './agentLoop-
|
|
12
|
+
export { I as IntentSignals, L as LaneMode, a as LaneSwitchDecision, O as ObjectiveChangeProposal, b as ObjectiveChangeSourceTrust, c as ObjectiveGuardDecision, d as ObjectiveGuardPolicy, P as PromptShieldDecision, e as PromptShieldFlag, f as PromptShieldInput, g as PromptShieldPolicy, h as PromptShieldRisk, i as PromptShieldTrustLevel, j as applyIntentArbitration, k as evaluateLaneSwitch, l as evaluateObjectiveChange, m as evaluatePromptShield, s as scoreBuildLane, n as scorePolishLane } from './agentLoop-D394RDif.js';
|
|
13
13
|
export { fetchSolBalance, fetchTokenBalance, fetchTokenBalances } from './solana.js';
|
|
14
14
|
import './compoundingMemory.js';
|
|
15
15
|
import '@coral-xyz/anchor';
|
package/dist/index.js
CHANGED
|
@@ -1112,7 +1112,7 @@ var ReviewGate = class {
|
|
|
1112
1112
|
var DEFAULT_API_BASE = "https://api.vibeiao.com";
|
|
1113
1113
|
var DEFAULT_WEB_BASE = "https://vibeiao.com";
|
|
1114
1114
|
var DEFAULT_SDK_PACKAGE = "@vibeiao/sdk";
|
|
1115
|
-
var DEFAULT_SDK_VERSION = "0.1.
|
|
1115
|
+
var DEFAULT_SDK_VERSION = "0.1.53" ? "0.1.53" : "0.1.4";
|
|
1116
1116
|
var DEFAULT_SDK_REGISTRY = "https://registry.npmjs.org";
|
|
1117
1117
|
var DEFAULT_SDK_POLICY_PATH = "/v1/sdk/policy";
|
|
1118
1118
|
var DEFAULT_SDK_CHECK_INTERVAL_MS = 1e3 * 60 * 30;
|
|
@@ -8,7 +8,7 @@ import './survivalEscapeHatch.js';
|
|
|
8
8
|
import './marketDiscovery.js';
|
|
9
9
|
import './outcomeBoundFlow.js';
|
|
10
10
|
import './strictMemoryRuntime.js';
|
|
11
|
-
import './agentLoop-
|
|
11
|
+
import './agentLoop-D394RDif.js';
|
|
12
12
|
import './solana.js';
|
|
13
13
|
import './compoundingMemory.js';
|
|
14
14
|
import '@coral-xyz/anchor';
|
|
@@ -1474,7 +1474,7 @@ declare class ReviewGate {
|
|
|
1474
1474
|
assertClear(listingId: string, wallet: string): void;
|
|
1475
1475
|
}
|
|
1476
1476
|
|
|
1477
|
-
declare const compareVersions: (currentVersion: string, latestVersion: string) =>
|
|
1477
|
+
declare const compareVersions: (currentVersion: string, latestVersion: string) => 0 | 1 | -1;
|
|
1478
1478
|
declare const buildSdkUpdateCommand: (packageName?: string) => string;
|
|
1479
1479
|
declare const checkForSdkUpdate: (options?: SdkUpdateCheckOptions) => Promise<SdkUpdateStatus>;
|
|
1480
1480
|
declare const checkForSdkUpdatePolicy: (options: SdkUpdatePolicyCheckOptions) => Promise<SdkUpdateStatus>;
|