yamlite 0.36.0 → 0.38.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/README.md +19 -1
- package/dist/browser/sqlite.d.mts +1 -1
- package/dist/browser/sqlite.mjs +7 -3
- package/dist/cli.mjs +2 -2
- package/dist/core.d.mts +13 -1
- package/dist/core.mjs +3 -3
- package/dist/guide.md +2 -0
- package/dist/{index-BBHZ8yok.d.mts → index-OSyELQEX.d.mts} +6 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-O1FTGCot.mjs → src-DdRmp-vT.mjs} +489 -206
- package/dist/ui/assets/{ErdView-BFNQ9J0L.js → ErdView-Cv4lBB9J.js} +1 -1
- package/dist/ui/assets/{MarkdownField-DctsImcK.js → MarkdownField-UKgTcG0X.js} +1 -1
- package/dist/ui/assets/{PageView-ApxooX20.js → PageView-SFpedZG6.js} +1 -1
- package/dist/ui/assets/index-BnlDexUD.js +125 -0
- package/dist/ui/assets/index-BwkTtzmh.css +2 -0
- package/dist/ui/assets/{load-C74BIjnc.js → load-S46Mj3YT.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/ui-embed/{PageView-Cpq5JtTW.js → PageView-BzCYlXPg.js} +1 -1
- package/dist/ui-embed/embed.js +5491 -5347
- package/dist/ui-embed/{pageFrame-Dm62WvvT.js → pageFrame-CFoU6UjD.js} +850 -817
- package/dist/ui-embed/style.css +1 -1
- package/dist/{workspace-1vCIMAfl.mjs → workspace-B4WnIeHR.mjs} +24 -10
- package/package.json +1 -1
- package/dist/ui/assets/index-BIkG4xcY.css +0 -2
- package/dist/ui/assets/index-ryUZiqoX.js +0 -125
package/README.md
CHANGED
|
@@ -200,7 +200,8 @@ The UI is available in English and Japanese. It follows your browser language on
|
|
|
200
200
|
When the data folder is in a git repository with an `origin` remote, the bottom of the sidebar shows the current branch and how many files under the data folder changed. **Send for review** lists the changed files by table and record, asks for a title and an optional description, and sends the files you keep checked:
|
|
201
201
|
|
|
202
202
|
- On the default branch, it creates a branch with the name you enter, or `yamlite/review-<date>-<time>` when you leave it blank, commits the files there, pushes it and opens a draft pull request. The UI stays on the new branch, so later edits go to the same pull request.
|
|
203
|
-
- On any other branch, it commits and pushes to that branch. If the branch already has an open pull request,
|
|
203
|
+
- On any other branch, it commits and pushes to that branch. If the branch already has an open pull request (`gh` tells), the dialog links to it and asks only for a commit message; otherwise it opens a draft pull request.
|
|
204
|
+
- With [Ask AI](#ask-ai) set up, **Write with AI** drafts the title and description (or the commit message) from the records and files you keep checked, in the UI's language. A new pull request's description follows the repository's `pull_request_template.md` (in `.github/`, the root or `docs/`, as GitHub looks for it; a `PULL_REQUEST_TEMPLATE/` folder of several is not used), and then the [AI instructions](#ai-instructions). You can edit the draft before sending.
|
|
204
205
|
- With [`gh`](https://cli.github.com) installed and logged in, the pull request is created for you. Without it, you get a GitHub link that opens the pull request form already filled in. For other hosts the branch is pushed and you open the pull request there.
|
|
205
206
|
- Only files under the data folder are committed. Git runs without prompts, so pushing needs credentials that already work without asking.
|
|
206
207
|
- Each record is listed under its file, with the fields it changed; the arrow shows them as committed and now. ↶ puts a changed or deleted record back as committed, and the bin removes a record that was never committed, after a second click. These go through the same writes as the form, so comments and the safety checks apply. **Put back** does it for the changed and deleted records of the checked files. The toast that follows can undo it. `yamlite.yaml`, pages and other files are listed but never changed.
|
|
@@ -225,6 +226,23 @@ Set `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` before `yamlite serve`, or enter a k
|
|
|
225
226
|
- If [GitHub CLI](https://cli.github.com) is installed and logged in, the pull request is created for you and linked in the chat. Without it, the card links to GitHub's pull request form with the title and body filled in.
|
|
226
227
|
- Switching branches changes the YAML files, and the database follows them, like an edit in your editor, even when many records disappear. If a declared table's folder doesn't exist on the target branch, the switch still happens but the database sync fails, and the card says so.
|
|
227
228
|
|
|
229
|
+
#### AI instructions
|
|
230
|
+
|
|
231
|
+
`ai:` in `yamlite.yaml` tells the AI features what everyone working in the folder wants: the language to write in, what the data's values mean, how pull requests are written. Edit it in the file, or with the scroll button in the Ask AI panel or **Edit instructions** under **Write with AI**; a save there changes only these keys and leaves `yamlite.yaml` as a change to send like any other.
|
|
232
|
+
|
|
233
|
+
```yaml
|
|
234
|
+
ai:
|
|
235
|
+
# Ask AI and pull request drafts
|
|
236
|
+
instructions: |
|
|
237
|
+
Write in English.
|
|
238
|
+
In tasks, status todo means not started.
|
|
239
|
+
# pull request drafts only, after instructions
|
|
240
|
+
pullRequests: Start titles with a verb. Say why in the description.
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
- Each is text of at most 4,000 characters; an empty one counts as none. They come after YAMLite's own prompt and win where they differ, `pullRequests` last. Pages' AI does not get them: a page sends its own prompt.
|
|
244
|
+
- They are read for every answer and draft, so a change applies at once.
|
|
245
|
+
|
|
228
246
|
## Pages
|
|
229
247
|
|
|
230
248
|
Add your own screens — a kanban board, a dashboard — to `serve`. A page is one HTML file that reads and writes your data through `window.yamlite`, limited to what `yamlite.yaml` allows it.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/browser/sqlite.d.ts
|
|
2
2
|
export declare const sqlite3: any;
|
|
3
|
-
export declare const opfs: any;
|
|
4
3
|
export declare function registerVfs(name: string): void;
|
|
4
|
+
export declare function installOpfs(name?: string): Promise<any>;
|
|
5
5
|
type Value = null | number | bigint | string | Uint8Array;
|
|
6
6
|
type Row = Record<string, Value>;
|
|
7
7
|
export declare const constants: Record<string, number>;
|
package/dist/browser/sqlite.mjs
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import sqlite3InitModule from "@sqlite.org/sqlite-wasm";
|
|
2
2
|
//#region src/browser/sqlite.ts
|
|
3
3
|
const sqlite3 = await sqlite3InitModule();
|
|
4
|
-
|
|
5
|
-
let VFS = opfs?.vfsName;
|
|
4
|
+
let VFS;
|
|
6
5
|
function registerVfs(name) {
|
|
7
6
|
VFS = name;
|
|
8
7
|
}
|
|
8
|
+
async function installOpfs(name = "yamlite") {
|
|
9
|
+
const pool = await sqlite3.installOpfsSAHPoolVfs({ name });
|
|
10
|
+
VFS = pool.vfsName;
|
|
11
|
+
return pool;
|
|
12
|
+
}
|
|
9
13
|
const { capi, oo1 } = sqlite3;
|
|
10
14
|
const constants = Object.fromEntries(Object.entries(capi).filter(([k, v]) => k.startsWith("SQLITE_") && typeof v === "number"));
|
|
11
15
|
var SqliteError = class extends Error {
|
|
@@ -216,4 +220,4 @@ var DatabaseSync = class {
|
|
|
216
220
|
}
|
|
217
221
|
};
|
|
218
222
|
//#endregion
|
|
219
|
-
export { DatabaseSync, StatementSync, constants,
|
|
223
|
+
export { DatabaseSync, StatementSync, constants, installOpfs, registerVfs, sqlite3 };
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { n as guide, r as envKeys, t as createWorkspace } from "./workspace-
|
|
2
|
+
import { F as createHandler, L as isLoopback, R as loopbackHosts, a as query, c as exportSite, i as formatTable, n as formatCsv, o as generateConfig, r as formatJson, s as init, t as open, z as check } from "./src-DdRmp-vT.mjs";
|
|
3
|
+
import { n as guide, r as envKeys, t as createWorkspace } from "./workspace-B4WnIeHR.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { relative, resolve } from "node:path";
|
|
6
6
|
import { homedir } from "node:os";
|
package/dist/core.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as parseConfig, B as HistoryEntry, C as Decision, D as OpenOptions, E as DeclaredTable, F as ColumnType, G as Rec, H as IndexSpec, I as ConflictInfo, J as ViewRecord, K as SchemaChange, L as DbRow, M as Capture, N as Change, O as TableInput, P as ChangeOp, R as DbValue, S as BaseHashes, T as Config, U as PageAccess, V as HistoryPage, W as PageSpec, _ as check, a as formatCsv, b as Watcher, c as query, d as init, f as ExportOptions, g as CheckTable, h as CheckResult, i as QueryResult, j as readsFile, k as TableLocation, l as InitOptions, m as exportSite, n as open, o as formatJson, p as ExportResult, q as TableSpec, r as QueryOptions, s as formatTable, t as Yamlite, u as generateConfig, v as WatchHandlers, w as CONFIG_NAMES, x as TableResult, y as WatchOptions, z as FieldChange } from "./index-
|
|
1
|
+
import { A as parseConfig, B as HistoryEntry, C as Decision, D as OpenOptions, E as DeclaredTable, F as ColumnType, G as Rec, H as IndexSpec, I as ConflictInfo, J as ViewRecord, K as SchemaChange, L as DbRow, M as Capture, N as Change, O as TableInput, P as ChangeOp, R as DbValue, S as BaseHashes, T as Config, U as PageAccess, V as HistoryPage, W as PageSpec, _ as check, a as formatCsv, b as Watcher, c as query, d as init, f as ExportOptions, g as CheckTable, h as CheckResult, i as QueryResult, j as readsFile, k as TableLocation, l as InitOptions, m as exportSite, n as open, o as formatJson, p as ExportResult, q as TableSpec, r as QueryOptions, s as formatTable, t as Yamlite, u as generateConfig, v as WatchHandlers, w as CONFIG_NAMES, x as TableResult, y as WatchOptions, z as FieldChange } from "./index-OSyELQEX.mjs";
|
|
2
2
|
import { DatabaseSync } from "node:sqlite";
|
|
3
3
|
import { LanguageModel, ModelMessage } from "ai";
|
|
4
4
|
//#region src/store.d.ts
|
|
@@ -276,6 +276,8 @@ interface GitDriver {
|
|
|
276
276
|
}, o: {
|
|
277
277
|
afterTreeChange: () => Promise<void>;
|
|
278
278
|
}): Promise<ReviewOutcome>;
|
|
279
|
+
openPr?(): Promise<string | null>;
|
|
280
|
+
pullRequestTemplate?(): Promise<string | null>;
|
|
279
281
|
readonly namesBranch?: boolean;
|
|
280
282
|
readonly defaultBranchFiles?: DefaultBranchFiles;
|
|
281
283
|
readonly steps?: StepRunner;
|
|
@@ -430,6 +432,7 @@ interface HostOptions {
|
|
|
430
432
|
tools: (conversationId: string) => AgentTool[];
|
|
431
433
|
feedback: (conversationId: string) => string[];
|
|
432
434
|
notes?: string[];
|
|
435
|
+
instructions?: () => string | null;
|
|
433
436
|
keys?: Record<string, string>;
|
|
434
437
|
viewerKeys?: boolean;
|
|
435
438
|
models?: Record<string, string[]>;
|
|
@@ -459,6 +462,11 @@ declare class AgentHost {
|
|
|
459
462
|
hasKey: boolean;
|
|
460
463
|
}[];
|
|
461
464
|
start(input: StartInput): Conversation;
|
|
465
|
+
viewerModel(input: StartInput): {
|
|
466
|
+
provider: string;
|
|
467
|
+
model: string;
|
|
468
|
+
languageModel: LanguageModel;
|
|
469
|
+
};
|
|
462
470
|
pageProvider(): {
|
|
463
471
|
provider: string;
|
|
464
472
|
models: string[];
|
|
@@ -469,6 +477,7 @@ declare class AgentHost {
|
|
|
469
477
|
languageModel: LanguageModel;
|
|
470
478
|
};
|
|
471
479
|
pageSlot(): () => void;
|
|
480
|
+
private system;
|
|
472
481
|
private build;
|
|
473
482
|
private listed;
|
|
474
483
|
private modelsOf;
|
|
@@ -529,4 +538,7 @@ interface Workspace {
|
|
|
529
538
|
}
|
|
530
539
|
export declare function createWorkspace(o: WorkspaceOptions): Promise<Workspace>;
|
|
531
540
|
//#endregion
|
|
541
|
+
//#region src/git/pr.d.ts
|
|
542
|
+
export declare function templatePath(paths: readonly string[]): string | null;
|
|
543
|
+
//#endregion
|
|
532
544
|
export { type AiOptions, type ApiContext, CONFIG_NAMES, type Capture, type Change, type ChangeOp, type CheckResult, type CheckTable, type ColumnType, type Config, type ConflictInfo, type Credentials, type Decision, type DeclaredTable, type DefaultBranchFiles, type DiffResult, type ExportOptions, type ExportResult, type Extract, type Extracted, type GitDriver, type GitStatus, type GitStep, type HistoryEntry, type HistoryPage, type HistoryTarget, type IndexSpec, type InitOptions, type OpenOptions, type PageSpec, type QueryOptions, type QueryResult, type Repo, type ReviewOutcome, type ReviewRequest, type RunOptions, type SchemaChange, type StepResult, type StepRunner, type TableInput, type TableLocation, type TableResult, type TableSpec, type WatchHandlers, type WatchOptions, type Watcher, type Workspace, type WorkspaceOptions, Yamlite, check, exportSite, formatCsv, formatJson, formatTable, generateConfig, init, open, parseConfig, query, readsFile };
|
package/dist/core.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createWorkspace } from "./workspace-
|
|
3
|
-
export { CONFIG_NAMES, HttpError, ReviewRefused, check, createWorkspace, describeChange, exportSite, fieldChanges, formatCsv, formatJson, formatTable, generateConfig, init, open, parseConfig, query, readsFile, worthShowing };
|
|
1
|
+
import { B as CONFIG_NAMES, C as describeChange, H as parseConfig, I as HttpError, T as worthShowing, U as readsFile, a as query, c as exportSite, f as ReviewRefused, h as templatePath, i as formatTable, n as formatCsv, o as generateConfig, r as formatJson, s as init, t as open, w as fieldChanges, z as check } from "./src-DdRmp-vT.mjs";
|
|
2
|
+
import { t as createWorkspace } from "./workspace-B4WnIeHR.mjs";
|
|
3
|
+
export { CONFIG_NAMES, HttpError, ReviewRefused, check, createWorkspace, describeChange, exportSite, fieldChanges, formatCsv, formatJson, formatTable, generateConfig, init, open, parseConfig, query, readsFile, templatePath, worthShowing };
|
package/dist/guide.md
CHANGED
|
@@ -169,3 +169,5 @@ Keys of a table under `tables:`. Details: https://github.com/yamlite-hq/yamlite#
|
|
|
169
169
|
| `split` | a column (declared in `columns`, not the key or body) or a field path whose values the sidebar lists under the table |
|
|
170
170
|
|
|
171
171
|
The top-level `pages:` key adds custom pages to the web UI; see the README's Pages section.
|
|
172
|
+
|
|
173
|
+
The top-level `ai:` key holds instructions for the AI features, each text of at most 4,000 characters: `instructions` for Ask AI and pull request drafts, `pullRequests` for pull request drafts only. See the README's AI instructions section.
|
|
@@ -70,6 +70,10 @@ interface TableSpec {
|
|
|
70
70
|
captures: Capture[];
|
|
71
71
|
}
|
|
72
72
|
type PageAccess = "read" | "write";
|
|
73
|
+
interface AiInstructions {
|
|
74
|
+
instructions: string | null;
|
|
75
|
+
pullRequests: string | null;
|
|
76
|
+
}
|
|
73
77
|
interface PageSpec {
|
|
74
78
|
name: string;
|
|
75
79
|
path: string;
|
|
@@ -172,6 +176,7 @@ type DeclaredTable = Omit<TableSpec, "path" | "mode" | "glob" | "captures" | "pe
|
|
|
172
176
|
interface Config {
|
|
173
177
|
tables: DeclaredTable[];
|
|
174
178
|
pages: PageSpec[];
|
|
179
|
+
ai: AiInstructions;
|
|
175
180
|
}
|
|
176
181
|
declare function readsFile(l: TableLocation, file: string): boolean;
|
|
177
182
|
declare function parseConfig(text: string, name?: string): Config;
|
|
@@ -300,6 +305,7 @@ declare function formatCsv(r: QueryResult): string;
|
|
|
300
305
|
interface Yamlite {
|
|
301
306
|
readonly tables: readonly TableSpec[];
|
|
302
307
|
readonly pages: readonly PageSpec[];
|
|
308
|
+
readonly ai: AiInstructions;
|
|
303
309
|
status(opts?: {
|
|
304
310
|
tables?: string[];
|
|
305
311
|
}): Promise<TableResult[]>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as Decision, D as OpenOptions, F as ColumnType, H as IndexSpec, I as ConflictInfo, K as SchemaChange, N as Change, O as TableInput, P as ChangeOp, W as PageSpec, _ as check, a as formatCsv, b as Watcher, c as query, d as init, f as ExportOptions, g as CheckTable, h as CheckResult, i as QueryResult, l as InitOptions, m as exportSite, n as open, o as formatJson, p as ExportResult, q as TableSpec, r as QueryOptions, s as formatTable, t as Yamlite, u as generateConfig, v as WatchHandlers, x as TableResult, y as WatchOptions } from "./index-
|
|
1
|
+
import { C as Decision, D as OpenOptions, F as ColumnType, H as IndexSpec, I as ConflictInfo, K as SchemaChange, N as Change, O as TableInput, P as ChangeOp, W as PageSpec, _ as check, a as formatCsv, b as Watcher, c as query, d as init, f as ExportOptions, g as CheckTable, h as CheckResult, i as QueryResult, l as InitOptions, m as exportSite, n as open, o as formatJson, p as ExportResult, q as TableSpec, r as QueryOptions, s as formatTable, t as Yamlite, u as generateConfig, v as WatchHandlers, x as TableResult, y as WatchOptions } from "./index-OSyELQEX.mjs";
|
|
2
2
|
export { type Change, type ChangeOp, type CheckResult, type CheckTable, type ColumnType, type ConflictInfo, type Decision, type ExportOptions, type ExportResult, type IndexSpec, type InitOptions, type OpenOptions, type PageSpec, type QueryOptions, type QueryResult, type SchemaChange, type TableInput, type TableResult, type TableSpec, type WatchHandlers, type WatchOptions, type Watcher, Yamlite, check, exportSite, formatCsv, formatJson, formatTable, generateConfig, init, open, query };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { z as check, c as exportSite, n as formatCsv, r as formatJson, i as formatTable, o as generateConfig, s as init, t as open, a as query } from "./src-DdRmp-vT.mjs";
|