@panaversity/ksor 0.0.0 → 0.0.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/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export {}
package/dist/cli.mjs ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ import { exitCodes, resolveCommand, verbs } from "./index.mjs";
3
+ import { readFileSync } from "node:fs";
4
+ //#region src/cli.ts
5
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
6
+ const notice = `
7
+ Knowledge System of Record: one governed source of markdown, published as a
8
+ site people read and an MCP surface AI agents query — with citations, and an
9
+ honest refusal when the corpus does not cover the question.
10
+
11
+ Follow along: ${pkg.homepage}\n`;
12
+ const usage = `ksor ${pkg.version} — Knowledge System of Record\n
13
+ Usage: ksor <verb>
14
+
15
+ Verbs (designed; none implemented in ${pkg.version} — each exits 2 until it ships):\n init create a new KSoR project
16
+ dev run the human surface locally, watching
17
+ build validate and build both surfaces
18
+ serve expose the MCP agent surface
19
+
20
+ Exit codes: 1 refused · 2 designed but not implemented · 3 environment
21
+ Docs: node_modules/${pkg.name}/docs · ${pkg.homepage}\n`;
22
+ function main(args) {
23
+ if (args.includes("--help") || args.includes("-h")) {
24
+ process.stdout.write(usage);
25
+ return 0;
26
+ }
27
+ if (args.includes("--version")) {
28
+ process.stdout.write(`${pkg.version}\n`);
29
+ return 0;
30
+ }
31
+ const { word, verb } = resolveCommand(args);
32
+ if (word !== null && verb === null) {
33
+ process.stderr.write(`error: unknown-verb\n"${word}" is not a ksor verb. The vocabulary is: ${verbs.join(", ")}.\n`);
34
+ return exitCodes.refused;
35
+ }
36
+ const heading = verb === null ? `ksor ${pkg.version} — the name is reserved; this is not a release.` : `ksor ${verb}: designed but not implemented in ${pkg.version}.`;
37
+ process.stdout.write(`${heading}\n${notice}`);
38
+ return exitCodes.notImplemented;
39
+ }
40
+ process.exitCode = main(process.argv.slice(2));
41
+ //#endregion
42
+ export {};
@@ -0,0 +1,34 @@
1
+ //#region src/index.d.ts
2
+ /**
3
+ * Public entry point of @panaversity/ksor.
4
+ *
5
+ * Nothing here is a released capability: 0.x builds expose only the CLI
6
+ * contract, so that scripts and agents driving `ksor` can rely on stable,
7
+ * documented exit semantics before the verbs are implemented.
8
+ */
9
+ /**
10
+ * Exit-code contract for the `ksor` CLI. 2 must never be read as a crash: it
11
+ * is the honest "this verb is designed but not implemented in this build".
12
+ */
13
+ declare const exitCodes: {
14
+ /** The command was refused: bad input or a guarded operation. */
15
+ readonly refused: 1;
16
+ /** The verb exists in the design but is not implemented in this build. */
17
+ readonly notImplemented: 2;
18
+ /** The environment cannot run ksor (missing runtime requirement). */
19
+ readonly environment: 3;
20
+ };
21
+ type ExitCode = (typeof exitCodes)[keyof typeof exitCodes];
22
+ /** The CLI vocabulary. Deliberately small; see the README. */
23
+ declare const verbs: readonly ["init", "dev", "build", "serve"];
24
+ type Verb = (typeof verbs)[number];
25
+ interface ResolvedCommand {
26
+ /** The first non-flag token, or null when only flags (or nothing) appear. */
27
+ readonly word: string | null;
28
+ /** `word` when it is in the vocabulary, otherwise null. */
29
+ readonly verb: Verb | null;
30
+ }
31
+ /** Resolve the command word from CLI arguments (flags are skipped). */
32
+ declare function resolveCommand(argv: readonly string[]): ResolvedCommand;
33
+ //#endregion
34
+ export { ExitCode, ResolvedCommand, Verb, exitCodes, resolveCommand, verbs };
package/dist/index.mjs ADDED
@@ -0,0 +1,37 @@
1
+ //#region src/index.ts
2
+ /**
3
+ * Public entry point of @panaversity/ksor.
4
+ *
5
+ * Nothing here is a released capability: 0.x builds expose only the CLI
6
+ * contract, so that scripts and agents driving `ksor` can rely on stable,
7
+ * documented exit semantics before the verbs are implemented.
8
+ */
9
+ /**
10
+ * Exit-code contract for the `ksor` CLI. 2 must never be read as a crash: it
11
+ * is the honest "this verb is designed but not implemented in this build".
12
+ */
13
+ const exitCodes = {
14
+ /** The command was refused: bad input or a guarded operation. */
15
+ refused: 1,
16
+ /** The verb exists in the design but is not implemented in this build. */
17
+ notImplemented: 2,
18
+ /** The environment cannot run ksor (missing runtime requirement). */
19
+ environment: 3
20
+ };
21
+ /** The CLI vocabulary. Deliberately small; see the README. */
22
+ const verbs = [
23
+ "init",
24
+ "dev",
25
+ "build",
26
+ "serve"
27
+ ];
28
+ /** Resolve the command word from CLI arguments (flags are skipped). */
29
+ function resolveCommand(argv) {
30
+ const word = argv.find((arg) => !arg.startsWith("-")) ?? null;
31
+ return {
32
+ word,
33
+ verb: word !== null && verbs.includes(word) ? word : null
34
+ };
35
+ }
36
+ //#endregion
37
+ export { exitCodes, resolveCommand, verbs };
package/docs/index.md ADDED
@@ -0,0 +1,25 @@
1
+ ---
2
+ title: ksor documentation
3
+ status: draft
4
+ ---
5
+
6
+ # ksor documentation
7
+
8
+ These docs ship inside the npm package (`node_modules/@panaversity/ksor/docs/`)
9
+ so that coding agents read documentation matching the **installed** version
10
+ instead of their training memory. That mechanism is live from 0.x on, even
11
+ though the docs are still small — the corpus grows with each implemented verb.
12
+
13
+ ## What exists in this build
14
+
15
+ - The `ksor` CLI answers honestly: every designed verb (`init`, `dev`, `build`,
16
+ `serve`) reports "designed but not implemented" and exits `2`.
17
+ - The package root exports the CLI contract: `exitCodes` (1 refused,
18
+ 2 not implemented, 3 environment), `verbs`, and `resolveCommand`.
19
+
20
+ ## Where truth lives
21
+
22
+ - [`docs/status.md`](https://github.com/panaversity/ksor/blob/main/docs/status.md)
23
+ in the repository is authoritative for implemented functionality.
24
+ - The repository [`README`](https://github.com/panaversity/ksor#readme) is the
25
+ concept document, not a capability claim.
package/package.json CHANGED
@@ -1,39 +1,66 @@
1
1
  {
2
2
  "name": "@panaversity/ksor",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "Knowledge System of Record — the authoritative, governed source of knowledge that humans and AI agents operate from. Name reserved; implementation in progress.",
5
- "license": "Apache-2.0",
6
- "author": "Panaversity",
7
- "homepage": "https://github.com/panaversity/ksor#readme",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/panaversity/ksor.git"
11
- },
12
- "bugs": {
13
- "url": "https://github.com/panaversity/ksor/issues"
14
- },
15
5
  "keywords": [
6
+ "abstention",
7
+ "citations",
8
+ "documentation",
9
+ "docusaurus",
10
+ "governance",
16
11
  "knowledge-system-of-record",
17
- "system-of-record",
18
12
  "mcp",
19
13
  "model-context-protocol",
20
- "governance",
21
14
  "provenance",
22
- "citations",
23
- "abstention",
24
- "documentation",
25
- "docusaurus"
15
+ "system-of-record"
26
16
  ],
17
+ "homepage": "https://github.com/panaversity/ksor#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/panaversity/ksor/issues"
20
+ },
21
+ "license": "Apache-2.0",
22
+ "author": "Panaversity",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/panaversity/ksor.git",
26
+ "directory": "packages/ksor"
27
+ },
27
28
  "bin": {
28
- "ksor": "bin/ksor.js"
29
+ "ksor": "./dist/cli.mjs"
29
30
  },
