@portel/photon-core 1.4.0 → 2.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/README.md +123 -0
- package/dist/auto-ui.d.ts +103 -0
- package/dist/auto-ui.d.ts.map +1 -0
- package/dist/auto-ui.js +275 -0
- package/dist/auto-ui.js.map +1 -0
- package/dist/base.d.ts +9 -2
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +23 -10
- package/dist/base.js.map +1 -1
- package/dist/cli-ui-renderer.d.ts +31 -0
- package/dist/cli-ui-renderer.d.ts.map +1 -0
- package/dist/cli-ui-renderer.js +224 -0
- package/dist/cli-ui-renderer.js.map +1 -0
- package/dist/dependency-manager.d.ts.map +1 -1
- package/dist/dependency-manager.js +0 -1
- package/dist/dependency-manager.js.map +1 -1
- package/dist/design-system/index.d.ts +21 -0
- package/dist/design-system/index.d.ts.map +1 -0
- package/dist/design-system/index.js +27 -0
- package/dist/design-system/index.js.map +1 -0
- package/dist/design-system/tokens.d.ts +149 -0
- package/dist/design-system/tokens.d.ts.map +1 -0
- package/dist/design-system/tokens.js +413 -0
- package/dist/design-system/tokens.js.map +1 -0
- package/dist/design-system/transaction-ui.d.ts +70 -0
- package/dist/design-system/transaction-ui.d.ts.map +1 -0
- package/dist/design-system/transaction-ui.js +982 -0
- package/dist/design-system/transaction-ui.js.map +1 -0
- package/dist/generator.d.ts +58 -8
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +9 -4
- package/dist/generator.js.map +1 -1
- package/dist/index.d.ts +10 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -44
- package/dist/index.js.map +1 -1
- package/dist/io.d.ts +395 -0
- package/dist/io.d.ts.map +1 -0
- package/dist/io.js +304 -0
- package/dist/io.js.map +1 -0
- package/dist/path-resolver.d.ts.map +1 -1
- package/dist/path-resolver.js +2 -1
- package/dist/path-resolver.js.map +1 -1
- package/dist/rendering/components.d.ts +29 -0
- package/dist/rendering/components.d.ts.map +1 -0
- package/dist/rendering/components.js +773 -0
- package/dist/rendering/components.js.map +1 -0
- package/dist/rendering/field-analyzer.d.ts +48 -0
- package/dist/rendering/field-analyzer.d.ts.map +1 -0
- package/dist/rendering/field-analyzer.js +270 -0
- package/dist/rendering/field-analyzer.js.map +1 -0
- package/dist/rendering/field-renderers.d.ts +64 -0
- package/dist/rendering/field-renderers.d.ts.map +1 -0
- package/dist/rendering/field-renderers.js +317 -0
- package/dist/rendering/field-renderers.js.map +1 -0
- package/dist/rendering/index.d.ts +28 -0
- package/dist/rendering/index.d.ts.map +1 -0
- package/dist/rendering/index.js +60 -0
- package/dist/rendering/index.js.map +1 -0
- package/dist/rendering/layout-selector.d.ts +48 -0
- package/dist/rendering/layout-selector.d.ts.map +1 -0
- package/dist/rendering/layout-selector.js +347 -0
- package/dist/rendering/layout-selector.js.map +1 -0
- package/dist/rendering/template-engine.d.ts +41 -0
- package/dist/rendering/template-engine.d.ts.map +1 -0
- package/dist/rendering/template-engine.js +236 -0
- package/dist/rendering/template-engine.js.map +1 -0
- package/dist/schema-extractor.d.ts +30 -0
- package/dist/schema-extractor.d.ts.map +1 -1
- package/dist/schema-extractor.js +205 -12
- package/dist/schema-extractor.js.map +1 -1
- package/dist/stateful.d.ts +63 -0
- package/dist/stateful.d.ts.map +1 -1
- package/dist/stateful.js +222 -0
- package/dist/stateful.js.map +1 -1
- package/dist/types.d.ts +9 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/ucp/ap2/handlers.d.ts +242 -0
- package/dist/ucp/ap2/handlers.d.ts.map +1 -0
- package/dist/ucp/ap2/handlers.js +482 -0
- package/dist/ucp/ap2/handlers.js.map +1 -0
- package/dist/ucp/ap2/mandates.d.ts +95 -0
- package/dist/ucp/ap2/mandates.d.ts.map +1 -0
- package/dist/ucp/ap2/mandates.js +234 -0
- package/dist/ucp/ap2/mandates.js.map +1 -0
- package/dist/ucp/ap2/types.d.ts +305 -0
- package/dist/ucp/ap2/types.d.ts.map +1 -0
- package/dist/ucp/ap2/types.js +8 -0
- package/dist/ucp/ap2/types.js.map +1 -0
- package/dist/ucp/capabilities/checkout.d.ts +118 -0
- package/dist/ucp/capabilities/checkout.d.ts.map +1 -0
- package/dist/ucp/capabilities/checkout.js +344 -0
- package/dist/ucp/capabilities/checkout.js.map +1 -0
- package/dist/ucp/capabilities/identity.d.ts +130 -0
- package/dist/ucp/capabilities/identity.d.ts.map +1 -0
- package/dist/ucp/capabilities/identity.js +290 -0
- package/dist/ucp/capabilities/identity.js.map +1 -0
- package/dist/ucp/capabilities/order.d.ts +142 -0
- package/dist/ucp/capabilities/order.d.ts.map +1 -0
- package/dist/ucp/capabilities/order.js +383 -0
- package/dist/ucp/capabilities/order.js.map +1 -0
- package/dist/ucp/index.d.ts +18 -0
- package/dist/ucp/index.d.ts.map +1 -0
- package/dist/ucp/index.js +19 -0
- package/dist/ucp/index.js.map +1 -0
- package/dist/ucp/manifest.d.ts +62 -0
- package/dist/ucp/manifest.d.ts.map +1 -0
- package/dist/ucp/manifest.js +180 -0
- package/dist/ucp/manifest.js.map +1 -0
- package/dist/ucp/types.d.ts +327 -0
- package/dist/ucp/types.d.ts.map +1 -0
- package/dist/ucp/types.js +8 -0
- package/dist/ucp/types.js.map +1 -0
- package/package.json +3 -4
- package/src/auto-ui.ts +413 -0
- package/src/base.ts +22 -9
- package/src/cli-ui-renderer.ts +264 -0
- package/src/dependency-manager.ts +0 -1
- package/src/design-system/index.ts +30 -0
- package/src/design-system/tokens.ts +451 -0
- package/src/design-system/transaction-ui.ts +1038 -0
- package/src/generator.ts +68 -8
- package/src/index.ts +159 -101
- package/src/io.ts +493 -0
- package/src/path-resolver.ts +2 -1
- package/src/rendering/components.ts +785 -0
- package/src/rendering/field-analyzer.ts +299 -0
- package/src/rendering/field-renderers.ts +356 -0
- package/src/rendering/index.ts +63 -0
- package/src/rendering/layout-selector.ts +390 -0
- package/src/rendering/template-engine.ts +254 -0
- package/src/schema-extractor.ts +225 -12
- package/src/stateful.ts +301 -0
- package/src/types.ts +10 -1
- package/src/ucp/ap2/handlers.ts +779 -0
- package/src/ucp/ap2/mandates.ts +354 -0
- package/src/ucp/ap2/types.ts +441 -0
- package/src/ucp/capabilities/checkout.ts +497 -0
- package/src/ucp/capabilities/identity.ts +425 -0
- package/src/ucp/capabilities/order.ts +549 -0
- package/src/ucp/index.ts +27 -0
- package/src/ucp/manifest.ts +257 -0
- package/src/ucp/types.ts +454 -0
- package/dist/cli-formatter.d.ts +0 -92
- package/dist/cli-formatter.d.ts.map +0 -1
- package/dist/cli-formatter.js +0 -486
- package/dist/cli-formatter.js.map +0 -1
- package/dist/elicit.d.ts +0 -93
- package/dist/elicit.d.ts.map +0 -1
- package/dist/elicit.js +0 -373
- package/dist/elicit.js.map +0 -1
- package/dist/mcp-client.d.ts +0 -218
- package/dist/mcp-client.d.ts.map +0 -1
- package/dist/mcp-client.js +0 -424
- package/dist/mcp-client.js.map +0 -1
- package/dist/mcp-sdk-transport.d.ts +0 -88
- package/dist/mcp-sdk-transport.d.ts.map +0 -1
- package/dist/mcp-sdk-transport.js +0 -360
- package/dist/mcp-sdk-transport.js.map +0 -1
- package/dist/photon-config.d.ts +0 -86
- package/dist/photon-config.d.ts.map +0 -1
- package/dist/photon-config.js +0 -156
- package/dist/photon-config.js.map +0 -1
- package/src/cli-formatter.ts +0 -579
- package/src/elicit.ts +0 -438
- package/src/mcp-client.ts +0 -561
- package/src/mcp-sdk-transport.ts +0 -449
- package/src/photon-config.ts +0 -201
package/src/generator.ts
CHANGED
|
@@ -203,14 +203,70 @@ export interface AskConfirm extends AskBase {
|
|
|
203
203
|
* multi: true
|
|
204
204
|
* };
|
|
205
205
|
*/
|
|
206
|
+
/**
|
|
207
|
+
* Rich select option for e-commerce, catalogs, and other common use cases.
|
|
208
|
+
*/
|
|
209
|
+
export type SelectOptionObject = {
|
|
210
|
+
/** Unique identifier returned when selected */
|
|
211
|
+
value: string;
|
|
212
|
+
/** Display label (product name, item title) */
|
|
213
|
+
label: string;
|
|
214
|
+
/** Secondary text (short description) */
|
|
215
|
+
description?: string;
|
|
216
|
+
/** Image URL (product photo, thumbnail) */
|
|
217
|
+
image?: string;
|
|
218
|
+
/** Price in currency units (rendered with locale formatting) */
|
|
219
|
+
price?: number;
|
|
220
|
+
/** Original price for showing discounts */
|
|
221
|
+
originalPrice?: number;
|
|
222
|
+
/** Currency code (default: USD) */
|
|
223
|
+
currency?: string;
|
|
224
|
+
/** Badge text (Sale, New, Low Stock, etc.) */
|
|
225
|
+
badge?: string;
|
|
226
|
+
/** Badge color/type for styling */
|
|
227
|
+
badgeType?: 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
228
|
+
/** Quantity (for cart items) */
|
|
229
|
+
quantity?: number;
|
|
230
|
+
/** Enable +/- quantity controls */
|
|
231
|
+
adjustable?: boolean;
|
|
232
|
+
/** Minimum quantity (0 = can remove, default: 1) */
|
|
233
|
+
minQuantity?: number;
|
|
234
|
+
/** Maximum quantity allowed */
|
|
235
|
+
maxQuantity?: number;
|
|
236
|
+
/** Category for filtering (e.g., 'vegetarian', 'spicy') */
|
|
237
|
+
category?: string | string[];
|
|
238
|
+
/** Whether the option is disabled/unavailable */
|
|
239
|
+
disabled?: boolean;
|
|
240
|
+
/** Reason for being disabled (Out of stock, etc.) */
|
|
241
|
+
disabledReason?: string;
|
|
242
|
+
/** Pre-selected state for multi-select */
|
|
243
|
+
selected?: boolean;
|
|
244
|
+
/** Additional metadata (not rendered, returned with selection) */
|
|
245
|
+
meta?: Record<string, any>;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export type SelectOption = string | SelectOptionObject;
|
|
249
|
+
|
|
206
250
|
export interface AskSelect extends AskBase {
|
|
207
251
|
ask: 'select';
|
|
208
|
-
/** Available options */
|
|
209
|
-
options:
|
|
252
|
+
/** Available options - simple strings or rich option objects */
|
|
253
|
+
options: SelectOption[];
|
|
210
254
|
/** Allow selecting multiple options */
|
|
211
255
|
multi?: boolean;
|
|
212
256
|
/** Default selected value(s) */
|
|
213
257
|
default?: string | string[];
|
|
258
|
+
/** Layout style for rendering options */
|
|
259
|
+
layout?: 'list' | 'grid' | 'cards';
|
|
260
|
+
/** Number of columns for grid/cards layout */
|
|
261
|
+
columns?: number;
|
|
262
|
+
/** Filter buttons to show (e.g., ['All', 'Vegetarian', 'Vegan']) */
|
|
263
|
+
filters?: string[];
|
|
264
|
+
/** Which option field to filter on (default: 'category') */
|
|
265
|
+
filterField?: string;
|
|
266
|
+
/** Show search box for filtering options */
|
|
267
|
+
searchable?: boolean;
|
|
268
|
+
/** Placeholder text for search box */
|
|
269
|
+
searchPlaceholder?: string;
|
|
214
270
|
}
|
|
215
271
|
|
|
216
272
|
/**
|
|
@@ -725,8 +781,8 @@ export type StatefulYield = PhotonYield | CheckpointYield;
|
|
|
725
781
|
* generator.next(userInput);
|
|
726
782
|
* }
|
|
727
783
|
*/
|
|
728
|
-
export function isAskYield(y: PhotonYield): y is AskYield {
|
|
729
|
-
return 'ask' in y;
|
|
784
|
+
export function isAskYield(y: PhotonYield | any): y is AskYield {
|
|
785
|
+
return typeof y === 'object' && y !== null && 'ask' in y;
|
|
730
786
|
}
|
|
731
787
|
|
|
732
788
|
/**
|
|
@@ -738,8 +794,8 @@ export function isAskYield(y: PhotonYield): y is AskYield {
|
|
|
738
794
|
* generator.next(); // Continue without value
|
|
739
795
|
* }
|
|
740
796
|
*/
|
|
741
|
-
export function isEmitYield(y: PhotonYield): y is EmitYield {
|
|
742
|
-
return 'emit' in y;
|
|
797
|
+
export function isEmitYield(y: PhotonYield | any): y is EmitYield {
|
|
798
|
+
return typeof y === 'object' && y !== null && 'emit' in y;
|
|
743
799
|
}
|
|
744
800
|
|
|
745
801
|
/**
|
|
@@ -930,9 +986,13 @@ export async function executeGenerator<T>(
|
|
|
930
986
|
// Continue without providing a value
|
|
931
987
|
result = await generator.next();
|
|
932
988
|
}
|
|
933
|
-
//
|
|
989
|
+
// Handle raw values (strings, numbers, objects without emit/ask)
|
|
934
990
|
else {
|
|
935
|
-
|
|
991
|
+
if (outputHandler) {
|
|
992
|
+
await outputHandler({ emit: 'stream', data: yielded } as EmitStream);
|
|
993
|
+
} else {
|
|
994
|
+
console.warn('[generator] Unknown yield type without output handler:', yielded);
|
|
995
|
+
}
|
|
936
996
|
result = await generator.next();
|
|
937
997
|
}
|
|
938
998
|
}
|
package/src/index.ts
CHANGED
|
@@ -33,17 +33,18 @@
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Dependency management
|
|
40
|
-
export { DependencyManager } from './dependency-manager.js';
|
|
41
|
-
|
|
42
|
-
// Schema extraction
|
|
43
|
-
export { SchemaExtractor } from './schema-extractor.js';
|
|
44
|
-
|
|
45
|
-
// CLI formatting
|
|
36
|
+
// ===== RE-EXPORT FROM @portel/cli =====
|
|
37
|
+
// CLI formatting, progress, text utils, fuzzy matching, logging
|
|
46
38
|
export {
|
|
39
|
+
// Types
|
|
40
|
+
type OutputFormat,
|
|
41
|
+
type TextWrapOptions,
|
|
42
|
+
type FuzzyMatch,
|
|
43
|
+
type ExecutionContext,
|
|
44
|
+
type LogLevel,
|
|
45
|
+
type LoggerOptions,
|
|
46
|
+
|
|
47
|
+
// CLI Formatting
|
|
47
48
|
formatOutput,
|
|
48
49
|
detectFormat,
|
|
49
50
|
renderPrimitive,
|
|
@@ -60,54 +61,123 @@ export {
|
|
|
60
61
|
printWarning,
|
|
61
62
|
printHeader,
|
|
62
63
|
STATUS,
|
|
63
|
-
} from './cli-formatter.js';
|
|
64
64
|
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
DEFAULT_PHOTON_DIR,
|
|
74
|
-
type ResolverOptions,
|
|
75
|
-
} from './path-resolver.js';
|
|
65
|
+
// Progress
|
|
66
|
+
ProgressRenderer,
|
|
67
|
+
getProgressRenderer,
|
|
68
|
+
startSpinner,
|
|
69
|
+
showProgress,
|
|
70
|
+
updateProgressMessage,
|
|
71
|
+
stopProgress,
|
|
72
|
+
isProgressActive,
|
|
76
73
|
|
|
77
|
-
//
|
|
78
|
-
|
|
74
|
+
// Execution Context
|
|
75
|
+
executionContext,
|
|
76
|
+
runWithContext,
|
|
77
|
+
getContext,
|
|
79
78
|
|
|
80
|
-
//
|
|
79
|
+
// Text Utils
|
|
80
|
+
TextUtils,
|
|
81
|
+
|
|
82
|
+
// Fuzzy Matching
|
|
83
|
+
FuzzyMatcher,
|
|
84
|
+
fuzzyMatch,
|
|
85
|
+
fuzzyScore,
|
|
86
|
+
findBestMatch,
|
|
87
|
+
|
|
88
|
+
// Logger
|
|
89
|
+
Logger,
|
|
90
|
+
createLogger,
|
|
91
|
+
getLogger,
|
|
92
|
+
} from '@portel/cli';
|
|
93
|
+
|
|
94
|
+
// ===== RE-EXPORT FROM @portel/mcp =====
|
|
95
|
+
// MCP client, transport, configuration, elicitation
|
|
81
96
|
export {
|
|
97
|
+
// Types
|
|
98
|
+
type MCPToolInfo,
|
|
99
|
+
type MCPToolResult,
|
|
100
|
+
type MCPTransport,
|
|
101
|
+
type MCPSourceType,
|
|
102
|
+
type MissingMCPInfo,
|
|
103
|
+
type MCPServerConfig,
|
|
104
|
+
type MCPConfig,
|
|
105
|
+
type PhotonMCPConfig,
|
|
106
|
+
type ElicitOptions,
|
|
107
|
+
type ElicitResult,
|
|
108
|
+
type PromptHandler,
|
|
109
|
+
type ElicitHandler,
|
|
110
|
+
|
|
111
|
+
// MCP Client
|
|
82
112
|
MCPClient,
|
|
113
|
+
type MCPClientFactory,
|
|
83
114
|
MCPError,
|
|
84
115
|
MCPNotConnectedError,
|
|
85
116
|
MCPToolError,
|
|
86
117
|
MCPConfigurationError,
|
|
87
118
|
createMCPProxy,
|
|
88
|
-
type MCPToolInfo,
|
|
89
|
-
type MCPToolResult,
|
|
90
|
-
type MCPTransport,
|
|
91
|
-
type MCPClientFactory,
|
|
92
|
-
type MCPSourceType,
|
|
93
|
-
type MissingMCPInfo,
|
|
94
|
-
} from './mcp-client.js';
|
|
95
119
|
|
|
96
|
-
// MCP SDK Transport
|
|
97
|
-
export {
|
|
120
|
+
// MCP SDK Transport
|
|
98
121
|
SDKMCPTransport,
|
|
99
122
|
SDKMCPClientFactory,
|
|
100
123
|
loadMCPConfig,
|
|
101
124
|
createSDKMCPClientFactory,
|
|
102
125
|
resolveMCPSource,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
126
|
+
|
|
127
|
+
// MCP Configuration
|
|
128
|
+
PHOTON_CONFIG_DIR,
|
|
129
|
+
MCP_SERVERS_CONFIG_FILE,
|
|
130
|
+
loadPhotonMCPConfig,
|
|
131
|
+
savePhotonMCPConfig,
|
|
132
|
+
isMCPConfigured,
|
|
133
|
+
getMCPServerConfig,
|
|
134
|
+
listMCPServers,
|
|
135
|
+
setMCPServerConfig,
|
|
136
|
+
removeMCPServerConfig,
|
|
137
|
+
toMCPConfig,
|
|
138
|
+
resolveEnvVars,
|
|
139
|
+
|
|
140
|
+
// Elicitation
|
|
141
|
+
prompt,
|
|
142
|
+
confirm,
|
|
143
|
+
elicit,
|
|
144
|
+
elicitReadline,
|
|
145
|
+
elicitNativeDialog,
|
|
146
|
+
setPromptHandler,
|
|
147
|
+
getPromptHandler,
|
|
148
|
+
setElicitHandler,
|
|
149
|
+
getElicitHandler,
|
|
150
|
+
} from '@portel/mcp';
|
|
151
|
+
|
|
152
|
+
// ===== PHOTON-SPECIFIC EXPORTS =====
|
|
153
|
+
|
|
154
|
+
// Core base class with lifecycle hooks
|
|
155
|
+
export { PhotonMCP } from './base.js';
|
|
156
|
+
|
|
157
|
+
// Dependency management
|
|
158
|
+
export { DependencyManager } from './dependency-manager.js';
|
|
159
|
+
|
|
160
|
+
// Schema extraction
|
|
161
|
+
export { SchemaExtractor } from './schema-extractor.js';
|
|
162
|
+
|
|
163
|
+
// Path resolution (Photon-specific paths)
|
|
164
|
+
export {
|
|
165
|
+
resolvePath,
|
|
166
|
+
listFiles,
|
|
167
|
+
ensureDir,
|
|
168
|
+
resolvePhotonPath,
|
|
169
|
+
listPhotonFiles,
|
|
170
|
+
ensurePhotonDir,
|
|
171
|
+
DEFAULT_PHOTON_DIR,
|
|
172
|
+
type ResolverOptions,
|
|
173
|
+
} from './path-resolver.js';
|
|
174
|
+
|
|
175
|
+
// Types
|
|
176
|
+
export * from './types.js';
|
|
106
177
|
|
|
107
178
|
// Generator-based tools with ask/emit pattern
|
|
108
|
-
// See generator.ts for comprehensive documentation
|
|
109
179
|
export {
|
|
110
|
-
// Type guards
|
|
180
|
+
// Type guards
|
|
111
181
|
isAskYield,
|
|
112
182
|
isEmitYield,
|
|
113
183
|
isCheckpointYield,
|
|
@@ -118,10 +188,10 @@ export {
|
|
|
118
188
|
isAsyncGeneratorFunction,
|
|
119
189
|
isAsyncGenerator,
|
|
120
190
|
|
|
121
|
-
// Executor
|
|
191
|
+
// Executor
|
|
122
192
|
executeGenerator,
|
|
123
193
|
|
|
124
|
-
// Ask extraction
|
|
194
|
+
// Ask extraction
|
|
125
195
|
extractAsks,
|
|
126
196
|
|
|
127
197
|
// Built-in providers
|
|
@@ -131,7 +201,7 @@ export {
|
|
|
131
201
|
// Utility
|
|
132
202
|
wrapAsGenerator,
|
|
133
203
|
|
|
134
|
-
// Ask yield types
|
|
204
|
+
// Ask yield types
|
|
135
205
|
type AskYield,
|
|
136
206
|
type AskText,
|
|
137
207
|
type AskPassword,
|
|
@@ -143,7 +213,11 @@ export {
|
|
|
143
213
|
type AskForm,
|
|
144
214
|
type AskUrl,
|
|
145
215
|
|
|
146
|
-
//
|
|
216
|
+
// Rich select option types (e-commerce, catalogs)
|
|
217
|
+
type SelectOption,
|
|
218
|
+
type SelectOptionObject,
|
|
219
|
+
|
|
220
|
+
// Form schema types
|
|
147
221
|
type FormSchema,
|
|
148
222
|
type FormSchemaProperty,
|
|
149
223
|
type FormSchemaArrayProperty,
|
|
@@ -152,7 +226,7 @@ export {
|
|
|
152
226
|
type ElicitAction,
|
|
153
227
|
type FormElicitResult,
|
|
154
228
|
|
|
155
|
-
// Emit yield types
|
|
229
|
+
// Emit yield types
|
|
156
230
|
type EmitYield,
|
|
157
231
|
type EmitStatus,
|
|
158
232
|
type EmitProgress,
|
|
@@ -163,7 +237,7 @@ export {
|
|
|
163
237
|
type EmitArtifact,
|
|
164
238
|
type EmitUI,
|
|
165
239
|
|
|
166
|
-
// Checkpoint yield type
|
|
240
|
+
// Checkpoint yield type
|
|
167
241
|
type CheckpointYield,
|
|
168
242
|
|
|
169
243
|
// Combined types
|
|
@@ -176,7 +250,7 @@ export {
|
|
|
176
250
|
type GeneratorExecutorConfig,
|
|
177
251
|
type ExtractedAsk,
|
|
178
252
|
|
|
179
|
-
// Legacy compatibility
|
|
253
|
+
// Legacy compatibility
|
|
180
254
|
isInputYield,
|
|
181
255
|
isProgressYield,
|
|
182
256
|
isStreamYield,
|
|
@@ -191,75 +265,59 @@ export {
|
|
|
191
265
|
type ExtractedYield,
|
|
192
266
|
} from './generator.js';
|
|
193
267
|
|
|
194
|
-
//
|
|
195
|
-
export {
|
|
196
|
-
// Simple functions (no imports needed in photon files)
|
|
197
|
-
prompt,
|
|
198
|
-
confirm,
|
|
199
|
-
// Full elicit with options
|
|
200
|
-
elicit,
|
|
201
|
-
elicitReadline,
|
|
202
|
-
elicitNativeDialog,
|
|
203
|
-
// Handler management (for runtimes)
|
|
204
|
-
setPromptHandler,
|
|
205
|
-
getPromptHandler,
|
|
206
|
-
setElicitHandler,
|
|
207
|
-
getElicitHandler,
|
|
208
|
-
// Types
|
|
209
|
-
type ElicitOptions,
|
|
210
|
-
type ElicitResult,
|
|
211
|
-
type ElicitHandler,
|
|
212
|
-
type PromptHandler,
|
|
213
|
-
} from './elicit.js';
|
|
214
|
-
|
|
215
|
-
// Photon Runtime Configuration - ~/.photon/mcp-servers.json
|
|
268
|
+
// Stateful Workflow Execution
|
|
216
269
|
export {
|
|
217
|
-
// Constants
|
|
218
|
-
PHOTON_CONFIG_DIR,
|
|
219
|
-
MCP_SERVERS_CONFIG_FILE,
|
|
220
|
-
// Load/Save
|
|
221
|
-
loadPhotonMCPConfig,
|
|
222
|
-
savePhotonMCPConfig,
|
|
223
|
-
// Query
|
|
224
|
-
isMCPConfigured,
|
|
225
|
-
getMCPServerConfig,
|
|
226
|
-
listMCPServers,
|
|
227
|
-
// Modify
|
|
228
|
-
setMCPServerConfig,
|
|
229
|
-
removeMCPServerConfig,
|
|
230
|
-
// Utilities
|
|
231
|
-
toMCPConfig,
|
|
232
|
-
resolveEnvVars,
|
|
233
|
-
// Types
|
|
234
|
-
type PhotonMCPConfig,
|
|
235
|
-
} from './photon-config.js';
|
|
236
|
-
|
|
237
|
-
// Stateful Workflow Execution - JSONL persistence with checkpoints
|
|
238
|
-
export {
|
|
239
|
-
// Constants
|
|
240
270
|
RUNS_DIR,
|
|
241
|
-
|
|
242
|
-
// State Log - JSONL persistence
|
|
243
271
|
StateLog,
|
|
244
|
-
|
|
245
|
-
// Resume state parsing
|
|
246
272
|
parseResumeState,
|
|
247
|
-
|
|
248
|
-
// Stateful executor
|
|
249
273
|
executeStatefulGenerator,
|
|
250
274
|
generateRunId,
|
|
251
|
-
|
|
252
|
-
// Run management
|
|
275
|
+
maybeStatefulExecute,
|
|
253
276
|
listRuns,
|
|
254
277
|
getRunInfo,
|
|
255
278
|
deleteRun,
|
|
256
279
|
cleanupRuns,
|
|
257
|
-
|
|
258
|
-
// Types re-exported from stateful.ts
|
|
259
280
|
type CheckpointYield as StatefulCheckpointYield,
|
|
260
281
|
type StatefulYield as StatefulWorkflowYield,
|
|
261
282
|
isCheckpointYield as isStatefulCheckpointYield,
|
|
262
283
|
type ResumeState,
|
|
263
284
|
type StatefulExecutorConfig,
|
|
264
285
|
type StatefulExecutionResult,
|
|
286
|
+
type MaybeStatefulConfig,
|
|
287
|
+
type MaybeStatefulResult,
|
|
265
288
|
} from './stateful.js';
|
|
289
|
+
|
|
290
|
+
// Auto-UI System
|
|
291
|
+
export {
|
|
292
|
+
type UIComponentType,
|
|
293
|
+
type UILayout,
|
|
294
|
+
type UIComponent,
|
|
295
|
+
type AutoUIConfig,
|
|
296
|
+
extractUIHints,
|
|
297
|
+
generateUIComponent,
|
|
298
|
+
suggestComponents,
|
|
299
|
+
shouldUseCards,
|
|
300
|
+
shouldUseChart,
|
|
301
|
+
type UIRenderer,
|
|
302
|
+
renderUIComponent,
|
|
303
|
+
} from './auto-ui.js';
|
|
304
|
+
|
|
305
|
+
// CLI UI Renderer
|
|
306
|
+
export {
|
|
307
|
+
CLIUIRenderer,
|
|
308
|
+
cliRenderer,
|
|
309
|
+
} from './cli-ui-renderer.js';
|
|
310
|
+
|
|
311
|
+
// IO Helper API
|
|
312
|
+
export { io, emit, ask } from './io.js';
|
|
313
|
+
|
|
314
|
+
// ===== SMART RENDERING (HTML/Web UI) =====
|
|
315
|
+
// Design system tokens and utilities
|
|
316
|
+
export * from './design-system/index.js';
|
|
317
|
+
|
|
318
|
+
// Smart rendering modules for auto-UI generation
|
|
319
|
+
export * from './rendering/index.js';
|
|
320
|
+
|
|
321
|
+
// ===== UCP (Universal Commerce Protocol) =====
|
|
322
|
+
// Agentic commerce with checkout, identity, orders, and AP2 payments
|
|
323
|
+
export * from './ucp/index.js';
|