diff --git a/packages/kbot/package.json b/packages/kbot/package.json index 29bdfdba..4c4ce8ed 100644 --- a/packages/kbot/package.json +++ b/packages/kbot/package.json @@ -1,11 +1,12 @@ { - "name": "@plastichub/code-bot", - "version": "0.3.4", + "name": "@polymech/kbot-d", + "version": "0.3.5", + "type": "module", "publishConfig": { "access": "public" }, "bin": { - "kbotd": "./main.js" + "kbot-d": "./main.js" }, "scripts": { "build": "tsc", @@ -20,25 +21,22 @@ "exe:lnx": "cd dist && nexe -i main_node.js -o kbot --build --temp=../../temp-kbot --verbose" }, "dependencies": { - "@astrojs/ts-plugin": "1.10.4", "@gradio/client": "1.12.0", - "@plastichub/core": "file:../core", - "@plastichub/fs": "^0.13.40", - "@plastichub/osr-ai-tools": "file:../osr-ai-tools", - "@plastichub/osr-commons": "file:../osr-commons", - "@plastichub/osr-log": "file:../osr-log", + "@polymech/ai-tools": "file:../ai-tools", + "@polymech/core": "file:../core", + "@polymech/fs": "file:../fs", + "@polymech/log": "file:../log", "axios": "1.7.9", "chalk": "4.0.0", "deepmerge-ts": "7.1.4", "emojilib": "4.0.1", "env-var": "7.5.0", - "free-astro-components": "1.1.1", "glob": "11.0.1", "marked": "14.1.4", "marked-terminal": "7.2.1", "mime-types": "2.1.35", - "openai": "4.84.0", - "p-map": "^4.0.0", + "openai": "4.85.3", + "p-map": "7.0.3", "tslog": "^4.9.3", "yargs": "17.7.2", "zod": "3.24.1" @@ -65,6 +63,7 @@ "code-review" ], "devDependencies": { + "@repo/typescript-config": "file:../typescript-config", "@types/node": "22.10.2", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", diff --git a/packages/kbot/src/__tests__/config.test.ts b/packages/kbot/src/__tests__/config.test.ts index 0c91a3fa..4a0fc0c1 100644 --- a/packages/kbot/src/__tests__/config.test.ts +++ b/packages/kbot/src/__tests__/config.test.ts @@ -5,7 +5,7 @@ import { createClient } from '../client' import * as fs from 'fs' vi.mock('fs') -vi.mock('@plastichub/osr-commons', () => ({ +vi.mock('@polymech/osr-commons', () => ({ CONFIG_DEFAULT: () => ({ openrouter: { key: 'default-openrouter-key' }, openai: { key: 'default-openai-key' } diff --git a/packages/kbot/src/__tests__/templates.test.ts b/packages/kbot/src/__tests__/templates.test.ts index 93b405b0..7386d2df 100644 --- a/packages/kbot/src/__tests__/templates.test.ts +++ b/packages/kbot/src/__tests__/templates.test.ts @@ -1,15 +1,15 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import {resolve_package_path, template_path, load } from '../templates' -import { sync as exists } from '@plastichub/fs/exists' -import { sync as read } from '@plastichub/fs/read' -import { filesEx as include } from '@plastichub/osr-commons/_glob' +import { sync as exists } from '@polymech/fs/exists' +import { sync as read } from '@polymech/fs/read' +import { filesEx as include } from '@polymech/commons/_glob' import * as path from 'path' import { logger } from '../' -vi.mock('@plastichub/fs/exists') -vi.mock('@plastichub/fs/read') -vi.mock('@plastichub/osr-commons/_glob') -vi.mock('@plastichub/osr-commons', () => ({ +vi.mock('@polymech/fs/exists') +vi.mock('@polymech/fs/read') +vi.mock('@polymech/commons/_glob') +vi.mock('@polymech/osr-commons', () => ({ resolve: vi.fn((path) => path), substitute: vi.fn((x, y) => y) })) diff --git a/packages/kbot/src/collector.ts b/packages/kbot/src/collector.ts index 8fda9fe7..26fb395a 100644 --- a/packages/kbot/src/collector.ts +++ b/packages/kbot/src/collector.ts @@ -2,9 +2,9 @@ import path from 'path' import OpenAI from 'openai' //import { ChatCompletion, ChatCompletionMessage, ChatCompletionMessageParam } from 'openai/resources' //import { } from 'openai/resources' -import { ICollector } from '@plastichub/osr-ai-tools/types' -import { winstonLogger, } from '@plastichub/osr-log' -import { resolve } from '@plastichub/osr-commons' +import { ICollector } from '@polymech/osr-ai-tools/types' +import { winstonLogger, } from '@polymech/osr-log' +import { resolve } from '@polymech/osr-commons' import { RunnableFunctionWithParse } from 'openai/lib/RunnableFunction' import { IKBotOptions } from './zod_types' diff --git a/packages/kbot/src/commands/build.ts b/packages/kbot/src/commands/build.ts index d8e04350..5fd3b5fe 100644 --- a/packages/kbot/src/commands/build.ts +++ b/packages/kbot/src/commands/build.ts @@ -1,12 +1,12 @@ import path from 'path' -import { sync as read } from '@plastichub/fs/read' -import { sync as write } from '@plastichub/fs/write' -import { sync as exists } from '@plastichub/fs/exists' +import { sync as read } from '@polymech/fs/read' +import { sync as write } from '@polymech/fs/write' +import { sync as exists } from '@polymech/fs/exists' import { logger } from '../' import { fetchOpenAIModels } from '../models/openai' import { fetchOpenRouterModels, OpenRouterModel } from '../models/openrouter' -import { CONFIG_DEFAULT } from '@plastichub/osr-commons' +import { CONFIG_DEFAULT } from '@polymech/osr-commons' import { arch } from 'os' export const build = async () => { diff --git a/packages/kbot/src/commands/fetch.ts b/packages/kbot/src/commands/fetch.ts index 08027d54..32dd5648 100644 --- a/packages/kbot/src/commands/fetch.ts +++ b/packages/kbot/src/commands/fetch.ts @@ -1,9 +1,9 @@ import path from 'path' -import { sync as write } from '@plastichub/fs/write' +import { sync as write } from '@polymech/fs/write' import { logger, module_root } from '..' import { fetchOpenAIModels } from '../models/openai' import { fetchOpenRouterModels } from '../models/openrouter' -import { CONFIG_DEFAULT } from '@plastichub/osr-commons' +import { CONFIG_DEFAULT } from '@polymech/osr-commons' export const fetch = async () => { diff --git a/packages/kbot/src/commands/handlers/image-handler.ts b/packages/kbot/src/commands/handlers/image-handler.ts index a1487d81..8ce025c1 100644 --- a/packages/kbot/src/commands/handlers/image-handler.ts +++ b/packages/kbot/src/commands/handlers/image-handler.ts @@ -1,6 +1,6 @@ import { BaseHandler } from './base-handler' import * as path from 'path' -import { sync as read } from '@plastichub/fs/read' +import { sync as read } from '@polymech/fs/read' import { createClient } from '../../client' import { logger } from '../../index' import { toFile } from 'openai' diff --git a/packages/kbot/src/commands/handlers/index.ts b/packages/kbot/src/commands/handlers/index.ts index 592cec3c..5fb80982 100644 --- a/packages/kbot/src/commands/handlers/index.ts +++ b/packages/kbot/src/commands/handlers/index.ts @@ -2,7 +2,7 @@ import { IHandler } from './base-handler' import { TextHandler } from './text-handler' import { AudioHandler } from './audio-handler' import { ImageHandler } from './image-handler' -import { sync as exists } from '@plastichub/fs/exists' +import { sync as exists } from '@polymech/fs/exists' import * as path from 'path' import { IKBotOptions } from '../../zod_types' diff --git a/packages/kbot/src/commands/handlers/text-handler.ts b/packages/kbot/src/commands/handlers/text-handler.ts index 540d0463..3d3ef72e 100644 --- a/packages/kbot/src/commands/handlers/text-handler.ts +++ b/packages/kbot/src/commands/handlers/text-handler.ts @@ -1,5 +1,5 @@ import { BaseHandler } from './base-handler'; -import { sync as read } from '@plastichub/fs/read'; +import { sync as read } from '@polymech/fs/read'; import * as path from 'path'; export class TextHandler extends BaseHandler { diff --git a/packages/kbot/src/commands/help.ts b/packages/kbot/src/commands/help.ts index 72c133b8..d18c7067 100644 --- a/packages/kbot/src/commands/help.ts +++ b/packages/kbot/src/commands/help.ts @@ -2,7 +2,7 @@ import { marked } from 'marked' import { markedTerminal } from 'marked-terminal' import { OptionsSchema } from '../zod_schema' -import { getDefaultValue, getDescription } from '@plastichub/osr-commons' +import { getDefaultValue, getDescription } from '@polymech/osr-commons' import { z } from 'zod' export const help = () => { diff --git a/packages/kbot/src/commands/init.ts b/packages/kbot/src/commands/init.ts index 63798655..4ff806b1 100644 --- a/packages/kbot/src/commands/init.ts +++ b/packages/kbot/src/commands/init.ts @@ -1,6 +1,6 @@ -import { sync as dir } from '@plastichub/fs/dir' -import { sync as exists } from '@plastichub/fs/exists' -import { sync as write } from '@plastichub/fs/write' +import { sync as dir } from '@polymech/fs/dir' +import { sync as exists } from '@polymech/fs/exists' +import { sync as write } from '@polymech/fs/write' import * as path from 'path' import { IKBotTask } from '../types' import { Logger } from 'tslog' diff --git a/packages/kbot/src/commands/log.ts b/packages/kbot/src/commands/log.ts index 9d350e49..62b54062 100644 --- a/packages/kbot/src/commands/log.ts +++ b/packages/kbot/src/commands/log.ts @@ -1,5 +1,5 @@ import * as path from 'path' -import { sync as read } from '@plastichub/fs/read' -import { sync as exists } from '@plastichub/fs/exists' +import { sync as read } from '@polymech/fs/read' +import { sync as exists } from '@polymech/fs/exists' import { Logger } from 'tslog' import { logger } from '../' diff --git a/packages/kbot/src/commands/run-completion.ts b/packages/kbot/src/commands/run-completion.ts index 5fbe0d5f..70fed4d3 100644 --- a/packages/kbot/src/commands/run-completion.ts +++ b/packages/kbot/src/commands/run-completion.ts @@ -3,8 +3,8 @@ import OpenAI from 'openai' import { marked } from 'marked' import { markedTerminal } from 'marked-terminal' import * as path from 'path' -import { sync as write } from '@plastichub/fs/write' -import { resolve } from '@plastichub/osr-commons' +import { sync as write } from '@polymech/fs/write' +import { resolve } from '@polymech/osr-commons' import { logger } from '../' import { dumpAsScript } from '../utils/script' import { applyFilters, Filter } from '../filters' diff --git a/packages/kbot/src/commands/run-each.ts b/packages/kbot/src/commands/run-each.ts index 4d6ea3c1..1f8f7eb4 100644 --- a/packages/kbot/src/commands/run-each.ts +++ b/packages/kbot/src/commands/run-each.ts @@ -1,8 +1,8 @@ import { globSync } from 'glob' import * as path from 'path' -import { forward_slash } from '@plastichub/osr-commons' +import { forward_slash } from '@polymech/osr-commons' import { logger } from '../' -import { IKBotTask } from '@plastichub/osr-ai-tools/types' +import { IKBotTask } from '@polymech/osr-ai-tools/types' export const runEach = async (opts: IKBotTask, processRun: (args: IKBotTask) => Promise) => { const ret = [] diff --git a/packages/kbot/src/commands/run.ts b/packages/kbot/src/commands/run.ts index 40ea672c..df7ac937 100644 --- a/packages/kbot/src/commands/run.ts +++ b/packages/kbot/src/commands/run.ts @@ -1,11 +1,11 @@ import * as path from 'path' import { hasMagic } from 'glob' -import { sync as dir } from '@plastichub/fs/dir' -import { sync as exists } from '@plastichub/fs/exists' -import { sync as write } from '@plastichub/fs/write' -import { sync as read } from '@plastichub/fs/read' -import { forward_slash, resolve, isFile, isFolder, pathInfoEx } from '@plastichub/osr-commons' -import { isArray, isString } from '@plastichub/core/primitives' +import { sync as dir } from '@polymech/fs/dir' +import { sync as exists } from '@polymech/fs/exists' +import { sync as write } from '@polymech/fs/write' +import { sync as read } from '@polymech/fs/read' +import { forward_slash, resolve, isFile, isFolder, pathInfoEx } from '@polymech/osr-commons' +import { isArray, isString } from '@polymech/core/primitives' import { ChatCompletionToolRunnerParams } from 'openai/lib/ChatCompletionRunner' import { ChatCompletionMessageParam } from 'openai/resources/index.mjs' import { logger } from '../' @@ -23,7 +23,7 @@ import { EMode } from '../zod_schema' import { runCompletion } from './run-completion' import { runTools } from './run-tools' import { runAssistant } from './run-assistant' -import { IKBotTask } from '@plastichub/osr-ai-tools/types' +import { IKBotTask } from '@polymech/osr-ai-tools/types' import { all } from '../models' export const processRun = async (opts: IKBotTask) => { diff --git a/packages/kbot/src/config.ts b/packages/kbot/src/config.ts index 96e582c8..985beebe 100644 --- a/packages/kbot/src/config.ts +++ b/packages/kbot/src/config.ts @@ -1,9 +1,9 @@ import * as fs from 'fs' import * as path from 'path' -import { CONFIG_DEFAULT, resolve } from '@plastichub/osr-commons' +import { CONFIG_DEFAULT, resolve } from '@polymech/osr-commons' import { logger } from './index' -import { sync as exists } from '@plastichub/fs/exists' -import { sync as read } from '@plastichub/fs/read' +import { sync as exists } from '@polymech/fs/exists' +import { sync as read } from '@polymech/fs/read' import { IKBotOptions } from './zod_types' import { env_vars } from './utils/env' export const loadConfig = (options: IKBotOptions) => { diff --git a/packages/kbot/src/filters.ts b/packages/kbot/src/filters.ts index d1130faa..4e9b1846 100644 --- a/packages/kbot/src/filters.ts +++ b/packages/kbot/src/filters.ts @@ -1,4 +1,4 @@ -import { isString } from '@plastichub/core/primitives' +import { isString } from '@polymech/core/primitives' import { logger } from './' export type Filter = (json: string) => any diff --git a/packages/kbot/src/index.ts b/packages/kbot/src/index.ts index 4a63706a..2ff87080 100644 --- a/packages/kbot/src/index.ts +++ b/packages/kbot/src/index.ts @@ -1,8 +1,8 @@ import path from 'path' import { Logger } from 'tslog' -import { createLogger } from '@plastichub/osr-log' -import { CONFIG_DEFAULT, get_var } from '@plastichub/osr-commons' +import { createLogger } from '@polymech/osr-log' +import { CONFIG_DEFAULT, get_var } from '@polymech/osr-commons' import { MODULE_NAME } from './constants' export const logger: Logger = createLogger('llm-tools') export { run } from './commands/run' diff --git a/packages/kbot/src/main.ts b/packages/kbot/src/main.ts index e268be6c..2a8e7dc2 100644 --- a/packages/kbot/src/main.ts +++ b/packages/kbot/src/main.ts @@ -3,10 +3,10 @@ import yargs from 'yargs' import { hideBin } from 'yargs/helpers' import { run } from './commands/run' import { Logger } from 'tslog' -import { createLogger } from '@plastichub/osr-log' +import { createLogger } from '@polymech/osr-log' import { OptionsSchema, types } from './zod_schema' import { IKBotTask } from './types' -import { toYargs } from '@plastichub/osr-commons' +import { toYargs } from '@polymech/osr-commons' import helpCommand from './commands/help' import { examples } from './commands/examples' import { init } from './commands/init' diff --git a/packages/kbot/src/merge.ts b/packages/kbot/src/merge.ts index 1c0a0d06..abf5e871 100644 --- a/packages/kbot/src/merge.ts +++ b/packages/kbot/src/merge.ts @@ -1,5 +1,5 @@ -import { isString } from '@plastichub/core/primitives' -import { sync as read } from '@plastichub/fs/read' +import { isString } from '@polymech/core/primitives' +import { sync as read } from '@polymech/fs/read' import { logger } from '..' import { deepmerge as merge } from 'deepmerge-ts' export const deepMerge = async (target: string, source: any) => { diff --git a/packages/kbot/src/mime-handlers.ts b/packages/kbot/src/mime-handlers.ts index b41b42bb..662bc094 100644 --- a/packages/kbot/src/mime-handlers.ts +++ b/packages/kbot/src/mime-handlers.ts @@ -1,6 +1,6 @@ import * as path from 'path' import { base64 } from './source' -import { sync as read } from '@plastichub/fs/read' +import { sync as read } from '@polymech/fs/read' import { ChatCompletionUserMessageParam } from 'openai/resources/index.mjs' export type IHandlerResult = ChatCompletionUserMessageParam & diff --git a/packages/kbot/src/models/index.ts b/packages/kbot/src/models/index.ts index 548a8306..7846746f 100644 --- a/packages/kbot/src/models/index.ts +++ b/packages/kbot/src/models/index.ts @@ -1,15 +1,15 @@ import { z } from 'zod' import chalk from 'chalk' import * as path from 'path' -import { resolve } from '@plastichub/osr-commons' -import { sync as read } from '@plastichub/fs/read' -import { sync as exists } from '@plastichub/fs/exists' +import { resolve } from '@polymech/osr-commons' +import { sync as read } from '@polymech/fs/read' +import { sync as exists } from '@polymech/fs/exists' import { logger, module_root } from '../index' import { CACHE_PATH as OPENROUTER_CACHE_PATH, CachedModels as OpenRouterCachedModels, fetchOpenRouterModels, listModelsAsStrings as listOpenRouterModelsAsStrings } from './openrouter' import { CACHE_PATH as OPENAI_CACHE_PATH, CachedModels as OpenAICachedModels, listModelsAsStrings as listOpenAIModelsAsStrings } from './openai' import { fetchOpenAIModels } from '../models/openai' -import { CONFIG_DEFAULT } from '@plastichub/osr-commons' +import { CONFIG_DEFAULT } from '@polymech/osr-commons' import { models as OpenAIModels } from './cache/openai' import { models as OpenRouterModels } from './cache/openrouter' diff --git a/packages/kbot/src/models/openai.ts b/packages/kbot/src/models/openai.ts index 686444c2..7abf8a16 100644 --- a/packages/kbot/src/models/openai.ts +++ b/packages/kbot/src/models/openai.ts @@ -2,10 +2,10 @@ import { OpenAI } from 'openai' import * as fs from 'fs' import * as path from 'path' import { logger } from '../index' -import { sync as dir } from '@plastichub/fs/dir' -import { sync as exists } from '@plastichub/fs/exists' -import { sync as read } from '@plastichub/fs/read' -import { sync as write } from '@plastichub/fs/write' +import { sync as dir } from '@polymech/fs/dir' +import { sync as exists } from '@polymech/fs/exists' +import { sync as read } from '@polymech/fs/read' +import { sync as write } from '@polymech/fs/write' interface OpenAIModel { id: string; diff --git a/packages/kbot/src/models/openrouter.ts b/packages/kbot/src/models/openrouter.ts index 540b4d20..b709a779 100644 --- a/packages/kbot/src/models/openrouter.ts +++ b/packages/kbot/src/models/openrouter.ts @@ -1,10 +1,10 @@ import axios from 'axios' import * as path from 'path'; import { logger } from '../index' -import { sync as dir } from '@plastichub/fs/dir' -import { sync as exists } from '@plastichub/fs/exists' -import { sync as read } from '@plastichub/fs/read' -import { sync as write } from '@plastichub/fs/write' +import { sync as dir } from '@polymech/fs/dir' +import { sync as exists } from '@polymech/fs/exists' +import { sync as read } from '@polymech/fs/read' +import { sync as write } from '@polymech/fs/write' interface ModelPricing { prompt: number; diff --git a/packages/kbot/src/profile.ts b/packages/kbot/src/profile.ts index 76f3ada1..29e363dc 100644 --- a/packages/kbot/src/profile.ts +++ b/packages/kbot/src/profile.ts @@ -1,8 +1,8 @@ import { IKBotTask } from "./types" -import { isFile, resolve } from '@plastichub/osr-commons' -import { sync as exists } from '@plastichub/fs/exists' +import { isFile, resolve } from '@polymech/osr-commons' +import { sync as exists } from '@polymech/fs/exists' import * as path from 'node:path' -import { IProfile, parseProfile } from '@plastichub/osr-commons/profile' +import { IProfile, parseProfile } from '@polymech/commons/profile' import { env_vars } from './utils/env' const testPath = (profilePath: string) => { diff --git a/packages/kbot/src/prompt.ts b/packages/kbot/src/prompt.ts index c7486afb..b4e4c82e 100644 --- a/packages/kbot/src/prompt.ts +++ b/packages/kbot/src/prompt.ts @@ -1,9 +1,9 @@ -import { IKBotTask } from '@plastichub/osr-ai-tools/types' +import { IKBotTask } from '@polymech/osr-ai-tools/types' import { resolveQuery } from './utils/input' import { ChatCompletionMessageParam } from 'openai/resources/index.mjs' -import { sync as read } from '@plastichub/fs/read' -import { sync as exists } from '@plastichub/fs/exists' -import { resolve } from '@plastichub/osr-commons' +import { sync as read } from '@polymech/fs/read' +import { sync as exists } from '@polymech/fs/exists' +import { resolve } from '@polymech/osr-commons' import * as path from 'path' import { env_vars } from './utils/env' import { PREFERENCES_FILE_NAME } from './constants' diff --git a/packages/kbot/src/source.ts b/packages/kbot/src/source.ts index 7c057f84..8e58680c 100644 --- a/packages/kbot/src/source.ts +++ b/packages/kbot/src/source.ts @@ -1,11 +1,11 @@ import * as path from 'path' import * as fs from 'fs' -import { sync as read } from '@plastichub/fs/read' -import { sync as dir } from '@plastichub/fs/dir' -import { createItem as toNode } from '@plastichub/fs/inspect' -import { INode } from '@plastichub/fs/interfaces' -import { sync as exists } from '@plastichub/fs/exists' -import { isFile, forward_slash } from '@plastichub/osr-commons' +import { sync as read } from '@polymech/fs/read' +import { sync as dir } from '@polymech/fs/dir' +import { createItem as toNode } from '@polymech/fs/inspect' +import { INode } from '@polymech/fs/interfaces' +import { sync as exists } from '@polymech/fs/exists' +import { isFile, forward_slash } from '@polymech/osr-commons' import { logger } from './index' import { lookup } from 'mime-types' import { globSync } from 'glob' diff --git a/packages/kbot/src/tools.ts b/packages/kbot/src/tools.ts index 0d255027..d6383806 100644 --- a/packages/kbot/src/tools.ts +++ b/packages/kbot/src/tools.ts @@ -1,10 +1,10 @@ import { ChatCompletionMessageParam } from "openai/resources/chat/completions" -import { resolve } from '@plastichub/osr-commons' -import { } from '@plastichub/osr-commons/config' -import { sync as exists } from '@plastichub/fs/exists' +import { resolve } from '@polymech/osr-commons' +import { } from '@polymech/commons/config' +import { sync as exists } from '@polymech/fs/exists' import * as path from 'node:path' -import { tools as defaultTools } from "@plastichub/osr-ai-tools/lib/tools/tools" +import { tools as defaultTools } from "@polymech/osr-ai-tools/lib/tools/tools" import { logger } from './index' import { IKBotOptions } from './zod_types' import { RunnableToolFunctionWithParse } from "openai/lib/RunnableFunction" diff --git a/packages/kbot/src/types.ts b/packages/kbot/src/types.ts index 6fe950de..726126cc 100644 --- a/packages/kbot/src/types.ts +++ b/packages/kbot/src/types.ts @@ -6,7 +6,7 @@ export type onMessage = (category: string, name: string, args: any, result?: any import { IKBotOptions } from './zod_types' import OpenAI from 'openai' -import { ICollector } from '@plastichub/osr-ai-tools/types' +import { ICollector } from '@polymech/osr-ai-tools/types' export interface IKBotTask extends IKBotOptions { diff --git a/packages/kbot/src/utils/__tests__/file.test.ts b/packages/kbot/src/utils/__tests__/file.test.ts index 263b48fc..02faf031 100644 --- a/packages/kbot/src/utils/__tests__/file.test.ts +++ b/packages/kbot/src/utils/__tests__/file.test.ts @@ -1,13 +1,13 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { readProjectFiles } from '../file' -import { sync as dir } from '@plastichub/fs/dir' -import { sync as exists } from '@plastichub/fs/exists' -import { filesEx } from '@plastichub/osr-commons/_glob' +import { sync as dir } from '@polymech/fs/dir' +import { sync as exists } from '@polymech/fs/exists' +import { filesEx } from '@polymech/commons/_glob' -vi.mock('@plastichub/fs/dir') -vi.mock('@plastichub/fs/exists') -vi.mock('@plastichub/osr-commons/_glob') -vi.mock('@plastichub/fs/read') +vi.mock('@polymech/fs/dir') +vi.mock('@polymech/fs/exists') +vi.mock('@polymech/commons/_glob') +vi.mock('@polymech/fs/read') vi.mock('path', async () => { const actual = await vi.importActual('path') return { diff --git a/packages/kbot/src/utils/__tests__/input.test.ts b/packages/kbot/src/utils/__tests__/input.test.ts index 075421f5..e4e8ad07 100644 --- a/packages/kbot/src/utils/__tests__/input.test.ts +++ b/packages/kbot/src/utils/__tests__/input.test.ts @@ -1,12 +1,12 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { resolveQuery, readStdin } from '../input' import { detectAndHandle } from '../../commands/handlers' -import { sync as exists } from '@plastichub/fs/exists' -import { sync as read } from '@plastichub/fs/read' +import { sync as exists } from '@polymech/fs/exists' +import { sync as read } from '@polymech/fs/read' import * as path from 'path' -vi.mock('@plastichub/fs/exists') -vi.mock('@plastichub/fs/read') +vi.mock('@polymech/fs/exists') +vi.mock('@polymech/fs/read') vi.mock('../../commands/handlers') vi.mock('path', async () => { const actual = await vi.importActual('path') diff --git a/packages/kbot/src/utils/__tests__/script.test.ts b/packages/kbot/src/utils/__tests__/script.test.ts index ddca6ea7..05c54c39 100644 --- a/packages/kbot/src/utils/__tests__/script.test.ts +++ b/packages/kbot/src/utils/__tests__/script.test.ts @@ -1,9 +1,9 @@ import { describe, it, expect, vi, beforeAll, afterAll } from 'vitest' import { dumpAsScript } from '../script' -import { sync as write } from '@plastichub/fs/write' +import { sync as write } from '@polymech/fs/write' import * as path from 'path' -vi.mock('@plastichub/fs/write') +vi.mock('@polymech/fs/write') vi.mock('path', async () => { const actual = await vi.importActual('path') return { diff --git a/packages/kbot/src/utils/array.ts b/packages/kbot/src/utils/array.ts index cf60b6b4..6ee80355 100644 --- a/packages/kbot/src/utils/array.ts +++ b/packages/kbot/src/utils/array.ts @@ -1,4 +1,4 @@ -import { isString } from '@plastichub/core/primitives' +import { isString } from '@polymech/core/primitives' export const flatten = (value: string | string[] | undefined): string[] => { let initialArray: string[] diff --git a/packages/kbot/src/utils/input.ts b/packages/kbot/src/utils/input.ts index 75e2e042..5017d376 100644 --- a/packages/kbot/src/utils/input.ts +++ b/packages/kbot/src/utils/input.ts @@ -1,7 +1,7 @@ import * as path from 'path' -import { sync as exists } from '@plastichub/fs/exists' -import { sync as read } from '@plastichub/fs/read' -import { resolve, isFile } from '@plastichub/osr-commons' +import { sync as exists } from '@polymech/fs/exists' +import { sync as read } from '@polymech/fs/read' +import { resolve, isFile } from '@polymech/osr-commons' import { detectAndHandle } from '../commands/handlers' import { logger } from '../index' import { IKBotOptions } from '../zod_types' diff --git a/packages/kbot/src/utils/script.ts b/packages/kbot/src/utils/script.ts index a4995347..483c7d82 100644 --- a/packages/kbot/src/utils/script.ts +++ b/packages/kbot/src/utils/script.ts @@ -1,6 +1,6 @@ import * as path from 'path' -import { sync as write } from '@plastichub/fs/write' -import { resolve } from '@plastichub/osr-commons' +import { sync as write } from '@polymech/fs/write' +import { resolve } from '@polymech/osr-commons' import { IKBotOptions } from '../zod_types' export const dumpAsScript = async (opts: IKBotOptions) => { diff --git a/packages/kbot/src/variables.ts b/packages/kbot/src/variables.ts index 945aa0bf..64c942a6 100644 --- a/packages/kbot/src/variables.ts +++ b/packages/kbot/src/variables.ts @@ -1,16 +1,16 @@ import * as path from 'path' -import { pathInfoEx, resolve } from '@plastichub/osr-commons' -import { resolveConfig } from '@plastichub/core' -import { isString } from '@plastichub/core/primitives' -import { pathInfo, DEFAULT_ROOTS, DEFAULT_VARS } from '@plastichub/osr-commons' +import { pathInfoEx, resolve } from '@polymech/osr-commons' +import { resolveConfig } from '@polymech/core' +import { isString } from '@polymech/core/primitives' +import { pathInfo, DEFAULT_ROOTS, DEFAULT_VARS } from '@polymech/osr-commons' import * as fs from 'fs' -import { sync as read } from '@plastichub/fs/read' -import { sync as dir } from '@plastichub/fs/dir' -import { createItem as toNode } from '@plastichub/fs/inspect' -import { INode } from '@plastichub/fs/interfaces' -import { sync as exists } from '@plastichub/fs/exists' -import { isFile, forward_slash } from '@plastichub/osr-commons' +import { sync as read } from '@polymech/fs/read' +import { sync as dir } from '@polymech/fs/dir' +import { createItem as toNode } from '@polymech/fs/inspect' +import { INode } from '@polymech/fs/interfaces' +import { sync as exists } from '@polymech/fs/exists' +import { isFile, forward_slash } from '@polymech/osr-commons' import { logger } from './index' import { lookup } from 'mime-types' import { globSync } from 'glob' diff --git a/packages/kbot/src/zod_schema.ts b/packages/kbot/src/zod_schema.ts index 537cbbe6..6ae3e9fa 100644 --- a/packages/kbot/src/zod_schema.ts +++ b/packages/kbot/src/zod_schema.ts @@ -2,10 +2,10 @@ import { z } from 'zod' import * as path from 'path' import chalk from 'chalk' import * as env from 'env-var' -import { sync as writeFS } from '@plastichub/fs/write' -import { resolve } from '@plastichub/osr-commons' -import { generate_interfaces, write, ZodMetaMap } from '@plastichub/osr-commons' -import { isString } from '@plastichub/core/primitives' +import { sync as writeFS } from '@polymech/fs/write' +import { resolve } from '@polymech/osr-commons' +import { generate_interfaces, write, ZodMetaMap } from '@polymech/osr-commons' +import { isString } from '@polymech/core/primitives' import { API_PREFIX, LOGGING_DIRECTORY, PREFERENCES_FILE_NAME } from './constants' diff --git a/packages/kbot/tsconfig.json b/packages/kbot/tsconfig.json index ea9cad5c..62737952 100644 --- a/packages/kbot/tsconfig.json +++ b/packages/kbot/tsconfig.json @@ -1,11 +1,7 @@ { + "extends": "../typescript-config/base.json", "compilerOptions": { - "target": "ES2020", - "module": "CommonJS", - "esModuleInterop": true, - "strict": false, - "skipLibCheck": true, - "outDir": "./", + "outDir": "./dist-in", "rootDir": "src", "lib": [ "es2015", @@ -18,7 +14,9 @@ "importHelpers": false, "inlineSourceMap": true }, - "exclude":["node_modules/**/*"], + "exclude": [ + "node_modules/**/*" + ], "filesGlob": [ "./src/**/*.ts" ], @@ -26,4 +24,9 @@ "src/main.ts", "src/index.ts" ], + "paths": { + "@/*": [ + "src/*" + ] + } } \ No newline at end of file