switch to typescript
This commit is contained in:
60
README.md
60
README.md
@@ -74,10 +74,10 @@ import {
|
||||
WorkflowFunctionManifold,
|
||||
ManifoldRegion,
|
||||
WorkflowOperator,
|
||||
DummyIntentService,
|
||||
DummyIntentMap,
|
||||
} from 'workflow-function-manifold';
|
||||
|
||||
const llm = new DummyIntentService();
|
||||
const llm = new DummyIntentMap();
|
||||
const manifold = new WorkflowFunctionManifold(llm);
|
||||
|
||||
const analysisOperator = new WorkflowOperator('analysis', async state => ({
|
||||
@@ -93,7 +93,7 @@ await manifold.navigate('analyze the data');
|
||||
await manifold.executeWorkflow('analyze the data');
|
||||
```
|
||||
|
||||
> **Note:** `DummyIntentService` uses basic keyword matching. Include keywords like `'analyze'`, `'process'`, or `'transform'` for default operators to work.
|
||||
> **Note:** `DummyIntentMap` uses basic keyword matching. Include keywords like `'analyze'`, `'process'`, or `'transform'` for default operators to work.
|
||||
|
||||
## Core Components
|
||||
|
||||
@@ -126,12 +126,12 @@ Defines an operation that can be executed within a region.
|
||||
const operator = new WorkflowOperator('operatorName', async state => newState);
|
||||
```
|
||||
|
||||
### `DummyIntentService`
|
||||
### `DummyIntentMap`
|
||||
|
||||
A basic intent-matching service.
|
||||
|
||||
```javascript
|
||||
const intentService = new DummyIntentService();
|
||||
const intentService = new DummyIntentMap();
|
||||
const intent = await intentService.query('analyze the data');
|
||||
```
|
||||
|
||||
@@ -141,36 +141,36 @@ Here's a complete workflow demonstration:
|
||||
|
||||
```javascript
|
||||
async function createWorkflow() {
|
||||
const intentService = new DummyIntentService();
|
||||
const manifold = new WorkflowFunctionManifold(intentService);
|
||||
const intentService = new DummyIntentMap();
|
||||
const manifold = new WorkflowFunctionManifold(intentService);
|
||||
|
||||
const analysisOp = new WorkflowOperator('analysis', async state => ({
|
||||
...state,
|
||||
analyzed: true,
|
||||
}));
|
||||
const analysisOp = new WorkflowOperator('analysis', async state => ({
|
||||
...state,
|
||||
analyzed: true,
|
||||
}));
|
||||
|
||||
const processingOp = new WorkflowOperator('processing', async state => ({
|
||||
...state,
|
||||
processed: true,
|
||||
}));
|
||||
const processingOp = new WorkflowOperator('processing', async state => ({
|
||||
...state,
|
||||
processed: true,
|
||||
}));
|
||||
|
||||
const transformOp = new WorkflowOperator('transformation', async state => ({
|
||||
...state,
|
||||
transformed: true,
|
||||
}));
|
||||
const transformOp = new WorkflowOperator('transformation', async state => ({
|
||||
...state,
|
||||
transformed: true,
|
||||
}));
|
||||
|
||||
const analysisRegion = new ManifoldRegion('analysis', [analysisOp]);
|
||||
const processingRegion = new ManifoldRegion('processing', [processingOp]);
|
||||
const transformRegion = new ManifoldRegion('transformation', [transformOp]);
|
||||
const analysisRegion = new ManifoldRegion('analysis', [analysisOp]);
|
||||
const processingRegion = new ManifoldRegion('processing', [processingOp]);
|
||||
const transformRegion = new ManifoldRegion('transformation', [transformOp]);
|
||||
|
||||
analysisRegion.connectTo(processingRegion);
|
||||
processingRegion.connectTo(transformRegion);
|
||||
analysisRegion.connectTo(processingRegion);
|
||||
processingRegion.connectTo(transformRegion);
|
||||
|
||||
manifold.addRegion(analysisRegion);
|
||||
manifold.addRegion(processingRegion);
|
||||
manifold.addRegion(transformRegion);
|
||||
manifold.addRegion(analysisRegion);
|
||||
manifold.addRegion(processingRegion);
|
||||
manifold.addRegion(transformRegion);
|
||||
|
||||
return manifold;
|
||||
return manifold;
|
||||
}
|
||||
|
||||
const manifold = await createWorkflow();
|
||||
@@ -178,8 +178,8 @@ const manifold = await createWorkflow();
|
||||
const prompts = ['analyze the data', 'process the results', 'transform the output'];
|
||||
|
||||
for (const prompt of prompts) {
|
||||
await manifold.navigate(prompt);
|
||||
await manifold.executeWorkflow(prompt);
|
||||
await manifold.navigate(prompt);
|
||||
await manifold.executeWorkflow(prompt);
|
||||
}
|
||||
```
|
||||
|
||||
|
78
bin.js
78
bin.js
@@ -1,78 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import {
|
||||
DummyIntentService,
|
||||
ManifoldRegion,
|
||||
WorkflowFunctionManifold,
|
||||
WorkflowOperator,
|
||||
NestedManifoldRegion,
|
||||
} from './lib.js';
|
||||
|
||||
async function demonstrateNestedManifold() {
|
||||
const nestedIntentService = new DummyIntentService();
|
||||
const nestedManifold = new WorkflowFunctionManifold(nestedIntentService);
|
||||
|
||||
const validateOp = new WorkflowOperator('validation', async state => {
|
||||
return { ...state, validated: true };
|
||||
});
|
||||
const cleanOp = new WorkflowOperator('cleaning', async state => {
|
||||
return { ...state, cleaned: true };
|
||||
});
|
||||
|
||||
const validateRegion = new ManifoldRegion('validation', [validateOp]);
|
||||
const cleanRegion = new ManifoldRegion('cleaning', [cleanOp]);
|
||||
|
||||
validateRegion.connectTo(cleanRegion);
|
||||
nestedManifold.addRegion(validateRegion);
|
||||
nestedManifold.addRegion(cleanRegion);
|
||||
|
||||
const mainIntentService = new DummyIntentService();
|
||||
const mainManifold = new WorkflowFunctionManifold(mainIntentService);
|
||||
|
||||
const analysisOp = new WorkflowOperator('analysis', async state => {
|
||||
return { ...state, analyzed: true };
|
||||
});
|
||||
const transformOp = new WorkflowOperator('transformation', async state => {
|
||||
return { ...state, transformed: true };
|
||||
});
|
||||
|
||||
const nestedPreprocessRegion = new NestedManifoldRegion('preprocessing', nestedManifold);
|
||||
const analysisRegion = new ManifoldRegion('analysis', [analysisOp]);
|
||||
const transformRegion = new ManifoldRegion('transformation', [transformOp]);
|
||||
|
||||
nestedPreprocessRegion.connectTo(analysisRegion);
|
||||
analysisRegion.connectTo(transformRegion);
|
||||
|
||||
mainManifold.addRegion(nestedPreprocessRegion);
|
||||
mainManifold.addRegion(analysisRegion);
|
||||
mainManifold.addRegion(transformRegion);
|
||||
|
||||
const prompts = [
|
||||
{ text: 'validate the input', description: 'Nested: Data Validation' },
|
||||
{ text: 'clean the data', description: 'Nested: Data Cleaning' },
|
||||
{ text: 'analyze the results', description: 'Main: Data Analysis' },
|
||||
{ text: 'transform the output', description: 'Main: Data Transformation' },
|
||||
];
|
||||
|
||||
for (const { text, description } of prompts) {
|
||||
try {
|
||||
const navigated = await mainManifold.navigate(text);
|
||||
if (navigated) {
|
||||
console.log(`📍 Step: ${description}`);
|
||||
}
|
||||
const executed = await mainManifold.executeWorkflow(text);
|
||||
if (executed) {
|
||||
console.log(`✅ Execution complete`);
|
||||
} else {
|
||||
console.log(`⚠️ Execution failed`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`❌ Error: ${error.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
demonstrateNestedManifold().catch(error => {
|
||||
console.error(`❌ Critical Error: ${error.message}`);
|
||||
process.exit(1);
|
||||
});
|
76
cli.ts
Normal file
76
cli.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import {
|
||||
DummyIntentMap,
|
||||
ManifoldRegion,
|
||||
WorkflowFunctionManifold,
|
||||
WorkflowOperator,
|
||||
NestedManifoldRegion,
|
||||
} from '.';
|
||||
|
||||
async function demonstrateNestedManifold() {
|
||||
const nestedIntentService = new DummyIntentMap();
|
||||
const nestedManifold = new WorkflowFunctionManifold(nestedIntentService);
|
||||
|
||||
const validateOp = new WorkflowOperator('validation', async (state: any) => {
|
||||
return { ...state, validated: true };
|
||||
});
|
||||
const cleanOp = new WorkflowOperator('cleaning', async (state: any) => {
|
||||
return { ...state, cleaned: true };
|
||||
});
|
||||
|
||||
const validateRegion = new ManifoldRegion('validation', [validateOp]);
|
||||
const cleanRegion = new ManifoldRegion('cleaning', [cleanOp]);
|
||||
|
||||
validateRegion.connectTo(cleanRegion);
|
||||
nestedManifold.addRegion(validateRegion);
|
||||
nestedManifold.addRegion(cleanRegion);
|
||||
|
||||
const mainIntentService = new DummyIntentMap();
|
||||
const mainManifold = new WorkflowFunctionManifold(mainIntentService);
|
||||
|
||||
const analysisOp = new WorkflowOperator('analysis', async (state: any) => {
|
||||
return { ...state, analyzed: true };
|
||||
});
|
||||
const transformOp = new WorkflowOperator('transformation', async (state: any) => {
|
||||
return { ...state, transformed: true };
|
||||
});
|
||||
|
||||
const nestedPreprocessRegion = new NestedManifoldRegion('preprocessing', nestedManifold);
|
||||
const analysisRegion = new ManifoldRegion('analysis', [analysisOp]);
|
||||
const transformRegion = new ManifoldRegion('transformation', [transformOp]);
|
||||
|
||||
nestedPreprocessRegion.connectTo(analysisRegion);
|
||||
analysisRegion.connectTo(transformRegion);
|
||||
|
||||
mainManifold.addRegion(nestedPreprocessRegion);
|
||||
mainManifold.addRegion(analysisRegion);
|
||||
mainManifold.addRegion(transformRegion);
|
||||
|
||||
const prompts = [
|
||||
{ text: 'validate the input', description: 'Nested: Data Validation' },
|
||||
{ text: 'clean the data', description: 'Nested: Data Cleaning' },
|
||||
{ text: 'analyze the results', description: 'Main: Data Analysis' },
|
||||
{ text: 'transform the output', description: 'Main: Data Transformation' },
|
||||
];
|
||||
|
||||
for (const { text, description } of prompts) {
|
||||
try {
|
||||
const navigated = await mainManifold.navigate(text);
|
||||
if (navigated) {
|
||||
console.log(`📍 Step: ${description}`);
|
||||
}
|
||||
const executed = await mainManifold.executeWorkflow(text);
|
||||
if (executed) {
|
||||
console.log(`✅ Execution complete`);
|
||||
} else {
|
||||
console.log(`⚠️ Execution failed`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`❌ Error: ${error.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
demonstrateNestedManifold().catch(error => {
|
||||
console.error(`❌ Critical Error: ${error.message}`);
|
||||
process.exit(1);
|
||||
});
|
146
index.ts
Normal file
146
index.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
export class DummyIntentMap {
|
||||
async query(prompt: string): Promise<{ confidence: number; action: string }> {
|
||||
const intents: Record<string, { confidence: number; action: string }> = {
|
||||
analyze: { confidence: 0.9, action: 'analysis' },
|
||||
process: { confidence: 0.8, action: 'processing' },
|
||||
transform: { confidence: 0.7, action: 'transformation' },
|
||||
validate: { confidence: 0.85, action: 'validation' },
|
||||
clean: { confidence: 0.85, action: 'cleaning' },
|
||||
};
|
||||
const matchedIntent = Object.entries(intents).find(([key]) =>
|
||||
prompt.toLowerCase().includes(key)
|
||||
);
|
||||
return matchedIntent ? matchedIntent[1] : { confidence: 0.1, action: 'unknown' };
|
||||
}
|
||||
}
|
||||
|
||||
export class WorkflowOperator {
|
||||
name: string;
|
||||
operation: (state: any) => Promise<any>;
|
||||
|
||||
constructor(name: string, operation: (state: any) => Promise<any>) {
|
||||
this.name = name;
|
||||
this.operation = operation;
|
||||
}
|
||||
|
||||
async execute(state: any): Promise<any> {
|
||||
return await this.operation(state);
|
||||
}
|
||||
}
|
||||
|
||||
export class ManifoldRegion {
|
||||
name: string;
|
||||
operators: WorkflowOperator[];
|
||||
adjacentRegions: Set<ManifoldRegion>;
|
||||
|
||||
constructor(name: string, operators: WorkflowOperator[] = []) {
|
||||
this.name = name;
|
||||
this.operators = operators;
|
||||
this.adjacentRegions = new Set<ManifoldRegion>();
|
||||
}
|
||||
|
||||
addOperator(operator: WorkflowOperator): void {
|
||||
this.operators.push(operator);
|
||||
}
|
||||
|
||||
connectTo(region: ManifoldRegion): void {
|
||||
this.adjacentRegions.add(region);
|
||||
region.adjacentRegions.add(this);
|
||||
}
|
||||
|
||||
async getValidOperators(_state: any): Promise<WorkflowOperator[]> {
|
||||
return this.operators;
|
||||
}
|
||||
}
|
||||
|
||||
export class NestedManifoldRegion extends ManifoldRegion {
|
||||
nestedManifold: WorkflowFunctionManifold;
|
||||
|
||||
constructor(name: string, nestedManifold: WorkflowFunctionManifold) {
|
||||
super(name);
|
||||
this.nestedManifold = nestedManifold;
|
||||
}
|
||||
|
||||
async getValidOperators(state: any): Promise<WorkflowOperator[]> {
|
||||
if (!this.nestedManifold.currentRegion) {
|
||||
return [];
|
||||
}
|
||||
return await this.nestedManifold.currentRegion.getValidOperators(state);
|
||||
}
|
||||
|
||||
async navigate(prompt: string): Promise<boolean> {
|
||||
return await this.nestedManifold.navigate(prompt);
|
||||
}
|
||||
|
||||
async executeWorkflow(prompt: string): Promise<boolean> {
|
||||
const result = await this.nestedManifold.executeWorkflow(prompt);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
export class WorkflowFunctionManifold {
|
||||
intentMap: DummyIntentMap;
|
||||
regions: Map<string, ManifoldRegion>;
|
||||
currentRegion: ManifoldRegion | null;
|
||||
state: any;
|
||||
|
||||
constructor(intentMap: DummyIntentMap) {
|
||||
this.intentMap = intentMap;
|
||||
this.regions = new Map<string, ManifoldRegion>();
|
||||
this.currentRegion = null;
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
addRegion(region: ManifoldRegion): void {
|
||||
this.regions.set(region.name, region);
|
||||
if (!this.currentRegion) {
|
||||
this.currentRegion = region;
|
||||
}
|
||||
}
|
||||
|
||||
async navigate(prompt: string): Promise<boolean> {
|
||||
try {
|
||||
if (this.currentRegion instanceof NestedManifoldRegion) {
|
||||
const nestedNavigated = await this.currentRegion.navigate(prompt);
|
||||
if (nestedNavigated) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
const intent = await this.intentMap.query(prompt);
|
||||
if (intent.confidence <= 0.5) {
|
||||
return false;
|
||||
}
|
||||
const nextRegion = Array.from(this.currentRegion.adjacentRegions).find(region =>
|
||||
region.name.toLowerCase().includes(intent.action)
|
||||
);
|
||||
if (nextRegion) {
|
||||
this.currentRegion = nextRegion;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async executeWorkflow(prompt: string): Promise<boolean> {
|
||||
try {
|
||||
if (this.currentRegion instanceof NestedManifoldRegion) {
|
||||
const nestedResult = await this.currentRegion.executeWorkflow(prompt);
|
||||
return nestedResult;
|
||||
}
|
||||
const intent = await this.intentMap.query(prompt);
|
||||
const operators = await this.currentRegion?.getValidOperators(this.state);
|
||||
const matchedOperator = operators.find(op =>
|
||||
op.name.toLowerCase().includes(intent.action)
|
||||
);
|
||||
if (matchedOperator && intent.confidence > 0.5) {
|
||||
this.state = await matchedOperator.execute(this.state);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
43
lib.d.ts
vendored
43
lib.d.ts
vendored
@@ -1,43 +0,0 @@
|
||||
export interface QueryResult {
|
||||
confidence: number;
|
||||
action: string;
|
||||
}
|
||||
export interface IntentService {
|
||||
query(prompt: string): Promise<QueryResult>;
|
||||
}
|
||||
export interface State {
|
||||
[key: string]: any;
|
||||
}
|
||||
export class DummyIntentService implements IntentService {
|
||||
query(prompt: string): Promise<QueryResult>;
|
||||
}
|
||||
export class WorkflowOperator {
|
||||
constructor(name: string, operation: (state: State) => Promise<State>);
|
||||
name: string;
|
||||
execute(state: State): Promise<State>;
|
||||
}
|
||||
export class ManifoldRegion {
|
||||
constructor(name: string, operators?: WorkflowOperator[]);
|
||||
name: string;
|
||||
operators: WorkflowOperator[];
|
||||
adjacentRegions: Set<ManifoldRegion>;
|
||||
addOperator(operator: WorkflowOperator): void;
|
||||
connectTo(region: ManifoldRegion): void;
|
||||
getValidOperators(state: State): Promise<WorkflowOperator[]>;
|
||||
}
|
||||
export class NestedManifoldRegion extends ManifoldRegion {
|
||||
constructor(name: string, nestedManifold: WorkflowFunctionManifold);
|
||||
nestedManifold: WorkflowFunctionManifold;
|
||||
navigate(prompt: string): Promise<boolean>;
|
||||
executeWorkflow(prompt: string): Promise<boolean>;
|
||||
}
|
||||
export class WorkflowFunctionManifold {
|
||||
constructor(intentService: IntentService);
|
||||
intentService: IntentService;
|
||||
regions: Map<string, ManifoldRegion | NestedManifoldRegion>;
|
||||
currentRegion: ManifoldRegion | NestedManifoldRegion | null;
|
||||
state: State;
|
||||
addRegion(region: ManifoldRegion | NestedManifoldRegion): void;
|
||||
navigate(prompt: string): Promise<boolean>;
|
||||
executeWorkflow(prompt: string): Promise<boolean>;
|
||||
}
|
122
lib.js
122
lib.js
@@ -1,122 +0,0 @@
|
||||
export class DummyIntentService {
|
||||
async query(prompt) {
|
||||
const intents = {
|
||||
analyze: { confidence: 0.9, action: 'analysis' },
|
||||
process: { confidence: 0.8, action: 'processing' },
|
||||
transform: { confidence: 0.7, action: 'transformation' },
|
||||
validate: { confidence: 0.85, action: 'validation' },
|
||||
clean: { confidence: 0.85, action: 'cleaning' },
|
||||
};
|
||||
const matchedIntent = Object.entries(intents).find(([key]) =>
|
||||
prompt.toLowerCase().includes(key)
|
||||
);
|
||||
return matchedIntent ? matchedIntent[1] : { confidence: 0.1, action: 'unknown' };
|
||||
}
|
||||
}
|
||||
|
||||
export class WorkflowOperator {
|
||||
constructor(name, operation) {
|
||||
this.name = name;
|
||||
this.operation = operation;
|
||||
}
|
||||
async execute(state) {
|
||||
return await this.operation(state);
|
||||
}
|
||||
}
|
||||
|
||||
export class ManifoldRegion {
|
||||
constructor(name, operators = []) {
|
||||
this.name = name;
|
||||
this.operators = operators;
|
||||
this.adjacentRegions = new Set();
|
||||
}
|
||||
addOperator(operator) {
|
||||
this.operators.push(operator);
|
||||
}
|
||||
connectTo(region) {
|
||||
this.adjacentRegions.add(region);
|
||||
region.adjacentRegions.add(this);
|
||||
}
|
||||
async getValidOperators(_state) {
|
||||
return this.operators;
|
||||
}
|
||||
}
|
||||
|
||||
export class NestedManifoldRegion extends ManifoldRegion {
|
||||
constructor(name, nestedManifold) {
|
||||
super(name);
|
||||
this.nestedManifold = nestedManifold;
|
||||
}
|
||||
async getValidOperators(state) {
|
||||
if (!this.nestedManifold.currentRegion) {
|
||||
return [];
|
||||
}
|
||||
return await this.nestedManifold.currentRegion.getValidOperators(state);
|
||||
}
|
||||
async navigate(prompt) {
|
||||
return await this.nestedManifold.navigate(prompt);
|
||||
}
|
||||
async executeWorkflow(prompt) {
|
||||
const result = await this.nestedManifold.executeWorkflow(prompt);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
export class WorkflowFunctionManifold {
|
||||
constructor(intentService) {
|
||||
this.intentService = intentService;
|
||||
this.regions = new Map();
|
||||
this.currentRegion = null;
|
||||
this.state = {};
|
||||
}
|
||||
addRegion(region) {
|
||||
this.regions.set(region.name, region);
|
||||
if (!this.currentRegion) {
|
||||
this.currentRegion = region;
|
||||
}
|
||||
}
|
||||
async navigate(prompt) {
|
||||
try {
|
||||
if (this.currentRegion instanceof NestedManifoldRegion) {
|
||||
const nestedNavigated = await this.currentRegion.navigate(prompt);
|
||||
if (nestedNavigated) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
const intent = await this.intentService.query(prompt);
|
||||
if (intent.confidence <= 0.5) {
|
||||
return false;
|
||||
}
|
||||
const nextRegion = Array.from(this.currentRegion.adjacentRegions).find(region =>
|
||||
region.name.toLowerCase().includes(intent.action)
|
||||
);
|
||||
if (nextRegion) {
|
||||
this.currentRegion = nextRegion;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async executeWorkflow(prompt) {
|
||||
try {
|
||||
if (this.currentRegion instanceof NestedManifoldRegion) {
|
||||
const nestedResult = await this.currentRegion.executeWorkflow(prompt);
|
||||
return nestedResult;
|
||||
}
|
||||
const intent = await this.intentService.query(prompt);
|
||||
const operators = await this.currentRegion.getValidOperators(this.state);
|
||||
const matchedOperator = operators.find(op =>
|
||||
op.name.toLowerCase().includes(intent.action)
|
||||
);
|
||||
if (matchedOperator && intent.confidence > 0.5) {
|
||||
this.state = await matchedOperator.execute(this.state);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@@ -16,7 +16,9 @@
|
||||
"workflow-function-manifold": "./bin.js"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"start": "node bin.js",
|
||||
"dev": "node bin.js",
|
||||
"cli": "bun cli.ts",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
||||
"deploy:dev": "pnpm publish .",
|
||||
@@ -29,8 +31,11 @@
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.14.0",
|
||||
"@types/bun": "^1.1.13",
|
||||
"bun": "^1.1.34",
|
||||
"eslint": "^9.14.0",
|
||||
"globals": "^15.12.0",
|
||||
"prettier": "^3.3.3"
|
||||
"prettier": "^3.3.3",
|
||||
"typescript": "^5.6.3"
|
||||
}
|
||||
}
|
||||
|
728
pnpm-lock.yaml
generated
728
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
110
tsconfig.json
Normal file
110
tsconfig.json
Normal file
@@ -0,0 +1,110 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||
|
||||
/* Projects */
|
||||
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
||||
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
||||
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
||||
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||
|
||||
/* Language and Environment */
|
||||
"target": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
||||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
||||
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||
|
||||
/* Modules */
|
||||
"module": "esnext", /* Specify what module code is generated. */
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
||||
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
||||
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
||||
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
||||
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
||||
// "noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
||||
// "resolveJsonModule": true, /* Enable importing .json files. */
|
||||
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
||||
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
||||
|
||||
/* JavaScript Support */
|
||||
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
||||
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
||||
|
||||
/* Emit */
|
||||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
||||
// "removeComments": true, /* Disable emitting comments. */
|
||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
||||
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
||||
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
||||
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
||||
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
||||
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
||||
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
||||
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||
|
||||
/* Interop Constraints */
|
||||
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
||||
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
||||
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
||||
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
||||
|
||||
/* Type Checking */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
||||
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
||||
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
||||
// "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
|
||||
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
||||
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
||||
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
||||
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
||||
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
||||
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
||||
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
||||
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
||||
|
||||
/* Completeness */
|
||||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user