@feedmepos/mf-miniprogram-v2 0.1.0-dev.40 → 0.1.0-dev.43

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 (48) hide show
  1. package/dist/{ControlPlaneView-DcNJs7QW.js → ControlPlaneView-WgFqpKut.js} +5063 -4965
  2. package/dist/app.d.ts +2 -1
  3. package/dist/app.js +1 -1
  4. package/dist/package.json +11 -9
  5. package/dist/style.css +1 -1
  6. package/package.json +11 -9
  7. package/dist/src/App.vue.d.ts +0 -3
  8. package/dist/src/Entry.vue.d.ts +0 -3
  9. package/dist/src/api/controlPlane.d.ts +0 -24
  10. package/dist/src/app.d.ts +0 -4
  11. package/dist/src/components/AnnotationColorField.vue.d.ts +0 -14
  12. package/dist/src/components/AnnotationMessage.vue.d.ts +0 -8
  13. package/dist/src/components/AnnotationPropertyPanel.vue.d.ts +0 -32
  14. package/dist/src/components/AnnotationStyleControl.vue.d.ts +0 -14
  15. package/dist/src/components/BrandKitPanel.vue.d.ts +0 -9
  16. package/dist/src/components/BrandKitProposalCard.vue.d.ts +0 -7
  17. package/dist/src/components/ChatPanel.vue.d.ts +0 -7
  18. package/dist/src/components/ChatTextPart.vue.d.ts +0 -6
  19. package/dist/src/components/DiffCard.vue.d.ts +0 -9
  20. package/dist/src/components/MarkdownContent.vue.d.ts +0 -6
  21. package/dist/src/components/MessageItem.vue.d.ts +0 -13
  22. package/dist/src/components/PreviewPanel.vue.d.ts +0 -7
  23. package/dist/src/components/QuestionPrompt.vue.d.ts +0 -16
  24. package/dist/src/components/RenameSessionDialog.vue.d.ts +0 -12
  25. package/dist/src/components/StatusBadge.vue.d.ts +0 -21
  26. package/dist/src/components/ToolCallCard.vue.d.ts +0 -9
  27. package/dist/src/components/ToolCallGroup.vue.d.ts +0 -11
  28. package/dist/src/composables/annotationEditing.d.ts +0 -130
  29. package/dist/src/composables/annotationTray.d.ts +0 -73
  30. package/dist/src/composables/brandkitProposal.d.ts +0 -14
  31. package/dist/src/composables/imageAttachments.d.ts +0 -23
  32. package/dist/src/composables/latestPoller.d.ts +0 -14
  33. package/dist/src/composables/localPreference.d.ts +0 -10
  34. package/dist/src/composables/markdown.d.ts +0 -2
  35. package/dist/src/composables/previewAnnotations.d.ts +0 -38
  36. package/dist/src/composables/promptQueue.d.ts +0 -20
  37. package/dist/src/composables/questionAnswers.d.ts +0 -4
  38. package/dist/src/composables/status.d.ts +0 -11
  39. package/dist/src/composables/types.d.ts +0 -201
  40. package/dist/src/composables/useAgentBridge.d.ts +0 -35
  41. package/dist/src/composables/useBrandKit.d.ts +0 -45
  42. package/dist/src/composables/useChat.d.ts +0 -201
  43. package/dist/src/composables/useIdleSuspend.d.ts +0 -6
  44. package/dist/src/composables/useProject.d.ts +0 -212
  45. package/dist/src/main.d.ts +0 -3
  46. package/dist/src/router/index.d.ts +0 -2
  47. package/dist/src/router/shared.d.ts +0 -2
  48. package/dist/src/views/ControlPlaneView.vue.d.ts +0 -3
