@algolia/wizard 0.84.0-rc.202.647 → 0.84.0-rc.202.650
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/main.js
CHANGED
|
@@ -2315,7 +2315,7 @@ async function ensureApplication(resumeAppId) {
|
|
|
2315
2315
|
// package.json
|
|
2316
2316
|
var package_default = {
|
|
2317
2317
|
name: "@algolia/wizard",
|
|
2318
|
-
version: "0.84.0-rc.202.
|
|
2318
|
+
version: "0.84.0-rc.202.650",
|
|
2319
2319
|
description: "Magically implement Algolia functionality in your codebase",
|
|
2320
2320
|
type: "module",
|
|
2321
2321
|
engines: {
|
|
@@ -5206,6 +5206,23 @@ var AgentReportedFailureError = class extends Error {
|
|
|
5206
5206
|
this.reason = reason;
|
|
5207
5207
|
}
|
|
5208
5208
|
};
|
|
5209
|
+
function withCachedHistory(messages) {
|
|
5210
|
+
const last = messages.at(-1);
|
|
5211
|
+
if (!last) return messages;
|
|
5212
|
+
return [
|
|
5213
|
+
...messages.slice(0, -1),
|
|
5214
|
+
{
|
|
5215
|
+
...last,
|
|
5216
|
+
providerOptions: {
|
|
5217
|
+
...last.providerOptions,
|
|
5218
|
+
anthropic: {
|
|
5219
|
+
...last.providerOptions?.anthropic,
|
|
5220
|
+
cacheControl: { type: "ephemeral" }
|
|
5221
|
+
}
|
|
5222
|
+
}
|
|
5223
|
+
}
|
|
5224
|
+
];
|
|
5225
|
+
}
|
|
5209
5226
|
function isMissingReportRetry(kind) {
|
|
5210
5227
|
return kind === "missingReport" || kind === "missingReportAtStepLimit";
|
|
5211
5228
|
}
|
|
@@ -5327,7 +5344,12 @@ async function runAgentAttempt(req, attempt, retryReason) {
|
|
|
5327
5344
|
hasToolCall("reportStatus"),
|
|
5328
5345
|
stepCountIs(profile.maxSteps)
|
|
5329
5346
|
],
|
|
5330
|
-
prepareStep: ({ stepNumber }) =>
|
|
5347
|
+
prepareStep: ({ stepNumber, messages }) => ({
|
|
5348
|
+
messages: withCachedHistory(messages),
|
|
5349
|
+
...stepNumber >= profile.maxSteps - 1 && {
|
|
5350
|
+
activeTools: ["reportStatus"]
|
|
5351
|
+
}
|
|
5352
|
+
}),
|
|
5331
5353
|
// Not in the settings type, but forwarded to streamText, whose default prints over the UI.
|
|
5332
5354
|
...{ onError: () => {
|
|
5333
5355
|
} }
|
|
@@ -6250,7 +6272,8 @@ function sourceSpecificInstructions(input) {
|
|
|
6250
6272
|
"Records live locally in this project (files, local DB, or local API).",
|
|
6251
6273
|
"Read each record from its real local source at the confirmed entity paths.",
|
|
6252
6274
|
"Never fabricate, hardcode, or use placeholder records.",
|
|
6253
|
-
"Add env vars for any local source access (DB URL, API base, file paths) that is not a fixed repo path."
|
|
6275
|
+
"Add env vars for any local source access (DB URL, API base, file paths) that is not a fixed repo path.",
|
|
6276
|
+
"To read a database, use the database client or ORM that the project already declares in its manifest. Never install a database driver or ORM. If the project declares none, report that limitation instead of adding one."
|
|
6254
6277
|
],
|
|
6255
6278
|
fileUpload: [
|
|
6256
6279
|
`Records come from the developer's file, already copied into the project at "${input.uploadFilePath}". Read and parse that exact file.`,
|
|
@@ -6303,7 +6326,8 @@ function ingestionInstructions(input) {
|
|
|
6303
6326
|
] : [],
|
|
6304
6327
|
`When the script is finished, decide the exact command and cwd you will use to run it. Make sure that the script path in the command resolves from that cwd to the filePath. Then call reviewScript with that filePath, command, cwd, the exact selected entityName, and usesGeneratedRecords set to ${input.ingestionSource === "generated"}. Wait for the developer to review it because running it writes records to a live index. Do not run it before that call returns. If you change the command or cwd after a failed run, call reviewScript again before runShell.`,
|
|
6305
6328
|
'Then, without changing directories, run the script yourself via runShell using the exact same command and cwd. Report the exact command you ran as "ingestCommand", with no cwd note or other text, so the developer can re-run it. Its explanation must say that running it writes records to Algolia.',
|
|
6306
|
-
"When the script reads from a database or another service, find how the project connects to it locally (env files, README, socket or TCP settings). If that connection needs a local service, such as a database proxy (for example cloud-sql-proxy) or a tunnel, make the script check the connection before it reads,
|
|
6329
|
+
"When the script reads from a database or another service, find how the project connects to it locally (env files, README, socket or TCP settings). If that connection needs a local service, such as a database proxy (for example cloud-sql-proxy) or a tunnel, make the script check the connection before it reads. If the check fails, the script must print an error that names the service, then print exactly one last line to stdout in the form `ALGOLIA_WIZARD_START_HINT=<command>`, where <command> is the command from the project docs that starts the service, and exit with an error. Omit that line when the project docs name no start command.",
|
|
6330
|
+
"Make sure that the start command and the script connect to the same address (the same socket path, or the same host and port). If the project env points at an address that only a deployed environment has, such as a /cloudsql socket, make the script connect to the address of the start command. Set that address in the script before it loads the project database module. Do not edit project env or config files for this.",
|
|
6307
6331
|
"If external data access fails, do not run authentication commands, change accounts or machine configuration, or start proxies, containers, or services.",
|
|
6308
6332
|
"Do not troubleshoot unavailable external infrastructure. Preserve the script and command, report success, and let the developer prepare the data source.",
|
|
6309
6333
|
"If the script cannot access an external data source because credentials or a service are unavailable, do not report status=fail. Report status=success with the completed script, ingestCommand, and a concise failure summary. The wizard handles this run failure and tells the developer how to retry.",
|
|
@@ -6403,7 +6427,7 @@ function packageSearchInstructions(input) {
|
|
|
6403
6427
|
],
|
|
6404
6428
|
`Create the search experience as its own component in a new file, following the project's existing component conventions (location, naming, styling approach). Do not write it inline into an existing file.`,
|
|
6405
6429
|
"When rendering results with an existing shared component (e.g. a card), import and reuse that component rather than inlining its markup \u2014 inlining silently drops the styles and behavior its own file provides.",
|
|
6406
|
-
"Vendor theme CSS, and any CSS you write against vendor class names, must be global:
|
|
6430
|
+
"Vendor theme CSS, and any CSS you write against vendor class names, must be global: put overrides in a global block (Astro <style is:global>, an unscoped Vue block, a plain global CSS file). Never a framework-scoped style block or a CSS Module \u2014 scoping rewrites the vendor selectors and the widget's runtime DOM carries no scope attribute, so not one rule matches: styling silently does nothing and the build still passes. Import the theme and those global overrides only where the framework allows first-party global CSS: Next.js Pages Router only from pages/_app (or _app.tsx), Next.js App Router only from the root layout, otherwise from the app's global stylesheet or the component module when that is valid. Do not import a plain .css file from a Next.js component \u2014 that fails the build.",
|
|
6407
6431
|
`Define ${SEARCH_CONFIG_APP_ID}, ${SEARCH_CONFIG_SEARCH_KEY}, and ${SEARCH_CONFIG_INDEX_NAME} as exported constants in a module that fits this project's existing conventions for shared client-side config \u2014 reuse an existing one if it already holds config like this, or add a small new one otherwise. These are PUBLIC values, safe to commit and expose client-side: never read them from an environment variable or a .env* file, and never hardcode them anywhere except in that one module (import them wherever the search client needs them).`,
|
|
6408
6432
|
`Set ${SEARCH_CONFIG_APP_ID} to "${input.appId}" and ${SEARCH_CONFIG_INDEX_NAME} to "${input.targetIndex}".`,
|
|
6409
6433
|
input.searchKey ? `Set ${SEARCH_CONFIG_SEARCH_KEY} to "${input.searchKey}".` : `A real search-only key could not be provisioned${input.searchKeyError ? ` (${input.searchKeyError})` : ""} \u2014 set ${SEARCH_CONFIG_SEARCH_KEY} to the placeholder "${SEARCH_KEY_PLACEHOLDER}" and add a prominent TODO for the developer to fill in a real one.`,
|
|
@@ -6437,7 +6461,7 @@ function validationInstructions(input) {
|
|
|
6437
6461
|
"Confirm the search experience reflows without horizontal page scrolling at 320 CSS pixels, keeps its panel on-screen, preserves visible focus, and respects reduced-motion preferences for any added animation.",
|
|
6438
6462
|
"If the project imports an InstantSearch theme and overrides its palette, confirm that the palette overrides (--ais-*-rgb) win over the theme: they must use a higher specificity than the theme, for example `:root:root`, and for a dark mode `:root:root.dark` or `:root:root[data-theme=dark]`, because the theme sets its own blue in `:root` and in `:root[data-theme=dark], .dark`. `:root:root` alone ties with `:root[data-theme=dark]`. If an override can lose to the theme, set sufficient=false, because the search icon and focus ring then show the theme blue instead of the app accent color.",
|
|
6439
6463
|
"Find how the app selects each theme it supports (a class or attribute on an ancestor, a prefers-color-scheme media query, or a theme that exists only in code). Confirm that the search input and results panel take their colors from the active app theme through that same switch. A search widget whose colors do not match the page theme, for example a light panel on a dark page, is a failure: set sufficient=false.",
|
|
6440
|
-
"When the project has a package.json, confirm that the theme CSS of the search widget (for InstantSearch, a theme from instantsearch.css) is imported once
|
|
6464
|
+
"When the project has a package.json, confirm that the theme CSS of the search widget (for InstantSearch, a theme from instantsearch.css) is imported once from a legal global-CSS entry for that framework (Next.js Pages Router: pages/_app; Next.js App Router: root layout; otherwise the app global stylesheet or a component module when allowed). If it is installed but not imported, or imported from a Next.js component file, set sufficient=false.",
|
|
6441
6465
|
"Confirm that the search component is reachable from and fits the corresponding content task at every supported breakpoint; require app-wide reachability only when the search scope is genuinely app-wide.",
|
|
6442
6466
|
"Do not run the test suite or any test command.",
|
|
6443
6467
|
"Do not modify files. Report each implementation issue as a concrete instruction for the next implementation pass.",
|
|
@@ -6515,6 +6539,11 @@ function parseIngestRecordCount(output) {
|
|
|
6515
6539
|
const count = Number(match[1]);
|
|
6516
6540
|
return Number.isFinite(count) ? count : void 0;
|
|
6517
6541
|
}
|
|
6542
|
+
var START_HINT_LINE = /^ALGOLIA_WIZARD_START_HINT=(.*)$/gm;
|
|
6543
|
+
function parseStartHint(output) {
|
|
6544
|
+
const matches = [...(output ?? "").matchAll(START_HINT_LINE)];
|
|
6545
|
+
return matches.at(-1)?.[1]?.trim() || void 0;
|
|
6546
|
+
}
|
|
6518
6547
|
function relativeIngestCwd(execution, repoRoot) {
|
|
6519
6548
|
const cwd = relative7(repoRoot, execution.cwd);
|
|
6520
6549
|
return cwd && cwd !== "." ? cwd : ".";
|
|
@@ -6541,7 +6570,7 @@ function ingestOutcome(executions, repoRoot, ingestCommand) {
|
|
|
6541
6570
|
}
|
|
6542
6571
|
var INGEST_OUTPUT_TAIL_CHARS = 400;
|
|
6543
6572
|
function outputTail(output) {
|
|
6544
|
-
const trimmed = output?.trim();
|
|
6573
|
+
const trimmed = output?.replace(START_HINT_LINE, "").trim();
|
|
6545
6574
|
if (!trimmed) return void 0;
|
|
6546
6575
|
return trimmed.length > INGEST_OUTPUT_TAIL_CHARS ? `\u2026${trimmed.slice(-INGEST_OUTPUT_TAIL_CHARS)}` : trimmed;
|
|
6547
6576
|
}
|
|
@@ -6607,12 +6636,13 @@ function errorLine(output) {
|
|
|
6607
6636
|
const lines = output?.split("\n").map((l) => l.trim()).filter(Boolean) ?? [];
|
|
6608
6637
|
return [...lines].reverse().find((l) => /\w*(Error|Exception)\b/.test(l)) ?? lines.at(-1);
|
|
6609
6638
|
}
|
|
6610
|
-
function ingestFailureMessages(headline, detail, command, cwd) {
|
|
6639
|
+
function ingestFailureMessages(headline, detail, command, cwd, startHint) {
|
|
6611
6640
|
return [
|
|
6612
6641
|
headline,
|
|
6613
6642
|
// One message per line: Notices.tsx counts a message as one wrapped
|
|
6614
6643
|
// line, so an embedded newline overflows the panel's height accounting.
|
|
6615
6644
|
...detail?.split("\n").filter((l) => l.trim()) ?? [],
|
|
6645
|
+
...startHint ? [`Start the data source with: ${startHint}`] : [],
|
|
6616
6646
|
...command ? [
|
|
6617
6647
|
`Ingestion command: ${command}`,
|
|
6618
6648
|
...cwd !== "." ? [`Working directory: ${cwd}`] : []
|
|
@@ -6939,7 +6969,8 @@ async function implement(ctx, useCases = DEFAULT_IMPLEMENT_USE_CASES) {
|
|
|
6939
6969
|
`\u26A0\uFE0F Records were not indexed \u2014 ${reason}.`,
|
|
6940
6970
|
errorLine(detail),
|
|
6941
6971
|
attempt.command,
|
|
6942
|
-
relativeIngestCwd(attempt, repoRoot)
|
|
6972
|
+
relativeIngestCwd(attempt, repoRoot),
|
|
6973
|
+
parseStartHint(attempt.output)
|
|
6943
6974
|
)
|
|
6944
6975
|
});
|
|
6945
6976
|
if (choice !== INGEST_RETRY.retry) {
|
|
@@ -7053,7 +7084,8 @@ ${detail}` : ""}`
|
|
|
7053
7084
|
ingestOutcomeMessage,
|
|
7054
7085
|
ingestFailureDetail,
|
|
7055
7086
|
ingestCommand,
|
|
7056
|
-
ingestCwd
|
|
7087
|
+
ingestCwd,
|
|
7088
|
+
parseStartHint(ingestAttempt?.output)
|
|
7057
7089
|
)
|
|
7058
7090
|
});
|
|
7059
7091
|
}
|
|
@@ -9322,7 +9354,7 @@ async function resetProjectState() {
|
|
|
9322
9354
|
// package.json with { type: 'json' }
|
|
9323
9355
|
var package_default2 = {
|
|
9324
9356
|
name: "@algolia/wizard",
|
|
9325
|
-
version: "0.84.0-rc.202.
|
|
9357
|
+
version: "0.84.0-rc.202.650",
|
|
9326
9358
|
description: "Magically implement Algolia functionality in your codebase",
|
|
9327
9359
|
type: "module",
|
|
9328
9360
|
engines: {
|
|
@@ -126,13 +126,18 @@ WCAG 2.2 AA and verify after styling that:
|
|
|
126
126
|
|
|
127
127
|
### Styling the panel
|
|
128
128
|
|
|
129
|
-
The widget ships no CSS. Install `instantsearch.css` and import a theme once
|
|
130
|
-
|
|
129
|
+
The widget ships no CSS. Install `instantsearch.css` and import a theme once from a
|
|
130
|
+
legal global-CSS entry for the framework:
|
|
131
131
|
|
|
132
132
|
```js
|
|
133
133
|
import 'instantsearch.css/themes/satellite.css'
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
Import only where first-party global CSS is allowed: Next.js Pages Router from
|
|
137
|
+
`pages/_app`, Next.js App Router from the root layout, otherwise the app global
|
|
138
|
+
stylesheet or the component module when that is valid. Do not import a plain `.css`
|
|
139
|
+
file from a Next.js component — the build fails.
|
|
140
|
+
|
|
136
141
|
The theme and your `.ais-*` overrides must be **global**: never a CSS `@import` inside a
|
|
137
142
|
framework-scoped style block (Astro `<style>`, Vue `<style scoped>`, Svelte `<style>`) or
|
|
138
143
|
a CSS Module.
|
|
@@ -118,13 +118,18 @@ WCAG 2.2 AA and verify after styling that:
|
|
|
118
118
|
|
|
119
119
|
### Styling the panel
|
|
120
120
|
|
|
121
|
-
The widget ships no CSS. Install `instantsearch.css` and import a theme once
|
|
122
|
-
|
|
121
|
+
The widget ships no CSS. Install `instantsearch.css` and import a theme once from a
|
|
122
|
+
legal global-CSS entry for the framework:
|
|
123
123
|
|
|
124
124
|
```tsx
|
|
125
125
|
import 'instantsearch.css/themes/satellite.css'
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
+
Import only where first-party global CSS is allowed: Next.js Pages Router from
|
|
129
|
+
`pages/_app`, Next.js App Router from the root layout, otherwise the app global
|
|
130
|
+
stylesheet or the component module when that is valid. Do not import a plain `.css`
|
|
131
|
+
file from a Next.js component — the build fails.
|
|
132
|
+
|
|
128
133
|
The theme and your `.ais-*` overrides must be **global**: never route either through a CSS
|
|
129
134
|
Module, a scoped style block (Astro `<style>`, Vue `<style scoped>`, Svelte `<style>`), or
|
|
130
135
|
any styled-components-style wrapper that rewrites selectors. Keep them in a global
|