@aperant/framework 0.8.4 → 0.8.6

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +156 -0
  2. package/agents/apt-planner.md +34 -3
  3. package/dist/cli/commands/coverage-check.d.mts.map +1 -1
  4. package/dist/cli/commands/coverage-check.mjs +74 -7
  5. package/dist/cli/commands/coverage-check.mjs.map +1 -1
  6. package/dist/cli/commands/detect-runtime.d.mts.map +1 -1
  7. package/dist/cli/commands/detect-runtime.mjs +18 -12
  8. package/dist/cli/commands/detect-runtime.mjs.map +1 -1
  9. package/dist/cli/coverage-check/user-outcomes.d.mts +84 -0
  10. package/dist/cli/coverage-check/user-outcomes.d.mts.map +1 -0
  11. package/dist/cli/coverage-check/user-outcomes.mjs +265 -0
  12. package/dist/cli/coverage-check/user-outcomes.mjs.map +1 -0
  13. package/dist/cli/host/detect.mjs +1 -1
  14. package/dist/cli/host/detect.mjs.map +1 -1
  15. package/dist/cli/install/install-from-source.mjs +3 -3
  16. package/dist/cli/install/legacy-paths.d.mts.map +1 -1
  17. package/dist/cli/install/legacy-paths.mjs +2 -0
  18. package/dist/cli/install/legacy-paths.mjs.map +1 -1
  19. package/dist/cli/verify-proof/idl/index.d.mts +1 -1
  20. package/dist/cli/verify-proof/idl/index.mjs +7 -8
  21. package/dist/cli/verify-proof/idl/index.mjs.map +1 -1
  22. package/dist/cli/verify-proof/idl/types.d.ts +5 -4
  23. package/dist/cli/verify-proof/idl/types.d.ts.map +1 -1
  24. package/dist/cli/verify-proof/idl/types.js +4 -3
  25. package/dist/cli/verify-proof/idl/types.js.map +1 -1
  26. package/dist/cli/verify-proof/resolver.d.mts +63 -1
  27. package/dist/cli/verify-proof/resolver.d.mts.map +1 -1
  28. package/dist/cli/verify-proof/resolver.mjs +164 -4
  29. package/dist/cli/verify-proof/resolver.mjs.map +1 -1
  30. package/dist/cli/verify-proof/runtime-detect.d.mts +6 -3
  31. package/dist/cli/verify-proof/runtime-detect.d.mts.map +1 -1
  32. package/dist/cli/verify-proof/runtime-detect.mjs +104 -11
  33. package/dist/cli/verify-proof/runtime-detect.mjs.map +1 -1
  34. package/dist/cli/verify-proof/trust.d.mts +1 -1
  35. package/dist/cli/verify-proof/trust.d.mts.map +1 -1
  36. package/dist/cli/verify-proof/trust.mjs +1 -1
  37. package/dist/driver-sdk/conformance.d.ts +41 -0
  38. package/dist/driver-sdk/conformance.d.ts.map +1 -0
  39. package/dist/driver-sdk/conformance.js +123 -0
  40. package/dist/driver-sdk/conformance.js.map +1 -0
  41. package/dist/driver-sdk/errors.d.ts +75 -0
  42. package/dist/driver-sdk/errors.d.ts.map +1 -0
  43. package/dist/driver-sdk/errors.js +80 -0
  44. package/dist/driver-sdk/errors.js.map +1 -0
  45. package/dist/driver-sdk/idl.d.ts +221 -0
  46. package/dist/driver-sdk/idl.d.ts.map +1 -0
  47. package/dist/driver-sdk/idl.js +140 -0
  48. package/dist/driver-sdk/idl.js.map +1 -0
  49. package/dist/driver-sdk/index.d.ts +28 -0
  50. package/dist/driver-sdk/index.d.ts.map +1 -0
  51. package/dist/driver-sdk/index.js +28 -0
  52. package/dist/driver-sdk/index.js.map +1 -0
  53. package/dist/driver-sdk/manifest.d.ts +93 -0
  54. package/dist/driver-sdk/manifest.d.ts.map +1 -0
  55. package/dist/driver-sdk/manifest.js +12 -0
  56. package/dist/driver-sdk/manifest.js.map +1 -0
  57. package/dist/driver-sdk/retry.d.ts +33 -0
  58. package/dist/driver-sdk/retry.d.ts.map +1 -0
  59. package/dist/driver-sdk/retry.js +50 -0
  60. package/dist/driver-sdk/retry.js.map +1 -0
  61. package/dist/plugin/.claude-plugin/plugin.json +2 -1
  62. package/dist/plugin/agents/apt-planner.md +34 -3
  63. package/dist/plugin/skills/apt-plan/SKILL.md +50 -0
  64. package/dist/plugin/skills/apt-pr-review/SKILL.md +1 -1
  65. package/dist/plugin/skills/apt-research/SKILL.md +526 -0
  66. package/dist/plugin/skills/apt-research/appendices/budget-loop.md +397 -0
  67. package/dist/plugin/skills/apt-research/appendices/claim-graph-schema.md +206 -0
  68. package/dist/plugin/skills/apt-research/appendices/domain-tools.md +236 -0
  69. package/dist/plugin/skills/apt-spar/SKILL.md +19 -7
  70. package/dist/plugin/skills/apt-verify-proof/SKILL.md +41 -2
  71. package/dist/schemas/quick-task.d.ts +17 -17
  72. package/drivers/.gitkeep +0 -0
  73. package/drivers/api/README.md +40 -0
  74. package/drivers/api/driver.mjs +59 -0
  75. package/drivers/api/manifest.json +26 -0
  76. package/drivers/browser/README.md +105 -0
  77. package/drivers/browser/driver.mjs +134 -0
  78. package/drivers/browser/manifest.json +35 -0
  79. package/drivers/cli/README.md +44 -0
  80. package/drivers/cli/driver.mjs +62 -0
  81. package/drivers/cli/manifest.json +28 -0
  82. package/drivers/electron/README.md +64 -0
  83. package/drivers/electron/driver.mjs +87 -0
  84. package/drivers/electron/manifest.json +37 -0
  85. package/package.json +7 -3
  86. package/skills/apt-plan/SKILL.md +50 -0
  87. package/skills/apt-planner.md +16 -0
  88. package/skills/apt-pr-review/SKILL.md +1 -1
  89. package/skills/apt-research/SKILL.md +526 -0
  90. package/skills/apt-research/appendices/budget-loop.md +397 -0
  91. package/skills/apt-research/appendices/claim-graph-schema.md +206 -0
  92. package/skills/apt-research/appendices/domain-tools.md +236 -0
  93. package/skills/apt-spar/SKILL.md +19 -7
  94. package/skills/apt-verify-proof/SKILL.md +41 -2
  95. package/src/cli/commands/coverage-check.mjs +126 -44
  96. package/src/cli/commands/detect-runtime.mjs +23 -14
  97. package/src/cli/coverage-check/user-outcomes.mjs +273 -0
  98. package/src/cli/host/detect.mjs +1 -1
  99. package/src/cli/install/install-from-source.mjs +3 -3
  100. package/src/cli/install/legacy-paths.mjs +2 -0
  101. package/src/cli/verify-proof/idl/index.mjs +7 -8
  102. package/src/cli/verify-proof/idl/types.ts +5 -4
  103. package/src/cli/verify-proof/manifest-schema.json +2 -1
  104. package/src/cli/verify-proof/resolver.mjs +171 -4
  105. package/src/cli/verify-proof/runtime-detect.mjs +99 -10
  106. package/src/cli/verify-proof/trust.mjs +1 -1
  107. package/templates/proof-verification.md +32 -3
  108. package/workflows/verify-proof.md +78 -9
