initial commit

This commit is contained in:
2026-03-22 03:21:45 +02:00
commit 897fea9f4e
15431 changed files with 2548840 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
/**
* @description Transform for Browserify to compile `.bt` and `.flow` files into source.
* ```
* var browserify = require('browserify');
* browserify().transform('jibo-dev/browserify-transform');
* ```
* ```
* {
* "browserify": {
* "transform": [
* "jibo-dev/browserify-transform"
* ]
* }
* }
* ```
* @class BrowserifyTransform
* @param filename {string} `.bt` or `.flow` file to compile.
*/
export default function BrowserifyTransform(filename: any): NodeJS.ReadWriteStream;

72
node_modules/jibo-dev/lib/dts/bt-flow/Behaviorify.d.ts generated vendored Normal file
View File

@@ -0,0 +1,72 @@
import core from './core';
/**
* Converts a raw JSON data structure into a JavaScript module.
* ```
* import {Behaviorify} = require('jibo-dev');
* const bt = new Behaviorify('/path/to/custom.bt');
* console.log(bt.exec());
* ```
* @class Behaviorify
* @param {String} filename The file name if the first argument is an Object.
* @param {Object} [data] The `.bt` or `.flow` file data or path to file.
*/
declare class Behaviorify {
/**
* Current version of the behavior tree format
* @name Behaviorify.CURRENT_VERSION
* @type {Number}
*/
static CURRENT_VERSION: number;
data: any;
filename: string;
/**
* Browserify transform
* @method Behaviorify.transform
* @private
* @param {String} filename File name.
* @param {String} source Buffer from source file.
* @return {String} Output JavaScript module buffer.
*/
static transform(filename: string, source: string): any;
/**
* Run behaviorify for the commandline.
* @method Behaviorify.cli
* @private
*/
static cli(): void;
/**
* The core classes.
* @method Behaviorify.core
* @return {Map} Collection of core behavior and decorators.
*/
static readonly core: typeof core;
constructor(filename: string, data?: any);
/**
* Update the raw tree with deprecations.
* @method Behaviorify#update
*/
update(): void;
/**
* Convert the object.
* @method Behaviorify#exec
* @param {Object} [options] - Options.
* @param {Boolean} [options.noRequirification] if true, the subflow/subtree references are left untouched.
* @return {String} Resulting buffer JavaScript file.
*/
exec(options?: any): string;
/**
* Clear and don't use after this.
* @method Behaviorify#dispose
* @private
*/
dispose(): void;
/**
* Simple utility to read a file.
* @method Behaviorify#readFile
* @private
* @param {String} file The local file path.
* @return {String} Contents of the file.
*/
private readFile(file);
}
export default Behaviorify;

26
node_modules/jibo-dev/lib/dts/bt-flow/Flowify.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import Behaviorify from './Behaviorify';
/**
* API to convert `.flow` files into JavaScript.
* ```
* import {Flowify} = require('jibo-dev');
* const flow = new Flowify('/path/to/custom.flow');
* console.log(flow.exec());
* ```
* @class Flowify
* @param {String} filename Path and name of the file to compile.
* @param {Object} [data] The parsed JSON file to load.
*/
export default class Flowify extends Behaviorify {
/**
* Browserify transform.
* @method Flowify.transform
* @private
* @param {String} filename File name.
* @param {String} source Buffer from source file.
* @return {String} Output JavaScript module buffer.
*/
static transform(filename: string, source: string): string;
constructor(filename: string, data?: {
[id: string]: any;
});
}

1
node_modules/jibo-dev/lib/dts/bt-flow/cli.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function cli(): void;

38
node_modules/jibo-dev/lib/dts/bt-flow/core.d.ts generated vendored Normal file
View File

