This commit is contained in:
Aadesh Kheria 2026-04-20 14:27:40 -07:00
parent 4965534c3d
commit 9ba7b5ee97
38 changed files with 6 additions and 1274 deletions

View File

@ -167,10 +167,10 @@ function logMcpCallAndReview(args: {
modelId: string,
}): void {
const { mcpCallMetadata, conversationId, correlationId, messages, contentBlocks, finalText, stepCount, startedAt, modelId } = args;
const firstUserMessage = messages.find(m => m.role === "user");
const question = typeof firstUserMessage?.content === "string"
? firstUserMessage.content
: JSON.stringify(firstUserMessage?.content ?? "");
const lastUserMessage = messages.findLast(m => m.role === "user");
const question = typeof lastUserMessage?.content === "string"
? lastUserMessage.content
: JSON.stringify(lastUserMessage?.content ?? "");
const innerToolCallsJson = JSON.stringify(contentBlocks.filter(b => b.type === "tool-call"));
const logPromise = logMcpCall({

View File

@ -60,12 +60,8 @@ async function rawCallReducer(token: string, reducer: string, args: unknown[]):
"Authorization": `Bearer ${token}`,
},
body: JSON.stringify(args, (_, v) => {
if (typeof v !== "bigint") return v;
// SpacetimeDB's HTTP API wants u64/i64 as JSON numbers, not strings.
// Convert bigints within JS safe-int range; fall back to string above that.
const MAX = BigInt(Number.MAX_SAFE_INTEGER);
if (v <= MAX && v >= -MAX) return Number(v);
return v.toString();
if (typeof v === "bigint") return Number(v);
return v;
}),
});
if (!res.ok) {

View File

@ -1,19 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
question: __t.string(),
answer: __t.string(),
publish: __t.bool(),
reviewedBy: __t.string(),
};

View File

@ -1,18 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
identity: __t.identity(),
stackUserId: __t.string(),
displayName: __t.string(),
};

View File

@ -1,16 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
};

View File

@ -1,16 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
displayName: __t.string(),
};

View File

