Skip to content

Commit 6a85a53

Browse files
Bump github/codeql-action from 4.31.0 to 4.31.2 in the actions group (#138)
* Bumps node modules * Bumps node modules * Bump github/codeql-action from 4.31.0 to 4.31.2 in the actions group Bumps the actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action). Updates `github/codeql-action` from 4.31.0 to 4.31.2 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@4e94bd1...0499de3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kenji Saito <ken-yo@mbr.nifty.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kenji Saito <1867845+poad@users.noreply.github.com>
1 parent 3b3867d commit 6a85a53

20 files changed

Lines changed: 218 additions & 136 deletions

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ jobs:
2828
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2929

3030
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0
31+
uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
3232
with:
3333
languages: ${{ matrix.language }}
3434

3535
- name: Autobuild
36-
uses: github/codeql-action/autobuild@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0
36+
uses: github/codeql-action/autobuild@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
3737

3838
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0
39+
uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2

agents/agent-mastra/src/mastra/tools/index.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
import { createTool } from '@mastra/core/tools';
22
import { z } from 'zod';
33

4+
interface GeocodingResponseResult {
5+
latitude: number;
6+
longitude: number;
7+
name: string;
8+
}
9+
410
interface GeocodingResponse {
5-
results: {
6-
latitude: number;
7-
longitude: number;
8-
name: string;
9-
}[];
11+
results: GeocodingResponseResult[];
12+
}
13+
14+
interface WeatherResponseCurrent {
15+
time: string;
16+
temperature_2m: number;
17+
apparent_temperature: number;
18+
relative_humidity_2m: number;
19+
wind_speed_10m: number;
20+
wind_gusts_10m: number;
21+
weather_code: number;
1022
}
23+
1124
interface WeatherResponse {
12-
current: {
13-
time: string;
14-
temperature_2m: number;
15-
apparent_temperature: number;
16-
relative_humidity_2m: number;
17-
wind_speed_10m: number;
18-
wind_gusts_10m: number;
19-
weather_code: number;
20-
};
25+
current: WeatherResponseCurrent;
2126
}
2227