@@ -0,0 +1,38 @@
declare var _default: {
Blink: any[];
ExecuteScript: string[];
ExecuteScriptAsync: string[];
Listen: string[];
ListenEmbedded: string[];
ListenJs: string[];
LookAt: string[];
Null: any[];
Parallel: string[];
PlayAnimation: string[];
PlayAudio: string[];
Random: string[];
ReadBarcode: string[];
Sequence: string[];
Subtree: string[];
SubtreeJs: string[];
Switch: string[];
TakePhoto: string[];
TextToSpeech: string[];
TextToSpeechJs: string[];
TimeoutJs: string[];
Case: string[];
FailOnCondition: string[];
StartOnAnimEvent: string[];
StartOnCondition: string[];
StartOnEvent: string[];
SucceedOnCondition: string[];
SucceedOnEmbedded: string[];
SucceedOnEvent: string[];
SucceedOnListen: string[];
SucceedOnListenJs: string[];
TimeoutFail: string[];
TimeoutSucceed: string[];
TimeoutSucceedJs: string[];
WhileCondition: string[];
};
export default _default;

View File

@@ -0,0 +1,9 @@
declare class ArrayExpression {
expression: {
type: string;
elements: any[];
};
constructor();
push(value: any): void;
}
export default ArrayExpression;

View File

@@ -0,0 +1,27 @@
declare var _default: (relativePath: any) => {
"type": string;
"id": any;
"params": any[];
"defaults": any[];
"body": {
"type": string;
"body": {
"type": string;
"argument": {
"type": string;
"callee": {
"type": string;
"name": string;
};
"arguments": {
"type": string;
"value": any;
"raw": string;
}[];
};
}[];
};
"generator": boolean;
"expression": boolean;
};
export default _default;

View File

@@ -0,0 +1,20 @@
export default function CallExpression(objectExpression: any, hasSelf: any): {
"type": string;
"callee": {
"type": string;
"id": any;
"params": any[];
"defaults": any[];
"body": {
"type": string;
"body": {
"type": string;
"argument": any;
}[];
};
"rest": any;
"generator": boolean;
"expression": boolean;
};
"arguments": any[];
};

View File

@@ -0,0 +1,16 @@
export default function FunctionExpression(objectExpression: any, hasSelf: any): {
"type": string;
"id": any;
"params": any[];
"defaults": any[];
"body": {
"type": string;
"body": {
"type": string;
"argument": any;
}[];
};
"rest": any;
"generator": boolean;
"expression": boolean;
};

View File

@@ -0,0 +1 @@
export default function LiteralExpression(value: string): any;

View File

@@ -0,0 +1,9 @@
declare class ObjectExpression {
expression: {
type: string;
properties: any[];
};
constructor(props?: any);
addKeyValue(key: string, value: any): void;
}
export default ObjectExpression;

View File

@@ -0,0 +1,16 @@
import Procedure from './Procedure';
import Transition from './Transition';
declare class Activity {
class: string;
assetPack: string;
id: string;
name: string;
procedure: Procedure;
transitions: Transition[];
exceptions: Transition[];
options: any;
constructor(name: string, id: string, className: string, assetPack: string, options: any);
set_transitions(transitions: Transition[]): void;
set_exceptions(exceptions: Transition[]): void;
}
export default Activity;

View File

@@ -0,0 +1,31 @@
import Activity from './Activity';
import Transition from './Transition';
declare class Procedure {
name: string;
uri: string;
activities: {
[key: string]: Activity;
};
local_inits: {
[key: string]: string;
};
param_inits: {
[key: string]: string;
};
transitions: {
[key: string]: Transition[];
};
exceptions: {
[key: string]: Transition[];
};
procedureConstructor: any;
constructor(name: string, uri: string, local_inits: {
[key: string]: string;
}, param_inits: {
[key: string]: string;
});
add_transition(transition: Transition): void;
add_activity(activity: Activity): void;
toBehaviorifyable(): any;
}
export default Procedure;

View File

@@ -0,0 +1,7 @@
declare class Transition {
frm: string;
to: string;
value: string;
constructor(frm: string, to: string, value: string);
}
export default Transition;

View File

@@ -0,0 +1,9 @@
import Procedure from "../flow-objects/Procedure";
declare class GojsLoader {
static getName(uri: string): string;
static getBase(uri: string): string;
static loadProcedureRelative(currentUri: string, name: string): Procedure;
static loadProcedure(uri: string): Procedure;
static loadParsedProcedure(uri: string, base: any): Procedure;
}
export default GojsLoader;