@ -1,163 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
// This was generated using spacetimedb cli version 2.1.0 (commit 6981f48b4bc1a71c8dd9bdfe5a2c343f6370243d).
/* eslint-disable */
/* tslint:disable */
import {
DbConnectionBuilder as __DbConnectionBuilder,
DbConnectionImpl as __DbConnectionImpl,
SubscriptionBuilderImpl as __SubscriptionBuilderImpl,
TypeBuilder as __TypeBuilder,
Uuid as __Uuid,
convertToAccessorMap as __convertToAccessorMap,
makeQueryBuilder as __makeQueryBuilder,
procedureSchema as __procedureSchema,
procedures as __procedures,
reducerSchema as __reducerSchema,
reducers as __reducers,
schema as __schema,
t as __t,
table as __table,
type AlgebraicTypeType as __AlgebraicTypeType,
type DbConnectionConfig as __DbConnectionConfig,
type ErrorContextInterface as __ErrorContextInterface,
type Event as __Event,
type EventContextInterface as __EventContextInterface,
type Infer as __Infer,
type QueryBuilder as __QueryBuilder,
type ReducerEventContextInterface as __ReducerEventContextInterface,
type RemoteModule as __RemoteModule,
type SubscriptionEventContextInterface as __SubscriptionEventContextInterface,
type SubscriptionHandleImpl as __SubscriptionHandleImpl,
} from "spacetimedb";
// Import all reducer arg schemas
import AddManualQaReducer from "./add_manual_qa_reducer";
import AddOperatorReducer from "./add_operator_reducer";
import DeleteQaEntryReducer from "./delete_qa_entry_reducer";
import EnrollServiceReducer from "./enroll_service_reducer";
import LogAiQueryReducer from "./log_ai_query_reducer";
import LogMcpCallReducer from "./log_mcp_call_reducer";
import MarkHumanReviewedReducer from "./mark_human_reviewed_reducer";
import RemoveOperatorReducer from "./remove_operator_reducer";
import UnmarkHumanReviewedReducer from "./unmark_human_reviewed_reducer";
import UpdateHumanCorrectionReducer from "./update_human_correction_reducer";
import UpdateMcpQaReviewReducer from "./update_mcp_qa_review_reducer";
// Import all procedure arg schemas
// Import all table schema definitions
import MyVisibleAiQueryLogRow from "./my_visible_ai_query_log_table";
import MyVisibleMcpCallLogRow from "./my_visible_mcp_call_log_table";
import OperatorsRow from "./operators_table";
import PublishedQaRow from "./published_qa_table";
/** Type-only namespace exports for generated type groups. */
/** The schema information for all tables in this module. This is defined the same was as the tables would have been defined in the server. */
const tablesSchema = __schema({
operators: __table({
name: 'operators',
indexes: [
{ accessor: 'identity', name: 'operators_identity_idx_btree', algorithm: 'btree', columns: [
'identity',
] },
],
constraints: [
{ name: 'operators_identity_key', constraint: 'unique', columns: ['identity'] },
],
}, OperatorsRow),
myVisibleAiQueryLog: __table({
name: 'my_visible_ai_query_log',
indexes: [
],
constraints: [
],
}, MyVisibleAiQueryLogRow),
myVisibleMcpCallLog: __table({
name: 'my_visible_mcp_call_log',
indexes: [
],
constraints: [
],
}, MyVisibleMcpCallLogRow),
publishedQa: __table({
name: 'published_qa',
indexes: [
],
constraints: [
],
}, PublishedQaRow),
});
/** The schema information for all reducers in this module. This is defined the same way as the reducers would have been defined in the server, except the body of the reducer is omitted in code generation. */
const reducersSchema = __reducers(
__reducerSchema("add_manual_qa", AddManualQaReducer),
__reducerSchema("add_operator", AddOperatorReducer),
__reducerSchema("delete_qa_entry", DeleteQaEntryReducer),
__reducerSchema("enroll_service", EnrollServiceReducer),
__reducerSchema("log_ai_query", LogAiQueryReducer),
__reducerSchema("log_mcp_call", LogMcpCallReducer),
__reducerSchema("mark_human_reviewed", MarkHumanReviewedReducer),
__reducerSchema("remove_operator", RemoveOperatorReducer),
__reducerSchema("unmark_human_reviewed", UnmarkHumanReviewedReducer),
__reducerSchema("update_human_correction", UpdateHumanCorrectionReducer),
__reducerSchema("update_mcp_qa_review", UpdateMcpQaReviewReducer),
);
/** The schema information for all procedures in this module. This is defined the same way as the procedures would have been defined in the server. */
const proceduresSchema = __procedures(
);
/** The remote SpacetimeDB module schema, both runtime and type information. */
const REMOTE_MODULE = {
versionInfo: {
cliVersion: "2.1.0" as const,
},
tables: tablesSchema.schemaType.tables,
reducers: reducersSchema.reducersType.reducers,
...proceduresSchema,
} satisfies __RemoteModule<
typeof tablesSchema.schemaType,
typeof reducersSchema.reducersType,
typeof proceduresSchema
>;
/** The tables available in this remote SpacetimeDB module. Each table reference doubles as a query builder. */
export const tables: __QueryBuilder<typeof tablesSchema.schemaType> = __makeQueryBuilder(tablesSchema.schemaType);
/** The reducers available in this remote SpacetimeDB module. */
export const reducers = __convertToAccessorMap(reducersSchema.reducersType.reducers);
/** The context type returned in callbacks for all possible events. */
export type EventContext = __EventContextInterface<typeof REMOTE_MODULE>;
/** The context type returned in callbacks for reducer events. */
export type ReducerEventContext = __ReducerEventContextInterface<typeof REMOTE_MODULE>;
/** The context type returned in callbacks for subscription events. */
export type SubscriptionEventContext = __SubscriptionEventContextInterface<typeof REMOTE_MODULE>;
/** The context type returned in callbacks for error events. */
export type ErrorContext = __ErrorContextInterface<typeof REMOTE_MODULE>;
/** The subscription handle type to manage active subscriptions created from a {@link SubscriptionBuilder}. */
export type SubscriptionHandle = __SubscriptionHandleImpl<typeof REMOTE_MODULE>;
/** Builder class to configure a new subscription to the remote SpacetimeDB instance. */
export class SubscriptionBuilder extends __SubscriptionBuilderImpl<typeof REMOTE_MODULE> {}
/** Builder class to configure a new database connection to the remote SpacetimeDB instance. */
export class DbConnectionBuilder extends __DbConnectionBuilder<DbConnection> {}
/** The typed database connection to manage connections to the remote SpacetimeDB instance. This class has type information specific to the generated module. */
export class DbConnection extends __DbConnectionImpl<typeof REMOTE_MODULE> {
/** Creates a new {@link DbConnectionBuilder} to configure and connect to the remote SpacetimeDB instance. */
static builder = (): DbConnectionBuilder => {
return new DbConnectionBuilder(REMOTE_MODULE, (config: __DbConnectionConfig<typeof REMOTE_MODULE>) => new DbConnection(config));
};
/** Creates a new {@link SubscriptionBuilder} to configure a subscription to the remote SpacetimeDB instance. */
override subscriptionBuilder = (): SubscriptionBuilder => {
return new SubscriptionBuilder(this);
};
}

View File

@ -1,37 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
mode: __t.string(),
systemPromptId: __t.string(),
quality: __t.string(),
speed: __t.string(),
modelId: __t.string(),
isAuthenticated: __t.bool(),
projectId: __t.option(__t.string()),
userId: __t.option(__t.string()),
requestedToolsJson: __t.string(),
messagesJson: __t.string(),
stepsJson: __t.string(),
finalText: __t.string(),
inputTokens: __t.option(__t.u32()),
outputTokens: __t.option(__t.u32()),
cachedInputTokens: __t.option(__t.u32()),
costUsd: __t.option(__t.f64()),
stepCount: __t.u32(),
durationMs: __t.u64(),
errorMessage: __t.option(__t.string()),
mcpCorrelationId: __t.option(__t.string()),
conversationId: __t.option(__t.string()),
};

