@exodus/spec-requirements 1.0.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/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # @exodus/spec-requirements
2
+
3
+ Canonical vocabulary of valid `requires` capability values for `*.test.md` QA specs (see the [SPEC_FORMAT.md](https://github.com/ExodusMovement/qa-specs/blob/main/SPEC_FORMAT.md) `requires` field).
4
+
5
+ Published standalone (not bundled with `@exodus/xqa`) so any consumer — `qa-specs` CI, `exodus-mobile`, or other spec authors — can validate `requires` values without depending on the full CLI.
6
+
7
+ ## Usage
8
+
9
+ ```typescript
10
+ import {
11
+ isSpecRequiresValue,
12
+ SPEC_REQUIRES_VALUES,
13
+ type SpecRequiresValue,
14
+ } from '@exodus/spec-requirements';
15
+
16
+ SPEC_REQUIRES_VALUES;
17
+ // readonly [
18
+ // 'funded',
19
+ // 'pay-onboarded',
20
+ // 'pay-kyc-pending',
21
+ // 'pay-verified-no-card',
22
+ // 'pay-funded',
23
+ // 'pay-kyc-failed',
24
+ // 'pay-rewards-unverified',
25
+ // ]
26
+
27
+ isSpecRequiresValue('funded'); // true
28
+ isSpecRequiresValue('funded-wallet'); // false — not a canonical value
29
+ ```
30
+
31
+ Each value corresponds to a handler the mobile runner actually registers (see `apps/mobile/scripts/xqa/hooks/requirements/` in `exodus-mobile`). `funded` seeds an imported wallet; the `pay-*` values compose additional Pay-state layers on top of it (e.g. `requires: [funded, pay-kyc-pending]`).
32
+
33
+ ## Adding a new capability
34
+
35
+ Append to `SPEC_REQUIRES_VALUES` in `src/index.ts` only once a matching runner handler exists (see `exodus-mobile`'s `apps/mobile/scripts/xqa/hooks/requirements/`), and add a test asserting it round-trips through `isSpecRequiresValue`. This is the single source of truth — `@qa-agents/shared`'s spec parser rejects any `requires` entry not in this list.
36
+
37
+ ## Development
38
+
39
+ ```bash
40
+ pnpm build # build (emits to dist/)
41
+ pnpm dev # watch mode
42
+ pnpm typecheck # type-check only (no emit)
43
+ pnpm lint # lint + format check
44
+ pnpm lint:fix # lint + format fix
45
+ pnpm test # unit tests
46
+ pnpm check # lint + typecheck + test
47
+ pnpm check:fix # lint:fix + typecheck + test
48
+ ```
49
+
50
+ ## Package metadata
51
+
52
+ | Field | Value |
53
+ | ------------- | --------------------------- |
54
+ | Name | `@exodus/spec-requirements` |
55
+ | Visibility | Public (published to npm) |
56
+ | Module system | ESM (`"type": "module"`) |
57
+ | Entry point | `dist/index.js` |
58
+ | Types | `dist/index.d.ts` |
59
+ | Node | >= 22 |
60
+ | Dependencies | none (zero runtime deps) |
@@ -0,0 +1,4 @@
1
+ export declare const SPEC_REQUIRES_VALUES: readonly ["funded", "pay-onboarded", "pay-kyc-pending", "pay-verified-no-card", "pay-funded", "pay-kyc-failed", "pay-rewards-unverified"];
2
+ export type SpecRequiresValue = (typeof SPEC_REQUIRES_VALUES)[number];
3
+ export declare function isSpecRequiresValue(value: string): value is SpecRequiresValue;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,2IAQvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAE7E"}
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ export const SPEC_REQUIRES_VALUES = [
2
+ 'funded',
3
+ 'pay-onboarded',
4
+ 'pay-kyc-pending',
5
+ 'pay-verified-no-card',
6
+ 'pay-funded',
7
+ 'pay-kyc-failed',
8
+ 'pay-rewards-unverified',
9
+ ];
10
+ export function isSpecRequiresValue(value) {
11
+ return SPEC_REQUIRES_VALUES.includes(value);
12
+ }
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ;IACR,eAAe;IACf,iBAAiB;IACjB,sBAAsB;IACtB,YAAY;IACZ,gBAAgB;IAChB,wBAAwB;CAChB,CAAC;AAIX,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAQ,oBAA0C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@exodus/spec-requirements",
3
+ "description": "Canonical vocabulary of valid `requires` capability values for *.test.md QA specs",
4
+ "version": "1.0.0",
5
+ "private": false,
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "type": "module",
10
+ "main": "dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "files": [
13
+ "dist/index.js",
14
+ "dist/index.js.map",
15
+ "dist/index.d.ts",
16
+ "dist/index.d.ts.map"
17
+ ],
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "default": "./dist/index.js"
22
+ }
23
+ },
24
+ "scripts": {
25
+ "dev": "tsc --watch",
26
+ "build": "tsc",
27
+ "typecheck": "tsc --noEmit",
28
+ "lint": "eslint src && prettier --check .",
29
+ "lint:fix": "eslint src --fix && prettier --write .",
30
+ "test": "vitest run",
31
+ "check": "pnpm run lint && pnpm run typecheck && pnpm run test",
32
+ "check:fix": "pnpm run lint:fix && pnpm run typecheck && pnpm run test"
33
+ },
34
+ "devDependencies": {
35
+ "@qa-agents/eslint-config": "workspace:*",
36
+ "@qa-agents/typescript-config": "workspace:*",
37
+ "@types/node": "^26.0.0",
38
+ "eslint": "^10.5.0",
39
+ "typescript": "^6.0.3",
40
+ "vitest": "^4.1.9"
41
+ }
42
+ }