@taskless/cli 0.11.0 → 0.11.1
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/assets/reference.json +213 -0
- package/dist/binary-DSACXL6n.js +107 -0
- package/dist/index.js +5650 -4550
- package/dist/layout/index.d.ts +31 -0
- package/dist/layout.js +43 -0
- package/dist/node/runtimes/index.d.ts +102 -0
- package/dist/node/runtimes.js +10 -0
- package/dist/prompts/index.d.ts +25 -11
- package/dist/prompts/recipes.d.ts +37 -12
- package/dist/prompts.js +12 -12
- package/dist/recipes-w68swLg4.js +2662 -0
- package/dist/rules/ast-grep-binary.d.ts +26 -0
- package/dist/rules/capabilities.d.ts +46 -6
- package/dist/rules/constraints.d.ts +132 -0
- package/dist/rules/layout.d.ts +152 -0
- package/dist/rules/platform-binary.d.ts +113 -0
- package/dist/rules/vale/binary.d.ts +35 -0
- package/dist/schemas/index.d.ts +93 -0
- package/dist/schemas/rules-create.d.ts +1 -0
- package/dist/schemas/rules-improve.d.ts +1 -0
- package/dist/schemas/rules-verify.d.ts +67 -0
- package/dist/schemas/verify-test.d.ts +22 -0
- package/dist/schemas-OhdGAhu_.js +4512 -0
- package/dist/schemas.js +65 -0
- package/dist/types/errors.d.ts +20 -0
- package/dist/verify-test-BaZPwJqC.js +34 -0
- package/package.json +31 -12
- package/dist/recipes-C_i98mTO.js +0 -6975
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { o as f } from "./verify-test-BaZPwJqC.js";
|
|
2
|
+
import { o as s, a, r as n, u as l, s as e, b as t, n as c, l as r, _ as o } from "./schemas-OhdGAhu_.js";
|
|
3
|
+
s({
|
|
4
|
+
astGrepSchema: n(e(), l()).describe("Official ast-grep rule JSON Schema"),
|
|
5
|
+
tasklessRequirements: s({
|
|
6
|
+
requiredFields: a(e()).describe("Fields Taskless requires beyond ast-grep defaults"),
|
|
7
|
+
rules: a(
|
|
8
|
+
s({
|
|
9
|
+
name: e(),
|
|
10
|
+
description: e()
|
|
11
|
+
})
|
|
12
|
+
)
|
|
13
|
+
}).describe("Taskless-specific validation rules"),
|
|
14
|
+
examples: a(
|
|
15
|
+
s({
|
|
16
|
+
description: e(),
|
|
17
|
+
rule: n(e(), l())
|
|
18
|
+
})
|
|
19
|
+
).describe("Curated annotated rule examples")
|
|
20
|
+
});
|
|
21
|
+
const i = s({
|
|
22
|
+
valid: t(),
|
|
23
|
+
errors: a(e()).describe("Human-readable error messages")
|
|
24
|
+
}), d = i.extend({
|
|
25
|
+
notice: e().optional().describe(
|
|
26
|
+
"Something true about the rule that does not make it invalid — an accepted-but-off-list `language:` spelling above all. Present only when there is something to say"
|
|
27
|
+
)
|
|
28
|
+
}), u = i.extend({
|
|
29
|
+
passed: c().describe("Number of test cases that passed"),
|
|
30
|
+
failed: c().describe("Number of test cases that failed")
|
|
31
|
+
}), b = s({
|
|
32
|
+
engine: r("sg").describe(
|
|
33
|
+
"The engine that owns this rule, decided by where its file lives"
|
|
34
|
+
),
|
|
35
|
+
success: t().describe("True if all layers passed"),
|
|
36
|
+
ruleId: e(),
|
|
37
|
+
schema: d.describe(
|
|
38
|
+
"Layer 1: Zod schema validation, plus the `language:` check the vendored JSON Schema cannot express"
|
|
39
|
+
),
|
|
40
|
+
requirements: i.describe(
|
|
41
|
+
"Layer 2: Taskless requirement checks"
|
|
42
|
+
),
|
|
43
|
+
tests: u.describe("Layer 3: sg test execution")
|
|
44
|
+
}), m = s({
|
|
45
|
+
engine: r("vale"),
|
|
46
|
+
success: t().describe("True only when both buckets are populated and both behaved"),
|
|
47
|
+
ruleId: e(),
|
|
48
|
+
fixtures: o(["both", "pass-only", "fail-only", "none"]).describe(
|
|
49
|
+
"Which fixture buckets held documents. Only 'both' can succeed: one bucket alone is half a claim"
|
|
50
|
+
),
|
|
51
|
+
missingFailures: a(e()).describe("fail/ fixtures the rule should have flagged and did not"),
|
|
52
|
+
unexpectedFindings: a(e()).describe("pass/ fixtures the rule flagged and should not have"),
|
|
53
|
+
notice: e().optional().describe(
|
|
54
|
+
"What Vale wrote to stderr while still exiting zero — a W101 ignored-assignment warning above all. Present only when Vale said something"
|
|
55
|
+
)
|
|
56
|
+
});
|
|
57
|
+
s({
|
|
58
|
+
success: r(!1),
|
|
59
|
+
error: e().describe("Error message")
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
m as valeVerifyOutputSchema,
|
|
63
|
+
b as verifyOutputSchema,
|
|
64
|
+
f as verifyTestOutputSchema
|
|
65
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable error codes emitted by CLI commands when --json is set.
|
|
3
|
+
* Recipes reference these codes by name in their `## Errors` section,
|
|
4
|
+
* so renaming a code is a breaking change for the agent contract.
|
|
5
|
+
*
|
|
6
|
+
* Add new codes by extending the union; do not rename existing codes
|
|
7
|
+
* without a major version bump.
|
|
8
|
+
*/
|
|
9
|
+
export type CLIErrorCode = "AUTH_REQUIRED" | "NO_GITHUB_REMOTE" | "NOT_A_GIT_REPOSITORY" | "NO_ORIGIN_REMOTE" | "UNSUPPORTED_REMOTE_HOST" | "RULE_GENERATION_FAILED" | "RULE_UNSUPPORTED" | "RULE_NOT_FOUND" | "RULE_META_UNAVAILABLE" | "RULE_EXISTS" | "RULE_ID_AMBIGUOUS" | "INVALID_INPUT" | "NETWORK_ERROR" | "SCAN_FAILED" | "ENGINE_UNAVAILABLE" | "RECONCILE_FAILED" | "SCAFFOLD_VERSION_MISMATCH" | "SCAFFOLD_MIGRATION_REQUIRED" | "SCAFFOLD_MANIFEST_UNREADABLE" | "SCAFFOLD_CONFLICT" | "INTERNAL_ERROR";
|
|
10
|
+
/**
|
|
11
|
+
* Standardized JSON error envelope written to stdout when an action
|
|
12
|
+
* command exits with an error AND `--json` was set.
|
|
13
|
+
*/
|
|
14
|
+
export interface CLIErrorEnvelope {
|
|
15
|
+
ok: false;
|
|
16
|
+
code: CLIErrorCode;
|
|
17
|
+
message: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function makeErrorEnvelope(code: CLIErrorCode, message: string): CLIErrorEnvelope;
|
|
20
|
+
export declare function writeJsonError(code: CLIErrorCode, message: string): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { o as t, s as e, b as s, a, _ as r } from "./schemas-OhdGAhu_.js";
|
|
2
|
+
const o = t({
|
|
3
|
+
engine: r(["sg", "vale", "runtime"]),
|
|
4
|
+
ruleId: e(),
|
|
5
|
+
ok: s(),
|
|
6
|
+
errors: a(e()).describe("Human-readable failure messages"),
|
|
7
|
+
violations: a(
|
|
8
|
+
t({
|
|
9
|
+
constraintId: e().describe(
|
|
10
|
+
"Stable id of a constraint published in `@taskless/cli/reference.json`"
|
|
11
|
+
),
|
|
12
|
+
message: e().describe(
|
|
13
|
+
"The failure message reporting it, repeated verbatim from `errors`"
|
|
14
|
+
)
|
|
15
|
+
})
|
|
16
|
+
).describe(
|
|
17
|
+
"The subset of `errors` a published constraint accounts for. `errors` stays complete, so this is additive: read it to map a rejection to the rationale the corpus publishes, instead of matching on message text, which changes without notice. Empty when nothing failed and when what failed is not something a published constraint describes"
|
|
18
|
+
),
|
|
19
|
+
ran: s().optional().describe(
|
|
20
|
+
"`test` only: whether the rule's tests actually ran. Branch on this, not on `ok` alone: `ok: true` with `ran: false` is not a rule that passed"
|
|
21
|
+
),
|
|
22
|
+
refused: e().optional().describe(
|
|
23
|
+
"`test` only: the execution policy declined to run the rule's fixtures, and why. Neither a pass nor a failure, excluded from the rules tested, and never on its own a reason for a non-zero exit"
|
|
24
|
+
),
|
|
25
|
+
notice: e().optional().describe(
|
|
26
|
+
"Something true about the rule that does not make it a failure, reported even on a pass"
|
|
27
|
+
)
|
|
28
|
+
}), i = t({
|
|
29
|
+
ok: s(),
|
|
30
|
+
rules: a(o).describe("Per-rule results")
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
i as o
|
|
34
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taskless/cli",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,14 +8,18 @@
|
|
|
8
8
|
"directory": "packages/cli"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "vite build && tsc -p tsconfig.
|
|
12
|
-
"build:nightly": "TASKLESS_BUILD_TARGET=nightly vite build && tsc -p tsconfig.
|
|
11
|
+
"build": "vite build && tsc -p tsconfig.public.json",
|
|
12
|
+
"build:nightly": "TASKLESS_BUILD_TARGET=nightly vite build && tsc -p tsconfig.public.json",
|
|
13
13
|
"build:self": "TASKLESS_BUILD_TARGET=self vite build",
|
|
14
|
-
"
|
|
14
|
+
"demo:manifests": "tsx scripts/print-demo-manifests.ts",
|
|
15
|
+
"generate:api": "pnpm generate:api:schema && pnpm generate:api:types",
|
|
16
|
+
"generate:api:schema": "tsx scripts/fetch-api-schema.ts",
|
|
17
|
+
"generate:api:types": "openapi-typescript src/generated/api.schema.json -o src/generated/api.d.ts",
|
|
15
18
|
"generate:ast-grep-schema": "tsx scripts/fetch-ast-grep-schema.ts",
|
|
16
19
|
"generate:rule-hash-vectors": "tsx scripts/fetch-rule-hash-vectors.ts",
|
|
17
20
|
"generate:vale-schema": "tsx scripts/generate-vale-schema.ts",
|
|
18
21
|
"prebuild": "tsx scripts/fetch-rule-hash-vectors.ts",
|
|
22
|
+
"reference": "tsx scripts/write-reference.ts",
|
|
19
23
|
"test": "vitest run",
|
|
20
24
|
"typecheck": "tsc --noEmit"
|
|
21
25
|
},
|
|
@@ -28,10 +32,24 @@
|
|
|
28
32
|
"./prompts": {
|
|
29
33
|
"types": "./dist/prompts/index.d.ts",
|
|
30
34
|
"import": "./dist/prompts.js"
|
|
31
|
-
}
|
|
35
|
+
},
|
|
36
|
+
"./layout": {
|
|
37
|
+
"types": "./dist/layout/index.d.ts",
|
|
38
|
+
"import": "./dist/layout.js"
|
|
39
|
+
},
|
|
40
|
+
"./schemas": {
|
|
41
|
+
"types": "./dist/schemas/index.d.ts",
|
|
42
|
+
"import": "./dist/schemas.js"
|
|
43
|
+
},
|
|
44
|
+
"./node/runtimes": {
|
|
45
|
+
"types": "./dist/node/runtimes/index.d.ts",
|
|
46
|
+
"import": "./dist/node/runtimes.js"
|
|
47
|
+
},
|
|
48
|
+
"./reference.json": "./assets/reference.json"
|
|
32
49
|
},
|
|
33
50
|
"files": [
|
|
34
|
-
"dist"
|
|
51
|
+
"dist",
|
|
52
|
+
"assets/reference.json"
|
|
35
53
|
],
|
|
36
54
|
"engines": {
|
|
37
55
|
"node": ">=22.22.0"
|
|
@@ -54,6 +72,7 @@
|
|
|
54
72
|
"@ast-grep/cli": "0.45.2",
|
|
55
73
|
"@types/sprintf-js": "^1.1.4",
|
|
56
74
|
"openapi-typescript": "^7.13.0",
|
|
75
|
+
"prettier": "^3.8.1",
|
|
57
76
|
"typescript": "^5.7.2",
|
|
58
77
|
"vite": "^7.3.1",
|
|
59
78
|
"vite-tsconfig-paths": "^5.1.4",
|
|
@@ -70,11 +89,11 @@
|
|
|
70
89
|
"@ast-grep/cli-win32-arm64-msvc": "0.45.2",
|
|
71
90
|
"@ast-grep/cli-win32-ia32-msvc": "0.45.2",
|
|
72
91
|
"@ast-grep/cli-win32-x64-msvc": "0.45.2",
|
|
73
|
-
"@taskless/vale-darwin-arm64": "3.
|
|
74
|
-
"@taskless/vale-darwin-x64": "3.
|
|
75
|
-
"@taskless/vale-linux-arm64": "3.
|
|
76
|
-
"@taskless/vale-linux-x64": "3.
|
|
77
|
-
"@taskless/vale-win32-arm64": "3.
|
|
78
|
-
"@taskless/vale-win32-x64": "3.
|
|
92
|
+
"@taskless/vale-darwin-arm64": "3.20.0-20260907164938",
|
|
93
|
+
"@taskless/vale-darwin-x64": "3.20.0-20260907164938",
|
|
94
|
+
"@taskless/vale-linux-arm64": "3.20.0-20260907164938",
|
|
95
|
+
"@taskless/vale-linux-x64": "3.20.0-20260907164938",
|
|
96
|
+
"@taskless/vale-win32-arm64": "3.20.0-20260907164938",
|
|
97
|
+
"@taskless/vale-win32-x64": "3.20.0-20260907164938"
|
|
79
98
|
}
|
|
80
99
|
}
|