Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 914188a

Browse files
committed
0.0.0-hotfix.1
1 parent c255e1f commit 914188a

File tree

11 files changed

+146
-29
lines changed

11 files changed

+146
-29
lines changed

bun.lockb

-587 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"packages/*",
88
"skill/*",
99
"docs",
10+
"scripts",
1011
"server"
1112
],
1213
"resolutions": {

packages/lang/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
},
2525
"trustedDependencies": [
2626
"hnswlib-node"
27-
]
28-
}
27+
],
28+
"version": "0.0.0-hotfix.1"
29+
}

packages/oai-types/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
},
1313
"peerDependencies": {
1414
"typescript": "^5.0.0"
15-
}
16-
}
15+
},
16+
"version": "0.0.0-hotfix.1"
17+
}

scripts/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@ava/workspace-scripts",
3+
"module": "index.ts",
4+
"type": "module",
5+
"devDependencies": {
6+
"@types/bun": "latest",
7+
"@types/js-yaml": "^4.0.9"
8+
},
9+
"peerDependencies": {
10+
"typescript": "^5.0.0"
11+
},
12+
"dependencies": {
13+
"js-yaml": "^4.1.0"
14+
}
15+
}

scripts/release.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { $, Glob } from "bun"
2+
import { readFile, writeFile } from "fs/promises"
3+
import { semver } from "bun"
4+
import { load, dump } from "js-yaml"
5+
6+
const branch = (await $`git rev-parse --abbrev-ref HEAD`.text()).trim();
7+
8+
if (branch !== "main") {
9+
console.error("Release is only allowed from main branch");
10+
process.exit(1);
11+
}
12+
13+
const newVersion = process.argv[2];
14+
if (!newVersion) {
15+
console.error("Version is required");
16+
process.exit(1);
17+
}
18+
19+
const packagesGlob = new Glob("{**,*,.}/{*,.}/package.json");
20+
21+
console.info('patching all js packages to', newVersion);
22+
for await (const p of packagesGlob.scan()) {
23+
if (p.includes("node_modules")) continue;
24+
const data = JSON.parse(await readFile(p, "utf-8"));
25+
const version = data.version || "0.0.0";
26+
const name = data.name;
27+
const diff = semver.order(newVersion, version);
28+
if (!diff) {
29+
console.log('no change for', `${name}@${version},`, "semver diff:", diff);
30+
continue
31+
}
32+
console.log(`patching ${name}@${version} -> ${name}@${newVersion}`);
33+
data.version = newVersion;
34+
await writeFile(p, JSON.stringify(data, null, 2));
35+
await $`git add ${p}`;
36+
}
37+
38+
console.log('patching home assistant add-ons to', newVersion);
39+
const addonsGlob = new Glob("{server}/config.{yml,yaml}");
40+
for await (const p of addonsGlob.scan()) {
41+
const data = load(await readFile(p, "utf-8")) as any;
42+
const version = data.version || "0.0.0";
43+
const name = data.name;
44+
const diff = semver.order(newVersion, version);
45+
if (!diff) {
46+
console.log('no change for', `${name}@${version},`, "semver diff:", diff);
47+
continue
48+
}
49+
50+
console.log(`patching ${name}@${version} -> ${name}@${newVersion}`);
51+
data.version = newVersion;
52+
await writeFile(p, dump(data));
53+
await $`git add ${p}`;
54+
}
55+
56+
console.log('installing dependencies to update lock files');
57+
await $`bun install`;
58+
59+
console.log('committing changes');
60+
await $`git commit -m "${newVersion}"`;
61+
await $`git tag -a ${newVersion}`;
62+
await $`git push origin main --tags`;

scripts/tsconfig.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
// Enable latest features
4+
"lib": ["ESNext", "DOM"],
5+
"target": "ESNext",
6+
"module": "ESNext",
7+
"moduleDetection": "force",
8+
"jsx": "react-jsx",
9+
"allowJs": true,
10+
11+
// Bundler mode
12+
"moduleResolution": "bundler",
13+
"allowImportingTsExtensions": true,
14+
"verbatimModuleSyntax": true,
15+
"noEmit": true,
16+
17+
// Best practices
18+
"strict": true,
19+
"skipLibCheck": true,
20+
"noFallthroughCasesInSwitch": true,
21+
22+
// Some stricter flags (disabled by default)
23+
"noUnusedLocals": false,
24+
"noUnusedParameters": false,
25+
"noPropertyAccessFromIndexSignature": false
26+
}
27+
}

server/config.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
name: "Ava Server"
2-
description: "Self-hosted personal assistant in minutes with built-in Home Assistant integration and great extensibility and customizability"
3-
version: "0.0.0"
4-
slug: "server"
1+
name: Ava Server
2+
description: >-
3+
Self-hosted personal assistant in minutes with built-in Home Assistant
4+
integration and great extensibility and customizability
5+
version: 0.0.0-hotfix.1
6+
slug: server
57
init: false
68
arch:
79
- aarch64
@@ -17,26 +19,26 @@ ingress_stream: true
1719
options:
1820
llm:
1921
namespace: anthropic
20-
token: "your token"
22+
token: your token
2123
name: claude-3-opus-20240229
2224
embeddings:
2325
namespace: ollama
24-
baseURL: "http://04c4e5a1-ollama:11434"
26+
baseURL: http://04c4e5a1-ollama:11434
2527
name: snowflake-arctic-embed:22m
2628
skills: []
2729
schema:
2830
llm:
2931
namespace: list(anthropic|openai|ollama)
30-
name: "str"
31-
token: "str?"
32-
baseURL: "str?"
32+
name: str
33+
token: str?
34+
baseURL: str?
3335
embeddings:
3436
namespace: list(openai|ollama)
35-
name: "str"
36-
token: "str?"
37-
baseURL: "str?"
37+
name: str
38+
token: str?
39+
baseURL: str?
3840
skills:
39-
- name: "str"
40-
description: "str"
41-
returnDirect: "bool?"
42-
url: "str"
41+
- name: str
42+
description: str
43+
returnDirect: bool?
44+
url: str

skill/dynamic/index.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ export const createDynamicToolkit = async (): Promise<ToolInterface[]> => {
1111
description: skill.description,
1212
returnDirect: skill.returnDirect,
1313
async func(body) {
14-
const response = await http.post(skill.url, {
15-
body,
16-
responseType: 'json'
17-
}).text()
14+
const res = await fetch(skill.url, {
15+
method: 'POST',
16+
headers: {
17+
'Content-Type': 'application/json',
18+
},
19+
body: JSON.stringify(body),
20+
})
1821

19-
return response
22+
if (!res.ok) {
23+
throw new Error(`Failed to call skill ${skill.name}, status: ${res.status}, body: ${await res.text()}`)
24+
}
25+
26+
return res.text()
2027
}
2128
})
2229
})

skill/dynamic/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@ava/skill-dynamic",
33
"module": "index.ts",
44
"type": "module",
5-
"version": "0.0.0",
5+
"version": "0.0.0-hotfix.1",
66
"devDependencies": {
77
"@types/bun": "latest"
88
},
@@ -15,4 +15,4 @@
1515
"znv": "^0.4.0",
1616
"zod": "^3.23.0"
1717
}
18-
}
18+
}

0 commit comments

Comments
 (0)