@mugwork/mug 0.1.0
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/LICENSE +21 -0
- package/README.md +251 -0
- package/dist/explorer.js +3 -0
- package/dist/packages/email-template/src/email-template.d.ts +18 -0
- package/dist/packages/email-template/src/email-template.js +74 -0
- package/dist/packages/email-template/src/index.d.ts +1 -0
- package/dist/packages/email-template/src/index.js +1 -0
- package/dist/packages/surface-renderer/src/form-renderer.d.ts +117 -0
- package/dist/packages/surface-renderer/src/form-renderer.js +719 -0
- package/dist/packages/surface-renderer/src/index.d.ts +4 -0
- package/dist/packages/surface-renderer/src/index.js +2 -0
- package/dist/packages/surface-renderer/src/portal-renderer.d.ts +177 -0
- package/dist/packages/surface-renderer/src/portal-renderer.js +1089 -0
- package/dist/packages/surface-renderer/src/workspace-home.d.ts +46 -0
- package/dist/packages/surface-renderer/src/workspace-home.js +345 -0
- package/dist/runtime/agent-types.d.ts +48 -0
- package/dist/runtime/agent-types.js +3 -0
- package/dist/runtime/ai-router.d.ts +32 -0
- package/dist/runtime/ai-router.js +112 -0
- package/dist/runtime/app.d.ts +6 -0
- package/dist/runtime/app.js +399 -0
- package/dist/runtime/chunker.d.ts +6 -0
- package/dist/runtime/chunker.js +30 -0
- package/dist/runtime/context.d.ts +115 -0
- package/dist/runtime/context.js +440 -0
- package/dist/runtime/do/workspace-database.d.ts +10 -0
- package/dist/runtime/do/workspace-database.js +199 -0
- package/dist/runtime/form-types.d.ts +143 -0
- package/dist/runtime/form-types.js +1 -0
- package/dist/runtime/runtime.d.ts +9 -0
- package/dist/runtime/runtime.js +7 -0
- package/dist/runtime/source-types.d.ts +15 -0
- package/dist/runtime/source-types.js +1 -0
- package/dist/runtime/source.d.ts +70 -0
- package/dist/runtime/source.js +21 -0
- package/dist/runtime/sync-runtime.d.ts +10 -0
- package/dist/runtime/sync-runtime.js +185 -0
- package/dist/runtime/types.d.ts +21 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/workflow-entrypoint.d.ts +31 -0
- package/dist/runtime/workflow-entrypoint.js +1297 -0
- package/dist/runtime/workflow.d.ts +285 -0
- package/dist/runtime/workflow.js +1008 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +44116 -0
- package/dist/src/commands/ai-gateway-route.d.ts +24 -0
- package/dist/src/commands/ai-gateway-route.js +192 -0
- package/dist/src/commands/auth.d.ts +1 -0
- package/dist/src/commands/auth.js +42 -0
- package/dist/src/commands/billing.d.ts +6 -0
- package/dist/src/commands/billing.js +76 -0
- package/dist/src/commands/brain.d.ts +1 -0
- package/dist/src/commands/brain.js +194 -0
- package/dist/src/commands/demo.d.ts +12 -0
- package/dist/src/commands/demo.js +147 -0
- package/dist/src/commands/deploy.d.ts +1 -0
- package/dist/src/commands/deploy.js +1052 -0
- package/dist/src/commands/dev.d.ts +14 -0
- package/dist/src/commands/dev.js +2818 -0
- package/dist/src/commands/form.d.ts +8 -0
- package/dist/src/commands/form.js +396 -0
- package/dist/src/commands/init.d.ts +1 -0
- package/dist/src/commands/init.js +139 -0
- package/dist/src/commands/issue.d.ts +7 -0
- package/dist/src/commands/issue.js +191 -0
- package/dist/src/commands/login.d.ts +9 -0
- package/dist/src/commands/login.js +163 -0
- package/dist/src/commands/logs.d.ts +8 -0
- package/dist/src/commands/logs.js +113 -0
- package/dist/src/commands/portal.d.ts +2 -0
- package/dist/src/commands/portal.js +111 -0
- package/dist/src/commands/pull.d.ts +3 -0
- package/dist/src/commands/pull.js +184 -0
- package/dist/src/commands/push.d.ts +4 -0
- package/dist/src/commands/push.js +183 -0
- package/dist/src/commands/run.d.ts +6 -0
- package/dist/src/commands/run.js +91 -0
- package/dist/src/commands/secret.d.ts +7 -0
- package/dist/src/commands/secret.js +105 -0
- package/dist/src/commands/shutdown.d.ts +1 -0
- package/dist/src/commands/shutdown.js +46 -0
- package/dist/src/commands/sql.d.ts +8 -0
- package/dist/src/commands/sql.js +142 -0
- package/dist/src/commands/status.d.ts +5 -0
- package/dist/src/commands/status.js +39 -0
- package/dist/src/commands/sync.d.ts +7 -0
- package/dist/src/commands/sync.js +991 -0
- package/dist/src/commands/usage.d.ts +6 -0
- package/dist/src/commands/usage.js +78 -0
- package/dist/src/commands/webhooks.d.ts +1 -0
- package/dist/src/commands/webhooks.js +102 -0
- package/dist/src/commands/workspace.d.ts +23 -0
- package/dist/src/commands/workspace.js +590 -0
- package/dist/src/connector-migration.d.ts +20 -0
- package/dist/src/connector-migration.js +43 -0
- package/dist/src/connector-parser.d.ts +14 -0
- package/dist/src/connector-parser.js +94 -0
- package/dist/src/connector-service/discover.d.ts +37 -0
- package/dist/src/connector-service/discover.js +79 -0
- package/dist/src/connector-service/gather.d.ts +22 -0
- package/dist/src/connector-service/gather.js +89 -0
- package/dist/src/connector-service/init.d.ts +14 -0
- package/dist/src/connector-service/init.js +109 -0
- package/dist/src/connector-service/scaffold.d.ts +17 -0
- package/dist/src/connector-service/scaffold.js +194 -0
- package/dist/src/connector-service/spec-storage.d.ts +8 -0
- package/dist/src/connector-service/spec-storage.js +48 -0
- package/dist/src/connector-service/types.d.ts +57 -0
- package/dist/src/connector-service/types.js +2 -0
- package/dist/src/connector-service/verify.d.ts +24 -0
- package/dist/src/connector-service/verify.js +575 -0
- package/dist/src/email-template.d.ts +2 -0
- package/dist/src/email-template.js +1 -0
- package/dist/src/manifest.d.ts +31 -0
- package/dist/src/manifest.js +25 -0
- package/dist/src/mug-icon.d.ts +1 -0
- package/dist/src/mug-icon.js +12 -0
- package/dist/src/slack-manifest.d.ts +119 -0
- package/dist/src/slack-manifest.js +163 -0
- package/dist/src/source-migration.d.ts +20 -0
- package/dist/src/source-migration.js +43 -0
- package/dist/src/surface-renderer.d.ts +5 -0
- package/dist/src/surface-renderer.js +3 -0
- package/dist/src/templates.d.ts +3 -0
- package/dist/src/templates.js +48 -0
- package/dist/src/version-check.d.ts +1 -0
- package/dist/src/version-check.js +28 -0
- package/dist/src/workflow-parser.d.ts +95 -0
- package/dist/src/workflow-parser.js +526 -0
- package/dist/worker/src/agent-types.d.ts +27 -0
- package/dist/worker/src/agent-types.js +3 -0
- package/dist/worker/src/source-types.d.ts +14 -0
- package/dist/worker/src/source-types.js +1 -0
- package/package.json +90 -0
- package/src/data/model-capabilities.json +171 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { renderForm, renderMetaTags, renderPwaTags, renderInstallBanner } from "./form-renderer.js";
|
|
2
|
+
export type { Breadcrumb, Condition, FormAccess, SessionData } from "./form-renderer.js";
|
|
3
|
+
export { renderPortal, renderPortalDetail, renderDevBanner, bindUserParam, paginateQuery, detailQuery, collectSectionQueries, findTableSection, renderSection } from "./portal-renderer.js";
|
|
4
|
+
export type { PortalConfig, PortalColumn, PortalField, PortalAction, PortalLink, PortalTab, PortalSection, TableSection, StatsSection, ProgressSection, TextSection, ChartSection, GallerySection, AccordionSection } from "./portal-renderer.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { renderForm, renderMetaTags, renderPwaTags, renderInstallBanner } from "./form-renderer.js";
|
|
2
|
+
export { renderPortal, renderPortalDetail, renderDevBanner, bindUserParam, paginateQuery, detailQuery, collectSectionQueries, findTableSection, renderSection } from "./portal-renderer.js";
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { Breadcrumb, BrandingConfig, Condition, FormAccess, SessionData } from "./form-renderer.js";
|
|
2
|
+
export type { Breadcrumb, BrandingConfig, Condition, FormAccess, SessionData };
|
|
3
|
+
export interface PortalColumn {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
format?: "date" | "datetime" | "currency" | "currency-whole" | "currency-short" | "number" | "percent";
|
|
7
|
+
dateFormat?: "short";
|
|
8
|
+
badge?: boolean;
|
|
9
|
+
badgeColors?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export interface PortalField {
|
|
12
|
+
key: string;
|
|
13
|
+
label: string;
|
|
14
|
+
format?: "date" | "datetime" | "currency" | "currency-whole" | "currency-short" | "number" | "percent" | "multiline";
|
|
15
|
+
badge?: boolean;
|
|
16
|
+
badgeColors?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
export interface TimelineEvent {
|
|
19
|
+
delay: number;
|
|
20
|
+
event: "toast" | "preview" | "stream" | "update" | "highlight";
|
|
21
|
+
message?: string;
|
|
22
|
+
channel?: "email" | "sms";
|
|
23
|
+
to?: string;
|
|
24
|
+
subject?: string;
|
|
25
|
+
body?: string;
|
|
26
|
+
target?: string;
|
|
27
|
+
text?: string;
|
|
28
|
+
row?: string;
|
|
29
|
+
action?: string;
|
|
30
|
+
field?: string;
|
|
31
|
+
value?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface PortalAction {
|
|
34
|
+
name: string;
|
|
35
|
+
label: string;
|
|
36
|
+
workflow?: string;
|
|
37
|
+
timeline?: TimelineEvent[];
|
|
38
|
+
style?: "primary" | "danger" | "success" | "warning" | "default";
|
|
39
|
+
color?: string;
|
|
40
|
+
showWhen?: Condition;
|
|
41
|
+
confirm?: string;
|
|
42
|
+
afterMessage?: string;
|
|
43
|
+
afterColor?: string;
|
|
44
|
+
afterActions?: {
|
|
45
|
+
label: string;
|
|
46
|
+
action: string;
|
|
47
|
+
style?: string;
|
|
48
|
+
}[];
|
|
49
|
+
}
|
|
50
|
+
export interface PortalLink {
|
|
51
|
+
label: string;
|
|
52
|
+
href: string;
|
|
53
|
+
}
|
|
54
|
+
export interface TableSection {
|
|
55
|
+
type: "table";
|
|
56
|
+
query: string;
|
|
57
|
+
primaryKey?: string;
|
|
58
|
+
pageSize?: number;
|
|
59
|
+
columns: PortalColumn[];
|
|
60
|
+
detail?: {
|
|
61
|
+
title?: string;
|
|
62
|
+
fields: PortalField[];
|
|
63
|
+
};
|
|
64
|
+
actions?: PortalAction[];
|
|
65
|
+
emptyMessage?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface StatsSection {
|
|
68
|
+
type: "stats";
|
|
69
|
+
query: string;
|
|
70
|
+
items: {
|
|
71
|
+
label: string;
|
|
72
|
+
column: string;
|
|
73
|
+
format?: "number" | "currency" | "currency-whole" | "currency-short" | "percent";
|
|
74
|
+
color?: string;
|
|
75
|
+
valueColor?: string;
|
|
76
|
+
href?: string;
|
|
77
|
+
}[];
|
|
78
|
+
}
|
|
79
|
+
export interface ProgressSection {
|
|
80
|
+
type: "progress";
|
|
81
|
+
query: string;
|
|
82
|
+
labelColumn: string;
|
|
83
|
+
valueColumn: string;
|
|
84
|
+
maxColumn: string;
|
|
85
|
+
subtitleTemplate?: string;
|
|
86
|
+
color?: string;
|
|
87
|
+
colorColumn?: string;
|
|
88
|
+
colorThresholds?: {
|
|
89
|
+
percent: number;
|
|
90
|
+
color: string;
|
|
91
|
+
}[];
|
|
92
|
+
}
|
|
93
|
+
export interface TextSection {
|
|
94
|
+
type: "text";
|
|
95
|
+
content: string;
|
|
96
|
+
}
|
|
97
|
+
export interface ChartSection {
|
|
98
|
+
type: "chart";
|
|
99
|
+
query: string;
|
|
100
|
+
chartType: "bar" | "donut";
|
|
101
|
+
labelColumn?: string;
|
|
102
|
+
valueColumn?: string;
|
|
103
|
+
title?: string;
|
|
104
|
+
color?: string;
|
|
105
|
+
colorColumn?: string;
|
|
106
|
+
colors?: Record<string, string>;
|
|
107
|
+
}
|
|
108
|
+
export interface GallerySection {
|
|
109
|
+
type: "gallery";
|
|
110
|
+
query: string;
|
|
111
|
+
imageColumn: string;
|
|
112
|
+
titleColumn?: string;
|
|
113
|
+
fields?: PortalField[];
|
|
114
|
+
columns?: number;
|
|
115
|
+
}
|
|
116
|
+
export interface AccordionSection {
|
|
117
|
+
type: "accordion";
|
|
118
|
+
label: string;
|
|
119
|
+
open?: boolean;
|
|
120
|
+
sections: PortalSection[];
|
|
121
|
+
}
|
|
122
|
+
export type PortalSection = TableSection | StatsSection | ProgressSection | TextSection | ChartSection | GallerySection | AccordionSection;
|
|
123
|
+
export interface PortalTab {
|
|
124
|
+
id: string;
|
|
125
|
+
label: string;
|
|
126
|
+
color?: string;
|
|
127
|
+
countQuery?: string;
|
|
128
|
+
sections: PortalSection[];
|
|
129
|
+
links?: PortalLink[];
|
|
130
|
+
}
|
|
131
|
+
export interface PortalConfig {
|
|
132
|
+
type: "portal";
|
|
133
|
+
workspace: string;
|
|
134
|
+
surfaceId: string;
|
|
135
|
+
title: string;
|
|
136
|
+
description?: string;
|
|
137
|
+
access: FormAccess;
|
|
138
|
+
database?: string;
|
|
139
|
+
sections?: PortalSection[];
|
|
140
|
+
tabs: PortalTab[];
|
|
141
|
+
branding?: BrandingConfig;
|
|
142
|
+
timezone?: string;
|
|
143
|
+
autoplay?: TimelineEvent[];
|
|
144
|
+
}
|
|
145
|
+
export declare function bindUserParam(sql: string, session: SessionData | null): {
|
|
146
|
+
sql: string;
|
|
147
|
+
userParams: string[];
|
|
148
|
+
};
|
|
149
|
+
export declare function paginateQuery(sql: string, userParams: string[], page: number, pageSize: number): {
|
|
150
|
+
countSql: string;
|
|
151
|
+
dataSql: string;
|
|
152
|
+
countParams: string[];
|
|
153
|
+
dataParams: (string | number)[];
|
|
154
|
+
};
|
|
155
|
+
export declare function detailQuery(sql: string, userParams: string[], primaryKey: string, rowId: string): {
|
|
156
|
+
sql: string;
|
|
157
|
+
params: (string | number)[];
|
|
158
|
+
};
|
|
159
|
+
export declare function formatDateTime(value: unknown, style?: "short" | "long", tz?: string): string;
|
|
160
|
+
export declare function renderStatsSection(section: StatsSection, rows: Record<string, unknown>[]): string;
|
|
161
|
+
export declare function renderProgressSection(section: ProgressSection, rows: Record<string, unknown>[]): string;
|
|
162
|
+
export declare function renderTextSection(section: TextSection): string;
|
|
163
|
+
export declare function renderChartSection(section: ChartSection, rows: Record<string, unknown>[]): string;
|
|
164
|
+
export declare function renderGallerySection(section: GallerySection, rows: Record<string, unknown>[]): string;
|
|
165
|
+
export declare function renderAccordionSection(section: AccordionSection, renderedChildren: string): string;
|
|
166
|
+
export declare function renderSection(section: PortalSection, queryResults: Map<string, Record<string, unknown>[]>, tableCounts: Map<string, number>, pages: Record<string, number>, sectionKey: string, sectionIndex: number, base: string, activeTabId: string): string;
|
|
167
|
+
export declare function collectSectionQueries(sections: PortalSection[], keyPrefix: string): {
|
|
168
|
+
key: string;
|
|
169
|
+
query: string;
|
|
170
|
+
}[];
|
|
171
|
+
export declare function renderPortal(config: PortalConfig, queryResults: Map<string, Record<string, unknown>[]>, tableCounts: Map<string, number>, pages: Record<string, number>, activeTabId: string | null, session: SessionData | null, basePath?: string, breadcrumb?: Breadcrumb, tabCounts?: Map<string, number>, embed?: boolean): string;
|
|
172
|
+
export declare function findTableSection(config: PortalConfig, tabId: string, sectionIndex: number): {
|
|
173
|
+
tab: PortalTab;
|
|
174
|
+
section: TableSection;
|
|
175
|
+
} | null;
|
|
176
|
+
export declare function renderPortalDetail(config: PortalConfig, tableSection: TableSection, row: Record<string, unknown>, session: SessionData | null, tabId: string, basePath?: string, embed?: boolean): string;
|
|
177
|
+
export declare function renderDevBanner(currentIdentity: string, registeredUsers?: string[], accentColor?: string, workspaceName?: string, badge?: string): string;
|