fix(aidocs, config): migrate aidocs configuration handling from npmextra to smartconfig
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-24 - 2.0.1 - fix(aidocs, config)
|
||||||
|
migrate aidocs configuration handling from npmextra to smartconfig
|
||||||
|
|
||||||
|
- replace the @push.rocks/npmextra dependency with @push.rocks/smartconfig
|
||||||
|
- load project metadata from smartconfig.json instead of npmextra.json in aidocs workflows
|
||||||
|
- move user key-value store paths from ~/.npmextra to ~/.smartconfig and preserve existing OPENAI_TOKEN data through migration
|
||||||
|
|
||||||
## 2026-03-11 - 2.0.0 - BREAKING CHANGE(aidoc)
|
## 2026-03-11 - 2.0.0 - BREAKING CHANGE(aidoc)
|
||||||
migrate agent orchestration to new runAgent API and filesystem tools; refactor model handling and update README and tests
|
migrate agent orchestration to new runAgent API and filesystem tools; refactor model handling and update README and tests
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@git.zone/tspublish": "^1.11.2",
|
"@git.zone/tspublish": "^1.11.2",
|
||||||
"@push.rocks/early": "^4.0.4",
|
"@push.rocks/early": "^4.0.4",
|
||||||
"@push.rocks/npmextra": "^5.3.3",
|
"@push.rocks/smartconfig": "^6.0.0",
|
||||||
"@push.rocks/qenv": "^6.1.3",
|
"@push.rocks/qenv": "^6.1.3",
|
||||||
"@push.rocks/smartagent": "^3.0.2",
|
"@push.rocks/smartagent": "^3.0.2",
|
||||||
"@push.rocks/smartai": "^2.0.0",
|
"@push.rocks/smartai": "^2.0.0",
|
||||||
|
|||||||
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@@ -14,14 +14,11 @@ importers:
|
|||||||
'@push.rocks/early':
|
'@push.rocks/early':
|
||||||
specifier: ^4.0.4
|
specifier: ^4.0.4
|
||||||
version: 4.0.4
|
version: 4.0.4
|
||||||
'@push.rocks/npmextra':
|
|
||||||
specifier: ^5.3.3
|
|
||||||
version: 5.3.3
|
|
||||||
'@push.rocks/qenv':
|
'@push.rocks/qenv':
|
||||||
specifier: ^6.1.3
|
specifier: ^6.1.3
|
||||||
version: 6.1.3
|
version: 6.1.3
|
||||||
'@push.rocks/smartagent':
|
'@push.rocks/smartagent':
|
||||||
specifier: 3.0.2
|
specifier: ^3.0.2
|
||||||
version: 3.0.2(typescript@5.9.3)(ws@8.19.0)
|
version: 3.0.2(typescript@5.9.3)(ws@8.19.0)
|
||||||
'@push.rocks/smartai':
|
'@push.rocks/smartai':
|
||||||
specifier: ^2.0.0
|
specifier: ^2.0.0
|
||||||
@@ -29,6 +26,9 @@ importers:
|
|||||||
'@push.rocks/smartcli':
|
'@push.rocks/smartcli':
|
||||||
specifier: ^4.0.20
|
specifier: ^4.0.20
|
||||||
version: 4.0.20
|
version: 4.0.20
|
||||||
|
'@push.rocks/smartconfig':
|
||||||
|
specifier: ^6.0.0
|
||||||
|
version: 6.0.0
|
||||||
'@push.rocks/smartdelay':
|
'@push.rocks/smartdelay':
|
||||||
specifier: ^3.0.5
|
specifier: ^3.0.5
|
||||||
version: 3.0.5
|
version: 3.0.5
|
||||||
@@ -1249,6 +1249,9 @@ packages:
|
|||||||
'@push.rocks/smartclickhouse@2.0.17':
|
'@push.rocks/smartclickhouse@2.0.17':
|
||||||
resolution: {integrity: sha512-IYO8Obor/Ruam2KQ2B/+5uQ+rL0exU5KZoSgOc3jkkrfjn+zZenN2xoV8lVqavAtxZVfG7MfxFrcv6I7I9ZMmA==}
|
resolution: {integrity: sha512-IYO8Obor/Ruam2KQ2B/+5uQ+rL0exU5KZoSgOc3jkkrfjn+zZenN2xoV8lVqavAtxZVfG7MfxFrcv6I7I9ZMmA==}
|
||||||
|
|
||||||
|
'@push.rocks/smartconfig@6.0.0':
|
||||||
|
resolution: {integrity: sha512-ohXwJdbDXV2budErnZKWBOz01YkjP6gJsZ7QM9+6Wsh+r7O1CVT3JpV+mD8xJWy5tZRHI+3B9L8z0+WkIDtKzw==}
|
||||||
|
|
||||||
'@push.rocks/smartcrypto@2.0.4':
|
'@push.rocks/smartcrypto@2.0.4':
|
||||||
resolution: {integrity: sha512-1+/5bsjyataf5uUkUNnnVXGRAt+gHVk1KDzozjTqgqJxHvQk1d9fVDohL6CxUhUucTPtu5VR5xNBiV8YCDuGyw==}
|
resolution: {integrity: sha512-1+/5bsjyataf5uUkUNnnVXGRAt+gHVk1KDzozjTqgqJxHvQk1d9fVDohL6CxUhUucTPtu5VR5xNBiV8YCDuGyw==}
|
||||||
|
|
||||||
@@ -6114,6 +6117,23 @@ snapshots:
|
|||||||
'@push.rocks/smarturl': 3.1.0
|
'@push.rocks/smarturl': 3.1.0
|
||||||
'@push.rocks/webrequest': 3.0.37
|
'@push.rocks/webrequest': 3.0.37
|
||||||
|
|
||||||
|
'@push.rocks/smartconfig@6.0.0':
|
||||||
|
dependencies:
|
||||||
|
'@push.rocks/qenv': 6.1.3
|
||||||
|
'@push.rocks/smartfile': 11.2.7
|
||||||
|
'@push.rocks/smartjson': 5.2.0
|
||||||
|
'@push.rocks/smartlog': 3.2.1
|
||||||
|
'@push.rocks/smartpath': 6.0.0
|
||||||
|
'@push.rocks/smartpromise': 4.2.3
|
||||||
|
'@push.rocks/smartrx': 3.0.10
|
||||||
|
'@push.rocks/taskbuffer': 3.5.0
|
||||||
|
'@tsclass/tsclass': 9.3.0
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- '@nuxt/kit'
|
||||||
|
- react
|
||||||
|
- supports-color
|
||||||
|
- vue
|
||||||
|
|
||||||
'@push.rocks/smartcrypto@2.0.4':
|
'@push.rocks/smartcrypto@2.0.4':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@push.rocks/smartpromise': 4.2.3
|
'@push.rocks/smartpromise': 4.2.3
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tsdoc',
|
name: '@git.zone/tsdoc',
|
||||||
version: '2.0.0',
|
version: '2.0.1',
|
||||||
description: 'A comprehensive TypeScript documentation tool that leverages AI to generate and enhance project documentation, including dynamic README creation, API docs via TypeDoc, and smart commit message generation.'
|
description: 'A comprehensive TypeScript documentation tool that leverages AI to generate and enhance project documentation, including dynamic README creation, API docs via TypeDoc, and smart commit message generation.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,15 +79,15 @@ Don't wrap the JSON in \`\`\`json\`\`\` - just return the raw JSON object.
|
|||||||
const projectContext = new ProjectContext(this.projectDir);
|
const projectContext = new ProjectContext(this.projectDir);
|
||||||
const files = await projectContext.gatherFiles();
|
const files = await projectContext.gatherFiles();
|
||||||
|
|
||||||
// Update npmextra.json
|
// Update smartconfig.json
|
||||||
const npmextraJson = files.smartfilesNpmextraJSON;
|
const smartconfigJson = files.smartfilesNpmextraJSON;
|
||||||
const npmextraJsonContent = JSON.parse(npmextraJson.contents.toString());
|
const smartconfigJsonContent = JSON.parse(smartconfigJson.contents.toString());
|
||||||
|
|
||||||
npmextraJsonContent['@git.zone/cli'].module.description = resultObject.description;
|
smartconfigJsonContent['@git.zone/cli'].module.description = resultObject.description;
|
||||||
npmextraJsonContent['@git.zone/cli'].module.keywords = resultObject.keywords;
|
smartconfigJsonContent['@git.zone/cli'].module.keywords = resultObject.keywords;
|
||||||
|
|
||||||
npmextraJson.contents = Buffer.from(JSON.stringify(npmextraJsonContent, null, 2));
|
smartconfigJson.contents = Buffer.from(JSON.stringify(smartconfigJsonContent, null, 2));
|
||||||
await npmextraJson.write();
|
await smartconfigJson.write();
|
||||||
|
|
||||||
// Update package.json
|
// Update package.json
|
||||||
const packageJson = files.smartfilePackageJSON;
|
const packageJson = files.smartfilePackageJSON;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export class ProjectContext {
|
|||||||
this.projectDir,
|
this.projectDir,
|
||||||
);
|
);
|
||||||
const smartfilesNpmextraJSON = await plugins.smartfileFactory.fromFilePath(
|
const smartfilesNpmextraJSON = await plugins.smartfileFactory.fromFilePath(
|
||||||
plugins.path.join(this.projectDir, 'npmextra.json'),
|
plugins.path.join(this.projectDir, 'smartconfig.json'),
|
||||||
this.projectDir,
|
this.projectDir,
|
||||||
);
|
);
|
||||||
const smartfilesMod = await plugins.smartfileFactory.virtualDirectoryFromPath(
|
const smartfilesMod = await plugins.smartfileFactory.virtualDirectoryFromPath(
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ export class Readme {
|
|||||||
|
|
||||||
// First check legal info before introducing any cost
|
// First check legal info before introducing any cost
|
||||||
const projectContext = new ProjectContext(this.projectDir);
|
const projectContext = new ProjectContext(this.projectDir);
|
||||||
const npmExtraJson = JSON.parse(
|
const smartconfigJson = JSON.parse(
|
||||||
(await projectContext.gatherFiles()).smartfilesNpmextraJSON.contents.toString()
|
(await projectContext.gatherFiles()).smartfilesNpmextraJSON.contents.toString()
|
||||||
);
|
);
|
||||||
const legalInfo = npmExtraJson?.['@git.zone/tsdoc']?.legal;
|
const legalInfo = smartconfigJson?.['@git.zone/tsdoc']?.legal;
|
||||||
if (!legalInfo) {
|
if (!legalInfo) {
|
||||||
const error = new Error(`No legal information found in npmextra.json`);
|
const error = new Error(`No legal information found in smartconfig.json`);
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import * as aiDocsClasses from './aidocs_classes/index.js';
|
|||||||
export class AiDoc {
|
export class AiDoc {
|
||||||
private openaiToken: string;
|
private openaiToken: string;
|
||||||
|
|
||||||
public npmextraKV: plugins.npmextra.KeyValueStore;
|
public smartconfigKV: plugins.npmextra.KeyValueStore;
|
||||||
public qenvInstance: plugins.qenv.Qenv;
|
public qenvInstance: plugins.qenv.Qenv;
|
||||||
public aidocInteract: plugins.smartinteract.SmartInteract;
|
public aidocInteract: plugins.smartinteract.SmartInteract;
|
||||||
public model: plugins.smartai.LanguageModelV3;
|
public model: plugins.smartai.LanguageModelV3;
|
||||||
@@ -38,8 +38,8 @@ export class AiDoc {
|
|||||||
if (!(await this.qenvInstance.getEnvVarOnDemand('OPENAI_TOKEN'))) {
|
if (!(await this.qenvInstance.getEnvVarOnDemand('OPENAI_TOKEN'))) {
|
||||||
// Migrate old KV store path to new path if needed
|
// Migrate old KV store path to new path if needed
|
||||||
const homeDir = plugins.smartpath.get.home();
|
const homeDir = plugins.smartpath.get.home();
|
||||||
const oldKvPath = plugins.path.join(homeDir, '.npmextra/kv/tsdoc.json');
|
const oldKvPath = plugins.path.join(homeDir, '.smartconfig/kv/tsdoc.json');
|
||||||
const newKvDir = plugins.path.join(homeDir, '.npmextra/kv/@git.zone');
|
const newKvDir = plugins.path.join(homeDir, '.smartconfig/kv/@git.zone');
|
||||||
const newKvPath = plugins.path.join(newKvDir, 'tsdoc.json');
|
const newKvPath = plugins.path.join(newKvDir, 'tsdoc.json');
|
||||||
if (
|
if (
|
||||||
await plugins.fsInstance.file(oldKvPath).exists() &&
|
await plugins.fsInstance.file(oldKvPath).exists() &&
|
||||||
@@ -52,13 +52,13 @@ export class AiDoc {
|
|||||||
console.log('Migration complete: tsdoc.json -> @git.zone/tsdoc.json');
|
console.log('Migration complete: tsdoc.json -> @git.zone/tsdoc.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.npmextraKV = new plugins.npmextra.KeyValueStore({
|
this.smartconfigKV = new plugins.npmextra.KeyValueStore({
|
||||||
typeArg: 'userHomeDir',
|
typeArg: 'userHomeDir',
|
||||||
identityArg: '@git.zone/tsdoc',
|
identityArg: '@git.zone/tsdoc',
|
||||||
mandatoryKeys: ['OPENAI_TOKEN'],
|
mandatoryKeys: ['OPENAI_TOKEN'],
|
||||||
});
|
});
|
||||||
|
|
||||||
const missingKeys = await this.npmextraKV.getMissingMandatoryKeys();
|
const missingKeys = await this.smartconfigKV.getMissingMandatoryKeys();
|
||||||
if (missingKeys.length > 0) {
|
if (missingKeys.length > 0) {
|
||||||
// lets try argv
|
// lets try argv
|
||||||
if (this.argvArg?.OPENAI_TOKEN) {
|
if (this.argvArg?.OPENAI_TOKEN) {
|
||||||
@@ -77,11 +77,11 @@ export class AiDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.printSanitizedToken();
|
this.printSanitizedToken();
|
||||||
await this.npmextraKV.writeKey('OPENAI_TOKEN', this.openaiToken);
|
await this.smartconfigKV.writeKey('OPENAI_TOKEN', this.openaiToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.openaiToken && this.npmextraKV) {
|
if (!this.openaiToken && this.smartconfigKV) {
|
||||||
this.openaiToken = await this.npmextraKV.readKey('OPENAI_TOKEN');
|
this.openaiToken = await this.smartconfigKV.readKey('OPENAI_TOKEN');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create model using getModel()
|
// Create model using getModel()
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as path from 'path';
|
|||||||
export { path };
|
export { path };
|
||||||
|
|
||||||
// pushrocks scope
|
// pushrocks scope
|
||||||
import * as npmextra from '@push.rocks/npmextra';
|
import * as npmextra from '@push.rocks/smartconfig';
|
||||||
import * as qenv from '@push.rocks/qenv';
|
import * as qenv from '@push.rocks/qenv';
|
||||||
import * as smartagent from '@push.rocks/smartagent';
|
import * as smartagent from '@push.rocks/smartagent';
|
||||||
import * as smartagentTools from '@push.rocks/smartagent/tools';
|
import * as smartagentTools from '@push.rocks/smartagent/tools';
|
||||||
|
|||||||
Reference in New Issue
Block a user