@portel/photon-core 1.1.0 → 1.2.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/dist/generator.d.ts +587 -107
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +313 -151
- package/dist/generator.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generator.ts +779 -220
- package/src/index.ts +50 -13
package/src/index.ts
CHANGED
|
@@ -77,36 +77,73 @@ export {
|
|
|
77
77
|
// Types
|
|
78
78
|
export * from './types.js';
|
|
79
79
|
|
|
80
|
-
// Generator-based tools
|
|
80
|
+
// Generator-based tools with ask/emit pattern
|
|
81
|
+
// See generator.ts for comprehensive documentation
|
|
81
82
|
export {
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
// Type guards - check yield direction
|
|
84
|
+
isAskYield,
|
|
85
|
+
isEmitYield,
|
|
86
|
+
getAskType,
|
|
87
|
+
getEmitType,
|
|
88
|
+
|
|
87
89
|
// Generator detection
|
|
88
90
|
isAsyncGeneratorFunction,
|
|
89
91
|
isAsyncGenerator,
|
|
90
|
-
|
|
92
|
+
|
|
93
|
+
// Executor - runs generators to completion
|
|
91
94
|
executeGenerator,
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
|
|
96
|
+
// Ask extraction (for REST API schema generation)
|
|
97
|
+
extractAsks,
|
|
98
|
+
|
|
94
99
|
// Built-in providers
|
|
95
100
|
createPrefilledProvider,
|
|
96
101
|
NeedsInputError,
|
|
102
|
+
|
|
97
103
|
// Utility
|
|
98
104
|
wrapAsGenerator,
|
|
99
|
-
|
|
105
|
+
|
|
106
|
+
// Ask yield types (input from user)
|
|
107
|
+
type AskYield,
|
|
108
|
+
type AskText,
|
|
109
|
+
type AskPassword,
|
|
110
|
+
type AskConfirm,
|
|
111
|
+
type AskSelect,
|
|
112
|
+
type AskNumber,
|
|
113
|
+
type AskFile,
|
|
114
|
+
type AskDate,
|
|
115
|
+
|
|
116
|
+
// Emit yield types (output to user)
|
|
117
|
+
type EmitYield,
|
|
118
|
+
type EmitStatus,
|
|
119
|
+
type EmitProgress,
|
|
120
|
+
type EmitStream,
|
|
121
|
+
type EmitLog,
|
|
122
|
+
type EmitToast,
|
|
123
|
+
type EmitThinking,
|
|
124
|
+
type EmitArtifact,
|
|
125
|
+
|
|
126
|
+
// Combined type
|
|
100
127
|
type PhotonYield,
|
|
128
|
+
|
|
129
|
+
// Execution config
|
|
130
|
+
type InputProvider,
|
|
131
|
+
type OutputHandler,
|
|
132
|
+
type GeneratorExecutorConfig,
|
|
133
|
+
type ExtractedAsk,
|
|
134
|
+
|
|
135
|
+
// Legacy compatibility (deprecated)
|
|
136
|
+
isInputYield,
|
|
137
|
+
isProgressYield,
|
|
138
|
+
isStreamYield,
|
|
139
|
+
isLogYield,
|
|
140
|
+
extractYields,
|
|
101
141
|
type PromptYield,
|
|
102
142
|
type ConfirmYield,
|
|
103
143
|
type SelectYield,
|
|
104
144
|
type ProgressYield,
|
|
105
145
|
type StreamYield,
|
|
106
146
|
type LogYield,
|
|
107
|
-
type InputProvider,
|
|
108
|
-
type OutputHandler,
|
|
109
|
-
type GeneratorExecutorConfig,
|
|
110
147
|
type ExtractedYield,
|
|
111
148
|
} from './generator.js';
|
|
112
149
|
|