Skip to content

Commit 8388de7

Browse files
committed
Merge origin/main into feat/deep-research-chat and resolve conflicts
2 parents f94919c + b85d6ed commit 8388de7

39 files changed

Lines changed: 128002 additions & 2645 deletions

.agents/llms-txt/cloudflare-llms.txt

Lines changed: 157 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Scheduled Repo Search
2+
3+
on:
4+
schedule:
5+
# Runs at 00:00 UTC every day. You can adjust the cron schedule as needed.
6+
- cron: '0 0 * * *'
7+
workflow_dispatch: # Allows manual trigger from the Actions UI
8+
9+
# 🚨 CRITICAL FIX: Grant 'write' permissions so the action can push commits back to the repo
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
execute-search:
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Set up Python 3.12
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.12'
26+
cache: 'pip'
27+
cache-dependency-path: 'scripts/github/workflows/requirements.txt'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install -r scripts/github/workflows/requirements.txt
33+
34+
- name: Run Search Script
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
WORKER_API_URL: ${{ secrets.WORKER_API_URL }}
38+
run: python scripts/github/workflows/search_repos.py
39+
40+
# 🚀 NEW: Auto-commit the results.json file back into the repository
41+
- name: Commit and Push Results Locally
42+
uses: stefanzweifel/git-auto-commit-action@v5
43+
with:
44+
commit_message: "chore(bot): update daily github discovery results"
45+
file_pattern: "results.json"
46+
commit_user_name: "github-actions[bot]"
47+
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"

backend/src/db/schemas/agents/pricing.ts

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ export const pricingSnapshots = sqliteTable(
1717
provider: text('provider', { enum: ['openai', 'anthropic', 'google', 'cloudflare'] }).notNull(),
1818
modelId: text('model_id').notNull(), // e.g., 'gpt-4o', 'claude-sonnet-4.5'
1919
modelName: text('model_name').notNull(), // Human-readable name
20-
20+
2121
// Base pricing (standard context)
2222
inputCostPerM: real('input_cost_per_m').notNull(), // Cost per 1M input tokens
2323
outputCostPerM: real('output_cost_per_m').notNull(), // Cost per 1M output tokens
24-
24+
2525
// Long context pricing (>200k tokens)
2626
inputLongCostPerM: real('input_long_cost_per_m'), // Nullable
2727
outputLongCostPerM: real('output_long_cost_per_m'), // Nullable
28-
28+
2929
// Caching costs
3030
cacheReadCostPerM: real('cache_read_cost_per_m'), // Nullable
3131
cacheWriteCostPerM: real('cache_write_cost_per_m'), // Nullable
32-
32+
3333
// Metadata
3434
metadata: text('metadata'), // JSON string for additional data
3535
sourceUrl: text('source_url').notNull(), // URL where pricing was scraped
@@ -45,3 +45,49 @@ export const pricingSnapshots = sqliteTable(
4545

4646
export type PricingSnapshot = typeof pricingSnapshots.$inferSelect;
4747
export type NewPricingSnapshot = typeof pricingSnapshots.$inferInsert;
48+
49+
/**
50+
* Tracks changes to AI model pricing over time
51+
* Used to maintain a changelog of pricing fluctuations
52+
*/
53+
export const pricingChangeLog = sqliteTable(
54+
'pricing_change_log',
55+
{
56+
id: text('id').primaryKey(), // UUID
57+
provider: text('provider', { enum: ['openai', 'anthropic', 'google', 'cloudflare'] }).notNull(),
58+
modelId: text('model_id').notNull(),
59+
modelName: text('model_name').notNull(),
60+
61+
// Change type
62+
changeType: text('change_type', { enum: ['new_model', 'price_increase', 'price_decrease', 'no_change'] }).notNull(),
63+
64+
// Old pricing (null for new models)
65+
oldInputCostPerM: real('old_input_cost_per_m'),
66+
oldOutputCostPerM: real('old_output_cost_per_m'),
67+
oldInputLongCostPerM: real('old_input_long_cost_per_m'),
68+
oldOutputLongCostPerM: real('old_output_long_cost_per_m'),
69+
oldCacheReadCostPerM: real('old_cache_read_cost_per_m'),
70+
oldCacheWriteCostPerM: real('old_cache_write_cost_per_m'),
71+
72+
// New pricing
73+
newInputCostPerM: real('new_input_cost_per_m').notNull(),
74+
newOutputCostPerM: real('new_output_cost_per_m').notNull(),
75+
newInputLongCostPerM: real('new_input_long_cost_per_m'),
76+
newOutputLongCostPerM: real('new_output_long_cost_per_m'),
77+
newCacheReadCostPerM: real('new_cache_read_cost_per_m'),
78+
newCacheWriteCostPerM: real('new_cache_write_cost_per_m'),
79+
80+
// Metadata
81+
sourceUrl: text('source_url').notNull(),
82+
detectedAt: integer('detected_at', { mode: 'timestamp' }).notNull(),
83+
},
84+
(table) => ({
85+
providerIdx: index('pricing_change_provider_idx').on(table.provider),
86+
modelIdIdx: index('pricing_change_model_id_idx').on(table.modelId),
87+
detectedAtIdx: index('pricing_change_detected_at_idx').on(table.detectedAt),
88+
changeTypeIdx: index('pricing_change_type_idx').on(table.changeType),
89+
})
90+
);
91+
92+
export type PricingChangeLog = typeof pricingChangeLog.$inferSelect;
93+
export type NewPricingChangeLog = typeof pricingChangeLog.$inferInsert;

0 commit comments

Comments
 (0)