@algolia/wizard 0.9.0-rc.75.65 → 0.9.0-rc.76.66

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
@@ -1003,7 +1003,7 @@ var accessItems = [
1003
1003
  {
1004
1004
  tag: "READ",
1005
1005
  title: "Project files",
1006
- description: "reads your dependency manifests (package.json, pyproject.toml\u2026), configs & source to detect your stack. Read-only; nothing is uploaded."
1006
+ description: "reads your dependency manifests (package.json, pyproject.toml, Gemfile\u2026), configs & source to detect your stack. Read-only; nothing is uploaded."
1007
1007
  },
1008
1008
  {
1009
1009
  tag: "WRITE",
@@ -2389,6 +2389,31 @@ var LANGUAGE_PROFILES = {
2389
2389
  "build",
2390
2390
  "htmlcov"
2391
2391
  ]
2392
+ },
2393
+ ruby: {
2394
+ id: "ruby",
2395
+ displayName: "Ruby",
2396
+ aliases: ["ruby", "rb", "rails", "ruby on rails", "rubyonrails"],
2397
+ manifests: ["Gemfile", "*.gemspec"],
2398
+ packageManagers: [
2399
+ {
2400
+ id: "bundler",
2401
+ dependency: { mode: "agent-declares", file: "Gemfile" },
2402
+ installSteps: [{ argv: ["bundle", "install"] }],
2403
+ ingest: {
2404
+ kind: "auto",
2405
+ argv: ["bundle", "exec", "ruby", ENTRYPOINT_TOKEN],
2406
+ entrypointExtensions: [".rb"]
2407
+ }
2408
+ }
2409
+ ],
2410
+ sdk: { packageName: "algolia", versionPin: "~> 3.0", docKey: "ruby" },
2411
+ ingestEntrypointExample: `${INGEST_DIR}/ingest.rb`,
2412
+ // Ruby has no directory-level syntax check (`ruby -c` is one file at a
2413
+ // time), so verification relies on the agent's own review here.
2414
+ verification: [],
2415
+ envReadInstruction: "Read them from `ENV.fetch('NAME')`.",
2416
+ skipDirs: ["vendor", "tmp", "log", "coverage"]
2392
2417
  }
2393
2418
  };
2394
2419
  var DEFAULT_LANGUAGE_ID = "javascript";