View File

@ -1,27 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
conversationId: __t.option(__t.string()),
toolName: __t.string(),
reason: __t.string(),
userPrompt: __t.string(),
question: __t.string(),
response: __t.string(),
stepCount: __t.u32(),
innerToolCallsJson: __t.string(),
durationMs: __t.u64(),
modelId: __t.string(),
errorMessage: __t.option(__t.string()),
};

View File

@ -1,17 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
reviewedBy: __t.string(),
};

View File

@ -1,39 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default __t.row({
id: __t.u64(),
shard: __t.u8(),
correlationId: __t.string().name("correlation_id"),
createdAt: __t.timestamp().name("created_at"),
mode: __t.string(),
systemPromptId: __t.string().name("system_prompt_id"),
quality: __t.string(),
speed: __t.string(),
modelId: __t.string().name("model_id"),
isAuthenticated: __t.bool().name("is_authenticated"),
projectId: __t.option(__t.string()).name("project_id"),
userId: __t.option(__t.string()).name("user_id"),
requestedToolsJson: __t.string().name("requested_tools_json"),
messagesJson: __t.string().name("messages_json"),
stepsJson: __t.string().name("steps_json"),
finalText: __t.string().name("final_text"),
inputTokens: __t.option(__t.u32()).name("input_tokens"),
outputTokens: __t.option(__t.u32()).name("output_tokens"),
cachedInputTokens: __t.option(__t.u32()).name("cached_input_tokens"),
costUsd: __t.option(__t.f64()).name("cost_usd"),
stepCount: __t.u32().name("step_count"),
durationMs: __t.u64().name("duration_ms"),
errorMessage: __t.option(__t.string()).name("error_message"),
mcpCorrelationId: __t.option(__t.string()).name("mcp_correlation_id"),
conversationId: __t.option(__t.string()).name("conversation_id"),
});

View File

@ -1,45 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default __t.row({
id: __t.u64(),
shard: __t.u8(),
correlationId: __t.string().name("correlation_id"),
conversationId: __t.option(__t.string()).name("conversation_id"),
createdAt: __t.timestamp().name("created_at"),
toolName: __t.string().name("tool_name"),
reason: __t.string(),
userPrompt: __t.string().name("user_prompt"),
question: __t.string(),
response: __t.string(),
stepCount: __t.u32().name("step_count"),
innerToolCallsJson: __t.string().name("inner_tool_calls_json"),
durationMs: __t.u64().name("duration_ms"),
modelId: __t.string().name("model_id"),
errorMessage: __t.option(__t.string()).name("error_message"),
qaReviewedAt: __t.option(__t.timestamp()).name("qa_reviewed_at"),
qaNeedsHumanReview: __t.option(__t.bool()).name("qa_needs_human_review"),
qaAnswerCorrect: __t.option(__t.bool()).name("qa_answer_correct"),
qaAnswerRelevant: __t.option(__t.bool()).name("qa_answer_relevant"),
qaFlagsJson: __t.option(__t.string()).name("qa_flags_json"),
qaImprovementSuggestions: __t.option(__t.string()).name("qa_improvement_suggestions"),
qaOverallScore: __t.option(__t.u32()).name("qa_overall_score"),
qaReviewModelId: __t.option(__t.string()).name("qa_review_model_id"),
qaConversationJson: __t.option(__t.string()).name("qa_conversation_json"),
qaErrorMessage: __t.option(__t.string()).name("qa_error_message"),
humanReviewedAt: __t.option(__t.timestamp()).name("human_reviewed_at"),
humanReviewedBy: __t.option(__t.string()).name("human_reviewed_by"),
humanCorrectedQuestion: __t.option(__t.string()).name("human_corrected_question"),
humanCorrectedAnswer: __t.option(__t.string()).name("human_corrected_answer"),
publishedToQa: __t.bool().name("published_to_qa"),
publishedAt: __t.option(__t.timestamp()).name("published_at"),
});

View File

@ -1,18 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default __t.row({
identity: __t.identity().primaryKey(),
addedAt: __t.timestamp().name("added_at"),
stackUserId: __t.string().name("stack_user_id"),
displayName: __t.string().name("display_name"),
});

View File

