@feedmepos/mf-miniprogram-v2 0.1.0-dev.11 → 0.1.0-dev.13

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-DzyTnzK9.js")
6
+ component: () => import("./ControlPlaneView-cqOxPMGx.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.11",
3
+ "version": "0.1.0-dev.13",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -39,6 +39,7 @@
39
39
  "@feedmepos/mf-common": "^1.27.9",
40
40
  "@feedmepos/ui-library": "1.8.4",
41
41
  "@opencode-ai/sdk": "*",
42
+ "diff": "^9.0.0",
42
43
  "dompurify": "^3.4.11",
43
44
  "highlight.js": "^11.11.1",
44
45
  "marked": "^18.0.5",
@@ -12,11 +12,12 @@ export declare function controlPlaneBaseUrl(): string;
12
12
  export declare function controlPlaneUrl(path: string): string;
13
13
  export declare function currentBusiness(): MaybeBusiness | undefined;
14
14
  export declare function currentBusinessId(): string;
15
- export declare function currentBusinessLabel(): string;
16
15
  export declare function currentBusinessSlug(): string | undefined;
17
16
  export declare function currentBusinessName(): string;
18
17
  export declare function currentBusinessCountry(): string | undefined;
19
18
  export declare function currentBusinessLiveUrl(): string;
19
+ export declare function sleep(ms: number): Promise<unknown>;
20
+ export declare function errorMessage(error: unknown): string;
20
21
  export declare function controlPlaneAuthorizationHeader(): Promise<string | null>;
21
22
  export declare function authorizedFetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
22
23
  export declare function controlPlaneFetch<T>(path: string, init?: RequestInit): Promise<T>;
@@ -0,0 +1,9 @@
1
+ import type { ChatMessage } from '../composables/types';
2
+ type __VLS_Props = {
3
+ files: string[];
4
+ diffs: ChatMessage['diffs'];
5
+ loading?: boolean;
6
+ };
7
+ 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>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
@@ -5,6 +5,7 @@ export declare function sessionStatusLabel(status: AgentSessionSummary['status']
5
5
  export declare function buildStatusVariant(status: string | null): BadgeVariant;
6
6
  export declare function buildStatusLabel(status: string | null): string;
7
7
  export declare function provisioningStatusLabel(status: string | null | undefined): string;
8
+ export declare function releaseHasPreview(release: Pick<ReleaseSummary, 'status'>): boolean;
8
9
  export declare function releaseDisplayStatus(release: ReleaseSummary): string;
9
10
  export declare function releaseDisplayVariant(release: ReleaseSummary): BadgeVariant;
10
11
  export declare function connectionStatusVariant(status: ConnectionStatus): BadgeVariant;
@@ -1,4 +1,16 @@
1
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
+ }
2
14
  export type ChatPart = {
3
15
  kind: 'text';
4
16
  id: string;
@@ -12,7 +24,21 @@ export type ChatPart = {
12
24
  id: string;
13
25
  tool: string;
14
26
  state: ToolState;
27
+ } | {
28
+ kind: 'file';
29
+ id: string;
30
+ mime: string;
31
+ filename?: string;
32
+ url: string;
15
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
+ * no separate upload channel exists (or is needed at screenshot sizes). */
37
+ export interface OutgoingAttachment {
38
+ mime: string;
39
+ filename?: string;
40
+ url: string;
41
+ }
16
42
  export interface ChatMessage {
17
43
  /** Stable render key. Starts as `local-{partId}` for our own just-sent
18
44
  * messages (the real message id isn't known until the server echoes it
@@ -21,8 +47,16 @@ export interface ChatMessage {
21
47
  key: string;
22
48
  id: string | null;
23
49
  role: 'user' | 'assistant';
50
+ /** Assistant messages point back to the user turn that spawned them. OpenCode
51
+ * stores the turn's final file diff on that user message, so this relation
52
+ * lets the UI render it beside the agent work that produced it. */
53
+ parentId: string | null;
24
54
  createdAt: number;
25
55
  parts: ChatPart[];
56
+ /** Patch parts arrive before the complete before/after diff is summarized.
57
+ * Keep their file names so the UI can show useful live progress. */
58
+ changedFiles: string[];
59
+ diffs: CodeFileDiff[];
26
60
  busy: boolean;
27
61
  errorText?: string;
28
62
  }
@@ -1,4 +1,4 @@
1
- import type { ChatMessage, ConnectionStatus } from './types';
1
+ import type { ChatMessage, ConnectionStatus, OutgoingAttachment } from './types';
2
2
  export declare function useChat(): {
3
3
  status: ConnectionStatus;
4
4
  statusText: string;
@@ -17,7 +17,7 @@ export declare function useChat(): {
17
17
  readOnly?: boolean;
18
18
  }) => Promise<void>;
19
19
  reset: (message?: string) => void;
20
- sendMessage: (text: string) => Promise<void>;
20
+ sendMessage: (text: string, attachments?: OutgoingAttachment[]) => Promise<void>;
21
21
  abort: () => Promise<void>;
22
22
  };
23
23
  export type ChatStore = ReturnType<typeof useChat>;
@@ -56,7 +56,6 @@ export declare function useProject(): {
56
56
  statusText: string;
57
57
  activeReleaseId: string | null;
58
58
  activeReleasePreviewUrl: string | null;
59
- activeBuildJobId: string | null;
60
59
  latestRelease: {
61
60
  id: string;
62
61
  source_commit_sha: string;
@@ -73,26 +72,7 @@ export declare function useProject(): {
73
72
  build_created_at: string | null;
74
73
  build_completed_at: string | null;
75
74
  } | null;
76
- activeRelease: {
77
- id: string;
78
- source_commit_sha: string;
79
- created_from_session_id: string | null;
80
- session_title: string | null;
81
- status: "draft" | "preview" | "published" | "rolled_back";
82
- artifact_prefix: string;
83
- created_at: string;
84
- published_at: string | null;
85
- is_live: 0 | 1;
86
- build_job_id: string | null;
87
- build_status: "queued" | "running" | "succeeded" | "failed" | null;
88
- build_logs_url: string | null;
89
- build_created_at: string | null;
90
- build_completed_at: string | null;
91
- } | null;
92
- activeBuildStatus: "failed" | "queued" | "running" | "succeeded" | null;
93
- activeBuildLogsUrl: string | null;
94
75
  isProvisioned: boolean;
95
- isProvisioning: boolean;
96
76
  provisioningFailed: boolean;
97
77
  syncBusiness: () => void;
98
78
  refreshProject: () => Promise<ProjectSummary>;
@@ -114,7 +94,6 @@ export declare function useProject(): {
114
94
  previewUrl: string;
115
95
  }>;
116
96
  renameSession: (sessionId: string, title: string) => Promise<void>;
117
- archive: (sessionId: string, codeAction?: ArchiveCodeAction) => Promise<void>;
118
97
  commitSession: (sessionId: string) => Promise<{
119
98
  sourceCommitSha: string;
120
99
  }>;
@@ -125,6 +104,5 @@ export declare function useProject(): {
125
104
  }>;
126
105
  publish: (releaseId?: string | null) => Promise<void>;
127
106
  rollbackToV1: () => Promise<void>;
128
- rollbackToRelease: (releaseId: string) => Promise<void>;
129
107
  };
130
108
  export type ProjectStore = ReturnType<typeof useProject>;