Skip to content

Commit ac94988

Browse files
committed
Merge origin/main into referral-one-time
Resolves merge conflicts to integrate both features: - referral_legacy grant type for legacy recurring monthly referrals - subscription grant type from main for subscription-based credits Conflict resolution: - common/src/types/grant.ts: Added both referral_legacy and subscription to GrantType - packages/billing: Updated grant-credits.ts to use referral_legacy for monthly bonuses - web/src/app/profile: Updated UI components to display both grant types correctly - DB migrations: Renumbered our migration to 0039 to sequence after main (0036-0038)
2 parents 295d137 + d22c7b9 commit ac94988

File tree

636 files changed

+28729
-6386
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

636 files changed

+28729
-6386
lines changed

.agents/lib/cli-agent-prompts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import type { CliAgentConfig } from './cli-agent-types'
21
import { CLI_AGENT_MODES } from './cli-agent-types'
32

3+
import type { CliAgentConfig } from './cli-agent-types'
4+
45
const TMUX_SESSION_DOCS = `## Session Logs (Paper Trail)
56
67
All session data is stored in **YAML format** in \`debug/tmux-sessions/{session-name}/\`:

.agents/lib/create-cli-agent.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import type { AgentDefinition } from '../types/agent-definition'
2-
import type { CliAgentConfig } from './cli-agent-types'
3-
import { CLI_AGENT_MODES } from './cli-agent-types'
4-
import { outputSchema } from './cli-agent-schemas'
51
import {
62
getSpawnerPrompt,
73
getSystemPrompt,
84
getInstructionsPrompt,
95
} from './cli-agent-prompts'
6+
import { outputSchema } from './cli-agent-schemas'
7+
import { CLI_AGENT_MODES } from './cli-agent-types'
8+
9+
import type { CliAgentConfig } from './cli-agent-types'
10+
import type { AgentDefinition } from '../types/agent-definition'
1011

1112
export function createCliAgent(config: CliAgentConfig): AgentDefinition {
1213
// Simple validation for shortName since it's used in file paths

.agents/notion-researcher.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import type { AgentDefinition } from './types/agent-definition'
21
import { publisher } from './constants'
32

3+
import type { AgentDefinition } from './types/agent-definition'
4+
45
const definition: AgentDefinition = {
56
id: 'notion-researcher',
67
publisher,

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ STRIPE_SECRET_KEY=sk_test_dummy_stripe_secret
1818
STRIPE_WEBHOOK_SECRET_KEY=whsec_dummy_webhook_secret
1919
STRIPE_USAGE_PRICE_ID=price_dummy_usage_id
2020
STRIPE_TEAM_FEE_PRICE_ID=price_dummy_team_fee_id
21+
STRIPE_SUBSCRIPTION_100_PRICE_ID=price_dummy_subscription_100_id
22+
STRIPE_SUBSCRIPTION_200_PRICE_ID=price_dummy_subscription_200_id
23+
STRIPE_SUBSCRIPTION_500_PRICE_ID=price_dummy_subscription_500_id
2124

2225
# External Services
2326
LINKUP_API_KEY=dummy_linkup_key

.github/workflows/ci.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,23 @@ jobs:
143143
command: |
144144
cd ${{ matrix.package }}
145145
if [ "${{ matrix.package }}" = ".agents" ]; then
146-
TEST_FILES=$(find __tests__ -name '*.test.ts' ! -name '*.integration.test.ts' 2>/dev/null | sort)
146+
TEST_FILES=$(find __tests__ -name '*.test.ts' ! -name '*.integration.test.ts' 2>/dev/null | sort | tr '\n' ' ')
147147
if [ -n "$TEST_FILES" ]; then
148-
echo "$TEST_FILES" | xargs -I {} bun test {}
148+
bun test $TEST_FILES
149149
else
150150
echo "No regular tests found in .agents"
151151
fi
152152
elif [ "${{ matrix.package }}" = "web" ]; then
153153
bun run test --runInBand
154154
else
155-
find src -name '*.test.ts' ! -name '*.integration.test.ts' | sort | xargs -I {} bun test {}
155+
# Run all non-integration tests in a single bun test invocation
156+
# This avoids xargs exit code issues with orphaned child processes
157+
TEST_FILES=$(find src -name '*.test.ts' ! -name '*.integration.test.ts' 2>/dev/null | sort | tr '\n' ' ')
158+
if [ -n "$TEST_FILES" ]; then
159+
bun test $TEST_FILES
160+
else
161+
echo "No tests found in ${{ matrix.package }}"
162+
fi
156163
fi
157164
158165
# - name: Open interactive debug shell
@@ -222,9 +229,9 @@ jobs:
222229
max_attempts: 3
223230
command: |
224231
cd ${{ matrix.package }}
225-
TEST_FILES=$(find src -name '*.integration.test.ts' 2>/dev/null | sort)
232+
TEST_FILES=$(find src -name '*.integration.test.ts' 2>/dev/null | sort | tr '\n' ' ')
226233
if [ -n "$TEST_FILES" ]; then
227-
echo "$TEST_FILES" | xargs -I {} bun test --timeout=60000 {}
234+
bun test --timeout=60000 $TEST_FILES
228235
else
229236
echo "No integration tests found in ${{ matrix.package }}"
230237
fi
@@ -310,9 +317,9 @@ jobs:
310317
max_attempts: 3
311318
command: |
312319
cd packages/billing
313-
TEST_FILES=$(find src -name '*.integration.test.ts' 2>/dev/null | sort)
320+
TEST_FILES=$(find src -name '*.integration.test.ts' 2>/dev/null | sort | tr '\n' ' ')
314321
if [ -n "$TEST_FILES" ]; then
315-
echo "$TEST_FILES" | xargs -I {} bun test --timeout=60000 {}
322+
bun test --timeout=60000 $TEST_FILES
316323
else
317324
echo "No integration tests found in packages/billing"
318325
fi
@@ -398,9 +405,9 @@ jobs:
398405
max_attempts: 3
399406
command: |
400407
cd packages/internal
401-
TEST_FILES=$(find src -name '*.integration.test.ts' 2>/dev/null | sort)
408+
TEST_FILES=$(find src -name '*.integration.test.ts' 2>/dev/null | sort | tr '\n' ' ')
402409
if [ -n "$TEST_FILES" ]; then
403-
echo "$TEST_FILES" | xargs -I {} bun test --timeout=60000 {}
410+
bun test --timeout=60000 $TEST_FILES
404411
else
405412
echo "No integration tests found in packages/internal"
406413
fi

.github/workflows/cli-release-prod.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,10 @@ jobs:
148148
- name: Set up Node.js for npm publishing
149149
uses: actions/setup-node@v4
150150
with:
151-
node-version: 20
151+
node-version: 24
152152
registry-url: https://registry.npmjs.org/
153153

154154
- name: Publish to npm
155155
run: |
156156
cd cli/release
157157
npm publish --access public
158-
env:
159-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

agents-graveyard/base/ask.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { buildArray } from '@codebuff/common/util/array'
33
import { closeXml } from '@codebuff/common/util/xml'
44

55
import { publisher } from '../constants'
6-
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
76
import { PLACEHOLDER } from '../types/secret-agent-definition'
87

8+
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
9+
910
const definition: SecretAgentDefinition = {
1011
id: 'ask',
1112
publisher,

agents-graveyard/base/base-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from './base-prompts'
88

99
import type { SecretAgentDefinition } from '../../agents/types/secret-agent-definition'
10-
import type { ModelName } from 'types/agent-definition'
10+
import type { ModelName } from '../../agents/types/agent-definition'
1111

1212
export const base = (
1313
model: ModelName,

agents-graveyard/base/base-lite-codex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { publisher } from '../../agents/constants.ts'
21
import baseLite from './base-lite.ts'
2+
import { publisher } from '../../agents/constants.ts'
33

44
import type { SecretAgentDefinition } from '../../agents/types/secret-agent-definition.ts'
55

agents-graveyard/base/base-lite-grok-4-fast.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import { buildArray } from '@codebuff/common/util/array'
2+
import { closeXml } from '@codebuff/common/util/xml'
3+
4+
import baseLite from './base-lite'
15
import { publisher } from '../constants'
6+
27
import {
38
PLACEHOLDER,
4-
SecretAgentDefinition,
5-
} from 'types/secret-agent-definition'
6-
import baseLite from './base-lite'
7-
import { buildArray } from '@codebuff/common/util/array'
8-
import { closeXml } from '@codebuff/common/util/xml'
9+
type SecretAgentDefinition,
10+
} from '../../agents/types/secret-agent-definition'
911

1012
const definition: SecretAgentDefinition = {
1113
...baseLite,

0 commit comments

Comments
 (0)