@ -1,45 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default __t.row({
id: __t.u64(),
shard: __t.u8(),
correlationId: __t.string().name("correlation_id"),
conversationId: __t.option(__t.string()).name("conversation_id"),
createdAt: __t.timestamp().name("created_at"),
toolName: __t.string().name("tool_name"),
reason: __t.string(),
userPrompt: __t.string().name("user_prompt"),
question: __t.string(),
response: __t.string(),
stepCount: __t.u32().name("step_count"),
innerToolCallsJson: __t.string().name("inner_tool_calls_json"),
durationMs: __t.u64().name("duration_ms"),
modelId: __t.string().name("model_id"),
errorMessage: __t.option(__t.string()).name("error_message"),
qaReviewedAt: __t.option(__t.timestamp()).name("qa_reviewed_at"),
qaNeedsHumanReview: __t.option(__t.bool()).name("qa_needs_human_review"),
qaAnswerCorrect: __t.option(__t.bool()).name("qa_answer_correct"),
qaAnswerRelevant: __t.option(__t.bool()).name("qa_answer_relevant"),
qaFlagsJson: __t.option(__t.string()).name("qa_flags_json"),
qaImprovementSuggestions: __t.option(__t.string()).name("qa_improvement_suggestions"),
qaOverallScore: __t.option(__t.u32()).name("qa_overall_score"),
qaReviewModelId: __t.option(__t.string()).name("qa_review_model_id"),
qaConversationJson: __t.option(__t.string()).name("qa_conversation_json"),
qaErrorMessage: __t.option(__t.string()).name("qa_error_message"),
humanReviewedAt: __t.option(__t.timestamp()).name("human_reviewed_at"),
humanReviewedBy: __t.option(__t.string()).name("human_reviewed_by"),
humanCorrectedQuestion: __t.option(__t.string()).name("human_corrected_question"),
humanCorrectedAnswer: __t.option(__t.string()).name("human_corrected_answer"),
publishedToQa: __t.bool().name("published_to_qa"),
publishedAt: __t.option(__t.timestamp()).name("published_at"),
});

View File

@ -1,16 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
identity: __t.identity(),
};

View File

@ -1,93 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export const AiQueryLog = __t.object("AiQueryLog", {
id: __t.u64(),
shard: __t.u8(),
correlationId: __t.string(),
createdAt: __t.timestamp(),
mode: __t.string(),
systemPromptId: __t.string(),
quality: __t.string(),
speed: __t.string(),
modelId: __t.string(),
isAuthenticated: __t.bool(),
projectId: __t.option(__t.string()),
userId: __t.option(__t.string()),
requestedToolsJson: __t.string(),
messagesJson: __t.string(),
stepsJson: __t.string(),
finalText: __t.string(),
inputTokens: __t.option(__t.u32()),
outputTokens: __t.option(__t.u32()),
cachedInputTokens: __t.option(__t.u32()),
costUsd: __t.option(__t.f64()),
stepCount: __t.u32(),
durationMs: __t.u64(),
errorMessage: __t.option(__t.string()),
mcpCorrelationId: __t.option(__t.string()),
conversationId: __t.option(__t.string()),
});
export type AiQueryLog = __Infer<typeof AiQueryLog>;
export const McpCallLog = __t.object("McpCallLog", {
id: __t.u64(),
shard: __t.u8(),
correlationId: __t.string(),
conversationId: __t.option(__t.string()),
createdAt: __t.timestamp(),
toolName: __t.string(),
reason: __t.string(),
userPrompt: __t.string(),
question: __t.string(),
response: __t.string(),
stepCount: __t.u32(),
innerToolCallsJson: __t.string(),
durationMs: __t.u64(),
modelId: __t.string(),
errorMessage: __t.option(__t.string()),
qaReviewedAt: __t.option(__t.timestamp()),
qaNeedsHumanReview: __t.option(__t.bool()),
qaAnswerCorrect: __t.option(__t.bool()),
qaAnswerRelevant: __t.option(__t.bool()),
qaFlagsJson: __t.option(__t.string()),
qaImprovementSuggestions: __t.option(__t.string()),
qaOverallScore: __t.option(__t.u32()),
qaReviewModelId: __t.option(__t.string()),
qaConversationJson: __t.option(__t.string()),
qaErrorMessage: __t.option(__t.string()),
humanReviewedAt: __t.option(__t.timestamp()),
humanReviewedBy: __t.option(__t.string()),
humanCorrectedQuestion: __t.option(__t.string()),
humanCorrectedAnswer: __t.option(__t.string()),
publishedToQa: __t.bool(),
publishedAt: __t.option(__t.timestamp()),
});
export type McpCallLog = __Infer<typeof McpCallLog>;
export const MyVisibleAiQueryLog = __t.object("MyVisibleAiQueryLog", {});
export type MyVisibleAiQueryLog = __Infer<typeof MyVisibleAiQueryLog>;
export const MyVisibleMcpCallLog = __t.object("MyVisibleMcpCallLog", {});
export type MyVisibleMcpCallLog = __Infer<typeof MyVisibleMcpCallLog>;
export const Operators = __t.object("Operators", {
identity: __t.identity(),
addedAt: __t.timestamp(),
stackUserId: __t.string(),
displayName: __t.string(),
});
export type Operators = __Infer<typeof Operators>;
export const PublishedQa = __t.object("PublishedQa", {});
export type PublishedQa = __Infer<typeof PublishedQa>;

View File

@ -1,10 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import { type Infer as __Infer } from "spacetimedb";
// Import all procedure arg schemas

View File

