@openagentpack/sdk 0.0.0-beta.run-29740517091.sha-65ccfac

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.
@@ -0,0 +1,39 @@
1
+ /** Neutral skill scan status. Mirrors ProviderSkillInfo.status / the webui contract SkillStatus. */
2
+ type SkillScanStatus = "checking" | "active" | "rejected" | "deleted";
3
+ /** Terminal classification of a scan poll: keep waiting, succeeded, or terminally failed. */
4
+ type ScanPhase = "pending" | "ready" | "failed";
5
+ declare const SCAN_SKILL_TIMEOUT_MS = 360000;
6
+ declare const SCAN_FILE_TIMEOUT_MS = 120000;
7
+ declare const SCAN_POLL_INTERVAL_MS = 8000;
8
+ /** Exponential-backoff poll schedule (SDK apply path: tighter first poll, capped growth). */
9
+ interface ScanBackoff {
10
+ initial: number;
11
+ factor: number;
12
+ max: number;
13
+ }
14
+ declare const SKILL_SCAN_BACKOFF: ScanBackoff;
15
+ declare const FILE_SCAN_BACKOFF: ScanBackoff;
16
+ declare function skillStatusFromString(raw: unknown): SkillScanStatus;
17
+ declare function classifyFileScan(status: string | undefined): ScanPhase;
18
+ declare function classifySkillScan(status: string | undefined): ScanPhase;
19
+ interface PollUntilOptions<T> {
20
+ /** Fetch the current state once. Called immediately, then after each interval. */
21
+ poll: () => Promise<T>;
22
+ /** Map a polled value to its scan phase. */
23
+ classify: (value: T) => ScanPhase;
24
+ /** Give up after this many ms (measured from the first poll). */
25
+ timeoutMs: number;
26
+ /** Fixed delay between polls, or an exponential-backoff schedule. */
27
+ interval: number | ScanBackoff;
28
+ /** Build the error thrown when classify returns "failed" (terminal rejection). */
29
+ onFailed: (value: T) => Error;
30
+ /** Build the error thrown when timeoutMs elapses (receives the last polled value, if any). */
31
+ onTimeout: (last: T | undefined) => Error;
32
+ }
33
+ /**
34
+ * Generic content-scan poll loop: poll → resolve on "ready", throw onFailed on "failed", throw
35
+ * onTimeout once the deadline passes, otherwise sleep and retry.
36
+ */
37
+ declare function pollUntil<T>(opts: PollUntilOptions<T>): Promise<T>;
38
+
39
+ export { FILE_SCAN_BACKOFF, type PollUntilOptions, SCAN_FILE_TIMEOUT_MS, SCAN_POLL_INTERVAL_MS, SCAN_SKILL_TIMEOUT_MS, SKILL_SCAN_BACKOFF, type ScanBackoff, type ScanPhase, type SkillScanStatus, classifyFileScan, classifySkillScan, pollUntil, skillStatusFromString };
@@ -0,0 +1,22 @@
1
+ import {
2
+ FILE_SCAN_BACKOFF,
3
+ SCAN_FILE_TIMEOUT_MS,
4
+ SCAN_POLL_INTERVAL_MS,
5
+ SCAN_SKILL_TIMEOUT_MS,
6
+ SKILL_SCAN_BACKOFF,
7
+ classifyFileScan,
8
+ classifySkillScan,
9
+ pollUntil,
10
+ skillStatusFromString
11
+ } from "./chunk-CHGDM6TX.js";
12
+ export {
13
+ FILE_SCAN_BACKOFF,
14
+ SCAN_FILE_TIMEOUT_MS,
15
+ SCAN_POLL_INTERVAL_MS,
16
+ SCAN_SKILL_TIMEOUT_MS,
17
+ SKILL_SCAN_BACKOFF,
18
+ classifyFileScan,
19
+ classifySkillScan,
20
+ pollUntil,
21
+ skillStatusFromString
22
+ };