@tackup/cli 0.0.0 → 0.1.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/LICENSE +21 -0
- package/README.md +16 -1
- package/dist/builtins/extensions/docs/guides/day-two.md +3 -0
- package/dist/builtins/extensions/docs/guides/onboarding-2.md +3 -0
- package/dist/builtins/extensions/docs/guides/onboarding-3.md +3 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/SKILL.md +67 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/references/declare-docs.md +71 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/references/docs-in-profiles.md +25 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/references/docs-maintenance.md +35 -0
- package/dist/builtins/extensions/docs/skills/use-tack-docs/references/review.md +34 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/SKILL.md +66 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figure-components.md +20 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/architecture-map.md +86 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/chart.md +52 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/figure.md +79 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/file-tree.md +74 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/schema.md +116 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/system.md +81 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/figures/walkthrough.md +45 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/page-components.md +82 -0
- package/dist/builtins/extensions/docs/skills/write-reader-figures/references/rules.md +27 -0
- package/dist/builtins/extensions/docs/tack.yaml +10 -0
- package/dist/builtins/extensions/scripts/guides/day-two.md +3 -0
- package/dist/builtins/extensions/scripts/guides/onboarding-2.md +3 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/SKILL.md +48 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/run-scripts.md +23 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/script-api.md +76 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/scripts-in-profiles.md +35 -0
- package/dist/builtins/extensions/scripts/skills/author-tack-scripts/references/scripts-in-sources.md +56 -0
- package/dist/builtins/extensions/scripts/tack.yaml +10 -0
- package/dist/builtins/skills/author-tack-profiles/SKILL.md +68 -0
- package/dist/builtins/skills/author-tack-profiles/references/apply.md +33 -0
- package/dist/builtins/skills/author-tack-profiles/references/bundles.md +59 -0
- package/dist/builtins/skills/author-tack-profiles/references/copy-workflows.md +46 -0
- package/dist/builtins/skills/manage-tack-sources/SKILL.md +75 -0
- package/dist/builtins/skills/manage-tack-sources/references/catalog-issues.md +38 -0
- package/dist/builtins/skills/manage-tack-sources/references/metadata.md +35 -0
- package/dist/builtins/skills/manage-tack-sources/references/tack-yaml.md +114 -0
- package/dist/builtins/skills/manage-tack-sources/references/worked-source.md +126 -0
- package/dist/builtins/skills/prepare-tack-checkout/SKILL.md +52 -0
- package/dist/builtins/skills/use-tack/SKILL.md +65 -0
- package/dist/builtins/skills/use-tack/references/agent-instructions.md +38 -0
- package/dist/builtins/skills/use-tack/references/day-two.md +35 -0
- package/dist/builtins/skills/use-tack/references/explore.md +13 -0
- package/dist/builtins/skills/use-tack/references/imports.md +30 -0
- package/dist/builtins/skills/use-tack/references/maintenance.md +51 -0
- package/dist/builtins/skills/use-tack/references/onboarding-2.md +41 -0
- package/dist/builtins/skills/use-tack/references/onboarding-3.md +29 -0
- package/dist/builtins/skills/use-tack/references/onboarding.md +54 -0
- package/dist/builtins/skills/use-tack/references/output.md +15 -0
- package/dist/builtins/skills/use-tack/references/selection.md +61 -0
- package/dist/builtins/skills/use-tack/references/setup.md +69 -0
- package/dist/builtins/tack.yaml +10 -0
- package/dist/bundle-support-ZGTM5CTZ.js +16 -0
- package/dist/chunk-CFUDY2NO.js +1791 -0
- package/dist/chunk-CRQMJGMU.js +225 -0
- package/dist/chunk-DCX5T7CG.js +281 -0
- package/dist/chunk-EZ5C7B2M.js +28 -0
- package/dist/chunk-H4AG4WIV.js +52 -0
- package/dist/chunk-I5RMMV2Y.js +18013 -0
- package/dist/chunk-JL3E32X5.js +92 -0
- package/dist/chunk-MR5PTCYF.js +26 -0
- package/dist/chunk-PHQL7OBB.js +162 -0
- package/dist/chunk-QQBCYPJZ.js +5733 -0
- package/dist/chunk-T6JAU547.js +12401 -0
- package/dist/chunk-W7GHLGII.js +16 -0
- package/dist/chunk-XARHV5M4.js +56 -0
- package/dist/chunk-XZH2XPII.js +1017 -0
- package/dist/chunk-ZT6BO7LG.js +36671 -0
- package/dist/corpus-effects-YWG5VVHJ.js +12069 -0
- package/dist/elk.bundled-EVXDSFFG.js +94125 -0
- package/dist/main-JHULX3QY.js +65517 -0
- package/dist/main.js +17 -0
- package/dist/reader/visuals.tsx +368 -0
- package/dist/script.d.ts +133 -0
- package/dist/script.js +90 -0
- package/dist/server-XF7NSYRQ.js +308 -0
- package/dist/src-DZKPD6VY.js +1871 -0
- package/dist/src-TC3RTKIS.js +1126 -0
- package/dist/tack-env.d.ts +137 -0
- package/dist/third-party-licenses.txt +2467 -0
- package/dist/worker-ZFY6P7X5.js +24246 -0
- package/package.json +29 -3
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Generated by Tack 0.1.0: the script API that Tack provides at run time. Scripts import
|
|
2
|
+
// "@tackup/cli" and install nothing. Run `tack types --apply` again after upgrading Tack.
|
|
3
|
+
declare module "@tackup/cli" {
|
|
4
|
+
/**
|
|
5
|
+
* The Tack script API: plain async functions, no Effect. The running Tack provides this module to a
|
|
6
|
+
* script under its published name, so a source installs nothing:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { defineScript } from "@tackup/cli";
|
|
10
|
+
*
|
|
11
|
+
* export default defineScript({
|
|
12
|
+
* args: { name: { type: "string", description: "Who to greet" } },
|
|
13
|
+
* run: async ({ args, log }) => {
|
|
14
|
+
* log(`Greeting ${args.name}`);
|
|
15
|
+
* return { greeting: `Hello, ${args.name}` };
|
|
16
|
+
* },
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* This module imports nothing, so it can be loaded on its own by any script under Node or Bun.
|
|
21
|
+
*/
|
|
22
|
+
/** The value types an argument can take. */
|
|
23
|
+
export type ArgType = "string" | "number" | "boolean";
|
|
24
|
+
/** One named argument, in the shape of Node's `util.parseArgs` options plus `number` and `choices`. */
|
|
25
|
+
export type ArgSpec = {
|
|
26
|
+
readonly type: ArgType;
|
|
27
|
+
/** One line shown in argument errors. */
|
|
28
|
+
readonly description?: string;
|
|
29
|
+
/** Accept a list of values. */
|
|
30
|
+
readonly multiple?: boolean;
|
|
31
|
+
/** Allow the argument to be absent; it is then `undefined`. */
|
|
32
|
+
readonly optional?: boolean;
|
|
33
|
+
/** The value used when the argument is absent. */
|
|
34
|
+
readonly default?: string | number | boolean | ReadonlyArray<string | number | boolean>;
|
|
35
|
+
/** Restrict a string argument to these values. */
|
|
36
|
+
readonly choices?: ReadonlyArray<string>;
|
|
37
|
+
};
|
|
38
|
+
type Base<S> = S extends {
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
readonly choices: ReadonlyArray<infer C>;
|
|
41
|
+
} ? C : S extends {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
} ? string : S extends {
|
|
44
|
+
readonly type: "number";
|
|
45
|
+
} ? number : boolean;
|
|
46
|
+
type ValueOf<S> = S extends {
|
|
47
|
+
readonly multiple: true;
|
|
48
|
+
} ? ReadonlyArray<Base<S>> : Base<S>;
|
|
49
|
+
type MayBeAbsent<S> = S extends {
|
|
50
|
+
readonly default: unknown;
|
|
51
|
+
} ? false : S extends {
|
|
52
|
+
readonly optional: true;
|
|
53
|
+
} ? true : false;
|
|
54
|
+
type Simplify<T> = {
|
|
55
|
+
[K in keyof T]: T[K];
|
|
56
|
+
} & {};
|
|
57
|
+
/** The parsed and validated arguments a script receives. */
|
|
58
|
+
export type Args<A extends Record<string, ArgSpec>> = Simplify<{
|
|
59
|
+
readonly [K in keyof A as MayBeAbsent<A[K]> extends true ? never : K]: ValueOf<A[K]>;
|
|
60
|
+
} & {
|
|
61
|
+
readonly [K in keyof A as MayBeAbsent<A[K]> extends true ? K : never]?: ValueOf<A[K]>;
|
|
62
|
+
}>;
|
|
63
|
+
/** Writes to the run's log. Calling it directly logs at info level. */
|
|
64
|
+
export type Log = ((...parts: ReadonlyArray<unknown>) => void) & {
|
|
65
|
+
readonly debug: (...parts: ReadonlyArray<unknown>) => void;
|
|
66
|
+
readonly info: (...parts: ReadonlyArray<unknown>) => void;
|
|
67
|
+
readonly warn: (...parts: ReadonlyArray<unknown>) => void;
|
|
68
|
+
readonly error: (...parts: ReadonlyArray<unknown>) => void;
|
|
69
|
+
};
|
|
70
|
+
/** Files, with relative paths resolved from `cwd`. Every call stops once the run is cancelled. */
|
|
71
|
+
export type Files = {
|
|
72
|
+
readonly read: (path: string) => Promise<string>;
|
|
73
|
+
readonly readJson: (path: string) => Promise<unknown>;
|
|
74
|
+
/** Creates parent directories as needed. */
|
|
75
|
+
readonly write: (path: string, content: string) => Promise<void>;
|
|
76
|
+
readonly writeJson: (path: string, value: unknown) => Promise<void>;
|
|
77
|
+
readonly exists: (path: string) => Promise<boolean>;
|
|
78
|
+
/** The files matching a glob, relative to `cwd`, sorted. */
|
|
79
|
+
readonly list: (pattern: string) => Promise<ReadonlyArray<string>>;
|
|
80
|
+
readonly remove: (path: string) => Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
/** Options for one `exec` call. */
|
|
83
|
+
export type ExecOptions = {
|
|
84
|
+
readonly cwd?: string;
|
|
85
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
86
|
+
/** Return the result instead of throwing when the command exits non-zero. */
|
|
87
|
+
readonly allowFailure?: boolean;
|
|
88
|
+
};
|
|
89
|
+
/** What one command printed and how it exited. */
|
|
90
|
+
export type ExecResult = {
|
|
91
|
+
readonly stdout: string;
|
|
92
|
+
readonly stderr: string;
|
|
93
|
+
readonly exitCode: number;
|
|
94
|
+
};
|
|
95
|
+
/** Runs one executable with an argument list, without a shell. Throws on a non-zero exit. */
|
|
96
|
+
export type Exec = (command: string, args?: ReadonlyArray<string>, options?: ExecOptions) => Promise<ExecResult>;
|
|
97
|
+
/** Everything Tack gives a running script. */
|
|
98
|
+
export type ScriptContext<A extends Record<string, ArgSpec>, S extends string> = {
|
|
99
|
+
readonly args: Args<A>;
|
|
100
|
+
/** The declared secrets. Tack replaces their values with `<redacted>` in logs and results. */
|
|
101
|
+
readonly secrets: {
|
|
102
|
+
readonly [K in S]: string;
|
|
103
|
+
};
|
|
104
|
+
readonly log: Log;
|
|
105
|
+
readonly fs: Files;
|
|
106
|
+
readonly exec: Exec;
|
|
107
|
+
/** The run's working directory: the selected project root or the user's home. */
|
|
108
|
+
readonly cwd: string;
|
|
109
|
+
/** Aborted when the operator cancels the run or it times out. */
|
|
110
|
+
readonly signal: AbortSignal;
|
|
111
|
+
/** Ends the run with an expected failure that the operator should read. */
|
|
112
|
+
readonly fail: (message: string, details?: unknown) => never;
|
|
113
|
+
};
|
|
114
|
+
/** What `defineScript` takes. */
|
|
115
|
+
export type ScriptOptions<A extends Record<string, ArgSpec>, S extends ReadonlyArray<string>> = {
|
|
116
|
+
readonly args?: A;
|
|
117
|
+
/** Names of operator secrets, read from `TACK_<NAME>` in the environment or the state `.env`. */
|
|
118
|
+
readonly secrets?: S;
|
|
119
|
+
/** The script. Return JSON data, or nothing. */
|
|
120
|
+
readonly run: (context: ScriptContext<A, S[number]>) => unknown;
|
|
121
|
+
};
|
|
122
|
+
const brand: unique symbol;
|
|
123
|
+
/** The value `defineScript` returns; export it as the module's default export. */
|
|
124
|
+
export type Script = {
|
|
125
|
+
readonly [brand]: 1;
|
|
126
|
+
};
|
|
127
|
+
/** Thrown by `defineScript` when a definition is malformed; the message says how to fix it. */
|
|
128
|
+
export class ScriptDefinitionError extends Error {
|
|
129
|
+
readonly name = "ScriptDefinitionError";
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Declares a Tack script; export the result as the module's default export. A malformed definition
|
|
133
|
+
* throws {@link ScriptDefinitionError} when the module loads, listing every problem.
|
|
134
|
+
*/
|
|
135
|
+
export function defineScript<const A extends Record<string, ArgSpec> = {}, const S extends ReadonlyArray<string> = []>(options: ScriptOptions<A, S>): Script;
|
|
136
|
+
export {};
|
|
137
|
+
}
|