Skip to content

Commit bfa9a82

Browse files
committed
chore: wip
chore: wip chore: wip chore: wip chore: wip chore: wip
1 parent b97f548 commit bfa9a82

File tree

13 files changed

+32
-42
lines changed

13 files changed

+32
-42
lines changed

app/Actions/Dashboard/GetProjects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Action } from '@stacksjs/actions'
44
export default new Action({
55
name: 'GetProjects',
66
description: 'Gets your local Stacks projects.',
7-
path: '/api/projects',
7+
path: '/projects',
88

99
async handle() {
1010
console.log('GetProjects called from Action')

app/Actions/Dashboard/Settings/UpdateAiConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { schema } from '@stacksjs/validation'
44
export default new Action({
55
name: 'UpdateAiConfig',
66
description: 'Updates the AI config.',
7-
path: '/api/dashboard/settings/ai',
7+
path: '/dashboard/settings/ai',
88
method: 'POST',
99

1010
validations: {

routes/api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import { route } from '@stacksjs/router'
88
* @see https://docs.stacksjs.org/routing
99
*/
1010

11-
route.get('/foo/bar/{id}', () => 'hello world, foo bar') // $APP_URL/api/hello/world
12-
route.get('/', () => 'hello world') // $APP_URL/api
13-
route.get('/hello/world', () => 'hello world, buddy') // $APP_URL/api/hello/world
11+
route.get('/foo/bar/{id}', () => 'hello world, foo bar') // $API_URL/hello/world
12+
route.get('/', () => 'hello world') // $API_URL
13+
route.get('/hello/world', () => 'hello world, buddy') // $API_URL/hello/world
1414

1515
route.post('/email/subscribe', 'Actions/SubscriberEmailAction')
1616
route.post('/login', 'Actions/LoginAction')
1717

1818
// route.email('/welcome')
19-
route.health() // adds a GET `/api/health` route
19+
route.health() // adds a GET `/health` route
2020
route.get('/install', 'Actions/InstallAction')
2121
route.post('/ai/ask', 'Actions/AI/AskAction')
2222
route.post('/ai/summary', 'Actions/AI/SummaryAction')

storage/framework/api/dev.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ serve({
6363
})
6464

6565
process.on('SIGINT', () => {
66-
log.info(`Exited ${italic('using Ctrl-C')}`)
67-
66+
log.info(`Exited using Ctrl-C`)
6867
process.exit()
6968
})
7069

7170
// @ts-expect-error - somehow type is not recognized
72-
if (globalThis.counter === 1) log.info(`Listening on http://localhost:${ports.api}/api ...`)
71+
if (globalThis.counter === 1) log.info(`Listening on http://localhost:${ports.api} ...`)
7372
// @ts-expect-error - somehow type is not recognized
74-
else log.info(`#${globalThis.counter}: Listening on http://localhost:${ports.api}/api ...`)
73+
else log.info(`#${globalThis.counter}: Listening on http://localhost:${ports.api} ...`)

storage/framework/core/actions/src/deploy/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ await runCommand('bun build.ts', {
3838
})
3939
log.success('Server built')
4040

41-
// run bun install in the framework path
42-
log.info('Installing aws-sdk-layer dependency...')
43-
await runCommand('bun install', {
44-
cwd: p.cloudPath('src/cloud/aws-sdk-layer'),
45-
})
46-
log.success('aws-sdk-layer dependency installed')
47-
4841
await runCommand('bun zip.ts', {
4942
cwd: p.corePath('cloud'),
5043
})
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
export * from './utils/client-bedrock'
22
export * from './utils/client-bedrock-runtime'
33
export * from './utils/model-access'
4+
export * from './text'
45

56
// export * from './chatbots'
67
// export * from './image-generation'
78
// export * from './search'
8-
// export * from './text-generation'
9-
// export * from './text-summary'

storage/framework/core/ai/src/text.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { InvokeModelCommand, client } from './client-bedrock-runtime'
1+
import { InvokeModelCommand, client } from './utils/client-bedrock-runtime'
22

33
export interface AiOptions {
44
maxTokenCount?: number
@@ -58,6 +58,7 @@ export async function ask(question: string, options: AskOptions = {}): Promise<s
5858
try {
5959
const response = await client.send(command)
6060
const responseBody = JSON.parse(new TextDecoder().decode(response.body))
61+
6162
return responseBody.results[0].outputText
6263
} catch (error) {
6364
console.error('Error asking question:', error)

storage/framework/core/ai/src/utils/client-bedrock-runtime.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import {
1010
InvokeModelWithResponseStreamCommand,
1111
} from '@aws-sdk/client-bedrock-runtime'
1212

13-
export const client = new BedrockRuntimeClient({
13+
export const client: BedrockRuntimeClient = new BedrockRuntimeClient({
1414
region: process.env.REGION || 'us-east-1',
1515
})
16+
1617
const logger = console // import your own logger
1718

1819
/*
@@ -47,4 +48,6 @@ export async function invokeModelWithResponseStream(
4748
return res
4849
}
4950

51+
export { InvokeModelCommand }
52+
5053
export type { InvokeModelCommandInput, InvokeModelWithResponseStreamCommandInput }

storage/framework/core/cloud/src/cloud/cdn.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { config } from '@stacksjs/config'
22
import type { aws_certificatemanager as acm, aws_s3 as s3, aws_wafv2 as wafv2 } from 'aws-cdk-lib'
33
import {
44
Duration,
5-
Fn,
65
CfnOutput as Output,
76
aws_cloudfront as cloudfront,
87
aws_lambda as lambda,
@@ -287,8 +286,4 @@ export class CdnStack {
287286
return cloudfront.CachedMethods.CACHE_GET_HEAD
288287
}
289288
}
290-
291-
shouldDeployCliSetup(): boolean {
292-
return config.cloud.cli ?? false
293-
}
294289
}

storage/framework/core/cloud/src/cloud/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Duration, CfnOutput as Output, aws_lambda as lambda } from 'aws-cdk-lib'
1+
import { CfnOutput as Output } from 'aws-cdk-lib'
22
import type { Construct } from 'constructs'
33
import type { NestedCloudProps } from '../types'
44

@@ -7,7 +7,7 @@ export interface CliStackProps extends NestedCloudProps {}
77
export class CliStack {
88
constructor(scope: Construct, props: CliStackProps) {
99
new Output(scope, 'CliSetupUrl', {
10-
value: `https://${props.domain}/install`,
10+
value: `https://api.${props.domain}/install`,
1111
description: 'URL to trigger the CLI setup function',
1212
})
1313
}

0 commit comments

Comments
 (0)