@ -1,32 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import { type Infer as __Infer } from "spacetimedb";
// Import all reducer arg schemas
import AddManualQaReducer from "../add_manual_qa_reducer";
import AddOperatorReducer from "../add_operator_reducer";
import DeleteQaEntryReducer from "../delete_qa_entry_reducer";
import EnrollServiceReducer from "../enroll_service_reducer";
import LogAiQueryReducer from "../log_ai_query_reducer";
import LogMcpCallReducer from "../log_mcp_call_reducer";
import MarkHumanReviewedReducer from "../mark_human_reviewed_reducer";
import RemoveOperatorReducer from "../remove_operator_reducer";
import UnmarkHumanReviewedReducer from "../unmark_human_reviewed_reducer";
import UpdateHumanCorrectionReducer from "../update_human_correction_reducer";
import UpdateMcpQaReviewReducer from "../update_mcp_qa_review_reducer";
export type AddManualQaParams = __Infer<typeof AddManualQaReducer>;
export type AddOperatorParams = __Infer<typeof AddOperatorReducer>;
export type DeleteQaEntryParams = __Infer<typeof DeleteQaEntryReducer>;
export type EnrollServiceParams = __Infer<typeof EnrollServiceReducer>;
export type LogAiQueryParams = __Infer<typeof LogAiQueryReducer>;
export type LogMcpCallParams = __Infer<typeof LogMcpCallReducer>;
export type MarkHumanReviewedParams = __Infer<typeof MarkHumanReviewedReducer>;
export type RemoveOperatorParams = __Infer<typeof RemoveOperatorReducer>;
export type UnmarkHumanReviewedParams = __Infer<typeof UnmarkHumanReviewedReducer>;
export type UpdateHumanCorrectionParams = __Infer<typeof UpdateHumanCorrectionReducer>;
export type UpdateMcpQaReviewParams = __Infer<typeof UpdateMcpQaReviewReducer>;

View File

@ -1,16 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
};

View File

@ -1,20 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
correctedQuestion: __t.string(),
correctedAnswer: __t.string(),
publish: __t.bool(),
reviewedBy: __t.string(),
};

View File

@ -1,25 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
qaNeedsHumanReview: __t.bool(),
qaAnswerCorrect: __t.bool(),
qaAnswerRelevant: __t.bool(),
qaFlagsJson: __t.string(),
qaImprovementSuggestions: __t.string(),
qaOverallScore: __t.u32(),
qaReviewModelId: __t.string(),
qaConversationJson: __t.option(__t.string()),
qaErrorMessage: __t.option(__t.string()),
};

View File

@ -1,19 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
question: __t.string(),
answer: __t.string(),
publish: __t.bool(),
reviewedBy: __t.string(),
};

View File

@ -1,18 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
identity: __t.identity(),
stackUserId: __t.string(),
displayName: __t.string(),
};

View File

@ -1,16 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
};

View File

@ -1,16 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
displayName: __t.string(),
};

View File

