@aotui/mobile-ai-native 0.1.0-alpha.1 → 0.1.0-alpha.2

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 (44) hide show
  1. package/dist/core/action/createActionRuntime.d.ts +3 -3
  2. package/dist/core/action/createActionRuntime.js +1 -1
  3. package/dist/core/action/defineAction.d.ts +2 -2
  4. package/dist/core/action/defineViewTypeTool.d.ts +1 -1
  5. package/dist/core/ref/ref-index.d.ts +1 -1
  6. package/dist/core/snapshot/createSnapshotBundle.d.ts +1 -1
  7. package/dist/core/snapshot/createSnapshotRegistry.d.ts +1 -1
  8. package/dist/core/snapshot/createSnapshotRegistry.js +1 -1
  9. package/dist/core/state/createStore.d.ts +1 -1
  10. package/dist/core/trace/createTraceStore.d.ts +1 -1
  11. package/dist/core/types.d.ts +1 -1
  12. package/dist/demo/inbox/InboxGUI.js +1 -1
  13. package/dist/demo/inbox/InboxTUI.d.ts +2 -2
  14. package/dist/demo/inbox/InboxTUI.js +7 -7
  15. package/dist/demo/inbox/actions.d.ts +1 -1
  16. package/dist/demo/inbox/actions.js +2 -2
  17. package/dist/demo/inbox/createInboxApp.d.ts +1 -1
  18. package/dist/demo/inbox/createInboxApp.js +9 -9
  19. package/dist/demo/inbox/effects.d.ts +2 -2
  20. package/dist/index.d.ts +23 -23
  21. package/dist/index.js +18 -18
  22. package/dist/projection/gui/AppProvider.d.ts +1 -1
  23. package/dist/projection/gui/AppProvider.js +1 -1
  24. package/dist/projection/gui/hooks.js +1 -1
  25. package/dist/projection/react/AppRuntimeProvider.d.ts +1 -1
  26. package/dist/projection/react/createReactAppRuntime.d.ts +5 -5
  27. package/dist/projection/react/createReactAppRuntime.js +7 -7
  28. package/dist/projection/react/hooks.d.ts +1 -1
  29. package/dist/projection/react/hooks.js +1 -1
  30. package/dist/projection/tui/createSnapshotAssembler.d.ts +1 -1
  31. package/dist/projection/tui/createSnapshotAssembler.js +2 -2
  32. package/dist/projection/tui/renderSnapshotDocument.d.ts +1 -1
  33. package/dist/projection/tui/renderTUI.d.ts +1 -1
  34. package/dist/projection/tui/renderTUI.js +4 -4
  35. package/dist/projection/tui/renderViewFragment.d.ts +1 -1
  36. package/dist/projection/tui/renderViewFragment.js +1 -1
  37. package/dist/ref/RefContext.d.ts +1 -1
  38. package/dist/ref/useArrayRef.js +1 -1
  39. package/dist/ref/useDataRef.js +1 -1
  40. package/dist/tool/createToolBridge.d.ts +1 -1
  41. package/dist/tool/createToolBridge.js +1 -1
  42. package/dist/version.d.ts +1 -1
  43. package/dist/version.js +1 -1
  44. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