@@ -3071,7 +3096,7 @@ var detectLanguageSchema = z16.object({
3071
3096
  var detectLanguage = () => runAgent({
3072
3097
  instructions: [
3073
3098
  "Analyze the codebase and determine the programming languages and frameworks used",
3074
- "Start from the dependency manifests: package.json, pyproject.toml, requirements.txt.",
3099
+ "Start from the dependency manifests: package.json, pyproject.toml, requirements.txt, Gemfile.",
3075
3100
  "List the language that owns the backend/data code first \u2014 that is the one an ingestion script will be written in.",
3076
3101
  "If a superset language is found, exclude the subset language. TS-over-JS.",
3077
3102
  "If a meta-framework is used, exclude the framework. Next-over-React.",
@@ -3124,7 +3149,7 @@ var MODE_CONFIG = {
3124
3149
  "Analyze the codebase to find the data entities (models) that should be ingested into Algolia.",
3125
3150
  "For each entity, return its name, the file path(s) where it is defined, and its indexable attribute keys (the fields a user would search or filter on).",
3126
3151
  "Inspect the source of each entity to extract real field names for attributes \u2014 do not guess or leave attributes empty.",
3127
- "Entities live wherever the stack keeps them: TypeScript interfaces or a Prisma schema, Django models.py, Pydantic models.",
3152
+ "Entities live wherever the stack keeps them: TypeScript interfaces or a Prisma schema, Django models.py, Rails app/models, Pydantic models.",
3128
3153
  "Prefer domain models (e.g. Document, Product, User) over framework or infrastructure types.",
3129
3154
  "Use as few tools as possible, but do not guess. If you cannot find any entities, return an empty array.",
3130
3155
  "Ignore directories that may be related to testing, like `/fixtures`, `/tests`, etc",
@@ -3147,7 +3172,7 @@ var MODE_CONFIG = {
3147
3172
  verification: {
3148
3173
  instructions: [
3149
3174
  "Analyze the codebase to determine which code-quality tools are available to validate changes.",
3150
- "Look at the dependency manifest and config files for the project's languages: package.json scripts with tsconfig/eslint/prettier, pyproject.toml or setup.cfg (ruff, mypy, black).",
3175
+ "Look at the dependency manifest and config files for the project's languages: package.json scripts with tsconfig/eslint/prettier, pyproject.toml or setup.cfg (ruff, mypy, black), Gemfile with .rubocop.yml.",
3151
3176
  'Return the tool names as an array, e.g. ["eslint", "prettier", "tsc"] or ["ruff", "mypy"].',
3152
3177
  "Use as few tools as possible, but do not guess. If you cannot find any, return an empty array.",
3153
3178
  "Ignore directories that may be related to testing, like `/fixtures`, `/tests`, etc",
@@ -3175,7 +3200,7 @@ async function runAnalysis(mode, extraInstructions = []) {
3175
3200
  // package.json
3176
3201
  var package_default = {
3177
3202
  name: "@algolia/wizard",
3178
- version: "0.9.0-rc.75.65",
3203
+ version: "0.9.0-rc.76.66",
3179
3204
  description: "Magically implement Algolia functionality in your codebase",
3180
3205
  type: "module",
3181
3206
  engines: {
@@ -17,6 +17,7 @@ Install the latest stable within the major; never pin an exact patch.
17
17
  | --- | --- | --- |
18
18
  | JavaScript/TypeScript | `algoliasearch` | `^5` |
19
19
  | Python | `algoliasearch` | `>=4,<5` |
20
+ | Ruby | `algolia` | `~> 3.0` |
20
21
 
21
22
  ## Search UI
22
23
 
@@ -0,0 +1,48 @@
1
+ # Save records (algolia v3)
2
+
3
+ Adds records to an index. Write op — use a **write key**, server-side only.
4
+
5
+ Dependency: gem `algolia`, `~> 3.0` (`gem 'algolia', '~> 3.0'`).
6
+
7
+ `require "algolia"` (gem name is `algolia`, not `algoliasearch`). Build the client
8
+ with `Algolia::SearchClient.create`.
9
+
10
+ ```ruby
11
+ require "algolia"
12
+
13
+ app_id = ENV.fetch("ALGOLIA_APPLICATION_ID")
14
+ api_key = ENV.fetch("ALGOLIA_WRITE_API_KEY")
15
+ index_name = "playlists"
16
+
17
+ client = Algolia::SearchClient.create(app_id, api_key)
18
+
19
+ records = [{ "objectID" => "1", "name" => "Hot 100", "visibility" => "public" }]
20
+
21
+ responses = client.save_objects(index_name, records, true)
22
+ ```
23
+
24
+ ```ruby
25
+ save_objects(
26
+ index_name, # String, required
27
+ objects, # Array<Hash>, required
28
+ wait_for_tasks = false,
29
+ batch_size = 1000,
30
+ request_options = {}
31
+ ) # => Array<Algolia::Search::BatchResponse>, one entry per 1,000-record batch
32
+ ```
33
+
34
+ Args are **positional**, and every method/field is **snake_case**: read
35
+ `r.task_id` and `r.object_ids`, not `taskID`/`objectIDs`. The return value is an
36
+ array — never treat it as one object.
37
+
38
+ Read records from a JSON file:
39
+
40
+ ```ruby
41
+ require "json"
42
+
43
+ records = JSON.parse(File.read(records_path))
44
+ ```
45
+
46
+ After a successful ingest, print `ALGOLIA_WIZARD_RECORD_COUNT=<n>` as the last
47
+ stdout line (`puts "ALGOLIA_WIZARD_RECORD_COUNT=#{records.length}"`), with no
48
+ other output after it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/wizard",
3
- "version": "0.9.0-rc.75.65",
3
+ "version": "0.9.0-rc.76.66",
4
4
  "description": "Magically implement Algolia functionality in your codebase",
5
5
  "type": "module",
6
6
  "engines": {