@sprucelabs/spruce-agent-plugin 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/build/.spruce/errors/errors.types.d.ts +32 -0
- package/build/.spruce/errors/errors.types.js +2 -0
- package/build/.spruce/errors/options.types.d.ts +10 -0
- package/build/.spruce/errors/options.types.js +2 -0
- package/build/.spruce/errors/spruceAgentPlugin/invalidSystemPromptFile.schema.d.ts +3 -0
- package/build/.spruce/errors/spruceAgentPlugin/invalidSystemPromptFile.schema.js +18 -0
- package/build/.spruce/errors/spruceAgentPlugin/noSystemPromptFile.schema.d.ts +3 -0
- package/build/.spruce/errors/spruceAgentPlugin/noSystemPromptFile.schema.js +11 -0
- package/build/.spruce/schemas/fields/fieldClassMap.d.ts +2 -0
- package/build/.spruce/schemas/fields/fieldClassMap.js +4 -0
- package/build/.spruce/schemas/fields/fields.types.d.ts +1 -0
- package/build/.spruce/schemas/fields/fields.types.js +2 -0
- package/build/.spruce/settings.json +13 -0
- package/build/.spruce/skill.d.ts +3 -0
- package/build/.spruce/skill.js +12 -0
- package/build/errors/SpruceError.d.ts +5 -0
- package/build/errors/SpruceError.js +27 -0
- package/build/errors/invalidSystemPromptFile.builder.d.ts +11 -0
- package/build/errors/invalidSystemPromptFile.builder.js +13 -0
- package/build/errors/noSystemPromptFile.builder.d.ts +6 -0
- package/build/errors/noSystemPromptFile.builder.js +8 -0
- package/build/esm/.spruce/errors/errors.types.d.ts +32 -0
- package/build/esm/.spruce/errors/errors.types.js +1 -0
- package/build/esm/.spruce/errors/errors.types.js.map +1 -0
- package/build/esm/.spruce/errors/options.types.d.ts +10 -0
- package/build/esm/.spruce/errors/options.types.js +1 -0
- package/build/esm/.spruce/errors/options.types.js.map +1 -0
- package/build/esm/.spruce/errors/spruceAgentPlugin/invalidSystemPromptFile.schema.d.ts +3 -0
- package/build/esm/.spruce/errors/spruceAgentPlugin/invalidSystemPromptFile.schema.js +18 -0
- package/build/esm/.spruce/errors/spruceAgentPlugin/invalidSystemPromptFile.schema.js.map +1 -0
- package/build/esm/.spruce/errors/spruceAgentPlugin/noSystemPromptFile.schema.d.ts +3 -0
- package/build/esm/.spruce/errors/spruceAgentPlugin/noSystemPromptFile.schema.js +11 -0
- package/build/esm/.spruce/errors/spruceAgentPlugin/noSystemPromptFile.schema.js.map +1 -0
- package/build/esm/.spruce/schemas/fields/fieldClassMap.d.ts +2 -0
- package/build/esm/.spruce/schemas/fields/fieldClassMap.js +4 -0
- package/build/esm/.spruce/schemas/fields/fieldClassMap.js.map +1 -0
- package/build/esm/.spruce/schemas/fields/fields.types.d.ts +1 -0
- package/build/esm/.spruce/schemas/fields/fields.types.js +2 -0
- package/build/esm/.spruce/schemas/fields/fields.types.js.map +1 -0
- package/build/esm/.spruce/settings.json +13 -0
- package/build/esm/.spruce/skill.d.ts +3 -0
- package/build/esm/.spruce/skill.js +12 -0
- package/build/esm/.spruce/skill.js.map +1 -0
- package/build/esm/errors/SpruceError.d.ts +5 -0
- package/build/esm/errors/SpruceError.js +21 -0
- package/build/esm/errors/SpruceError.js.map +1 -0
- package/build/esm/errors/invalidSystemPromptFile.builder.d.ts +11 -0
- package/build/esm/errors/invalidSystemPromptFile.builder.js +11 -0
- package/build/esm/errors/invalidSystemPromptFile.builder.js.map +1 -0
- package/build/esm/errors/noSystemPromptFile.builder.d.ts +6 -0
- package/build/esm/errors/noSystemPromptFile.builder.js +6 -0
- package/build/esm/errors/noSystemPromptFile.builder.js.map +1 -0
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/plugins/agent.plugin.d.ts +20 -0
- package/build/esm/plugins/agent.plugin.js +123 -0
- package/build/esm/plugins/agent.plugin.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +8 -0
- package/build/plugins/agent.plugin.d.ts +20 -0
- package/build/plugins/agent.plugin.js +108 -0
- package/package.json +104 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { default as SchemaEntity } from '@sprucelabs/schema';
|
|
2
|
+
import * as SpruceSchema from '@sprucelabs/schema';
|
|
3
|
+
export declare namespace SpruceErrors.SpruceAgentPlugin {
|
|
4
|
+
interface NoSystemPromptFile {
|
|
5
|
+
}
|
|
6
|
+
interface NoSystemPromptFileSchema extends SpruceSchema.Schema {
|
|
7
|
+
id: 'noSystemPromptFile';
|
|
8
|
+
namespace: 'SpruceAgentPlugin';
|
|
9
|
+
name: 'No system prompt file';
|
|
10
|
+
fields: {};
|
|
11
|
+
}
|
|
12
|
+
type NoSystemPromptFileEntity = SchemaEntity<SpruceErrors.SpruceAgentPlugin.NoSystemPromptFileSchema>;
|
|
13
|
+
}
|
|
14
|
+
export declare namespace SpruceErrors.SpruceAgentPlugin {
|
|
15
|
+
interface InvalidSystemPromptFile {
|
|
16
|
+
'path': string;
|
|
17
|
+
}
|
|
18
|
+
interface InvalidSystemPromptFileSchema extends SpruceSchema.Schema {
|
|
19
|
+
id: 'invalidSystemPromptFile';
|
|
20
|
+
namespace: 'SpruceAgentPlugin';
|
|
21
|
+
name: 'Invalid system prompt file';
|
|
22
|
+
fields: {
|
|
23
|
+
/** . */
|
|
24
|
+
'path': {
|
|
25
|
+
type: 'text';
|
|
26
|
+
isRequired: true;
|
|
27
|
+
options: undefined;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
type InvalidSystemPromptFileEntity = SchemaEntity<SpruceErrors.SpruceAgentPlugin.InvalidSystemPromptFileSchema>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SpruceErrors } from "./errors.types";
|
|
2
|
+
import { ErrorOptions as ISpruceErrorOptions } from "@sprucelabs/error";
|
|
3
|
+
export interface NoSystemPromptFileErrorOptions extends SpruceErrors.SpruceAgentPlugin.NoSystemPromptFile, ISpruceErrorOptions {
|
|
4
|
+
code: 'NO_SYSTEM_PROMPT_FILE';
|
|
5
|
+
}
|
|
6
|
+
export interface InvalidSystemPromptFileErrorOptions extends SpruceErrors.SpruceAgentPlugin.InvalidSystemPromptFile, ISpruceErrorOptions {
|
|
7
|
+
code: 'INVALID_SYSTEM_PROMPT_FILE';
|
|
8
|
+
}
|
|
9
|
+
type ErrorOptions = NoSystemPromptFileErrorOptions | InvalidSystemPromptFileErrorOptions;
|
|
10
|
+
export default ErrorOptions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
4
|
+
const invalidSystemPromptFileSchema = {
|
|
5
|
+
id: 'invalidSystemPromptFile',
|
|
6
|
+
namespace: 'SpruceAgentPlugin',
|
|
7
|
+
name: 'Invalid system prompt file',
|
|
8
|
+
fields: {
|
|
9
|
+
/** . */
|
|
10
|
+
'path': {
|
|
11
|
+
type: 'text',
|
|
12
|
+
isRequired: true,
|
|
13
|
+
options: undefined
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
schema_1.SchemaRegistry.getInstance().trackSchema(invalidSystemPromptFileSchema);
|
|
18
|
+
exports.default = invalidSystemPromptFileSchema;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
4
|
+
const noSystemPromptFileSchema = {
|
|
5
|
+
id: 'noSystemPromptFile',
|
|
6
|
+
namespace: 'SpruceAgentPlugin',
|
|
7
|
+
name: 'No system prompt file',
|
|
8
|
+
fields: {}
|
|
9
|
+
};
|
|
10
|
+
schema_1.SchemaRegistry.getInstance().trackSchema(noSystemPromptFileSchema);
|
|
11
|
+
exports.default = noSystemPromptFileSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FieldDefinitions, FieldDefinitionMap, FieldValueTypeGeneratorMap, FieldMap } from '@sprucelabs/schema';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const spruce_skill_booter_1 = __importDefault(require("@sprucelabs/spruce-skill-booter"));
|
|
8
|
+
exports.default = new spruce_skill_booter_1.default({
|
|
9
|
+
rootDir: path_1.default.join(__dirname, '..', '..'),
|
|
10
|
+
activeDir: path_1.default.join(__dirname, '..'),
|
|
11
|
+
hashSpruceDir: path_1.default.join(__dirname, '..', '.spruce'),
|
|
12
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const error_1 = __importDefault(require("@sprucelabs/error"));
|
|
7
|
+
class SpruceError extends error_1.default {
|
|
8
|
+
friendlyMessage() {
|
|
9
|
+
const { options } = this;
|
|
10
|
+
let message;
|
|
11
|
+
switch (options?.code) {
|
|
12
|
+
case 'INVALID_SYSTEM_PROMPT_FILE':
|
|
13
|
+
message = `The system prompt file at "${options.path}" is invalid. Make sure it includes a section for "## AGENT NAME" followed by the agent's name on the next line.`;
|
|
14
|
+
break;
|
|
15
|
+
case 'NO_SYSTEM_PROMPT_FILE':
|
|
16
|
+
message = `You don't have an agent prompt file. Try running "spruce create.agent" to get started!`;
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
message = super.friendlyMessage();
|
|
20
|
+
}
|
|
21
|
+
const fullMessage = options.friendlyMessage
|
|
22
|
+
? options.friendlyMessage
|
|
23
|
+
: message;
|
|
24
|
+
return fullMessage;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = SpruceError;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
4
|
+
exports.default = (0, schema_1.buildErrorSchema)({
|
|
5
|
+
id: 'invalidSystemPromptFile',
|
|
6
|
+
name: 'Invalid system prompt file',
|
|
7
|
+
fields: {
|
|
8
|
+
path: {
|
|
9
|
+
type: 'text',
|
|
10
|
+
isRequired: true,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { default as SchemaEntity } from '@sprucelabs/schema';
|
|
2
|
+
import * as SpruceSchema from '@sprucelabs/schema';
|
|
3
|
+
export declare namespace SpruceErrors.SpruceAgentPlugin {
|
|
4
|
+
interface NoSystemPromptFile {
|
|
5
|
+
}
|
|
6
|
+
interface NoSystemPromptFileSchema extends SpruceSchema.Schema {
|
|
7
|
+
id: 'noSystemPromptFile';
|
|
8
|
+
namespace: 'SpruceAgentPlugin';
|
|
9
|
+
name: 'No system prompt file';
|
|
10
|
+
fields: {};
|
|
11
|
+
}
|
|
12
|
+
type NoSystemPromptFileEntity = SchemaEntity<SpruceErrors.SpruceAgentPlugin.NoSystemPromptFileSchema>;
|
|
13
|
+
}
|
|
14
|
+
export declare namespace SpruceErrors.SpruceAgentPlugin {
|
|
15
|
+
interface InvalidSystemPromptFile {
|
|
16
|
+
'path': string;
|
|
17
|
+
}
|
|
18
|
+
interface InvalidSystemPromptFileSchema extends SpruceSchema.Schema {
|
|
19
|
+
id: 'invalidSystemPromptFile';
|
|
20
|
+
namespace: 'SpruceAgentPlugin';
|
|
21
|
+
name: 'Invalid system prompt file';
|
|
22
|
+
fields: {
|
|
23
|
+
/** . */
|
|
24
|
+
'path': {
|
|
25
|
+
type: 'text';
|
|
26
|
+
isRequired: true;
|
|
27
|
+
options: undefined;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
type InvalidSystemPromptFileEntity = SchemaEntity<SpruceErrors.SpruceAgentPlugin.InvalidSystemPromptFileSchema>;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.types.js","sourceRoot":"","sources":["../../../src/.spruce/errors/errors.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SpruceErrors } from "./errors.types";
|
|
2
|
+
import { ErrorOptions as ISpruceErrorOptions } from "@sprucelabs/error";
|
|
3
|
+
export interface NoSystemPromptFileErrorOptions extends SpruceErrors.SpruceAgentPlugin.NoSystemPromptFile, ISpruceErrorOptions {
|
|
4
|
+
code: 'NO_SYSTEM_PROMPT_FILE';
|
|
5
|
+
}
|
|
6
|
+
export interface InvalidSystemPromptFileErrorOptions extends SpruceErrors.SpruceAgentPlugin.InvalidSystemPromptFile, ISpruceErrorOptions {
|
|
7
|
+
code: 'INVALID_SYSTEM_PROMPT_FILE';
|
|
8
|
+
}
|
|
9
|
+
type ErrorOptions = NoSystemPromptFileErrorOptions | InvalidSystemPromptFileErrorOptions;
|
|
10
|
+
export default ErrorOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.types.js","sourceRoot":"","sources":["../../../src/.spruce/errors/options.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require('@sprucelabs/schema');
|
|
4
|
+
const invalidSystemPromptFileSchema = {
|
|
5
|
+
id: 'invalidSystemPromptFile',
|
|
6
|
+
namespace: 'SpruceAgentPlugin',
|
|
7
|
+
name: 'Invalid system prompt file',
|
|
8
|
+
fields: {
|
|
9
|
+
/** . */
|
|
10
|
+
'path': {
|
|
11
|
+
type: 'text',
|
|
12
|
+
isRequired: true,
|
|
13
|
+
options: undefined
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
schema_1.SchemaRegistry.getInstance().trackSchema(invalidSystemPromptFileSchema);
|
|
18
|
+
exports.default = invalidSystemPromptFileSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalidSystemPromptFile.schema.js","sourceRoot":"","sources":["../../../../src/.spruce/errors/spruceAgentPlugin/invalidSystemPromptFile.schema.ts"],"names":[],"mappings":";;AAAA,+CAAmD;AAKnD,MAAM,6BAA6B,GAAkE;IACpG,EAAE,EAAE,yBAAyB;IAC7B,SAAS,EAAE,mBAAmB;IAC9B,IAAI,EAAE,4BAA4B;IAC9B,MAAM,EAAE;QACA,QAAQ;QACR,MAAM,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,SAAS;SACrB;KACR;CACL,CAAA;AAED,uBAAc,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,6BAA6B,CAAC,CAAA;AAEvE,kBAAe,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require('@sprucelabs/schema');
|
|
4
|
+
const noSystemPromptFileSchema = {
|
|
5
|
+
id: 'noSystemPromptFile',
|
|
6
|
+
namespace: 'SpruceAgentPlugin',
|
|
7
|
+
name: 'No system prompt file',
|
|
8
|
+
fields: {}
|
|
9
|
+
};
|
|
10
|
+
schema_1.SchemaRegistry.getInstance().trackSchema(noSystemPromptFileSchema);
|
|
11
|
+
exports.default = noSystemPromptFileSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noSystemPromptFile.schema.js","sourceRoot":"","sources":["../../../../src/.spruce/errors/spruceAgentPlugin/noSystemPromptFile.schema.ts"],"names":[],"mappings":";;AAAA,+CAAmD;AAKnD,MAAM,wBAAwB,GAA6D;IAC1F,EAAE,EAAE,oBAAoB;IACxB,SAAS,EAAE,mBAAmB;IAC9B,IAAI,EAAE,uBAAuB;IACzB,MAAM,EAAE,EACP;CACL,CAAA;AAED,uBAAc,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAA;AAElE,kBAAe,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldClassMap.js","sourceRoot":"","sources":["../../../../src/.spruce/schemas/fields/fieldClassMap.ts"],"names":[],"mappings":";;AAAA,+CAAkD;AAKlD,kBAAe,sBAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FieldDefinitions, FieldDefinitionMap, FieldValueTypeGeneratorMap, FieldMap } from '@sprucelabs/schema';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.types.js","sourceRoot":"","sources":["../../../../src/.spruce/schemas/fields/fields.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require('path'));
|
|
7
|
+
const spruce_skill_booter_1 = __importDefault(require('@sprucelabs/spruce-skill-booter'));
|
|
8
|
+
exports.default = new spruce_skill_booter_1.default({
|
|
9
|
+
rootDir: path_1.default.join(__dirname, '..', '..'),
|
|
10
|
+
activeDir: path_1.default.join(__dirname, '..'),
|
|
11
|
+
hashSpruceDir: path_1.default.join(__dirname, '..', '.spruce'),
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../src/.spruce/skill.ts"],"names":[],"mappings":";;;;;AAAA,gDAA2B;AAC3B,0FAAmD;AAEnD,kBAAe,IAAI,6BAAK,CAAC;IACrB,OAAO,EAAE,cAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC;IAC7C,SAAS,EAAE,cAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC;IACzC,aAAa,EAAE,cAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC;CAC3D,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import AbstractSpruceError from '@sprucelabs/error';
|
|
2
|
+
export default class SpruceError extends AbstractSpruceError {
|
|
3
|
+
friendlyMessage() {
|
|
4
|
+
const { options } = this;
|
|
5
|
+
let message;
|
|
6
|
+
switch (options === null || options === void 0 ? void 0 : options.code) {
|
|
7
|
+
case 'INVALID_SYSTEM_PROMPT_FILE':
|
|
8
|
+
message = `The system prompt file at "${options.path}" is invalid. Make sure it includes a section for "## AGENT NAME" followed by the agent's name on the next line.`;
|
|
9
|
+
break;
|
|
10
|
+
case 'NO_SYSTEM_PROMPT_FILE':
|
|
11
|
+
message = `You don't have an agent prompt file. Try running "spruce create.agent" to get started!`;
|
|
12
|
+
break;
|
|
13
|
+
default:
|
|
14
|
+
message = super.friendlyMessage();
|
|
15
|
+
}
|
|
16
|
+
const fullMessage = options.friendlyMessage
|
|
17
|
+
? options.friendlyMessage
|
|
18
|
+
: message;
|
|
19
|
+
return fullMessage;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpruceError.js","sourceRoot":"","sources":["../../src/errors/SpruceError.ts"],"names":[],"mappings":";;;;;AAAA,8DAAmD;AAGnD,MAAqB,WAAY,SAAQ,eAAiC;IAC/D,eAAe;QAClB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QACxB,IAAI,OAAO,CAAA;QAEX,QAAQ,OAAO,EAAE,IAAI,EAAE,CAAC;YACpB,KAAK,4BAA4B;gBAC7B,OAAO,GAAG,8BAA8B,OAAO,CAAC,IAAI,kHAAkH,CAAA;gBACtK,MAAK;YAET,KAAK,uBAAuB;gBACxB,OAAO,GAAG,wFAAwF,CAAA;gBAClG,MAAK;YAET;gBACI,OAAO,GAAG,KAAK,CAAC,eAAe,EAAE,CAAA;QACzC,CAAC;QAED,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe;YACvC,CAAC,CAAC,OAAO,CAAC,eAAe;YACzB,CAAC,CAAC,OAAO,CAAA;QAEb,OAAO,WAAW,CAAA;IACtB,CAAC;CACJ;AAxBD,8BAwBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalidSystemPromptFile.builder.js","sourceRoot":"","sources":["../../src/errors/invalidSystemPromptFile.builder.ts"],"names":[],"mappings":";;AAAA,+CAAqD;AAErD,kBAAe,IAAA,yBAAgB,EAAC;IAC5B,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,4BAA4B;IAClC,MAAM,EAAE;QACJ,IAAI,EAAE;YACF,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,IAAI;SACnB;KACJ;CACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noSystemPromptFile.builder.js","sourceRoot":"","sources":["../../src/errors/noSystemPromptFile.builder.ts"],"names":[],"mappings":";;AAAA,+CAAqD;AAErD,kBAAe,IAAA,yBAAgB,EAAC;IAC5B,EAAE,EAAE,oBAAoB;IACxB,IAAI,EAAE,uBAAuB;IAC7B,MAAM,EAAE,EAAE;CACb,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as plugin } from './plugins/agent.plugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as plugin } from './plugins/agent.plugin.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,uDAA0D;AAAjD,uHAAA,OAAO,OAAU"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BootCallback, HealthCheckItem, Skill, SkillFeature } from '@sprucelabs/spruce-skill-utils';
|
|
2
|
+
export declare class AgentFeature implements SkillFeature {
|
|
3
|
+
private skill;
|
|
4
|
+
constructor(skill: Skill);
|
|
5
|
+
static doesFileExist(path: string): boolean;
|
|
6
|
+
execute(): Promise<void>;
|
|
7
|
+
private registePlatformAgent;
|
|
8
|
+
private connectToApi;
|
|
9
|
+
private parseName;
|
|
10
|
+
private InvalidPromptFileError;
|
|
11
|
+
private readSystemPromptFile;
|
|
12
|
+
private resolvePlatformPromptPath;
|
|
13
|
+
checkHealth(): Promise<HealthCheckItem>;
|
|
14
|
+
isInstalled(): Promise<boolean>;
|
|
15
|
+
destroy(): Promise<void>;
|
|
16
|
+
isBooted(): boolean;
|
|
17
|
+
onBoot(_cb: BootCallback): void;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: (skill: Skill) => void;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { diskUtil, } from '@sprucelabs/spruce-skill-utils';
|
|
11
|
+
import SpruceError from '../errors/SpruceError.js';
|
|
12
|
+
export class AgentFeature {
|
|
13
|
+
constructor(skill) {
|
|
14
|
+
this.skill = skill;
|
|
15
|
+
}
|
|
16
|
+
static doesFileExist(path) {
|
|
17
|
+
return diskUtil.doesFileExist(path);
|
|
18
|
+
}
|
|
19
|
+
execute() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const prompt = this.readSystemPromptFile();
|
|
22
|
+
if (!prompt) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const name = this.parseName(prompt);
|
|
26
|
+
yield this.registePlatformAgent(name, prompt);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
registePlatformAgent(name, prompt) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const client = yield this.connectToApi();
|
|
32
|
+
yield client.emitAndFlattenResponses('register-agent::v2020_12_25', {
|
|
33
|
+
payload: {
|
|
34
|
+
agent: {
|
|
35
|
+
name,
|
|
36
|
+
systemPrompt: prompt,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
connectToApi() {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const events = this.skill.getFeatureByCode('event');
|
|
45
|
+
const client = yield events.connectToApi();
|
|
46
|
+
return client;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
parseName(prompt) {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
const promptSections = prompt.split('## AGENT NAME');
|
|
52
|
+
const lastSection = promptSections.length == 2 ? promptSections.pop() : undefined;
|
|
53
|
+
const lastSectionParts = (_a = lastSection === null || lastSection === void 0 ? void 0 : lastSection.trim()) === null || _a === void 0 ? void 0 : _a.split('\n');
|
|
54
|
+
const name = (_b = lastSectionParts === null || lastSectionParts === void 0 ? void 0 : lastSectionParts.shift()) === null || _b === void 0 ? void 0 : _b.trim();
|
|
55
|
+
if (!name) {
|
|
56
|
+
throw this.InvalidPromptFileError();
|
|
57
|
+
}
|
|
58
|
+
return name;
|
|
59
|
+
}
|
|
60
|
+
InvalidPromptFileError() {
|
|
61
|
+
return new SpruceError({
|
|
62
|
+
code: 'INVALID_SYSTEM_PROMPT_FILE',
|
|
63
|
+
path: this.resolvePlatformPromptPath(),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
readSystemPromptFile() {
|
|
67
|
+
const promptPath = this.resolvePlatformPromptPath();
|
|
68
|
+
if (!promptPath) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const prompt = diskUtil.readFile(promptPath);
|
|
72
|
+
return prompt;
|
|
73
|
+
}
|
|
74
|
+
resolvePlatformPromptPath() {
|
|
75
|
+
const promptPath = diskUtil.resolvePath(this.skill.rootDir, 'agents', 'SYSTEM_PROMPT.md');
|
|
76
|
+
if (!AgentFeature.doesFileExist(promptPath)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return promptPath;
|
|
80
|
+
}
|
|
81
|
+
checkHealth() {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const prompt = this.readSystemPromptFile();
|
|
84
|
+
if (!prompt) {
|
|
85
|
+
return {
|
|
86
|
+
status: 'failed',
|
|
87
|
+
errors: [
|
|
88
|
+
new SpruceError({
|
|
89
|
+
code: 'NO_SYSTEM_PROMPT_FILE',
|
|
90
|
+
}),
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
this.parseName(prompt);
|
|
96
|
+
return {
|
|
97
|
+
status: 'passed',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
return {
|
|
102
|
+
status: 'failed',
|
|
103
|
+
errors: [err],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
isInstalled() {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
return true;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
destroy() {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
115
|
+
}
|
|
116
|
+
isBooted() {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
onBoot(_cb) { }
|
|
120
|
+
}
|
|
121
|
+
export default (skill) => {
|
|
122
|
+
skill.registerFeature('agent', new AgentFeature(skill));
|
|
123
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.plugin.js","sourceRoot":"","sources":["../../src/plugins/agent.plugin.ts"],"names":[],"mappings":"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"}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as plugin } from './plugins/agent.plugin';
|
package/build/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.plugin = void 0;
|
|
7
|
+
var agent_plugin_1 = require("./plugins/agent.plugin");
|
|
8
|
+
Object.defineProperty(exports, "plugin", { enumerable: true, get: function () { return __importDefault(agent_plugin_1).default; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BootCallback, HealthCheckItem, Skill, SkillFeature } from '@sprucelabs/spruce-skill-utils';
|
|
2
|
+
export declare class AgentFeature implements SkillFeature {
|
|
3
|
+
private skill;
|
|
4
|
+
constructor(skill: Skill);
|
|
5
|
+
static doesFileExist(path: string): boolean;
|
|
6
|
+
execute(): Promise<void>;
|
|
7
|
+
private registePlatformAgent;
|
|
8
|
+
private connectToApi;
|
|
9
|
+
private parseName;
|
|
10
|
+
private InvalidPromptFileError;
|
|
11
|
+
private readSystemPromptFile;
|
|
12
|
+
private resolvePlatformPromptPath;
|
|
13
|
+
checkHealth(): Promise<HealthCheckItem>;
|
|
14
|
+
isInstalled(): Promise<boolean>;
|
|
15
|
+
destroy(): Promise<void>;
|
|
16
|
+
isBooted(): boolean;
|
|
17
|
+
onBoot(_cb: BootCallback): void;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: (skill: Skill) => void;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AgentFeature = void 0;
|
|
7
|
+
const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
|
|
8
|
+
const SpruceError_1 = __importDefault(require("../errors/SpruceError"));
|
|
9
|
+
class AgentFeature {
|
|
10
|
+
constructor(skill) {
|
|
11
|
+
this.skill = skill;
|
|
12
|
+
}
|
|
13
|
+
static doesFileExist(path) {
|
|
14
|
+
return spruce_skill_utils_1.diskUtil.doesFileExist(path);
|
|
15
|
+
}
|
|
16
|
+
async execute() {
|
|
17
|
+
const prompt = this.readSystemPromptFile();
|
|
18
|
+
if (!prompt) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const name = this.parseName(prompt);
|
|
22
|
+
await this.registePlatformAgent(name, prompt);
|
|
23
|
+
}
|
|
24
|
+
async registePlatformAgent(name, prompt) {
|
|
25
|
+
const client = await this.connectToApi();
|
|
26
|
+
await client.emitAndFlattenResponses('register-agent::v2020_12_25', {
|
|
27
|
+
payload: {
|
|
28
|
+
agent: {
|
|
29
|
+
name,
|
|
30
|
+
systemPrompt: prompt,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async connectToApi() {
|
|
36
|
+
const events = this.skill.getFeatureByCode('event');
|
|
37
|
+
const client = await events.connectToApi();
|
|
38
|
+
return client;
|
|
39
|
+
}
|
|
40
|
+
parseName(prompt) {
|
|
41
|
+
const promptSections = prompt.split('## AGENT NAME');
|
|
42
|
+
const lastSection = promptSections.length == 2 ? promptSections.pop() : undefined;
|
|
43
|
+
const lastSectionParts = lastSection?.trim()?.split('\n');
|
|
44
|
+
const name = lastSectionParts?.shift()?.trim();
|
|
45
|
+
if (!name) {
|
|
46
|
+
throw this.InvalidPromptFileError();
|
|
47
|
+
}
|
|
48
|
+
return name;
|
|
49
|
+
}
|
|
50
|
+
InvalidPromptFileError() {
|
|
51
|
+
return new SpruceError_1.default({
|
|
52
|
+
code: 'INVALID_SYSTEM_PROMPT_FILE',
|
|
53
|
+
path: this.resolvePlatformPromptPath(),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
readSystemPromptFile() {
|
|
57
|
+
const promptPath = this.resolvePlatformPromptPath();
|
|
58
|
+
if (!promptPath) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
const prompt = spruce_skill_utils_1.diskUtil.readFile(promptPath);
|
|
62
|
+
return prompt;
|
|
63
|
+
}
|
|
64
|
+
resolvePlatformPromptPath() {
|
|
65
|
+
const promptPath = spruce_skill_utils_1.diskUtil.resolvePath(this.skill.rootDir, 'agents', 'SYSTEM_PROMPT.md');
|
|
66
|
+
if (!AgentFeature.doesFileExist(promptPath)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return promptPath;
|
|
70
|
+
}
|
|
71
|
+
async checkHealth() {
|
|
72
|
+
const prompt = this.readSystemPromptFile();
|
|
73
|
+
if (!prompt) {
|
|
74
|
+
return {
|
|
75
|
+
status: 'failed',
|
|
76
|
+
errors: [
|
|
77
|
+
new SpruceError_1.default({
|
|
78
|
+
code: 'NO_SYSTEM_PROMPT_FILE',
|
|
79
|
+
}),
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
this.parseName(prompt);
|
|
85
|
+
return {
|
|
86
|
+
status: 'passed',
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
return {
|
|
91
|
+
status: 'failed',
|
|
92
|
+
errors: [err],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async isInstalled() {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
async destroy() { }
|
|
100
|
+
isBooted() {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
onBoot(_cb) { }
|
|
104
|
+
}
|
|
105
|
+
exports.AgentFeature = AgentFeature;
|
|
106
|
+
exports.default = (skill) => {
|
|
107
|
+
skill.registerFeature('agent', new AgentFeature(skill));
|
|
108
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sprucelabs/spruce-agent-plugin",
|
|
3
|
+
"description": "Allow your skill to register AI agents!",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"skill": {
|
|
6
|
+
"namespace": "spruce-agent-plugin"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/sprucelabsai/spruce-agent-plugin",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/sprucelabsai/spruce-agent-plugin/issues"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"build"
|
|
14
|
+
],
|
|
15
|
+
"main": "./build/index.js",
|
|
16
|
+
"types": "./build/index.d.ts",
|
|
17
|
+
"module": "./build/esm/index.js",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"keywords": [
|
|
20
|
+
"node",
|
|
21
|
+
"components",
|
|
22
|
+
"sprucebot",
|
|
23
|
+
"sprucelabs"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build.ci": "yarn run build.tsc && yarn run build.resolve-paths && yarn run lint",
|
|
27
|
+
"build.copy-files": "mkdir -p build && rsync -avzq --exclude='*.ts' ./src/ ./build/",
|
|
28
|
+
"build.dev": "yarn run build.tsc --sourceMap ; yarn run resolve-paths.lint",
|
|
29
|
+
"build.dist": "tsc --project tsconfig.dist.json && yarn build.resolve-paths && mv build esm && yarn build.esm-postbuild && yarn build.tsc && yarn build.resolve-paths && mv esm build/ && yarn clean.dist",
|
|
30
|
+
"build.esm-postbuild": "esm-postbuild --target esm --patterns '**/*.js'",
|
|
31
|
+
"build.resolve-paths": "resolve-path-aliases --target build --patterns '**/*.js,**/*.d.ts'",
|
|
32
|
+
"build.tsc": "yarn run build.copy-files && tsc",
|
|
33
|
+
"clean": "yarn run clean.build",
|
|
34
|
+
"clean.all": "yarn run clean.dependencies && yarn run clean.build",
|
|
35
|
+
"clean.build": "rm -rf build/",
|
|
36
|
+
"clean.dependencies": "rm -rf node_modules/ package-lock.json yarn.lock",
|
|
37
|
+
"clean.dist": "rm -rf build/__tests__ build/esm/__tests__",
|
|
38
|
+
"fix.lint.local": "eslint --fix --cache '**/*.ts'",
|
|
39
|
+
"lint": "eslint --cache '**/*.ts'",
|
|
40
|
+
"rebuild": "yarn run clean.all && yarn install && yarn run build.dev",
|
|
41
|
+
"release": "semantic-release",
|
|
42
|
+
"resolve-paths.lint": "yarn run build.resolve-paths ; yarn run lint",
|
|
43
|
+
"test": "jest",
|
|
44
|
+
"post.watch.build": "yarn run build.copy-files && yarn run build.resolve-paths",
|
|
45
|
+
"watch.build.dev": "tsc-watch --sourceMap --onCompilationComplete 'yarn run post.watch.build'",
|
|
46
|
+
"watch.rebuild": "yarn run clean.all && yarn install && yarn run watch.build.dev",
|
|
47
|
+
"watch.tsc": "tsc -w",
|
|
48
|
+
"lint.tsc": "tsc -p . --noEmit",
|
|
49
|
+
"fix.lint": "eslint --fix --cache '**/*.ts'",
|
|
50
|
+
"update.dependencies": "yarn run clean.dependencies && yarn"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@sprucelabs/error": "^7.1.27",
|
|
54
|
+
"@sprucelabs/globby": "^2.0.506",
|
|
55
|
+
"@sprucelabs/mercury-types": "^48.0.111",
|
|
56
|
+
"@sprucelabs/schema": "^32.1.58",
|
|
57
|
+
"@sprucelabs/spruce-core-schemas": "^41.3.6",
|
|
58
|
+
"@sprucelabs/spruce-event-plugin": "^74.1.30",
|
|
59
|
+
"@sprucelabs/spruce-event-utils": "^41.0.125",
|
|
60
|
+
"@sprucelabs/spruce-skill-utils": "^32.0.115",
|
|
61
|
+
"dotenv": "^17.2.3"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@sprucelabs/esm-postbuild": "^7.0.40",
|
|
65
|
+
"@sprucelabs/jest-json-reporter": "^9.0.60",
|
|
66
|
+
"@sprucelabs/jest-sheets-reporter": "^4.0.43",
|
|
67
|
+
"@sprucelabs/resolve-path-aliases": "^3.0.27",
|
|
68
|
+
"@sprucelabs/semantic-release": "^5.0.2",
|
|
69
|
+
"@sprucelabs/spruce-test-fixtures": "^74.1.30",
|
|
70
|
+
"@sprucelabs/test": "^10.0.23",
|
|
71
|
+
"@sprucelabs/test-utils": "^6.0.93",
|
|
72
|
+
"@types/node": "^24.6.2",
|
|
73
|
+
"chokidar-cli": "^3.0.0",
|
|
74
|
+
"eslint": "^9.36.0",
|
|
75
|
+
"eslint-config-spruce": "^11.2.26",
|
|
76
|
+
"jest": "^30.2.0",
|
|
77
|
+
"jest-circus": "^30.2.0",
|
|
78
|
+
"prettier": "^3.6.2",
|
|
79
|
+
"ts-node": "^10.9.2",
|
|
80
|
+
"tsc-watch": "^7.2.0",
|
|
81
|
+
"tsconfig-paths": "^4.2.0",
|
|
82
|
+
"typescript": "^5.9.3"
|
|
83
|
+
},
|
|
84
|
+
"jest": {
|
|
85
|
+
"maxWorkers": 4,
|
|
86
|
+
"testTimeout": 300000,
|
|
87
|
+
"testEnvironment": "node",
|
|
88
|
+
"testPathIgnorePatterns": [
|
|
89
|
+
"<rootDir>/tmp/",
|
|
90
|
+
"<rootDir>/src/",
|
|
91
|
+
"<rootDir>/node_modules/",
|
|
92
|
+
"<rootDir>/build/esm/"
|
|
93
|
+
],
|
|
94
|
+
"testMatch": [
|
|
95
|
+
"**/__tests__/**/*.test.js?(x)"
|
|
96
|
+
],
|
|
97
|
+
"moduleNameMapper": {
|
|
98
|
+
"^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"engines": {
|
|
102
|
+
"yarn": "1.x"
|
|
103
|
+
}
|
|
104
|
+
}
|