View File

@@ -0,0 +1,4 @@
declare var _default: {
version0: (rawTree: any) => any;
};
export default _default;

View File

@@ -0,0 +1 @@
export default function (rawTree: any): any;

97
node_modules/jibo-dev/lib/dts/dev/JiboDev.d.ts generated vendored Normal file
View File

@@ -0,0 +1,97 @@
/**
* The config options
* @interface JiboDev~JiboDevConfig
*/
export interface JiboDevConfig {
/**
* The folder to watch
* @name JiboDev~JiboDevConfig#watch
* @type {String}
* @default src
*/
watch?: string;
/**
* Entry point for the application
* @name JiboDev~JiboDevConfig#app
* @type {String}
* @default src/index.ts
*/
app?: string;
/**
* The output file name
* @name JiboDev~JiboDevConfig#bundle
* @type {String}
* @default index.js
*/
bundle?: string;
/**
* The name of the map file
* @name JiboDev~JiboDevConfig#map
* @type {String}
* @default index.js.map
*/
map?: string;
/**
* The folder to watch
* @name JiboDev~JiboDevConfig#watch
* @type {String}
* @default tslint.json
*/
tslint?: string;
/**
* Additional files to clean
* @name JiboDev~JiboDevConfig#clean
* @type {Array<String>}
* @default []
*/
clean?: string[];
/**
* Output folder for rules
* @name JiboDev~JiboDevConfig#rules
* @type {Array<String>}
* @default rules
*/
rules?: string;
/**
* Input folder for rules
* @name JiboDev~JiboDevConfig#rulesSrc
* @type {Array<String>}
* @default src/rules
*/
rulesSrc?: string;
/**
* Input folder for flow
* @name JiboDev~JiboDevConfig#flowsSrc
* @type {Array<String>}
* @default src/flows
*/
flowsSrc?: string;
}
/**
* Provide the build process for skills.
* @class JiboDev
*/
declare class JiboDev {
dirname: string;
config: JiboDevConfig;
args: any;
/**
* Command line invokation of the jibo-dev build tools
* @method JiboDev.cli
*/
static cli(): void;
/**
* @constructor
* @param {String} [dirname] The directory name to run tasks
* @param {JiboDev~JiboDevConfig} [config] Optional configuration
*/
constructor(dirname?: string, config?: JiboDevConfig);
/**
* Run as ask command.
* @method JiboDev#run
* @param {String} [task='build'] Name of the task: build, clean, watch
* @return Promise<void> The promise when complete.
*/
run(task: string): Promise<void>;
}
export default JiboDev;

View File

@@ -0,0 +1,2 @@
import { JiboDevConfig } from '../JiboDev';
export default function (options: JiboDevConfig, production: boolean, watch?: boolean): any;

2
node_modules/jibo-dev/lib/dts/dev/tasks/build.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import JiboDev from '../JiboDev';
export default function (gulp: any, dev: JiboDev): void;

2
node_modules/jibo-dev/lib/dts/dev/tasks/clean.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import JiboDev from '../JiboDev';
export default function (gulp: any, dev: JiboDev): void;

2
node_modules/jibo-dev/lib/dts/dev/tasks/flows.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import JiboDev from '../JiboDev';
export default function (gulp: any, dev: JiboDev): void;

8
node_modules/jibo-dev/lib/dts/dev/tasks/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import build from './build';
import clean from './clean';
import lint from './lint';
import watch from './watch';
import watchBuild from './watch-build';
import flows from './flows';
import rules from './rules';
export { build, clean, lint, watch, watchBuild, rules, flows };

2
node_modules/jibo-dev/lib/dts/dev/tasks/lint.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import JiboDev from '../JiboDev';
export default function (gulp: any, dev: JiboDev): void;

2
node_modules/jibo-dev/lib/dts/dev/tasks/rules.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import JiboDev from '../JiboDev';
export default function (gulp: any, dev: JiboDev): void;

View File

