@taskless/cli-nightly 0.11.0-20260820055459x599d3f3
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 +21 -0
- package/README.md +235 -0
- package/dist/index.js +15360 -0
- package/dist/prompts/index.d.ts +61 -0
- package/dist/prompts/recipes.d.ts +36 -0
- package/dist/prompts.js +43 -0
- package/dist/recipes-Ay7coxQs.js +6962 -0
- package/dist/schemas/rules-create.d.ts +18 -0
- package/dist/schemas/rules-improve.d.ts +21 -0
- package/dist/util/invocation.d.ts +17 -0
- package/package.json +79 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type RecipeOptions } from "./recipes.js";
|
|
2
|
+
/**
|
|
3
|
+
* Public entry for `@taskless/cli/prompts`.
|
|
4
|
+
*
|
|
5
|
+
* Everything here renders through the same embedded recipe text and the same
|
|
6
|
+
* render path `taskless agent <topic>` serves, so the two surfaces cannot emit
|
|
7
|
+
* different guidance. Nothing in this graph reaches the CLI runtime: no citty
|
|
8
|
+
* command tree, no telemetry, no filesystem or network, so a Worker can import
|
|
9
|
+
* it without dragging the CLI in behind it.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Topics exported as public API. Hand-maintained rather than derived from the
|
|
13
|
+
* recipe files, because an exported name is a promise held for a major version
|
|
14
|
+
* and a new `help/*.txt` must not be able to publish one by existing. The
|
|
15
|
+
* completeness check in `test/prompts.test.ts` asserts this list plus
|
|
16
|
+
* {@link INTERNAL_TOPICS} accounts for every canonical recipe on disk.
|
|
17
|
+
*
|
|
18
|
+
* The list starts at what a consumer has actually asked for and grows on
|
|
19
|
+
* demand. It is the authoring recipe for each engine a rule can be routed to,
|
|
20
|
+
* so a consumer that can decide a rule belongs to an engine can also reach the
|
|
21
|
+
* procedure for writing one. Exporting a chooser without its destinations
|
|
22
|
+
* reproduces, for the platform generator, the dead end this surface exists to
|
|
23
|
+
* remove.
|
|
24
|
+
*
|
|
25
|
+
* `engine-selection` used to be exported alongside them. It no longer exists:
|
|
26
|
+
* the criterion it carried now lives in `route`, stated once. `route` is not
|
|
27
|
+
* exported yet because it still contains local mechanics (`taskless detect`,
|
|
28
|
+
* on-device authoring) a Worker cannot run; until it is, a consumer gets each
|
|
29
|
+
* destination's own scope from these three and adjudicates genuinely ambiguous
|
|
30
|
+
* calls itself.
|
|
31
|
+
*/
|
|
32
|
+
export declare const TOPICS: readonly ["create-sg-rule", "create-vale-rule", "create-runtime-rule"];
|
|
33
|
+
/**
|
|
34
|
+
* Recipes deliberately withheld from the export, recorded so they stay visible
|
|
35
|
+
* decisions rather than oversights. Two groups:
|
|
36
|
+
*
|
|
37
|
+
* - Command recipes (`auth` … `update`) walk an agent through running a CLI
|
|
38
|
+
* subcommand on a developer's machine. There is no caller for them outside
|
|
39
|
+
* the CLI that hosts those commands.
|
|
40
|
+
* - Authoring recipes are unreachable server-side: `route` picks an authoring
|
|
41
|
+
* destination before the service is involved, `create-remote-rule` states
|
|
42
|
+
* the boundary from the client's side, `detect` documents a CLI subprocess a
|
|
43
|
+
* Worker cannot spawn, `create-legacy-rule` targets a local toolchain, and
|
|
44
|
+
* `rule-meta` reads an `improve-rule` sidecar file.
|
|
45
|
+
*/
|
|
46
|
+
export declare const INTERNAL_TOPICS: readonly ["auth", "check", "ci", "create-legacy-rule", "create-remote-rule", "delete-rule", "detect", "improve-rule", "info", "init", "onboard", "route", "rule", "rule-meta", "update", "verify-rule"];
|
|
47
|
+
/** A topic name the package exports. Unknown names fail to type-check. */
|
|
48
|
+
export type PromptTopic = (typeof TOPICS)[number];
|
|
49
|
+
/** Options accepted by every prompt render function. */
|
|
50
|
+
export type PromptOptions = RecipeOptions;
|
|
51
|
+
/**
|
|
52
|
+
* Render a prompt to finished text. Every `%(KEY)s` placeholder is resolved
|
|
53
|
+
* from values the package already holds, so the caller never handles a
|
|
54
|
+
* template dialect.
|
|
55
|
+
*
|
|
56
|
+
* @throws when the topic has no canonical recipe in the build, which means
|
|
57
|
+
* {@link TOPICS} and the recipe files have diverged.
|
|
58
|
+
*/
|
|
59
|
+
export declare function getPrompt(topic: PromptTopic, options?: PromptOptions): string;
|
|
60
|
+
/** Every exported topic as a render function, keyed by topic name. */
|
|
61
|
+
export declare const PROMPTS: Record<PromptTopic, (options?: PromptOptions) => string>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** The canonical `<topic>.txt` recipe names present in the build. */
|
|
2
|
+
export declare function canonicalRecipeTopics(): string[];
|
|
3
|
+
/** Options accepted by the shared render path. */
|
|
4
|
+
export interface RecipeOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Select the `.anonymous` variant of the topic, falling back to the
|
|
7
|
+
* canonical recipe when the topic has no variant.
|
|
8
|
+
*
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
anonymous?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Value substituted for the `%(PACKAGE_MANAGER_DLX)s` placeholder. The
|
|
14
|
+
* default is an agent-fill marker, which is the right answer whenever
|
|
15
|
+
* the caller does not know the consuming repo's package manager.
|
|
16
|
+
*
|
|
17
|
+
* @default "<package-manager-dlx>"
|
|
18
|
+
*/
|
|
19
|
+
packageManagerDlx?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Include the `# Topic: <name> (CLI v<version> / topic vN)` first line.
|
|
22
|
+
* Suppressing it drops the CLI version from the text, which matters to
|
|
23
|
+
* an LLM consumer whose prompt-cache key would otherwise churn on every
|
|
24
|
+
* CLI publish.
|
|
25
|
+
*
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
header?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Look up a help topic from the embedded recipe map and return the rendered
|
|
32
|
+
* text. Anonymous variants are preferred when `anonymous` is set and a
|
|
33
|
+
* variant exists; otherwise the canonical recipe is returned. Returns
|
|
34
|
+
* `undefined` when the topic is unknown.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getRecipe(topic: string, options?: RecipeOptions): string | undefined;
|
package/dist/prompts.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { F as o } from "./recipes-Ay7coxQs.js";
|
|
2
|
+
const i = [
|
|
3
|
+
"create-sg-rule",
|
|
4
|
+
"create-vale-rule",
|
|
5
|
+
"create-runtime-rule"
|
|
6
|
+
], n = [
|
|
7
|
+
"auth",
|
|
8
|
+
"check",
|
|
9
|
+
"ci",
|
|
10
|
+
"create-legacy-rule",
|
|
11
|
+
"create-remote-rule",
|
|
12
|
+
"delete-rule",
|
|
13
|
+
"detect",
|
|
14
|
+
"improve-rule",
|
|
15
|
+
"info",
|
|
16
|
+
"init",
|
|
17
|
+
"onboard",
|
|
18
|
+
"route",
|
|
19
|
+
"rule",
|
|
20
|
+
"rule-meta",
|
|
21
|
+
"update",
|
|
22
|
+
"verify-rule"
|
|
23
|
+
];
|
|
24
|
+
function a(e, r) {
|
|
25
|
+
const t = o(e, r);
|
|
26
|
+
if (t === void 0)
|
|
27
|
+
throw new Error(
|
|
28
|
+
`No recipe is embedded for prompt topic "${e}". This is a packaging fault: TOPICS lists a topic with no help/${e}.txt behind it.`
|
|
29
|
+
);
|
|
30
|
+
return t;
|
|
31
|
+
}
|
|
32
|
+
const u = Object.fromEntries(
|
|
33
|
+
i.map((e) => [
|
|
34
|
+
e,
|
|
35
|
+
(r) => a(e, r)
|
|
36
|
+
])
|
|
37
|
+
);
|
|
38
|
+
export {
|
|
39
|
+
n as INTERNAL_TOPICS,
|
|
40
|
+
u as PROMPTS,
|
|
41
|
+
i as TOPICS,
|
|
42
|
+
a as getPrompt
|
|
43
|
+
};
|