@dinoxx/dinox-cli 1.0.17 → 1.0.19
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 +72 -34
- package/dist/cli.js +15 -1
- package/dist/commands/auth/index.d.ts +2 -0
- package/dist/commands/auth/index.js +209 -163
- package/dist/commands/boxes/index.d.ts +2 -0
- package/dist/commands/boxes/index.js +119 -75
- package/dist/commands/boxes/repo.d.ts +8 -0
- package/dist/commands/boxes/repo.js +41 -0
- package/dist/commands/config/index.d.ts +2 -0
- package/dist/commands/config/index.js +85 -36
- package/dist/commands/descriptor/register.d.ts +8 -0
- package/dist/commands/descriptor/register.js +113 -0
- package/dist/commands/descriptor/types.d.ts +37 -0
- package/dist/commands/descriptor/types.js +17 -0
- package/dist/commands/graph/index.d.ts +2 -0
- package/dist/commands/graph/index.js +143 -73
- package/dist/commands/info/index.d.ts +2 -0
- package/dist/commands/info/index.js +41 -14
- package/dist/commands/mcp/index.js +11 -10
- package/dist/commands/mcp/server.js +6 -3
- package/dist/commands/mcp/tools.js +30 -104
- package/dist/commands/mcp/types.d.ts +8 -1
- package/dist/commands/meta/index.d.ts +2 -0
- package/dist/commands/meta/index.js +64 -33
- package/dist/commands/meta/repo.d.ts +6 -0
- package/dist/commands/meta/repo.js +6 -0
- package/dist/commands/notes/actions.d.ts +10 -0
- package/dist/commands/notes/actions.js +403 -0
- package/dist/commands/notes/descriptors.d.ts +4 -0
- package/dist/commands/notes/descriptors.js +250 -0
- package/dist/commands/notes/dryRun.d.ts +31 -0
- package/dist/commands/notes/dryRun.js +130 -0
- package/dist/commands/notes/index.d.ts +2 -51
- package/dist/commands/notes/index.js +2 -581
- package/dist/commands/notes/repo.d.ts +9 -0
- package/dist/commands/notes/repo.js +56 -10
- package/dist/commands/notes/runtime.d.ts +28 -0
- package/dist/commands/notes/runtime.js +185 -0
- package/dist/commands/notes/searchOutput.d.ts +10 -2
- package/dist/commands/notes/searchOutput.js +14 -2
- package/dist/commands/notes/searchResponse.d.ts +51 -0
- package/dist/commands/notes/searchResponse.js +56 -0
- package/dist/commands/notes/searchSql.js +2 -0
- package/dist/commands/prompt/index.d.ts +2 -0
- package/dist/commands/prompt/index.js +122 -72
- package/dist/commands/prompt/repo.d.ts +7 -0
- package/dist/commands/prompt/repo.js +46 -0
- package/dist/commands/schema/commandMetadata.d.ts +2 -0
- package/dist/commands/schema/commandMetadata.js +18 -0
- package/dist/commands/schema/globalOptions.d.ts +3 -0
- package/dist/commands/schema/globalOptions.js +3 -0
- package/dist/commands/schema/index.d.ts +4 -0
- package/dist/commands/schema/index.js +109 -0
- package/dist/commands/schema/renderSkills.d.ts +6 -0
- package/dist/commands/schema/renderSkills.js +216 -0
- package/dist/commands/schema/spec.d.ts +6 -0
- package/dist/commands/schema/spec.js +40 -0
- package/dist/commands/schema/types.d.ts +47 -0
- package/dist/commands/schema/types.js +1 -0
- package/dist/commands/storage/index.d.ts +4 -0
- package/dist/commands/storage/index.js +292 -0
- package/dist/commands/storage/repo.d.ts +162 -0
- package/dist/commands/storage/repo.js +751 -0
- package/dist/commands/sync.d.ts +2 -0
- package/dist/commands/sync.js +41 -27
- package/dist/commands/tags/index.d.ts +2 -0
- package/dist/commands/tags/index.js +121 -79
- package/dist/commands/tags/repo.d.ts +7 -0
- package/dist/commands/tags/repo.js +52 -0
- package/dist/commands/todo/dryRun.d.ts +23 -0
- package/dist/commands/todo/dryRun.js +133 -0
- package/dist/commands/todo/index.d.ts +2 -0
- package/dist/commands/todo/index.js +285 -135
- package/dist/commands/todo/repo.d.ts +11 -0
- package/dist/commands/todo/repo.js +37 -9
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.js +35 -13
- package/dist/commands/writeDryRun.d.ts +62 -0
- package/dist/commands/writeDryRun.js +131 -0
- package/dist/constants/links.d.ts +1 -1
- package/dist/constants/links.js +1 -1
- package/dist/daemon/ensure.js +3 -2
- package/dist/daemon/index.js +17 -15
- package/dist/dinox.js +9 -13
- package/dist/powersync/schema/index.d.ts +27 -0
- package/dist/powersync/schema/index.js +2 -0
- package/dist/powersync/schema/note.d.ts +1 -0
- package/dist/powersync/schema/note.js +1 -0
- package/dist/powersync/schema/projects.d.ts +3 -0
- package/dist/powersync/schema/projects.js +3 -0
- package/dist/powersync/schema/storage.d.ts +24 -0
- package/dist/powersync/schema/storage.js +24 -0
- package/dist/skills/check.d.ts +6 -0
- package/dist/skills/check.js +254 -0
- package/dist/utils/bidlinkCanonicalization.d.ts +2 -0
- package/dist/utils/bidlinkCanonicalization.js +161 -0
- package/dist/utils/dryRun.d.ts +13 -0
- package/dist/utils/dryRun.js +69 -0
- package/dist/utils/output.d.ts +19 -0
- package/dist/utils/output.js +155 -1
- package/dist/utils/terminalSanitization.d.ts +2 -0
- package/dist/utils/terminalSanitization.js +33 -0
- package/dist/utils/tiptapMarkdown.d.ts +4 -1
- package/dist/utils/tiptapMarkdown.js +285 -113
- package/dist/utils/tiptapMarkdownSchema.d.ts +37 -0
- package/dist/utils/tiptapMarkdownSchema.js +577 -0
- package/dist/utils/tiptapMarkdownSchemaUtils.d.ts +74 -0
- package/dist/utils/tiptapMarkdownSchemaUtils.js +394 -0
- package/dist/utils/updateNotice.d.ts +7 -0
- package/dist/utils/updateNotice.js +64 -0
- package/package.json +25 -3
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ResolvedDinoxConfig } from '../config/types.js';
|
|
2
|
+
import type { DryRunPreview } from '../utils/dryRun.js';
|
|
3
|
+
export declare function buildTagAddDryRunPreview(args: {
|
|
4
|
+
config: ResolvedDinoxConfig;
|
|
5
|
+
offline: boolean;
|
|
6
|
+
tag: string;
|
|
7
|
+
emoji: string;
|
|
8
|
+
createdPaths: string[];
|
|
9
|
+
restoredPaths: string[];
|
|
10
|
+
}): DryRunPreview;
|
|
11
|
+
export declare function buildBoxAddDryRunPreview(args: {
|
|
12
|
+
config: ResolvedDinoxConfig;
|
|
13
|
+
offline: boolean;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
color: string;
|
|
17
|
+
restored: boolean;
|
|
18
|
+
existingId?: string;
|
|
19
|
+
}): DryRunPreview;
|
|
20
|
+
export declare function buildPromptAddDryRunPreview(args: {
|
|
21
|
+
config: ResolvedDinoxConfig;
|
|
22
|
+
offline: boolean;
|
|
23
|
+
name: string;
|
|
24
|
+
cmd: string;
|
|
25
|
+
restored: boolean;
|
|
26
|
+
existingId?: string;
|
|
27
|
+
}): DryRunPreview;
|
|
28
|
+
export declare function buildStorageUploadDryRunPreview(args: {
|
|
29
|
+
config: ResolvedDinoxConfig;
|
|
30
|
+
offline: boolean;
|
|
31
|
+
filePath: string;
|
|
32
|
+
fileName: string;
|
|
33
|
+
sizeBytes: number;
|
|
34
|
+
category: string;
|
|
35
|
+
storage: {
|
|
36
|
+
id: string;
|
|
37
|
+
aliasName: string;
|
|
38
|
+
provider: string;
|
|
39
|
+
bucket: string;
|
|
40
|
+
endpoint: string;
|
|
41
|
+
isPrivate: boolean;
|
|
42
|
+
};
|
|
43
|
+
storageKey: string;
|
|
44
|
+
storageUrl: string;
|
|
45
|
+
selectionSource: 'storage_id' | 'active' | 'single_available_config';
|
|
46
|
+
}): DryRunPreview;
|
|
47
|
+
export declare function buildStorageTestDryRunPreview(args: {
|
|
48
|
+
config: ResolvedDinoxConfig;
|
|
49
|
+
offline: boolean;
|
|
50
|
+
storage: {
|
|
51
|
+
id: string;
|
|
52
|
+
aliasName: string;
|
|
53
|
+
provider: string;
|
|
54
|
+
bucket: string;
|
|
55
|
+
endpoint: string;
|
|
56
|
+
isPrivate: boolean;
|
|
57
|
+
};
|
|
58
|
+
storageKey: string;
|
|
59
|
+
storageUrl: string;
|
|
60
|
+
sizeBytes: number;
|
|
61
|
+
selectionSource: 'storage_id' | 'active' | 'single_available_config';
|
|
62
|
+
}): DryRunPreview;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
function buildExecutionWarnings(config, offline) {
|
|
2
|
+
const warnings = [];
|
|
3
|
+
if (offline) {
|
|
4
|
+
warnings.push('Execution would run in offline mode and only use the local cache.');
|
|
5
|
+
}
|
|
6
|
+
if (!offline && !config.powersync.uploadBaseUrl) {
|
|
7
|
+
warnings.push('Execution would be local-only because powersync.uploadBaseUrl is unset.');
|
|
8
|
+
}
|
|
9
|
+
return warnings;
|
|
10
|
+
}
|
|
11
|
+
export function buildTagAddDryRunPreview(args) {
|
|
12
|
+
return {
|
|
13
|
+
dry_run: true,
|
|
14
|
+
command: 'dino tag add',
|
|
15
|
+
action: 'add_tag',
|
|
16
|
+
risk: 'write',
|
|
17
|
+
summary: `Create tag "${args.tag}"${args.restoredPaths.length > 0 ? ' by restoring existing path nodes where needed' : ''}.`,
|
|
18
|
+
warnings: buildExecutionWarnings(args.config, args.offline),
|
|
19
|
+
inputs: {
|
|
20
|
+
tag: args.tag,
|
|
21
|
+
...(args.emoji ? { emoji: args.emoji } : {}),
|
|
22
|
+
},
|
|
23
|
+
changes: {
|
|
24
|
+
tag: args.tag,
|
|
25
|
+
created_paths: args.createdPaths,
|
|
26
|
+
restored_paths: args.restoredPaths,
|
|
27
|
+
...(args.emoji ? { emoji: args.emoji } : {}),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function buildBoxAddDryRunPreview(args) {
|
|
32
|
+
return {
|
|
33
|
+
dry_run: true,
|
|
34
|
+
command: 'dino box add',
|
|
35
|
+
action: 'add_box',
|
|
36
|
+
risk: 'write',
|
|
37
|
+
summary: `${args.restored ? 'Restore' : 'Create'} zettel box "${args.name}".`,
|
|
38
|
+
warnings: buildExecutionWarnings(args.config, args.offline),
|
|
39
|
+
inputs: {
|
|
40
|
+
name: args.name,
|
|
41
|
+
...(args.description ? { description: args.description } : {}),
|
|
42
|
+
...(args.color ? { color: args.color } : {}),
|
|
43
|
+
},
|
|
44
|
+
changes: {
|
|
45
|
+
name: args.name,
|
|
46
|
+
description: args.description,
|
|
47
|
+
color: args.color,
|
|
48
|
+
restored: args.restored,
|
|
49
|
+
...(args.existingId ? { existing_id: args.existingId } : {}),
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function buildPromptAddDryRunPreview(args) {
|
|
54
|
+
return {
|
|
55
|
+
dry_run: true,
|
|
56
|
+
command: 'dino prompt add',
|
|
57
|
+
action: 'add_prompt',
|
|
58
|
+
risk: 'write',
|
|
59
|
+
summary: `${args.restored ? 'Restore' : 'Create'} prompt "${args.name}".`,
|
|
60
|
+
warnings: buildExecutionWarnings(args.config, args.offline),
|
|
61
|
+
inputs: {
|
|
62
|
+
name: args.name,
|
|
63
|
+
cmd_chars: args.cmd.length,
|
|
64
|
+
},
|
|
65
|
+
changes: {
|
|
66
|
+
name: args.name,
|
|
67
|
+
cmd_preview: args.cmd.slice(0, 200),
|
|
68
|
+
restored: args.restored,
|
|
69
|
+
...(args.existingId ? { existing_id: args.existingId } : {}),
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export function buildStorageUploadDryRunPreview(args) {
|
|
74
|
+
const warnings = buildExecutionWarnings(args.config, args.offline);
|
|
75
|
+
if (args.storage.isPrivate) {
|
|
76
|
+
warnings.push('The target bucket is private; the final storageUrl may require signed read access.');
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
dry_run: true,
|
|
80
|
+
command: 'dino storage upload',
|
|
81
|
+
action: 'upload_storage_file',
|
|
82
|
+
risk: 'write',
|
|
83
|
+
summary: `Upload "${args.fileName}" to storage "${args.storage.aliasName || args.storage.id}".`,
|
|
84
|
+
warnings,
|
|
85
|
+
inputs: {
|
|
86
|
+
file_path: args.filePath,
|
|
87
|
+
category: args.category,
|
|
88
|
+
size_bytes: args.sizeBytes,
|
|
89
|
+
selection_source: args.selectionSource,
|
|
90
|
+
},
|
|
91
|
+
changes: {
|
|
92
|
+
storage_config_id: args.storage.id,
|
|
93
|
+
storage_alias: args.storage.aliasName,
|
|
94
|
+
provider: args.storage.provider,
|
|
95
|
+
bucket: args.storage.bucket,
|
|
96
|
+
endpoint: args.storage.endpoint,
|
|
97
|
+
object_key: args.storageKey,
|
|
98
|
+
storage_url: args.storageUrl,
|
|
99
|
+
resource_record: true,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export function buildStorageTestDryRunPreview(args) {
|
|
104
|
+
const warnings = buildExecutionWarnings(args.config, args.offline);
|
|
105
|
+
warnings.push('This test upload does not persist a c_resource row, but it does write a tiny object to the target bucket.');
|
|
106
|
+
if (args.storage.isPrivate) {
|
|
107
|
+
warnings.push('The target bucket is private; the reported storageUrl may still require signed read access.');
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
dry_run: true,
|
|
111
|
+
command: 'dino storage test',
|
|
112
|
+
action: 'test_storage_connection',
|
|
113
|
+
risk: 'write',
|
|
114
|
+
summary: `Upload a tiny temporary object to storage "${args.storage.aliasName || args.storage.id}".`,
|
|
115
|
+
warnings,
|
|
116
|
+
inputs: {
|
|
117
|
+
selection_source: args.selectionSource,
|
|
118
|
+
size_bytes: args.sizeBytes,
|
|
119
|
+
},
|
|
120
|
+
changes: {
|
|
121
|
+
storage_config_id: args.storage.id,
|
|
122
|
+
storage_alias: args.storage.aliasName,
|
|
123
|
+
provider: args.storage.provider,
|
|
124
|
+
bucket: args.storage.bucket,
|
|
125
|
+
endpoint: args.storage.endpoint,
|
|
126
|
+
object_key: args.storageKey,
|
|
127
|
+
storage_url: args.storageUrl,
|
|
128
|
+
resource_record: false,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SKILLS_REPO_URL = "https://github.com/ryzencool/dinox-cli
|
|
1
|
+
export declare const SKILLS_REPO_URL = "https://github.com/ryzencool/dinox-cli/tree/main/skills";
|
package/dist/constants/links.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SKILLS_REPO_URL = 'https://github.com/ryzencool/dinox-cli
|
|
1
|
+
export const SKILLS_REPO_URL = 'https://github.com/ryzencool/dinox-cli/tree/main/skills';
|
package/dist/daemon/ensure.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
2
|
import { isDaemonRunning } from './client.js';
|
|
3
3
|
import { DEFAULT_DAEMON_PORT } from './types.js';
|
|
4
|
+
import { printHumanReadableLine } from '../utils/output.js';
|
|
4
5
|
export async function ensureDaemonRunning() {
|
|
5
6
|
if (await isDaemonRunning()) {
|
|
6
7
|
return;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
+
printHumanReadableLine('Starting daemon...');
|
|
9
10
|
const args = ['daemon', 'start', '--port', String(DEFAULT_DAEMON_PORT), '--no-detach'];
|
|
10
11
|
const child = spawn(process.argv[0], [process.argv[1], ...args], {
|
|
11
12
|
detached: true,
|
|
@@ -15,7 +16,7 @@ export async function ensureDaemonRunning() {
|
|
|
15
16
|
for (let i = 0; i < 10; i++) {
|
|
16
17
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
17
18
|
if (await isDaemonRunning()) {
|
|
18
|
-
|
|
19
|
+
printHumanReadableLine('Daemon started');
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
}
|
package/dist/daemon/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { readPid, isProcessRunning, removePid } from './pid.js';
|
|
|
5
5
|
import { isDaemonRunning } from './client.js';
|
|
6
6
|
import { getPackageVersion } from '../utils/version.js';
|
|
7
7
|
import { DinoxError } from '../utils/errors.js';
|
|
8
|
+
import { printHumanReadableError, printHumanReadableLine } from '../utils/output.js';
|
|
8
9
|
const DAEMON_STOP_POLL_INTERVAL_MS = 100;
|
|
9
10
|
const DAEMON_STOP_TIMEOUT_MS = 5_000;
|
|
10
11
|
function parsePort(value) {
|
|
@@ -36,7 +37,7 @@ async function waitForProcessExit(pid, timeoutMs) {
|
|
|
36
37
|
}
|
|
37
38
|
async function startDaemon(port, detached = true) {
|
|
38
39
|
if (await isDaemonRunning()) {
|
|
39
|
-
|
|
40
|
+
printHumanReadableLine('Daemon is already running');
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
43
|
if (detached) {
|
|
@@ -48,20 +49,21 @@ async function startDaemon(port, detached = true) {
|
|
|
48
49
|
child.unref();
|
|
49
50
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
50
51
|
if (await isDaemonRunning()) {
|
|
51
|
-
|
|
52
|
+
printHumanReadableLine(`Daemon started on port ${port}`);
|
|
52
53
|
}
|
|
53
54
|
else {
|
|
54
|
-
|
|
55
|
+
printHumanReadableError('Failed to start daemon');
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
else {
|
|
58
|
-
|
|
59
|
+
printHumanReadableLine(`Starting daemon on port ${port}...`);
|
|
59
60
|
const server = new DaemonServer();
|
|
60
61
|
await server.initialize();
|
|
61
62
|
await server.start(port);
|
|
62
|
-
|
|
63
|
+
printHumanReadableLine(`Daemon running on port ${port} (PID: ${process.pid})`);
|
|
63
64
|
process.on('SIGINT', async () => {
|
|
64
|
-
|
|
65
|
+
printHumanReadableLine('');
|
|
66
|
+
printHumanReadableLine('Stopping daemon...');
|
|
65
67
|
await server.stop();
|
|
66
68
|
process.exit(0);
|
|
67
69
|
});
|
|
@@ -74,11 +76,11 @@ async function startDaemon(port, detached = true) {
|
|
|
74
76
|
async function stopDaemon() {
|
|
75
77
|
const pidInfo = readPid();
|
|
76
78
|
if (!pidInfo) {
|
|
77
|
-
|
|
79
|
+
printHumanReadableLine('Daemon is not running');
|
|
78
80
|
return;
|
|
79
81
|
}
|
|
80
82
|
if (!isProcessRunning(pidInfo.pid)) {
|
|
81
|
-
|
|
83
|
+
printHumanReadableLine('Daemon is not running (stale PID file)');
|
|
82
84
|
removePid();
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
@@ -93,23 +95,23 @@ async function stopDaemon() {
|
|
|
93
95
|
throw new DinoxError(`Daemon did not stop within ${DAEMON_STOP_TIMEOUT_MS}ms. Try stopping it manually and rerun \`dino daemon status\`.`);
|
|
94
96
|
}
|
|
95
97
|
removePid();
|
|
96
|
-
|
|
98
|
+
printHumanReadableLine('Daemon stopped');
|
|
97
99
|
}
|
|
98
100
|
async function daemonStatus() {
|
|
99
101
|
const pidInfo = readPid();
|
|
100
102
|
if (!pidInfo) {
|
|
101
|
-
|
|
103
|
+
printHumanReadableLine('Status: Not running');
|
|
102
104
|
return;
|
|
103
105
|
}
|
|
104
106
|
const running = await isDaemonRunning();
|
|
105
107
|
if (running) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
printHumanReadableLine('Status: Running');
|
|
109
|
+
printHumanReadableLine(`PID: ${pidInfo.pid}`);
|
|
110
|
+
printHumanReadableLine(`Port: ${pidInfo.port}`);
|
|
111
|
+
printHumanReadableLine(`Version: ${getPackageVersion()}`);
|
|
110
112
|
}
|
|
111
113
|
else {
|
|
112
|
-
|
|
114
|
+
printHumanReadableLine('Status: Not running (stale PID file)');
|
|
113
115
|
removePid();
|
|
114
116
|
}
|
|
115
117
|
}
|
package/dist/dinox.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createCli } from './cli.js';
|
|
3
3
|
import { buildStructuredErrorPayload, isDinoxError } from './utils/errors.js';
|
|
4
|
-
import {
|
|
4
|
+
import { clearRequestedStructuredOutputFormat, parseStructuredOutputFormatFromArgv, printError, printHumanReadableError, setRequestedStructuredOutputFormat, } from './utils/output.js';
|
|
5
5
|
function normalizeArgv(argv) {
|
|
6
6
|
// pnpm/npm script forwarding can prepend a standalone "--".
|
|
7
7
|
if (argv[0] === '--') {
|
|
@@ -15,28 +15,24 @@ async function main() {
|
|
|
15
15
|
const executable = process.argv[1] ?? 'dino';
|
|
16
16
|
await program.parseAsync(['node', executable, ...argv]);
|
|
17
17
|
}
|
|
18
|
-
function shouldOutputJson(argv) {
|
|
19
|
-
return argv.includes('--json');
|
|
20
|
-
}
|
|
21
18
|
function isVerbose(argv) {
|
|
22
19
|
return argv.includes('--verbose');
|
|
23
20
|
}
|
|
24
21
|
main().catch((error) => {
|
|
25
|
-
const argv = process.argv;
|
|
26
|
-
const
|
|
22
|
+
const argv = normalizeArgv(process.argv.slice(2));
|
|
23
|
+
const format = parseStructuredOutputFormatFromArgv(argv);
|
|
27
24
|
const verbose = isVerbose(argv);
|
|
28
25
|
const payload = buildStructuredErrorPayload(error, verbose);
|
|
29
26
|
const exitCode = isDinoxError(error) ? error.exitCode : 1;
|
|
30
27
|
process.exitCode = exitCode;
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
28
|
+
if (format) {
|
|
29
|
+
setRequestedStructuredOutputFormat(format);
|
|
30
|
+
printError(payload, format);
|
|
31
|
+
clearRequestedStructuredOutputFormat();
|
|
36
32
|
return;
|
|
37
33
|
}
|
|
38
|
-
|
|
34
|
+
printHumanReadableError(payload.message);
|
|
39
35
|
if (verbose && payload.stack) {
|
|
40
|
-
|
|
36
|
+
printHumanReadableError(payload.stack);
|
|
41
37
|
}
|
|
42
38
|
});
|
|
@@ -54,6 +54,7 @@ export declare const AppSchema: Schema<{
|
|
|
54
54
|
zettel_boxes: import("@powersync/common").BaseColumnType<string | null>;
|
|
55
55
|
status: import("@powersync/common").BaseColumnType<number | null>;
|
|
56
56
|
comments: import("@powersync/common").BaseColumnType<string | null>;
|
|
57
|
+
is_starred: import("@powersync/common").BaseColumnType<number | null>;
|
|
57
58
|
is_top: import("@powersync/common").BaseColumnType<number | null>;
|
|
58
59
|
pinned_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
59
60
|
chat_context: import("@powersync/common").BaseColumnType<string | null>;
|
|
@@ -319,6 +320,7 @@ export declare const AppSchema: Schema<{
|
|
|
319
320
|
name: import("@powersync/common").BaseColumnType<string | null>;
|
|
320
321
|
mime_type: import("@powersync/common").BaseColumnType<string | null>;
|
|
321
322
|
size_bytes: import("@powersync/common").BaseColumnType<number | null>;
|
|
323
|
+
storage_config_id: import("@powersync/common").BaseColumnType<string | null>;
|
|
322
324
|
storage_key: import("@powersync/common").BaseColumnType<string | null>;
|
|
323
325
|
storage_url: import("@powersync/common").BaseColumnType<string | null>;
|
|
324
326
|
storage_provider: import("@powersync/common").BaseColumnType<string | null>;
|
|
@@ -339,9 +341,34 @@ export declare const AppSchema: Schema<{
|
|
|
339
341
|
domain: import("@powersync/common").BaseColumnType<string | null>;
|
|
340
342
|
extra_data: import("@powersync/common").BaseColumnType<string | null>;
|
|
341
343
|
deleted_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
344
|
+
content_sha256: import("@powersync/common").BaseColumnType<string | null>;
|
|
342
345
|
content: import("@powersync/common").BaseColumnType<string | null>;
|
|
346
|
+
content_md: import("@powersync/common").BaseColumnType<string | null>;
|
|
343
347
|
summary: import("@powersync/common").BaseColumnType<string | null>;
|
|
344
348
|
}>;
|
|
349
|
+
c_storage: import("@powersync/common").Table<{
|
|
350
|
+
id: import("@powersync/common").BaseColumnType<string | null>;
|
|
351
|
+
user_id: import("@powersync/common").BaseColumnType<string | null>;
|
|
352
|
+
alias_name: import("@powersync/common").BaseColumnType<string | null>;
|
|
353
|
+
protocol: import("@powersync/common").BaseColumnType<string | null>;
|
|
354
|
+
provider: import("@powersync/common").BaseColumnType<string | null>;
|
|
355
|
+
is_active: import("@powersync/common").BaseColumnType<number | null>;
|
|
356
|
+
sort_rank: import("@powersync/common").BaseColumnType<number | null>;
|
|
357
|
+
endpoint: import("@powersync/common").BaseColumnType<string | null>;
|
|
358
|
+
bucket: import("@powersync/common").BaseColumnType<string | null>;
|
|
359
|
+
region: import("@powersync/common").BaseColumnType<string | null>;
|
|
360
|
+
access_key_id: import("@powersync/common").BaseColumnType<string | null>;
|
|
361
|
+
secret_access_key: import("@powersync/common").BaseColumnType<string | null>;
|
|
362
|
+
force_path_style: import("@powersync/common").BaseColumnType<number | null>;
|
|
363
|
+
path_prefix: import("@powersync/common").BaseColumnType<string | null>;
|
|
364
|
+
custom_domain: import("@powersync/common").BaseColumnType<string | null>;
|
|
365
|
+
legacy_domains: import("@powersync/common").BaseColumnType<string | null>;
|
|
366
|
+
is_private: import("@powersync/common").BaseColumnType<number | null>;
|
|
367
|
+
extra_config: import("@powersync/common").BaseColumnType<string | null>;
|
|
368
|
+
created_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
369
|
+
updated_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
370
|
+
deleted_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
371
|
+
}>;
|
|
345
372
|
c_user_config_advanced: import("@powersync/common").Table<{
|
|
346
373
|
id: import("@powersync/common").BaseColumnType<string | null>;
|
|
347
374
|
created_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
@@ -4,6 +4,7 @@ import { c_note_embed, c_note_history, c_note_link, note_local_history } from '.
|
|
|
4
4
|
import { c_card_box, c_card_note, c_cmd, c_note_template, c_zettel_box } from './content.js';
|
|
5
5
|
import { c_local_config, app_local_store, c_config_property, c_user_config, c_user_config_advanced, note_local_index_meta, note_local_index_state, } from './local.js';
|
|
6
6
|
import { c_project, c_project_board, c_project_item, c_thread, c_chat_message, c_resource } from './projects.js';
|
|
7
|
+
import { c_storage } from './storage.js';
|
|
7
8
|
import { c_tag, c_tag_node, c_tag_preference } from './tags.js';
|
|
8
9
|
export const AppSchema = new Schema({
|
|
9
10
|
c_local_config,
|
|
@@ -29,6 +30,7 @@ export const AppSchema = new Schema({
|
|
|
29
30
|
c_thread,
|
|
30
31
|
c_chat_message,
|
|
31
32
|
c_resource,
|
|
33
|
+
c_storage,
|
|
32
34
|
c_user_config_advanced,
|
|
33
35
|
note_local_index_meta,
|
|
34
36
|
note_local_index_state,
|
|
@@ -24,6 +24,7 @@ export declare const c_note: Table<{
|
|
|
24
24
|
zettel_boxes: import("@powersync/common").BaseColumnType<string | null>;
|
|
25
25
|
status: import("@powersync/common").BaseColumnType<number | null>;
|
|
26
26
|
comments: import("@powersync/common").BaseColumnType<string | null>;
|
|
27
|
+
is_starred: import("@powersync/common").BaseColumnType<number | null>;
|
|
27
28
|
is_top: import("@powersync/common").BaseColumnType<number | null>;
|
|
28
29
|
pinned_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
29
30
|
chat_context: import("@powersync/common").BaseColumnType<string | null>;
|
|
@@ -76,6 +76,7 @@ export declare const c_resource: Table<{
|
|
|
76
76
|
name: import("@powersync/common").BaseColumnType<string | null>;
|
|
77
77
|
mime_type: import("@powersync/common").BaseColumnType<string | null>;
|
|
78
78
|
size_bytes: import("@powersync/common").BaseColumnType<number | null>;
|
|
79
|
+
storage_config_id: import("@powersync/common").BaseColumnType<string | null>;
|
|
79
80
|
storage_key: import("@powersync/common").BaseColumnType<string | null>;
|
|
80
81
|
storage_url: import("@powersync/common").BaseColumnType<string | null>;
|
|
81
82
|
storage_provider: import("@powersync/common").BaseColumnType<string | null>;
|
|
@@ -96,6 +97,8 @@ export declare const c_resource: Table<{
|
|
|
96
97
|
domain: import("@powersync/common").BaseColumnType<string | null>;
|
|
97
98
|
extra_data: import("@powersync/common").BaseColumnType<string | null>;
|
|
98
99
|
deleted_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
100
|
+
content_sha256: import("@powersync/common").BaseColumnType<string | null>;
|
|
99
101
|
content: import("@powersync/common").BaseColumnType<string | null>;
|
|
102
|
+
content_md: import("@powersync/common").BaseColumnType<string | null>;
|
|
100
103
|
summary: import("@powersync/common").BaseColumnType<string | null>;
|
|
101
104
|
}>;
|
|
@@ -76,6 +76,7 @@ export const c_resource = new Table({
|
|
|
76
76
|
name: column.text,
|
|
77
77
|
mime_type: column.text,
|
|
78
78
|
size_bytes: column.integer,
|
|
79
|
+
storage_config_id: column.text,
|
|
79
80
|
storage_key: column.text,
|
|
80
81
|
storage_url: column.text,
|
|
81
82
|
storage_provider: column.text,
|
|
@@ -96,6 +97,8 @@ export const c_resource = new Table({
|
|
|
96
97
|
domain: column.text,
|
|
97
98
|
extra_data: column.text,
|
|
98
99
|
deleted_at: column.text,
|
|
100
|
+
content_sha256: column.text,
|
|
99
101
|
content: column.text,
|
|
102
|
+
content_md: column.text,
|
|
100
103
|
summary: column.text,
|
|
101
104
|
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Table } from '@powersync/common';
|
|
2
|
+
export declare const c_storage: Table<{
|
|
3
|
+
id: import("@powersync/common").BaseColumnType<string | null>;
|
|
4
|
+
user_id: import("@powersync/common").BaseColumnType<string | null>;
|
|
5
|
+
alias_name: import("@powersync/common").BaseColumnType<string | null>;
|
|
6
|
+
protocol: import("@powersync/common").BaseColumnType<string | null>;
|
|
7
|
+
provider: import("@powersync/common").BaseColumnType<string | null>;
|
|
8
|
+
is_active: import("@powersync/common").BaseColumnType<number | null>;
|
|
9
|
+
sort_rank: import("@powersync/common").BaseColumnType<number | null>;
|
|
10
|
+
endpoint: import("@powersync/common").BaseColumnType<string | null>;
|
|
11
|
+
bucket: import("@powersync/common").BaseColumnType<string | null>;
|
|
12
|
+
region: import("@powersync/common").BaseColumnType<string | null>;
|
|
13
|
+
access_key_id: import("@powersync/common").BaseColumnType<string | null>;
|
|
14
|
+
secret_access_key: import("@powersync/common").BaseColumnType<string | null>;
|
|
15
|
+
force_path_style: import("@powersync/common").BaseColumnType<number | null>;
|
|
16
|
+
path_prefix: import("@powersync/common").BaseColumnType<string | null>;
|
|
17
|
+
custom_domain: import("@powersync/common").BaseColumnType<string | null>;
|
|
18
|
+
legacy_domains: import("@powersync/common").BaseColumnType<string | null>;
|
|
19
|
+
is_private: import("@powersync/common").BaseColumnType<number | null>;
|
|
20
|
+
extra_config: import("@powersync/common").BaseColumnType<string | null>;
|
|
21
|
+
created_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
22
|
+
updated_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
23
|
+
deleted_at: import("@powersync/common").BaseColumnType<string | null>;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { column, Table } from '@powersync/common';
|
|
2
|
+
export const c_storage = new Table({
|
|
3
|
+
id: column.text,
|
|
4
|
+
user_id: column.text,
|
|
5
|
+
alias_name: column.text,
|
|
6
|
+
protocol: column.text,
|
|
7
|
+
provider: column.text,
|
|
8
|
+
is_active: column.integer,
|
|
9
|
+
sort_rank: column.integer,
|
|
10
|
+
endpoint: column.text,
|
|
11
|
+
bucket: column.text,
|
|
12
|
+
region: column.text,
|
|
13
|
+
access_key_id: column.text,
|
|
14
|
+
secret_access_key: column.text,
|
|
15
|
+
force_path_style: column.integer,
|
|
16
|
+
path_prefix: column.text,
|
|
17
|
+
custom_domain: column.text,
|
|
18
|
+
legacy_domains: column.text,
|
|
19
|
+
is_private: column.integer,
|
|
20
|
+
extra_config: column.text,
|
|
21
|
+
created_at: column.text,
|
|
22
|
+
updated_at: column.text,
|
|
23
|
+
deleted_at: column.text,
|
|
24
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type SkillCheckIssue = {
|
|
2
|
+
skill: string;
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function checkSkillContent(skill: string, content: string, skillDir?: string): SkillCheckIssue[];
|
|
6
|
+
export declare function checkSkillsDirectory(skillsDir: string): SkillCheckIssue[];
|