youmd 0.2.0 → 0.3.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/dist/commands/build.d.ts +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +70 -9
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/chat.d.ts +2 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +598 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +28 -18
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +69 -13
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +10 -3
- package/dist/commands/whoami.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/onboarding.d.ts +75 -0
- package/dist/lib/onboarding.d.ts.map +1 -1
- package/dist/lib/onboarding.js +915 -164
- package/dist/lib/onboarding.js.map +1 -1
- package/package.json +1 -1
package/dist/commands/build.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function buildCommand(): void
|
|
1
|
+
export declare function buildCommand(): Promise<void>;
|
|
2
2
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAOA,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAuFlD"}
|
package/dist/commands/build.js
CHANGED
|
@@ -1,26 +1,70 @@
|
|
|
1
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
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.buildCommand = buildCommand;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
7
42
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
43
|
const config_1 = require("../lib/config");
|
|
9
44
|
const compiler_1 = require("../lib/compiler");
|
|
10
|
-
|
|
45
|
+
const onboarding_1 = require("../lib/onboarding");
|
|
46
|
+
async function buildCommand() {
|
|
11
47
|
if (!(0, config_1.localBundleExists)()) {
|
|
12
48
|
console.log("");
|
|
13
|
-
console.log(chalk_1.default.yellow("no .youmd/ directory found"));
|
|
49
|
+
console.log(chalk_1.default.yellow(" no .youmd/ directory found"));
|
|
14
50
|
console.log("");
|
|
15
|
-
console.log("
|
|
51
|
+
console.log(" run " + chalk_1.default.cyan("youmd init") + " to create one.");
|
|
16
52
|
console.log("");
|
|
17
53
|
return;
|
|
18
54
|
}
|
|
19
55
|
const bundleDir = (0, config_1.getLocalBundleDir)();
|
|
56
|
+
// Detect if this is the first build (no manifest.json yet)
|
|
57
|
+
const isFirstBuild = !fs.existsSync(path.join(bundleDir, "manifest.json"));
|
|
20
58
|
console.log("");
|
|
21
|
-
console.log("you.md -- building identity bundle");
|
|
59
|
+
console.log(" " + chalk_1.default.bold("you.md") + chalk_1.default.dim(" -- building identity bundle"));
|
|
22
60
|
console.log("");
|
|
61
|
+
// Show a thinking phrase while compiling
|
|
62
|
+
const spinner = new onboarding_1.Spinner((0, onboarding_1.randomThinking)());
|
|
63
|
+
spinner.start();
|
|
23
64
|
const result = (0, compiler_1.compileBundle)(bundleDir);
|
|
65
|
+
// Brief pause for the spinner to feel real
|
|
66
|
+
await new Promise((r) => setTimeout(r, 400));
|
|
67
|
+
spinner.stop();
|
|
24
68
|
// Print each file read
|
|
25
69
|
const totalSteps = result.filesRead.length + 3; // +3 for compile, generate, manifest
|
|
26
70
|
let step = 0;
|
|
@@ -28,21 +72,38 @@ function buildCommand() {
|
|
|
28
72
|
step++;
|
|
29
73
|
const prefix = step < totalSteps ? "\u251C\u2500\u2500" : "\u2514\u2500\u2500";
|
|
30
74
|
const dir = entry.type === "profile" ? "profile" : "preferences";
|
|
31
|
-
console.log(
|
|
75
|
+
console.log(` ${prefix} ${chalk_1.default.dim("reading")} ${dir}/${entry.file}`);
|
|
32
76
|
}
|
|
33
77
|
// Compile step
|
|
34
78
|
step++;
|
|
35
|
-
console.log(
|
|
79
|
+
console.log(` ${step < totalSteps ? "\u251C\u2500\u2500" : "\u2514\u2500\u2500"} ${chalk_1.default.dim("compiling")} you.json`);
|
|
36
80
|
// Generate step
|
|
37
81
|
step++;
|
|
38
|
-
console.log(
|
|
82
|
+
console.log(` ${step < totalSteps ? "\u251C\u2500\u2500" : "\u2514\u2500\u2500"} ${chalk_1.default.dim("generating")} you.md`);
|
|
39
83
|
// Write manifest
|
|
40
84
|
step++;
|
|
41
|
-
console.log(
|
|
85
|
+
console.log(` \u2514\u2500\u2500 ${chalk_1.default.dim("writing")} manifest.json`);
|
|
42
86
|
// Write output files
|
|
43
87
|
(0, compiler_1.writeBundle)(bundleDir, result);
|
|
88
|
+
// Calculate summary stats
|
|
89
|
+
const filledSections = result.bundle.profile.filter((s) => s.content.split("\n").filter((l) => l.trim() && !l.startsWith("<!--")).length > 0).length + result.bundle.preferences.filter((s) => s.content.split("\n").filter((l) => l.trim() && !l.startsWith("<!--")).length > 0).length;
|
|
90
|
+
const totalSections = result.bundle.profile.length + result.bundle.preferences.length;
|
|
91
|
+
const youMdPath = path.join(bundleDir, "you.md");
|
|
92
|
+
const contentSize = fs.existsSync(youMdPath) ? fs.statSync(youMdPath).size : 0;
|
|
93
|
+
const sizeLabel = contentSize > 1024
|
|
94
|
+
? (contentSize / 1024).toFixed(1) + " KB"
|
|
95
|
+
: contentSize + " bytes";
|
|
44
96
|
console.log("");
|
|
45
|
-
console.log(chalk_1.default.green("\u2713") +
|
|
97
|
+
console.log(" " + chalk_1.default.green("\u2713") +
|
|
98
|
+
" bundle compiled" +
|
|
99
|
+
chalk_1.default.dim(` (v${result.bundle.version})`));
|
|
100
|
+
console.log(chalk_1.default.dim(` ${filledSections}/${totalSections} sections filled, ${sizeLabel} total`));
|
|
46
101
|
console.log("");
|
|
102
|
+
if (isFirstBuild) {
|
|
103
|
+
const config = (0, config_1.readGlobalConfig)();
|
|
104
|
+
const name = config.username || "friend";
|
|
105
|
+
console.log(" " + chalk_1.default.bold(`welcome to the agent internet, ${name}.`));
|
|
106
|
+
console.log("");
|
|
107
|
+
}
|
|
47
108
|
}
|
|
48
109
|
//# sourceMappingURL=build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,oCAuFC;AA9FD,uCAAyB;AACzB,2CAA6B;AAC7B,kDAA0B;AAC1B,0CAAuF;AACvF,8CAA6D;AAC7D,kDAA4D;AAErD,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,IAAA,0BAAiB,GAAE,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,eAAK,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,iBAAiB,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,IAAA,0BAAiB,GAAE,CAAC;IAEtC,2DAA2D;IAC3D,MAAM,YAAY,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC;IAE3E,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;I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