# Script Catalog Read this file when you need the exact CLI surface of the bundled scripts without rediscovering flags from source. Read this file for flag names, parameter conflicts, execution modes, and helper-script contracts. Skip it for routine asks that already map cleanly to a known intent or view. ## Quick Navigation - Discovery policy: [Discovery Rule](#discovery-rule) - Shortest path by ask type: [Minimal-Step Decision Table](#minimal-step-decision-table) - Annual June-to-May week lookup: [Week Shortcuts](#week-shortcuts) - Main fetch command: [Script: `fetch-sales-intelligence.mjs`](#script-fetch-sales-intelligencemjs) - Browser refresh helper: [Script: `refresh-auth-state.mjs`](#script-refresh-auth-statemjs) - Direct auth helper: [Script: `refresh-auth-direct.mjs`](#script-refresh-auth-directmjs) - Quote-safe SQL helper: [Script: `run-sales-intelligence-sql.mjs`](#script-run-sales-intelligence-sqlmjs) For manager, hierarchy, architect-productivity, or business-parameter context, read [initial-context-catalog.md](initial-context-catalog.md) first. That skill-level catalog front-loads verified manager emails, hierarchy heuristics, and common query translations so the agent can execute faster before touching the generated CLI catalog. ## Discovery Rule - Prefer [initial-context-catalog.md](initial-context-catalog.md) first for manager or hierarchy asks. - Prefer `node scripts/fetch-sales-intelligence.mjs --catalog` first for CLI and data-contract discovery. - The catalog now returns `views`, `intents`, `entities`, `fields`, `macros`, `parameters`, and `scripts`. - For focused inspection, use `--list-parameters`, `--describe-parameter`, `--list-scripts`, and `--describe-script`. - Treat `--catalog` as a one-shot resolver, not the first step in every request. - If the ask already maps to a known intent, view, or query pattern, execute directly and skip discovery. - After `--catalog`, go straight to the execution command. Avoid chaining `--list-*` calls unless one exact contract detail is still missing. ## Operational Keepers These are the local catalog items worth keeping highly visible because they reduce trial-and-error during real backend execution: - Discovery helpers: `--catalog`, `--list-parameters`, `--describe-parameter`, `--list-scripts`, `--describe-script`. - Workspace/runtime path controls: `--runtime-home`, `--state-path`, `--meta-path`, `--output-file`. - Backend targeting: `--base-url`, plus auth refresh `--url`. - Browser-auth recovery: `--profile-dir`, `--chrome-path`, `--timeout-ms`. - Direct-auth recovery: `--username`, `--factor`. Role-shaped placeholder emails used below are illustrative only. Keep verified hierarchy anchors in `initial-context-catalog.md`, but keep routine usage examples generic. ## Minimal-Step Decision Table | Ask shape | Shortest default | |---|---| | Recurring business request | `--intent ...` | | Known row extract | `--view ...` | | Ad hoc aliases + filters + grouping | `--query ...` | | Need exact Oracle expression | `--sql ...` | | Need contract discovery | `--catalog` once | | Need one specific flag or script | `--describe-parameter ...` or `--describe-script ...` | ## Week Shortcuts Use these as fixed lookups for June-to-May cycle asks: | Token | Meaning | |---|---| | `W1` / `week 1` | Starts on June 1 of the cycle start year | | `W2` / `week 2` | Starts 7 days after `W1` | | `W43` / `week 43` | Continues counting across January without resetting | | `W53` / `week 53` | Final partial week ending on the last day of May | CLI flags: - `--week ` accepts `1..53`, `w1..w53`, or `week 1..week 53` - `--week-year ` selects the cycle start year for that June-to-May map - For the explicit default-cycle table, read [Week Reference](#week-reference) # Week Reference Use this file for asks that mention `week`, `wk`, or `w1`..`w53`. Week numbering is anchored on `June 1` and runs continuously until the last day of the following `May`. Interpretation rules: - `week-year` means the cycle start year. - `week-year 2025` means the cycle `2025-06-01` through `2026-05-31`. - If the user does not specify a year, default to the current June-cycle. - Do not recalculate the default cycle in normal execution. Use the explicit table below. ## Default Cycle Lookup Current default cycle for this workspace date context: - `week-year 2025` - cycle start: `2025-06-01` - cycle end: `2026-05-31` | Week | Start | End | |---|---|---| | W1 | 2025-06-01 | 2025-06-07 | | W2 | 2025-06-08 | 2025-06-14 | | W3 | 2025-06-15 | 2025-06-21 | | W4 | 2025-06-22 | 2025-06-28 | | W5 | 2025-06-29 | 2025-07-05 | | W6 | 2025-07-06 | 2025-07-12 | | W7 | 2025-07-13 | 2025-07-19 | | W8 | 2025-07-20 | 2025-07-26 | | W9 | 2025-07-27 | 2025-08-02 | | W10 | 2025-08-03 | 2025-08-09 | | W11 | 2025-08-10 | 2025-08-16 | | W12 | 2025-08-17 | 2025-08-23 | | W13 | 2025-08-24 | 2025-08-30 | | W14 | 2025-08-31 | 2025-09-06 | | W15 | 2025-09-07 | 2025-09-13 | | W16 | 2025-09-14 | 2025-09-20 | | W17 | 2025-09-21 | 2025-09-27 | | W18 | 2025-09-28 | 2025-10-04 | | W19 | 2025-10-05 | 2025-10-11 | | W20 | 2025-10-12 | 2025-10-18 | | W21 | 2025-10-19 | 2025-10-25 | | W22 | 2025-10-26 | 2025-11-01 | | W23 | 2025-11-02 | 2025-11-08 | | W24 | 2025-11-09 | 2025-11-15 | | W25 | 2025-11-16 | 2025-11-22 | | W26 | 2025-11-23 | 2025-11-29 | | W27 | 2025-11-30 | 2025-12-06 | | W28 | 2025-12-07 | 2025-12-13 | | W29 | 2025-12-14 | 2025-12-20 | | W30 | 2025-12-21 | 2025-12-27 | | W31 | 2025-12-28 | 2026-01-03 | | W32 | 2026-01-04 | 2026-01-10 | | W33 | 2026-01-11 | 2026-01-17 | | W34 | 2026-01-18 | 2026-01-24 | | W35 | 2026-01-25 | 2026-01-31 | | W36 | 2026-02-01 | 2026-02-07 | | W37 | 2026-02-08 | 2026-02-14 | | W38 | 2026-02-15 | 2026-02-21 | | W39 | 2026-02-22 | 2026-02-28 | | W40 | 2026-03-01 | 2026-03-07 | | W41 | 2026-03-08 | 2026-03-14 | | W42 | 2026-03-15 | 2026-03-21 | | W43 | 2026-03-22 | 2026-03-28 | | W44 | 2026-03-29 | 2026-04-04 | | W45 | 2026-04-05 | 2026-04-11 | | W46 | 2026-04-12 | 2026-04-18 | | W47 | 2026-04-19 | 2026-04-25 | | W48 | 2026-04-26 | 2026-05-02 | | W49 | 2026-05-03 | 2026-05-09 | | W50 | 2026-05-10 | 2026-05-16 | | W51 | 2026-05-17 | 2026-05-23 | | W52 | 2026-05-24 | 2026-05-30 | | W53 | 2026-05-31 | 2026-05-31 | Examples: - `week 1` -> `2025-06-01` to `2025-06-07` - `recursos do resource.manager em pipe na week 43` -> use `--intent opportunities-by-manager-close-window --manager-email resource.manager@oracle.com --week w43` ## Script: `fetch-sales-intelligence.mjs` Primary backend retrieval entrypoint for Oracle DV. ### Discovery flags | Flag | Type | Description | |---|---|---| | `--catalog` | flag | Return the full local catalog, including script and parameter metadata. | | `--list-views` | flag | List built-in views. | | `--describe-view ` | string | Describe one built-in view. | | `--list-intents` | flag | List recurring business intents. | | `--describe-intent ` | string | Describe one intent. | | `--list-entities` | flag | List entities and the views that expose them. | | `--list-fields` | flag | List local field aliases. | | `--describe-field ` | string | Describe one field alias. | | `--list-parameters` | flag | List the parameter catalog. | | `--describe-parameter ` | string | Describe one parameter. Accepts `resource` or `--resource`. | | `--list-scripts` | flag | List runnable scripts in the skill. | | `--describe-script