@poetics/cli 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jack James
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
- # Temporary Holding Version
1
+ # @poetics/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The poetics command-line interface, with --json output for agents.
4
+
5
+ Part of [Poetics](../../README.md). Pre-alpha: see [architecture](../../docs/architecture.md) for what is built and what is stubbed.
package/dist/bin.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
package/dist/bin.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { run } from "./run.js";
3
+ process.exitCode = await run(process.argv.slice(2), {
4
+ out: (text) => process.stdout.write(`${text}\n`),
5
+ err: (text) => process.stderr.write(`${text}\n`),
6
+ });
7
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,CAAC,QAAQ,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAClD,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;IAChD,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;CACjD,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export interface CommandSpec {
2
+ name: string;
3
+ usage: string;
4
+ summary: string;
5
+ }
6
+ /** The CLI surface from docs/plan.md, "Developer workflow and tooling". */
7
+ export declare const COMMANDS: readonly CommandSpec[];
8
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,2EAA2E;AAC3E,eAAO,MAAM,QAAQ,EAAE,SAAS,WAAW,EAU1C,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** The CLI surface from docs/plan.md, "Developer workflow and tooling". */
2
+ export const COMMANDS = [
3
+ { name: "init", usage: "poetics init [--agents]", summary: "Detect React and Svelte, write config, index the repo and backfill history from git" },
4
+ { name: "index", usage: "poetics index", summary: "Incremental re-index of changed files; run by the git hook" },
5
+ { name: "log", usage: "poetics log <unit>", summary: "Version history of one unit, with rationale and commits" },
6
+ { name: "why", usage: "poetics why <unit>", summary: "The rationale chain that led to the current version" },
7
+ { name: "impact", usage: "poetics impact [ref]", summary: "Components whose closure changed since a branch or commit" },
8
+ { name: "diff", usage: "poetics diff <unit> <a> <b>", summary: "Semantic diff between two versions of a unit" },
9
+ { name: "verify", usage: "poetics verify [--since <ref>]", summary: "List unverified units, stale docs and unresolved edges, and unrecorded changes since a ref; non-zero exit for CI" },
10
+ { name: "coverage", usage: "poetics coverage", summary: "How much of the codebase .poetics/ covers, against policy thresholds" },
11
+ { name: "docs", usage: "poetics docs sync", summary: "Write stored docs into TSDoc and @component comments" },
12
+ ];
13
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAMA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,QAAQ,GAA2B;IAC9C,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,yBAAyB,EAAE,OAAO,EAAE,qFAAqF,EAAE;IAClJ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,4DAA4D,EAAE;IAChH,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,yDAAyD,EAAE;IAChH,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,qDAAqD,EAAE;IAC5G,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,sBAAsB,EAAE,OAAO,EAAE,2DAA2D,EAAE;IACvH,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,6BAA6B,EAAE,OAAO,EAAE,8CAA8C,EAAE;IAC/G,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,gCAAgC,EAAE,OAAO,EAAE,kHAAkH,EAAE;IACxL,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,sEAAsE,EAAE;IAChI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,sDAAsD,EAAE;CAC9G,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type { CommandSpec } from "./commands.ts";
2
+ export { COMMANDS } from "./commands.ts";
3
+ export type { Io } from "./run.ts";
4
+ export { VERSION, run } from "./run.ts";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { COMMANDS } from "./commands.js";
2
+ export { VERSION, run } from "./run.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC"}
package/dist/run.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export interface Io {
2
+ out(text: string): void;
3
+ err(text: string): void;
4
+ }
5
+ export declare const VERSION: string;
6
+ /** Exit codes: 0 ok, 1 findings (e.g. verify), 2 usage or not-implemented. */
7
+ export declare function run(argv: readonly string[], io: Io): Promise<number>;
8
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,EAAE;IACjB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAGD,eAAO,MAAM,OAAO,EAAE,MAEb,CAAC;AAEV,8EAA8E;AAC9E,wBAAsB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA6B1E"}
package/dist/run.js ADDED
@@ -0,0 +1,43 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { NotImplementedError } from "@poetics/core";
3
+ import { COMMANDS } from "./commands.js";
4
+ // src/ and dist/ both sit one level below package.json.
5
+ export const VERSION = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
6
+ /** Exit codes: 0 ok, 1 findings (e.g. verify), 2 usage or not-implemented. */
7
+ export async function run(argv, io) {
8
+ const json = argv.includes("--json");
9
+ const args = argv.filter((arg) => arg !== "--json");
10
+ const [name] = args;
11
+ if (name === undefined || name === "help" || name === "--help" || name === "-h") {
12
+ io.out(json ? JSON.stringify({ version: VERSION, commands: COMMANDS }) : helpText());
13
+ return 0;
14
+ }
15
+ if (name === "--version" || name === "-v") {
16
+ io.out(json ? JSON.stringify({ version: VERSION }) : VERSION);
17
+ return 0;
18
+ }
19
+ const command = COMMANDS.find((spec) => spec.name === name);
20
+ if (!command) {
21
+ report(io, json, { error: "unknown-command", message: `Unknown command: ${name}. Run poetics help.` });
22
+ return 2;
23
+ }
24
+ try {
25
+ throw new NotImplementedError(`poetics ${command.name}`);
26
+ }
27
+ catch (error) {
28
+ if (error instanceof NotImplementedError) {
29
+ report(io, json, { error: "not-implemented", command: command.name, message: error.message });
30
+ return 2;
31
+ }
32
+ throw error;
33
+ }
34
+ }
35
+ function report(io, json, payload) {
36
+ io.err(json ? JSON.stringify(payload) : payload.message);
37
+ }
38
+ function helpText() {
39
+ const width = Math.max(...COMMANDS.map((command) => command.usage.length));
40
+ const lines = COMMANDS.map((command) => ` ${command.usage.padEnd(width)} ${command.summary}`);
41
+ return [`poetics ${VERSION}`, "", "Usage:", ...lines, "", "Every command accepts --json for structured output."].join("\n");
42
+ }
43
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAOzC,wDAAwD;AACxD,MAAM,CAAC,MAAM,OAAO,GAClB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAC7E,CAAC,OAAO,CAAC;AAEV,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,IAAuB,EAAE,EAAM;IACvD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC;IACpD,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAChF,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC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GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,QAAQ;IACf,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAChG,OAAO,CAAC,WAAW,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,qDAAqD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9H,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "@poetics/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "The poetics command-line interface, with --json output for agents.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Pixerate/poetics.git",
10
+ "directory": "packages/cli"
11
+ },
12
+ "engines": {
13
+ "node": ">=24.15.0"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "poetics-source": "./src/index.ts",
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "!dist/**/*.test.*",
25
+ "!dist/.tsbuildinfo"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "provenance": true
30
+ },
31
+ "bin": {
32
+ "poetics": "./dist/bin.js"
33
+ },
34
+ "dependencies": {
35
+ "@poetics/core": "0.2.0",
36
+ "@poetics/store": "0.2.0"
37
+ },
38
+ "scripts": {
39
+ "build": "tsc -b"
40
+ }
6
41
  }