@@ -0,0 +1,75 @@
1
+ /**
2
+ * errors.ts — error taxonomy for @aperant/driver-sdk.
3
+ *
4
+ * Every driver-layer failure raises one of these classes. The taxonomy
5
+ * is load-bearing for the resolver + audit log + verification.json's
6
+ * `meta.fallback_attempts[].reason` field.
7
+ *
8
+ * Conventions:
9
+ * - Every class sets `.name` to its class identifier so structured
10
+ * audit lines can serialize the discriminator without `instanceof`
11
+ * gymnastics in cross-realm contexts.
12
+ * - Every class extends Error so plain Node consumers can match with
13
+ * try/catch.
14
+ */
15
+ /** A driver manifest violates the structural contract (JSON-Schema). */
16
+ export declare class DriverManifestSchemaError extends Error {
17
+ readonly name = "DriverManifestSchemaError";
18
+ /** JSON-pointer paths into the manifest where validation failed. */
19
+ readonly errors: ReadonlyArray<{
20
+ path: string;
21
+ message: string;
22
+ }>;
23
+ constructor(message: string, errors?: ReadonlyArray<{
24
+ path: string;
25
+ message: string;
26
+ }>);
27
+ }
28
+ /** A driver's runtime configuration is invalid (missing env, malformed args). */
29
+ export declare class DriverConfigError extends Error {
30
+ readonly name = "DriverConfigError";
31
+ }
32
+ /** A driver's preflight check failed (missing binary, unreachable service). */
33
+ export declare class DriverPreflightError extends Error {
34
+ readonly name = "DriverPreflightError";
35
+ /** Structured list of unsatisfied preflight requirements. */
36
+ readonly missing: readonly string[];
37
+ constructor(message: string, missing?: readonly string[]);
38
+ }
39
+ /** A driver verb invocation failed at the transport / RPC layer. */
40
+ export declare class DriverInvocationError extends Error {
41
+ readonly name = "DriverInvocationError";
42
+ /** The IDL verb name that was being invoked. */
43
+ readonly verb: string | undefined;
44
+ constructor(message: string, verb?: string);
45
+ }
46
+ /** A driver succeeded but evidence capture (screenshot, dom_dump) failed. */
47
+ export declare class DriverEvidenceCaptureError extends Error {
48
+ readonly name = "DriverEvidenceCaptureError";
49
+ }
50
+ /** A non-first-party driver invocation is blocked by TOFU + policy. */
51
+ export declare class DriverNotApprovedError extends Error {
52
+ readonly name = "DriverNotApprovedError";
53
+ readonly driverId: string | undefined;
54
+ readonly trustTier: string | undefined;
55
+ constructor(message: string, driverId?: string, trustTier?: string);
56
+ }
57
+ /**
58
+ * The resolver exhausted its driver chain without satisfying a REQUIRED
59
+ * capability. Fail-closed — verdict logic must NOT silently turn this
60
+ * into a `blocked_by_platform` skip (ID-02).
61
+ */
62
+ export declare class UnsatisfiedRequiredCapabilityError extends Error {
63
+ readonly name = "UnsatisfiedRequiredCapabilityError";
64
+ readonly capability: string | undefined;
65
+ /** Drivers attempted, with the reason each was rejected. */
66
+ readonly attempts: ReadonlyArray<{
67
+ driver_id: string;
68
+ reason: string;
69
+ }>;
70
+ constructor(message: string, capability?: string, attempts?: ReadonlyArray<{
71
+ driver_id: string;
72
+ reason: string;
73
+ }>);
74
+ }
75
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/driver-sdk/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,wEAAwE;AACxE,qBAAa,yBAA0B,SAAQ,KAAK;IACnD,SAAkB,IAAI,+BAA8B;IACpD,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;gBACrD,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAM;CAI1F;AAED,iFAAiF;AACjF,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,SAAkB,IAAI,uBAAsB;CAC5C;AAED,+EAA+E;AAC/E,qBAAa,oBAAqB,SAAQ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ts — error taxonomy for @aperant/driver-sdk.
3
+ *
4
+ * Every driver-layer failure raises one of these classes. The taxonomy
5
+ * is load-bearing for the resolver + audit log + verification.json's
6
+ * `meta.fallback_attempts[].reason` field.
7
+ *
8
+ * Conventions:
9
+ * - Every class sets `.name` to its class identifier so structured
10
+ * audit lines can serialize the discriminator without `instanceof`
11
+ * gymnastics in cross-realm contexts.
12
+ * - Every class extends Error so plain Node consumers can match with
13
+ * try/catch.
14
+ */
15
+ /** A driver manifest violates the structural contract (JSON-Schema). */
16
+ export class DriverManifestSchemaError extends Error {
17
+ name = 'DriverManifestSchemaError';
18
+ /** JSON-pointer paths into the manifest where validation failed. */
19
+ errors;
20
+ constructor(message, errors = []) {
21
+ super(message);
22
+ this.errors = errors;
23
+ }
24
+ }
25
+ /** A driver's runtime configuration is invalid (missing env, malformed args). */
26
+ export class DriverConfigError extends Error {
27
+ name = 'DriverConfigError';
28
+ }
29
+ /** A driver's preflight check failed (missing binary, unreachable service). */
30
+ export class DriverPreflightError extends Error {
31
+ name = 'DriverPreflightError';
32
+ /** Structured list of unsatisfied preflight requirements. */
33
+ missing;
34
+ constructor(message, missing = []) {
35
+ super(message);
36
+ this.missing = missing;
37
+ }
38
+ }
39
+ /** A driver verb invocation failed at the transport / RPC layer. */
40
+ export class DriverInvocationError extends Error {
41
+ name = 'DriverInvocationError';
42
+ /** The IDL verb name that was being invoked. */
43
+ verb;
44
+ constructor(message, verb) {
45
+ super(message);
46
+ this.verb = verb;
47
+ }
48
+ }
49
+ /** A driver succeeded but evidence capture (screenshot, dom_dump) failed. */
50
+ export class DriverEvidenceCaptureError extends Error {
51
+ name = 'DriverEvidenceCaptureError';
52
+ }
53
+ /** A non-first-party driver invocation is blocked by TOFU + policy. */
54
+ export class DriverNotApprovedError extends Error {
55
+ name = 'DriverNotApprovedError';
56
+ driverId;
57
+ trustTier;
58
+ constructor(message, driverId, trustTier) {
59
+ super(message);
60
+ this.driverId = driverId;
61
+ this.trustTier = trustTier;
62
+ }
63
+ }
64
+ /**
65
+ * The resolver exhausted its driver chain without satisfying a REQUIRED
66
+ * capability. Fail-closed — verdict logic must NOT silently turn this
67
+ * into a `blocked_by_platform` skip (ID-02).
68
+ */
69
+ export class UnsatisfiedRequiredCapabilityError extends Error {
70
+ name = 'UnsatisfiedRequiredCapabilityError';
71
+ capability;
72
+ /** Drivers attempted, with the reason each was rejected. */
73
+ attempts;
74
+ constructor(message, capability, attempts = []) {
75
+ super(message);
76
+ this.capability = capability;
77
+ this.attempts = attempts;
78
+ }
79
+ }
80
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/driver-sdk/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,wEAAwE;AACxE,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IACjC,IAAI,GAAG,2BAA2B,CAAA;IACpD,oEAAoE;IAC3D,MAAM,CAAkD;IACjE,YAAY,OAAe,EAAE,SAA2D,EAAE;QACzF,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACrB,CAAC;CACD;AAED,iFAAiF;AACjF,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACzB,IAAI,GAAG,mBAAmB,CAAA;CAC5C;AAED,+EAA+E;AAC/E,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC5B,IAAI,GAAG,sBAAsB,CAAA;IAC/C,6DAA6D;IACpD,OAAO,CAAmB;IACnC,YAAY,OAAe,EAAE,UAA6B,EAAE;QAC3D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACvB,CAAC;CACD;AAED,oEAAoE;AACpE,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC7B,IAAI,GAAG,uBAAuB,CAAA;IAChD,gDAAgD;IACvC,IAAI,CAAoB;IACjC,YAAY,OAAe,EAAE,IAAa;QACzC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACjB,CAAC;CACD;AAED,6EAA6E;AAC7E,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAClC,IAAI,GAAG,4BAA4B,CAAA;CACrD;AAED,uEAAuE;AACvE,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC9B,IAAI,GAAG,wBAAwB,CAAA;IACxC,QAAQ,CAAoB;IAC5B,SAAS,CAAoB;IACtC,YAAY,OAAe,EAAE,QAAiB,EAAE,SAAkB;QACjE,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC3B,CAAC;CACD;AAED;;;;GAIG;AACH,MAAM,OAAO,kCAAmC,SAAQ,KAAK;IAC1C,IAAI,GAAG,oCAAoC,CAAA;IACpD,UAAU,CAAoB;IACvC,4DAA4D;IACnD,QAAQ,CAAsD;IACvE,YACC,OAAe,EACf,UAAmB,EACnB,WAAiE,EAAE;QAEnE,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IACzB,CAAC;CACD"}
@@ -0,0 +1,221 @@
1
+ /**
2
+ * idl.ts — verify-proof IDL v1 verb definitions + arg/return shapes.
3
+ *
4
+ * Wire contract per ID-01: workflow prose, the resolver, verification.json,
5
+ * and third-party drivers all refer to IDL verbs (`click`, `screenshot`,
6
+ * `assert_visible`, ...) and NEVER to concrete MCP tool names. The mapping
7
+ * from a verb to a transport (mcp_server_id / local_command / http_endpoint /
8
+ * builtin) lives in the driver's manifest + driver.mjs, not here.
9
+ *
10
+ * Five verb families:
11
+ * - lifecycle: launch / teardown
12
+ * - interaction: click / type / key / navigate / select / upload_file /
13
+ * drag_drop / swipe / switch_context / execute_js / wait_for_event /
14
+ * wait_for_idle
15
+ * - evidence: screenshot / record_video / capture_logs / dump_state /
16
+ * dom_dump
17
+ * - assertion: assert_visible / assert_text / assert_output /
18
+ * assert_network
19
+ * - async: trigger / await_signal
20
+ */
21
+ /** How a driver locates a UI element. `screen_coord` is last-resort. */
22
+ export type TargetKind = 'aria_role' | 'test_id' | 'css' | 'xpath' | 'screen_coord';
23
+ /** A locator the driver translates into a transport-specific selector. */
24
+ export interface Target {
25
+ readonly kind: TargetKind;
26
+ readonly value: string;
27
+ }
28
+ export interface LaunchArgs {
29
+ readonly entrypoint?: string;
30
+ readonly env?: Readonly<Record<string, string>>;
31
+ readonly cwd?: string;
32
+ }
33
+ export interface Handle {
34
+ readonly handle_id: string;
35
+ }
36
+ export interface TeardownArgs {
37
+ readonly handle: Handle;
38
+ }
39
+ export interface ClickArgs {
40
+ readonly target: Target;
41
+ readonly button?: 'left' | 'right' | 'middle';
42
+ }
43
+ export interface TypeArgs {
44
+ readonly target: Target;
45
+ readonly text: string;
46
+ readonly clear_first?: boolean;
47
+ }
48
+ export interface KeyArgs {
49
+ readonly target?: Target;
50
+ readonly key: string;
51
+ }
52
+ export interface NavigateArgs {
53
+ readonly url: string;
54
+ }
55
+ export interface SelectArgs {
56
+ readonly target: Target;
57
+ readonly value: string;
58
+ }
59
+ export interface UploadFileArgs {
60
+ readonly target: Target;
61
+ readonly file_path: string;
62
+ }
63
+ export interface DragDropArgs {
64
+ readonly source: Target;
65
+ readonly destination: Target;
66
+ }
67
+ export interface SwipeArgs {
68
+ readonly target: Target;
69
+ readonly direction: 'up' | 'down' | 'left' | 'right';
70
+ }
71
+ export interface SwitchContextArgs {
72
+ readonly handle: Handle;
73
+ }
74
+ export interface ExecuteJsArgs {
75
+ readonly script: string;
76
+ /** Optional args passed positionally into the script. */
77
+ readonly args?: readonly unknown[];
78
+ }
79
+ export interface WaitForEventArgs {
80
+ readonly event: string;
81
+ readonly timeout_ms?: number;
82
+ }
83
+ export interface WaitForIdleArgs {
84
+ readonly timeout_ms?: number;
85
+ }
86
+ export interface ScreenshotArgs {
87
+ readonly target?: Target;
88
+ readonly output_path: string;
89
+ }
90
+ export interface RecordVideoArgs {
91
+ readonly duration_seconds: number;
92
+ readonly fps?: number;
93
+ readonly output_path: string;
94
+ }
95
+ export interface CaptureLogsArgs {
96
+ readonly source: 'console' | 'stdout' | 'stderr' | 'all';
97
+ readonly output_path?: string;
98
+ }
99
+ export interface DumpStateArgs {
100
+ readonly output_path: string;
101
+ }
102
+ export interface DomDumpArgs {
103
+ readonly output_path: string;
104
+ }
105
+ export interface AssertVisibleArgs {
106
+ readonly target: Target;
107
+ }
108
+ export interface AssertTextArgs {
109
+ readonly target: Target;
110
+ readonly expected: string;
111
+ readonly match?: 'exact' | 'contains' | 'regex';
112
+ }
113
+ export interface AssertOutputArgs {
114
+ readonly source: 'stdout' | 'stderr' | 'console';
115
+ readonly expected: string;
116
+ readonly match?: 'exact' | 'contains' | 'regex';
117
+ }
118
+ export interface AssertNetworkArgs {
119
+ readonly url_pattern: string;
120
+ readonly method?: string;
121
+ readonly expected_status?: number;
122
+ }
123
+ export interface TriggerArgs {
124
+ readonly event: string;
125
+ readonly payload?: unknown;
126
+ }
127
+ export interface AwaitSignalArgs {
128
+ readonly signal: string;
129
+ readonly timeout_ms?: number;
130
+ }
131
+ export interface VerbResult {
132
+ readonly status: 'success' | 'fail' | 'skip';
133
+ readonly evidence_paths: readonly string[];
134
+ readonly duration_ms: number;
135
+ readonly retry_count: number;
136
+ readonly error?: string;
137
+ }
138
+ /** Lifecycle verbs. */
139
+ export declare const LIFECYCLE_VERBS: readonly ["launch", "teardown"];
140
+ /** Interaction verbs. */
141
+ export declare const INTERACTION_VERBS: readonly ["click", "type", "key", "navigate", "select", "upload_file", "drag_drop", "swipe", "switch_context", "execute_js", "wait_for_event", "wait_for_idle"];
142
+ /** Evidence verbs. */
143
+ export declare const EVIDENCE_VERBS: readonly ["screenshot", "record_video", "capture_logs", "dump_state", "dom_dump"];
144
+ /** Assertion verbs. */
145
+ export declare const ASSERTION_VERBS: readonly ["assert_visible", "assert_text", "assert_output", "assert_network"];
146
+ /** Async verbs. */
147
+ export declare const ASYNC_VERBS: readonly ["trigger", "await_signal"];
148
+ /** Every IDL v1 verb name, flat array — the canonical list. */
149
+ export declare const IDL_VERB_NAMES: readonly string[];
150
+ /** The union type of every verb name. */
151
+ export type IdlVerbName = (typeof LIFECYCLE_VERBS)[number] | (typeof INTERACTION_VERBS)[number] | (typeof EVIDENCE_VERBS)[number] | (typeof ASSERTION_VERBS)[number] | (typeof ASYNC_VERBS)[number];
152
+ /**
153
+ * Per-verb arg metadata. `required` lists keys that MUST be present on the
154
+ * args object; `optional` lists keys that MAY be present. Bundled drivers
155
+ * and third-party drivers both consume this through validateVerbArgs() so
156
+ * the SDK is the single source of truth (ID-04).
157
+ *
158
+ * Frozen so consumers don't mutate the registry by accident.
159
+ */
160
+ export declare const IDL_VERB_ARGS: Readonly<Record<string, {
161
+ readonly required: readonly string[];
162
+ readonly optional: readonly string[];
163
+ }>>;
164
+ /**
165
+ * VerbResult return-shape predicate. Drivers MUST return an object with
166
+ * `status` ∈ {success,fail,skip}, `evidence_paths` (array), `duration_ms`
167
+ * (number), and `retry_count` (number). The conformance kit + framework
168
+ * resolver call this to validate runtime return shapes.
169
+ */
170
+ export declare function isVerbResult(value: unknown): boolean;
171
+ /**
172
+ * Validate a verb's args object against the IDL_VERB_ARGS registry. Returns
173
+ * `{valid: true}` when every required key is present; otherwise returns
174
+ * `{valid: false, missing: [...keys]}` where `missing` includes the keys
175
+ * that were absent (or `['unknown verb: <name>']` for unknown verbs).
176
+ */
177
+ export declare function validateVerbArgs(verb: string, args: unknown): {
178
+ valid: true;
179
+ } | {
180
+ valid: false;
181
+ missing: string[];
182
+ };
183
+ /**
184
+ * Driver-shaped interface — a driver exports a subset of these functions
185
+ * keyed by IDL verb name. The resolver introspects this surface to validate
186
+ * `manifest.capabilities[]` matches the runtime exports.
187
+ *
188
+ * Every method is async + returns VerbResult. Drivers MAY omit verbs they
189
+ * don't implement — the manifest's `capabilities[]` array is the source of
190
+ * truth for what each driver claims.
191
+ */
192
+ export interface DriverModule {
193
+ readonly launch?: (args: LaunchArgs) => Promise<VerbResult & {
194
+ handle?: Handle;
195
+ }>;
196
+ readonly teardown?: (args: TeardownArgs) => Promise<VerbResult>;
197
+ readonly click?: (args: ClickArgs) => Promise<VerbResult>;
198
+ readonly type?: (args: TypeArgs) => Promise<VerbResult>;
199
+ readonly key?: (args: KeyArgs) => Promise<VerbResult>;
200
+ readonly navigate?: (args: NavigateArgs) => Promise<VerbResult>;
201
+ readonly select?: (args: SelectArgs) => Promise<VerbResult>;
202
+ readonly upload_file?: (args: UploadFileArgs) => Promise<VerbResult>;
203
+ readonly drag_drop?: (args: DragDropArgs) => Promise<VerbResult>;
204
+ readonly swipe?: (args: SwipeArgs) => Promise<VerbResult>;
205
+ readonly switch_context?: (args: SwitchContextArgs) => Promise<VerbResult>;
206
+ readonly execute_js?: (args: ExecuteJsArgs) => Promise<VerbResult>;
207
+ readonly wait_for_event?: (args: WaitForEventArgs) => Promise<VerbResult>;
208
+ readonly wait_for_idle?: (args: WaitForIdleArgs) => Promise<VerbResult>;
209
+ readonly screenshot?: (args: ScreenshotArgs) => Promise<VerbResult>;
210
+ readonly record_video?: (args: RecordVideoArgs) => Promise<VerbResult>;
211
+ readonly capture_logs?: (args: CaptureLogsArgs) => Promise<VerbResult>;
212
+ readonly dump_state?: (args: DumpStateArgs) => Promise<VerbResult>;
213
+ readonly dom_dump?: (args: DomDumpArgs) => Promise<VerbResult>;
214
+ readonly assert_visible?: (args: AssertVisibleArgs) => Promise<VerbResult>;
215
+ readonly assert_text?: (args: AssertTextArgs) => Promise<VerbResult>;
216
+ readonly assert_output?: (args: AssertOutputArgs) => Promise<VerbResult>;
217
+ readonly assert_network?: (args: AssertNetworkArgs) => Promise<VerbResult>;
218
+ readonly trigger?: (args: TriggerArgs) => Promise<VerbResult>;
219
+ readonly await_signal?: (args: Await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CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IACxE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAC7D,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;CACtE"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * idl.ts — verify-proof IDL v1 verb definitions + arg/return shapes.
3
+ *
4
+ * Wire contract per ID-01: workflow prose, the resolver, verification.json,
5
+ * and third-party drivers all refer to IDL verbs (`click`, `screenshot`,
6
+ * `assert_visible`, ...) and NEVER to concrete MCP tool names. The mapping
7
+ * from a verb to a transport (mcp_server_id / local_command / http_endpoint /
8
+ * builtin) lives in the driver's manifest + driver.mjs, not here.
9
+ *
10
+ * Five verb families:
11
+ * - lifecycle: launch / teardown
12
+ * - interaction: click / type / key / navigate / select / upload_file /
13
+ * drag_drop / swipe / switch_context / execute_js / wait_for_event /
14
+ * wait_for_idle
15
+ * - evidence: screenshot / record_video / capture_logs / dump_state /
16
+ * dom_dump
17
+ * - assertion: assert_visible / assert_text / assert_output /
18
+ * assert_network
19
+ * - async: trigger / await_signal
20
+ */
21
+ // ---------------------------------------------------------------------------
22
+ // Runtime registry — the verb names IDL v1 ships, by family.
23
+ // ---------------------------------------------------------------------------
24
+ /** Lifecycle verbs. */
25
+ export const LIFECYCLE_VERBS = ['launch', 'teardown'];
26
+ /** Interaction verbs. */
27
+ export const INTERACTION_VERBS = [
28
+ 'click',
29
+ 'type',
30
+ 'key',
31
+ 'navigate',
32
+ 'select',
33
+ 'upload_file',
34
+ 'drag_drop',
35
+ 'swipe',
36
+ 'switch_context',
37
+ 'execute_js',
38
+ 'wait_for_event',
39
+ 'wait_for_idle',
40
+ ];
41
+ /** Evidence verbs. */
42
+ export const EVIDENCE_VERBS = [
43
+ 'screenshot',
44
+ 'record_video',
45
+ 'capture_logs',
46
+ 'dump_state',
47
+ 'dom_dump',
48
+ ];
49
+ /** Assertion verbs. */
50
+ export const ASSERTION_VERBS = [
51
+ 'assert_visible',
52
+ 'assert_text',
53
+ 'assert_output',
54
+ 'assert_network',
55
+ ];
56
+ /** Async verbs. */
57
+ export const ASYNC_VERBS = ['trigger', 'await_signal'];
58
+ /** Every IDL v1 verb name, flat array — the canonical list. */
59
+ export const IDL_VERB_NAMES = [
60
+ ...LIFECYCLE_VERBS,
61
+ ...INTERACTION_VERBS,
62
+ ...EVIDENCE_VERBS,
63
+ ...ASSERTION_VERBS,
64
+ ...ASYNC_VERBS,
65
+ ];
66
+ /**
67
+ * Per-verb arg metadata. `required` lists keys that MUST be present on the
68
+ * args object; `optional` lists keys that MAY be present. Bundled drivers
69
+ * and third-party drivers both consume this through validateVerbArgs() so
70
+ * the SDK is the single source of truth (ID-04).
71
+ *
72
+ * Frozen so consumers don't mutate the registry by accident.
73
+ */
74
+ export const IDL_VERB_ARGS = Object.freeze({
75
+ launch: { required: [], optional: ['entrypoint', 'env', 'cwd'] },
76
+ teardown: { required: ['handle'], optional: [] },
77
+ click: { required: ['target'], optional: ['button'] },
78
+ type: { required: ['target', 'text'], optional: ['clear_first'] },
79
+ key: { required: ['key'], optional: ['target'] },
80
+ navigate: { required: ['url'], optional: [] },
81
+ select: { required: ['target', 'value'], optional: [] },
82
+ upload_file: { required: ['target', 'file_path'], optional: [] },
83
+ drag_drop: { required: ['source', 'destination'], optional: [] },
84
+ swipe: { required: ['target', 'direction'], optional: [] },
85
+ switch_context: { required: ['handle'], optional: [] },
86
+ execute_js: { required: ['script'], optional: ['args'] },
87
+ wait_for_event: { required: ['event'], optional: ['timeout_ms'] },
88
+ wait_for_idle: { required: [], optional: ['timeout_ms'] },
89
+ screenshot: { required: ['output_path'], optional: ['target'] },
90
+ record_video: { required: ['duration_seconds', 'output_path'], optional: ['fps'] },
91
+ capture_logs: { required: ['source'], optional: ['output_path'] },
92
+ dump_state: { required: ['output_path'], optional: [] },
93
+ dom_dump: { required: ['output_path'], optional: [] },
94
+ assert_visible: { required: ['target'], optional: [] },
95
+ assert_text: { required: ['target', 'expected'], optional: ['match'] },
96
+ assert_output: { required: ['source', 'expected'], optional: ['match'] },
97
+ assert_network: { required: ['url_pattern'], optional: ['method', 'expected_status'] },
98
+ trigger: { required: ['event'], optional: ['payload'] },
99
+ await_signal: { required: ['signal'], optional: ['timeout_ms'] },
100
+ });
101
+ /**
102
+ * VerbResult return-shape predicate. Drivers MUST return an object with
103
+ * `status` ∈ {success,fail,skip}, `evidence_paths` (array), `duration_ms`
104
+ * (number), and `retry_count` (number). The conformance kit + framework
105
+ * resolver call this to validate runtime return shapes.
106
+ */
107
+ export function isVerbResult(value) {
108
+ if (value === null || typeof value !== 'object')
109
+ return false;
110
+ const v = value;
111
+ if (v.status !== 'success' && v.status !== 'fail' && v.status !== 'skip')
112
+ return false;
113
+ if (!Array.isArray(v.evidence_paths))
114
+ return false;
115
+ if (typeof v.duration_ms !== 'number')
116
+ return false;
117
+ if (typeof v.retry_count !== 'number')
118
+ return false;
119
+ return true;
120
+ }
121
+ /**
122
+ * Validate a verb's args object against the IDL_VERB_ARGS registry. Returns
123
+ * `{valid: true}` when every required key is present; otherwise returns
124
+ * `{valid: false, missing: [...keys]}` where `missing` includes the keys
125
+ * that were absent (or `['unknown verb: <name>']` for unknown verbs).
126
+ */
127
+ export function validateVerbArgs(verb, args) {
128
+ const meta = IDL_VERB_ARGS[verb];
129
+ if (meta === undefined)
130
+ return { valid: false, missing: [`unknown verb: ${verb}`] };
131
+ if (args === null || typeof args !== 'object' || Array.isArray(args)) {
132
+ return { valid: false, missing: [...meta.required] };
133
+ }
134
+ const obj = args;
135
+ const missing = meta.required.filter((k) => !(k in obj));
136
+ if (missing.length === 0)
137
+ return { valid: true };
138
+ return { valid: false, missing: [...missing] };
139
+ }
140
+ //# sourceMappingURL=idl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idl.js","sourceRoot":"","sources":["../../src/driver-sdk/idl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAgLH,8EAA8E;AAC9E,6DAA6D;AAC7D,8EAA8E;AAE9E,uBAAuB;AACvB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAU,CAAA;AAE9D,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,OAAO;IACP,MAAM;IACN,KAAK;IACL,UAAU;IACV,QAAQ;IACR,aAAa;IACb,WAAW;IACX,OAAO;IACP,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAChB,eAAe;CACN,CAAA;AAEV,sBAAsB;AACtB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,YAAY;IACZ,cAAc;IACd,cAAc;IACd,YAAY;IACZ,UAAU;CACD,CAAA;AAEV,uBAAuB;AACvB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,gBAAgB;IAChB,aAAa;IACb,eAAe;IACf,gBAAgB;CACP,CAAA;AAEV,mBAAmB;AACnB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,cAAc,CAAU,CAAA;AAE/D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAsB;IAChD,GAAG,eAAe;IAClB,GAAG,iBAAiB;IACpB,GAAG,cAAc;IACjB,GAAG,eAAe;IAClB,GAAG,WAAW;CACd,CAAA;AAUD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAEtB,MAAM,CAAC,MAAM,CAAC;IACjB,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE;IAChE,QAAQ,EAAE,E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,IAAI,EAAE,CAAA;IAChD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,EAAE,CAAA;AAC/C,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * driver-sdk — public surface (inlined into @aperant/framework@0.8.5).
3
+ *
4
+ * Originally shipped as the standalone `@aperant/driver-sdk` package; the
5
+ * 0.8.4 publish failed because workspace:* rewrote to an unpublished
6
+ * 0.1.0 spec, leaving framework consumers with a 404. The 0.8.5 inline
7
+ * folds 875 LOC of zero-dep SDK into the framework tarball; the
8
+ * subdirectory boundary is enforced by __tests__/import-direction.test.ts
9
+ * so re-extraction stays mechanical if/when a real third-party driver
10
+ * author asks for a standalone install.
11
+ *
12
+ * Framework consumers import these symbols via the
13
+ * `@aperant/framework/driver-sdk` subpath export (declared in
14
+ * packages/framework/package.json:exports) — Node resolves through the
15
+ * framework's self-symlinked node_modules to the compiled dist output,
16
+ * matching how `@aperant/framework/cost`, `./schemas`, `./standalone`
17
+ * already work. Public surface enumerated in
18
+ * __tests__/public-api-lock.test.ts.
19
+ */
20
+ export type { ConformanceCheck, ConformanceReport } from './conformance.js';
21
+ export { runConformanceKit } from './conformance.js';
22
+ export { DriverConfigError, DriverEvidenceCaptureError, DriverInvocationError, DriverManifestSchemaError, DriverNotApprovedError, DriverPreflightError, UnsatisfiedRequiredCapabilityError, } from './errors.js';
23
+ export type { AssertNetworkArgs, AssertOutputArgs, AssertTextArgs, AssertVisibleArgs, AwaitSignalArgs, CaptureLogsArgs, ClickArgs, DomDumpArgs, DragDropArgs, DriverModule, DumpStateArgs, ExecuteJsArgs, Handle, IdlVerbName, KeyArgs, LaunchArgs, NavigateArgs, RecordVideoArgs, ScreenshotArgs, SelectArgs, SwipeArgs, SwitchContextArgs, Target, TargetKind, TeardownArgs, TriggerArgs, TypeArgs, UploadFileArgs, VerbResult, WaitForEventArgs, WaitForIdleArgs, } from './idl.js';
24
+ export { ASSERTION_VERBS, ASYNC_VERBS, EVIDENCE_VERBS, IDL_VERB_ARGS, IDL_VERB_NAMES, INTERACTION_VERBS, isVerbResult, LIFECYCLE_VERBS, validateVerbArgs, } from './idl.js';
25
+ export type { AuditBlock, DriverManifest, Integrity, LocalCommand, NetworkPosture, PreflightCheck, Provenance, Publisher, SandboxProfile, SecurityBlock, Stability, Transport, TrustBlock, TrustTier, } from './manifest.js';
26
+ export type { RetryOptions } from './retry.js';
27
+ export { retryWithBackoff } from './retry.js';
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/driver-sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EACN,iBAAiB,EACjB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,kCAAkC,GAClC,MAAM,aAAa,CAAA;AACpB,YAAY,EACX,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,SAAS,EACT,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,MAAM,EACN,WAAW,EACX,OAAO,EACP,UAAU,EACV,YAAY,EACZ,eAAe,EACf,cAAc,EACd,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,eAAe,GACf,MAAM,UAAU,CAAA;AAEjB,OAAO,EACN,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,gBAAgB,GAChB,MAAM,UAAU,CAAA;AAEjB,YAAY,EACX,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACV,SAAS,EACT,cAAc,EACd,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,GACT,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * driver-sdk — public surface (inlined into @aperant/framework@0.8.5).
3
+ *
4
+ * Originally shipped as the standalone `@aperant/driver-sdk` package; the
5
+ * 0.8.4 publish failed because workspace:* rewrote to an unpublished
6
+ * 0.1.0 spec, leaving framework consumers with a 404. The 0.8.5 inline
7
+ * folds 875 LOC of zero-dep SDK into the framework tarball; the
8
+ * subdirectory boundary is enforced by __tests__/import-direction.test.ts
9
+ * so re-extraction stays mechanical if/when a real third-party driver
10
+ * author asks for a standalone install.
11
+ *
12
+ * Framework consumers import these symbols via the
13
+ * `@aperant/framework/driver-sdk` subpath export (declared in
14
+ * packages/framework/package.json:exports) — Node resolves through the
15
+ * framework's self-symlinked node_modules to the compiled dist output,
16
+ * matching how `@aperant/framework/cost`, `./schemas`, `./standalone`
17
+ * already work. Public surface enumerated in
18
+ * __tests__/public-api-lock.test.ts.
19
+ */
20
+ // conformance.ts — shared driver conformance kit
21
+ export { runConformanceKit } from './conformance.js';
22
+ // errors.ts — error taxonomy
23
+ export { DriverConfigError, DriverEvidenceCaptureError, DriverInvocationError, DriverManifestSchemaError, DriverNotApprovedError, DriverPreflightError, UnsatisfiedRequiredCapabilityError, } from './errors.js';
24
+ // idl.ts — runtime verb name registry + driver interface types + arg validation
25
+ export { ASSERTION_VERBS, ASYNC_VERBS, EVIDENCE_VERBS, IDL_VERB_ARGS, IDL_VERB_NAMES, INTERACTION_VERBS, isVerbResult, LIFECYCLE_VERBS, validateVerbArgs, } from './idl.js';
26
+ // retry.ts — exponential backoff helper
27
+ export { retryWithBackoff } from './retry.js';
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/driver-sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,iDAAiD;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,6BAA6B;AAC7B,OAAO,EACN,iBAAiB,EACjB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,kCAAkC,GAClC,MAAM,aAAa,CAAA;AAkCpB,gFAAgF;AAChF,OAAO,EACN,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,gBAAgB,GAChB,MAAM,UAAU,CAAA;AAmBjB,wCAAwC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA"}