30
31
  "files": [
31
- "bin"
32
+ "dist",
33
+ "docs",
34
+ "CHANGELOG.md",
35
+ "NOTICE"
32
36
  ],
33
- "engines": {
34
- "node": ">=20"
37
+ "type": "module",
38
+ "sideEffects": false,
39
+ "exports": {
40
+ ".": {
41
+ "types": "./dist/index.d.mts",
42
+ "import": "./dist/index.mjs",
43
+ "default": "./dist/index.mjs"
44
+ },
45
+ "./package.json": "./package.json"
35
46
  },
36
47
  "publishConfig": {
37
- "access": "public"
48
+ "access": "public",
49
+ "provenance": true
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^24.13.3",
53
+ "publint": "0.3.23",
54
+ "tsdown": "0.22.14",
55
+ "typescript": "7.0.2",
56
+ "vitest": "^4.1.10"
57
+ },
58
+ "engines": {
59
+ "node": ">=24"
60
+ },
61
+ "scripts": {
62
+ "build": "tsdown",
63
+ "typecheck": "tsc -p tsconfig.json",
64
+ "publint": "publint"
38
65
  }
39
- }
66
+ }
package/bin/ksor.js DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env node
2
- // The placeholder CLI. It exists so that `npx ksor` answers honestly rather than
3
- // failing with a module error — the same rule the implementation holds itself to:
4
- // an unimplemented verb says so, names what does exist, and exits non-zero.
5
- //
6
- // Exit 2 is deliberate and matches the framework's own convention: 2 means "this
7
- // verb is not implemented in this build", distinct from 1 (refused / bad input)
8
- // and 3 (environment). Nothing here should be taken as a released capability.
9
-
10
- const pkg = require("../package.json");
11
-
12
- process.stdout.write(
13
- `ksor ${pkg.version} — the name is reserved; this is not a release.\n` +
14
- "\n" +
15
- "Knowledge System of Record: one governed source of markdown, published as a\n" +
16
- "site people read and an MCP surface AI agents query — with citations, and an\n" +
17
- "honest refusal when the corpus does not cover the question.\n" +
18
- "\n" +
19
- `Follow along: ${pkg.homepage}\n`,
20
- );
21
-
22
- process.exit(2);