diff --git a/README.md b/README.md index 0180869..622b29b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.s Pin a version or choose an install directory: ```bash -curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --version v0.3.4 +curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --version v0.3.5 curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --install-dir "$HOME/bin" --force ``` @@ -37,7 +37,7 @@ Pin a version or skip `PATH` changes (useful in CI): ```powershell irm "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.ps1" | iex -Install-Tollbit -Version v0.3.4 -Force +Install-Tollbit -Version v0.3.5 -Force Install-Tollbit -NoModifyPath -PrintPathInstructions ``` @@ -167,7 +167,7 @@ Installer channel updates: curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash # Pinned -curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --version v0.3.4 --force +curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --version v0.3.5 --force ``` ```powershell diff --git a/internal/cli/analytics.go b/internal/cli/analytics.go index 3891766..72cdfe3 100644 --- a/internal/cli/analytics.go +++ b/internal/cli/analytics.go @@ -21,7 +21,8 @@ automatically when needed).` const analyticsQueryLongHelp = `Execute a read-only SQL query against TollBit analytics. -Queries use BigQuery Standard SQL. Only a single SELECT statement is accepted; +Queries use standard SQL (SQL:2011) as reported by "analytics schema" in its +"dialect" field. Only a single SELECT statement is accepted; SHOW, DESCRIBE, and data-modifying statements are rejected by the server. Use "analytics schema" to list the tables and columns you can query. diff --git a/internal/cli/analytics_test.go b/internal/cli/analytics_test.go index 9ddfac0..5a61e2f 100644 --- a/internal/cli/analytics_test.go +++ b/internal/cli/analytics_test.go @@ -178,7 +178,7 @@ func TestAnalyticsSchemaUsesOBOAgentTokenAndWritesJSON(t *testing.T) { if r.Header.Get("Authorization") != "Bearer "+token { t.Fatal("unexpected authorization header") } - _, _ = w.Write([]byte(`{"dialect":"bigquery","tables":[{"name":"agent_logs_by_page","clustering":["host","user_agent","path"],"columns":[{"name":"host","type":"STRING"}]}],"limits":{"max_rows":{"value":10000,"unit":"rows"}}}`)) + _, _ = w.Write([]byte(`{"dialect":"standard_sql","tables":[{"name":"agent_logs_by_page","clustering":["host","user_agent","path"],"columns":[{"name":"host","type":"STRING"}]}],"limits":{"max_rows":{"value":10000,"unit":"rows"}}}`)) })) defer analyticsSrv.Close() @@ -211,7 +211,7 @@ func TestAnalyticsSchemaUsesOBOAgentTokenAndWritesJSON(t *testing.T) { if err := json.Unmarshal(stdout.Bytes(), &output); err != nil { t.Fatalf("invalid JSON output %q: %v", stdout.String(), err) } - if output.Dialect != "bigquery" || len(output.Tables) != 1 || output.Tables[0].Name != "agent_logs_by_page" { + if output.Dialect != "standard_sql" || len(output.Tables) != 1 || output.Tables[0].Name != "agent_logs_by_page" { t.Fatalf("unexpected schema: %#v", output) } if len(output.Tables[0].Clustering) != 3 || len(output.Tables[0].Columns) != 1 || output.Tables[0].Columns[0].Name != "host" { @@ -304,7 +304,7 @@ func TestAnalyticsHelpDocumentsQueryContract(t *testing.T) { want []string }{ {[]string{"analytics", "--help"}, []string{"analytics schema", "analytics query"}}, - {[]string{"analytics", "query", "--help"}, []string{"BigQuery Standard SQL", "single SELECT", "timestamp", "user_agent_aggregate", "Examples:", "meta"}}, + {[]string{"analytics", "query", "--help"}, []string{"standard SQL", "single SELECT", "timestamp", "user_agent_aggregate", "Examples:", "meta"}}, {[]string{"analytics", "schema", "--help"}, []string{"JSON object", "limits", "clustering", "analytics query"}}, } { var stdout, stderr bytes.Buffer diff --git a/internal/client/analytics/client_test.go b/internal/client/analytics/client_test.go index edb2974..10fa43f 100644 --- a/internal/client/analytics/client_test.go +++ b/internal/client/analytics/client_test.go @@ -88,7 +88,7 @@ func TestSchema(t *testing.T) { t.Fatal("unexpected authorization header") } _, _ = w.Write([]byte(`{ - "dialect": "bigquery", + "dialect": "standard_sql", "tables": [{"name": "agent_logs_by_page", "description": "Daily counts.", "clustering": ["host", "user_agent", "path"], "columns": [{"name": "host", "type": "STRING", "description": "Site hostname."}, {"name": "type", "type": "STRING", "values": ["REQUEST", "ROBOT"]}]}], @@ -106,7 +106,7 @@ func TestSchema(t *testing.T) { if err != nil { t.Fatal(err) } - if schema.Dialect != "bigquery" { + if schema.Dialect != "standard_sql" { t.Fatalf("unexpected dialect: %q", schema.Dialect) } if len(schema.Tables) != 1 || schema.Tables[0].Name != "agent_logs_by_page" || schema.Tables[0].Description != "Daily counts." { diff --git a/internal/version/version.go b/internal/version/version.go index d597038..ecddf2b 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -2,4 +2,4 @@ // Bump this when shipping; keep skill frontmatter `version` in sync (tests enforce it). package version -const Version = "0.3.4" +const Version = "0.3.5" diff --git a/skill/tollbit-cli/SKILL.md b/skill/tollbit-cli/SKILL.md index 9770595..992501f 100644 --- a/skill/tollbit-cli/SKILL.md +++ b/skill/tollbit-cli/SKILL.md @@ -1,6 +1,6 @@ --- name: tollbit-cli -version: 0.3.4 +version: 0.3.5 description: Search for news and articles and ground answers in licensed publisher content on the TollBit network. Use whenever the user wants to find news, articles, reporting, or sources on a topic or current event — searches the catalog, then prices and fetches full article content (paid) with the tollbit CLI. ---