fix: hotfix vscode extension 0.4.1. update document links, fix data.json migration, and update anonymous usage tracking client properties. (#434)
parent
682c21e536
commit
3af32c8c7c
|
|
@ -10,6 +10,6 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cpy-cli": "^4.2.0",
|
"cpy-cli": "^4.2.0",
|
||||||
"rimraf": "^5.0.1",
|
"rimraf": "^5.0.1",
|
||||||
"tabby-agent": "0.1.0"
|
"tabby-agent": "0.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tabby-agent",
|
"name": "tabby-agent",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Generic client agent for Tabby AI coding assistant IDE extensions.",
|
"description": "Generic client agent for Tabby AI coding assistant IDE extensions.",
|
||||||
"repository": "https://github.com/TabbyML/tabby",
|
"repository": "https://github.com/TabbyML/tabby",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import { AgentConfig, PartialAgentConfig } from "./AgentConfig";
|
||||||
export type AgentInitOptions = Partial<{
|
export type AgentInitOptions = Partial<{
|
||||||
config: PartialAgentConfig;
|
config: PartialAgentConfig;
|
||||||
client: string;
|
client: string;
|
||||||
|
clientProperties: Record<string, any>;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
export type ServerHealthState = HealthState;
|
export type ServerHealthState = HealthState;
|
||||||
|
|
|
||||||
|
|
@ -253,9 +253,15 @@ export class TabbyAgent extends EventEmitter implements Agent {
|
||||||
private healthCheck(): Promise<any> {
|
private healthCheck(): Promise<any> {
|
||||||
return this.callApi(this.api.v1.health, {})
|
return this.callApi(this.api.v1.health, {})
|
||||||
.then((healthState) => {
|
.then((healthState) => {
|
||||||
this.serverHealthState = healthState;
|
if (
|
||||||
if (this.status === "ready") {
|
typeof healthState === "object" &&
|
||||||
this.anonymousUsageLogger.uniqueEvent("AgentConnected", healthState);
|
healthState["model"] !== undefined &&
|
||||||
|
healthState["device"] !== undefined
|
||||||
|
) {
|
||||||
|
this.serverHealthState = healthState;
|
||||||
|
if (this.status === "ready") {
|
||||||
|
this.anonymousUsageLogger.uniqueEvent("AgentConnected", healthState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|
@ -276,11 +282,11 @@ export class TabbyAgent extends EventEmitter implements Agent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async initialize(options: AgentInitOptions): Promise<boolean> {
|
public async initialize(options: AgentInitOptions): Promise<boolean> {
|
||||||
if (options.client) {
|
if (options.client || options.clientProperties) {
|
||||||
// Client info is only used in logging for now
|
// Client info is only used in logging for now
|
||||||
// `pino.Logger.setBindings` is not present in the browser
|
// `pino.Logger.setBindings` is not present in the browser
|
||||||
allLoggers.forEach((logger) => logger.setBindings?.({ client: options.client }));
|
allLoggers.forEach((logger) => logger.setBindings?.({ client: options.client, ...options.clientProperties }));
|
||||||
this.anonymousUsageLogger.addProperties({ client: options.client });
|
this.anonymousUsageLogger.addProperties({ client: options.client, ...options.clientProperties });
|
||||||
}
|
}
|
||||||
if (userAgentConfig) {
|
if (userAgentConfig) {
|
||||||
await userAgentConfig.load();
|
await userAgentConfig.load();
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,23 @@ export const dataStore: DataStore = isBrowser
|
||||||
return {
|
return {
|
||||||
data: {},
|
data: {},
|
||||||
load: async function () {
|
load: async function () {
|
||||||
|
await this.migrateFrom_0_3_0();
|
||||||
this.data = (await fs.readJson(dataFile, { throws: false })) || {};
|
this.data = (await fs.readJson(dataFile, { throws: false })) || {};
|
||||||
},
|
},
|
||||||
save: async function () {
|
save: async function () {
|
||||||
await fs.outputJson(dataFile, this.data);
|
await fs.outputJson(dataFile, this.data);
|
||||||
},
|
},
|
||||||
|
migrateFrom_0_3_0: async function () {
|
||||||
|
const dataFile_0_3_0 = require("path").join(require("os").homedir(), ".tabby", "agent", "data.json");
|
||||||
|
const migratedFlag = require("path").join(require("os").homedir(), ".tabby", "agent", ".data_json_migrated");
|
||||||
|
if (
|
||||||
|
(await fs.pathExists(dataFile_0_3_0)) &&
|
||||||
|
!(await fs.pathExists(migratedFlag))
|
||||||
|
) {
|
||||||
|
const data = await fs.readJson(dataFile_0_3_0);
|
||||||
|
await fs.outputJson(dataFile, data);
|
||||||
|
await fs.outputFile(migratedFlag, "");
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ const stream =
|
||||||
export const rootLogger = !!stream ? pino(stream) : pino();
|
export const rootLogger = !!stream ? pino(stream) : pino();
|
||||||
if (isTest && testLogDebug) {
|
if (isTest && testLogDebug) {
|
||||||
rootLogger.level = "debug";
|
rootLogger.level = "debug";
|
||||||
|
} else {
|
||||||
|
rootLogger.level = "silent";
|
||||||
}
|
}
|
||||||
|
|
||||||
export const allLoggers = [rootLogger];
|
export const allLoggers = [rootLogger];
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,6 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cpy-cli": "^4.2.0",
|
"cpy-cli": "^4.2.0",
|
||||||
"rimraf": "^5.0.1",
|
"rimraf": "^5.0.1",
|
||||||
"tabby-agent": "0.1.0"
|
"tabby-agent": "0.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
## 0.4.1
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
|
||||||
|
- Updated expired links in the documentation.
|
||||||
|
- Migrated Tabby cloud authorization tokens and anonymous usage tracking id from the old data directory to the new one.
|
||||||
|
|
||||||
## 0.4.0
|
## 0.4.0
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ If you encounter any problem or have any suggestion, please [open an issue](http
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
Try our online demo [here](https://tabbyml.github.io/tabby/playground).
|
Try our online demo [here](https://tabby.tabbyml.com/playground).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Get Started
|
## Get Started
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
Tabby will show inline suggestions when you stop typing, and you can accept suggestions by just pressing the `Tab` key.
|
Tabby will show inline suggestions when you stop typing, and you can accept suggestions by just pressing the `Tab` key.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Cycling Through Choices
|
## Cycling Through Choices
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,4 @@ You can get a Tabby Cloud account [here](https://app.tabbyml.com). Once you crea
|
||||||
|
|
||||||
## Self-Hosting
|
## Self-Hosting
|
||||||
|
|
||||||
Tabby is an open-source project and supports self-hosting. For more details, please refer to our [self-hosting guide](https://tabbyml.github.io/tabby/docs/self-hosting/) and visit our [Github repository](https://github.com/tabbyml/tabby).
|
Tabby is an open-source project and supports self-hosting. For more details, please refer to our [self-hosting guide](https://tabby.tabbyml.com/docs/installation/) and visit our [Github repository](https://github.com/tabbyml/tabby).
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
"publisher": "TabbyML",
|
"publisher": "TabbyML",
|
||||||
"displayName": "Tabby",
|
"displayName": "Tabby",
|
||||||
"description": "Tabby is a self-hosted AI coding assistant that can suggest multi-line code or full functions in real-time.",
|
"description": "Tabby is a self-hosted AI coding assistant that can suggest multi-line code or full functions in real-time.",
|
||||||
"homepage": "https://tabbyml.github.io/tabby",
|
"homepage": "https://tabby.tabbyml.com/",
|
||||||
"repository": "https://github.com/TabbyML/tabby",
|
"repository": "https://github.com/TabbyML/tabby",
|
||||||
"bugs": "https://github.com/TabbyML/tabby/issues",
|
"bugs": "https://github.com/TabbyML/tabby/issues",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"version": "0.4.0",
|
"version": "0.4.1",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ai",
|
"ai",
|
||||||
"autocomplete",
|
"autocomplete",
|
||||||
|
|
@ -197,6 +197,6 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@xstate/fsm": "^2.0.1",
|
"@xstate/fsm": "^2.0.1",
|
||||||
"tabby-agent": "0.1.0"
|
"tabby-agent": "0.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,16 @@ export async function createAgentInstance(context: ExtensionContext): Promise<Ta
|
||||||
const initPromise = agent.initialize({
|
const initPromise = agent.initialize({
|
||||||
config: getWorkspaceConfiguration(),
|
config: getWorkspaceConfiguration(),
|
||||||
client: `${env.appName} ${env.appHost} ${version}, ${context.extension.id} ${context.extension.packageJSON.version}`,
|
client: `${env.appName} ${env.appHost} ${version}, ${context.extension.id} ${context.extension.packageJSON.version}`,
|
||||||
|
clientProperties: {
|
||||||
|
ide: {
|
||||||
|
name: `${env.appName} ${env.appHost}`,
|
||||||
|
version: version,
|
||||||
|
},
|
||||||
|
tabby_plugin: {
|
||||||
|
name: context.extension.id,
|
||||||
|
version: context.extension.packageJSON.version,
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
workspace.onDidChangeConfiguration(async (event) => {
|
workspace.onDidChangeConfiguration(async (event) => {
|
||||||
await initPromise;
|
await initPromise;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue