@taskless/cli 0.11.0 → 0.11.2

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,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,50 @@
1
+ /**
2
+ * The PostHog survey the CLI answers on the user's behalf, and the map from
3
+ * the payload's human keys to its question identifiers.
4
+ *
5
+ * This is the ONLY place the survey's identifiers live. The agent never sees a
6
+ * question UUID: it writes `verbatim`, `goal`, and so on, and `feedback send`
7
+ * translates. A mangled UUID would be a silently missing answer; a mangled
8
+ * human key is a validation error with a message.
9
+ *
10
+ * The identifiers are PostHog's. `survey shown`, `survey dismissed`, and
11
+ * `survey sent` are its event literals for a custom survey, `$survey_id` and
12
+ * `$survey_response_<question id>` are its property contract, and the CLI
13
+ * adds no survey-specific property of its own. Everything else on the event
14
+ * is the standard set the telemetry client stamps on every capture.
15
+ *
16
+ * `survey shown` means SERVED. The CLI knows it appended the invite to a
17
+ * recipe; it cannot know the agent put the question to a person. The funnel
18
+ * reads shown ≫ sent by design, and nothing here pretends otherwise.
19
+ *
20
+ * A question's id changes when its type changes in PostHog. Q3 became single
21
+ * choice on 2026-09-17 and took a new id; the one below is current.
22
+ */
23
+ export declare const SURVEY_ID = "01a0b1a0-80fb-0000-5dc1-baa4ec44e619";
24
+ /** The payload keys, in question order. */
25
+ export type FeedbackKey = "verbatim" | "goal" | "completed" | "workedWell" | "needsImprovement";
26
+ export interface SurveyQuestion {
27
+ key: FeedbackKey;
28
+ id: string;
29
+ question: string;
30
+ }
31
+ export declare const SURVEY_QUESTIONS: readonly SurveyQuestion[];
32
+ /** The choices PostHog holds for `completed`, in its own casing. */
33
+ export declare const COMPLETED_CHOICES: readonly ["Yes", "No", "Unknown"];
34
+ /**
35
+ * The recipes that carry the invite. Used by the gate alone; the events do not
36
+ * name the recipe, because the survey contract has no slot for it.
37
+ */
38
+ export declare const SURVEYED_TOPICS: ReadonlySet<string>;
39
+ /**
40
+ * How long serving an invite holds the next one off. Ten days, because the
41
+ * surveyed recipes are rule generation, which is the touchiest part of the
42
+ * agent experience, and a long quiet gap is a gap in feedback.
43
+ */
44
+ export declare const SHOWN_INTERVAL_MS: number;
45
+ /**
46
+ * How long an explicit answer holds the next invite off. Twenty days for both
47
+ * a dismissal and a sent response: either is a terminal action the user took,
48
+ * and only silence earns the shorter gap.
49
+ */
50
+ export declare const ANSWERED_INTERVAL_MS: number;
@@ -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;
@@ -21,6 +21,24 @@ export declare const PROD_INVOCATION = "npx @taskless/cli";
21
21
  export declare function isProductionInvocation(): boolean;
22
22
  /** This build's invocation, whatever the target. */
23
23
  export declare function buildInvocation(): string;
24
+ /** The token skill and command sources spell the CLI invocation with. */
25
+ export declare const INVOCATION_PLACEHOLDER = "%(TASKLESS_CLI)s";
26
+ /**
27
+ * Render {@link INVOCATION_PLACEHOLDER} in an installed skill or command body
28
+ * to this build's invocation.
29
+ *
30
+ * The same token the recipes use, so a reader of either source sees one
31
+ * spelling. It is substituted as an exact token rather than rendered through
32
+ * sprintf: the sources are prose with no other placeholders, and sprintf
33
+ * would make a literal `%` in a markdown body a render error.
34
+ *
35
+ * This replaces searching the prose for the literal `npx @taskless/cli`
36
+ * ({@link applyCliInvocation}), which is whitespace-sensitive: a wrapped line
37
+ * or a doubled space left the literal in place, and a nightly install then
38
+ * carried a skill telling its agent to run the release package. A token
39
+ * either matches exactly or a test on the source notices it is missing.
40
+ */
41
+ export declare function renderInvocationPlaceholder(content: string): string;
24
42
  /**
25
43
  * Rewrite the canonical `npx @taskless/cli` invocation to the build-target
26
44
  * invocation (`__TASKLESS_CLI__`).
@@ -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.0",
3
+ "version": "0.11.2",
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.prompts.json",
12
- "build:nightly": "TASKLESS_BUILD_TARGET=nightly vite build && tsc -p tsconfig.prompts.json",
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
- "generate:api": "openapi-typescript https://app.taskless.io/cli/api/__schema -o src/generated/api.d.ts",
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"
@@ -51,9 +69,10 @@
51
69
  "zod": "^4.3.6"
52
70
  },
53
71
  "devDependencies": {
54
- "@ast-grep/cli": "0.45.2",
72
+ "@ast-grep/cli": "0.45.3",
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",
@@ -63,18 +82,18 @@
63
82
  "taskless": "./dist/index.js"
64
83
  },
65
84
  "optionalDependencies": {
66
- "@ast-grep/cli-darwin-arm64": "0.45.2",
67
- "@ast-grep/cli-darwin-x64": "0.45.2",
68
- "@ast-grep/cli-linux-arm64-gnu": "0.45.2",
69
- "@ast-grep/cli-linux-x64-gnu": "0.45.2",
70
- "@ast-grep/cli-win32-arm64-msvc": "0.45.2",
71
- "@ast-grep/cli-win32-ia32-msvc": "0.45.2",
72
- "@ast-grep/cli-win32-x64-msvc": "0.45.2",
73
- "@taskless/vale-darwin-arm64": "3.18.0-20260824195610",
74
- "@taskless/vale-darwin-x64": "3.18.0-20260824195610",
75
- "@taskless/vale-linux-arm64": "3.18.0-20260824195610",
76
- "@taskless/vale-linux-x64": "3.18.0-20260824195610",
77
- "@taskless/vale-win32-arm64": "3.18.0-20260824195610",
78
- "@taskless/vale-win32-x64": "3.18.0-20260824195610"
85
+ "@ast-grep/cli-darwin-arm64": "0.45.3",
86
+ "@ast-grep/cli-darwin-x64": "0.45.3",
87
+ "@ast-grep/cli-linux-arm64-gnu": "0.45.3",
88
+ "@ast-grep/cli-linux-x64-gnu": "0.45.3",
89
+ "@ast-grep/cli-win32-arm64-msvc": "0.45.3",
90
+ "@ast-grep/cli-win32-ia32-msvc": "0.45.3",
91
+ "@ast-grep/cli-win32-x64-msvc": "0.45.3",
92
+ "@taskless/vale-darwin-arm64": "3.21.0-20260915061224",
93
+ "@taskless/vale-darwin-x64": "3.21.0-20260915061224",
94
+ "@taskless/vale-linux-arm64": "3.21.0-20260915061224",
95
+ "@taskless/vale-linux-x64": "3.21.0-20260915061224",
96
+ "@taskless/vale-win32-arm64": "3.21.0-20260915061224",
97
+ "@taskless/vale-win32-x64": "3.21.0-20260915061224"
79
98
  }
80
99
  }