@ -1,153 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
// This was generated using spacetimedb cli version 2.1.0 (commit 6981f48b4bc1a71c8dd9bdfe5a2c343f6370243d).
/* eslint-disable */
/* tslint:disable */
import {
DbConnectionBuilder as __DbConnectionBuilder,
DbConnectionImpl as __DbConnectionImpl,
SubscriptionBuilderImpl as __SubscriptionBuilderImpl,
TypeBuilder as __TypeBuilder,
Uuid as __Uuid,
convertToAccessorMap as __convertToAccessorMap,
makeQueryBuilder as __makeQueryBuilder,
procedureSchema as __procedureSchema,
procedures as __procedures,
reducerSchema as __reducerSchema,
reducers as __reducers,
schema as __schema,
t as __t,
table as __table,
type AlgebraicTypeType as __AlgebraicTypeType,
type DbConnectionConfig as __DbConnectionConfig,
type ErrorContextInterface as __ErrorContextInterface,
type Event as __Event,
type EventContextInterface as __EventContextInterface,
type Infer as __Infer,
type QueryBuilder as __QueryBuilder,
type ReducerEventContextInterface as __ReducerEventContextInterface,
type RemoteModule as __RemoteModule,
type SubscriptionEventContextInterface as __SubscriptionEventContextInterface,
type SubscriptionHandleImpl as __SubscriptionHandleImpl,
} from "spacetimedb";
// Import all reducer arg schemas
import AddManualQaReducer from "./add_manual_qa_reducer";
import AddOperatorReducer from "./add_operator_reducer";
import DeleteQaEntryReducer from "./delete_qa_entry_reducer";
import EnrollServiceReducer from "./enroll_service_reducer";
import LogAiQueryReducer from "./log_ai_query_reducer";
import LogMcpCallReducer from "./log_mcp_call_reducer";
import MarkHumanReviewedReducer from "./mark_human_reviewed_reducer";
import RemoveOperatorReducer from "./remove_operator_reducer";
import UpdateHumanCorrectionReducer from "./update_human_correction_reducer";
import UpdateMcpQaReviewReducer from "./update_mcp_qa_review_reducer";
// Import all procedure arg schemas
// Import all table schema definitions
import MyVisibleAiQueryLogRow from "./my_visible_ai_query_log_table";
import MyVisibleMcpCallLogRow from "./my_visible_mcp_call_log_table";
import OperatorsRow from "./operators_table";
/** Type-only namespace exports for generated type groups. */
/** The schema information for all tables in this module. This is defined the same was as the tables would have been defined in the server. */
const tablesSchema = __schema({
operators: __table({
name: 'operators',
indexes: [
{ accessor: 'identity', name: 'operators_identity_idx_btree', algorithm: 'btree', columns: [
'identity',
] },
],
constraints: [
{ name: 'operators_identity_key', constraint: 'unique', columns: ['identity'] },
],
}, OperatorsRow),
myVisibleAiQueryLog: __table({
name: 'my_visible_ai_query_log',
indexes: [
],
constraints: [
],
}, MyVisibleAiQueryLogRow),
myVisibleMcpCallLog: __table({
name: 'my_visible_mcp_call_log',
indexes: [
],
constraints: [
],
}, MyVisibleMcpCallLogRow),
});
/** The schema information for all reducers in this module. This is defined the same way as the reducers would have been defined in the server, except the body of the reducer is omitted in code generation. */
const reducersSchema = __reducers(
__reducerSchema("add_manual_qa", AddManualQaReducer),
__reducerSchema("add_operator", AddOperatorReducer),
__reducerSchema("delete_qa_entry", DeleteQaEntryReducer),
__reducerSchema("enroll_service", EnrollServiceReducer),
__reducerSchema("log_ai_query", LogAiQueryReducer),
__reducerSchema("log_mcp_call", LogMcpCallReducer),
__reducerSchema("mark_human_reviewed", MarkHumanReviewedReducer),
__reducerSchema("remove_operator", RemoveOperatorReducer),
__reducerSchema("update_human_correction", UpdateHumanCorrectionReducer),
__reducerSchema("update_mcp_qa_review", UpdateMcpQaReviewReducer),
);
/** The schema information for all procedures in this module. This is defined the same way as the procedures would have been defined in the server. */
const proceduresSchema = __procedures(
);
/** The remote SpacetimeDB module schema, both runtime and type information. */
const REMOTE_MODULE = {
versionInfo: {
cliVersion: "2.1.0" as const,
},
tables: tablesSchema.schemaType.tables,
reducers: reducersSchema.reducersType.reducers,
...proceduresSchema,
} satisfies __RemoteModule<
typeof tablesSchema.schemaType,
typeof reducersSchema.reducersType,
typeof proceduresSchema
>;
/** The tables available in this remote SpacetimeDB module. Each table reference doubles as a query builder. */
export const tables: __QueryBuilder<typeof tablesSchema.schemaType> = __makeQueryBuilder(tablesSchema.schemaType);
/** The reducers available in this remote SpacetimeDB module. */
export const reducers = __convertToAccessorMap(reducersSchema.reducersType.reducers);
/** The context type returned in callbacks for all possible events. */
export type EventContext = __EventContextInterface<typeof REMOTE_MODULE>;
/** The context type returned in callbacks for reducer events. */
export type ReducerEventContext = __ReducerEventContextInterface<typeof REMOTE_MODULE>;
/** The context type returned in callbacks for subscription events. */
export type SubscriptionEventContext = __SubscriptionEventContextInterface<typeof REMOTE_MODULE>;
/** The context type returned in callbacks for error events. */
export type ErrorContext = __ErrorContextInterface<typeof REMOTE_MODULE>;
/** The subscription handle type to manage active subscriptions created from a {@link SubscriptionBuilder}. */
export type SubscriptionHandle = __SubscriptionHandleImpl<typeof REMOTE_MODULE>;
/** Builder class to configure a new subscription to the remote SpacetimeDB instance. */
export class SubscriptionBuilder extends __SubscriptionBuilderImpl<typeof REMOTE_MODULE> {}
/** Builder class to configure a new database connection to the remote SpacetimeDB instance. */
export class DbConnectionBuilder extends __DbConnectionBuilder<DbConnection> {}
/** The typed database connection to manage connections to the remote SpacetimeDB instance. This class has type information specific to the generated module. */
export class DbConnection extends __DbConnectionImpl<typeof REMOTE_MODULE> {
/** Creates a new {@link DbConnectionBuilder} to configure and connect to the remote SpacetimeDB instance. */
static builder = (): DbConnectionBuilder => {
return new DbConnectionBuilder(REMOTE_MODULE, (config: __DbConnectionConfig<typeof REMOTE_MODULE>) => new DbConnection(config));
};
/** Creates a new {@link SubscriptionBuilder} to configure a subscription to the remote SpacetimeDB instance. */
override subscriptionBuilder = (): SubscriptionBuilder => {
return new SubscriptionBuilder(this);
};
}

View File

@ -1,37 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
mode: __t.string(),
systemPromptId: __t.string(),
quality: __t.string(),
speed: __t.string(),
modelId: __t.string(),
isAuthenticated: __t.bool(),
projectId: __t.option(__t.string()),
userId: __t.option(__t.string()),
requestedToolsJson: __t.string(),
messagesJson: __t.string(),
stepsJson: __t.string(),
finalText: __t.string(),
inputTokens: __t.option(__t.u32()),
outputTokens: __t.option(__t.u32()),
cachedInputTokens: __t.option(__t.u32()),
costUsd: __t.option(__t.f64()),
stepCount: __t.u32(),
durationMs: __t.u64(),
errorMessage: __t.option(__t.string()),
mcpCorrelationId: __t.option(__t.string()),
conversationId: __t.option(__t.string()),
};

