@feedmepos/mf-miniprogram-v2 0.1.0-dev.22 → 0.1.0-dev.24

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/dist/app.js CHANGED
@@ -3,7 +3,7 @@ const n = [
3
3
  {
4
4
  path: "/",
5
5
  name: "miniprogram-v2-control",
6
- component: () => import("./ControlPlaneView-zIaLc8qc.js")
6
+ component: () => import("./ControlPlaneView-DVeW58te.js")
7
7
  },
8
8
  {
9
9
  path: "/:pathMatch(.*)*",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-miniprogram-v2",
3
- "version": "0.1.0-dev.22",
3
+ "version": "0.1.0-dev.24",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -23,7 +23,7 @@
23
23
  "build": "npm run type-check && npm run build-only:dev",
24
24
  "build:prod": "npm run type-check && npm run build-only:prod",
25
25
  "preview": "vite preview",
26
- "test": "node --test src/components/PreviewPanel.test.mjs",
26
+ "test": "node --test src/components/*.test.mjs src/composables/*.test.mjs",
27
27
  "type-check": "vue-tsc --build --force",
28
28
  "typecheck": "npm run type-check",
29
29
  "build:mf:dev": "vite build --mode fmmf:dev",
@@ -0,0 +1,7 @@
1
+ import type { QuickEditHistoryItem } from '../composables/quickEdit';
2
+ type __VLS_Props = {
3
+ item: QuickEditHistoryItem;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,26 @@
1
+ import { type QuickEditFieldStatus, type QuickEditSelection, type QuickEditValue } from '../composables/quickEdit';
2
+ type __VLS_Props = {
3
+ selection: QuickEditSelection;
4
+ statuses: Record<string, QuickEditFieldStatus>;
5
+ reasons: Record<string, string>;
6
+ busy?: boolean;
7
+ error?: string | null;
8
+ uploadAsset: (file: File) => Promise<string>;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ change: (payload: {
12
+ prop: string;
13
+ value: QuickEditValue;
14
+ }) => any;
15
+ confirm: () => any;
16
+ cancel: () => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ onChange?: ((payload: {
19
+ prop: string;
20
+ value: QuickEditValue;
21
+ }) => any) | undefined;
22
+ onConfirm?: (() => any) | undefined;
23
+ onCancel?: (() => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
@@ -0,0 +1,20 @@
1
+ export interface PromptQueueState<T> {
2
+ pending: readonly T[];
3
+ active: T | null;
4
+ }
5
+ export declare function emptyPromptQueue<T>(): PromptQueueState<T>;
6
+ export declare function enqueuePrompt<T>(queue: PromptQueueState<T>, item: T): PromptQueueState<T>;
7
+ export declare function startNextPrompt<T>(queue: PromptQueueState<T>): {
8
+ queue: PromptQueueState<T>;
9
+ item: T | null;
10
+ };
11
+ export declare function finishActivePrompt<T>(queue: PromptQueueState<T>): {
12
+ queue: PromptQueueState<T>;
13
+ item: T | null;
14
+ };
15
+ export interface AscendingMessageIdState {
16
+ lastTimestamp: number;
17
+ counter: number;
18
+ }
19
+ export declare function createAscendingMessageIdState(): AscendingMessageIdState;
20
+ export declare function makeOpencodeMessageId(state: AscendingMessageIdState, timestamp?: number, randomBytes?: Uint8Array): string;
@@ -0,0 +1,73 @@
1
+ export type QuickEditControl = 'text' | 'textarea' | 'image' | 'color' | 'select' | 'number' | 'boolean';
2
+ export interface QuickEditOption {
3
+ value: string;
4
+ label: string;
5
+ }
6
+ export interface QuickEditField {
7
+ control: QuickEditControl;
8
+ label: string;
9
+ binding?: 'static' | 'data';
10
+ maxLength?: number;
11
+ accept?: string[];
12
+ options?: QuickEditOption[];
13
+ min?: number;
14
+ max?: number;
15
+ step?: number;
16
+ }
17
+ export type QuickEditValue = string | number | boolean;
18
+ export type QuickEditLocate = 'usage-site' | 'component-own' | 'ambiguous-vfor';
19
+ export interface QuickEditSelection {
20
+ matched: true;
21
+ component: string;
22
+ label: string;
23
+ schema: Record<string, QuickEditField>;
24
+ values: Record<string, QuickEditValue>;
25
+ presentProps?: Record<string, boolean>;
26
+ rect: {
27
+ x: number;
28
+ y: number;
29
+ width: number;
30
+ height: number;
31
+ } | null;
32
+ source: {
33
+ usageFile: string;
34
+ componentFile: string;
35
+ inspector: string | null;
36
+ inspectorVia?: 'vnode' | 'dom' | null;
37
+ locate: QuickEditLocate;
38
+ inVFor: boolean;
39
+ instanceKey: string | number | null;
40
+ };
41
+ }
42
+ export type QuickEditFieldStatus = 'idle' | 'applying' | 'applied' | 'escalated' | 'error';
43
+ export interface QuickEditApplyResult {
44
+ prop: string;
45
+ status: 'applied' | 'escalated';
46
+ reason?: string;
47
+ }
48
+ export interface QuickEditApplyResponse {
49
+ ok: boolean;
50
+ applied: QuickEditApplyResult[];
51
+ escalated: QuickEditApplyResult[];
52
+ results: QuickEditApplyResult[];
53
+ preview: boolean;
54
+ }
55
+ export interface QuickEditHistoryItem {
56
+ component: string;
57
+ file: string;
58
+ edits: Array<{
59
+ prop: string;
60
+ value: QuickEditValue;
61
+ reason?: string;
62
+ }>;
63
+ fallback: boolean;
64
+ }
65
+ export declare function wrapQuickEditPayload(item: QuickEditHistoryItem): string;
66
+ export declare function parseQuickEditMessage(text: string): QuickEditHistoryItem | null;
67
+ export declare function quickEditValueError(field: QuickEditField, value: unknown): string | null;
68
+ export declare function quickEditShortFile(path: string): string;
69
+ export declare function buildQuickEditFallbackPrompt(selection: QuickEditSelection, edits: Array<{
70
+ prop: string;
71
+ value: QuickEditValue;
72
+ reason: string;
73
+ }>): string;
@@ -39,11 +39,11 @@ export interface OutgoingAttachment {
39
39
  filename?: string;
40
40
  url: string;
41
41
  }
42
+ export type PromptState = 'queued' | 'submitting' | 'running' | 'failed';
42
43
  export interface ChatMessage {
43
- /** Stable render key. Starts as `local-{partId}` for our own just-sent
44
- * messages (the real message id isn't known until the server echoes it
45
- * back over the event stream) and never changes after that, so v-for
46
- * keys stay stable even once `id` is reconciled to the real one. */
44
+ /** Stable render key. Starts as `local-{uuid}` for queued prompts and never
45
+ * changes; the OpenCode message id is assigned only when that prompt reaches
46
+ * the head of the FIFO, so v-for identity remains stable after dispatch. */
47
47
  key: string;
48
48
  id: string | null;
49
49
  role: 'user' | 'assistant';
@@ -58,6 +58,9 @@ export interface ChatMessage {
58
58
  changedFiles: string[];
59
59
  diffs: CodeFileDiff[];
60
60
  busy: boolean;
61
+ /** Present only on locally-originated user prompts while they are waiting
62
+ * for, or being handled by, the OpenCode session runner. */
63
+ promptState?: PromptState;
61
64
  errorText?: string;
62
65
  }
63
66
  export type ConnectionStatus = 'idle' | 'starting' | 'ready' | 'error';
@@ -6,12 +6,138 @@ export declare function useChat(): {
6
6
  restartingPreview: boolean;
7
7
  previewRestartError: string | null;
8
8
  sending: boolean;
9
+ agentBusy: boolean;
9
10
  sessionId: string | null;
10
11
  workspaceSessionId: string | null;
12
+ businessId: string | null;
11
13
  readOnly: boolean;
12
14
  disconnected: boolean;
13
15
  messagesOrder: string[];
14
16
  messagesByKey: Record<string, ChatMessage>;
17
+ queuedMessages: {
18
+ key: string;
19
+ id: string | null;
20
+ role: "user" | "assistant";
21
+ parentId: string | null;
22
+ createdAt: number;
23
+ parts: ({
24
+ kind: "text";
25
+ id: string;
26
+ text: string;
27
+ } | {
28
+ kind: "reasoning";
29
+ id: string;
30
+ text: string;
31
+ } | {
32
+ kind: "tool";
33
+ id: string;
34
+ tool: string;
35
+ state: {
36
+ status: "pending";
37
+ input: {
38
+ [key: string]: unknown;
39
+ };
40
+ raw: string;
41
+ } | {
42
+ status: "running";
43
+ input: {
44
+ [key: string]: unknown;
45
+ };
46
+ title?: string | undefined;
47
+ metadata?: {
48
+ [key: string]: unknown;
49
+ } | undefined;
50
+ time: {
51
+ start: number;
52
+ };
53
+ } | {
54
+ status: "completed";
55
+ input: {
56
+ [key: string]: unknown;
57
+ };
58
+ output: string;
59
+ title: string;
60
+ metadata: {
61
+ [key: string]: unknown;
62
+ };
63
+ time: {
64
+ start: number;
65
+ end: number;
66
+ compacted?: number | undefined;
67
+ };
68
+ attachments?: {
69
+ id: string;
70
+ sessionID: string;
71
+ messageID: string;
72
+ type: "file";
73
+ mime: string;
74
+ filename?: string | undefined;
75
+ url: string;
76
+ source?: {
77
+ text: {
78
+ value: string;
79
+ start: number;
80
+ end: number;
81
+ };
82
+ type: "file";
83
+ path: string;
84
+ } | {
85
+ text: {
86
+ value: string;
87
+ start: number;
88
+ end: number;
89
+ };
90
+ type: "symbol";
91
+ path: string;
92
+ range: {
93
+ start: {
94
+ line: number;
95
+ character: number;
96
+ };
97
+ end: {
98
+ line: number;
99
+ character: number;
100
+ };
101
+ };
102
+ name: string;
103
+ kind: number;
104
+ } | undefined;
105
+ }[] | undefined;
106
+ } | {
107
+ status: "error";
108
+ input: {
109
+ [key: string]: unknown;
110
+ };
111
+ error: string;
112
+ metadata?: {
113
+ [key: string]: unknown;
114
+ } | undefined;
115
+ time: {
116
+ start: number;
117
+ end: number;
118
+ };
119
+ };
120
+ } | {
121
+ kind: "file";
122
+ id: string;
123
+ mime: string;
124
+ filename?: string | undefined;
125
+ url: string;
126
+ })[];
127
+ changedFiles: string[];
128
+ diffs: {
129
+ file: string;
130
+ patch?: string | undefined;
131
+ status?: "added" | "deleted" | "modified" | undefined;
132
+ before?: string | undefined;
133
+ after?: string | undefined;
134
+ additions: number;
135
+ deletions: number;
136
+ }[];
137
+ busy: boolean;
138
+ promptState?: import("./types").PromptState | undefined;
139
+ errorText?: string | undefined;
140
+ }[];
15
141
  revision: number;
16
142
  init: (options?: {
17
143
  businessId?: string;
@@ -20,7 +146,7 @@ export declare function useChat(): {
20
146
  }) => Promise<void>;
21
147
  reset: (message?: string) => void;
22
148
  suspend: (message?: string) => void;
23
- sendMessage: (text: string, attachments?: OutgoingAttachment[]) => Promise<void>;
149
+ sendMessage: (text: string, attachments?: OutgoingAttachment[]) => boolean;
24
150
  abort: () => Promise<void>;
25
151
  restartPreviewServer: () => Promise<boolean>;
26
152
  };