@dinoxx/dinox-cli 2.13.0 → 2.14.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.
Files changed (58) hide show
  1. package/dist/cli.js +5 -2
  2. package/dist/commands/auth/index.d.ts +2 -7
  3. package/dist/commands/auth/index.js +26 -51
  4. package/dist/commands/doctor.d.ts +4 -1
  5. package/dist/commands/doctor.js +20 -1
  6. package/dist/commands/graph/index.js +2 -1
  7. package/dist/commands/notes/contentPatch.js +2 -1
  8. package/dist/commands/notes/export.js +3 -2
  9. package/dist/commands/runtime.d.ts +8 -0
  10. package/dist/commands/runtime.js +49 -1
  11. package/dist/commands/schema/globalOptions.d.ts +1 -0
  12. package/dist/commands/schema/globalOptions.js +1 -0
  13. package/dist/commands/schema/renderSkills.js +1 -0
  14. package/dist/commands/schema/spec.js +9 -1
  15. package/dist/commands/storage/repo/operations.js +3 -1
  16. package/dist/commands/sync.d.ts +2 -1
  17. package/dist/commands/sync.js +24 -5
  18. package/dist/daemon/client.js +32 -2
  19. package/dist/daemon/connectivity.d.ts +20 -0
  20. package/dist/daemon/connectivity.js +42 -0
  21. package/dist/daemon/ensure.js +48 -12
  22. package/dist/daemon/forward.d.ts +34 -0
  23. package/dist/daemon/forward.js +146 -0
  24. package/dist/daemon/fresh.d.ts +4 -0
  25. package/dist/daemon/fresh.js +10 -0
  26. package/dist/daemon/index.d.ts +11 -6
  27. package/dist/daemon/index.js +90 -25
  28. package/dist/daemon/launch.d.ts +13 -1
  29. package/dist/daemon/launch.js +31 -2
  30. package/dist/daemon/lifecycle.d.ts +3 -1
  31. package/dist/daemon/lifecycle.js +27 -3
  32. package/dist/daemon/pid.d.ts +8 -0
  33. package/dist/daemon/pid.js +20 -0
  34. package/dist/daemon/route.js +2 -1
  35. package/dist/daemon/server.d.ts +44 -0
  36. package/dist/daemon/server.js +175 -3
  37. package/dist/daemon/supervise.d.ts +6 -6
  38. package/dist/daemon/supervise.js +12 -10
  39. package/dist/daemon/supervisor.d.ts +21 -5
  40. package/dist/daemon/supervisor.js +125 -6
  41. package/dist/daemon/types.d.ts +16 -0
  42. package/dist/dinox.js +41 -64
  43. package/dist/gateway/mcpCommandTools.d.ts +9 -0
  44. package/dist/gateway/mcpCommandTools.js +40 -10
  45. package/dist/powersync/runtime.d.ts +2 -0
  46. package/dist/powersync/runtime.js +3 -1
  47. package/dist/requests/store.d.ts +10 -0
  48. package/dist/requests/store.js +190 -0
  49. package/dist/runCli.d.ts +2 -0
  50. package/dist/runCli.js +64 -0
  51. package/dist/utils/argValue.js +2 -1
  52. package/dist/utils/errorCodes.d.ts +20 -0
  53. package/dist/utils/errorCodes.js +5 -0
  54. package/dist/utils/output.d.ts +2 -0
  55. package/dist/utils/output.js +31 -7
  56. package/dist/utils/requestContext.d.ts +24 -0
  57. package/dist/utils/requestContext.js +13 -0
  58. package/package.json +2 -1
@@ -0,0 +1,24 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
2
+ import type { AbstractPowerSyncDatabase } from '@powersync/common';
3
+ import type { ResolvedDinoxConfig } from '../config/types.js';
4
+ import type { StructuredNoticeMap, StructuredOutputFormat } from './output.js';
5
+ export type RequestContext = {
6
+ stdout: string[];
7
+ stderr: string[];
8
+ format: StructuredOutputFormat | null;
9
+ noticeProvider: (() => StructuredNoticeMap | null) | null;
10
+ cwd: string;
11
+ daemon?: {
12
+ db: AbstractPowerSyncDatabase;
13
+ config: ResolvedDinoxConfig;
14
+ /**
15
+ * Set after the daemon reconnected (wake from sleep, network change): the
16
+ * stream is only known to be current once a checkpoint completes after it.
17
+ */
18
+ syncUnconfirmedSince?: () => string | null;
19
+ };
20
+ };
21
+ export declare const requestContext: AsyncLocalStorage<RequestContext>;
22
+ export declare function resolveUserPath(p: string): string;
23
+ export declare function assertStdinAvailable(): void;
24
+ export declare const localCommandExecution: AsyncLocalStorage<boolean>;
@@ -0,0 +1,13 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
2
+ import path from 'node:path';
3
+ import { DinoxError } from './errors.js';
4
+ export const requestContext = new AsyncLocalStorage();
5
+ export function resolveUserPath(p) {
6
+ return path.resolve(requestContext.getStore()?.cwd ?? process.cwd(), p);
7
+ }
8
+ export function assertStdinAvailable() {
9
+ if (requestContext.getStore()?.daemon) {
10
+ throw new DinoxError('Reading stdin inside the daemon is not supported.', { code: 'USAGE_ERROR' });
11
+ }
12
+ }
13
+ export const localCommandExecution = new AsyncLocalStorage();
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@dinoxx/dinox-cli",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "Dinox CLI",
5
5
  "main": "dist/dinox.js",
6
6
  "scripts": {
7
+ "bench:startup": "node scripts/bench-startup.mjs",
7
8
  "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.json && node scripts/add-shebang.mjs",
8
9
  "dev": "tsx src/dinox.ts",
9
10
  "prepublishOnly": "pnpm run skills:check && pnpm run build",