View File

@ -1,27 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
conversationId: __t.option(__t.string()),
toolName: __t.string(),
reason: __t.string(),
userPrompt: __t.string(),
question: __t.string(),
response: __t.string(),
stepCount: __t.u32(),
innerToolCallsJson: __t.string(),
durationMs: __t.u64(),
modelId: __t.string(),
errorMessage: __t.option(__t.string()),
};

View File

@ -1,17 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
reviewedBy: __t.string(),
};

View File

@ -1,38 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default __t.row({
id: __t.u64(),
correlationId: __t.string().name("correlation_id"),
createdAt: __t.timestamp().name("created_at"),
mode: __t.string(),
systemPromptId: __t.string().name("system_prompt_id"),
quality: __t.string(),
speed: __t.string(),
modelId: __t.string().name("model_id"),
isAuthenticated: __t.bool().name("is_authenticated"),
projectId: __t.option(__t.string()).name("project_id"),
userId: __t.option(__t.string()).name("user_id"),
requestedToolsJson: __t.string().name("requested_tools_json"),
messagesJson: __t.string().name("messages_json"),
stepsJson: __t.string().name("steps_json"),
finalText: __t.string().name("final_text"),
inputTokens: __t.option(__t.u32()).name("input_tokens"),
outputTokens: __t.option(__t.u32()).name("output_tokens"),
cachedInputTokens: __t.option(__t.u32()).name("cached_input_tokens"),
costUsd: __t.option(__t.f64()).name("cost_usd"),
stepCount: __t.u32().name("step_count"),
durationMs: __t.u64().name("duration_ms"),
errorMessage: __t.option(__t.string()).name("error_message"),
mcpCorrelationId: __t.option(__t.string()).name("mcp_correlation_id"),
conversationId: __t.option(__t.string()).name("conversation_id"),
});

View File

@ -1,44 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default __t.row({
id: __t.u64(),
correlationId: __t.string().name("correlation_id"),
conversationId: __t.option(__t.string()).name("conversation_id"),
createdAt: __t.timestamp().name("created_at"),
toolName: __t.string().name("tool_name"),
reason: __t.string(),
userPrompt: __t.string().name("user_prompt"),
question: __t.string(),
response: __t.string(),
stepCount: __t.u32().name("step_count"),
innerToolCallsJson: __t.string().name("inner_tool_calls_json"),
durationMs: __t.u64().name("duration_ms"),
modelId: __t.string().name("model_id"),
errorMessage: __t.option(__t.string()).name("error_message"),
qaReviewedAt: __t.option(__t.timestamp()).name("qa_reviewed_at"),
qaNeedsHumanReview: __t.option(__t.bool()).name("qa_needs_human_review"),
qaAnswerCorrect: __t.option(__t.bool()).name("qa_answer_correct"),
qaAnswerRelevant: __t.option(__t.bool()).name("qa_answer_relevant"),
qaFlagsJson: __t.option(__t.string()).name("qa_flags_json"),
qaImprovementSuggestions: __t.option(__t.string()).name("qa_improvement_suggestions"),
qaOverallScore: __t.option(__t.u32()).name("qa_overall_score"),
qaReviewModelId: __t.option(__t.string()).name("qa_review_model_id"),
qaConversationJson: __t.option(__t.string()).name("qa_conversation_json"),
qaErrorMessage: __t.option(__t.string()).name("qa_error_message"),
humanReviewedAt: __t.option(__t.timestamp()).name("human_reviewed_at"),
humanReviewedBy: __t.option(__t.string()).name("human_reviewed_by"),
humanCorrectedQuestion: __t.option(__t.string()).name("human_corrected_question"),
humanCorrectedAnswer: __t.option(__t.string()).name("human_corrected_answer"),
publishedToQa: __t.option(__t.bool()).name("published_to_qa"),
publishedAt: __t.option(__t.timestamp()).name("published_at"),
});

View File

@ -1,18 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default __t.row({
identity: __t.identity().primaryKey(),
addedAt: __t.timestamp().name("added_at"),
stackUserId: __t.string().name("stack_user_id"),
displayName: __t.string().name("display_name"),
});

View File

@ -1,16 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
identity: __t.identity(),
};

View File

