@feedmepos/mf-miniprogram-v2 0.1.0-dev.22 → 0.1.0-dev.23
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/{ControlPlaneView-zIaLc8qc.js → ControlPlaneView-CUBTM2zB.js} +3989 -3841
- package/dist/app.js +1 -1
- package/dist/package.json +2 -2
- package/dist/src/composables/promptQueue.d.ts +20 -0
- package/dist/src/composables/types.d.ts +7 -4
- package/dist/src/composables/useChat.d.ts +126 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/app.js
CHANGED
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-miniprogram-v2",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.23",
|
|
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/
|
|
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,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;
|
|
@@ -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-{
|
|
44
|
-
*
|
|
45
|
-
*
|
|
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,137 @@ 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;
|
|
11
12
|
readOnly: boolean;
|
|
12
13
|
disconnected: boolean;
|
|
13
14
|
messagesOrder: string[];
|
|
14
15
|
messagesByKey: Record<string, ChatMessage>;
|
|
16
|
+
queuedMessages: {
|
|
17
|
+
key: string;
|
|
18
|
+
id: string | null;
|
|
19
|
+
role: "user" | "assistant";
|
|
20
|
+
parentId: string | null;
|
|
21
|
+
createdAt: number;
|
|
22
|
+
parts: ({
|
|
23
|
+
kind: "text";
|
|
24
|
+
id: string;
|
|
25
|
+
text: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "reasoning";
|
|
28
|
+
id: string;
|
|
29
|
+
text: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "tool";
|
|
32
|
+
id: string;
|
|
33
|
+
tool: string;
|
|
34
|
+
state: {
|
|
35
|
+
status: "pending";
|
|
36
|
+
input: {
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
};
|
|
39
|
+
raw: string;
|
|
40
|
+
} | {
|
|
41
|
+
status: "running";
|
|
42
|
+
input: {
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
title?: string | undefined;
|
|
46
|
+
metadata?: {
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
} | undefined;
|
|
49
|
+
time: {
|
|
50
|
+
start: number;
|
|
51
|
+
};
|
|
52
|
+
} | {
|
|
53
|
+
status: "completed";
|
|
54
|
+
input: {
|
|
55
|
+
[key: string]: unknown;
|
|
56
|
+
};
|
|
57
|
+
output: string;
|
|
58
|
+
title: string;
|
|
59
|
+
metadata: {
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
};
|
|
62
|
+
time: {
|
|
63
|
+
start: number;
|
|
64
|
+
end: number;
|
|
65
|
+
compacted?: number | undefined;
|
|
66
|
+
};
|
|
67
|
+
attachments?: {
|
|
68
|
+
id: string;
|
|
69
|
+
sessionID: string;
|
|
70
|
+
messageID: string;
|
|
71
|
+
type: "file";
|
|
72
|
+
mime: string;
|
|
73
|
+
filename?: string | undefined;
|
|
74
|
+
url: string;
|
|
75
|
+
source?: {
|
|
76
|
+
text: {
|
|
77
|
+
value: string;
|
|
78
|
+
start: number;
|
|
79
|
+
end: number;
|
|
80
|
+
};
|
|
81
|
+
type: "file";
|
|
82
|
+
path: string;
|
|
83
|
+
} | {
|
|
84
|
+
text: {
|
|
85
|
+
value: string;
|
|
86
|
+
start: number;
|
|
87
|
+
end: number;
|
|
88
|
+
};
|
|
89
|
+
type: "symbol";
|
|
90
|
+
path: string;
|
|
91
|
+
range: {
|
|
92
|
+
start: {
|
|
93
|
+
line: number;
|
|
94
|
+
character: number;
|
|
95
|
+
};
|
|
96
|
+
end: {
|
|
97
|
+
line: number;
|
|
98
|
+
character: number;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
name: string;
|
|
102
|
+
kind: number;
|
|
103
|
+
} | undefined;
|
|
104
|
+
}[] | undefined;
|
|
105
|
+
} | {
|
|
106
|
+
status: "error";
|
|
107
|
+
input: {
|
|
108
|
+
[key: string]: unknown;
|
|
109
|
+
};
|
|
110
|
+
error: string;
|
|
111
|
+
metadata?: {
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
} | undefined;
|
|
114
|
+
time: {
|
|
115
|
+
start: number;
|
|
116
|
+
end: number;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
} | {
|
|
120
|
+
kind: "file";
|
|
121
|
+
id: string;
|
|
122
|
+
mime: string;
|
|
123
|
+
filename?: string | undefined;
|
|
124
|
+
url: string;
|
|
125
|
+
})[];
|
|
126
|
+
changedFiles: string[];
|
|
127
|
+
diffs: {
|
|
128
|
+
file: string;
|
|
129
|
+
patch?: string | undefined;
|
|
130
|
+
status?: "added" | "deleted" | "modified" | undefined;
|
|
131
|
+
before?: string | undefined;
|
|
132
|
+
after?: string | undefined;
|
|
133
|
+
additions: number;
|
|
134
|
+
deletions: number;
|
|
135
|
+
}[];
|
|
136
|
+
busy: boolean;
|
|
137
|
+
promptState?: import("./types").PromptState | undefined;
|
|
138
|
+
errorText?: string | undefined;
|
|
139
|
+
}[];
|
|
15
140
|
revision: number;
|
|
16
141
|
init: (options?: {
|
|
17
142
|
businessId?: string;
|
|
@@ -20,7 +145,7 @@ export declare function useChat(): {
|
|
|
20
145
|
}) => Promise<void>;
|
|
21
146
|
reset: (message?: string) => void;
|
|
22
147
|
suspend: (message?: string) => void;
|
|
23
|
-
sendMessage: (text: string, attachments?: OutgoingAttachment[]) =>
|
|
148
|
+
sendMessage: (text: string, attachments?: OutgoingAttachment[]) => boolean;
|
|
24
149
|
abort: () => Promise<void>;
|
|
25
150
|
restartPreviewServer: () => Promise<boolean>;
|
|
26
151
|
};
|