youmd 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.
Files changed (65) hide show
  1. package/dist/commands/add.d.ts +2 -0
  2. package/dist/commands/add.d.ts.map +1 -0
  3. package/dist/commands/add.js +66 -0
  4. package/dist/commands/add.js.map +1 -0
  5. package/dist/commands/build.d.ts +2 -0
  6. package/dist/commands/build.d.ts.map +1 -0
  7. package/dist/commands/build.js +48 -0
  8. package/dist/commands/build.js.map +1 -0
  9. package/dist/commands/diff.d.ts +2 -0
  10. package/dist/commands/diff.d.ts.map +1 -0
  11. package/dist/commands/diff.js +25 -0
  12. package/dist/commands/diff.js.map +1 -0
  13. package/dist/commands/init.d.ts +2 -0
  14. package/dist/commands/init.d.ts.map +1 -0
  15. package/dist/commands/init.js +112 -0
  16. package/dist/commands/init.js.map +1 -0
  17. package/dist/commands/keys.d.ts +11 -0
  18. package/dist/commands/keys.d.ts.map +1 -0
  19. package/dist/commands/keys.js +99 -0
  20. package/dist/commands/keys.js.map +1 -0
  21. package/dist/commands/link.d.ts +7 -0
  22. package/dist/commands/link.d.ts.map +1 -0
  23. package/dist/commands/link.js +152 -0
  24. package/dist/commands/link.js.map +1 -0
  25. package/dist/commands/login.d.ts +4 -0
  26. package/dist/commands/login.d.ts.map +1 -0
  27. package/dist/commands/login.js +121 -0
  28. package/dist/commands/login.js.map +1 -0
  29. package/dist/commands/preview.d.ts +4 -0
  30. package/dist/commands/preview.d.ts.map +1 -0
  31. package/dist/commands/preview.js +26 -0
  32. package/dist/commands/preview.js.map +1 -0
  33. package/dist/commands/publish.d.ts +2 -0
  34. package/dist/commands/publish.d.ts.map +1 -0
  35. package/dist/commands/publish.js +146 -0
  36. package/dist/commands/publish.js.map +1 -0
  37. package/dist/commands/register.d.ts +2 -0
  38. package/dist/commands/register.d.ts.map +1 -0
  39. package/dist/commands/register.js +105 -0
  40. package/dist/commands/register.js.map +1 -0
  41. package/dist/commands/status.d.ts +2 -0
  42. package/dist/commands/status.d.ts.map +1 -0
  43. package/dist/commands/status.js +165 -0
  44. package/dist/commands/status.js.map +1 -0
  45. package/dist/commands/whoami.d.ts +2 -0
  46. package/dist/commands/whoami.d.ts.map +1 -0
  47. package/dist/commands/whoami.js +87 -0
  48. package/dist/commands/whoami.js.map +1 -0
  49. package/dist/index.d.ts +3 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +83 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/lib/api.d.ts +75 -0
  54. package/dist/lib/api.d.ts.map +1 -0
  55. package/dist/lib/api.js +133 -0
  56. package/dist/lib/api.js.map +1 -0
  57. package/dist/lib/compiler.d.ts +42 -0
  58. package/dist/lib/compiler.d.ts.map +1 -0
  59. package/dist/lib/compiler.js +179 -0
  60. package/dist/lib/compiler.js.map +1 -0
  61. package/dist/lib/config.d.ts +25 -0
  62. package/dist/lib/config.d.ts.map +1 -0
  63. package/dist/lib/config.js +102 -0
  64. package/dist/lib/config.js.map +1 -0
  65. package/package.json +49 -0