@ -1,88 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export const AiQueryLog = __t.object("AiQueryLog", {
id: __t.u64(),
correlationId: __t.string(),
createdAt: __t.timestamp(),
mode: __t.string(),
systemPromptId: __t.string(),
quality: __t.string(),
speed: __t.string(),
modelId: __t.string(),
isAuthenticated: __t.bool(),
projectId: __t.option(__t.string()),
userId: __t.option(__t.string()),
requestedToolsJson: __t.string(),
messagesJson: __t.string(),
stepsJson: __t.string(),
finalText: __t.string(),
inputTokens: __t.option(__t.u32()),
outputTokens: __t.option(__t.u32()),
cachedInputTokens: __t.option(__t.u32()),
costUsd: __t.option(__t.f64()),
stepCount: __t.u32(),
durationMs: __t.u64(),
errorMessage: __t.option(__t.string()),
mcpCorrelationId: __t.option(__t.string()),
conversationId: __t.option(__t.string()),
});
export type AiQueryLog = __Infer<typeof AiQueryLog>;
export const McpCallLog = __t.object("McpCallLog", {
id: __t.u64(),
correlationId: __t.string(),
conversationId: __t.option(__t.string()),
createdAt: __t.timestamp(),
toolName: __t.string(),
reason: __t.string(),
userPrompt: __t.string(),
question: __t.string(),
response: __t.string(),
stepCount: __t.u32(),
innerToolCallsJson: __t.string(),
durationMs: __t.u64(),
modelId: __t.string(),
errorMessage: __t.option(__t.string()),
qaReviewedAt: __t.option(__t.timestamp()),
qaNeedsHumanReview: __t.option(__t.bool()),
qaAnswerCorrect: __t.option(__t.bool()),
qaAnswerRelevant: __t.option(__t.bool()),
qaFlagsJson: __t.option(__t.string()),
qaImprovementSuggestions: __t.option(__t.string()),
qaOverallScore: __t.option(__t.u32()),
qaReviewModelId: __t.option(__t.string()),
qaConversationJson: __t.option(__t.string()),
qaErrorMessage: __t.option(__t.string()),
humanReviewedAt: __t.option(__t.timestamp()),
humanReviewedBy: __t.option(__t.string()),
humanCorrectedQuestion: __t.option(__t.string()),
humanCorrectedAnswer: __t.option(__t.string()),
publishedToQa: __t.option(__t.bool()),
publishedAt: __t.option(__t.timestamp()),
});
export type McpCallLog = __Infer<typeof McpCallLog>;
export const MyVisibleAiQueryLog = __t.object("MyVisibleAiQueryLog", {});
export type MyVisibleAiQueryLog = __Infer<typeof MyVisibleAiQueryLog>;
export const MyVisibleMcpCallLog = __t.object("MyVisibleMcpCallLog", {});
export type MyVisibleMcpCallLog = __Infer<typeof MyVisibleMcpCallLog>;
export const Operators = __t.object("Operators", {
identity: __t.identity(),
addedAt: __t.timestamp(),
stackUserId: __t.string(),
displayName: __t.string(),
});
export type Operators = __Infer<typeof Operators>;

View File

@ -1,10 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import { type Infer as __Infer } from "spacetimedb";
// Import all procedure arg schemas

View File

@ -1,30 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import { type Infer as __Infer } from "spacetimedb";
// Import all reducer arg schemas
import AddManualQaReducer from "../add_manual_qa_reducer";
import AddOperatorReducer from "../add_operator_reducer";
import DeleteQaEntryReducer from "../delete_qa_entry_reducer";
import EnrollServiceReducer from "../enroll_service_reducer";
import LogAiQueryReducer from "../log_ai_query_reducer";
import LogMcpCallReducer from "../log_mcp_call_reducer";
import MarkHumanReviewedReducer from "../mark_human_reviewed_reducer";
import RemoveOperatorReducer from "../remove_operator_reducer";
import UpdateHumanCorrectionReducer from "../update_human_correction_reducer";
import UpdateMcpQaReviewReducer from "../update_mcp_qa_review_reducer";
export type AddManualQaParams = __Infer<typeof AddManualQaReducer>;
export type AddOperatorParams = __Infer<typeof AddOperatorReducer>;
export type DeleteQaEntryParams = __Infer<typeof DeleteQaEntryReducer>;
export type EnrollServiceParams = __Infer<typeof EnrollServiceReducer>;
export type LogAiQueryParams = __Infer<typeof LogAiQueryReducer>;
export type LogMcpCallParams = __Infer<typeof LogMcpCallReducer>;
export type MarkHumanReviewedParams = __Infer<typeof MarkHumanReviewedReducer>;
export type RemoveOperatorParams = __Infer<typeof RemoveOperatorReducer>;
export type UpdateHumanCorrectionParams = __Infer<typeof UpdateHumanCorrectionReducer>;
export type UpdateMcpQaReviewParams = __Infer<typeof UpdateMcpQaReviewReducer>;

View File

@ -1,20 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
correctedQuestion: __t.string(),
correctedAnswer: __t.string(),
publish: __t.bool(),
reviewedBy: __t.string(),
};

View File

@ -1,25 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
/* eslint-disable */
/* tslint:disable */
import {
TypeBuilder as __TypeBuilder,
t as __t,
type AlgebraicTypeType as __AlgebraicTypeType,
type Infer as __Infer,
} from "spacetimedb";
export default {
token: __t.string(),
correlationId: __t.string(),
qaNeedsHumanReview: __t.bool(),
qaAnswerCorrect: __t.bool(),
qaAnswerRelevant: __t.bool(),
qaFlagsJson: __t.string(),
qaImprovementSuggestions: __t.string(),
qaOverallScore: __t.u32(),
qaReviewModelId: __t.string(),
qaConversationJson: __t.option(__t.string()),
qaErrorMessage: __t.option(__t.string()),
};