@openagentpack/sdk 0.0.2-beta.0
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/LICENSE +199 -0
- package/README.md +25 -0
- package/dist/chunk-7ECSYAQA.js +72 -0
- package/dist/chunk-GAAU67HX.js +81 -0
- package/dist/chunk-TUW6XLDT.js +84 -0
- package/dist/file-URqwlxLf.d.ts +12 -0
- package/dist/file-lifecycle.d.ts +30 -0
- package/dist/file-lifecycle.js +15 -0
- package/dist/index.d.ts +1145 -0
- package/dist/index.js +7643 -0
- package/dist/scan-lifecycle.d.ts +48 -0
- package/dist/scan-lifecycle.js +26 -0
- package/dist/session-event-CmiO8Gqv.d.ts +898 -0
- package/dist/session-events.d.ts +13 -0
- package/dist/session-events.js +202 -0
- package/package.json +74 -0
|
@@ -0,0 +1,48 @@
|
|
|
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 const SKILL_STATUS_CODE: {
|
|
17
|
+
readonly checking: 0;
|
|
18
|
+
readonly active: 1;
|
|
19
|
+
readonly rejected: 2;
|
|
20
|
+
readonly deleted: 100;
|
|
21
|
+
};
|
|
22
|
+
/** Numeric console skill status → neutral SkillScanStatus (unknown codes read as still-checking). */
|
|
23
|
+
declare function skillStatusFromCode(code: number | undefined): SkillScanStatus;
|
|
24
|
+
declare function skillStatusFromString(raw: unknown): SkillScanStatus;
|
|
25
|
+
declare function classifyFileScan(status: string | undefined): ScanPhase;
|
|
26
|
+
declare function classifySkillScan(status: string | undefined): ScanPhase;
|
|
27
|
+
interface PollUntilOptions<T> {
|
|
28
|
+
/** Fetch the current state once. Called immediately, then after each interval. */
|
|
29
|
+
poll: () => Promise<T>;
|
|
30
|
+
/** Map a polled value to its scan phase. */
|
|
31
|
+
classify: (value: T) => ScanPhase;
|
|
32
|
+
/** Give up after this many ms (measured from the first poll). */
|
|
33
|
+
timeoutMs: number;
|
|
34
|
+
/** Fixed delay between polls, or an exponential-backoff schedule. */
|
|
35
|
+
interval: number | ScanBackoff;
|
|
36
|
+
/** Build the error thrown when classify returns "failed" (terminal rejection). */
|
|
37
|
+
onFailed: (value: T) => Error;
|
|
38
|
+
/** Build the error thrown when timeoutMs elapses (receives the last polled value, if any). */
|
|
39
|
+
onTimeout: (last: T | undefined) => Error;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generic content-scan poll loop: poll → resolve on "ready", throw onFailed on "failed", throw
|
|
43
|
+
* onTimeout once the deadline passes, otherwise sleep and retry. Supersedes the four hand-rolled
|
|
44
|
+
* copies (SDK file/skill waits, server warm loops, Mode B waitForActive).
|
|
45
|
+
*/
|
|
46
|
+
declare function pollUntil<T>(opts: PollUntilOptions<T>): Promise<T>;
|
|
47
|
+
|
|
48
|
+
export { FILE_SCAN_BACKOFF, type PollUntilOptions, SCAN_FILE_TIMEOUT_MS, SCAN_POLL_INTERVAL_MS, SCAN_SKILL_TIMEOUT_MS, SKILL_SCAN_BACKOFF, SKILL_STATUS_CODE, type ScanBackoff, type ScanPhase, type SkillScanStatus, classifyFileScan, classifySkillScan, pollUntil, skillStatusFromCode, skillStatusFromString };
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
SKILL_STATUS_CODE,
|
|
8
|
+
classifyFileScan,
|
|
9
|
+
classifySkillScan,
|
|
10
|
+
pollUntil,
|
|
11
|
+
skillStatusFromCode,
|
|
12
|
+
skillStatusFromString
|
|
13
|
+
} from "./chunk-7ECSYAQA.js";
|
|
14
|
+
export {
|
|
15
|
+
FILE_SCAN_BACKOFF,
|
|
16
|
+
SCAN_FILE_TIMEOUT_MS,
|
|
17
|
+
SCAN_POLL_INTERVAL_MS,
|
|
18
|
+
SCAN_SKILL_TIMEOUT_MS,
|
|
19
|
+
SKILL_SCAN_BACKOFF,
|
|
20
|
+
SKILL_STATUS_CODE,
|
|
21
|
+
classifyFileScan,
|
|
22
|
+
classifySkillScan,
|
|
23
|
+
pollUntil,
|
|
24
|
+
skillStatusFromCode,
|
|
25
|
+
skillStatusFromString
|
|
26
|
+
};
|