@@ -0,0 +1,2 @@
import JiboDev from '../JiboDev';
export default function (gulp: any, dev: JiboDev): void;

2
node_modules/jibo-dev/lib/dts/dev/tasks/watch.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import JiboDev from '../JiboDev';
export default function (gulp: any, dev: JiboDev): void;

161
node_modules/jibo-dev/lib/dts/flows/FlowLint.d.ts generated vendored Normal file
View File

@@ -0,0 +1,161 @@
import { EventEmitter } from 'events';
/**
* Statically check a `.flow` file and its dependencies for inconsistencies and missing resources.
* ```
* import {FlowLint} from 'jibo-dev';
* var linter = new FlowLint(__dirname, '/full/path/to/file.flow');
* linter.run();
* console.log(linter.getErrorReport());
* ```
* @class FlowLint
* @param {string} projectRoot Path to the skill's project-level directory.
* @param {string} uri Path to the `.flow` file.
*/
declare class FlowLint {
projectRoot: string;
uri: string;
procedures: {
[key: string]: any;
};
flowRoot: any;
private errors;
/**
* Command-line tool for validating a directory or single flow file.
* @method FlowLint.cli
* @private
*/
static cli(): void;
/**
* Command-line tool for validating a directory or single flow file.
* @method FlowLint.exec
* @param {String} dir Directory containing flow files
* @param {Boolean} [verbose=false] If we should load
* @return {EventEmitter} Emits 'lintError', 'end' and 'log' event
*/
static exec(dir: String, verbose?: boolean): EventEmitter;
constructor(projectRoot: string, uri: string);
/**
* Run the preflight check.
* @method FlowLint#run
*/
run(): void;
/**
* Write discovered errors to the given file.
* @method FlowLint#writeReportToFile
* @param {string} filename
*/
writeReportToFile(filename: string): void;
/**
* Format all the discovered errors into a report.
* @method FlowLint#getErrorReport
* @returns {string} Report of all discovered errors.
*/
getErrorReport(): string;
/**
* Recursively load all the procedures reachable from the preflighted procedure.
* @method FlowLint#loadProcedures
* @private
*/
private loadProcedures();
/**
* Load a procedure and all its dependents.
* @method FlowLint#loadProcedure
* @private
* @param {Procedure} procedure
*/
private loadProcedure(procedure);
/**
* Recursively load all the procedures reachable from the preflighted procedure.
* @method FlowLint#loadProcedures
* @private
* @param {Procedure} procedure
*/
private loadSubflows(procedure);
/**
* Gather up all the different transition values that a procedure returns to its parent via Flow.End.
* @method FlowLint#loadReturnValues
* @private
* @param {Procedure} procedure
*/
private loadReturnValues(procedure);
/**
* Check all the procedures found during loading.
* @method FlowLint#checkProcedures
* @private
*/
private checkProcedures();
/**
* Get a sorted list of all the procedures that have been loaded.
* @method FlowLint#getSortedProcedures
* @private
*/
private getSortedProcedures();
/**
* Check a procedure for consistency and missing resources.
* @method FlowLint#checkProcedure
* @private
* @param {Procedure} procedure
*/
private checkProcedure(procedure);
/**
* Ensure that correct number of transitions are used for each type of activity.
* @method FlowLint#checkTransitionCounts
* @private
* @param {Procedure} procedure
*/
private checkTransitionCounts(procedure);
/**
* Ensure that values returned from an activity (currently just Subflows) will match one of its outbound transitions.
* @method FlowLint#checkTransitionValues
* @private
* @param {Procedure} procedure
*/
private checkTransitionValues(procedure);
/**
* Ensure that the procedure has the correct number of Flow.Begin activities.
* @method FlowLint#checkStartValidity
* @private
* @param {Procedure} procedure
*/
private checkStartValidity(procedure);
/**
* Ensure that the resources referenced by each mim in the procedure are present.
* @method FlowLint#checkMimReferences
* @private
* @param {Procedure} procedure
*/
private checkMimReferences(procedure);
/**
* Ensure that a mim activity's referenced files are present (mim file, rule file, animation files).
* @method FlowLint#checkMim
* @private
* @param {Activity} activity
*/
private checkMim(activity);
/**
* Accumulate an error referring to a procedure.
* @method FlowLint#addProcedureError
* @private
* @param {Procedure} procedure
* @param {string} message
* @param {string} code
*/
private addProcedureError(procedure, message, code);
/**
* Accumulate an error referring to an activity.
* @method FlowLint#addProcedureError
* @private
* @param {Activity} activity
* @param {string} message
* @param {string} code
*/
private addActivityError(activity, message, code);
/**
* Sort the errors by procedure name, error code, activity type, and activity name.
* @method FlowLint#getSortedErrors
* @private
* @returns {Error[]}
*/
private getSortedErrors();
}
export default FlowLint;

