@positronic/core 0.0.33 → 0.0.35
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/src/dsl/brain-runner.js +15 -3
- package/dist/src/dsl/brain.js +15 -126
- package/dist/src/index.js +1 -1
- package/dist/types/dsl/brain-runner.d.ts +4 -2
- package/dist/types/dsl/brain-runner.d.ts.map +1 -1
- package/dist/types/dsl/brain.d.ts +9 -4
- package/dist/types/dsl/brain.d.ts.map +1 -1
- package/dist/types/dsl/types.d.ts +25 -0
- package/dist/types/dsl/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -275,6 +275,7 @@ function _ts_values(o) {
|
|
|
275
275
|
}
|
|
276
276
|
import { BRAIN_EVENTS, STATUS } from './constants.js';
|
|
277
277
|
import { applyPatches } from './json-patch.js';
|
|
278
|
+
import { DEFAULT_ENV } from './brain.js';
|
|
278
279
|
export var BrainRunner = /*#__PURE__*/ function() {
|
|
279
280
|
"use strict";
|
|
280
281
|
function BrainRunner(options) {
|
|
@@ -316,17 +317,26 @@ export var BrainRunner = /*#__PURE__*/ function() {
|
|
|
316
317
|
}));
|
|
317
318
|
}
|
|
318
319
|
},
|
|
320
|
+
{
|
|
321
|
+
key: "withEnv",
|
|
322
|
+
value: function withEnv(env) {
|
|
323
|
+
return new BrainRunner(_object_spread_props(_object_spread({}, this.options), {
|
|
324
|
+
env: env
|
|
325
|
+
}));
|
|
326
|
+
}
|
|
327
|
+
},
|
|
319
328
|
{
|
|
320
329
|
key: "run",
|
|
321
330
|
value: function run(_0) {
|
|
322
331
|
return _async_to_generator(function(brain) {
|
|
323
|
-
var _ref, _ref_initialState, initialState, options, initialCompletedSteps, brainRunId, endAfter, signal, response, _this_options, adapters, client, resources, pages, currentState, stepNumber, brainRun, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step, _ret, err, error, cancelledEvent;
|
|
332
|
+
var _ref, _ref_initialState, initialState, options, initialCompletedSteps, brainRunId, endAfter, signal, response, _this_options, adapters, client, resources, pages, env, resolvedEnv, currentState, stepNumber, brainRun, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step, _ret, err, error, cancelledEvent;
|
|
324
333
|
var _arguments = arguments;
|
|
325
334
|
return _ts_generator(this, function(_state) {
|
|
326
335
|
switch(_state.label){
|
|
327
336
|
case 0:
|
|
328
337
|
_ref = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, _ref_initialState = _ref.initialState, initialState = _ref_initialState === void 0 ? {} : _ref_initialState, options = _ref.options, initialCompletedSteps = _ref.initialCompletedSteps, brainRunId = _ref.brainRunId, endAfter = _ref.endAfter, signal = _ref.signal, response = _ref.response;
|
|
329
|
-
_this_options = this.options, adapters = _this_options.adapters, client = _this_options.client, resources = _this_options.resources, pages = _this_options.pages;
|
|
338
|
+
_this_options = this.options, adapters = _this_options.adapters, client = _this_options.client, resources = _this_options.resources, pages = _this_options.pages, env = _this_options.env;
|
|
339
|
+
resolvedEnv = env !== null && env !== void 0 ? env : DEFAULT_ENV;
|
|
330
340
|
currentState = initialState !== null && initialState !== void 0 ? initialState : {};
|
|
331
341
|
stepNumber = 1;
|
|
332
342
|
// Apply any patches from completed steps
|
|
@@ -349,6 +359,7 @@ export var BrainRunner = /*#__PURE__*/ function() {
|
|
|
349
359
|
client: client,
|
|
350
360
|
resources: resources !== null && resources !== void 0 ? resources : {},
|
|
351
361
|
pages: pages,
|
|
362
|
+
env: resolvedEnv,
|
|
352
363
|
response: response
|
|
353
364
|
}) : brain.run({
|
|
354
365
|
initialState: initialState,
|
|
@@ -356,7 +367,8 @@ export var BrainRunner = /*#__PURE__*/ function() {
|
|
|
356
367
|
client: client,
|
|
357
368
|
brainRunId: brainRunId,
|
|
358
369
|
resources: resources !== null && resources !== void 0 ? resources : {},
|
|
359
|
-
pages: pages
|
|
370
|
+
pages: pages,
|
|
371
|
+
env: resolvedEnv
|
|
360
372
|
});
|
|
361
373
|
_state.label = 1;
|
|
362
374
|
case 1:
|
package/dist/src/dsl/brain.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _assert_this_initialized(self) {
|
|
2
|
-
if (self === void 0) {
|
|
3
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
-
}
|
|
5
|
-
return self;
|
|
6
|
-
}
|
|
7
1
|
function _async_generator(gen) {
|
|
8
2
|
var front, back;
|
|
9
3
|
function send(key, arg) {
|
|
@@ -193,32 +187,11 @@ function _async_to_generator(fn) {
|
|
|
193
187
|
function _await_async_generator(value) {
|
|
194
188
|
return new _overload_yield(value, 0);
|
|
195
189
|
}
|
|
196
|
-
function _call_super(_this, derived, args) {
|
|
197
|
-
derived = _get_prototype_of(derived);
|
|
198
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
199
|
-
}
|
|
200
190
|
function _class_call_check(instance, Constructor) {
|
|
201
191
|
if (!(instance instanceof Constructor)) {
|
|
202
192
|
throw new TypeError("Cannot call a class as a function");
|
|
203
193
|
}
|
|
204
194
|
}
|
|
205
|
-
function _construct(Parent, args, Class) {
|
|
206
|
-
if (_is_native_reflect_construct()) {
|
|
207
|
-
_construct = Reflect.construct;
|
|
208
|
-
} else {
|
|
209
|
-
_construct = function construct(Parent, args, Class) {
|
|
210
|
-
var a = [
|
|
211
|
-
null
|
|
212
|
-
];
|
|
213
|
-
a.push.apply(a, args);
|
|
214
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
215
|
-
var instance = new Constructor();
|
|
216
|
-
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
217
|
-
return instance;
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
return _construct.apply(null, arguments);
|
|
221
|
-
}
|
|
222
195
|
function _defineProperties(target, props) {
|
|
223
196
|
for(var i = 0; i < props.length; i++){
|
|
224
197
|
var descriptor = props[i];
|
|
@@ -246,28 +219,6 @@ function _define_property(obj, key, value) {
|
|
|
246
219
|
}
|
|
247
220
|
return obj;
|
|
248
221
|
}
|
|
249
|
-
function _get_prototype_of(o) {
|
|
250
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
251
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
252
|
-
};
|
|
253
|
-
return _get_prototype_of(o);
|
|
254
|
-
}
|
|
255
|
-
function _inherits(subClass, superClass) {
|
|
256
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
257
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
258
|
-
}
|
|
259
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
260
|
-
constructor: {
|
|
261
|
-
value: subClass,
|
|
262
|
-
writable: true,
|
|
263
|
-
configurable: true
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
267
|
-
}
|
|
268
|
-
function _is_native_function(fn) {
|
|
269
|
-
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
270
|
-
}
|
|
271
222
|
function _object_spread(target) {
|
|
272
223
|
for(var i = 1; i < arguments.length; i++){
|
|
273
224
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -338,19 +289,6 @@ function _overload_yield(value, kind) {
|
|
|
338
289
|
this.v = value;
|
|
339
290
|
this.k = kind;
|
|
340
291
|
}
|
|
341
|
-
function _possible_constructor_return(self, call) {
|
|
342
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
343
|
-
return call;
|
|
344
|
-
}
|
|
345
|
-
return _assert_this_initialized(self);
|
|
346
|
-
}
|
|
347
|
-
function _set_prototype_of(o, p) {
|
|
348
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
349
|
-
o.__proto__ = p;
|
|
350
|
-
return o;
|
|
351
|
-
};
|
|
352
|
-
return _set_prototype_of(o, p);
|
|
353
|
-
}
|
|
354
292
|
function _type_of(obj) {
|
|
355
293
|
"@swc/helpers - typeof";
|
|
356
294
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
@@ -360,40 +298,6 @@ function _wrap_async_generator(fn) {
|
|
|
360
298
|
return new _async_generator(fn.apply(this, arguments));
|
|
361
299
|
};
|
|
362
300
|
}
|
|
363
|
-
function _wrap_native_super(Class) {
|
|
364
|
-
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
365
|
-
_wrap_native_super = function wrapNativeSuper(Class) {
|
|
366
|
-
if (Class === null || !_is_native_function(Class)) return Class;
|
|
367
|
-
if (typeof Class !== "function") {
|
|
368
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
369
|
-
}
|
|
370
|
-
if (typeof _cache !== "undefined") {
|
|
371
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
372
|
-
_cache.set(Class, Wrapper);
|
|
373
|
-
}
|
|
374
|
-
function Wrapper() {
|
|
375
|
-
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
376
|
-
}
|
|
377
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
378
|
-
constructor: {
|
|
379
|
-
value: Wrapper,
|
|
380
|
-
enumerable: false,
|
|
381
|
-
writable: true,
|
|
382
|
-
configurable: true
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
return _set_prototype_of(Wrapper, Class);
|
|
386
|
-
};
|
|
387
|
-
return _wrap_native_super(Class);
|
|
388
|
-
}
|
|
389
|
-
function _is_native_reflect_construct() {
|
|
390
|
-
try {
|
|
391
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
392
|
-
} catch (_) {}
|
|
393
|
-
return (_is_native_reflect_construct = function() {
|
|
394
|
-
return !!result;
|
|
395
|
-
})();
|
|
396
|
-
}
|
|
397
301
|
function _ts_generator(thisArg, body) {
|
|
398
302
|
var f, y, t, _ = {
|
|
399
303
|
label: 0,
|
|
@@ -502,20 +406,13 @@ function _ts_values(o) {
|
|
|
502
406
|
import { v4 as uuidv4 } from 'uuid';
|
|
503
407
|
import { STATUS, BRAIN_EVENTS } from './constants.js';
|
|
504
408
|
import { createPatch, applyPatches } from './json-patch.js';
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
'Step "'.concat(stepTitle, '" timed out after ').concat(timeoutMs, "ms")
|
|
513
|
-
]);
|
|
514
|
-
_this.name = 'StepTimeoutError';
|
|
515
|
-
return _this;
|
|
516
|
-
}
|
|
517
|
-
return StepTimeoutError;
|
|
518
|
-
}(_wrap_native_super(Error));
|
|
409
|
+
/**
|
|
410
|
+
* Default runtime environment used when env is not provided.
|
|
411
|
+
* This ensures backward compatibility with existing code.
|
|
412
|
+
*/ export var DEFAULT_ENV = {
|
|
413
|
+
origin: 'http://localhost:3000',
|
|
414
|
+
secrets: {}
|
|
415
|
+
};
|
|
519
416
|
export var Brain = /*#__PURE__*/ function() {
|
|
520
417
|
"use strict";
|
|
521
418
|
function Brain(title, description) {
|
|
@@ -800,8 +697,9 @@ var BrainEventStream = /*#__PURE__*/ function() {
|
|
|
800
697
|
_define_property(this, "services", void 0);
|
|
801
698
|
_define_property(this, "resources", void 0);
|
|
802
699
|
_define_property(this, "pages", void 0);
|
|
700
|
+
_define_property(this, "env", void 0);
|
|
803
701
|
_define_property(this, "currentResponse", undefined);
|
|
804
|
-
var _params_initialState = params.initialState, initialState = _params_initialState === void 0 ? {} : _params_initialState, initialCompletedSteps = params.initialCompletedSteps, blocks = params.blocks, title = params.title, description = params.description, providedBrainRunId = params.brainRunId, _params_options = params.options, options = _params_options === void 0 ? {} : _params_options, client = params.client, services = params.services, _params_resources = params.resources, resources = _params_resources === void 0 ? {} : _params_resources, pages = params.pages, response = params.response;
|
|
702
|
+
var _params_initialState = params.initialState, initialState = _params_initialState === void 0 ? {} : _params_initialState, initialCompletedSteps = params.initialCompletedSteps, blocks = params.blocks, title = params.title, description = params.description, providedBrainRunId = params.brainRunId, _params_options = params.options, options = _params_options === void 0 ? {} : _params_options, client = params.client, services = params.services, _params_resources = params.resources, resources = _params_resources === void 0 ? {} : _params_resources, pages = params.pages, env = params.env, response = params.response;
|
|
805
703
|
this.initialState = initialState;
|
|
806
704
|
this.title = title;
|
|
807
705
|
this.description = description;
|
|
@@ -810,6 +708,7 @@ var BrainEventStream = /*#__PURE__*/ function() {
|
|
|
810
708
|
this.services = services;
|
|
811
709
|
this.resources = resources;
|
|
812
710
|
this.pages = pages;
|
|
711
|
+
this.env = env !== null && env !== void 0 ? env : DEFAULT_ENV;
|
|
813
712
|
// Initialize steps array with UUIDs and pending status
|
|
814
713
|
this.steps = blocks.map(function(block, index) {
|
|
815
714
|
var completedStep = initialCompletedSteps === null || initialCompletedSteps === void 0 ? void 0 : initialCompletedSteps[index];
|
|
@@ -1067,7 +966,8 @@ var BrainEventStream = /*#__PURE__*/ function() {
|
|
|
1067
966
|
resources: this.resources,
|
|
1068
967
|
client: this.client,
|
|
1069
968
|
initialState: initialState,
|
|
1070
|
-
options: (_this_options = this.options) !== null && _this_options !== void 0 ? _this_options : {}
|
|
969
|
+
options: (_this_options = this.options) !== null && _this_options !== void 0 ? _this_options : {},
|
|
970
|
+
env: this.env
|
|
1071
971
|
});
|
|
1072
972
|
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
1073
973
|
_state.label = 1;
|
|
@@ -1204,11 +1104,12 @@ var BrainEventStream = /*#__PURE__*/ function() {
|
|
|
1204
1104
|
client: this.client,
|
|
1205
1105
|
resources: this.resources,
|
|
1206
1106
|
response: this.currentResponse,
|
|
1207
|
-
pages: this.pages
|
|
1107
|
+
pages: this.pages,
|
|
1108
|
+
env: this.env
|
|
1208
1109
|
}, this.services)));
|
|
1209
1110
|
return [
|
|
1210
1111
|
4,
|
|
1211
|
-
_await_async_generator(
|
|
1112
|
+
_await_async_generator(actionPromise)
|
|
1212
1113
|
];
|
|
1213
1114
|
case 19:
|
|
1214
1115
|
result = _state.sent();
|
|
@@ -1349,15 +1250,3 @@ export var brain = function brain(brainConfig) {
|
|
|
1349
1250
|
var clone = function(value) {
|
|
1350
1251
|
return structuredClone(value);
|
|
1351
1252
|
};
|
|
1352
|
-
var STEP_TIMEOUT_MS = 25000; // Before 30s IoContext limit
|
|
1353
|
-
function withTimeout(promise, stepTitle) {
|
|
1354
|
-
var timeoutMs = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : STEP_TIMEOUT_MS;
|
|
1355
|
-
return Promise.race([
|
|
1356
|
-
promise,
|
|
1357
|
-
new Promise(function(_, reject) {
|
|
1358
|
-
setTimeout(function() {
|
|
1359
|
-
reject(new StepTimeoutError(stepTitle, timeoutMs));
|
|
1360
|
-
}, timeoutMs);
|
|
1361
|
-
})
|
|
1362
|
-
]);
|
|
1363
|
-
}
|
package/dist/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Brain, brain,
|
|
1
|
+
export { Brain, brain, DEFAULT_ENV } from './dsl/brain.js';
|
|
2
2
|
export { BrainRunner } from './dsl/brain-runner.js';
|
|
3
3
|
export { STATUS, BRAIN_EVENTS } from './dsl/constants.js';
|
|
4
4
|
export { createPatch, applyPatches } from './dsl/json-patch.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Adapter } from '../adapters/types.js';
|
|
2
|
-
import type
|
|
3
|
-
import type { State, JsonObject } from './types.js';
|
|
2
|
+
import { type SerializedStep, type Brain } from './brain.js';
|
|
3
|
+
import type { State, JsonObject, RuntimeEnv } from './types.js';
|
|
4
4
|
import type { ObjectGenerator } from '../clients/types.js';
|
|
5
5
|
import type { Resources } from '../resources/resources.js';
|
|
6
6
|
import type { PagesService } from './pages.js';
|
|
@@ -11,11 +11,13 @@ export declare class BrainRunner {
|
|
|
11
11
|
client: ObjectGenerator;
|
|
12
12
|
resources?: Resources;
|
|
13
13
|
pages?: PagesService;
|
|
14
|
+
env?: RuntimeEnv;
|
|
14
15
|
});
|
|
15
16
|
withAdapters(adapters: Adapter[]): BrainRunner;
|
|
16
17
|
withClient(client: ObjectGenerator): BrainRunner;
|
|
17
18
|
withResources(resources: Resources): BrainRunner;
|
|
18
19
|
withPages(pages: PagesService): BrainRunner;
|
|
20
|
+
withEnv(env: RuntimeEnv): BrainRunner;
|
|
19
21
|
run<TOptions extends JsonObject = {}, TState extends State = {}>(brain: Brain<TOptions, TState, any>, { initialState, options, initialCompletedSteps, brainRunId, endAfter, signal, response, }?: {
|
|
20
22
|
initialState?: TState;
|
|
21
23
|
options?: TOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brain-runner.d.ts","sourceRoot":"","sources":["../../../src/dsl/brain-runner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"brain-runner.d.ts","sourceRoot":"","sources":["../../../src/dsl/brain-runner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAe,KAAK,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,qBAAa,WAAW;IAEpB,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE;QACf,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,MAAM,EAAE,eAAe,CAAC;QACxB,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,KAAK,CAAC,EAAE,YAAY,CAAC;QACrB,GAAG,CAAC,EAAE,UAAU,CAAC;KAClB;IAGH,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,WAAW;IAQ9C,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW;IAOhD,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW;IAOhD,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW;IAO3C,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW;IAO/B,GAAG,CAAC,QAAQ,SAAS,UAAU,GAAG,EAAE,EAAE,MAAM,SAAS,KAAK,GAAG,EAAE,EACnE,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EACnC,EACE,YAA2B,EAC3B,OAAO,EACP,qBAAqB,EACrB,UAAU,EACV,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,GAAE;QACD,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,OAAO,CAAC,EAAE,QAAQ,CAAC;QACnB,qBAAqB,CAAC,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;QACjD,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;QAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,QAAQ,CAAC,EAAE,UAAU,CAAC;KAClB,GACL,OAAO,CAAC,MAAM,CAAC;CAmGnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { ObjectGenerator } from '../clients/types.js';
|
|
3
|
-
import type { State, JsonPatch, JsonObject } from './types.js';
|
|
3
|
+
import type { State, JsonPatch, JsonObject, RuntimeEnv } from './types.js';
|
|
4
4
|
import { STATUS, BRAIN_EVENTS } from './constants.js';
|
|
5
5
|
import type { Resources } from '../resources/resources.js';
|
|
6
6
|
import type { ExtractWebhookResponses, SerializedWebhookRegistration } from './webhook.js';
|
|
@@ -10,9 +10,11 @@ export type SerializedError = {
|
|
|
10
10
|
message: string;
|
|
11
11
|
stack?: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Default runtime environment used when env is not provided.
|
|
15
|
+
* This ensures backward compatibility with existing code.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_ENV: RuntimeEnv;
|
|
16
18
|
export type StepAction<TStateIn, TStateOut, TOptions extends JsonObject = JsonObject, TServices extends object = object, TResponseIn extends JsonObject | undefined = undefined, TWaitFor extends readonly any[] = readonly []> = (params: {
|
|
17
19
|
state: TStateIn;
|
|
18
20
|
options: TOptions;
|
|
@@ -20,6 +22,7 @@ export type StepAction<TStateIn, TStateOut, TOptions extends JsonObject = JsonOb
|
|
|
20
22
|
resources: Resources;
|
|
21
23
|
response: TResponseIn;
|
|
22
24
|
pages?: PagesService;
|
|
25
|
+
env: RuntimeEnv;
|
|
23
26
|
} & TServices) => TStateOut | Promise<TStateOut> | {
|
|
24
27
|
state: TStateOut;
|
|
25
28
|
waitFor: TWaitFor;
|
|
@@ -111,6 +114,7 @@ interface BaseRunParams<TOptions extends JsonObject = JsonObject> {
|
|
|
111
114
|
resources?: Resources;
|
|
112
115
|
options?: TOptions;
|
|
113
116
|
pages?: PagesService;
|
|
117
|
+
env?: RuntimeEnv;
|
|
114
118
|
}
|
|
115
119
|
export interface InitialRunParams<TOptions extends JsonObject = JsonObject> extends BaseRunParams<TOptions> {
|
|
116
120
|
initialState?: State;
|
|
@@ -141,6 +145,7 @@ export declare class Brain<TOptions extends JsonObject = JsonObject, TState exte
|
|
|
141
145
|
resources: Resources;
|
|
142
146
|
response: TResponse;
|
|
143
147
|
pages?: PagesService;
|
|
148
|
+
env: RuntimeEnv;
|
|
144
149
|
} & TServices) => TNewState | Promise<TNewState> | {
|
|
145
150
|
state: TNewState;
|
|
146
151
|
waitFor: TWaitFor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../../src/dsl/brain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../../src/dsl/brain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAuB,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAChH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,UAGzB,CAAC;AAGF,MAAM,MAAM,UAAU,CACpB,QAAQ,EACR,SAAS,EACT,QAAQ,SAAS,UAAU,GAAG,UAAU,EACxC,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,WAAW,SAAS,UAAU,GAAG,SAAS,GAAG,SAAS,EACtD,QAAQ,SAAS,SAAS,GAAG,EAAE,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MAAM,CAAC,EAAE,CACP,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,EAAE,QAAQ,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,SAAS,CAAC;KACtB,GAAG,SAAS,KACV,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAmDrC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC7E,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAqCxE,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,SAAS;CAkBlB;AAiYD,eAAO,MAAM,KAAK,EAAE,YAkBnB,CAAC"}
|
|
@@ -5,6 +5,31 @@ export type JsonObject = {
|
|
|
5
5
|
};
|
|
6
6
|
export type JsonValue = JsonPrimitive | JsonArray | JsonObject;
|
|
7
7
|
export type State = JsonObject;
|
|
8
|
+
/**
|
|
9
|
+
* Secrets/environment variables available to brains at runtime.
|
|
10
|
+
* This interface can be augmented via module declaration in generated secrets.d.ts
|
|
11
|
+
* to provide autocomplete for project-specific secrets.
|
|
12
|
+
*/
|
|
13
|
+
export interface Secrets {
|
|
14
|
+
[key: string]: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Runtime environment information provided by the backend.
|
|
18
|
+
* Contains deployment-specific values that brains need at runtime.
|
|
19
|
+
*/
|
|
20
|
+
export interface RuntimeEnv {
|
|
21
|
+
/**
|
|
22
|
+
* The base URL/origin of the running instance.
|
|
23
|
+
* e.g., "http://localhost:3000" in development or "https://myapp.workers.dev" in production.
|
|
24
|
+
*/
|
|
25
|
+
origin: string;
|
|
26
|
+
/**
|
|
27
|
+
* Secrets and environment variables.
|
|
28
|
+
* Access via env.secrets.SECRET_NAME in brain steps.
|
|
29
|
+
* Type augmentation from secrets.d.ts provides autocomplete.
|
|
30
|
+
*/
|
|
31
|
+
secrets: Secrets;
|
|
32
|
+
}
|
|
8
33
|
export type JsonPatch = {
|
|
9
34
|
op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
|
|
10
35
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dsl/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AACpC,MAAM,MAAM,UAAU,GAAG;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,SAAS;CAAE,CAAC;AACzD,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC;AAE/B,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dsl/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AACpC,MAAM,MAAM,UAAU,GAAG;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,SAAS;CAAE,CAAC;AACzD,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC;AAE/B;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,EAAE,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Brain, brain,
|
|
1
|
+
export { Brain, brain, DEFAULT_ENV } from './dsl/brain.js';
|
|
2
2
|
export { BrainRunner } from './dsl/brain-runner.js';
|
|
3
3
|
export { STATUS, BRAIN_EVENTS } from './dsl/constants.js';
|
|
4
4
|
export type { Adapter } from './adapters/types.js';
|
|
5
5
|
export type { BrainEvent, SerializedStep, InitialRunParams, RerunParams, BrainStartEvent, BrainCompleteEvent, BrainErrorEvent, StepStatusEvent, StepStartedEvent, StepCompletedEvent, StepRetryEvent, BrainStructure, BrainFactory, } from './dsl/brain.js';
|
|
6
6
|
export type { ObjectGenerator, Message } from './clients/types.js';
|
|
7
|
-
export type { State } from './dsl/types.js';
|
|
7
|
+
export type { State, RuntimeEnv, Secrets } from './dsl/types.js';
|
|
8
8
|
export { createPatch, applyPatches } from './dsl/json-patch.js';
|
|
9
9
|
export { z } from 'zod';
|
|
10
10
|
export type { ResourceLoader } from './resources/resource-loader.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC1D,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,YAAY,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,YAAY,EACV,QAAQ,IAAI,gBAAgB,EA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