@qloo/qloo-harness 0.1.18

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.
@@ -0,0 +1,223 @@
1
+ import { createRequire as __qlooCreateRequire } from "node:module";
2
+ const require = __qlooCreateRequire(import.meta.url);
3
+
4
+ // apps/qloo-harness/dist/guided-journey.js
5
+ var QLOO_GUIDED_GOALS = [
6
+ {
7
+ id: "ask",
8
+ label: "Ask Qloo a question",
9
+ description: "Recommendations, comparisons, trends, places, and cultural context",
10
+ profile: "explore",
11
+ starters: [
12
+ {
13
+ label: "Find recommendations for an audience",
14
+ prompt: "Recommend five [things] for [audience] who like [interests], in [place]. Explain how you interpreted my request."
15
+ },
16
+ {
17
+ label: "Compare two tastes",
18
+ prompt: "Compare the audiences and taste affinities around [first entity] and [second entity]. Explain the strongest differences."
19
+ },
20
+ {
21
+ label: "Explore what is trending",
22
+ prompt: "What is trending for [category] in [place] during [date range], and what does the result support?"
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ id: "audience",
28
+ label: "Explore an audience or idea",
29
+ description: "Turn everyday language into Qloo entities, tags, and useful audience signals",
30
+ profile: "explore",
31
+ starters: [
32
+ {
33
+ label: "Understand an audience",
34
+ prompt: "Help me understand people in [place] who like [entities or ideas]. Resolve the concepts through Qloo, ask only about choices that would materially change the answer, and summarize the resulting taste profile."
35
+ },
36
+ {
37
+ label: "Ground an aesthetic or concept",
38
+ prompt: "Show me how Qloo represents the idea \u201C[concept or aesthetic]\u201D. Explain meaningful candidate differences before asking me to choose."
39
+ },
40
+ {
41
+ label: "Find related brands or experiences",
42
+ prompt: "Find [brands, places, artists, or experiences] associated with people who like [entities, tags, or aesthetics]."
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ id: "integrate",
48
+ label: "Integrate Qloo into my product",
49
+ description: "Map Qloo inputs and results onto the project in this directory",
50
+ profile: "plan",
51
+ starters: [
52
+ {
53
+ label: "Design an integration",
54
+ prompt: "Inspect this project's bounded integration context and design a Qloo integration for [product behavior]. Map our domain fields to Qloo signals and filters, map Qloo results back to our data model, and include auth, errors, retries, pagination, and focused tests."
55
+ },
56
+ {
57
+ label: "Translate an existing use case",
58
+ prompt: "I currently need to [describe use case]. Inspect this project and show exactly where Qloo fits, including a field-by-field request and response mapping and the safest implementation boundary."
59
+ },
60
+ {
61
+ label: "Review an existing integration",
62
+ prompt: "Inspect this project's Qloo integration and identify contract, normalization, error-handling, privacy, and test gaps. Start with a read-only assessment."
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ id: "diagnose",
68
+ label: "Diagnose my Qloo setup",
69
+ description: "Check credentials, endpoint trust, resolution, and network reachability",
70
+ starters: []
71
+ },
72
+ {
73
+ id: "blank",
74
+ label: "Start with a blank prompt",
75
+ description: "Keep the current profile and write your own request",
76
+ starters: []
77
+ }
78
+ ];
79
+ function clipGuidedLine(text, width) {
80
+ const characters = [...text];
81
+ if (characters.length <= width)
82
+ return text;
83
+ if (width === 1)
84
+ return "\u2026";
85
+ return `${characters.slice(0, width - 1).join("")}\u2026`;
86
+ }
87
+ function qlooStarterIdeaLines(availableWidth) {
88
+ const width = Math.max(1, Math.floor(availableWidth));
89
+ const detailed = width >= 96;
90
+ const goals = QLOO_GUIDED_GOALS.filter(({ id }) => id !== "blank");
91
+ const title = width >= 42 ? "Start typing, or try one of these:" : "Start typing \u2014 ideas:";
92
+ const footer = width >= 54 ? "Type anything now \xB7 /start opens guided, editable prompts" : "Type anything \xB7 /start for guided prompts";
93
+ return [
94
+ title,
95
+ ...goals.map((goal) => detailed ? ` \u2022 ${goal.label} \u2014 ${goal.description}` : ` \u2022 ${goal.label}`),
96
+ footer
97
+ ].map((line) => clipGuidedLine(line, width));
98
+ }
99
+ var COMMON_SUCCESS_ACTIONS = [
100
+ {
101
+ id: "explain",
102
+ label: "Explain what this result means (and does not mean)",
103
+ kind: "prompt",
104
+ value: "Explain the latest Qloo result in plain language. Separate what the data supports from assumptions, and call out important limitations."
105
+ },
106
+ {
107
+ id: "refine",
108
+ label: "Refine the question or audience",
109
+ kind: "prompt",
110
+ value: "Help me refine the latest Qloo question. Suggest the two or three changes most likely to produce a meaningfully different result, without asking me for API parameter names."
111
+ },
112
+ {
113
+ id: "request",
114
+ label: "Inspect the underlying Qloo request",
115
+ kind: "command",
116
+ value: "request"
117
+ },
118
+ {
119
+ id: "integrate",
120
+ label: "Turn this into an integration plan",
121
+ kind: "prompt",
122
+ profile: "plan",
123
+ value: "Turn the latest Qloo workflow into a project-grounded integration plan. Map application inputs to Qloo signals and filters, and map normalized Qloo results back to the application data model."
124
+ }
125
+ ];
126
+ function operationPrompt(operation) {
127
+ switch (operation) {
128
+ case "recommend":
129
+ case "rank":
130
+ return {
131
+ id: "compare",
132
+ label: "Compare with another audience or signal",
133
+ kind: "prompt",
134
+ value: "Run a useful comparison against the latest result by changing one material audience or taste signal. Ask me which signal if the choice is not clear."
135
+ };
136
+ case "compare":
137
+ case "compare_audiences":
138
+ return {
139
+ id: "deepen-compare",
140
+ label: "Explore the strongest difference",
141
+ kind: "prompt",
142
+ value: "Take the strongest meaningful difference in the latest comparison and explore it further with the narrowest relevant Qloo workflow."
143
+ };
144
+ case "trends":
145
+ return {
146
+ id: "trend-window",
147
+ label: "Try another place or time window",
148
+ kind: "prompt",
149
+ value: "Help me rerun the latest trend question for a useful comparison place or time window. Ask for the one missing choice in everyday language."
150
+ };
151
+ case "where_popular":
152
+ return {
153
+ id: "location-detail",
154
+ label: "Explore another location",
155
+ kind: "prompt",
156
+ value: "Compare where the latest entity is popular with another location. Ask me for the comparison location if needed."
157
+ };
158
+ case "describe":
159
+ case "entity_tags":
160
+ case "find_tags":
161
+ return {
162
+ id: "use-signal",
163
+ label: "Use this as a taste signal",
164
+ kind: "prompt",
165
+ value: "Use the latest resolved Qloo entity or tag as a taste signal in a concrete recommendation. Ask me what kind of output and location I want if those are missing."
166
+ };
167
+ case "audience_demographics":
168
+ return {
169
+ id: "audience-recommendation",
170
+ label: "Use this audience in a recommendation",
171
+ kind: "prompt",
172
+ value: "Use the latest audience understanding to run a relevant Qloo recommendation. Ask me for the output category if it is not already clear."
173
+ };
174
+ default:
175
+ return void 0;
176
+ }
177
+ }
178
+ function qlooNextActions(workflow) {
179
+ const status = workflow.status;
180
+ if (status === "error" || status === "needs_input") {
181
+ return [
182
+ {
183
+ id: "why",
184
+ label: "See how Qloo interpreted the request",
185
+ kind: "command",
186
+ value: "why"
187
+ },
188
+ {
189
+ id: "doctor",
190
+ label: "Diagnose credentials and connectivity",
191
+ kind: "command",
192
+ value: "doctor network"
193
+ },
194
+ {
195
+ id: "retry",
196
+ label: "Retry the exact Qloo workflow once",
197
+ kind: "command",
198
+ value: "retry"
199
+ },
200
+ {
201
+ id: "rephrase",
202
+ label: "Rephrase the request in plain language",
203
+ kind: "prompt",
204
+ value: "Help me rephrase the latest request using everyday language. Preserve my goal while resolving only the ambiguity or missing information that blocked it."
205
+ }
206
+ ];
207
+ }
208
+ const specific = operationPrompt(workflow.operation);
209
+ return specific ? [specific, ...COMMON_SUCCESS_ACTIONS] : [...COMMON_SUCCESS_ACTIONS];
210
+ }
211
+ function findGuidedGoal(label) {
212
+ return QLOO_GUIDED_GOALS.find((goal) => `${goal.label} \u2014 ${goal.description}` === label);
213
+ }
214
+ function guidedGoalLabel(goal) {
215
+ return `${goal.label} \u2014 ${goal.description}`;
216
+ }
217
+ export {
218
+ QLOO_GUIDED_GOALS,
219
+ findGuidedGoal,
220
+ guidedGoalLabel,
221
+ qlooNextActions,
222
+ qlooStarterIdeaLines
223
+ };