Merge branch 'staging' into big-nate-bus-1608-make-a-tanstack-start-demo

This commit is contained in:
Nate Kelley 2025-09-04 08:50:29 -06:00
commit e5112da7b8
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
12 changed files with 58 additions and 47 deletions

View File

@ -103,6 +103,7 @@ export function createAnalystAgent(analystAgentOptions: AnalystAgentOptions) {
headers: {
'anthropic-beta':
'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
anthropic_beta: 'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
},
tools: {
[CREATE_METRICS_TOOL_NAME]: createMetrics,

View File

@ -135,8 +135,8 @@ export function createThinkAndPrepAgent(thinkAndPrepAgentSchema: ThinkAndPrepAge
streamText({
model: Sonnet4,
headers: {
'anthropic-beta':
'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
'anthropic-beta':'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
'anthropic_beta': 'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
},
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
tools: {

View File

@ -89,8 +89,10 @@ async function generateTodosWithLLM(
const { object, textStream } = streamObject({
headers: {
'anthropic-beta':
'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
'anthropic-beta':
'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
anthropic_beta:
'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
},
model: Sonnet4,
schema: llmOutputSchema,

View File

@ -47,6 +47,7 @@ async function generateTitleWithLLM(messages: ModelMessage[]): Promise<string> {
headers: {
'anthropic-beta':
'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
anthropic_beta: 'fine-grained-tool-streaming-2025-05-14,extended-cache-ttl-2025-04-11',
},
schema: llmOutputSchema,
messages: titleMessages,

View File

@ -13,7 +13,7 @@ import type { SequentialThinkingState } from '../sequential-thinking-tool';
export function createSequentialThinkingReasoningMessage(
sequentialThinkingState: SequentialThinkingState,
toolCallId?: string,
status: ChatMessageReasoning_status = 'loading'
overrideStatus?: ChatMessageReasoning_status
): ChatMessageReasoningMessage_Text | null {
// Use entry_id from state or fallback to provided toolCallId
const id = sequentialThinkingState.toolCallId || toolCallId;
@ -22,6 +22,9 @@ export function createSequentialThinkingReasoningMessage(
return null;
}
// Determine status based on state.isComplete or override
const status = overrideStatus ?? (sequentialThinkingState.isComplete ? 'completed' : 'loading');
// Determine title based on status
const title = status === 'completed' ? 'Thought for a few seconds' : 'Thinking it through...';

View File

@ -31,6 +31,11 @@ export function createSequentialThinkingDelta(
return async function sequentialThinkingDelta(
options: { inputTextDelta: string } & ToolCallOptions
): Promise<void> {
// Skip delta updates if already complete
if (sequentialThinkingState.isComplete) {
return;
}
// Accumulate the delta to the args
sequentialThinkingState.args = (sequentialThinkingState.args || '') + options.inputTextDelta;

View File

@ -30,11 +30,7 @@ async function processSequentialThinking(
};
if (state.toolCallId) {
const reasoningEntry = createSequentialThinkingReasoningMessage(
state,
state.toolCallId,
'completed'
);
const reasoningEntry = createSequentialThinkingReasoningMessage(state, state.toolCallId);
const rawLlmMessage = createSequentialThinkingRawLlmMessageEntry(state, state.toolCallId);
const rawToolResultEntry = createRawToolResultEntry(

View File

@ -20,13 +20,12 @@ export function createSequentialThinkingFinish(
sequentialThinkingState.thought = normalizeEscapedText(options.input.thought);
sequentialThinkingState.nextThoughtNeeded = options.input.nextThoughtNeeded;
sequentialThinkingState.thoughtNumber = options.input.thoughtNumber;
sequentialThinkingState.isComplete = true;
// Update the reasoning message with completed status in finish
// The execute function will also update, but we need to ensure the completed status is set
// Update the reasoning message - status will be determined by state.isComplete
const reasoningEntry = createSequentialThinkingReasoningMessage(
sequentialThinkingState,
options.toolCallId,
'completed' // Mark as completed when finish is called
options.toolCallId
);
try {

View File

@ -19,6 +19,7 @@ export function createSequentialThinkingStart(
sequentialThinkingState.thought = undefined;
sequentialThinkingState.nextThoughtNeeded = undefined;
sequentialThinkingState.thoughtNumber = undefined;
sequentialThinkingState.isComplete = false;
// Create initial reasoning entry with loading status
const reasoningEntry = createSequentialThinkingReasoningMessage(

View File

@ -53,6 +53,7 @@ const SequentialThinkingStateSchema = z.object({
'Current number in sequence. This is optional and will be set by the tool delta and finish'
),
startTime: z.number().optional().describe('The start time of the thinking process'),
isComplete: z.boolean().optional().describe('Whether the thinking process is complete'),
});
export type SequentialThinkingInput = z.infer<typeof SequentialThinkingInputSchema>;
@ -68,6 +69,7 @@ export function createSequentialThinkingTool(context: SequentialThinkingContext)
nextThoughtNeeded: undefined,
thoughtNumber: undefined,
startTime: undefined,
isComplete: undefined,
};
const execute = createSequentialThinkingExecute(state, context);

View File

@ -26,6 +26,40 @@ COPY public.organizations (id, name, domain, created_at, updated_at, deleted_at,
bf58d19a-8bb9-4f1d-a257-2d2105e7f1ce Buster buster.so 2024-11-05 15:41:13.864677+00 2024-11-05 15:41:13.8647+00 \N f
\.
select vault.create_secret('{"type":"postgres","host":"aws-0-us-east-1.pooler.supabase.com","port":5432,"username":"postgres.fjbidcbjvmpesoonimhl","password":"S8Jrts05EqxsfA3q","database":"postgres","schema":"sem","jump_host":null,"ssh_username":null,"ssh_private_key":null}', 'cc3ef3bc-44ec-4a43-8dc4-681cae5c996a');
--
-- Data for Name: users; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', 'c2dd64cd-f7f3-4884-bc91-d46ae431901e', 'authenticated', 'authenticated', 'chad@buster.so', '$2a$06$BKy/23Yp58fItuTD0aKWluB2ayXyww8AeXNQ0KHgh9TeRxJ/tbmaC', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', '1fe85021-e799-471b-8837-953e9ae06e4c', 'authenticated', 'authenticated', 'blake@buster.so', '$2a$06$TGfhnVxsa/Iy/rHmPnjiTuCMkui64yaAOEJl3qqaplGDrbUioCfPS', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', '6840fa04-c0d7-4e0e-8d3d-ea9190d93874', 'authenticated', 'authenticated', 'nate@buster.so', '$2a$06$Qy7COradxcriaW2vMkfFce1GNSvt3NVq/7LI0bPid.rk.gMZ20Thi', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', 'aa0a1367-3a10-4fe5-9244-2db46c000d64', 'authenticated', 'authenticated', 'dallin@buster.so', '$2a$06$jRwWRve7D0lnGhhjJ.r0uOpNlmP32LgNmWJmK5WjrjH0ys8HDHWEC', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', '8e98a1fc-c4d5-401c-98d8-2cce60e11079', 'authenticated', 'authenticated', 'sales@buster.so', '$2a$06$S6iCGkSXOfl13SeSR1xjPemM7xB41aR.W6N0H3/kEPtYXM./PXpAC', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', '70d05d4e-b2c1-40c5-be69-315e420fd0ab', 'authenticated', 'authenticated', 'noaccess@buster.so', '$2a$06$vJM/Dbp2AC/TXBCZiv8liu7JgC.1FxOlvV7kCOPVLjRm/RbtBDFje', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
--
-- Data for Name: identities; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
INSERT INTO auth.identities VALUES ('c2dd64cd-f7f3-4884-bc91-d46ae431901e', 'c2dd64cd-f7f3-4884-bc91-d46ae431901e', '{"sub": "c2dd64cd-f7f3-4884-bc91-d46ae431901e"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, 'c2dd64cd-f7f3-4884-bc91-d46ae431901e');
INSERT INTO auth.identities VALUES ('1fe85021-e799-471b-8837-953e9ae06e4c', '1fe85021-e799-471b-8837-953e9ae06e4c', '{"sub": "1fe85021-e799-471b-8837-953e9ae06e4c"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, '1fe85021-e799-471b-8837-953e9ae06e4c');
INSERT INTO auth.identities VALUES ('6840fa04-c0d7-4e0e-8d3d-ea9190d93874', '6840fa04-c0d7-4e0e-8d3d-ea9190d93874', '{"sub": "6840fa04-c0d7-4e0e-8d3d-ea9190d93874"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, '6840fa04-c0d7-4e0e-8d3d-ea9190d93874');
INSERT INTO auth.identities VALUES ('aa0a1367-3a10-4fe5-9244-2db46c000d64', 'aa0a1367-3a10-4fe5-9244-2db46c000d64', '{"sub": "aa0a1367-3a10-4fe5-9244-2db46c000d64"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, 'aa0a1367-3a10-4fe5-9244-2db46c000d64');
INSERT INTO auth.identities VALUES ('8e98a1fc-c4d5-401c-98d8-2cce60e11079', '8e98a1fc-c4d5-401c-98d8-2cce60e11079', '{"sub": "8e98a1fc-c4d5-401c-98d8-2cce60e11079"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, '8e98a1fc-c4d5-401c-98d8-2cce60e11079');
INSERT INTO auth.identities VALUES ('70d05d4e-b2c1-40c5-be69-315e420fd0ab', '70d05d4e-b2c1-40c5-be69-315e420fd0ab', '{"sub": "70d05d4e-b2c1-40c5-be69-315e420fd0ab"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, '70d05d4e-b2c1-40c5-be69-315e420fd0ab');
-- Update user names in public.users
UPDATE public.users SET name = 'chad' WHERE id = 'c2dd64cd-f7f3-4884-bc91-d46ae431901e';
UPDATE public.users SET name = 'blake' WHERE id = '1fe85021-e799-471b-8837-953e9ae06e4c';
UPDATE public.users SET name = 'nate' WHERE id = '6840fa04-c0d7-4e0e-8d3d-ea9190d93874';
UPDATE public.users SET name = 'dallin' WHERE id = 'aa0a1367-3a10-4fe5-9244-2db46c000d64';
UPDATE public.users SET name = 'sales' WHERE id = '8e98a1fc-c4d5-401c-98d8-2cce60e11079';
UPDATE public.users SET name = 'no access' WHERE id = '70d05d4e-b2c1-40c5-be69-315e420fd0ab';
--
-- Data for Name: api_keys; Type: TABLE DATA; Schema: public; Owner: -
--

View File

@ -1,33 +0,0 @@
select vault.create_secret('{"type":"postgres","host":"aws-0-us-east-1.pooler.supabase.com","port":5432,"username":"postgres.fjbidcbjvmpesoonimhl","password":"S8Jrts05EqxsfA3q","database":"postgres","schema":"sem","jump_host":null,"ssh_username":null,"ssh_private_key":null}', 'cc3ef3bc-44ec-4a43-8dc4-681cae5c996a');
--
-- Data for Name: users; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', 'c2dd64cd-f7f3-4884-bc91-d46ae431901e', 'authenticated', 'authenticated', 'chad@buster.so', '$2a$06$BKy/23Yp58fItuTD0aKWluB2ayXyww8AeXNQ0KHgh9TeRxJ/tbmaC', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', '1fe85021-e799-471b-8837-953e9ae06e4c', 'authenticated', 'authenticated', 'blake@buster.so', '$2a$06$TGfhnVxsa/Iy/rHmPnjiTuCMkui64yaAOEJl3qqaplGDrbUioCfPS', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', '6840fa04-c0d7-4e0e-8d3d-ea9190d93874', 'authenticated', 'authenticated', 'nate@buster.so', '$2a$06$Qy7COradxcriaW2vMkfFce1GNSvt3NVq/7LI0bPid.rk.gMZ20Thi', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', 'aa0a1367-3a10-4fe5-9244-2db46c000d64', 'authenticated', 'authenticated', 'dallin@buster.so', '$2a$06$jRwWRve7D0lnGhhjJ.r0uOpNlmP32LgNmWJmK5WjrjH0ys8HDHWEC', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', '8e98a1fc-c4d5-401c-98d8-2cce60e11079', 'authenticated', 'authenticated', 'sales@buster.so', '$2a$06$S6iCGkSXOfl13SeSR1xjPemM7xB41aR.W6N0H3/kEPtYXM./PXpAC', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
INSERT INTO auth.users VALUES ('00000000-0000-0000-0000-000000000000', '70d05d4e-b2c1-40c5-be69-315e420fd0ab', 'authenticated', 'authenticated', 'noaccess@buster.so', '$2a$06$vJM/Dbp2AC/TXBCZiv8liu7JgC.1FxOlvV7kCOPVLjRm/RbtBDFje', '2025-03-04 18:42:05.801697+00', NULL, '', NULL, '', NULL, '', '', NULL, NULL, '{"provider": "email", "providers": ["email"]}', '{}', NULL, '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', NULL, NULL, '', '', NULL, DEFAULT, '', 0, NULL, '', NULL, false, NULL, false);
--
-- Data for Name: identities; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
INSERT INTO auth.identities VALUES ('c2dd64cd-f7f3-4884-bc91-d46ae431901e', 'c2dd64cd-f7f3-4884-bc91-d46ae431901e', '{"sub": "c2dd64cd-f7f3-4884-bc91-d46ae431901e"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, 'c2dd64cd-f7f3-4884-bc91-d46ae431901e');
INSERT INTO auth.identities VALUES ('1fe85021-e799-471b-8837-953e9ae06e4c', '1fe85021-e799-471b-8837-953e9ae06e4c', '{"sub": "1fe85021-e799-471b-8837-953e9ae06e4c"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, '1fe85021-e799-471b-8837-953e9ae06e4c');
INSERT INTO auth.identities VALUES ('6840fa04-c0d7-4e0e-8d3d-ea9190d93874', '6840fa04-c0d7-4e0e-8d3d-ea9190d93874', '{"sub": "6840fa04-c0d7-4e0e-8d3d-ea9190d93874"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, '6840fa04-c0d7-4e0e-8d3d-ea9190d93874');
INSERT INTO auth.identities VALUES ('aa0a1367-3a10-4fe5-9244-2db46c000d64', 'aa0a1367-3a10-4fe5-9244-2db46c000d64', '{"sub": "aa0a1367-3a10-4fe5-9244-2db46c000d64"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, 'aa0a1367-3a10-4fe5-9244-2db46c000d64');
INSERT INTO auth.identities VALUES ('8e98a1fc-c4d5-401c-98d8-2cce60e11079', '8e98a1fc-c4d5-401c-98d8-2cce60e11079', '{"sub": "8e98a1fc-c4d5-401c-98d8-2cce60e11079"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, '8e98a1fc-c4d5-401c-98d8-2cce60e11079');
INSERT INTO auth.identities VALUES ('70d05d4e-b2c1-40c5-be69-315e420fd0ab', '70d05d4e-b2c1-40c5-be69-315e420fd0ab', '{"sub": "70d05d4e-b2c1-40c5-be69-315e420fd0ab"}', 'email', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', '2025-03-04 18:42:05.801697+00', DEFAULT, '70d05d4e-b2c1-40c5-be69-315e420fd0ab');
-- Update user names in public.users
UPDATE public.users SET name = 'chad' WHERE id = 'c2dd64cd-f7f3-4884-bc91-d46ae431901e';
UPDATE public.users SET name = 'blake' WHERE id = '1fe85021-e799-471b-8837-953e9ae06e4c';
UPDATE public.users SET name = 'nate' WHERE id = '6840fa04-c0d7-4e0e-8d3d-ea9190d93874';
UPDATE public.users SET name = 'dallin' WHERE id = 'aa0a1367-3a10-4fe5-9244-2db46c000d64';
UPDATE public.users SET name = 'sales' WHERE id = '8e98a1fc-c4d5-401c-98d8-2cce60e11079';
UPDATE public.users SET name = 'no access' WHERE id = '70d05d4e-b2c1-40c5-be69-315e420fd0ab';