1
node_modules/jibo-dev/lib/dts/flows/cli.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function cli(): void;

7
node_modules/jibo-dev/lib/dts/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import Rulify from './rules/Rulify';
import Flowify from './bt-flow/Flowify';
import FlowLint from './flows/FlowLint';
import Behaviorify from './bt-flow/Behaviorify';
import BrowserifyTransform from './browserify/BrowserifyTransform';
import JiboDev from './dev/JiboDev';
export { FlowLint, Flowify, Behaviorify, BrowserifyTransform, Rulify, JiboDev };

81
node_modules/jibo-dev/lib/dts/rules/Rulify.d.ts generated vendored Normal file
View File

@@ -0,0 +1,81 @@
import { EventEmitter } from 'events';
/**
* Callback for asynchronous rule conversion.
* @callback Rulify~Callback
* @param {Error} error If conversion failed.
* @param {String} output The output file path.
*/
/**
* Convert a `.rule` file to a `.fst` file.
* ```
* import {Rulify} from 'jibo-dev';
* const fstPath = Rulify.sync('/path/to/file.rule');
* console.log("FST file saved to: ", fstPath);
* ```
* @class Rulify
*/
export default class Rulify {
private static _nlu;
/**
* Synchronous version of rulify.
* @method Rulify.sync
* @param {String} src Either the contents of the rule or the path to the source.
* @param {String} output Name of file to write, will default to src with `.fst` extension.
* @return {String} The output file saved.
*/
static sync(src: any, output: any): any;
/**
* Asynchronous version of rulify.
* @method Rulify.async
* @param {String} src Either the contents of the rule or the path to the source.
* @param {String} [output] Name of file to write, will default to src with `.fst` extension.
* @param {Rulify~Callback} callback Called when the conversion completes.
*/
static async(src: any, output: any, callback: any): void;
/**
* Execute the commandline interface
* @method Rulify.cli
* @private
*/
static cli(): void;
/**
* Get the reference the NLU parser.
* @method Rulify.nlu
* @return {NLU} The nlu parser.
*/
static readonly nlu: any;
/**
* Get the reference the NLU parser.
* @method Rulify.exec
* @param {Array<String>} files List of files to load
* @param {String} input Input directory
* @param {String} output Output directory
* @param {Boolean} [verbose=false] Extra logging
* @return {EventEmitter} Emitter dispatches 'end', 'fileError', 'compileError', and 'log'
*/
static exec(input: string, output: string, verbose?: boolean): EventEmitter;
/**
* Convert file to .fst
* @method Rulify.defaultOutput
* @private
* @param {String} file Convert
* @return {String} File .fst path
*/
private static defaultOutput(file);
/**
* Write the buffer from data string
* @function fromString
* @private
* @param {String} data contents of .rule file
* @param {String} output Path to file to save
* @param {Rulify~Callback} callback Calls when write completes.
*/
private static fromString(data, output, callback);
/**
* Create a buffer from data
* @function toBuffer
* @private
* @param {String} data Contents of .rule file
*/
private static toBuffer(data);
}

1
node_modules/jibo-dev/lib/dts/rules/cli.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function cli(): void;

16
node_modules/jibo-dev/lib/jibo-dev.js generated vendored Normal file

File diff suppressed because one or more lines are too long