@dinoxx/dinox-cli 2.2.0 → 2.4.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 (102) hide show
  1. package/README.md +17 -3
  2. package/dist/cli.js +6 -0
  3. package/dist/commands/domain/options.d.ts +10 -0
  4. package/dist/commands/domain/options.js +75 -0
  5. package/dist/commands/domain/run.d.ts +24 -0
  6. package/dist/commands/domain/run.js +137 -0
  7. package/dist/commands/gateway/index.d.ts +4 -0
  8. package/dist/commands/gateway/index.js +300 -0
  9. package/dist/commands/notes/actions.js +47 -18
  10. package/dist/commands/notes/createFromTemplate.d.ts +35 -0
  11. package/dist/commands/notes/createFromTemplate.js +58 -0
  12. package/dist/commands/notes/descriptors.js +9 -4
  13. package/dist/commands/notes/repo/read.js +4 -23
  14. package/dist/commands/notes/repo/write.d.ts +2 -0
  15. package/dist/commands/notes/repo/write.js +1 -1
  16. package/dist/commands/properties/index.d.ts +16 -0
  17. package/dist/commands/properties/index.js +640 -0
  18. package/dist/commands/properties/repo.d.ts +150 -0
  19. package/dist/commands/properties/repo.js +272 -0
  20. package/dist/commands/savedViews/fields.d.ts +28 -0
  21. package/dist/commands/savedViews/fields.js +87 -0
  22. package/dist/commands/savedViews/index.js +203 -164
  23. package/dist/commands/savedViews/model.d.ts +27 -69
  24. package/dist/commands/savedViews/model.js +63 -279
  25. package/dist/commands/savedViews/repo.d.ts +64 -62
  26. package/dist/commands/savedViews/repo.js +309 -428
  27. package/dist/commands/schema/renderSkills.js +33 -5
  28. package/dist/commands/schema/spec.js +6 -0
  29. package/dist/commands/templates/index.d.ts +4 -0
  30. package/dist/commands/templates/index.js +290 -0
  31. package/dist/commands/templates/model.d.ts +12 -34
  32. package/dist/commands/templates/model.js +39 -83
  33. package/dist/commands/templates/repo.d.ts +53 -0
  34. package/dist/commands/templates/repo.js +78 -0
  35. package/dist/config/paths.d.ts +1 -0
  36. package/dist/config/paths.js +1 -1
  37. package/dist/daemon/server.d.ts +1 -0
  38. package/dist/daemon/server.js +31 -0
  39. package/dist/gateway/adapters/acp.d.ts +42 -0
  40. package/dist/gateway/adapters/acp.js +285 -0
  41. package/dist/gateway/adapters/echo.d.ts +12 -0
  42. package/dist/gateway/adapters/echo.js +51 -0
  43. package/dist/gateway/adapters/index.d.ts +9 -0
  44. package/dist/gateway/adapters/index.js +30 -0
  45. package/dist/gateway/assistantProjection.d.ts +32 -0
  46. package/dist/gateway/assistantProjection.js +193 -0
  47. package/dist/gateway/config.d.ts +50 -0
  48. package/dist/gateway/config.js +253 -0
  49. package/dist/gateway/detect.d.ts +40 -0
  50. package/dist/gateway/detect.js +145 -0
  51. package/dist/gateway/deviceHost.d.ts +82 -0
  52. package/dist/gateway/deviceHost.js +530 -0
  53. package/dist/gateway/mcpServer.d.ts +4 -0
  54. package/dist/gateway/mcpServer.js +118 -0
  55. package/dist/gateway/protocol.d.ts +29 -0
  56. package/dist/gateway/protocol.js +127 -0
  57. package/dist/gateway/runExecutor.d.ts +67 -0
  58. package/dist/gateway/runExecutor.js +316 -0
  59. package/dist/gateway/service.d.ts +26 -0
  60. package/dist/gateway/service.js +82 -0
  61. package/dist/gateway/streamPublisher.d.ts +33 -0
  62. package/dist/gateway/streamPublisher.js +93 -0
  63. package/dist/gateway/threadStore.d.ts +157 -0
  64. package/dist/gateway/threadStore.js +430 -0
  65. package/dist/gateway/types.d.ts +117 -0
  66. package/dist/gateway/types.js +9 -0
  67. package/dist/skills/registry.js +7 -0
  68. package/dist/utils/errorCodes.d.ts +212 -0
  69. package/dist/utils/errorCodes.js +53 -0
  70. package/dist/vendor/electron/domain/note-templates.d.ts +3 -0
  71. package/dist/vendor/electron/domain/note-templates.js +232 -0
  72. package/dist/vendor/electron/domain/properties.d.ts +10 -0
  73. package/dist/vendor/electron/domain/properties.js +1549 -0
  74. package/dist/vendor/electron/domain/saved-view-analytics.d.ts +45 -0
  75. package/dist/vendor/electron/domain/saved-view-analytics.js +365 -0
  76. package/dist/vendor/electron/domain/saved-view-relative-date.d.ts +21 -0
  77. package/dist/vendor/electron/domain/saved-view-relative-date.js +153 -0
  78. package/dist/vendor/electron/domain/saved-views.d.ts +61 -0
  79. package/dist/vendor/electron/domain/saved-views.js +1120 -0
  80. package/dist/vendor/electron/rpc.d.ts +22 -0
  81. package/dist/vendor/electron/rpc.js +27 -0
  82. package/dist/vendor/electron/shared/ai-errors.d.ts +11 -0
  83. package/dist/vendor/electron/shared/ai-errors.js +107 -0
  84. package/dist/vendor/electron/shared/external-types.d.ts +20 -0
  85. package/dist/vendor/electron/shared/external-types.js +1 -0
  86. package/dist/vendor/electron/shared/index.d.ts +9 -0
  87. package/dist/vendor/electron/shared/index.js +7 -0
  88. package/dist/vendor/electron/shared/note-properties.d.ts +328 -0
  89. package/dist/vendor/electron/shared/note-properties.js +1027 -0
  90. package/dist/vendor/electron/shared/note-templates.d.ts +82 -0
  91. package/dist/vendor/electron/shared/note-templates.js +84 -0
  92. package/dist/vendor/electron/shared/powersync-read-models.d.ts +1716 -0
  93. package/dist/vendor/electron/shared/powersync-read-models.js +1 -0
  94. package/dist/vendor/electron/shared/remote-device-agent.d.ts +373 -0
  95. package/dist/vendor/electron/shared/remote-device-agent.js +191 -0
  96. package/dist/vendor/electron/shared/saved-views.d.ts +394 -0
  97. package/dist/vendor/electron/shared/saved-views.js +981 -0
  98. package/dist/vendor/electron/sql-utils.d.ts +5 -0
  99. package/dist/vendor/electron/sql-utils.js +32 -0
  100. package/package.json +10 -4
  101. package/dist/commands/savedViews/semantics.d.ts +0 -46
  102. package/dist/commands/savedViews/semantics.js +0 -738
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Note template domain types + pure helpers.
3
+ *
4
+ * `c_note_template.property_def` carries the template's property schema as a
5
+ * versioned JSON envelope: { version: 1, keys: [...] }. The template stores
6
+ * only the ordered key list — type/options/description stay on the
7
+ * `c_property_def` catalog so the AI fill contract has a single source of
8
+ * truth. Templates created by other clients without the column keep working
9
+ * (property_def NULL means "content-only template").
10
+ *
11
+ * This module is pure (no DB, no React) so it can be shared by the
12
+ * main-process command handlers and the renderer UI.
13
+ */
14
+ export declare const NOTE_TEMPLATE_PROPERTY_DEF_VERSION = 1;
15
+ export declare const MAX_NOTE_TEMPLATE_PROPERTY_KEYS = 50;
16
+ export interface NoteTemplatePropertyDef {
17
+ version: typeof NOTE_TEMPLATE_PROPERTY_DEF_VERSION;
18
+ keys: string[];
19
+ }
20
+ /** Raw c_note_template row shape (snake_case, nullable). */
21
+ export interface NoteTemplateRow {
22
+ id: string;
23
+ user_id: string | null;
24
+ name: string | null;
25
+ content: string | null;
26
+ priority: number | null;
27
+ is_show: number | null;
28
+ extra_data: string | null;
29
+ property_def: string | null;
30
+ insert_at: string | null;
31
+ update_at: string | null;
32
+ is_del: number | null;
33
+ }
34
+ /** Domain form used by the renderer (camelCase, defaults applied). */
35
+ export interface NoteTemplateSummary {
36
+ id: string;
37
+ name: string;
38
+ propertyKeys: string[];
39
+ /** Raw content column: tiptap JSON string (or legacy markdown), '' when none. */
40
+ content: string;
41
+ hasContent: boolean;
42
+ isShow: boolean;
43
+ priority: number;
44
+ updateAt: string | null;
45
+ }
46
+ /** Drop invalid/duplicate keys and cap the list; order is preserved. */
47
+ export declare function sanitizeNoteTemplatePropertyKeys(keys: readonly unknown[]): string[];
48
+ /**
49
+ * Parse the property_def JSON column into an ordered key list. Accepts the
50
+ * versioned envelope and (defensively) a bare array; anything else yields [].
51
+ */
52
+ export declare function parseNoteTemplatePropertyKeys(raw: string | null | undefined): string[];
53
+ /** Serialize: empty list normalizes to null (keep storage NULL, no "{}" noise). */
54
+ export declare function serializeNoteTemplatePropertyKeys(keys: readonly string[]): string | null;
55
+ /** Map a raw c_note_template row into the domain object. */
56
+ export declare function mapNoteTemplateRow(row: NoteTemplateRow): NoteTemplateSummary;
57
+ export interface NoteTemplateCatalogInput {
58
+ userId: string;
59
+ limit?: number;
60
+ }
61
+ export interface NoteTemplateCreateInput {
62
+ userId: string;
63
+ name: string;
64
+ propertyKeys: string[];
65
+ /** Tiptap JSON string ('' / omitted = property-only template). */
66
+ content?: string | null;
67
+ updatedAt: string;
68
+ }
69
+ export interface NoteTemplateUpdateInput {
70
+ id: string;
71
+ userId: string;
72
+ name?: string;
73
+ propertyKeys?: string[];
74
+ /** Tiptap JSON string; '' clears the content. */
75
+ content?: string | null;
76
+ updatedAt: string;
77
+ }
78
+ export interface NoteTemplateSoftDeleteInput {
79
+ id: string;
80
+ userId: string;
81
+ updatedAt: string;
82
+ }
@@ -0,0 +1,84 @@
1
+ // Generated by scripts/sync-electron-domain.ts from dinox-electron/packages/shared/src/note-templates.ts. Do not edit manually.
2
+ /**
3
+ * Note template domain types + pure helpers.
4
+ *
5
+ * `c_note_template.property_def` carries the template's property schema as a
6
+ * versioned JSON envelope: { version: 1, keys: [...] }. The template stores
7
+ * only the ordered key list — type/options/description stay on the
8
+ * `c_property_def` catalog so the AI fill contract has a single source of
9
+ * truth. Templates created by other clients without the column keep working
10
+ * (property_def NULL means "content-only template").
11
+ *
12
+ * This module is pure (no DB, no React) so it can be shared by the
13
+ * main-process command handlers and the renderer UI.
14
+ */
15
+ import { isPropertyKeyValid } from './note-properties.js';
16
+ export const NOTE_TEMPLATE_PROPERTY_DEF_VERSION = 1;
17
+ export const MAX_NOTE_TEMPLATE_PROPERTY_KEYS = 50;
18
+ /** Drop invalid/duplicate keys and cap the list; order is preserved. */
19
+ export function sanitizeNoteTemplatePropertyKeys(keys) {
20
+ const seen = new Set();
21
+ const result = [];
22
+ for (const key of keys) {
23
+ if (!isPropertyKeyValid(key))
24
+ continue;
25
+ if (seen.has(key))
26
+ continue;
27
+ seen.add(key);
28
+ result.push(key);
29
+ if (result.length >= MAX_NOTE_TEMPLATE_PROPERTY_KEYS)
30
+ break;
31
+ }
32
+ return result;
33
+ }
34
+ /**
35
+ * Parse the property_def JSON column into an ordered key list. Accepts the
36
+ * versioned envelope and (defensively) a bare array; anything else yields [].
37
+ */
38
+ export function parseNoteTemplatePropertyKeys(raw) {
39
+ if (!raw)
40
+ return [];
41
+ let parsed;
42
+ try {
43
+ parsed = JSON.parse(raw);
44
+ }
45
+ catch {
46
+ return [];
47
+ }
48
+ if (Array.isArray(parsed))
49
+ return sanitizeNoteTemplatePropertyKeys(parsed);
50
+ if (parsed && typeof parsed === 'object') {
51
+ const envelope = parsed;
52
+ if (envelope.version !== NOTE_TEMPLATE_PROPERTY_DEF_VERSION)
53
+ return [];
54
+ const keys = envelope.keys;
55
+ if (Array.isArray(keys))
56
+ return sanitizeNoteTemplatePropertyKeys(keys);
57
+ }
58
+ return [];
59
+ }
60
+ /** Serialize: empty list normalizes to null (keep storage NULL, no "{}" noise). */
61
+ export function serializeNoteTemplatePropertyKeys(keys) {
62
+ const sanitized = sanitizeNoteTemplatePropertyKeys(keys);
63
+ if (sanitized.length === 0)
64
+ return null;
65
+ const envelope = {
66
+ version: NOTE_TEMPLATE_PROPERTY_DEF_VERSION,
67
+ keys: sanitized,
68
+ };
69
+ return JSON.stringify(envelope);
70
+ }
71
+ /** Map a raw c_note_template row into the domain object. */
72
+ export function mapNoteTemplateRow(row) {
73
+ const content = (row.content ?? '').trim() ? (row.content ?? '') : '';
74
+ return {
75
+ id: row.id,
76
+ name: (row.name ?? '').trim(),
77
+ propertyKeys: parseNoteTemplatePropertyKeys(row.property_def),
78
+ content,
79
+ hasContent: content.length > 0,
80
+ isShow: Number(row.is_show ?? 0) === 1,
81
+ priority: Number.isFinite(row.priority) ? Math.trunc(Number(row.priority)) : 0,
82
+ updateAt: row.update_at ?? null,
83
+ };
84
+ }