oneie 3.4.1 → 3.5.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.
@@ -19,7 +19,13 @@
19
19
 
20
20
  **Control Your AI. Build Anything.**
21
21
 
22
- Server: http://localhost:4321
22
+ Server Started at http://localhost:4321
23
+
24
+ [If account owner found from .oneie/installation.json, display:]
25
+ Account: [owner name]
26
+
27
+ [If organization found from .oneie/installation.json, display:]
28
+ Organization: [org name] - [org url]
23
29
 
24
30
  Type:
25
31
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -39,15 +45,40 @@ or type anything...
39
45
 
40
46
  You are ONE, an AI Agent helping users build apps, websites, and agent teams.
41
47
 
42
- **CRITICAL - Server Check:** Before displaying anything, check if the dev server is running:
43
-
44
- 1. Use Bash to check: `lsof -ti:4321 2>/dev/null || echo ""`
45
- 2. If empty output (server not running):
46
- - Output to user: "🚀 Starting dev server..."
47
- - Start server in background: `cd /Users/toc/Server/ONE/web && bun run dev`
48
- - DO NOT show bash output or errors
49
- - DO NOT show "sleep" or "wait" commands
50
- 3. Then display the logo and menu (server URL will show http://localhost:4321)
48
+ **CRITICAL - Initialization Checks:** Before displaying anything, run these checks in order:
49
+
50
+ 1. **Git Repository Check:**
51
+ - Use Bash: `[ -d .git ] && echo "exists" || echo ""`
52
+ - If empty output (no .git):
53
+ - Output to user: "📦 Initializing git repository..."
54
+ - Run: `git init`
55
+ - Run: `git add .`
56
+ - Run: `git commit -m "chore: initialize ONE Platform repository"`
57
+ - Output: "✓ Git repository initialized"
58
+ - DO NOT show bash output or errors
59
+
60
+ 2. **Account Owner Check:**
61
+ - Check for CLI installation metadata: `[ -f .oneie/installation.json ] && cat .oneie/installation.json || echo "{}"`
62
+ - Extract owner info from installation.json (if exists)
63
+ - Store owner name for display
64
+
65
+ 3. **Organization Check:**
66
+ - Check for organization metadata in installation.json
67
+ - Extract org name and URL (if exists)
68
+ - Store org info for display
69
+
70
+ 4. **Dev Server Check:**
71
+ - Use Bash: `lsof -ti:4321 2>/dev/null || echo ""`
72
+ - If empty output (server not running):
73
+ - Output to user: "🚀 Starting dev server..."
74
+ - Start server in background: `cd /Users/toc/Server/ONE/web && bun run dev`
75
+ - DO NOT show bash output or errors
76
+
77
+ 5. **Then display the welcome screen with:**
78
+ - Logo and menu
79
+ - Account owner (if found): "Account: [owner name]"
80
+ - Organization (if found): "Organization: [org name] - [org url]"
81
+ - Server URL: http://localhost:4321
51
82
 
52
83
  **CRITICAL:** Always display the logo and menu above (between "DISPLAY THIS TO USER" markers) FIRST before any other response.
53
84
 
package/folders.yaml CHANGED
@@ -87,6 +87,6 @@ exclude_patterns:
87
87
  deployment:
88
88
  github_repo: one-ie/one
89
89
  npm_package: oneie
90
- version: 3.4.1
90
+ version: 3.5.0
91
91
  homepage: https://one.ie
92
92
  license_url: https://one.ie/free-license
@@ -0,0 +1,8 @@
1
+ {
2
+ "pdfExportSettings": {
3
+ "pageSize": "Letter",
4
+ "landscape": false,
5
+ "margin": "0",
6
+ "downscalePercent": 100
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,3 @@
1
+ [
2
+ "easy-bake"
3
+ ]
@@ -0,0 +1,361 @@
1
+ /*
2
+ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
3
+ if you want to view the source, please visit the github repository of this plugin
4
+ */
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+
24
+ // src/main.ts
25
+ var main_exports = {};
26
+ __export(main_exports, {
27
+ default: () => EasyBake
28
+ });
29
+ module.exports = __toCommonJS(main_exports);
30
+ var import_obsidian4 = require("obsidian");
31
+
32
+ // src/BakeModal.ts
33
+ var import_obsidian2 = require("obsidian");
34
+
35
+ // src/bake.ts
36
+ var import_obsidian = require("obsidian");
37
+
38
+ // src/util.ts
39
+ var wordCountRE = /\P{Z}*[\p{L}\p{N}]\P{Z}*/gu;
40
+ var commentRE = /(?:<!--[\s\S]*?-->|%%[\s\S]*?(?!%%)[\s\S]+?%%)/g;
41
+ function stripComments(text) {
42
+ return text.replace(commentRE, "");
43
+ }
44
+ function getWordCount(text) {
45
+ return (stripComments(text).match(wordCountRE) || []).length;
46
+ }
47
+ function dedent(text) {
48
+ const firstIndent = text.match(/^([ \t]*)/);
49
+ if (firstIndent) {
50
+ return text.replace(
51
+ // Escape tab chars
52
+ new RegExp(`^${firstIndent[0].replace(/\\/g, "\\$&")}`, "gm"),
53
+ ""
54
+ );
55
+ }
56
+ return text;
57
+ }
58
+ function applyIndent(text, indent) {
59
+ if (!indent)
60
+ return text;
61
+ return text.trim().replace(/(\r?\n)/g, `$1${indent}`);
62
+ }
63
+ function stripFirstBullet(text) {
64
+ if (!text)
65
+ return text;
66
+ return text.replace(/^[ \t]*(?:[-*+]|[0-9]+[.)]) +/, "");
67
+ }
68
+ function stripBlockId(text) {
69
+ if (!text)
70
+ return text;
71
+ return text.replace(/ +\^[^ \n\r]+$/gm, "");
72
+ }
73
+ function stripFrontmatter(text) {
74
+ if (!text)
75
+ return text;
76
+ return text.replace(/^---[\s\S]+?\r?\n---(?:\r?\n\s*|$)/, "");
77
+ }
78
+ function sanitizeBakedContent(text) {
79
+ return stripBlockId(stripFrontmatter(text));
80
+ }
81
+ function extractSubpath(content, subpathResult, cache) {
82
+ let text = content;
83
+ if (subpathResult.type === "block" && subpathResult.list && cache.listItems) {
84
+ const targetItem = subpathResult.list;
85
+ const ancestors = /* @__PURE__ */ new Set([targetItem.position.start.line]);
86
+ const start = targetItem.position.start.offset - targetItem.position.start.col;
87
+ let end = targetItem.position.end.offset;
88
+ let found = false;
89
+ for (const item of cache.listItems) {
90
+ if (targetItem === item) {
91
+ found = true;
92
+ continue;
93
+ } else if (!found) {
94
+ continue;
95
+ }
96
+ if (!ancestors.has(item.parent))
97
+ break;
98
+ ancestors.add(item.position.start.line);
99
+ end = item.position.end.offset;
100
+ }
101
+ text = stripBlockId(dedent(content.substring(start, end)));
102
+ } else {
103
+ const start = subpathResult.start.offset;
104
+ const end = subpathResult.end ? subpathResult.end.offset : content.length;
105
+ text = stripBlockId(content.substring(start, end));
106
+ }
107
+ return text;
108
+ }
109
+
110
+ // src/bake.ts
111
+ var lineStartRE = /(?:^|\n) *$/;
112
+ var listLineStartRE = /(?:^|\n)([ \t]*)(?:[-*+]|[0-9]+[.)]) +$/;
113
+ var lineEndRE = /^ *(?:\r?\n|$)/;
114
+ async function bake(app, file, subpath, ancestors, settings) {
115
+ const { vault, metadataCache } = app;
116
+ let text = await vault.cachedRead(file);
117
+ const cache = metadataCache.getFileCache(file);
118
+ if (!cache)
119
+ return text;
120
+ const resolvedSubpath = subpath ? (0, import_obsidian.resolveSubpath)(cache, subpath) : null;
121
+ if (resolvedSubpath) {
122
+ text = extractSubpath(text, resolvedSubpath, cache);
123
+ }
124
+ const links = settings.bakeLinks ? cache.links || [] : [];
125
+ const embeds = settings.bakeEmbeds ? cache.embeds || [] : [];
126
+ const targets = [...links, ...embeds];
127
+ if (targets.length === 0)
128
+ return text;
129
+ targets.sort((a, b) => a.position.start.offset - b.position.start.offset);
130
+ const newAncestors = new Set(ancestors);
131
+ newAncestors.add(file);
132
+ let posOffset = 0;
133
+ for (const target of targets) {
134
+ const { path, subpath: subpath2 } = (0, import_obsidian.parseLinktext)(target.link);
135
+ const linkedFile = metadataCache.getFirstLinkpathDest(path, file.path);
136
+ if (!linkedFile)
137
+ continue;
138
+ const start = target.position.start.offset + posOffset;
139
+ const end = target.position.end.offset + posOffset;
140
+ const prevLen = end - start;
141
+ const before = text.substring(0, start);
142
+ const after = text.substring(end);
143
+ const listMatch = settings.bakeInList ? before.match(listLineStartRE) : null;
144
+ const isInline = !(listMatch || lineStartRE.test(before)) || !lineEndRE.test(after);
145
+ const isMarkdownFile = linkedFile.extension === "md";
146
+ const replaceTarget = (replacement) => {
147
+ text = before + replacement + after;
148
+ posOffset += replacement.length - prevLen;
149
+ };
150
+ if (!isMarkdownFile) {
151
+ if (!settings.convertFileLinks)
152
+ continue;
153
+ const adapter = app.vault.adapter;
154
+ if (!adapter.getFullPath)
155
+ continue;
156
+ const fullPath = adapter.getFullPath(linkedFile.path);
157
+ const protocol = import_obsidian.Platform.isWin ? "file:///" : "file://";
158
+ replaceTarget(`![](${protocol}${encodeURI(fullPath)})`);
159
+ continue;
160
+ }
161
+ if (newAncestors.has(linkedFile) || isInline) {
162
+ replaceTarget(target.displayText || path);
163
+ continue;
164
+ }
165
+ const baked = sanitizeBakedContent(
166
+ await bake(app, linkedFile, subpath2, newAncestors, settings)
167
+ );
168
+ replaceTarget(
169
+ listMatch ? applyIndent(stripFirstBullet(baked), listMatch[1]) : baked
170
+ );
171
+ }
172
+ return text;
173
+ }
174
+
175
+ // src/BakeModal.ts
176
+ function disableBtn(btn) {
177
+ btn.removeClass("mod-cta");
178
+ btn.addClass("mod-muted");
179
+ btn.setAttrs({
180
+ disabled: "true",
181
+ "aria-disabled": "true"
182
+ });
183
+ }
184
+ function enableBtn(btn) {
185
+ btn.removeClass("mod-muted");
186
+ btn.addClass("mod-cta");
187
+ btn.setAttrs({
188
+ disabled: "false",
189
+ "aria-disabled": "false"
190
+ });
191
+ }
192
+ var BakeModal = class extends import_obsidian2.Modal {
193
+ constructor(plugin, file) {
194
+ super(plugin.app);
195
+ const { contentEl } = this;
196
+ const { settings } = plugin;
197
+ this.titleEl.setText("Bake file");
198
+ this.modalEl.addClass("mod-narrow", "easy-bake-modal");
199
+ this.contentEl.createEl("p", { text: "Input file: " }).createEl("strong", { text: file.path });
200
+ new import_obsidian2.Setting(contentEl).setName("Bake embedded markdown").setDesc(
201
+ "Include the content of ![[embedded markdown files]] when the link is on its own line."
202
+ ).addToggle(
203
+ (toggle) => toggle.setValue(settings.bakeEmbeds).onChange((value) => {
204
+ settings.bakeEmbeds = value;
205
+ plugin.saveSettings();
206
+ })
207
+ );
208
+ new import_obsidian2.Setting(contentEl).setName("Bake links").setDesc(
209
+ "Include the content of [[any link]] when it is on its own line."
210
+ ).addToggle(
211
+ (toggle) => toggle.setValue(settings.bakeLinks).onChange((value) => {
212
+ settings.bakeLinks = value;
213
+ plugin.saveSettings();
214
+ })
215
+ );
216
+ new import_obsidian2.Setting(contentEl).setName("Bake links and embeds in lists").setDesc(
217
+ "Include the content of [[any link]] or ![[embedded markdown file]] when it takes up an entire list bullet."
218
+ ).addToggle(
219
+ (toggle) => toggle.setValue(settings.bakeInList).onChange((value) => {
220
+ settings.bakeInList = value;
221
+ plugin.saveSettings();
222
+ })
223
+ );
224
+ new import_obsidian2.Setting(contentEl).setName("Bake file links").setDesc(
225
+ "Convert links to ![[non-markdown files.png]] to ![](file:///full/path/to/non-markdown%20files.png)"
226
+ ).addToggle(
227
+ (toggle) => toggle.setValue(settings.convertFileLinks).onChange((value) => {
228
+ settings.convertFileLinks = value;
229
+ plugin.saveSettings();
230
+ })
231
+ );
232
+ new import_obsidian2.Setting(contentEl).setName("Output file name").then((setting) => {
233
+ new import_obsidian2.Setting(contentEl).then((setting2) => {
234
+ setting2.addButton(
235
+ (btn) => btn.setButtonText("Calculate word count").onClick(async () => {
236
+ const baked = await bake(this.app, file, null, /* @__PURE__ */ new Set(), settings);
237
+ setting2.descEl.setText(getWordCount(baked).toString());
238
+ })
239
+ );
240
+ });
241
+ this.modalEl.createDiv("modal-button-container", (el) => {
242
+ var _a;
243
+ let outputName = file.basename + ".baked";
244
+ let outputFolder = ((_a = file.parent) == null ? void 0 : _a.path) || "";
245
+ if (outputFolder)
246
+ outputFolder += "/";
247
+ const btn = el.createEl("button", {
248
+ cls: "mod-cta",
249
+ text: "Bake"
250
+ });
251
+ activeWindow.setTimeout(() => {
252
+ btn.focus();
253
+ });
254
+ btn.addEventListener("click", async () => {
255
+ disableBtn(btn);
256
+ if (outputName) {
257
+ const { vault } = this.app;
258
+ const baked = await bake(this.app, file, null, /* @__PURE__ */ new Set(), settings);
259
+ const nextPath = outputFolder + outputName + ".md";
260
+ let existing = vault.getAbstractFileByPath(nextPath);
261
+ if (existing instanceof import_obsidian2.TFile) {
262
+ await vault.modify(existing, baked);
263
+ } else {
264
+ existing = await vault.create(nextPath, baked);
265
+ }
266
+ if (existing instanceof import_obsidian2.TFile) {
267
+ this.app.workspace.getLeaf("tab").openFile(existing);
268
+ }
269
+ }
270
+ this.close();
271
+ });
272
+ setting.addText(
273
+ (text) => text.setValue(outputName).onChange((value) => {
274
+ outputName = value;
275
+ if (!value) {
276
+ disableBtn(btn);
277
+ } else if (btn.disabled) {
278
+ enableBtn(btn);
279
+ }
280
+ })
281
+ );
282
+ });
283
+ });
284
+ }
285
+ };
286
+
287
+ // src/api.ts
288
+ var import_obsidian3 = require("obsidian");
289
+ var EasyBakeApi = class {
290
+ constructor(plugin) {
291
+ this.plugin = plugin;
292
+ }
293
+ async bakeToString(inputPath, settings) {
294
+ const app = this.plugin.app;
295
+ const file = app.vault.getAbstractFileByPath(inputPath);
296
+ if (!(file instanceof import_obsidian3.TFile)) {
297
+ console.error("Input file does not exist");
298
+ return;
299
+ }
300
+ return await bake(app, file, null, /* @__PURE__ */ new Set(), settings);
301
+ }
302
+ async bakeToFile(inputPath, outputPath, settings) {
303
+ const baked = await this.bakeToString(inputPath, settings);
304
+ if (!baked)
305
+ return;
306
+ const app = this.plugin.app;
307
+ let existing = app.vault.getAbstractFileByPath(outputPath);
308
+ if (existing instanceof import_obsidian3.TFile) {
309
+ await app.vault.modify(existing, baked);
310
+ } else {
311
+ existing = await app.vault.create(outputPath, baked);
312
+ }
313
+ }
314
+ async bakeAndOpen(inputPath, outputPath, settings) {
315
+ await this.bakeToFile(inputPath, outputPath, settings);
316
+ const app = this.plugin.app;
317
+ const existing = app.vault.getAbstractFileByPath(outputPath);
318
+ if (existing instanceof import_obsidian3.TFile) {
319
+ await app.workspace.getLeaf("tab").openFile(existing);
320
+ }
321
+ }
322
+ };
323
+
324
+ // src/main.ts
325
+ var DEFAULT_SETTINGS = {
326
+ bakeLinks: true,
327
+ bakeEmbeds: true,
328
+ bakeInList: true,
329
+ convertFileLinks: true
330
+ };
331
+ var EasyBake = class extends import_obsidian4.Plugin {
332
+ constructor() {
333
+ super(...arguments);
334
+ this.api = new EasyBakeApi(this);
335
+ }
336
+ async loadSettings() {
337
+ this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
338
+ }
339
+ async saveSettings() {
340
+ await this.saveData(this.settings);
341
+ }
342
+ get activeMarkdownFile() {
343
+ var _a;
344
+ return (_a = this.app.workspace.activeEditor) == null ? void 0 : _a.file;
345
+ }
346
+ async onload() {
347
+ await this.loadSettings();
348
+ this.addCommand({
349
+ id: "bake-file",
350
+ name: "Bake current file",
351
+ checkCallback: (checking) => {
352
+ const file = this.activeMarkdownFile;
353
+ if (checking || !file)
354
+ return !!file;
355
+ new BakeModal(this, file).open();
356
+ }
357
+ });
358
+ }
359
+ };
360
+
361
+ /* nosourcemap */
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "easy-bake",
3
+ "name": "Easy Bake",
4
+ "version": "1.1.0",
5
+ "minAppVersion": "0.15.0",
6
+ "description": "Easily compile many Obsidian notes down to a single file.",
7
+ "author": "mgmeyers",
8
+ "authorUrl": "https://github.com/mgmeyers",
9
+ "fundingUrl": "https://www.buymeacoffee.com/mgme",
10
+ "isDesktopOnly": false
11
+ }
@@ -0,0 +1,10 @@
1
+ body:not(.is-mobile) .easy-bake-modal .modal {
2
+ overflow: hidden;
3
+ }
4
+
5
+ body:not(.is-mobile) .easy-bake-modal .modal-content {
6
+ overflow: auto;
7
+ height: 100%;
8
+ flex-grow: 0;
9
+ flex-shrink: 1;
10
+ }