@agent-relay/factory 0.1.51 → 0.1.53
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/orchestrator/batch-tracker.d.ts +2 -0
- package/dist/orchestrator/batch-tracker.d.ts.map +1 -1
- package/dist/orchestrator/batch-tracker.js.map +1 -1
- package/dist/orchestrator/factory.d.ts.map +1 -1
- package/dist/orchestrator/factory.js +70 -6
- package/dist/orchestrator/factory.js.map +1 -1
- package/dist/orchestrator/failure-classifier.d.ts +13 -0
- package/dist/orchestrator/failure-classifier.d.ts.map +1 -0
- package/dist/orchestrator/failure-classifier.js +14 -0
- package/dist/orchestrator/failure-classifier.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type FailureRecord = {
|
|
2
|
+
errorKind: string;
|
|
3
|
+
message: string;
|
|
4
|
+
occurredAtMs: number;
|
|
5
|
+
};
|
|
6
|
+
export type FailureClassification = 'transient' | 'structural';
|
|
7
|
+
/**
|
|
8
|
+
* Classifies repeated failures conservatively: structural failures require at
|
|
9
|
+
* least two records with one unanimous error kind. Any conflicting error kind
|
|
10
|
+
* keeps the classification transient.
|
|
11
|
+
*/
|
|
12
|
+
export declare function classifyFailure(attempts: readonly FailureRecord[]): FailureClassification;
|
|
13
|
+
//# sourceMappingURL=failure-classifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure-classifier.d.ts","sourceRoot":"","sources":["../../src/orchestrator/failure-classifier.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,YAAY,CAAA;AAE9D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,qBAAqB,CAOzF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classifies repeated failures conservatively: structural failures require at
|
|
3
|
+
* least two records with one unanimous error kind. Any conflicting error kind
|
|
4
|
+
* keeps the classification transient.
|
|
5
|
+
*/
|
|
6
|
+
export function classifyFailure(attempts) {
|
|
7
|
+
if (attempts.length < 2)
|
|
8
|
+
return 'transient';
|
|
9
|
+
const errorKind = attempts[0].errorKind;
|
|
10
|
+
return attempts.every((attempt) => attempt.errorKind === errorKind)
|
|
11
|
+
? 'structural'
|
|
12
|
+
: 'transient';
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=failure-classifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure-classifier.js","sourceRoot":"","sources":["../../src/orchestrator/failure-classifier.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,QAAkC;IAChE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,WAAW,CAAA;IAE3C,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACvC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC;QACjE,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,WAAW,CAAA;AACjB,CAAC"}
|