@@ -1,20 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- import type { QuestionAnswer, QuestionInfo } from '@opencode-ai/sdk/v2/client';
2
- export declare function toggleQuestionOption(selected: readonly string[], label: string): string[];
3
- export declare function answerForQuestion(question: QuestionInfo, selected: readonly string[], customValue: string): QuestionAnswer;
4
- export declare function buildQuestionAnswers(questions: readonly QuestionInfo[], selected: readonly (readonly string[])[], customValues: readonly string[]): QuestionAnswer[];
@@ -1,11 +0,0 @@
1
- import type { AgentSessionSummary, ConnectionStatus, ReleaseSummary } from './types';
2
- export type BadgeVariant = 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'primary';
3
- export declare function sessionStatusVariant(status: AgentSessionSummary['status']): BadgeVariant;
4
- export declare function sessionStatusLabel(status: AgentSessionSummary['status']): string;
5
- export declare function buildStatusVariant(status: string | null): BadgeVariant;
6
- export declare function buildStatusLabel(status: string | null): string;
7
- export declare function provisioningStatusLabel(status: string | null | undefined): string;
8
- export declare function releaseHasPreview(release: Pick<ReleaseSummary, 'status'>): boolean;
9
- export declare function releaseDisplayStatus(release: ReleaseSummary): string;
10
- export declare function releaseDisplayVariant(release: ReleaseSummary): BadgeVariant;
11
- export declare function connectionStatusVariant(status: ConnectionStatus): BadgeVariant;
@@ -1,201 +0,0 @@
1
- import type { ToolState } from '@opencode-ai/sdk';
2
- /** OpenCode 1.17.14's server emits a unified `patch`, while the generated SDK
3
- * still declares the older `before`/`after` shape. Keep both so current and
4
- * already-archived sessions render through the same UI. */
5
- export interface CodeFileDiff {
6
- file: string;
7
- patch?: string;
8
- status?: 'added' | 'deleted' | 'modified';
9
- before?: string;
10
- after?: string;
11
- additions: number;
12
- deletions: number;
13
- }
14
- export type ChatPart = {
15
- kind: 'text';
16
- id: string;
17
- text: string;
18
- } | {
19
- kind: 'reasoning';
20
- id: string;
21
- text: string;
22
- } | {
23
- kind: 'tool';
24
- id: string;
25
- tool: string;
26
- state: ToolState;
27
- } | {
28
- kind: 'file';
29
- id: string;
30
- mime: string;
31
- filename?: string;
32
- url: string;
33
- };
34
- /** An image attached to an outgoing prompt. `url` is a data: URI so the file
35
- * rides inline in the OpenCode prompt JSON through the transparent proxy. */
36
- export interface OutgoingAttachment {
37
- mime: string;
38
- filename?: string;
39
- url: string;
40
- }
41
- export interface PreviewBridgeElement {
42
- tag: string;
43
- selector: string;
44
- text: string;
45
- nearbyText?: string;
46
- attrs: Record<string, string>;
47
- rect: {
48
- x: number;
49
- y: number;
50
- width: number;
51
- height: number;
52
- };
53
- computed: Record<string, string>;
54
- canEditText?: boolean;
55
- sourceInspector?: {
56
- file: string;
57
- line: number;
58
- column: number;
59
- } | null;
60
- sourceInspectorRaw?: string | null;
61
- }
62
- export type PromptState = 'queued' | 'submitting' | 'running' | 'failed';
63
- export interface ChatMessage {
64
- /** Stable render key. Starts as `local-{uuid}` for queued prompts and never
65
- * changes; the OpenCode message id is assigned only when that prompt reaches
66
- * the head of the FIFO, so v-for identity remains stable after dispatch. */
67
- key: string;
68
- id: string | null;
69
- role: 'user' | 'assistant';
70
- /** Assistant messages point back to the user turn that spawned them. OpenCode
71
- * stores the turn's final file diff on that user message, so this relation
72
- * lets the UI render it beside the agent work that produced it. */
73
- parentId: string | null;
74
- createdAt: number;
75
- parts: ChatPart[];
76
- /** Patch parts arrive before the complete before/after diff is summarized.
77
- * Keep their file names so the UI can show useful live progress. */
78
- changedFiles: string[];
79
- diffs: CodeFileDiff[];
80
- busy: boolean;
81
- /** Present only on locally-originated user prompts while they are waiting
82
- * for, or being handled by, the OpenCode session runner. */
83
- promptState?: PromptState;
84
- errorText?: string;
85
- }
86
- export type ConnectionStatus = 'idle' | 'starting' | 'ready' | 'error';
87
- export type ProjectProvisioningStatus = 'not_started' | 'provisioning' | 'ready' | 'failed';
88
- export type ArchiveCodeAction = 'save' | 'discard';
89
- export type CheckpointTrigger = 'manual' | 'turn_completed' | 'interval' | 'archive' | 'pre_restore' | 'pre_discard' | 'turn_revert' | 'turn_unrevert' | 'restore' | 'release';
90
- export type CheckpointStatus = 'capturing' | 'local_only' | 'pushed_verified' | 'failed';
91
- export type CheckpointContextStatus = 'pending' | 'snapshotted' | 'failed' | 'unavailable';
92
- export type WorkspaceSyncState = 'unavailable' | 'diverged' | 'behind' | 'uncommitted' | 'unpushed' | 'saving' | 'save_failed' | 'synced' | 'unknown';
93
- export interface ProjectSummary {
94
- businessId: string;
95
- businessSlug: string | null;
96
- repoName: string;
97
- repoUrl: string;
98
- v2Enabled: 0 | 1;
99
- activeSessionId: string | null;
100
- currentPublishedReleaseId: string | null;
101
- rolloutStatus: 'disabled' | 'preview' | 'live' | 'rolled_back';
102
- fallbackVersion: 'v1';
103
- provisioningStatus: ProjectProvisioningStatus;
104
- provisioningError: string | null;
105
- provisionedAt: string | null;
106
- repoInitialCommitSha: string | null;
107
- createdAt: string | null;
108
- updatedAt: string | null;
109
- }
110
- export interface AgentSessionSummary {
111
- id: string;
112
- title: string | null;
113
- forked_from: string | null;
114
- raw_opencode_session_id: string | null;
115
- branch_name: string;
116
- sandbox_id: string | null;
117
- status: 'active' | 'archived' | 'needs_attention';
118
- archived_at: string | null;
119
- last_event_chunk: number;
120
- last_snapshot_at: string | null;
121
- base_commit_sha: string | null;
122
- last_checkpoint_id: string | null;
123
- last_durable_commit_sha: string | null;
124
- last_pushed_at: string | null;
125
- dirty_since: string | null;
126
- checkpoint_status: CheckpointStatus | null;
127
- checkpoint_error: string | null;
128
- attention_action?: string | null;
129
- attention_error?: string | null;
130
- release_count: number;
131
- has_live_release: number;
132
- created_at: string;
133
- updated_at: string;
134
- }
135
- export interface SessionChangesSummary {
136
- businessId: string;
137
- sessionId: string;
138
- workspaceExists: boolean;
139
- dirty: boolean;
140
- hasUncommittedChanges: boolean;
141
- hasUnpushedCommits: boolean;
142
- headDiffersFromOrigin: boolean;
143
- statusCount: number;
144
- commitsAheadOrigin: number;
145
- commitsBehindOrigin: number;
146
- headSha: string | null;
147
- originSha: string | null;
148
- syncState: WorkspaceSyncState;
149
- availability: 'available' | 'unavailable';
150
- lastCheckpointId: string | null;
151
- lastDurableCommitSha: string | null;
152
- lastPushedAt: string | null;
153
- dirtySince: string | null;
154
- checkpointStatus: CheckpointStatus | null;
155
- checkpointError: string | null;
156
- lastSnapshotAt: string | null;
157
- latestCheckpoint: SessionCheckpoint | null;
158
- }
159
- export interface SessionCheckpoint {
160
- id: string;
161
- business_id: string;
162
- session_id: string;
163
- sequence: number;
164
- trigger: CheckpointTrigger;
165
- status: CheckpointStatus;
166
- context_status: CheckpointContextStatus;
167
- base_sha: string | null;
168
- commit_sha: string | null;
169
- verified_remote_sha: string | null;
170
- raw_opencode_message_id: string | null;
171
- opencode_snapshot_key: string | null;
172
- workspace_backup_key: string | null;
173
- file_count: number;
174
- additions: number;
175
- deletions: number;
176
- summary: string | null;
177
- error_stage: string | null;
178
- error_message: string | null;
179
- created_at: string;
180
- committed_at: string | null;
181
- pushed_at: string | null;
182
- context_snapshotted_at: string | null;
183
- pinned: number;
184
- }
185
- export interface ReleaseSummary {
186
- id: string;
187
- source_commit_sha: string;
188
- checkpoint_id: string | null;
189
- created_from_session_id: string | null;
190
- session_title: string | null;
191
- status: 'draft' | 'preview' | 'published' | 'rolled_back';
192
- artifact_prefix: string;
193
- created_at: string;
194
- published_at: string | null;
195
- is_live: 0 | 1;
196
- build_job_id: string | null;
197
- build_status: 'queued' | 'running' | 'succeeded' | 'failed' | null;
198
- build_logs_url: string | null;
199
- build_created_at: string | null;
200
- build_completed_at: string | null;
201
- }
@@ -1,35 +0,0 @@
1
- /**
2
- * Presence + command channel for the agent's preview tools.
3
- *
4
- * The agent cannot see a rendered SPA from inside its sandbox, so its
5
- * preview_* tools are executed by a browser: the control plane pushes the
6
- * command down this WebSocket and this tab relays it into the preview iframe.
7
- *
8
- * Several tabs can watch one session. Exactly one of them holds control and is
9
- * the only one the agent ever drives — fanning a click out to every open tab
10
- * would both duplicate the action and race the answers back. Control follows
11
- * the conversation: sending a prompt moves it to the tab that sent it (see
12
- * useChat.sendMessage), which is why there is no manual takeover control.
13
- *
14
- * The server owns the election; this composable only reflects it. It is a
15
- * module-level singleton because two consumers need the same socket — the
16
- * preview panel, which executes commands against its iframe, and the chat send
17
- * path, which claims control — and only one workspace is ever open per page.
18
- */
19
- export type AgentBridgePresence = {
20
- clientCount: number;
21
- controllerId: string | null;
22
- };
23
- /** Runs one command against this tab's preview iframe. */
24
- export type AgentCommandExecutor = (command: string, args: Record<string, unknown>) => Promise<unknown>;
25
- export declare function useAgentBridge(): {
26
- connected: import("vue").Ref<boolean, boolean>;
27
- isController: import("vue").Ref<boolean, boolean>;
28
- clientCount: import("vue").Ref<number, number>;
29
- lastError: import("vue").Ref<string | null, string | null>;
30
- attach: (businessId: string, sessionId: string) => Promise<void>;
31
- detach: () => void;
32
- setExecutor: (fn: AgentCommandExecutor | null) => void;
33
- takeControl: () => boolean;
34
- };
35
- export type AgentBridgeStore = ReturnType<typeof useAgentBridge>;
@@ -1,45 +0,0 @@
1
- export interface BrandKitField {
2
- path: string;
3
- label: string;
4
- group: string;
5
- hint?: string;
6
- }
7
- export declare const COLOR_FIELDS: BrandKitField[];
8
- export declare const FONT_FIELDS: BrandKitField[];
9
- export declare function isHexColor(value: string): boolean;
10
- export declare function toInputHex(value: string): string;
11
- type KitObject = Record<string, unknown>;
12
- declare function load(force?: boolean): Promise<void>;
13
- declare function save(): Promise<void>;
14
- declare function revertLastSave(): Promise<void>;
15
- declare function applyProposal(proposal: {
16
- name?: string;
17
- colors: Record<string, string>;
18
- fonts: Record<string, string>;
19
- }): Promise<void>;
20
- declare function discardEdits(): void;
21
- export declare function useBrandKit(): {
22
- state: {
23
- panelOpen: boolean;
24
- loading: boolean;
25
- saving: boolean;
26
- loaded: boolean;
27
- error: string | null;
28
- businessId: string | null;
29
- colors: Record<string, string>;
30
- fonts: Record<string, string>;
31
- savedColors: Record<string, string>;
32
- savedFonts: Record<string, string>;
33
- revertKit: KitObject | null;
34
- appliedProposal: string | null;
35
- };
36
- dirtyCount: import("vue").ComputedRef<number>;
37
- hasInvalidColor: import("vue").ComputedRef<boolean>;
38
- load: typeof load;
39
- save: typeof save;
40
- revertLastSave: typeof revertLastSave;
41
- applyProposal: typeof applyProposal;
42
- discardEdits: typeof discardEdits;
43
- };
44
- export type BrandKitStore = ReturnType<typeof useBrandKit>;
45
- export {};
@@ -1,201 +0,0 @@
1
- import { type QuestionAnswer } from '@opencode-ai/sdk/v2/client';
2
- import type { ChatMessage, ConnectionStatus, OutgoingAttachment } from './types';
3
- export declare function useChat(): {
4
- status: ConnectionStatus;
5
- statusText: string;
6
- previewUrl: string | null;
7
- restartingPreview: boolean;
8
- previewRestartError: string | null;
9
- sending: boolean;
10
- agentBusy: boolean;
11
- sessionId: string | null;
12
- workspaceSessionId: string | null;
13
- businessId: string | null;
14
- readOnly: boolean;
15
- disconnected: boolean;
16
- checkpointRevision: number;
17
- checkpointError: string | null;
18
- checkpointSaving: boolean;
19
- canUnrevert: boolean;
20
- pendingQuestions: {
21
- id: string;
22
- sessionID: string;
23
- questions: {
24
- question: string;
25
- header: string;
26
- options: {
27
- label: string;
28
- description: string;
29
- }[];
30
- multiple?: boolean | undefined;
31
- custom?: boolean | undefined;
32
- }[];
33
- tool?: {
34
- messageID: string;
35
- callID: string;
36
- } | undefined;
37
- }[];
38
- activeQuestion: {
39
- id: string;
40
- sessionID: string;
41
- questions: {
42
- question: string;
43
- header: string;
44
- options: {
45
- label: string;
46
- description: string;
47
- }[];
48
- multiple?: boolean | undefined;
49
- custom?: boolean | undefined;
50
- }[];
51
- tool?: {
52
- messageID: string;
53
- callID: string;
54
- } | undefined;
55
- } | null;
56
- answeringQuestionId: string | null;
57
- questionError: string | null;
58
- messagesOrder: string[];
59
- messagesByKey: Record<string, ChatMessage>;
60
- queuedMessages: {
61
- key: string;
62
- id: string | null;
63
- role: "user" | "assistant";
64
- parentId: string | null;
65
- createdAt: number;
66
- parts: ({
67
- kind: "text";
68
- id: string;
69
- text: string;
70
- } | {
71
- kind: "reasoning";
72
- id: string;
73
- text: string;
74
- } | {
75
- kind: "tool";
76
- id: string;
77
- tool: string;
78
- state: {
79
- status: "pending";
80
- input: {
81
- [key: string]: unknown;
82
- };
83
- raw: string;
84
- } | {
85
- status: "running";
86
- input: {
87
- [key: string]: unknown;
88
- };
89
- title?: string | undefined;
90
- metadata?: {
91
- [key: string]: unknown;
92
- } | undefined;
93
- time: {
94
- start: number;
95
- };
96
- } | {
97
- status: "completed";
98
- input: {
99
- [key: string]: unknown;
100
- };
101
- output: string;
102
- title: string;
103
- metadata: {
104
- [key: string]: unknown;
105
- };
106
- time: {
107
- start: number;
108
- end: number;
109
- compacted?: number | undefined;
110
- };
111
- attachments?: {
112
- id: string;
113
- sessionID: string;
114
- messageID: string;
115
- type: "file";
116
- mime: string;
117
- filename?: string | undefined;
118
- url: string;
119
- source?: {
120
- text: {
121
- value: string;
122
- start: number;
123
- end: number;
124
- };
125
- type: "file";
126
- path: string;
127
- } | {
128
- text: {
129
- value: string;
130
- start: number;
131
- end: number;
132
- };
133
- type: "symbol";
134
- path: string;
135
- range: {
136
- start: {
137
- line: number;
138
- character: number;
139
- };
140
- end: {
141
- line: number;
142
- character: number;
143
- };
144
- };
145
- name: string;
146
- kind: number;
147
- } | undefined;
148
- }[] | undefined;
149
- } | {
150
- status: "error";
151
- input: {
152
- [key: string]: unknown;
153
- };
154
- error: string;
155
- metadata?: {
156
- [key: string]: unknown;
157
- } | undefined;
158
- time: {
159
- start: number;
160
- end: number;
161
- };
162
- };
163
- } | {
164
- kind: "file";
165
- id: string;
166
- mime: string;
167
- filename?: string | undefined;
168
- url: string;
169
- })[];
170
- changedFiles: string[];
171
- diffs: {
172
- file: string;
173
- patch?: string | undefined;
174
- status?: "added" | "deleted" | "modified" | undefined;
175
- before?: string | undefined;
176
- after?: string | undefined;
177
- additions: number;
178
- deletions: number;
179
- }[];
180
- busy: boolean;
181
- promptState?: import("./types").PromptState | undefined;
182
- errorText?: string | undefined;
183
- }[];
184
- revision: number;
185
- init: (options?: {
186
- businessId?: string;
187
- sessionId?: string;
188
- readOnly?: boolean;
189
- }) => Promise<void>;
190
- reset: (message?: string) => void;
191
- suspend: (message?: string) => void;
192
- sendMessage: (text: string, attachments?: OutgoingAttachment[]) => boolean;
193
- abort: () => Promise<void>;
194
- answerQuestion: (requestID: string, answers: QuestionAnswer[]) => Promise<boolean>;
195
- rejectQuestion: (requestID: string) => Promise<boolean>;
196
- revertTurn: (rawOpencodeMessageId: string) => Promise<boolean>;
197
- unrevertTurn: () => Promise<boolean>;
198
- reportCheckpointResult: (error?: string | null) => void;
199
- restartPreviewServer: () => Promise<boolean>;
200
- };
201
- export type ChatStore = ReturnType<typeof useChat>;
@@ -1,6 +0,0 @@
1
- export declare function useIdleSuspend(options: {
2
- timeoutMs: number;
3
- isEligible: () => boolean;
4
- isActive: () => boolean;
5
- onSuspend: () => void;
6
- }): void;