2328
export const weatherTool = createTool({

basic/app/src/features/Models/components/ModelSelector.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import { For } from 'solid-js/web';
22

3-
export function ModelSelector(props: {
4-
models: {
5-
id: string;
6-
name: string;
7-
selected: boolean;
8-
disabled?: boolean;
9-
}[],
3+
interface Model {
4+
id: string;
5+
name: string;
6+
selected: boolean;
7+
disabled?: boolean;
8+
}
9+
10+
interface ModelSelectorProps {
11+
models: Model[],
1012
onChange: (model: string) => void
1113
class?: string;
1214
id?: string;
13-
}) {
15+
}
16+
17+
export function ModelSelector(props: ModelSelectorProps) {
1418
return (<>
1519
<select onChange={(e) => props.onChange(e.target.value)} id={props.id} class={props.class}>
1620
<For each={props.models.filter((it) => !it.disabled)}>

basic/app/src/features/chat/components/Chat.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ interface ChatMessage {
1212
streaming?: boolean;
1313
}
1414

15-
export function Chat(props: {
15+
interface Model {
16+
id: string;
17+
name: string;
18+
selected: boolean;
19+
}
20+
21+
interface ChatProps {
1622
sessionId: string;
17-
models: {
18-
id: string;
19-
name: string;
20-
selected: boolean;
21-
}[]
22-
}) {
23+
models: Model[]
24+
}
25+
26+
export function Chat(props: ChatProps) {
2327
// 履歴を管理するstore
2428
const [history, setHistory] = createStore<ChatMessage[]>([]);
2529

basic/cdk/bin/cdk.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import {
88

99
const app = new cdk.App();
1010

11+
interface ConfigProps { stackName: string }
12+
1113
const env = app.node.tryGetContext('env');
12-
const config: Config & { stackName: string } = env
14+
const config: Config & ConfigProps = env
1315
? app.node.tryGetContext(env)
1416
: app.node.tryGetContext('default');
1517

basic/cdk/lambda/handler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import { CallbackHandler } from 'langfuse-langchain';
55

66
import { selectLlm, logger } from '@llm-ts-example/common-backend';
77

8+
interface HandleProps { question: string, model?: string }
9+
810
export async function handle(
911
sessionId: string,
10-
{ question, model: modelType }: { question: string, model?: string },
12+
{ question, model: modelType }: HandleProps,
1113
output: NodeJS.WritableStream,
1214
) {
1315

basic/cdk/lib/cdk-stack.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,26 @@ import * as iam from 'aws-cdk-lib/aws-iam';
1010
import * as deployment from 'aws-cdk-lib/aws-s3-deployment';
1111
import { buildCommon, buildFrontend } from './process/setup.js';
1212

13+
interface CloudFrontProps {
14+
comment: string;
15+
}
16+
1317
export interface Config extends cdk.StackProps {
1418
bucketName: string;
1519
appName: string;
16-
cloudfront: {
17-
comment: string;
18-
};
20+
cloudfront: CloudFrontProps;
21+
}
22+
23+
interface LangFuseProps {
24+
sk: string;
25+
pk: string;
26+
endpoint: string;
27+
}
28+
29+
interface LangSmithProps {
30+
apiKey: string;
31+
project: string;
32+
endpoint: string;
1933
}
2034

2135
interface CloudfrontCdnTemplateStackProps extends Config {
@@ -24,18 +38,10 @@ interface CloudfrontCdnTemplateStackProps extends Config {
2438
instanceName: string;
2539
apiKey: string;
2640
apiVersion: string;
27-
langfuse?: {
28-
sk: string;
29-
pk: string;
30-
endpoint: string;
31-
};
41+
langfuse?: LangFuseProps;
3242
anthoropicApiKey: string;
3343
claudeModel: string;
34-
langsmith?: {
35-
apiKey: string;
36-
project: string;
37-
endpoint: string;
38-
};
44+
langsmith?: LangSmithProps;
3945
}
4046

4147
export class CloudfrontCdnTemplateStack extends cdk.Stack {
@@ -110,7 +116,7 @@ export class CloudfrontCdnTemplateStack extends cdk.Stack {
110116
environment: {
111117
// ...devOptions.environment,
112118
API_ROOT_PATH: apiRootPath,
113-
...(endpoint ? {AZURE_OPENAI_API_ENDPOINT: endpoint} : {}),
119+
...(endpoint ? { AZURE_OPENAI_API_ENDPOINT: endpoint } : {}),
114120
AZURE_OPENAI_API_INSTANCE_NAME: instanceName,
115121
AZURE_OPENAI_API_KEY: apiKey,
116122
AZURE_OPENAI_API_VERSION: apiVersion,

basic/cdk/tsconfig-eslint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": true
5+
},
36
"include": [
47
"eslint.config.*s",
58
"vite.config.ts",

common/backend/src/langchain.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import { BaseChatModel } from '@langchain/core/language_models/chat_models';
66

77
import { models } from '@llm-ts-example/common-core';
88

9-
export function selectLlm(modelType?: string): {
9+
interface SelectLlmResult {
1010
platform: 'aws' | 'azure';
1111
modelName: string;
1212
model: LanguageModelLike & BaseChatModel;
13-
} {
13+
}
14+
15+
export function selectLlm(modelType?: string): SelectLlmResult {
1416
const model = models.find((model) => model.id === modelType);
1517
if (!model) {
1618
logger.error(`Model type "${modelType}" is not supported.`);

mcp/clients/mcp-client-http/src/McpClient.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ async function createClient(baseUrl: URL) {
2323
}
2424
}
2525

26-
function createConverseClient(params: {
26+
interface CreateConverseClientProps {
2727
tools: Tool[];
2828
bedrock: BedrockRuntimeClient;
2929
mcp: Client;
3030
modelId: string;
31-
}) {
31+
}
32+
33+
function createConverseClient(params:CreateConverseClientProps) {
3234
const converse = async (conversation: Message[]) => {
3335
const { tools, bedrock, mcp, modelId } = params;
3436
const input: ConverseCommandInput = {
@@ -98,9 +100,11 @@ async function questionPrompt(conversation: Message[]): Promise<boolean> {
98100
}
99101
}
100102

101-
async function chat(client: {
103+
interface ChatProps {
102104
converse: (conversation: Message[]) => Promise<void>;
103-
}) {
105+
}
106+
107+
async function chat(client: ChatProps) {
104108
const conversation: Message[] = [];
105109
try {
106110
console.log('\nMCP Client Started!');
@@ -126,11 +130,13 @@ interface McpClient {
126130
chat: () => Promise<void>;
127131
}
128132

129-
async function createMcpClient({ region, url, modelId }: {
133+
interface CreateMcpClientProps {
130134
region: string
131135
url: string
132136
modelId: string
133-
}): Promise<McpClient> {
137+
}
138+
139+
async function createMcpClient({ region, url, modelId }: CreateMcpClientProps): Promise<McpClient> {
134140
const baseUrl = new URL(url);
135141
const bedrock = new BedrockRuntimeClient({ region });
136142

0 commit comments

Comments
 (0)