@native-sdk/cli 0.8.4 → 0.9.1
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/build/app.zig +1178 -74
- package/build.zig +715 -17
- package/build.zig.zon +1 -0
- package/native-sdk.d.ts +10 -0
- package/package.json +12 -11
- package/packages/core/compile-surface/core.ts +435 -3
- package/packages/core/package-lock.json +11 -11
- package/packages/core/package.json +2 -2
- package/packages/core/scripts/compiler_typecheck.mjs +116 -15
- package/packages/core/scripts/gen_service_surface.mjs +268 -0
- package/packages/core/scripts/merge_static_archives.mjs +78 -0
- package/packages/core/scripts/npm_static_spike.mjs +64 -0
- package/packages/core/scripts/run_external_core_compiler.mjs +122 -6
- package/packages/core/scripts/run_external_service_compiler.mjs +280 -0
- package/packages/core/scripts/stage_external_core.mjs +9 -1
- package/packages/core/scripts/stage_external_services.mjs +172 -0
- package/packages/core/scripts/surface_manifest_diff.mjs +253 -0
- package/packages/core/scripts/vendor_service_packages.mjs +189 -0
- package/packages/core/sdk/core.d.ts +224 -0
- package/packages/core/sdk/core.ts +694 -22
- package/packages/core/sdk/events.d.ts +89 -0
- package/packages/core/sdk/events.ts +128 -0
- package/packages/core/src/checker.ts +936 -15
- package/packages/core/src/cli.ts +156 -3
- package/packages/core/src/contract.ts +28 -5
- package/packages/core/src/devhost.ts +1876 -16
- package/packages/core/src/devhost_journal.mjs +183 -0
- package/packages/core/src/devhost_resolver.mjs +17 -1
- package/packages/core/src/devhost_service_worker.mjs +90 -0
- package/packages/core/src/diagnostics.ts +179 -22
- package/packages/core/src/frontend.ts +210 -34
- package/packages/core/src/infer.ts +24 -0
- package/packages/core/src/modules.ts +129 -80
- package/packages/core/src/service_contract.ts +597 -0
- package/packages/core/src/sqlite_cli.ts +93 -0
- package/packages/core/src/sqlite_codegen.ts +806 -0
- package/packages/core/src/sqlite_runtime_policy.ts +364 -0
- package/packages/core/src/typed_ast.ts +36 -8
- package/skill-data/automation/SKILL.md +1 -1
- package/skill-data/core/references/project-anatomy.md +1 -1
- package/skill-data/native-ui/SKILL.md +58 -5
- package/skill-data/ts-core/SKILL.md +123 -41
- package/skill-data/ts-services/SKILL.md +126 -0
- package/skill-data/ts-services/references/service-surface.md +604 -0
- package/skill-data/zig/SKILL.md +1 -1
- package/skills/native-sdk/SKILL.md +1 -1
- package/src/app_runner/no_migrations.zig +3 -0
- package/src/app_runner/no_services.zig +20 -0
- package/src/app_runner/root.zig +133 -4
- package/src/app_runner/ts_core_main.zig +254 -8
- package/src/app_runner/ts_core_mobile.zig +241 -0
- package/src/automation/protocol.zig +5 -1
- package/src/automation/snapshot.zig +31 -11
- package/src/embed/app_exports.zig +12 -1
- package/src/embed/c_api.zig +48 -2
- package/src/embed/conversions.zig +4 -5
- package/src/embed/host.zig +109 -1
- package/src/embed/root.zig +8 -0
- package/src/embed/tests.zig +241 -0
- package/src/embed/types.zig +51 -0
- package/src/embed/ui_host.zig +185 -5
- package/src/platform/android/NativeSdkActivity.java +131 -0
- package/src/platform/android/android_host.c +182 -1
- package/src/platform/android/native_sdk_app.h +17 -0
- package/src/platform/ios/native_sdk_app.h +17 -0
- package/src/platform/ios/uikit_host.m +115 -0
- package/src/platform/linux/cef_host.cpp +8 -2
- package/src/platform/linux/gtk_host.c +289 -22
- package/src/platform/linux/gtk_host.h +5 -1
- package/src/platform/linux/root.zig +109 -22
- package/src/platform/macos/appkit_host.h +24 -7
- package/src/platform/macos/appkit_host.m +686 -64
- package/src/platform/macos/cef_host.mm +400 -66
- package/src/platform/macos/root.zig +304 -47
- package/src/platform/null_platform.zig +435 -48
- package/src/platform/null_platform_tests.zig +113 -0
- package/src/platform/root.zig +19 -0
- package/src/platform/types.zig +281 -28
- package/src/platform/windows/root.zig +207 -27
- package/src/platform/windows/webview2_host.cpp +334 -51
- package/src/primitives/app_manifest/comptime_scene.zig +2 -0
- package/src/primitives/app_manifest/root.zig +4 -0
- package/src/primitives/app_manifest/tests.zig +3 -0
- package/src/primitives/app_manifest/types.zig +32 -0
- package/src/primitives/app_manifest/validation.zig +19 -1
- package/src/root.zig +53 -0
- package/src/runtime/api.zig +19 -0
- package/src/runtime/automation_commands.zig +35 -2
- package/src/runtime/automation_snapshot.zig +32 -20
- package/src/runtime/bridge_permission_tests.zig +58 -3
- package/src/runtime/bridge_responses.zig +4 -2
- package/src/runtime/builtin_bridge.zig +11 -1
- package/src/runtime/canvas_frame.zig +18 -11
- package/src/runtime/canvas_frame_animation_tests.zig +4 -0
- package/src/runtime/clock.zig +13 -1
- package/src/runtime/core.zig +145 -7
- package/src/runtime/credentials_store.zig +115 -0
- package/src/runtime/effects.zig +3701 -231
- package/src/runtime/effects_credentials_tests.zig +332 -0
- package/src/runtime/effects_file_tests.zig +587 -0
- package/src/runtime/effects_host_tests.zig +208 -1
- package/src/runtime/effects_notification_tests.zig +11 -0
- package/src/runtime/effects_relational_tests.zig +314 -0
- package/src/runtime/effects_store_tests.zig +211 -0
- package/src/runtime/file_access.zig +400 -0
- package/src/runtime/file_effect_crash_helper.zig +28 -0
- package/src/runtime/file_effect_crash_tests.zig +37 -0
- package/src/runtime/flow.zig +35 -10
- package/src/runtime/gpu_surface_events.zig +6 -1
- package/src/runtime/native_command_event_tests.zig +86 -2
- package/src/runtime/persist_store.zig +666 -0
- package/src/runtime/pty.zig +5 -2
- package/src/runtime/record_store.zig +788 -0
- package/src/runtime/relational_store.zig +854 -0
- package/src/runtime/root.zig +54 -0
- package/src/runtime/runtime_event_tests.zig +70 -0
- package/src/runtime/service_host.zig +711 -0
- package/src/runtime/service_pool.zig +1314 -0
- package/src/runtime/session_blobs.zig +4 -1
- package/src/runtime/session_journal.zig +158 -5
- package/src/runtime/session_record.zig +215 -0
- package/src/runtime/session_replay.zig +206 -11
- package/src/runtime/session_tests.zig +81 -0
- package/src/runtime/shell_layout.zig +1 -0
- package/src/runtime/shell_layout_tests.zig +120 -0
- package/src/runtime/sqlite_engine.zig +474 -0
- package/src/runtime/state.zig +16 -0
- package/src/runtime/system_services.zig +170 -38
- package/src/runtime/tests.zig +4 -0
- package/src/runtime/ts_core_host.zig +1067 -95
- package/src/runtime/ts_core_host_tests.zig +325 -11
- package/src/runtime/ts_ui_app.zig +953 -2
- package/src/runtime/ui_app.zig +434 -96
- package/src/runtime/ui_app_tests.zig +287 -11
- package/src/runtime/ui_app_window_tests.zig +61 -7
- package/src/runtime/validation.zig +42 -0
- package/src/runtime/view.zig +9 -0
- package/src/runtime/window_storage.zig +1 -0
- package/src/runtime/window_view_runtime.zig +2 -3
- package/src/runtime/window_views.zig +19 -0
- package/src/tooling/android.zig +21 -16
- package/src/tooling/db.zig +160 -0
- package/src/tooling/ios.zig +7 -1
- package/src/tooling/manifest.zig +214 -2
- package/src/tooling/package.zig +116 -0
- package/src/tooling/raw_manifest.zig +30 -0
- package/src/tooling/root.zig +1 -0
- package/src/tooling/templates.zig +189 -4
- package/src/tooling/ts_core.zig +366 -17
- package/src/tooling/verbs.zig +7 -0
- package/third_party/sqlite/README.md +13 -0
- package/third_party/sqlite/sqlite3.c +269649 -0
- package/third_party/sqlite/sqlite3.h +14349 -0
- package/tools/corewire/core_abi.zig +14 -2
- package/tools/corewire/emit.zig +98 -29
- package/tools/corewire/emit_facade.zig +442 -27
- package/tools/corewire/emit_profile.zig +6 -2
- package/tools/corewire/emit_service.zig +924 -0
- package/tools/corewire/main.zig +122 -0
- package/tools/corewire/service_contract.zig +250 -0
- package/tools/corewire/sidecar.zig +26 -15
|
@@ -1,4 +1,93 @@
|
|
|
1
1
|
export type { TextCaretDirection, TextCaretMove, TextSelection, TextInputEvent } from "./text.js";
|
|
2
|
+
export type StatusItemTone = "normal" | "warning" | "critical";
|
|
3
|
+
export type StatusItemMenuRole = "command" | "info" | "header" | "hero" | "agent" | "context";
|
|
4
|
+
export interface StatusItemModifiers {
|
|
5
|
+
readonly primary: boolean;
|
|
6
|
+
readonly command: boolean;
|
|
7
|
+
readonly control: boolean;
|
|
8
|
+
readonly option: boolean;
|
|
9
|
+
readonly shift: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface StatusItemPresentation {
|
|
12
|
+
readonly title: Uint8Array;
|
|
13
|
+
readonly width: number;
|
|
14
|
+
readonly tone: StatusItemTone;
|
|
15
|
+
readonly iconOpacity: number;
|
|
16
|
+
readonly monospaced: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface StatusItemMenuItem {
|
|
19
|
+
readonly id: number;
|
|
20
|
+
readonly label: Uint8Array;
|
|
21
|
+
readonly command: Uint8Array;
|
|
22
|
+
readonly separator: boolean;
|
|
23
|
+
readonly enabled: boolean;
|
|
24
|
+
readonly detail: Uint8Array;
|
|
25
|
+
readonly role: StatusItemMenuRole;
|
|
26
|
+
readonly key: Uint8Array;
|
|
27
|
+
readonly modifiers: StatusItemModifiers;
|
|
28
|
+
}
|
|
29
|
+
export interface StatusItemState {
|
|
30
|
+
readonly iconPath: Uint8Array;
|
|
31
|
+
readonly tooltip: Uint8Array;
|
|
32
|
+
readonly activationCommand: Uint8Array;
|
|
33
|
+
readonly alternateActivationCommand: Uint8Array;
|
|
34
|
+
readonly openCommand: Uint8Array;
|
|
35
|
+
readonly presentation: StatusItemPresentation;
|
|
36
|
+
readonly items: readonly StatusItemMenuItem[];
|
|
37
|
+
}
|
|
38
|
+
export interface StatusItemDescriptor {
|
|
39
|
+
readonly id: number;
|
|
40
|
+
readonly visible: boolean;
|
|
41
|
+
readonly iconPath: Uint8Array;
|
|
42
|
+
readonly tooltip: Uint8Array;
|
|
43
|
+
readonly activationCommand: Uint8Array;
|
|
44
|
+
readonly alternateActivationCommand: Uint8Array;
|
|
45
|
+
readonly openCommand: Uint8Array;
|
|
46
|
+
readonly presentation: StatusItemPresentation;
|
|
47
|
+
readonly items: readonly StatusItemMenuItem[];
|
|
48
|
+
}
|
|
49
|
+
export type WindowClosePolicy = "quit" | "hide";
|
|
50
|
+
export type WindowTitlebarStyle = "standard" | "hidden_inset" | "hidden_inset_tall" | "chromeless";
|
|
51
|
+
export interface WindowDescriptorSpec {
|
|
52
|
+
readonly label: Uint8Array;
|
|
53
|
+
readonly canvasLabel: Uint8Array;
|
|
54
|
+
readonly title?: Uint8Array;
|
|
55
|
+
readonly width?: number;
|
|
56
|
+
readonly height?: number;
|
|
57
|
+
readonly x?: number | null;
|
|
58
|
+
readonly y?: number | null;
|
|
59
|
+
readonly resizable?: boolean;
|
|
60
|
+
readonly minWidth?: number;
|
|
61
|
+
readonly minHeight?: number;
|
|
62
|
+
readonly titlebar?: WindowTitlebarStyle;
|
|
63
|
+
readonly transparent?: boolean;
|
|
64
|
+
readonly alwaysOnTop?: boolean;
|
|
65
|
+
readonly clickThrough?: boolean;
|
|
66
|
+
readonly activateOnShow?: boolean;
|
|
67
|
+
readonly allowsFullscreen?: boolean;
|
|
68
|
+
readonly closePolicy?: WindowClosePolicy;
|
|
69
|
+
readonly onCloseCommand?: Uint8Array;
|
|
70
|
+
}
|
|
71
|
+
export interface WindowDescriptor {
|
|
72
|
+
readonly label: Uint8Array;
|
|
73
|
+
readonly canvasLabel: Uint8Array;
|
|
74
|
+
readonly title: Uint8Array;
|
|
75
|
+
readonly width: number;
|
|
76
|
+
readonly height: number;
|
|
77
|
+
readonly x: number | null;
|
|
78
|
+
readonly y: number | null;
|
|
79
|
+
readonly resizable: boolean;
|
|
80
|
+
readonly minWidth: number;
|
|
81
|
+
readonly minHeight: number;
|
|
82
|
+
readonly titlebar: WindowTitlebarStyle;
|
|
83
|
+
readonly transparent: boolean;
|
|
84
|
+
readonly alwaysOnTop: boolean;
|
|
85
|
+
readonly clickThrough: boolean;
|
|
86
|
+
readonly activateOnShow: boolean;
|
|
87
|
+
readonly allowsFullscreen: boolean;
|
|
88
|
+
readonly closePolicy: WindowClosePolicy;
|
|
89
|
+
readonly onCloseCommand: Uint8Array;
|
|
90
|
+
}
|
|
2
91
|
export interface ScrollState {
|
|
3
92
|
readonly offsetX: number;
|
|
4
93
|
readonly offsetY: number;
|
|
@@ -37,9 +37,137 @@
|
|
|
37
37
|
// - `AppearanceEvent`, `ChromeEvent`, `AudioEvent`: the full arm
|
|
38
38
|
// payload shapes, canonical and importable for helper signatures
|
|
39
39
|
// (an arm value is structurally assignable to its event record).
|
|
40
|
+
// - `StatusItemState`, `StatusItemDescriptor`, and their nested records:
|
|
41
|
+
// the model-derived shell returned by `statusItem(model)` or keyed
|
|
42
|
+
// `statusItems(model)`; the generated launcher refreshes shell,
|
|
43
|
+
// presentation, visibility, and menu after committed model changes.
|
|
40
44
|
|
|
41
45
|
export type { TextCaretDirection, TextCaretMove, TextSelection, TextInputEvent } from "./text.ts";
|
|
42
46
|
|
|
47
|
+
/// One row in a menu-bar status item's menu. Non-separator rows need a
|
|
48
|
+
/// unique non-zero `id`, a non-empty `label`, and (when actionable) a
|
|
49
|
+
/// command name accepted by `commandMsg`. Rich readout roles may carry
|
|
50
|
+
/// secondary `detail`; command rows may carry a key equivalent. Spell
|
|
51
|
+
/// every field explicitly because app-core records have one exact shape.
|
|
52
|
+
/// A status item may expose at most 32 rows.
|
|
53
|
+
export type StatusItemTone = "normal" | "warning" | "critical";
|
|
54
|
+
|
|
55
|
+
export type StatusItemMenuRole = "command" | "info" | "header" | "hero" | "agent" | "context";
|
|
56
|
+
|
|
57
|
+
export interface StatusItemModifiers {
|
|
58
|
+
readonly primary: boolean;
|
|
59
|
+
readonly command: boolean;
|
|
60
|
+
readonly control: boolean;
|
|
61
|
+
readonly option: boolean;
|
|
62
|
+
readonly shift: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface StatusItemPresentation {
|
|
66
|
+
readonly title: Uint8Array;
|
|
67
|
+
readonly width: number;
|
|
68
|
+
readonly tone: StatusItemTone;
|
|
69
|
+
readonly iconOpacity: number;
|
|
70
|
+
readonly monospaced: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface StatusItemMenuItem {
|
|
74
|
+
readonly id: number;
|
|
75
|
+
readonly label: Uint8Array;
|
|
76
|
+
readonly command: Uint8Array;
|
|
77
|
+
readonly separator: boolean;
|
|
78
|
+
readonly enabled: boolean;
|
|
79
|
+
readonly detail: Uint8Array;
|
|
80
|
+
readonly role: StatusItemMenuRole;
|
|
81
|
+
readonly key: Uint8Array;
|
|
82
|
+
readonly modifiers: StatusItemModifiers;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/// The generated launcher's model-derived menu-bar status item. Export
|
|
86
|
+
/// `statusItem(model: Model): StatusItemState` from `src/core.ts`; its
|
|
87
|
+
/// shell, presentation, and rows are re-derived after every committed model
|
|
88
|
+
/// update. Byte slices are borrowed only for that apply, so returning literals
|
|
89
|
+
/// or freshly built arrays is safe.
|
|
90
|
+
export interface StatusItemState {
|
|
91
|
+
readonly iconPath: Uint8Array;
|
|
92
|
+
readonly tooltip: Uint8Array;
|
|
93
|
+
readonly activationCommand: Uint8Array;
|
|
94
|
+
readonly alternateActivationCommand: Uint8Array;
|
|
95
|
+
readonly openCommand: Uint8Array;
|
|
96
|
+
readonly presentation: StatusItemPresentation;
|
|
97
|
+
readonly items: readonly StatusItemMenuItem[];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/// One independently reconciled menu-bar status item. Export
|
|
101
|
+
/// `statusItems(model: Model): readonly StatusItemDescriptor[]`; `id`
|
|
102
|
+
/// preserves the native item while all remaining fields update live.
|
|
103
|
+
export interface StatusItemDescriptor {
|
|
104
|
+
readonly id: number;
|
|
105
|
+
readonly visible: boolean;
|
|
106
|
+
readonly iconPath: Uint8Array;
|
|
107
|
+
readonly tooltip: Uint8Array;
|
|
108
|
+
readonly activationCommand: Uint8Array;
|
|
109
|
+
readonly alternateActivationCommand: Uint8Array;
|
|
110
|
+
readonly openCommand: Uint8Array;
|
|
111
|
+
readonly presentation: StatusItemPresentation;
|
|
112
|
+
readonly items: readonly StatusItemMenuItem[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/// What the user's close affordance does for a model-declared secondary
|
|
116
|
+
/// window. `quit` really closes it and routes `onCloseCommand`; `hide` keeps
|
|
117
|
+
/// the native window and view tree alive for `Cmd.showWindow(label)`.
|
|
118
|
+
export type WindowClosePolicy = "quit" | "hide";
|
|
119
|
+
|
|
120
|
+
export type WindowTitlebarStyle = "standard" | "hidden_inset" | "hidden_inset_tall" | "chromeless";
|
|
121
|
+
|
|
122
|
+
/// Author-facing input to `windowDescriptor`; omitted fields receive the
|
|
123
|
+
/// same defaults as UiApp.WindowDescriptor.
|
|
124
|
+
export interface WindowDescriptorSpec {
|
|
125
|
+
readonly label: Uint8Array;
|
|
126
|
+
readonly canvasLabel: Uint8Array;
|
|
127
|
+
readonly title?: Uint8Array;
|
|
128
|
+
readonly width?: number;
|
|
129
|
+
readonly height?: number;
|
|
130
|
+
readonly x?: number | null;
|
|
131
|
+
readonly y?: number | null;
|
|
132
|
+
readonly resizable?: boolean;
|
|
133
|
+
readonly minWidth?: number;
|
|
134
|
+
readonly minHeight?: number;
|
|
135
|
+
readonly titlebar?: WindowTitlebarStyle;
|
|
136
|
+
readonly transparent?: boolean;
|
|
137
|
+
readonly alwaysOnTop?: boolean;
|
|
138
|
+
readonly clickThrough?: boolean;
|
|
139
|
+
readonly activateOnShow?: boolean;
|
|
140
|
+
readonly allowsFullscreen?: boolean;
|
|
141
|
+
readonly closePolicy?: WindowClosePolicy;
|
|
142
|
+
readonly onCloseCommand?: Uint8Array;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/// One independently reconciled secondary window returned by
|
|
146
|
+
/// `windows(model)`. The generated launcher compiles
|
|
147
|
+
/// `src/windows/<label>.native` as its view; presence is liveness. Construct
|
|
148
|
+
/// entries with `windowDescriptor` and spell `label` as a literal
|
|
149
|
+
/// `asciiBytes("<label>")` so check/build can prove that root exists.
|
|
150
|
+
export interface WindowDescriptor {
|
|
151
|
+
readonly label: Uint8Array;
|
|
152
|
+
readonly canvasLabel: Uint8Array;
|
|
153
|
+
readonly title: Uint8Array;
|
|
154
|
+
readonly width: number;
|
|
155
|
+
readonly height: number;
|
|
156
|
+
readonly x: number | null;
|
|
157
|
+
readonly y: number | null;
|
|
158
|
+
readonly resizable: boolean;
|
|
159
|
+
readonly minWidth: number;
|
|
160
|
+
readonly minHeight: number;
|
|
161
|
+
readonly titlebar: WindowTitlebarStyle;
|
|
162
|
+
readonly transparent: boolean;
|
|
163
|
+
readonly alwaysOnTop: boolean;
|
|
164
|
+
readonly clickThrough: boolean;
|
|
165
|
+
readonly activateOnShow: boolean;
|
|
166
|
+
readonly allowsFullscreen: boolean;
|
|
167
|
+
readonly closePolicy: WindowClosePolicy;
|
|
168
|
+
readonly onCloseCommand: Uint8Array;
|
|
169
|
+
}
|
|
170
|
+
|
|
43
171
|
/// The scroll-state mirror markup's `on-scroll` matches structurally: a
|
|
44
172
|
/// record of exactly these eight numeric fields — the TWO-AXIS shape, one
|
|
45
173
|
/// offset/velocity/viewport/content quartet per axis. Offsets and extents
|