- import type { ActionDefinition } from "./defineAction";
2
- import type { EffectMap } from "../effect/types";
3
- import type { ActionResult, Store, ToolDefinition, TraceStore } from "../types";
1
+ import type { ActionDefinition } from "./defineAction.js";
2
+ import type { EffectMap } from "../effect/types.js";
3
+ import type { ActionResult, Store, ToolDefinition, TraceStore } from "../types.js";
4
4
  export declare function createActionRuntime<State, Event>(config: {
5
5
  store: Store<State, Event>;
6
6
  actions: Array<ActionDefinition<State, Event, any>>;
@@ -1,4 +1,4 @@
1
- import { createTraceStore } from "../trace/createTraceStore";
1
+ import { createTraceStore } from "../trace/createTraceStore.js";
2
2
  export function createActionRuntime(config) {
3
3
  const actionsByName = new Map(config.actions.map((action) => [action.name, action]));
4
4
  const traceStore = config.traceStore ?? createTraceStore();
@@ -1,6 +1,6 @@
1
1
  import type { ZodType } from "zod";
2
- import type { EffectResult } from "../effect/types";
3
- import type { ActionResult, ToolMetadata } from "../types";
2
+ import type { EffectResult } from "../effect/types.js";
3
+ import type { ActionResult, ToolMetadata } from "../types.js";
4
4
  export type ActionContext<State, Event> = {
5
5
  getState(): State;
6
6
  emit(event: Event): void;
@@ -1,4 +1,4 @@
1
- import type { ActionDefinition } from "./defineAction";
1
+ import type { ActionDefinition } from "./defineAction.js";
2
2
  export type ViewTypeToolActionDefinition<State, Event, Input> = ActionDefinition<State, Event, Input> & {
3
3
  readonly viewType: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { RefIndexEntry } from "../types";
1
+ import type { RefIndexEntry } from "../types.js";
2
2
  export declare function createRefCollector(): {
3
3
  register(refId: string, entry: RefIndexEntry): void;
4
4
  snapshot(): Record<string, RefIndexEntry>;
@@ -1,4 +1,4 @@
1
- import type { SnapshotBundle, ToolDefinition, RefIndexEntry, ViewFragment } from "../types";
1
+ import type { SnapshotBundle, ToolDefinition, RefIndexEntry, ViewFragment } from "../types.js";
2
2
  export declare function hardenSnapshotBundle(snapshot: SnapshotBundle): SnapshotBundle;
3
3
  export declare function createSnapshotBundle(input: {
4
4
  markup?: string;
@@ -1,4 +1,4 @@
1
- import type { SnapshotRegistry } from "../types";
1
+ import type { SnapshotRegistry } from "../types.js";
2
2
  export declare function createSnapshotRegistry(config?: {
3
3
  maxEntries?: number;
4
4
  }): SnapshotRegistry;
@@ -1,4 +1,4 @@
1
- import { hardenSnapshotBundle } from "./createSnapshotBundle";
1
+ import { hardenSnapshotBundle } from "./createSnapshotBundle.js";
2
2
  function evictOldSnapshots(snapshots, maxEntries) {
3
3
  while (snapshots.size > maxEntries) {
4
4
  const oldestSnapshotId = snapshots.keys().next().value;
@@ -1,4 +1,4 @@
1
- import type { StateReducer, Store } from "../types";
1
+ import type { StateReducer, Store } from "../types.js";
2
2
  export declare function createStore<State, Event>(config: {
3
3
  initialState: State;
4
4
  reduce: StateReducer<State, Event>;
@@ -1,2 +1,2 @@
1
- import type { TraceStore } from "./types";
1
+ import type { TraceStore } from "./types.js";
2
2
  export declare function createTraceStore(): TraceStore;
@@ -1,6 +1,6 @@
1
1
  import type { ComponentChild } from "preact";
2
2
  import type { ZodTypeAny } from "zod";
3
- export type { TraceRecord, TraceState, TraceStatus, TraceStore, } from "./trace/types";
3
+ export type { TraceRecord, TraceState, TraceStatus, TraceStore, } from "./trace/types.js";
4
4
  export type StateReducer<State, Event> = (state: State, event: Event) => State;
5
5
  export type StoreListener = () => void;
6
6
  export type StoreUnsubscribe = () => void;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
2
2
  /** @jsxImportSource preact */
3
- import { useRuntimeState } from "../../projection/react/hooks";
3
+ import { useRuntimeState } from "../../projection/react/hooks.js";
4
4
  export function InboxGUI() {
5
5
  const recentTrace = useRuntimeState((state) => state.shell.recentTrace ?? "");
6
6
  const openedMessageId = useRuntimeState((state) => state.inbox.openedMessageId ?? "");
@@ -1,3 +1,3 @@
1
- import type { ToolDefinition } from "../../core/types";
2
- import type { InboxState } from "./state";
1
+ import type { ToolDefinition } from "../../core/types.js";
2
+ import type { InboxState } from "./state.js";
3
3
  export declare function createInboxSnapshotBundle(state: InboxState, visibleTools: readonly ToolDefinition[]): import("../..").SnapshotBundle;
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "preact/jsx-runtime";
2
2
  /** @jsxImportSource preact */
3
3
  import renderToString from "preact-render-to-string";
4
- import { createRefCollector } from "../../core/ref/ref-index";
5
- import { createSnapshotAssembler } from "../../projection/tui/createSnapshotAssembler";
6
- import { renderViewFragment } from "../../projection/tui/renderViewFragment";
7
- import { RefProvider } from "../../ref/RefContext";
8
- import { useDataRef } from "../../ref/useDataRef";
9
- import { useArrayRef } from "../../ref/useArrayRef";
10
- import { isInboxSearchActive, } from "./state";
4
+ import { createRefCollector } from "../../core/ref/ref-index.js";
5
+ import { createSnapshotAssembler } from "../../projection/tui/createSnapshotAssembler.js";
6
+ import { renderViewFragment } from "../../projection/tui/renderViewFragment.js";
7
+ import { RefProvider } from "../../ref/RefContext.js";
8
+ import { useDataRef } from "../../ref/useDataRef.js";
9
+ import { useArrayRef } from "../../ref/useArrayRef.js";
10
+ import { isInboxSearchActive, } from "./state.js";
11
11
  function InboxRootContent() {
12
12
  return (_jsxs(_Fragment, { children: [_jsx("text", { children: "App Navigation" }), _jsx("text", { children: "Semantic view graph" }), _jsx("item", { children: "Inbox: primary message list view." }), _jsx("item", { children: "Enter Inbox: mounted by default when the app opens." }), _jsx("item", { children: "Inbox actions: openMessage." }), _jsx("item", { children: "InboxSearch: focused search/results view for inbox queries." }), _jsx("item", { children: "Enter InboxSearch: use searchMessages when inbox search is relevant." }), _jsx("item", { children: "InboxSearch actions: searchMessages." }), _jsx("item", { children: "MessageDetail: opened message detail view." }), _jsx("item", { children: "Enter MessageDetail: use openMessage from Inbox." }), _jsx("item", { children: "MessageDetail actions: inspect the opened message state." })] }));
13
13
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { InboxEvent, InboxState } from "./state";
2
+ import type { InboxEvent, InboxState } from "./state.js";
3
3
  declare const inboxMessageSchema: z.ZodObject<{
4
4
  id: z.ZodString;
5
5
  subject: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { defineViewTypeTool } from "../../core/action/defineViewTypeTool";
3
- import { isInboxSearchActive, isInboxSearchRelevant } from "./state";
2
+ import { defineViewTypeTool } from "../../core/action/defineViewTypeTool.js";
3
+ import { isInboxSearchActive, isInboxSearchRelevant } from "./state.js";
4
4
  const inboxMessageSchema = z.object({
5
5
  id: z.string(),
6
6
  subject: z.string(),
@@ -1,4 +1,4 @@
1
- import { type InboxMessage } from "./state";
1
+ import { type InboxMessage } from "./state.js";
2
2
  export declare function createInboxApp(config: {
3
3
  initialMessages: InboxMessage[];
4
4
  }): {
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx } from "preact/jsx-runtime";
2
2
  /** @jsxImportSource preact */
3
3
  import renderToString from "preact-render-to-string";
4
- import { createActionRuntime } from "../../core/action/createActionRuntime";
5
- import { createStore } from "../../core/state/createStore";
6
- import { AppProvider } from "../../projection/gui/AppProvider";
7
- import { createToolBridge } from "../../tool/createToolBridge";
8
- import { createInboxActions } from "./actions";
9
- import { createInboxEffects } from "./effects";
10
- import { InboxGUI } from "./InboxGUI";
11
- import { createInboxSnapshotBundle, } from "./InboxTUI";
12
- import { createInitialInboxState, getInboxRelevantViewTypes, reduceInboxState, } from "./state";
4
+ import { createActionRuntime } from "../../core/action/createActionRuntime.js";
5
+ import { createStore } from "../../core/state/createStore.js";
6
+ import { AppProvider } from "../../projection/gui/AppProvider.js";
7
+ import { createToolBridge } from "../../tool/createToolBridge.js";
8
+ import { createInboxActions } from "./actions.js";
9
+ import { createInboxEffects } from "./effects.js";
10
+ import { InboxGUI } from "./InboxGUI.js";
11
+ import { createInboxSnapshotBundle, } from "./InboxTUI.js";
12
+ import { createInitialInboxState, getInboxRelevantViewTypes, reduceInboxState, } from "./state.js";
13
13
  export function createInboxApp(config) {
14
14
  const store = createStore({
15
15
  initialState: createInitialInboxState(config.initialMessages),
@@ -1,5 +1,5 @@
1
- import type { InboxEvent, InboxMessage, InboxState } from "./state";
2
- import type { EffectContext, EffectResult } from "../../core/effect/types";
1
+ import type { InboxEvent, InboxMessage, InboxState } from "./state.js";
2
+ import type { EffectContext, EffectResult } from "../../core/effect/types.js";
3
3
  export declare function createInboxEffects(allMessages: InboxMessage[]): {
4
4
  searchMessages(ctx: EffectContext<InboxState, InboxEvent>, input: {
5
5
  query: string;
package/dist/index.d.ts CHANGED
@@ -1,25 +1,25 @@
1
- import { createSnapshotBundle } from "./core/snapshot/createSnapshotBundle";
2
- import { VERSION } from "./version";
1
+ import { createSnapshotBundle } from "./core/snapshot/createSnapshotBundle.js";
2
+ import { VERSION } from "./version.js";
3
3
  export { VERSION };
4
- export { createStore } from "./core/state/createStore";
4
+ export { createStore } from "./core/state/createStore.js";
5
5
  export { createSnapshotBundle };
6
- export type { RefIndexEntry, MountedViewDescriptor, SnapshotBundle, TraceState, ToolDefinition, StaticViewCatalogEntry, SnapshotAssemblerInput, ViewFragment, } from "./core/types";
7
- export type { EffectContext, EffectFailure, EffectHandler, EffectMap, EffectResult, EffectSuccess, EffectTrace, } from "./core/effect/types";
8
- export type { ActionContext, ActionDefinition, } from "./core/action/defineAction";
9
- export type { ViewTypeToolActionDefinition, } from "./core/action/defineViewTypeTool";
10
- export { defineAction } from "./core/action/defineAction";
11
- export { defineViewTypeTool } from "./core/action/defineViewTypeTool";
12
- export { createActionRuntime } from "./core/action/createActionRuntime";
13
- export { createToolBridge } from "./tool/createToolBridge";
14
- export { useDataRef } from "./ref/useDataRef";
15
- export { useArrayRef } from "./ref/useArrayRef";
16
- export { View } from "./projection/tui/View";
17
- export { createSnapshotAssembler } from "./projection/tui/createSnapshotAssembler";
18
- export { renderTUI } from "./projection/tui/renderTUI";
19
- export { createReactAppRuntime } from "./projection/react/createReactAppRuntime";
20
- export type { ReactAppDefinition, ReactAppRuntime, RuntimeTrace, } from "./projection/react/createReactAppRuntime";
21
- export { AppRuntimeProvider } from "./projection/react/AppRuntimeProvider";
22
- export { useAppRuntime, useRuntimeActions, useRuntimeState, useRuntimeTrace } from "./projection/react/hooks";
23
- export { AppProvider } from "./projection/gui/AppProvider";
24
- export { useAppState, useActions } from "./projection/gui/hooks";
25
- export { createInboxApp } from "./demo/inbox/createInboxApp";
6
+ export type { RefIndexEntry, MountedViewDescriptor, SnapshotBundle, TraceState, ToolDefinition, StaticViewCatalogEntry, SnapshotAssemblerInput, ViewFragment, } from "./core/types.js";
7
+ export type { EffectContext, EffectFailure, EffectHandler, EffectMap, EffectResult, EffectSuccess, EffectTrace, } from "./core/effect/types.js";
8
+ export type { ActionContext, ActionDefinition, } from "./core/action/defineAction.js";
9
+ export type { ViewTypeToolActionDefinition, } from "./core/action/defineViewTypeTool.js";
10
+ export { defineAction } from "./core/action/defineAction.js";
11
+ export { defineViewTypeTool } from "./core/action/defineViewTypeTool.js";
12
+ export { createActionRuntime } from "./core/action/createActionRuntime.js";
13
+ export { createToolBridge } from "./tool/createToolBridge.js";
14
+ export { useDataRef } from "./ref/useDataRef.js";
15
+ export { useArrayRef } from "./ref/useArrayRef.js";
16
+ export { View } from "./projection/tui/View.js";
17
+ export { createSnapshotAssembler } from "./projection/tui/createSnapshotAssembler.js";
18
+ export { renderTUI } from "./projection/tui/renderTUI.js";
19
+ export { createReactAppRuntime } from "./projection/react/createReactAppRuntime.js";
20
+ export type { ReactAppDefinition, ReactAppRuntime, RuntimeTrace, } from "./projection/react/createReactAppRuntime.js";
21
+ export { AppRuntimeProvider } from "./projection/react/AppRuntimeProvider.js";
22
+ export { useAppRuntime, useRuntimeActions, useRuntimeState, useRuntimeTrace } from "./projection/react/hooks.js";
23
+ export { AppProvider } from "./projection/gui/AppProvider.js";
24
+ export { useAppState, useActions } from "./projection/gui/hooks.js";
25
+ export { createInboxApp } from "./demo/inbox/createInboxApp.js";
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
- import { createSnapshotBundle } from "./core/snapshot/createSnapshotBundle";
2
- import { VERSION } from "./version";
1
+ import { createSnapshotBundle } from "./core/snapshot/createSnapshotBundle.js";
2
+ import { VERSION } from "./version.js";
3
3
  export { VERSION };
4
- export { createStore } from "./core/state/createStore";
4
+ export { createStore } from "./core/state/createStore.js";
5
5
  export { createSnapshotBundle };
6
- export { defineAction } from "./core/action/defineAction";
7
- export { defineViewTypeTool } from "./core/action/defineViewTypeTool";
8
- export { createActionRuntime } from "./core/action/createActionRuntime";
9
- export { createToolBridge } from "./tool/createToolBridge";
10
- export { useDataRef } from "./ref/useDataRef";
11
- export { useArrayRef } from "./ref/useArrayRef";
12
- export { View } from "./projection/tui/View";
13
- export { createSnapshotAssembler } from "./projection/tui/createSnapshotAssembler";
14
- export { renderTUI } from "./projection/tui/renderTUI";
15
- export { createReactAppRuntime } from "./projection/react/createReactAppRuntime";
16
- export { AppRuntimeProvider } from "./projection/react/AppRuntimeProvider";
17
- export { useAppRuntime, useRuntimeActions, useRuntimeState, useRuntimeTrace } from "./projection/react/hooks";
18
- export { AppProvider } from "./projection/gui/AppProvider";
19
- export { useAppState, useActions } from "./projection/gui/hooks";
20
- export { createInboxApp } from "./demo/inbox/createInboxApp";
6
+ export { defineAction } from "./core/action/defineAction.js";
7
+ export { defineViewTypeTool } from "./core/action/defineViewTypeTool.js";
8
+ export { createActionRuntime } from "./core/action/createActionRuntime.js";
9
+ export { createToolBridge } from "./tool/createToolBridge.js";
10
+ export { useDataRef } from "./ref/useDataRef.js";
11
+ export { useArrayRef } from "./ref/useArrayRef.js";
12
+ export { View } from "./projection/tui/View.js";
13
+ export { createSnapshotAssembler } from "./projection/tui/createSnapshotAssembler.js";
14
+ export { renderTUI } from "./projection/tui/renderTUI.js";
15
+ export { createReactAppRuntime } from "./projection/react/createReactAppRuntime.js";
16
+ export { AppRuntimeProvider } from "./projection/react/AppRuntimeProvider.js";
17
+ export { useAppRuntime, useRuntimeActions, useRuntimeState, useRuntimeTrace } from "./projection/react/hooks.js";
18
+ export { AppProvider } from "./projection/gui/AppProvider.js";
19
+ export { useAppState, useActions } from "./projection/gui/hooks.js";
20
+ export { createInboxApp } from "./demo/inbox/createInboxApp.js";
@@ -1,5 +1,5 @@
1
1
  import type { ComponentChildren } from "preact";
2
- import type { ActionResult, Store, ToolDefinition } from "../../core/types";
2
+ import type { ActionResult, Store, ToolDefinition } from "../../core/types.js";
3
3
  type LegacyAppContextValue = {
4
4
  store: Store<unknown, unknown>;
5
5
  actionRuntime: {
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "preact/jsx-runtime";
2
2
  /** @jsxImportSource preact */
3
3
  import { createContext } from "preact";
4
4
  import { useContext, useMemo } from "preact/hooks";
5
- import { AppRuntimeProvider } from "../react/AppRuntimeProvider";
5
+ import { AppRuntimeProvider } from "../react/AppRuntimeProvider.js";
6
6
  const AppContext = createContext(null);
7
7
  function createCompatibilityRuntime(value) {
8
8
  let nextTraceId = 1;
@@ -1,4 +1,4 @@
1
- import { useRuntimeActions, useRuntimeState } from "../react/hooks";
1
+ import { useRuntimeActions, useRuntimeState } from "../react/hooks.js";
2
2
  export function useAppState() {
3
3
  return {
4
4
  state: useRuntimeState((state) => state),
@@ -1,5 +1,5 @@
1
1
  import type { ComponentChildren } from "preact";
2
- import type { ReactAppRuntime, RuntimeTrace } from "./createReactAppRuntime";
2
+ import type { ReactAppRuntime, RuntimeTrace } from "./createReactAppRuntime.js";
3
3
  export type AppRuntime<State = unknown, Event = unknown> = ReactAppRuntime<State, Event> & {
4
4
  trace: RuntimeTrace;
5
5
  };
@@ -1,8 +1,8 @@
1
- import { createActionRuntime } from "../../core/action/createActionRuntime";
2
- import type { ActionDefinition } from "../../core/action/defineAction";
3
- import type { EffectMap } from "../../core/effect/types";
4
- import type { ActionResult, SnapshotBundle, SnapshotRegistry, StateReducer, Store, ToolDefinition, TraceRecord, TraceState, TraceStore } from "../../core/types";
5
- import { createToolBridge } from "../../tool/createToolBridge";
1
+ import { createActionRuntime } from "../../core/action/createActionRuntime.js";
2
+ import type { ActionDefinition } from "../../core/action/defineAction.js";
3
+ import type { EffectMap } from "../../core/effect/types.js";
4
+ import type { ActionResult, SnapshotBundle, SnapshotRegistry, StateReducer, Store, ToolDefinition, TraceRecord, TraceState, TraceStore } from "../../core/types.js";
5
+ import { createToolBridge } from "../../tool/createToolBridge.js";
6
6
  export type ReactAppDefinition<State, Event> = {
7
7
  initialState: State;
8
8
  reduce: StateReducer<State, Event>;
@@ -1,10 +1,10 @@
1
- import { createActionRuntime } from "../../core/action/createActionRuntime";
2
- import { createSnapshotRegistry } from "../../core/snapshot/createSnapshotRegistry";
3
- import { createStore } from "../../core/state/createStore";
4
- import { createTraceStore } from "../../core/trace/createTraceStore";
5
- import { createSnapshotAssembler } from "../tui/createSnapshotAssembler";
6
- import { renderViewFragment } from "../tui/renderViewFragment";
7
- import { createToolBridge } from "../../tool/createToolBridge";
1
+ import { createActionRuntime } from "../../core/action/createActionRuntime.js";
2
+ import { createSnapshotRegistry } from "../../core/snapshot/createSnapshotRegistry.js";
3
+ import { createStore } from "../../core/state/createStore.js";
4
+ import { createTraceStore } from "../../core/trace/createTraceStore.js";
5
+ import { createSnapshotAssembler } from "../tui/createSnapshotAssembler.js";
6
+ import { renderViewFragment } from "../tui/renderViewFragment.js";
7
+ import { createToolBridge } from "../../tool/createToolBridge.js";
8
8
  export function createReactAppRuntime(app) {
9
9
  const store = createStore({
10
10
  initialState: app.initialState,
@@ -1,4 +1,4 @@
1
- import type { TraceState } from "../../core/types";
1
+ import type { TraceState } from "../../core/types.js";
2
2
  export declare function useAppRuntime(): import("./AppRuntimeProvider").AppRuntime<unknown, unknown>;
3
3
  export declare function useRuntimeState<State, Selected>(selector: (state: State) => Selected): Selected;
4
4
  export declare function useRuntimeActions(): {
@@ -1,5 +1,5 @@
1
1
  import { useSyncExternalStore } from "preact/compat";
2
- import { useAppRuntimeContext } from "./AppRuntimeProvider";
2
+ import { useAppRuntimeContext } from "./AppRuntimeProvider.js";
3
3
  export function useAppRuntime() {
4
4
  return useAppRuntimeContext();
5
5
  }
@@ -1,2 +1,2 @@
1
- import type { SnapshotAssemblerInput, SnapshotBundle } from "../../core/types";
1
+ import type { SnapshotAssemblerInput, SnapshotBundle } from "../../core/types.js";
2
2
  export declare function createSnapshotAssembler<State>(input: SnapshotAssemblerInput<State>): SnapshotBundle;
@@ -1,5 +1,5 @@
1
- import { createSnapshotBundle } from "../../core/snapshot/createSnapshotBundle";
2
- import { renderSnapshotDocument } from "./renderSnapshotDocument";
1
+ import { createSnapshotBundle } from "../../core/snapshot/createSnapshotBundle.js";
2
+ import { renderSnapshotDocument } from "./renderSnapshotDocument.js";
3
3
  export function createSnapshotAssembler(input) {
4
4
  const views = [input.rootView, ...input.mountedViews];
5
5
  const markup = renderSnapshotDocument(views);
@@ -1,2 +1,2 @@
1
- import type { ViewFragment } from "../../core/types";
1
+ import type { ViewFragment } from "../../core/types.js";
2
2
  export declare function renderSnapshotDocument(views: readonly ViewFragment[]): string;
@@ -1,6 +1,6 @@
1
1
  /** @jsxImportSource preact */
2
2
  import type { ComponentChild } from "preact";
3
- import type { ToolDefinition } from "../../core/types";
3
+ import type { ToolDefinition } from "../../core/types.js";
4
4
  export declare function renderTUI(node: ComponentChild, options: {
5
5
  visibleTools: ToolDefinition[];
6
6
  }): import("../..").SnapshotBundle;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "preact/jsx-runtime";
2
2
  import renderToString from "preact-render-to-string";
3
- import { createRefCollector } from "../../core/ref/ref-index";
4
- import { RefProvider } from "../../ref/RefContext";
5
- import { renderViewFragment } from "./renderViewFragment";
6
- import { createSnapshotAssembler } from "./createSnapshotAssembler";
3
+ import { createRefCollector } from "../../core/ref/ref-index.js";
4
+ import { RefProvider } from "../../ref/RefContext.js";
5
+ import { renderViewFragment } from "./renderViewFragment.js";
6
+ import { createSnapshotAssembler } from "./createSnapshotAssembler.js";
7
7
  export function renderTUI(node, options) {
8
8
  const collector = createRefCollector();
9
9
  const renderedNode = _jsx(RefProvider, { registry: collector, children: node });
@@ -1,5 +1,5 @@
1
1
  import type { ComponentChildren } from "preact";
2
- import type { ViewFragment } from "../../core/types";
2
+ import type { ViewFragment } from "../../core/types.js";
3
3
  export type RenderViewFragmentInput = {
4
4
  readonly id: string;
5
5
  readonly type: string;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "preact/jsx-runtime";
2
2
  /** @jsxImportSource preact */
3
3
  import renderToString from "preact-render-to-string";
4
- import { View } from "./View";
4
+ import { View } from "./View.js";
5
5
  export function renderViewFragment(input) {
6
6
  const content = input.markup !== undefined
7
7
  ? { dangerouslySetInnerHTML: { __html: input.markup } }
@@ -1,5 +1,5 @@
1
1
  import type { ComponentChildren } from "preact";
2
- import type { RefIndexEntry } from "../core/types";
2
+ import type { RefIndexEntry } from "../core/types.js";
3
3
  type RefRegistry = {
4
4
  register(refId: string, entry: RefIndexEntry): void;
5
5
  };
@@ -1,4 +1,4 @@
1
- import { useRefRegistry } from "./RefContext";
1
+ import { useRefRegistry } from "./RefContext.js";
2
2
  export function useArrayRef(type, data, refId) {
3
3
  const registry = useRefRegistry();
4
4
  const listRef = (content) => {
@@ -1,4 +1,4 @@
1
- import { useRefRegistry } from "./RefContext";
1
+ import { useRefRegistry } from "./RefContext.js";
2
2
  export function useDataRef(type, data, refId) {
3
3
  const registry = useRefRegistry();
4
4
  return (content) => {
@@ -1,4 +1,4 @@
1
- import type { SnapshotBundle, ActionResult, SnapshotRegistry, ToolDefinition } from "../core/types";
1
+ import type { SnapshotBundle, ActionResult, SnapshotRegistry, ToolDefinition } from "../core/types.js";
2
2
  export declare function createToolBridge(config: {
3
3
  actionRuntime: {
4
4
  listVisibleTools(): ToolDefinition[];
@@ -1,4 +1,4 @@
1
- import { createSnapshotRegistry } from "../core/snapshot/createSnapshotRegistry";
1
+ import { createSnapshotRegistry } from "../core/snapshot/createSnapshotRegistry.js";
2
2
  const DATA_REF_MARKER_PATTERN = /^\((?:[\s\S]*)\)\[[^:\]]+:(.+)\]$/;
3
3
  const REF_ID_PATTERN = /^[A-Za-z0-9_.-]+(?:\[[^\]]+\])*$/;
4
4
  function getExplicitRefId(value) {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.1.0-alpha.1";
1
+ export declare const VERSION = "0.1.0-alpha.2";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.1.0-alpha.1";
1
+ export const VERSION = "0.1.0-alpha.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aotui/mobile-ai-native",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.2",
4
4
  "description": "Alpha host-agnostic core for building Agent Native mobile apps with shared GUI/TUI state and snapshot-scoped tool execution.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "scripts": {
43
43
  "clean": "rm -rf dist",
44
- "build": "pnpm run clean && tsc -p tsconfig.json",
44
+ "build": "pnpm run clean && tsc -p tsconfig.json && node ../scripts/fix-relative-import-extensions.mjs ./dist",
45
45
  "test": "vitest",
46
46
  "test:run": "vitest --run"
47
47
  }