@dinoxx/dinox-cli 1.1.0 → 2.0.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 +48 -4
- package/dist/cli.js +4 -0
- package/dist/commands/auth/index.js +1 -2
- package/dist/commands/boxes/index.js +37 -13
- package/dist/commands/boxes/operations.d.ts +3 -3
- package/dist/commands/boxes/operations.js +51 -28
- package/dist/commands/info/index.js +30 -5
- package/dist/commands/meta/repo.js +2 -1
- package/dist/commands/notes/actions.js +20 -37
- package/dist/commands/notes/bulk.d.ts +2 -2
- package/dist/commands/notes/bulk.js +3 -18
- package/dist/commands/notes/contentPatch.d.ts +5 -1
- package/dist/commands/notes/contentPatch.js +12 -1
- package/dist/commands/notes/contentPatchCommand.d.ts +3 -0
- package/dist/commands/notes/contentPatchCommand.js +29 -8
- package/dist/commands/notes/descriptors.js +19 -16
- package/dist/commands/notes/export.js +3 -0
- package/dist/commands/notes/repo.d.ts +9 -0
- package/dist/commands/notes/repo.js +65 -15
- package/dist/commands/notes/searchOutput.d.ts +2 -1
- package/dist/commands/notes/searchOutput.js +2 -1
- package/dist/commands/notes/searchSql.js +9 -3
- package/dist/commands/prompt/index.d.ts +1 -0
- package/dist/commands/prompt/index.js +26 -11
- package/dist/commands/runtime.js +17 -6
- package/dist/commands/savedViews/index.d.ts +7 -0
- package/dist/commands/savedViews/index.js +458 -0
- package/dist/commands/savedViews/model.d.ts +87 -0
- package/dist/commands/savedViews/model.js +306 -0
- package/dist/commands/savedViews/repo.d.ts +123 -0
- package/dist/commands/savedViews/repo.js +512 -0
- package/dist/commands/savedViews/semantics.d.ts +46 -0
- package/dist/commands/savedViews/semantics.js +738 -0
- package/dist/commands/schema/renderSkills.d.ts +2 -0
- package/dist/commands/schema/renderSkills.js +69 -10
- package/dist/commands/schema/spec.js +4 -0
- package/dist/commands/skills/index.d.ts +54 -0
- package/dist/commands/skills/index.js +468 -0
- package/dist/commands/storage/index.js +2 -2
- package/dist/commands/sync.d.ts +23 -1
- package/dist/commands/sync.js +100 -58
- package/dist/commands/tags/index.js +30 -11
- package/dist/commands/tags/operations.d.ts +3 -3
- package/dist/commands/tags/operations.js +45 -20
- package/dist/commands/templates/model.d.ts +50 -0
- package/dist/commands/templates/model.js +239 -0
- package/dist/commands/todo/index.js +3 -3
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/update.js +46 -9
- package/dist/commands/writeConfirmation.d.ts +13 -0
- package/dist/commands/writeConfirmation.js +54 -0
- package/dist/config/resolve.js +5 -10
- package/dist/config/types.d.ts +3 -6
- package/dist/constants/links.d.ts +18 -1
- package/dist/constants/links.js +26 -1
- package/dist/daemon/client.d.ts +2 -2
- package/dist/daemon/client.js +106 -52
- package/dist/daemon/index.d.ts +5 -3
- package/dist/daemon/index.js +28 -5
- package/dist/daemon/lifecycle.d.ts +10 -3
- package/dist/daemon/lifecycle.js +54 -11
- package/dist/daemon/pid.d.ts +1 -1
- package/dist/daemon/pid.js +6 -3
- package/dist/dinox.js +9 -1
- package/dist/powersync/exclusiveRuntime.d.ts +2 -0
- package/dist/powersync/exclusiveRuntime.js +28 -4
- package/dist/powersync/runtime.d.ts +4 -2
- package/dist/powersync/runtime.js +43 -5
- package/dist/powersync/schema/content.d.ts +1 -78
- package/dist/powersync/schema/content.js +1 -78
- package/dist/powersync/schema/electronCanonical.d.ts +1561 -0
- package/dist/powersync/schema/electronCanonical.js +1154 -0
- package/dist/powersync/schema/index.d.ts +573 -129
- package/dist/powersync/schema/index.js +3 -32
- package/dist/powersync/schema/local.d.ts +1 -56
- package/dist/powersync/schema/local.js +1 -60
- package/dist/powersync/schema/note.d.ts +1 -35
- package/dist/powersync/schema/note.js +1 -35
- package/dist/powersync/schema/notesExtras.d.ts +1 -62
- package/dist/powersync/schema/notesExtras.js +1 -71
- package/dist/powersync/schema/projects.d.ts +1 -104
- package/dist/powersync/schema/projects.js +1 -104
- package/dist/powersync/schema/savedViews.d.ts +1 -0
- package/dist/powersync/schema/savedViews.js +1 -0
- package/dist/powersync/schema/storage.d.ts +1 -24
- package/dist/powersync/schema/storage.js +1 -24
- package/dist/powersync/schema/tags.d.ts +1 -37
- package/dist/powersync/schema/tags.js +1 -37
- package/dist/powersync/syncGate.d.ts +22 -3
- package/dist/powersync/syncGate.js +4 -1
- package/dist/powersync/syncPass.d.ts +2 -0
- package/dist/powersync/syncPass.js +15 -4
- package/dist/powersync/tokenIndex.d.ts +2 -0
- package/dist/powersync/tokenIndex.js +60 -18
- package/dist/powersync/uploader.d.ts +16 -2
- package/dist/powersync/uploader.js +152 -158
- package/dist/skills/check.d.ts +1 -0
- package/dist/skills/check.js +538 -70
- package/dist/skills/retired.d.ts +60 -0
- package/dist/skills/retired.js +58 -0
- package/dist/utils/deadline.d.ts +8 -0
- package/dist/utils/deadline.js +31 -0
- package/dist/utils/dryRun.d.ts +20 -1
- package/dist/utils/dryRun.js +22 -3
- package/dist/utils/errors.d.ts +2 -0
- package/dist/utils/errors.js +5 -3
- package/dist/utils/processExit.d.ts +1 -0
- package/dist/utils/processExit.js +33 -0
- package/dist/utils/updateNotice.d.ts +1 -0
- package/dist/utils/updateNotice.js +1 -1
- package/package.json +10 -5
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { SKILLS_REPO_SLUG } from '../constants/links.js';
|
|
2
|
+
export type RetiredSkill = Readonly<{
|
|
3
|
+
name: string;
|
|
4
|
+
replacement: string | null;
|
|
5
|
+
replacementNote?: string;
|
|
6
|
+
source: typeof SKILLS_REPO_SLUG;
|
|
7
|
+
skillFolderHash: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type RetiredSkillsCleanupGuidance = Readonly<{
|
|
10
|
+
automaticRemoval: false;
|
|
11
|
+
inventoryCommand: string;
|
|
12
|
+
lockFile: string;
|
|
13
|
+
requiredMatchFields: readonly ['name', 'source', 'skillFolderHash'];
|
|
14
|
+
guidance: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const RETIRED_SKILLS: readonly (Readonly<{
|
|
17
|
+
name: "create-note";
|
|
18
|
+
replacement: "dino-note";
|
|
19
|
+
source: "ryzencool/dinox-cli-skills";
|
|
20
|
+
skillFolderHash: "15a91b77e5032e614cbec95997de0f9697cee29c";
|
|
21
|
+
}> | Readonly<{
|
|
22
|
+
name: "dinox";
|
|
23
|
+
replacement: "dino-dinox";
|
|
24
|
+
source: "ryzencool/dinox-cli-skills";
|
|
25
|
+
skillFolderHash: "3089a4b076fffd8d6579db26c520f0d97e225a30";
|
|
26
|
+
}> | Readonly<{
|
|
27
|
+
name: "manage-boxes";
|
|
28
|
+
replacement: "dino-manage-boxes";
|
|
29
|
+
source: "ryzencool/dinox-cli-skills";
|
|
30
|
+
skillFolderHash: "49ffa648ab341bef20a9ea4696973d39c5c4e1c9";
|
|
31
|
+
}> | Readonly<{
|
|
32
|
+
name: "manage-tags";
|
|
33
|
+
replacement: "dino-manage-tags";
|
|
34
|
+
source: "ryzencool/dinox-cli-skills";
|
|
35
|
+
skillFolderHash: "801f6cc91d225503ad67054f66ac024cb12d01cb";
|
|
36
|
+
}> | Readonly<{
|
|
37
|
+
name: "search-notes";
|
|
38
|
+
replacement: "dino-note";
|
|
39
|
+
source: "ryzencool/dinox-cli-skills";
|
|
40
|
+
skillFolderHash: "88d3a95a3cb663b555e79be57d2135c0edbe8e0d";
|
|
41
|
+
}> | Readonly<{
|
|
42
|
+
name: "view-note";
|
|
43
|
+
replacement: "dino-note";
|
|
44
|
+
source: "ryzencool/dinox-cli-skills";
|
|
45
|
+
skillFolderHash: "639ce5941e19d4f5ffc3a4b5870486e741ab2937";
|
|
46
|
+
}> | Readonly<{
|
|
47
|
+
name: "dino-shared";
|
|
48
|
+
replacement: null;
|
|
49
|
+
replacementNote: "Runtime guidance is embedded in every current Dinox skill.";
|
|
50
|
+
source: "ryzencool/dinox-cli-skills";
|
|
51
|
+
skillFolderHash: "842fe8fd30020bf1b58718dcd438d78b4c7d8f33";
|
|
52
|
+
}>)[];
|
|
53
|
+
export declare const RETIRED_SKILLS_CLEANUP: Readonly<{
|
|
54
|
+
automaticRemoval: false;
|
|
55
|
+
inventoryCommand: string;
|
|
56
|
+
lockFile: string;
|
|
57
|
+
requiredMatchFields: readonly ["name", "source", "skillFolderHash"];
|
|
58
|
+
guidance: string;
|
|
59
|
+
}>;
|
|
60
|
+
export declare function formatRetiredSkillsSummary(): string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { SKILLS_INSTALLER_NAME, SKILLS_INSTALLER_VERSION, SKILLS_REPO_SLUG, } from '../constants/links.js';
|
|
2
|
+
export const RETIRED_SKILLS = Object.freeze([
|
|
3
|
+
Object.freeze({
|
|
4
|
+
name: 'create-note',
|
|
5
|
+
replacement: 'dino-note',
|
|
6
|
+
source: SKILLS_REPO_SLUG,
|
|
7
|
+
skillFolderHash: '15a91b77e5032e614cbec95997de0f9697cee29c',
|
|
8
|
+
}),
|
|
9
|
+
Object.freeze({
|
|
10
|
+
name: 'dinox',
|
|
11
|
+
replacement: 'dino-dinox',
|
|
12
|
+
source: SKILLS_REPO_SLUG,
|
|
13
|
+
skillFolderHash: '3089a4b076fffd8d6579db26c520f0d97e225a30',
|
|
14
|
+
}),
|
|
15
|
+
Object.freeze({
|
|
16
|
+
name: 'manage-boxes',
|
|
17
|
+
replacement: 'dino-manage-boxes',
|
|
18
|
+
source: SKILLS_REPO_SLUG,
|
|
19
|
+
skillFolderHash: '49ffa648ab341bef20a9ea4696973d39c5c4e1c9',
|
|
20
|
+
}),
|
|
21
|
+
Object.freeze({
|
|
22
|
+
name: 'manage-tags',
|
|
23
|
+
replacement: 'dino-manage-tags',
|
|
24
|
+
source: SKILLS_REPO_SLUG,
|
|
25
|
+
skillFolderHash: '801f6cc91d225503ad67054f66ac024cb12d01cb',
|
|
26
|
+
}),
|
|
27
|
+
Object.freeze({
|
|
28
|
+
name: 'search-notes',
|
|
29
|
+
replacement: 'dino-note',
|
|
30
|
+
source: SKILLS_REPO_SLUG,
|
|
31
|
+
skillFolderHash: '88d3a95a3cb663b555e79be57d2135c0edbe8e0d',
|
|
32
|
+
}),
|
|
33
|
+
Object.freeze({
|
|
34
|
+
name: 'view-note',
|
|
35
|
+
replacement: 'dino-note',
|
|
36
|
+
source: SKILLS_REPO_SLUG,
|
|
37
|
+
skillFolderHash: '639ce5941e19d4f5ffc3a4b5870486e741ab2937',
|
|
38
|
+
}),
|
|
39
|
+
Object.freeze({
|
|
40
|
+
name: 'dino-shared',
|
|
41
|
+
replacement: null,
|
|
42
|
+
replacementNote: 'Runtime guidance is embedded in every current Dinox skill.',
|
|
43
|
+
source: SKILLS_REPO_SLUG,
|
|
44
|
+
skillFolderHash: '842fe8fd30020bf1b58718dcd438d78b4c7d8f33',
|
|
45
|
+
}),
|
|
46
|
+
]);
|
|
47
|
+
export const RETIRED_SKILLS_CLEANUP = Object.freeze({
|
|
48
|
+
automaticRemoval: false,
|
|
49
|
+
inventoryCommand: `npx --yes ${SKILLS_INSTALLER_NAME}@${SKILLS_INSTALLER_VERSION} list -g --json`,
|
|
50
|
+
lockFile: '~/.agents/.skill-lock.json',
|
|
51
|
+
requiredMatchFields: Object.freeze(['name', 'source', 'skillFolderHash']),
|
|
52
|
+
guidance: 'Use the inventory command to find candidates, then inspect the installer lock. Remove an installed skill only when its name, source, and skillFolderHash all match this official retired inventory. Never delete a skill directory or lock entry by name alone because unrelated skills can share an ID.',
|
|
53
|
+
});
|
|
54
|
+
export function formatRetiredSkillsSummary() {
|
|
55
|
+
return RETIRED_SKILLS.map((skill) => (skill.replacement
|
|
56
|
+
? `${skill.name} -> ${skill.replacement}`
|
|
57
|
+
: `${skill.name} -> no direct replacement (${skill.replacementNote})`)).join('; ');
|
|
58
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type DeadlineOptions = {
|
|
2
|
+
deadlineAtMs?: number;
|
|
3
|
+
maximumTimeoutMs: number;
|
|
4
|
+
createTimeoutError: () => Error;
|
|
5
|
+
runWhenExpired?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function remainingDeadlineMs(deadlineAtMs: number | undefined, maximumTimeoutMs: number, now?: () => number): number;
|
|
8
|
+
export declare function runWithinDeadline<T>(run: () => Promise<T>, options: DeadlineOptions): Promise<T>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function remainingDeadlineMs(deadlineAtMs, maximumTimeoutMs, now = Date.now) {
|
|
2
|
+
const maximum = Number.isFinite(maximumTimeoutMs)
|
|
3
|
+
? Math.max(0, Math.floor(maximumTimeoutMs))
|
|
4
|
+
: 0;
|
|
5
|
+
if (deadlineAtMs === undefined) {
|
|
6
|
+
return maximum;
|
|
7
|
+
}
|
|
8
|
+
return Math.max(0, Math.min(maximum, Math.floor(deadlineAtMs - now())));
|
|
9
|
+
}
|
|
10
|
+
export async function runWithinDeadline(run, options) {
|
|
11
|
+
if (options.deadlineAtMs === undefined) {
|
|
12
|
+
return run();
|
|
13
|
+
}
|
|
14
|
+
const remainingMs = remainingDeadlineMs(options.deadlineAtMs, options.maximumTimeoutMs);
|
|
15
|
+
if (remainingMs <= 0 && !options.runWhenExpired) {
|
|
16
|
+
throw options.createTimeoutError();
|
|
17
|
+
}
|
|
18
|
+
const operation = Promise.resolve().then(run);
|
|
19
|
+
let timer;
|
|
20
|
+
const timeout = new Promise((_resolve, reject) => {
|
|
21
|
+
timer = setTimeout(() => reject(options.createTimeoutError()), Math.max(1, remainingMs));
|
|
22
|
+
});
|
|
23
|
+
try {
|
|
24
|
+
return await Promise.race([operation, timeout]);
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
if (timer) {
|
|
28
|
+
clearTimeout(timer);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
package/dist/utils/dryRun.d.ts
CHANGED
|
@@ -8,6 +8,25 @@ export type DryRunPreview = {
|
|
|
8
8
|
inputs?: Record<string, unknown>;
|
|
9
9
|
targets?: Array<Record<string, unknown>>;
|
|
10
10
|
changes?: Record<string, unknown> | Array<Record<string, unknown>>;
|
|
11
|
+
stale?: boolean;
|
|
12
|
+
sync?: {
|
|
13
|
+
offline: boolean;
|
|
14
|
+
gate: {
|
|
15
|
+
ok: boolean;
|
|
16
|
+
reasons: string[];
|
|
17
|
+
} | null;
|
|
18
|
+
};
|
|
11
19
|
};
|
|
20
|
+
export type DryRunExecutionState = {
|
|
21
|
+
offline: boolean;
|
|
22
|
+
stale: boolean;
|
|
23
|
+
sync?: {
|
|
24
|
+
gate?: {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
reasons: string[];
|
|
27
|
+
} | null;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare function attachDryRunExecutionState(preview: DryRunPreview, state: DryRunExecutionState): DryRunPreview;
|
|
12
31
|
export declare function formatDryRunPreview(preview: DryRunPreview): string;
|
|
13
|
-
export declare function printDryRunPreview(preview: DryRunPreview): void;
|
|
32
|
+
export declare function printDryRunPreview(preview: DryRunPreview, state?: DryRunExecutionState): void;
|
package/dist/utils/dryRun.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { getRequestedStructuredOutputFormat, printHumanReadableBlock, printSuccess, } from './output.js';
|
|
2
|
+
export function attachDryRunExecutionState(preview, state) {
|
|
3
|
+
return {
|
|
4
|
+
...preview,
|
|
5
|
+
stale: state.offline || state.stale,
|
|
6
|
+
sync: {
|
|
7
|
+
offline: state.offline,
|
|
8
|
+
gate: state.sync?.gate ?? null,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
2
12
|
function formatValue(value) {
|
|
3
13
|
if (value === null || value === undefined) {
|
|
4
14
|
return String(value);
|
|
@@ -36,6 +46,14 @@ export function formatDryRunPreview(preview) {
|
|
|
36
46
|
`Risk: ${preview.risk}`,
|
|
37
47
|
`Summary: ${preview.summary}`,
|
|
38
48
|
];
|
|
49
|
+
if (typeof preview.stale === 'boolean') {
|
|
50
|
+
lines.push(`Freshness: ${preview.stale ? 'stale' : 'fresh'}`);
|
|
51
|
+
}
|
|
52
|
+
if (preview.sync) {
|
|
53
|
+
const gate = preview.sync.gate;
|
|
54
|
+
const gateSummary = gate ? (gate.ok ? 'ok' : `blocked (${gate.reasons.join(', ')})`) : 'not evaluated';
|
|
55
|
+
lines.push(`Sync: ${preview.sync.offline ? 'offline' : 'online'}; gate ${gateSummary}`);
|
|
56
|
+
}
|
|
39
57
|
if (preview.warnings && preview.warnings.length > 0) {
|
|
40
58
|
lines.push('');
|
|
41
59
|
lines.push('Warnings:');
|
|
@@ -60,10 +78,11 @@ export function formatDryRunPreview(preview) {
|
|
|
60
78
|
}
|
|
61
79
|
return `${lines.join('\n')}\n`;
|
|
62
80
|
}
|
|
63
|
-
export function printDryRunPreview(preview) {
|
|
81
|
+
export function printDryRunPreview(preview, state) {
|
|
82
|
+
const output = state ? attachDryRunExecutionState(preview, state) : preview;
|
|
64
83
|
if (getRequestedStructuredOutputFormat()) {
|
|
65
|
-
printSuccess(
|
|
84
|
+
printSuccess(output);
|
|
66
85
|
return;
|
|
67
86
|
}
|
|
68
|
-
printHumanReadableBlock(formatDryRunPreview(
|
|
87
|
+
printHumanReadableBlock(formatDryRunPreview(output));
|
|
69
88
|
}
|
package/dist/utils/errors.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type DinoxErrorOptions = {
|
|
|
6
6
|
suggestion?: string;
|
|
7
7
|
suggestedAction?: SuggestedAction;
|
|
8
8
|
recoverable?: boolean;
|
|
9
|
+
requiresProcessExit?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export type SuggestedAction = {
|
|
11
12
|
command: string;
|
|
@@ -34,6 +35,7 @@ export declare class DinoxError extends Error {
|
|
|
34
35
|
readonly suggestion?: string;
|
|
35
36
|
readonly suggestedAction?: SuggestedAction;
|
|
36
37
|
readonly recoverable: boolean;
|
|
38
|
+
readonly requiresProcessExit: boolean;
|
|
37
39
|
constructor(message: string, options?: DinoxErrorOptions);
|
|
38
40
|
}
|
|
39
41
|
export declare function isDinoxError(error: unknown): error is DinoxError;
|
package/dist/utils/errors.js
CHANGED
|
@@ -5,6 +5,7 @@ export class DinoxError extends Error {
|
|
|
5
5
|
suggestion;
|
|
6
6
|
suggestedAction;
|
|
7
7
|
recoverable;
|
|
8
|
+
requiresProcessExit;
|
|
8
9
|
constructor(message, options) {
|
|
9
10
|
super(message);
|
|
10
11
|
const code = normalizeErrorCode(options?.code ?? inferDinoxErrorCode(message));
|
|
@@ -18,6 +19,7 @@ export class DinoxError extends Error {
|
|
|
18
19
|
?? suggestedActionFromSuggestion(suggestion)
|
|
19
20
|
?? defaultSuggestedActionForCode(code, message);
|
|
20
21
|
this.recoverable = options?.recoverable ?? true;
|
|
22
|
+
this.requiresProcessExit = options?.requiresProcessExit ?? false;
|
|
21
23
|
if (options?.cause !== undefined) {
|
|
22
24
|
// Node 16+ supports Error.cause.
|
|
23
25
|
this.cause = options.cause;
|
|
@@ -147,7 +149,7 @@ function defaultSuggestionForCode(code) {
|
|
|
147
149
|
return 'Run `dino auth status --format json`; if auth is missing, set DINOX_TOKEN or pipe a token to `dino auth login --token-stdin` in your own terminal.';
|
|
148
150
|
case 'SYNC_REQUIRED':
|
|
149
151
|
case 'SYNC_STALE':
|
|
150
|
-
return 'Run `dino sync --strict --sync-timeout
|
|
152
|
+
return 'Run `dino sync --strict --sync-timeout 20000 --format json`, then retry the command.';
|
|
151
153
|
case 'UPLOAD_PENDING':
|
|
152
154
|
return 'Run `dino doctor --fix --format json` to wait for pending uploads and inspect sync health.';
|
|
153
155
|
case 'DAEMON_STALE':
|
|
@@ -163,7 +165,7 @@ function defaultSuggestionForCode(code) {
|
|
|
163
165
|
return 'Run `dino auth status --format json`; if auth is missing, set DINOX_TOKEN or pipe a token to `dino auth login --token-stdin` in your own terminal.';
|
|
164
166
|
}
|
|
165
167
|
if (normalized.startsWith('SYNC_')) {
|
|
166
|
-
return 'Run `dino sync --strict --sync-timeout
|
|
168
|
+
return 'Run `dino sync --strict --sync-timeout 20000 --format json`, then retry the command.';
|
|
167
169
|
}
|
|
168
170
|
if (normalized.startsWith('DAEMON_')) {
|
|
169
171
|
return 'Run `dino doctor --fix --format json` to restart a stale daemon and inspect local health.';
|
|
@@ -196,7 +198,7 @@ function defaultSuggestedActionForCode(code, message) {
|
|
|
196
198
|
}
|
|
197
199
|
if (normalized === 'SYNC_REQUIRED' || normalized === 'SYNC_STALE' || normalized.startsWith('SYNC_')) {
|
|
198
200
|
return {
|
|
199
|
-
command: 'dino sync --strict --sync-timeout
|
|
201
|
+
command: 'dino sync --strict --sync-timeout 20000 --format json',
|
|
200
202
|
reason: 'Refresh the local PowerSync cache and prove freshness before retrying the read.',
|
|
201
203
|
};
|
|
202
204
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function exitProcessAfterFlushing(exitCode: number, flushTimeoutMs?: number): Promise<never>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const DEFAULT_FLUSH_TIMEOUT_MS = 100;
|
|
2
|
+
async function flushWritable(stream, timeoutMs) {
|
|
3
|
+
if (stream.destroyed || stream.writableEnded || !stream.writable) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
await new Promise((resolve) => {
|
|
7
|
+
let settled = false;
|
|
8
|
+
const finish = () => {
|
|
9
|
+
if (settled)
|
|
10
|
+
return;
|
|
11
|
+
settled = true;
|
|
12
|
+
clearTimeout(timer);
|
|
13
|
+
resolve();
|
|
14
|
+
};
|
|
15
|
+
const timer = setTimeout(finish, timeoutMs);
|
|
16
|
+
try {
|
|
17
|
+
stream.write('', finish);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
finish();
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export async function exitProcessAfterFlushing(exitCode, flushTimeoutMs = DEFAULT_FLUSH_TIMEOUT_MS) {
|
|
25
|
+
const timeoutMs = Number.isFinite(flushTimeoutMs)
|
|
26
|
+
? Math.max(1, Math.floor(flushTimeoutMs))
|
|
27
|
+
: DEFAULT_FLUSH_TIMEOUT_MS;
|
|
28
|
+
await Promise.all([
|
|
29
|
+
flushWritable(process.stdout, timeoutMs),
|
|
30
|
+
flushWritable(process.stderr, timeoutMs),
|
|
31
|
+
]);
|
|
32
|
+
process.exit(exitCode);
|
|
33
|
+
}
|
|
@@ -4,4 +4,5 @@ export type UpdateNotice = {
|
|
|
4
4
|
message: string;
|
|
5
5
|
};
|
|
6
6
|
export declare function isVersionNewer(candidate: string, current: string): boolean;
|
|
7
|
+
export declare function fetchLatestPublishedVersion(fetchImpl?: typeof fetch): Promise<string | null>;
|
|
7
8
|
export declare function getUpdateNotice(currentVersion: string, fetchImpl?: typeof fetch): Promise<UpdateNotice | null>;
|
|
@@ -26,7 +26,7 @@ export function isVersionNewer(candidate, current) {
|
|
|
26
26
|
}
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
|
-
async function fetchLatestPublishedVersion(fetchImpl = fetch) {
|
|
29
|
+
export async function fetchLatestPublishedVersion(fetchImpl = fetch) {
|
|
30
30
|
const controller = new AbortController();
|
|
31
31
|
const timeout = setTimeout(() => controller.abort(), 1500);
|
|
32
32
|
try {
|
package/package.json
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinoxx/dinox-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Dinox CLI",
|
|
5
5
|
"main": "dist/dinox.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.json && node scripts/add-shebang.mjs",
|
|
8
8
|
"dev": "tsx src/dinox.ts",
|
|
9
|
-
"prepublishOnly": "pnpm run build",
|
|
9
|
+
"prepublishOnly": "pnpm run skills:check && pnpm run build",
|
|
10
10
|
"publish:npm": "sh ./publish-npm.sh --no-bump",
|
|
11
|
-
"publish:npm:dry-run": "sh ./publish-npm.sh --dry-run",
|
|
11
|
+
"publish:npm:dry-run": "sh ./publish-npm.sh --dry-run --no-bump",
|
|
12
12
|
"skills:check": "tsx scripts/check-skills.ts",
|
|
13
|
+
"skills:eval:triggers": "tsx scripts/evaluate-skill-triggers.ts",
|
|
13
14
|
"skills:sync:standalone": "tsx scripts/sync-standalone-skills-repo.ts",
|
|
15
|
+
"skills:sync:standalone:check": "tsx scripts/sync-standalone-skills-repo.ts --check",
|
|
16
|
+
"skills:sync:standalone:dry-run": "tsx scripts/sync-standalone-skills-repo.ts --dry-run",
|
|
14
17
|
"skills:sync": "tsx scripts/sync-skills-reference.ts",
|
|
18
|
+
"schema:sync:electron": "tsx scripts/sync-electron-powersync-schema.ts",
|
|
19
|
+
"schema:sync:electron:check": "tsx scripts/sync-electron-powersync-schema.ts --check",
|
|
15
20
|
"start": "node dist/dinox.js",
|
|
16
21
|
"test": "node scripts/run-tests.mjs",
|
|
17
22
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json"
|
|
@@ -36,8 +41,8 @@
|
|
|
36
41
|
"dependencies": {
|
|
37
42
|
"@aws-sdk/client-s3": "^3.1021.0",
|
|
38
43
|
"@node-rs/jieba": "^2.0.1",
|
|
39
|
-
"@powersync/common": "^
|
|
40
|
-
"@powersync/node": "^
|
|
44
|
+
"@powersync/common": "^2.3.1",
|
|
45
|
+
"@powersync/node": "^1.1.1",
|
|
41
46
|
"@tiptap/core": "^3.20.0",
|
|
42
47
|
"@tiptap/extension-blockquote": "^3.20.0",
|
|
43
48
|
"@tiptap/extension-bold": "^3.20.0",
|