@@ -0,0 +1,25 @@
1
+ export interface GlobalConfig {
2
+ token?: string;
3
+ username?: string;
4
+ email?: string;
5
+ apiUrl?: string;
6
+ }
7
+ export interface LocalConfig {
8
+ version: number;
9
+ sources: Array<{
10
+ type: string;
11
+ url: string;
12
+ addedAt: string;
13
+ }>;
14
+ lastPublished?: string;
15
+ }
16
+ export declare function getGlobalConfigDir(): string;
17
+ export declare function getGlobalConfigPath(): string;
18
+ export declare function getLocalBundleDir(): string;
19
+ export declare function readGlobalConfig(): GlobalConfig;
20
+ export declare function writeGlobalConfig(config: GlobalConfig): void;
21
+ export declare function readLocalConfig(): LocalConfig | null;
22
+ export declare function writeLocalConfig(config: LocalConfig): void;
23
+ export declare function localBundleExists(): boolean;
24
+ export declare function isAuthenticated(): boolean;
25
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,gBAAgB,IAAI,YAAY,CAU/C;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAK5D;AAED,wBAAgB,eAAe,IAAI,WAAW,GAAG,IAAI,CAWpD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAG1D;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,wBAAgB,eAAe,IAAI,OAAO,CAGzC"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getGlobalConfigDir = getGlobalConfigDir;
37
+ exports.getGlobalConfigPath = getGlobalConfigPath;
38
+ exports.getLocalBundleDir = getLocalBundleDir;
39
+ exports.readGlobalConfig = readGlobalConfig;
40
+ exports.writeGlobalConfig = writeGlobalConfig;
41
+ exports.readLocalConfig = readLocalConfig;
42
+ exports.writeLocalConfig = writeLocalConfig;
43
+ exports.localBundleExists = localBundleExists;
44
+ exports.isAuthenticated = isAuthenticated;
45
+ const fs = __importStar(require("fs"));
46
+ const path = __importStar(require("path"));
47
+ const os = __importStar(require("os"));
48
+ const GLOBAL_CONFIG_DIR = path.join(os.homedir(), ".youmd");
49
+ const GLOBAL_CONFIG_FILE = path.join(GLOBAL_CONFIG_DIR, "config.json");
50
+ const LOCAL_BUNDLE_DIR = ".youmd";
51
+ function getGlobalConfigDir() {
52
+ return GLOBAL_CONFIG_DIR;
53
+ }
54
+ function getGlobalConfigPath() {
55
+ return GLOBAL_CONFIG_FILE;
56
+ }
57
+ function getLocalBundleDir() {
58
+ return path.resolve(process.cwd(), LOCAL_BUNDLE_DIR);
59
+ }
60
+ function readGlobalConfig() {
61
+ if (!fs.existsSync(GLOBAL_CONFIG_FILE)) {
62
+ return {};
63
+ }
64
+ try {
65
+ const raw = fs.readFileSync(GLOBAL_CONFIG_FILE, "utf-8");
66
+ return JSON.parse(raw);
67
+ }
68
+ catch {
69
+ return {};
70
+ }
71
+ }
72
+ function writeGlobalConfig(config) {
73
+ if (!fs.existsSync(GLOBAL_CONFIG_DIR)) {
74
+ fs.mkdirSync(GLOBAL_CONFIG_DIR, { recursive: true });
75
+ }
76
+ fs.writeFileSync(GLOBAL_CONFIG_FILE, JSON.stringify(config, null, 2) + "\n");
77
+ }
78
+ function readLocalConfig() {
79
+ const configPath = path.join(getLocalBundleDir(), "config.json");
80
+ if (!fs.existsSync(configPath)) {
81
+ return null;
82
+ }
83
+ try {
84
+ const raw = fs.readFileSync(configPath, "utf-8");
85
+ return JSON.parse(raw);
86
+ }
87
+ catch {
88
+ return null;
89
+ }
90
+ }
91
+ function writeLocalConfig(config) {
92
+ const configPath = path.join(getLocalBundleDir(), "config.json");
93
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
94
+ }
95
+ function localBundleExists() {
96
+ return fs.existsSync(getLocalBundleDir());
97
+ }
98
+ function isAuthenticated() {
99
+ const config = readGlobalConfig();
100
+ return !!config.token;
101
+ }
102
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,gDAEC;AAED,kDAEC;AAED,8CAEC;AAED,4CAUC;AAED,8CAKC;AAED,0CAWC;AAED,4CAGC;AAED,8CAEC;AAED,0CAGC;AA7ED,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC5D,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,iBAA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,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAgB,gBAAgB,CAAC,MAAmB;IAClD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,aAAa,CAAC,CAAC;IACjE,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACvE,CAAC;AAED,SAAgB,iBAAiB;IAC/B,OAAO,EAAE,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,SAAgB,eAAe;IAC7B,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;AACxB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "youmd",
3
+ "version": "0.1.0",
4
+ "description": "Your identity file for the agent internet. CLI for the You.md platform.",
5
+ "bin": {
6
+ "youmd": "./dist/index.js"
7
+ },
8
+ "main": "dist/index.js",
9
+ "files": [
10
+ "dist/**/*"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc",
14
+ "dev": "ts-node src/index.ts",
15
+ "start": "node dist/index.js",
16
+ "prepublishOnly": "npm run build"
17
+ },
18
+ "keywords": [
19
+ "identity",
20
+ "ai",
21
+ "agent",
22
+ "llm",
23
+ "markdown",
24
+ "cli",
25
+ "profile",
26
+ "you-md"
27
+ ],
28
+ "author": "Houston Golden",
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/houstongolden/youmd.git",
33
+ "directory": "cli"
34
+ },
35
+ "homepage": "https://you.md",
36
+ "dependencies": {
37
+ "chalk": "^4.1.2",
38
+ "commander": "^12.1.0",
39
+ "gray-matter": "^4.0.3"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^20.14.0",
43
+ "ts-node": "^10.9.2",
44
+ "typescript": "^5.5.0"
45
+ },
46
+ "engines": {
47
+ "node": ">=18"
48
+ }
49
+ }