@rizom/brain 0.2.0-alpha.223 → 0.2.0-alpha.225
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/dist/brain.js +1007 -1001
- package/dist/chunks/blog-post-adapter-tk0z5tgh.js +5 -0
- package/dist/chunks/{index-ps0mn8y9.js → index-18d0wj5t.js} +4 -4
- package/dist/chunks/{index-ps0mn8y9.js.map → index-18d0wj5t.js.map} +1 -1
- package/dist/chunks/{index-px8fmtx1.js → index-1qz89akh.js} +4 -4
- package/dist/chunks/{index-px8fmtx1.js.map → index-1qz89akh.js.map} +1 -1
- package/dist/chunks/{index-vtwspye3.js → index-48mg443r.js} +3 -3
- package/dist/chunks/{index-vtwspye3.js.map → index-48mg443r.js.map} +1 -1
- package/dist/chunks/{index-0bjkx8vb.js → index-4xzx30t8.js} +4 -4
- package/dist/chunks/{index-0bjkx8vb.js.map → index-4xzx30t8.js.map} +2 -2
- package/dist/chunks/{index-gca7xnrh.js → index-e933mq3w.js} +3 -3
- package/dist/chunks/{index-gca7xnrh.js.map → index-e933mq3w.js.map} +1 -1
- package/dist/chunks/{index-nqjbkf5n.js → index-gaa2742w.js} +3 -3
- package/dist/chunks/{index-nqjbkf5n.js.map → index-gaa2742w.js.map} +1 -1
- package/dist/chunks/index-gfewwta6.js +6 -0
- package/dist/chunks/{index-59y15khc.js.map → index-gfewwta6.js.map} +2 -2
- package/dist/chunks/{index-57d1xga4.js → index-h1zmmtbw.js} +4 -4
- package/dist/chunks/{index-57d1xga4.js.map → index-h1zmmtbw.js.map} +1 -1
- package/dist/chunks/index-jm9vaxsh.js +10 -0
- package/dist/chunks/{index-836tm28j.js.map → index-jm9vaxsh.js.map} +8 -8
- package/dist/chunks/{index-c93wmj0d.js → index-q53nehd5.js} +4 -4
- package/dist/chunks/{index-c93wmj0d.js.map → index-q53nehd5.js.map} +3 -3
- package/dist/chunks/index-rng6ka15.js +6 -0
- package/dist/chunks/{index-t7hbrpyx.js.map → index-rng6ka15.js.map} +12 -12
- package/dist/chunks/{rss-datasource-c67ta2xa.js → rss-datasource-v805vq9d.js} +3 -3
- package/dist/chunks/{rss-datasource-c67ta2xa.js.map → rss-datasource-v805vq9d.js.map} +1 -1
- package/dist/deploy.js +1 -1
- package/dist/entities.js +2 -2
- package/dist/entities.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces.js +2 -2
- package/dist/interfaces.js.map +1 -1
- package/dist/plugins.d.ts +17 -5
- package/dist/plugins.js +3 -3
- package/dist/plugins.js.map +3 -3
- package/dist/seed-content/ranger/anchor-profile/anchor-profile.md +1 -1
- package/dist/seed-content/ranger/site-info/site-info.md +1 -0
- package/dist/seed-content/relay/site-info/site-info.md +1 -0
- package/dist/seed-content/rover-seed-content-core/anchor-profile/anchor-profile.md +1 -1
- package/dist/seed-content/rover-seed-content-core/style-guide/style-guide.md +48 -0
- package/dist/seed-content/rover-seed-content-default/anchor-profile/anchor-profile.md +1 -1
- package/dist/seed-content/rover-seed-content-default/site-info/site-info.md +1 -0
- package/dist/seed-content/rover-seed-content-default/style-guide/style-guide.md +48 -0
- package/dist/seed-content/rover-seed-content-full/anchor-profile/anchor-profile.md +1 -1
- package/dist/seed-content/rover-seed-content-full/site-info/site-info.md +1 -0
- package/dist/seed-content/rover-seed-content-full/style-guide/style-guide.md +48 -0
- package/dist/services.js +2 -2
- package/dist/services.js.map +1 -1
- package/dist/site.js +155 -160
- package/dist/site.js.map +33 -25
- package/dist/templates.js +2 -2
- package/dist/templates.js.map +1 -1
- package/dist/themes.js +1 -1
- package/dist/ui/cms-app.js +121 -121
- package/dist/ui/cms-app.js.map +6 -6
- package/package.json +1 -1
- package/dist/chunks/blog-post-adapter-gny02sy3.js +0 -5
- package/dist/chunks/index-59y15khc.js +0 -6
- package/dist/chunks/index-836tm28j.js +0 -10
- package/dist/chunks/index-t7hbrpyx.js +0 -6
- /package/dist/chunks/{blog-post-adapter-gny02sy3.js.map → blog-post-adapter-tk0z5tgh.js.map} +0 -0
package/dist/deploy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunks/index-
|
|
2
|
+
import"./chunks/index-48mg443r.js";import{appendFileSync as l,readFileSync as m}from"fs";var y=/^# ---- .+ ----$/;function p(e,t){let n=[],i=new Set,S=t?.skipSections??new Set,c=!1,s=!1,o=!1;for(let v of e.split(/\r?\n/)){let r=v.trim();if(y.test(r)){c=S.has(r),s=!1,o=!1;continue}if(c)continue;if(r.startsWith("#")){if(r.includes("@required"))s=!0;if(r.includes("@sensitive"))o=!0;continue}let u=r.match(/^([A-Z][A-Z0-9_]*)=/);if(!u?.[1]){s=!1,o=!1;continue}let a=u[1];if(!i.has(a))i.add(a),n.push({key:a,required:s,sensitive:o});s=!1,o=!1}return n}function d(e,t){return p(m(e,"utf8"),t)}async function f(e,t){let n=await e.text();if(!n)throw Error(`${t} returned an empty response (${e.status})`);try{return JSON.parse(n)}catch{throw Error(`${t} returned invalid JSON (${e.status}): ${n}`)}}function E(e){let t=m(e,"utf8");return Object.fromEntries(t.split(/\r?\n/).filter(Boolean).map((n)=>{let i=n.indexOf("=");return[n.slice(0,i),n.slice(i+1)]}))}function _(e){let t=process.env[e];if(!t)throw Error(`Missing ${e}`);return t}function h(e,t){let n=process.env.GITHUB_OUTPUT;if(n)l(n,`${e}=${t}
|
|
3
3
|
`)}function g(e,t){let n=process.env.GITHUB_ENV;if(!n)return;if(t.includes(`
|
|
4
4
|
`)){let i=`EOF_${e}_${Date.now().toString(36)}`;l(n,`${e}<<${i}
|
|
5
5
|
${t}
|
package/dist/entities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$ as r,R as t,S as e,V as a,W as n,X as i,ba as o,ca as s,da as p}from"./chunks/index-4xzx30t8.js";import"./chunks/index-18d0wj5t.js";import"./chunks/index-h1zmmtbw.js";import"./chunks/index-48mg443r.js";export{n as parseMarkdownWithFrontmatter,o as paginationInfoSchema,p as paginateItems,a as generateMarkdownWithFrontmatter,i as generateFrontmatter,s as buildPaginationInfo,e as baseEntitySchema,t as NOTE_ENTITY_TYPE,r as BaseEntityAdapter};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=FDF4FC52D673FDB564756E2164756E21
|
|
5
5
|
//# sourceMappingURL=entities.js.map
|
package/dist/entities.js.map
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Va as r,Wa as o}from"./chunks/index-h1zmmtbw.js";import"./chunks/index-48mg443r.js";function t(i){return i}var e={name:"@rizom/brain",version:"0.2.0-alpha.225",description:"Brain runtime + CLI \u2014 scaffold, run, and manage AI brain instances",keywords:["brain","ai","cli","mcp","agent","personal-ai","knowledge-management"],license:"Apache-2.0",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",bin:{brain:"./dist/brain.js"},bugs:"https://github.com/rizom-ai/brains/issues",dependencies:{"@clack/prompts":"^1.5.1","@modelcontextprotocol/sdk":"^1.29.0","@tailwindcss/postcss":"^4.3.1","@tailwindcss/typography":"^0.5.20",postcss:"^8.5.15",preact:"^10.27.2","preact-render-to-string":"^6.7.0",tailwindcss:"^4.3.1",zod:"^4.1.8"},devDependencies:{"@brains/app":"workspace:*","@brains/build-tools":"workspace:*","@brains/content-formatters":"workspace:*","@brains/deploy-support":"workspace:*","@brains/eslint-config":"workspace:*","@brains/mcp-service":"workspace:*","@brains/plugins":"workspace:*","@brains/ranger":"workspace:*","@brains/relay":"workspace:*","@brains/rover":"workspace:*","@brains/site-composition":"workspace:*","@brains/site-default":"workspace:*","@brains/site-personal":"workspace:*","@brains/site-professional":"workspace:*","@brains/theme-rizom":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@rizom/theme-default":"workspace:*","@types/bun":"^1.3.14",rolldown:"^1.0.0","rolldown-plugin-dts":"^0.27.4",typescript:"^7.0.2"},engines:{bun:">=1.3.3"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./cli":"./dist/brain.js","./plugins":{types:"./dist/plugins.d.ts",import:"./dist/plugins.js"},"./entities":{types:"./dist/entities.d.ts",import:"./dist/entities.js"},"./services":{types:"./dist/services.d.ts",import:"./dist/services.js"},"./interfaces":{types:"./dist/interfaces.d.ts",import:"./dist/interfaces.js"},"./templates":{types:"./dist/templates.d.ts",import:"./dist/templates.js"},"./site":{types:"./dist/site.d.ts",import:"./dist/site.js"},"./themes":{types:"./dist/themes.d.ts",import:"./dist/themes.js"},"./deploy":{types:"./dist/deploy.d.ts",import:"./dist/deploy.js"},"./tsconfig.instance.json":"./tsconfig.instance.json"},files:["dist","templates","tsconfig.instance.json"],homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brain-cli#readme",optionalDependencies:{"@bitwarden/sdk-napi":"^1.0.0","@libsql/client":"^0.17.4","@tailwindcss/oxide":"^4.1.4",lightningcss:"^1.29.2","playwright-core":"^1.61.0","react-devtools-core":"^7.0.1",sharp:"^0.35.1"},publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brain-cli"},scripts:{build:"bun scripts/build.ts","dev:start":"bun scripts/build.ts && bun dist/brain.js start",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",prepublishOnly:"bun scripts/build.ts",test:"bun test",typecheck:"tsc --noEmit"},type:"module"};var n=e.version;export{o as z,t as defineBrain,r as ZodError,n as PLUGIN_API_VERSION};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=D9FF5B6D6696260464756E2164756E21
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import packageJson from \"../package.json\" with { type: \"json\" };\n\n/**\n * Pre-v1 external plugin API marker.\n *\n * During alpha, the external plugin API compatibility marker tracks the\n * published @rizom/brain package version. Once the plugin API is declared\n * stable, this can move to an independent semver contract such as 1.0.0.\n */\nexport const PLUGIN_API_VERSION: string = packageJson.version;\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";0FA0EO,UAAS,CAAW,CAAC,EAA8C,CACxE,OAAO,6yFClEF,IAAM,EAA6B,EAAY",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "D9FF5B6D6696260464756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/interfaces.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ea as d,fa as f,ga as h,ha as j,ia as k,ja as q,pa as w,qa as x}from"./chunks/index-q53nehd5.js";import"./chunks/index-18d0wj5t.js";import{Qa as v}from"./chunks/index-e933mq3w.js";import"./chunks/index-h1zmmtbw.js";import"./chunks/index-48mg443r.js";export{v as UserPermissionLevelSchema,j as UnregisterRoutesPayloadSchema,f as RouteDefinitionSchema,h as RegisterRoutesPayloadSchema,d as NavigationSlots,w as MessageResponseSchema,k as ListRoutesPayloadSchema,q as GetRoutePayloadSchema,x as BaseMessageSchema};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=C54F76659032025E64756E2164756E21
|
|
5
5
|
//# sourceMappingURL=interfaces.js.map
|
package/dist/interfaces.js.map
CHANGED
package/dist/plugins.d.ts
CHANGED
|
@@ -330,6 +330,14 @@ interface UploadSaveHandlerRegistration {
|
|
|
330
330
|
mediaTypes: string[];
|
|
331
331
|
handler: UploadSaveHandler;
|
|
332
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* Called before an entity is persisted (on create or update). Throws to reject
|
|
335
|
+
* the write with an operator-facing error. Use this for cross-entity invariants
|
|
336
|
+
* the per-entity Zod schema cannot express.
|
|
337
|
+
*/
|
|
338
|
+
type PersistValidator<T extends BaseEntity = BaseEntity> = (entity: T, context: {
|
|
339
|
+
operation: "create" | "update";
|
|
340
|
+
}) => Promise<void>;
|
|
333
341
|
/**
|
|
334
342
|
* Interface for entity adapter - handles conversion between entities and markdown
|
|
335
343
|
* following the hybrid storage model
|
|
@@ -663,6 +671,8 @@ interface IEntitiesNamespace {
|
|
|
663
671
|
}>;
|
|
664
672
|
/** Register a data source for dynamic content */
|
|
665
673
|
registerDataSource(dataSource: DataSource): void;
|
|
674
|
+
/** Register plugin-owned validation that runs before create/update persistence. */
|
|
675
|
+
registerPersistValidator(entityType: string, validator: PersistValidator): void;
|
|
666
676
|
/** Register a create interceptor for this plugin's entity type */
|
|
667
677
|
registerCreateInterceptor(entityType: string, interceptor: CreateInterceptor): void;
|
|
668
678
|
/** Register a raw-upload durable save handler for this plugin's entity type */
|
|
@@ -855,11 +865,17 @@ declare const entityCountSchema: z.ZodObject<{
|
|
|
855
865
|
/**
|
|
856
866
|
* Content generation configuration - unified config object
|
|
857
867
|
*/
|
|
868
|
+
interface GenerationStyleGuide {
|
|
869
|
+
voice?: string;
|
|
870
|
+
visual?: string;
|
|
871
|
+
}
|
|
858
872
|
interface ContentGenerationConfig {
|
|
859
873
|
prompt: string;
|
|
860
874
|
templateName: string;
|
|
861
875
|
conversationHistory?: string;
|
|
862
876
|
data?: Record<string, unknown>;
|
|
877
|
+
representedIdentity?: "brain" | "anchor" | "none";
|
|
878
|
+
styleGuide?: GenerationStyleGuide;
|
|
863
879
|
interfacePermissionGrant?: UserPermissionLevel;
|
|
864
880
|
}
|
|
865
881
|
//#endregion
|
|
@@ -943,11 +959,6 @@ declare const BrainCharacterSchema: z.ZodObject<{
|
|
|
943
959
|
type BrainCharacter = z.output<typeof BrainCharacterSchema>;
|
|
944
960
|
declare const AnchorProfileSchema: z.ZodObject<{
|
|
945
961
|
name: z.ZodString;
|
|
946
|
-
kind: z.ZodEnum<{
|
|
947
|
-
professional: "professional";
|
|
948
|
-
team: "team";
|
|
949
|
-
collective: "collective";
|
|
950
|
-
}>;
|
|
951
962
|
organization: z.ZodOptional<z.ZodString>;
|
|
952
963
|
description: z.ZodOptional<z.ZodString>;
|
|
953
964
|
avatar: z.ZodOptional<z.ZodString>;
|
|
@@ -1072,6 +1083,7 @@ interface Plugin {
|
|
|
1072
1083
|
readonly packageName: string;
|
|
1073
1084
|
readonly description?: string;
|
|
1074
1085
|
readonly dependencies?: string[];
|
|
1086
|
+
finalizeRegistration?(): Promise<void>;
|
|
1075
1087
|
ready?(): Promise<void>;
|
|
1076
1088
|
shutdown?(): Promise<void>;
|
|
1077
1089
|
requiresDaemonStartup?(): boolean;
|
package/dist/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{n as N,o as D,p as A,q as U,s as c,t as l,u as y,v as P,w as B,x as O}from"./chunks/index-jm9vaxsh.js";import"./chunks/index-4xzx30t8.js";import{oa as w,pa as W,qa as _}from"./chunks/index-q53nehd5.js";import{ra as E,ua as b,va as k}from"./chunks/index-18d0wj5t.js";import"./chunks/index-e933mq3w.js";import{Wa as o}from"./chunks/index-h1zmmtbw.js";import"./chunks/index-48mg443r.js";function v(e){return e}function R(e){return e}function C(e){return e===void 0?{success:!0}:{success:!0,data:e}}function S(e){return{success:!1,error:e}}var x=o.object({captureUrls:o.boolean().default(!1),blockedUrlDomains:o.array(o.string()).default(["meet.google.com","zoom.us","teams.microsoft.com","whereby.com","gather.town","calendly.com","cal.com","discord.com","discord.gg","cdn.discordapp.com","media.discordapp.net","giphy.com","tenor.com","wetransfer.com","file.io"])});function I(e,t){return{name:e,schema:t}}class p extends c{hooks;constructor(e,t,i,r,n){super(e,t,i,r);this.hooks=n}get entityType(){return this.hooks.getEntityType()}get schema(){return this.hooks.getSchema()}get adapter(){return this.hooks.getAdapter()}onRegister(e){return this.hooks.onRegister(e)}onReady(e){return this.hooks.onReady(e)}onShutdown(){return this.hooks.onShutdown()}getEntityTypeConfig(){return this.hooks.getEntityTypeConfig()}getDataSources(){return this.hooks.getDataSources()}getInstructions(){return this.hooks.getInstructions()}interceptCreate(e,t,i){return this.hooks.interceptCreate(e,t,i)}}class u{type="entity";id;version;packageName;description;delegate;constructor(e,t,i,r){if(this.id=e,this.version=t.version,this.packageName=t.name,t.description!==void 0)this.description=t.description;this.delegate=new p(e,t,i,r,{getEntityType:()=>this.entityType,getSchema:()=>this.schema,getAdapter:()=>this.adapter,onRegister:(n)=>this.onRegister(n),onReady:(n)=>this.onReady(n),onShutdown:()=>this.onShutdown(),getEntityTypeConfig:()=>this.getEntityTypeConfig(),getDataSources:()=>this.getDataSources(),getInstructions:()=>this.getInstructions(),interceptCreate:(n,a,T)=>this.interceptCreate(n,a,T)})}register(e,t){return this.delegate.register(e,t)}async onRegister(e){}async onReady(e){}async onShutdown(){}async getInstructions(){return}getEntityTypeConfig(){return}getDataSources(){return[]}async interceptCreate(e,t,i){return{kind:"continue",input:e}}ready(){return this.delegate.ready()}shutdown(){return this.delegate.shutdown?.()??Promise.resolve()}}class m extends l{hooks;constructor(e,t,i,r,n){super(e,t,i,r);this.hooks=n}onRegister(e){return this.hooks.onRegister(e)}onReady(e){return this.hooks.onReady(e)}onShutdown(){return this.hooks.onShutdown()}getTools(){return this.hooks.getTools()}getResources(){return this.hooks.getResources()}getInstructions(){return this.hooks.getInstructions()}getWebRoutes(){return this.hooks.getWebRoutes()}requiresDaemonStartup(){return this.hooks.requiresDaemonStartup()}}class s{type="interface";id;version;packageName;description;delegate;constructor(e,t,i,r){if(this.id=e,this.version=t.version,this.packageName=t.name,t.description!==void 0)this.description=t.description;this.delegate=new m(e,t,i,r,{onRegister:(n)=>this.onRegister(n),onReady:(n)=>this.onReady(n),onShutdown:()=>this.onShutdown(),getTools:()=>this.getTools(),getResources:()=>this.getResources(),getInstructions:()=>this.getInstructions(),getWebRoutes:()=>this.getWebRoutes(),requiresDaemonStartup:()=>this.requiresDaemonStartup()})}register(e,t){return this.delegate.register(e,t)}async onRegister(e){}async onReady(e){}async onShutdown(){}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}getWebRoutes(){return[]}requiresDaemonStartup(){return!1}ready(){return this.delegate.ready()}shutdown(){return this.delegate.shutdown?.()??Promise.resolve()}}class f extends y{hooks;constructor(e,t,i,r,n){super(e,t,i,r);this.hooks=n}async onRegister(e){await super.onRegister(e),await this.hooks.onRegister(e)}onReady(e){return this.hooks.onReady(e)}onShutdown(){return this.hooks.onShutdown()}getTools(){return this.hooks.getTools()}getResources(){return this.hooks.getResources()}getInstructions(){return this.hooks.getInstructions()}getWebRoutes(){return this.hooks.getWebRoutes()}requiresDaemonStartup(){return this.hooks.requiresDaemonStartup()}sendMessageToChannel(e){this.hooks.sendMessageToChannel(e)}sendMessageWithId(e){return this.hooks.sendMessageWithId(e)}editMessage(e){return this.hooks.editMessage(e)}supportsMessageEditing(){return this.hooks.supportsMessageEditing()}onProgressUpdate(e){return this.hooks.onProgressUpdate(e)}trackAgentResponseForJobPublic(e,t,i){this.trackAgentResponseForJob(e,t,i)}captureUrlViaAgentPublic(e,t,i,r,n){return this.captureUrlViaAgent(e,t,i,r,n)}getCurrentChannelIdPublic(){return this.getCurrentChannelId()}}class d extends s{messageDelegate;constructor(e,t,i,r){super(e,t,i,r);this.messageDelegate=new f(e,t,i,r,{onRegister:(n)=>this.onRegister(n),onReady:(n)=>this.onReady(n),onShutdown:()=>this.onShutdown(),getTools:()=>this.getTools(),getResources:()=>this.getResources(),getInstructions:()=>this.getInstructions(),getWebRoutes:()=>this.getWebRoutes(),requiresDaemonStartup:()=>this.requiresDaemonStartup(),sendMessageToChannel:(n)=>this.sendMessageToChannel(n),sendMessageWithId:(n)=>this.sendMessageWithId(n),editMessage:(n)=>this.editMessage(n),supportsMessageEditing:()=>this.supportsMessageEditing(),onProgressUpdate:(n)=>this.onProgressUpdate(n)})}register(e,t){return this.messageDelegate.register(e,t)}async onRegister(e){}async onReady(e){}async onShutdown(){}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}sendMessageWithId(e){return Promise.resolve(void 0)}editMessage(e){return Promise.resolve(!1)}supportsMessageEditing(){return!1}async onProgressUpdate(e){}isUploadableTextFile(e,t){let i=[".md",".txt",".markdown"];if(t&&["text/plain","text/markdown","text/x-markdown"].some((n)=>t.startsWith(n)))return!0;return i.some((n)=>e.toLowerCase().endsWith(n))}isFileSizeAllowed(e){return e<=1e5}formatFileUploadMessage(e,t){return`User uploaded a file "${e}":
|
|
3
3
|
|
|
4
|
-
${t}`}extractCaptureableUrls(e,t){let i=e.match(/https?:\/\/[^\s<>"{}|\\^`[\]]+?(?=[,;:\s]|$)/gi)??[];return[...new Set(i)].filter((r)=>{try{let{hostname:n}=new URL(r);return!t.some((a)=>n===a||n.endsWith(`.${a}`))}catch{return!1}})}captureUrlViaAgent(e,t,i,r,n){return this.messageDelegate.captureUrlViaAgentPublic(e,t,i,r,n)}trackAgentResponseForJob(e,t,i){this.messageDelegate.trackAgentResponseForJobPublic(e,t,i)}registerProgressCallback(e){this.messageDelegate.registerProgressCallback(e)}unregisterProgressCallback(){this.messageDelegate.unregisterProgressCallback()}getProgressEvents(){return this.messageDelegate.getProgressEvents()}getActiveProgressEvents(){return this.messageDelegate.getActiveProgressEvents()}startProcessingInput(e=null){this.messageDelegate.startProcessingInput(e)}endProcessingInput(){this.messageDelegate.endProcessingInput()}getCurrentChannelId(){return this.messageDelegate.getCurrentChannelIdPublic()}ready(){return this.messageDelegate.ready()}shutdown(){return this.messageDelegate.shutdown?.()??Promise.resolve()}}class h extends P{hooks;constructor(e,t,i,r,n){super(e,t,i,r);this.hooks=n}onRegister(e){return this.hooks.onRegister(e)}onReady(e){return this.hooks.onReady(e)}onShutdown(){return this.hooks.onShutdown()}getTools(){return this.hooks.getTools()}getResources(){return this.hooks.getResources()}getInstructions(){return this.hooks.getInstructions()}}class
|
|
4
|
+
${t}`}extractCaptureableUrls(e,t){let i=e.match(/https?:\/\/[^\s<>"{}|\\^`[\]]+?(?=[,;:\s]|$)/gi)??[];return[...new Set(i)].filter((r)=>{try{let{hostname:n}=new URL(r);return!t.some((a)=>n===a||n.endsWith(`.${a}`))}catch{return!1}})}captureUrlViaAgent(e,t,i,r,n){return this.messageDelegate.captureUrlViaAgentPublic(e,t,i,r,n)}trackAgentResponseForJob(e,t,i){this.messageDelegate.trackAgentResponseForJobPublic(e,t,i)}registerProgressCallback(e){this.messageDelegate.registerProgressCallback(e)}unregisterProgressCallback(){this.messageDelegate.unregisterProgressCallback()}getProgressEvents(){return this.messageDelegate.getProgressEvents()}getActiveProgressEvents(){return this.messageDelegate.getActiveProgressEvents()}startProcessingInput(e=null){this.messageDelegate.startProcessingInput(e)}endProcessingInput(){this.messageDelegate.endProcessingInput()}getCurrentChannelId(){return this.messageDelegate.getCurrentChannelIdPublic()}ready(){return this.messageDelegate.ready()}shutdown(){return this.messageDelegate.shutdown?.()??Promise.resolve()}}class h extends P{hooks;constructor(e,t,i,r,n){super(e,t,i,r);this.hooks=n}onRegister(e){return this.hooks.onRegister(e)}onReady(e){return this.hooks.onReady(e)}onShutdown(){return this.hooks.onShutdown()}getTools(){return this.hooks.getTools()}getResources(){return this.hooks.getResources()}getInstructions(){return this.hooks.getInstructions()}}class g{type="service";id;version;packageName;description;delegate;constructor(e,t,i,r){if(this.id=e,this.version=t.version,this.packageName=t.name,t.description!==void 0)this.description=t.description;this.delegate=new h(e,t,i,r,{onRegister:(n)=>this.onRegister(n),onReady:(n)=>this.onReady(n),onShutdown:()=>this.onShutdown(),getTools:()=>this.getTools(),getResources:()=>this.getResources(),getInstructions:()=>this.getInstructions()})}register(e,t){return this.delegate.register(e,t)}async onRegister(e){}async onReady(e){}async onShutdown(){}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}ready(){return this.delegate.ready()}shutdown(){return this.delegate.shutdown?.()??Promise.resolve()}}export{x as urlCaptureConfigSchema,C as toolSuccess,S as toolError,I as defineChannel,v as createTool,R as createResource,b as ToolResultDataSchema,g as ServicePlugin,E as PendingConfirmationSchema,D as MessageSchema,W as MessageResponseSchema,d as MessageInterfacePlugin,s as InterfacePlugin,w as ExtensionMetadataSchema,u as EntityPlugin,N as ConversationSchema,B as ChatContextSchema,A as BrainCharacterSchema,_ as BaseMessageSchema,O as AppInfoSchema,U as AnchorProfileSchema,k as AgentResponseSchema};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
6
|
+
//# debugId=C6919AA775FA2EAF64756E2164756E21
|
|
7
7
|
//# sourceMappingURL=plugins.js.map
|
package/dist/plugins.js.map
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../shell/plugins/src/public/types.ts", "../../../shell/plugins/src/public/entity-plugin.ts", "../../../shell/plugins/src/public/interface-plugin.ts", "../../../shell/plugins/src/public/message-interface-plugin.ts", "../../../shell/plugins/src/public/service-plugin.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type {\n ContentVisibility,\n CountEntitiesRequest,\n EntitySearchRequest,\n SearchWithDistancesRequest,\n GetEntityRequest,\n ICoreEntityService,\n IEntitiesNamespace,\n ProjectSemanticSpaceRequest,\n SemanticEntityReference,\n SemanticSpaceDistanceRange,\n SemanticSpaceNeighbor,\n SemanticSpaceOrigin,\n SemanticSpacePoint,\n SemanticSpaceProjection,\n ListEntitiesRequest,\n ListOptions,\n SearchOptions,\n SearchResult,\n} from \"@brains/entity-service\";\nimport type {\n EntityAction,\n OutputFormat,\n UserPermissionLevel,\n} from \"@brains/templates\";\nimport { z } from \"@brains/utils/zod\";\nimport type { AgentNamespace } from \"../contracts/agent\";\nimport type { AppInfo } from \"../contracts/app-info\";\nimport type { Conversation, Message } from \"../contracts/conversations\";\nimport type { AnchorProfile, BrainCharacter } from \"../contracts/identity\";\nimport type {\n MessageResponse,\n MessageSender,\n MessageWithPayload,\n} from \"../contracts/messaging\";\nimport type { IEntityAINamespace } from \"../entity/context\";\n\nexport type PluginConfig = Record<string, unknown>;\nexport type PluginConfigInput<T extends { _input: unknown }> = T[\"_input\"];\n\nexport interface SafeParserSchema<T> {\n safeParse(\n input: unknown,\n ):\n { success: true; data: T } | { success: false; error: { message: string } };\n}\n\nexport interface JudgeInput<T> {\n instruction: string;\n material: string;\n schema: z.ZodType<T, unknown>;\n}\n\nexport interface Plugin {\n readonly id: string;\n readonly version: string;\n readonly type: \"core\" | \"entity\" | \"service\" | \"interface\";\n readonly packageName: string;\n readonly description?: string;\n readonly dependencies?: string[];\n ready?(): Promise<void>;\n shutdown?(): Promise<void>;\n requiresDaemonStartup?(): boolean;\n}\n\nexport type PluginFactory = (config: PluginConfig) => Plugin | Plugin[];\n\nexport interface Logger {\n debug(message: string, data?: unknown): void;\n info(message: string, data?: unknown): void;\n warn(message: string, data?: unknown): void;\n error(message: string, data?: unknown): void;\n child(context: string): Logger;\n}\n\nexport interface ToolContext {\n progressToken?: string | number;\n sendProgress?: (notification: {\n progress?: number;\n total?: number;\n message?: string;\n }) => Promise<void>;\n interfaceType?: string;\n userId?: string;\n conversationId?: string;\n channelId?: string;\n channelName?: string;\n runId?: string;\n toolCallId?: string;\n userPermissionLevel?: UserPermissionLevel;\n}\n\nexport interface ToolResponse<T = unknown> {\n success: boolean;\n data?: T;\n error?: string;\n}\n\nexport type ToolVisibility = UserPermissionLevel;\n\nexport interface ToolConfirmation {\n required: boolean;\n message?: string;\n}\n\nexport type ToolSideEffects = \"none\" | \"writes\" | \"external\";\n\nexport interface Tool<TArgs = unknown, TResult = unknown> {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n handler: (args: TArgs, context: ToolContext) => Promise<TResult> | TResult;\n visibility?: ToolVisibility;\n confirmation?: ToolConfirmation;\n sideEffects?: ToolSideEffects;\n}\n\nexport interface Resource<TResult = unknown> {\n uri: string;\n name: string;\n description?: string;\n mimeType?: string;\n handler: () => Promise<TResult> | TResult;\n}\n\nexport interface ResourceTemplate<K extends string = string> {\n uriTemplate: K;\n name: string;\n description?: string;\n mimeType?: string;\n}\n\nexport interface Prompt {\n name: string;\n description?: string;\n arguments?: Array<{ name: string; description?: string; required?: boolean }>;\n}\n\nexport function createTool<TArgs = unknown, TResult = unknown>(\n tool: Tool<TArgs, TResult>,\n): Tool<TArgs, TResult> {\n return tool;\n}\n\nexport function createResource<TResult = unknown>(\n resource: Resource<TResult>,\n): Resource<TResult> {\n return resource;\n}\n\nexport function toolSuccess<T = unknown>(data?: T): ToolResponse<T> {\n return data === undefined ? { success: true } : { success: true, data };\n}\n\nexport function toolError(error: string): ToolResponse<never> {\n return { success: false, error };\n}\n\nexport interface BaseJobTrackingInfo {\n rootJobId: string;\n}\n\nexport interface MessageJobTrackingInfo extends BaseJobTrackingInfo {\n messageId?: string;\n channelId?: string;\n}\n\nexport type JobProgressStatus =\n \"pending\" | \"processing\" | \"completed\" | \"failed\";\n\nexport interface JobProgressContext {\n rootJobId: string;\n operationType:\n | \"file_operations\"\n | \"content_operations\"\n | \"data_processing\"\n | \"batch_processing\";\n pluginId?: string | undefined;\n progressToken?: string | number | undefined;\n operationTarget?: string | undefined;\n interfaceType?: string | undefined;\n conversationId?: string | undefined;\n channelId?: string | undefined;\n}\n\nexport interface JobProgressEvent {\n id: string;\n type: \"job\" | \"batch\";\n status: JobProgressStatus;\n message?: string | undefined;\n progress?:\n | {\n current: number;\n total: number;\n percentage: number;\n }\n | undefined;\n aggregationKey?: string | undefined;\n batchDetails?:\n | {\n totalOperations: number;\n completedOperations: number;\n failedOperations: number;\n currentOperation?: string | undefined;\n errors?: string[] | undefined;\n }\n | undefined;\n jobDetails?:\n | {\n jobType: string;\n priority: number;\n retryCount: number;\n }\n | undefined;\n metadata: JobProgressContext;\n}\n\nexport const urlCaptureConfigSchema: z.ZodObject<{\n captureUrls: z.ZodDefault<z.ZodBoolean>;\n blockedUrlDomains: z.ZodDefault<z.ZodArray<z.ZodString>>;\n}> = z.object({\n captureUrls: z.boolean().default(false),\n blockedUrlDomains: z\n .array(z.string())\n .default([\n \"meet.google.com\",\n \"zoom.us\",\n \"teams.microsoft.com\",\n \"whereby.com\",\n \"gather.town\",\n \"calendly.com\",\n \"cal.com\",\n \"discord.com\",\n \"discord.gg\",\n \"cdn.discordapp.com\",\n \"media.discordapp.net\",\n \"giphy.com\",\n \"tenor.com\",\n \"wetransfer.com\",\n \"file.io\",\n ]),\n});\n\nexport interface Channel<TPayload, TResponse = unknown> {\n readonly name: string;\n readonly schema: SafeParserSchema<TPayload>;\n readonly _response?: TResponse;\n}\n\nexport function defineChannel<TPayload, TResponse = unknown>(\n name: string,\n schema: SafeParserSchema<TPayload>,\n): Channel<TPayload, TResponse> {\n return { name, schema };\n}\n\ntype PublicEntityServiceMethods =\n | \"getEntity\"\n | \"listEntities\"\n | \"search\"\n | \"searchWithDistances\"\n | \"getEntityTypes\"\n | \"hasEntityType\"\n | \"countEntities\"\n | \"getEntityCounts\"\n | \"getEntityTypeConfig\";\n\nexport type IEntityService = Pick<\n ICoreEntityService,\n PublicEntityServiceMethods\n>;\n\nexport type {\n CountEntitiesRequest,\n EntitySearchRequest,\n SearchWithDistancesRequest,\n GetEntityRequest,\n IEntitiesNamespace,\n ProjectSemanticSpaceRequest,\n SemanticEntityReference,\n SemanticSpaceDistanceRange,\n SemanticSpaceNeighbor,\n SemanticSpaceOrigin,\n SemanticSpacePoint,\n SemanticSpaceProjection,\n ListEntitiesRequest,\n ListOptions,\n SearchOptions,\n SearchResult,\n};\n\nexport interface IIdentityNamespace {\n get: () => BrainCharacter;\n getProfile: () => AnchorProfile;\n getAppInfo: () => Promise<AppInfo>;\n}\n\nexport interface IConversationsNamespace {\n get(conversationId: string): Promise<Conversation | null>;\n search(query: string): Promise<Conversation[]>;\n list(options?: {\n limit?: number;\n updatedAfter?: string;\n interfaceType?: string;\n sessionId?: string;\n channelId?: string;\n }): Promise<Conversation[]>;\n getMessages(\n conversationId: string,\n options?: { limit?: number; range?: { start: number; end: number } },\n ): Promise<Message[]>;\n}\n\nexport interface IMessagingNamespace {\n send: MessageSender;\n subscribe<T = unknown, R = unknown>(\n channel: string | Channel<T, R>,\n handler: (message: MessageWithPayload<T>) => Promise<MessageResponse<R>>,\n ): () => void;\n}\n\nexport type EvalHandler<TInput = unknown, TOutput = unknown> = (\n input: TInput,\n) => Promise<TOutput>;\n\nexport type InsightHandler = (\n entityService: IEntityService,\n visibilityScope: ContentVisibility,\n) => Promise<Record<string, unknown>>;\n\nexport interface IEvalNamespace {\n registerHandler(handlerId: string, handler: EvalHandler): void;\n}\n\nexport interface IInsightsNamespace {\n register(type: string, handler: InsightHandler): void;\n}\n\nexport interface ISemanticNamespace {\n project(\n request: ProjectSemanticSpaceRequest,\n ): Promise<SemanticSpaceProjection>;\n}\n\nexport interface IPermissionsNamespace {\n assertEntityActionAllowed(\n entityType: string,\n action: EntityAction,\n context: { userPermissionLevel?: UserPermissionLevel | undefined },\n ): void;\n}\n\nexport interface RuntimeUploadRecord {\n id: string;\n ref: { kind: string; id: string };\n filename: string;\n mediaType: string;\n sizeBytes: number;\n createdAt: string;\n metadata?: Record<string, unknown> | undefined;\n}\n\nexport interface RuntimeUploadResponseBody extends RuntimeUploadRecord {\n url: string;\n downloadUrl: string;\n}\n\nexport interface ResolvedRuntimeUpload {\n record: RuntimeUploadRecord;\n content: Buffer;\n}\n\nexport interface SaveRuntimeUploadInput {\n filename: string;\n mediaType: string;\n content: Buffer;\n metadata?: Record<string, unknown> | undefined;\n}\n\nexport interface RuntimeUploadScopeOptions {\n namespace: string;\n refKind: string;\n routePath: string;\n retentionMs?: number | undefined;\n maxCount?: number | undefined;\n}\n\nexport interface RuntimeUploadStore {\n save(input: SaveRuntimeUploadInput): Promise<RuntimeUploadRecord>;\n read(uploadId: string): Promise<ResolvedRuntimeUpload>;\n readRecord(uploadId: string): Promise<RuntimeUploadRecord>;\n toResponseBody(record: RuntimeUploadRecord): RuntimeUploadResponseBody;\n prune(): Promise<void>;\n getUploadDir(uploadId: string): string;\n}\n\nexport interface IRuntimeUploadsNamespace {\n scoped(options: RuntimeUploadScopeOptions): RuntimeUploadStore;\n}\n\nexport interface BasePluginContext {\n readonly pluginId: string;\n readonly logger: Logger;\n readonly dataDir: string;\n readonly domain: string | undefined;\n readonly siteUrl: string | undefined;\n readonly localSiteUrl: string | undefined;\n readonly previewUrl: string | undefined;\n readonly preferLocalUrls: boolean;\n readonly appInfo: () => Promise<AppInfo>;\n readonly judge: <T>(input: JudgeInput<T>) => Promise<{\n verdict: T;\n usage: {\n promptTokens: number;\n completionTokens: number;\n totalTokens: number;\n };\n }>;\n readonly entityService: IEntityService;\n readonly semantic: ISemanticNamespace;\n readonly identity: IIdentityNamespace;\n readonly messaging: IMessagingNamespace;\n readonly conversations: IConversationsNamespace;\n readonly eval: IEvalNamespace;\n readonly insights: IInsightsNamespace;\n readonly permissions: IPermissionsNamespace;\n readonly uploads: IRuntimeUploadsNamespace;\n}\n\nexport interface IPromptsNamespace {\n resolve(target: string, fallback: string): Promise<string>;\n}\n\nexport interface IServiceTemplatesNamespace {\n register(templates: unknown): void;\n}\n\nexport interface IViewsNamespace {\n get(name: string): unknown | undefined;\n list(): unknown[];\n hasRenderer(templateName: string, format?: OutputFormat): boolean;\n getRenderer(templateName: string, format?: OutputFormat): unknown | undefined;\n validate(templateName: string, content: unknown): boolean;\n}\n\nexport interface FrontmatterSchemaParser {\n parse(data: unknown): unknown;\n}\n\nexport interface EntityPluginEntitiesNamespace extends Omit<\n IEntitiesNamespace,\n \"getEffectiveFrontmatterSchema\"\n> {\n getEffectiveFrontmatterSchema(\n type: string,\n ): FrontmatterSchemaParser | undefined;\n}\n\nexport interface ServicePluginContext extends BasePluginContext {\n readonly entities: IEntitiesNamespace;\n readonly templates: IServiceTemplatesNamespace;\n readonly views: IViewsNamespace;\n readonly prompts: IPromptsNamespace;\n readonly ai: IEntityAINamespace;\n registerInstructions(instructions: string): void;\n}\n\nexport interface EntityPluginContext extends BasePluginContext {\n readonly entities: EntityPluginEntitiesNamespace;\n readonly prompts: IPromptsNamespace;\n}\n\nexport interface InterfacePluginContext extends BasePluginContext {\n readonly agent: AgentNamespace;\n}\n",
|
|
5
|
+
"import type {\n ContentVisibility,\n CountEntitiesRequest,\n EntitySearchRequest,\n SearchWithDistancesRequest,\n GetEntityRequest,\n ICoreEntityService,\n IEntitiesNamespace,\n ProjectSemanticSpaceRequest,\n SemanticEntityReference,\n SemanticSpaceDistanceRange,\n SemanticSpaceNeighbor,\n SemanticSpaceOrigin,\n SemanticSpacePoint,\n SemanticSpaceProjection,\n ListEntitiesRequest,\n ListOptions,\n SearchOptions,\n SearchResult,\n} from \"@brains/entity-service\";\nimport type {\n EntityAction,\n OutputFormat,\n UserPermissionLevel,\n} from \"@brains/templates\";\nimport { z } from \"@brains/utils/zod\";\nimport type { AgentNamespace } from \"../contracts/agent\";\nimport type { AppInfo } from \"../contracts/app-info\";\nimport type { Conversation, Message } from \"../contracts/conversations\";\nimport type { AnchorProfile, BrainCharacter } from \"../contracts/identity\";\nimport type {\n MessageResponse,\n MessageSender,\n MessageWithPayload,\n} from \"../contracts/messaging\";\nimport type { IEntityAINamespace } from \"../entity/context\";\n\nexport type PluginConfig = Record<string, unknown>;\nexport type PluginConfigInput<T extends { _input: unknown }> = T[\"_input\"];\n\nexport interface SafeParserSchema<T> {\n safeParse(\n input: unknown,\n ):\n { success: true; data: T } | { success: false; error: { message: string } };\n}\n\nexport interface JudgeInput<T> {\n instruction: string;\n material: string;\n schema: z.ZodType<T, unknown>;\n}\n\nexport interface Plugin {\n readonly id: string;\n readonly version: string;\n readonly type: \"core\" | \"entity\" | \"service\" | \"interface\";\n readonly packageName: string;\n readonly description?: string;\n readonly dependencies?: string[];\n finalizeRegistration?(): Promise<void>;\n ready?(): Promise<void>;\n shutdown?(): Promise<void>;\n requiresDaemonStartup?(): boolean;\n}\n\nexport type PluginFactory = (config: PluginConfig) => Plugin | Plugin[];\n\nexport interface Logger {\n debug(message: string, data?: unknown): void;\n info(message: string, data?: unknown): void;\n warn(message: string, data?: unknown): void;\n error(message: string, data?: unknown): void;\n child(context: string): Logger;\n}\n\nexport interface ToolContext {\n progressToken?: string | number;\n sendProgress?: (notification: {\n progress?: number;\n total?: number;\n message?: string;\n }) => Promise<void>;\n interfaceType?: string;\n userId?: string;\n conversationId?: string;\n channelId?: string;\n channelName?: string;\n runId?: string;\n toolCallId?: string;\n userPermissionLevel?: UserPermissionLevel;\n}\n\nexport interface ToolResponse<T = unknown> {\n success: boolean;\n data?: T;\n error?: string;\n}\n\nexport type ToolVisibility = UserPermissionLevel;\n\nexport interface ToolConfirmation {\n required: boolean;\n message?: string;\n}\n\nexport type ToolSideEffects = \"none\" | \"writes\" | \"external\";\n\nexport interface Tool<TArgs = unknown, TResult = unknown> {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n handler: (args: TArgs, context: ToolContext) => Promise<TResult> | TResult;\n visibility?: ToolVisibility;\n confirmation?: ToolConfirmation;\n sideEffects?: ToolSideEffects;\n}\n\nexport interface Resource<TResult = unknown> {\n uri: string;\n name: string;\n description?: string;\n mimeType?: string;\n handler: () => Promise<TResult> | TResult;\n}\n\nexport interface ResourceTemplate<K extends string = string> {\n uriTemplate: K;\n name: string;\n description?: string;\n mimeType?: string;\n}\n\nexport interface Prompt {\n name: string;\n description?: string;\n arguments?: Array<{ name: string; description?: string; required?: boolean }>;\n}\n\nexport function createTool<TArgs = unknown, TResult = unknown>(\n tool: Tool<TArgs, TResult>,\n): Tool<TArgs, TResult> {\n return tool;\n}\n\nexport function createResource<TResult = unknown>(\n resource: Resource<TResult>,\n): Resource<TResult> {\n return resource;\n}\n\nexport function toolSuccess<T = unknown>(data?: T): ToolResponse<T> {\n return data === undefined ? { success: true } : { success: true, data };\n}\n\nexport function toolError(error: string): ToolResponse<never> {\n return { success: false, error };\n}\n\nexport interface BaseJobTrackingInfo {\n rootJobId: string;\n}\n\nexport interface MessageJobTrackingInfo extends BaseJobTrackingInfo {\n messageId?: string;\n channelId?: string;\n}\n\nexport type JobProgressStatus =\n \"pending\" | \"processing\" | \"completed\" | \"failed\";\n\nexport interface JobProgressContext {\n rootJobId: string;\n operationType:\n | \"file_operations\"\n | \"content_operations\"\n | \"data_processing\"\n | \"batch_processing\";\n pluginId?: string | undefined;\n progressToken?: string | number | undefined;\n operationTarget?: string | undefined;\n interfaceType?: string | undefined;\n conversationId?: string | undefined;\n channelId?: string | undefined;\n}\n\nexport interface JobProgressEvent {\n id: string;\n type: \"job\" | \"batch\";\n status: JobProgressStatus;\n message?: string | undefined;\n progress?:\n | {\n current: number;\n total: number;\n percentage: number;\n }\n | undefined;\n aggregationKey?: string | undefined;\n batchDetails?:\n | {\n totalOperations: number;\n completedOperations: number;\n failedOperations: number;\n currentOperation?: string | undefined;\n errors?: string[] | undefined;\n }\n | undefined;\n jobDetails?:\n | {\n jobType: string;\n priority: number;\n retryCount: number;\n }\n | undefined;\n metadata: JobProgressContext;\n}\n\nexport const urlCaptureConfigSchema: z.ZodObject<{\n captureUrls: z.ZodDefault<z.ZodBoolean>;\n blockedUrlDomains: z.ZodDefault<z.ZodArray<z.ZodString>>;\n}> = z.object({\n captureUrls: z.boolean().default(false),\n blockedUrlDomains: z\n .array(z.string())\n .default([\n \"meet.google.com\",\n \"zoom.us\",\n \"teams.microsoft.com\",\n \"whereby.com\",\n \"gather.town\",\n \"calendly.com\",\n \"cal.com\",\n \"discord.com\",\n \"discord.gg\",\n \"cdn.discordapp.com\",\n \"media.discordapp.net\",\n \"giphy.com\",\n \"tenor.com\",\n \"wetransfer.com\",\n \"file.io\",\n ]),\n});\n\nexport interface Channel<TPayload, TResponse = unknown> {\n readonly name: string;\n readonly schema: SafeParserSchema<TPayload>;\n readonly _response?: TResponse;\n}\n\nexport function defineChannel<TPayload, TResponse = unknown>(\n name: string,\n schema: SafeParserSchema<TPayload>,\n): Channel<TPayload, TResponse> {\n return { name, schema };\n}\n\ntype PublicEntityServiceMethods =\n | \"getEntity\"\n | \"listEntities\"\n | \"search\"\n | \"searchWithDistances\"\n | \"getEntityTypes\"\n | \"hasEntityType\"\n | \"countEntities\"\n | \"getEntityCounts\"\n | \"getEntityTypeConfig\";\n\nexport type IEntityService = Pick<\n ICoreEntityService,\n PublicEntityServiceMethods\n>;\n\nexport type {\n CountEntitiesRequest,\n EntitySearchRequest,\n SearchWithDistancesRequest,\n GetEntityRequest,\n IEntitiesNamespace,\n ProjectSemanticSpaceRequest,\n SemanticEntityReference,\n SemanticSpaceDistanceRange,\n SemanticSpaceNeighbor,\n SemanticSpaceOrigin,\n SemanticSpacePoint,\n SemanticSpaceProjection,\n ListEntitiesRequest,\n ListOptions,\n SearchOptions,\n SearchResult,\n};\n\nexport interface IIdentityNamespace {\n get: () => BrainCharacter;\n getProfile: () => AnchorProfile;\n getAppInfo: () => Promise<AppInfo>;\n}\n\nexport interface IConversationsNamespace {\n get(conversationId: string): Promise<Conversation | null>;\n search(query: string): Promise<Conversation[]>;\n list(options?: {\n limit?: number;\n updatedAfter?: string;\n interfaceType?: string;\n sessionId?: string;\n channelId?: string;\n }): Promise<Conversation[]>;\n getMessages(\n conversationId: string,\n options?: { limit?: number; range?: { start: number; end: number } },\n ): Promise<Message[]>;\n}\n\nexport interface IMessagingNamespace {\n send: MessageSender;\n subscribe<T = unknown, R = unknown>(\n channel: string | Channel<T, R>,\n handler: (message: MessageWithPayload<T>) => Promise<MessageResponse<R>>,\n ): () => void;\n}\n\nexport type EvalHandler<TInput = unknown, TOutput = unknown> = (\n input: TInput,\n) => Promise<TOutput>;\n\nexport type InsightHandler = (\n entityService: IEntityService,\n visibilityScope: ContentVisibility,\n) => Promise<Record<string, unknown>>;\n\nexport interface IEvalNamespace {\n registerHandler(handlerId: string, handler: EvalHandler): void;\n}\n\nexport interface IInsightsNamespace {\n register(type: string, handler: InsightHandler): void;\n}\n\nexport interface ISemanticNamespace {\n project(\n request: ProjectSemanticSpaceRequest,\n ): Promise<SemanticSpaceProjection>;\n}\n\nexport interface IPermissionsNamespace {\n assertEntityActionAllowed(\n entityType: string,\n action: EntityAction,\n context: { userPermissionLevel?: UserPermissionLevel | undefined },\n ): void;\n}\n\nexport interface RuntimeUploadRecord {\n id: string;\n ref: { kind: string; id: string };\n filename: string;\n mediaType: string;\n sizeBytes: number;\n createdAt: string;\n metadata?: Record<string, unknown> | undefined;\n}\n\nexport interface RuntimeUploadResponseBody extends RuntimeUploadRecord {\n url: string;\n downloadUrl: string;\n}\n\nexport interface ResolvedRuntimeUpload {\n record: RuntimeUploadRecord;\n content: Buffer;\n}\n\nexport interface SaveRuntimeUploadInput {\n filename: string;\n mediaType: string;\n content: Buffer;\n metadata?: Record<string, unknown> | undefined;\n}\n\nexport interface RuntimeUploadScopeOptions {\n namespace: string;\n refKind: string;\n routePath: string;\n retentionMs?: number | undefined;\n maxCount?: number | undefined;\n}\n\nexport interface RuntimeUploadStore {\n save(input: SaveRuntimeUploadInput): Promise<RuntimeUploadRecord>;\n read(uploadId: string): Promise<ResolvedRuntimeUpload>;\n readRecord(uploadId: string): Promise<RuntimeUploadRecord>;\n toResponseBody(record: RuntimeUploadRecord): RuntimeUploadResponseBody;\n prune(): Promise<void>;\n getUploadDir(uploadId: string): string;\n}\n\nexport interface IRuntimeUploadsNamespace {\n scoped(options: RuntimeUploadScopeOptions): RuntimeUploadStore;\n}\n\nexport interface BasePluginContext {\n readonly pluginId: string;\n readonly logger: Logger;\n readonly dataDir: string;\n readonly domain: string | undefined;\n readonly siteUrl: string | undefined;\n readonly localSiteUrl: string | undefined;\n readonly previewUrl: string | undefined;\n readonly preferLocalUrls: boolean;\n readonly appInfo: () => Promise<AppInfo>;\n readonly judge: <T>(input: JudgeInput<T>) => Promise<{\n verdict: T;\n usage: {\n promptTokens: number;\n completionTokens: number;\n totalTokens: number;\n };\n }>;\n readonly entityService: IEntityService;\n readonly semantic: ISemanticNamespace;\n readonly identity: IIdentityNamespace;\n readonly messaging: IMessagingNamespace;\n readonly conversations: IConversationsNamespace;\n readonly eval: IEvalNamespace;\n readonly insights: IInsightsNamespace;\n readonly permissions: IPermissionsNamespace;\n readonly uploads: IRuntimeUploadsNamespace;\n}\n\nexport interface IPromptsNamespace {\n resolve(target: string, fallback: string): Promise<string>;\n}\n\nexport interface IServiceTemplatesNamespace {\n register(templates: unknown): void;\n}\n\nexport interface IViewsNamespace {\n get(name: string): unknown | undefined;\n list(): unknown[];\n hasRenderer(templateName: string, format?: OutputFormat): boolean;\n getRenderer(templateName: string, format?: OutputFormat): unknown | undefined;\n validate(templateName: string, content: unknown): boolean;\n}\n\nexport interface FrontmatterSchemaParser {\n parse(data: unknown): unknown;\n}\n\nexport interface EntityPluginEntitiesNamespace extends Omit<\n IEntitiesNamespace,\n \"getEffectiveFrontmatterSchema\"\n> {\n getEffectiveFrontmatterSchema(\n type: string,\n ): FrontmatterSchemaParser | undefined;\n}\n\nexport interface ServicePluginContext extends BasePluginContext {\n readonly entities: IEntitiesNamespace;\n readonly templates: IServiceTemplatesNamespace;\n readonly views: IViewsNamespace;\n readonly prompts: IPromptsNamespace;\n readonly ai: IEntityAINamespace;\n registerInstructions(instructions: string): void;\n}\n\nexport interface EntityPluginContext extends BasePluginContext {\n readonly entities: EntityPluginEntitiesNamespace;\n readonly prompts: IPromptsNamespace;\n}\n\nexport interface InterfacePluginContext extends BasePluginContext {\n readonly agent: AgentNamespace;\n}\n",
|
|
6
6
|
"import { EntityPlugin as RuntimeEntityPlugin } from \"../entity/entity-plugin\";\nimport type { EntityPluginContext as RuntimeEntityPluginContext } from \"../entity/context\";\nimport type { PluginConfigSchema } from \"../config\";\nimport type {\n IShell,\n PluginCapabilities,\n PluginRegistrationContext,\n} from \"../interfaces\";\nimport type {\n BaseEntity,\n CreateExecutionContext,\n CreateInput,\n CreateInterceptionResult,\n DataSource,\n EntityAdapter,\n EntityTypeConfig,\n} from \"@brains/entity-service\";\nimport type { EntityPluginContext, Plugin } from \"./types\";\n\ntype EntitySchema<TEntity extends BaseEntity> =\n EntityAdapter<TEntity>[\"schema\"];\n\ninterface EntityPluginHooks<TEntity extends BaseEntity> {\n getEntityType(): string;\n getSchema(): EntitySchema<TEntity>;\n getAdapter(): EntityAdapter<TEntity>;\n onRegister(context: EntityPluginContext): Promise<void>;\n onReady(context: EntityPluginContext): Promise<void>;\n onShutdown(): Promise<void>;\n getEntityTypeConfig(): EntityTypeConfig | undefined;\n getDataSources(): DataSource[];\n getInstructions(): Promise<string | undefined>;\n interceptCreate(\n input: CreateInput,\n executionContext: CreateExecutionContext,\n context: EntityPluginContext,\n ): Promise<CreateInterceptionResult>;\n}\n\nclass EntityPluginDelegate<\n TEntity extends BaseEntity,\n TConfig,\n TConfigInput,\n> extends RuntimeEntityPlugin<TEntity, TConfig, TConfigInput> {\n private readonly hooks: EntityPluginHooks<TEntity>;\n constructor(\n id: string,\n packageJson: { name: string; version: string; description?: string },\n config: TConfigInput,\n configSchema: PluginConfigSchema<TConfig>,\n hooks: EntityPluginHooks<TEntity>,\n ) {\n super(id, packageJson, config, configSchema);\n this.hooks = hooks;\n }\n\n override get entityType(): string {\n return this.hooks.getEntityType();\n }\n\n override get schema(): EntitySchema<TEntity> {\n return this.hooks.getSchema();\n }\n\n override get adapter(): EntityAdapter<TEntity> {\n return this.hooks.getAdapter();\n }\n\n protected override onRegister(\n context: RuntimeEntityPluginContext,\n ): Promise<void> {\n return this.hooks.onRegister(context);\n }\n\n protected override onReady(\n context: RuntimeEntityPluginContext,\n ): Promise<void> {\n return this.hooks.onReady(context);\n }\n\n protected override onShutdown(): Promise<void> {\n return this.hooks.onShutdown();\n }\n\n protected override getEntityTypeConfig(): EntityTypeConfig | undefined {\n return this.hooks.getEntityTypeConfig();\n }\n\n protected override getDataSources(): DataSource[] {\n return this.hooks.getDataSources();\n }\n\n protected override getInstructions(): Promise<string | undefined> {\n return this.hooks.getInstructions();\n }\n\n protected override interceptCreate(\n input: CreateInput,\n executionContext: CreateExecutionContext,\n context: RuntimeEntityPluginContext,\n ): Promise<CreateInterceptionResult> {\n return this.hooks.interceptCreate(input, executionContext, context);\n }\n}\n\nexport abstract class EntityPlugin<\n TEntity extends BaseEntity,\n TConfig,\n TConfigInput,\n> implements Plugin {\n public readonly type = \"entity\" as const;\n public readonly id: string;\n public readonly version: string;\n public readonly packageName: string;\n public readonly description?: string;\n public abstract readonly entityType: string;\n public abstract readonly schema: EntitySchema<TEntity>;\n public abstract readonly adapter: EntityAdapter<TEntity>;\n private readonly delegate: EntityPluginDelegate<\n TEntity,\n TConfig,\n TConfigInput\n >;\n\n protected constructor(\n id: string,\n packageJson: { name: string; version: string; description?: string },\n config: TConfigInput,\n configSchema: PluginConfigSchema<TConfig>,\n ) {\n this.id = id;\n this.version = packageJson.version;\n this.packageName = packageJson.name;\n if (packageJson.description !== undefined) {\n this.description = packageJson.description;\n }\n this.delegate = new EntityPluginDelegate(\n id,\n packageJson,\n config,\n configSchema,\n {\n getEntityType: (): string => this.entityType,\n getSchema: (): EntitySchema<TEntity> => this.schema,\n getAdapter: (): EntityAdapter<TEntity> => this.adapter,\n onRegister: (context): Promise<void> => this.onRegister(context),\n onReady: (context): Promise<void> => this.onReady(context),\n onShutdown: (): Promise<void> => this.onShutdown(),\n getEntityTypeConfig: (): EntityTypeConfig | undefined =>\n this.getEntityTypeConfig(),\n getDataSources: (): DataSource[] => this.getDataSources(),\n getInstructions: (): Promise<string | undefined> =>\n this.getInstructions(),\n interceptCreate: (\n input,\n executionContext,\n context,\n ): Promise<CreateInterceptionResult> =>\n this.interceptCreate(input, executionContext, context),\n },\n );\n }\n\n /** @internal */\n register(\n shell: IShell,\n context?: PluginRegistrationContext,\n ): Promise<PluginCapabilities> {\n return this.delegate.register(shell, context);\n }\n\n protected async onRegister(_context: EntityPluginContext): Promise<void> {}\n protected async onReady(_context: EntityPluginContext): Promise<void> {}\n protected async onShutdown(): Promise<void> {}\n protected async getInstructions(): Promise<string | undefined> {\n return undefined;\n }\n protected getEntityTypeConfig(): EntityTypeConfig | undefined {\n return undefined;\n }\n protected getDataSources(): DataSource[] {\n return [];\n }\n protected async interceptCreate(\n input: CreateInput,\n _executionContext: CreateExecutionContext,\n _context: EntityPluginContext,\n ): Promise<CreateInterceptionResult> {\n return { kind: \"continue\", input };\n }\n\n ready(): Promise<void> {\n return this.delegate.ready();\n }\n\n shutdown(): Promise<void> {\n return this.delegate.shutdown?.() ?? Promise.resolve();\n }\n}\n",
|
|
7
7
|
"import { InterfacePlugin as RuntimeInterfacePlugin } from \"../interface/interface-plugin\";\nimport type { InterfacePluginContext as RuntimeInterfacePluginContext } from \"../interface/context\";\nimport type { PluginConfigSchema } from \"../config\";\nimport type {\n IShell,\n PluginCapabilities,\n PluginRegistrationContext,\n} from \"../interfaces\";\nimport type { WebRouteDefinition } from \"../types/web-routes\";\nimport type {\n BaseJobTrackingInfo,\n InterfacePluginContext,\n Plugin,\n Resource,\n Tool,\n} from \"./types\";\n\ninterface InterfacePluginHooks {\n onRegister(context: InterfacePluginContext): Promise<void>;\n onReady(context: InterfacePluginContext): Promise<void>;\n onShutdown(): Promise<void>;\n getTools(): Promise<Tool[]>;\n getResources(): Promise<Resource[]>;\n getInstructions(): Promise<string | undefined>;\n getWebRoutes(): WebRouteDefinition[];\n requiresDaemonStartup(): boolean;\n}\n\nclass InterfacePluginDelegate<\n TConfig,\n TConfigInput,\n TTrackingInfo extends BaseJobTrackingInfo,\n> extends RuntimeInterfacePlugin<TConfig, TConfigInput, TTrackingInfo> {\n private readonly hooks: InterfacePluginHooks;\n constructor(\n id: string,\n packageJson: { name: string; version: string; description?: string },\n config: TConfigInput,\n configSchema: PluginConfigSchema<TConfig>,\n hooks: InterfacePluginHooks,\n ) {\n super(id, packageJson, config, configSchema);\n this.hooks = hooks;\n }\n\n protected override onRegister(\n context: RuntimeInterfacePluginContext,\n ): Promise<void> {\n return this.hooks.onRegister(context);\n }\n\n protected override onReady(\n context: RuntimeInterfacePluginContext,\n ): Promise<void> {\n return this.hooks.onReady(context);\n }\n\n protected override onShutdown(): Promise<void> {\n return this.hooks.onShutdown();\n }\n\n protected override getTools(): Promise<never[]> {\n return this.hooks.getTools() as Promise<never[]>;\n }\n\n protected override getResources(): Promise<never[]> {\n return this.hooks.getResources() as Promise<never[]>;\n }\n\n protected override getInstructions(): Promise<string | undefined> {\n return this.hooks.getInstructions();\n }\n\n override getWebRoutes(): WebRouteDefinition[] {\n return this.hooks.getWebRoutes();\n }\n\n override requiresDaemonStartup(): boolean {\n return this.hooks.requiresDaemonStartup();\n }\n}\n\nexport abstract class InterfacePlugin<\n TConfig,\n TConfigInput,\n TTrackingInfo extends BaseJobTrackingInfo = BaseJobTrackingInfo,\n> implements Plugin {\n public readonly type = \"interface\" as const;\n public readonly id: string;\n public readonly version: string;\n public readonly packageName: string;\n public readonly description?: string;\n private readonly delegate: InterfacePluginDelegate<\n TConfig,\n TConfigInput,\n TTrackingInfo\n >;\n\n protected constructor(\n id: string,\n packageJson: { name: string; version: string; description?: string },\n config: TConfigInput,\n configSchema: PluginConfigSchema<TConfig>,\n ) {\n this.id = id;\n this.version = packageJson.version;\n this.packageName = packageJson.name;\n if (packageJson.description !== undefined) {\n this.description = packageJson.description;\n }\n this.delegate = new InterfacePluginDelegate(\n id,\n packageJson,\n config,\n configSchema,\n {\n onRegister: (context): Promise<void> => this.onRegister(context),\n onReady: (context): Promise<void> => this.onReady(context),\n onShutdown: (): Promise<void> => this.onShutdown(),\n getTools: (): Promise<Tool[]> => this.getTools(),\n getResources: (): Promise<Resource[]> => this.getResources(),\n getInstructions: (): Promise<string | undefined> =>\n this.getInstructions(),\n getWebRoutes: (): WebRouteDefinition[] => this.getWebRoutes(),\n requiresDaemonStartup: (): boolean => this.requiresDaemonStartup(),\n },\n );\n }\n\n /** @internal */\n register(\n shell: IShell,\n context?: PluginRegistrationContext,\n ): Promise<PluginCapabilities> {\n return this.delegate.register(shell, context);\n }\n\n protected async onRegister(_context: InterfacePluginContext): Promise<void> {}\n protected async onReady(_context: InterfacePluginContext): Promise<void> {}\n protected async onShutdown(): Promise<void> {}\n protected async getTools(): Promise<Tool[]> {\n return [];\n }\n protected async getResources(): Promise<Resource[]> {\n return [];\n }\n protected async getInstructions(): Promise<string | undefined> {\n return undefined;\n }\n\n getWebRoutes(): WebRouteDefinition[] {\n return [];\n }\n\n requiresDaemonStartup(): boolean {\n return false;\n }\n\n ready(): Promise<void> {\n return this.delegate.ready();\n }\n\n shutdown(): Promise<void> {\n return this.delegate.shutdown?.() ?? Promise.resolve();\n }\n}\n",
|
|
8
8
|
"import { MessageInterfacePlugin as RuntimeMessageInterfacePlugin } from \"../message-interface/message-interface-plugin\";\nimport type { InterfacePluginContext as RuntimeInterfacePluginContext } from \"../interface/context\";\nimport type {\n EditMessageRequest,\n SendMessageToChannelRequest,\n SendMessageWithIdRequest,\n} from \"../message-interface/message-interface-plugin\";\nimport type {\n IShell,\n PluginCapabilities,\n PluginRegistrationContext,\n} from \"../interfaces\";\nimport type { WebRouteDefinition } from \"../types/web-routes\";\nimport type { PermissionLookupContext } from \"@brains/templates\";\nimport type { PluginConfigSchema } from \"../config\";\nimport { InterfacePlugin } from \"./interface-plugin\";\nimport type {\n InterfacePluginContext,\n JobProgressEvent,\n MessageJobTrackingInfo,\n Resource,\n Tool,\n} from \"./types\";\n\ninterface MessageInterfacePluginHooks {\n onRegister(context: InterfacePluginContext): Promise<void>;\n onReady(context: InterfacePluginContext): Promise<void>;\n onShutdown(): Promise<void>;\n getTools(): Promise<Tool[]>;\n getResources(): Promise<Resource[]>;\n getInstructions(): Promise<string | undefined>;\n getWebRoutes(): WebRouteDefinition[];\n requiresDaemonStartup(): boolean;\n sendMessageToChannel(request: SendMessageToChannelRequest): void;\n sendMessageWithId(\n request: SendMessageWithIdRequest,\n ): Promise<string | undefined>;\n editMessage(request: EditMessageRequest): Promise<boolean>;\n supportsMessageEditing(): boolean;\n onProgressUpdate(event: JobProgressEvent): Promise<void>;\n}\n\nclass MessageInterfacePluginDelegate<\n TConfig,\n TConfigInput,\n TTrackingInfo extends MessageJobTrackingInfo,\n> extends RuntimeMessageInterfacePlugin<TConfig, TConfigInput, TTrackingInfo> {\n private readonly hooks: MessageInterfacePluginHooks;\n constructor(\n id: string,\n packageJson: { name: string; version: string; description?: string },\n config: TConfigInput,\n configSchema: PluginConfigSchema<TConfig>,\n hooks: MessageInterfacePluginHooks,\n ) {\n super(id, packageJson, config, configSchema);\n this.hooks = hooks;\n }\n\n protected override async onRegister(\n context: RuntimeInterfacePluginContext,\n ): Promise<void> {\n await super.onRegister(context);\n await this.hooks.onRegister(context);\n }\n\n protected override onReady(\n context: RuntimeInterfacePluginContext,\n ): Promise<void> {\n return this.hooks.onReady(context);\n }\n\n protected override onShutdown(): Promise<void> {\n return this.hooks.onShutdown();\n }\n\n protected override getTools(): Promise<never[]> {\n return this.hooks.getTools() as Promise<never[]>;\n }\n\n protected override getResources(): Promise<never[]> {\n return this.hooks.getResources() as Promise<never[]>;\n }\n\n protected override getInstructions(): Promise<string | undefined> {\n return this.hooks.getInstructions();\n }\n\n override getWebRoutes(): WebRouteDefinition[] {\n return this.hooks.getWebRoutes();\n }\n\n override requiresDaemonStartup(): boolean {\n return this.hooks.requiresDaemonStartup();\n }\n\n protected override sendMessageToChannel(\n request: SendMessageToChannelRequest,\n ): void {\n this.hooks.sendMessageToChannel(request);\n }\n\n protected override sendMessageWithId(\n request: SendMessageWithIdRequest,\n ): Promise<string | undefined> {\n return this.hooks.sendMessageWithId(request);\n }\n\n protected override editMessage(\n request: EditMessageRequest,\n ): Promise<boolean> {\n return this.hooks.editMessage(request);\n }\n\n protected override supportsMessageEditing(): boolean {\n return this.hooks.supportsMessageEditing();\n }\n\n protected override onProgressUpdate(event: JobProgressEvent): Promise<void> {\n return this.hooks.onProgressUpdate(event);\n }\n\n trackAgentResponseForJobPublic(\n jobId: string,\n messageId: string,\n channelId: string,\n ): void {\n this.trackAgentResponseForJob(jobId, messageId, channelId);\n }\n\n captureUrlViaAgentPublic(\n url: string,\n channelId: string,\n authorId: string,\n interfaceType: string,\n permissionContext?: PermissionLookupContext,\n ): Promise<void> {\n return this.captureUrlViaAgent(\n url,\n channelId,\n authorId,\n interfaceType,\n permissionContext,\n );\n }\n\n getCurrentChannelIdPublic(): string | null {\n return this.getCurrentChannelId();\n }\n}\n\nexport abstract class MessageInterfacePlugin<\n TConfig,\n TConfigInput,\n TTrackingInfo extends MessageJobTrackingInfo = MessageJobTrackingInfo,\n> extends InterfacePlugin<TConfig, TConfigInput, TTrackingInfo> {\n private readonly messageDelegate: MessageInterfacePluginDelegate<\n TConfig,\n TConfigInput,\n TTrackingInfo\n >;\n\n protected constructor(\n id: string,\n packageJson: { name: string; version: string; description?: string },\n config: TConfigInput,\n configSchema: PluginConfigSchema<TConfig>,\n ) {\n super(id, packageJson, config, configSchema);\n this.messageDelegate = new MessageInterfacePluginDelegate(\n id,\n packageJson,\n config,\n configSchema,\n {\n onRegister: (context): Promise<void> => this.onRegister(context),\n onReady: (context): Promise<void> => this.onReady(context),\n onShutdown: (): Promise<void> => this.onShutdown(),\n getTools: (): Promise<Tool[]> => this.getTools(),\n getResources: (): Promise<Resource[]> => this.getResources(),\n getInstructions: (): Promise<string | undefined> =>\n this.getInstructions(),\n getWebRoutes: (): WebRouteDefinition[] => this.getWebRoutes(),\n requiresDaemonStartup: (): boolean => this.requiresDaemonStartup(),\n sendMessageToChannel: (request): void =>\n this.sendMessageToChannel(request),\n sendMessageWithId: (request): Promise<string | undefined> =>\n this.sendMessageWithId(request),\n editMessage: (request): Promise<boolean> => this.editMessage(request),\n supportsMessageEditing: (): boolean => this.supportsMessageEditing(),\n onProgressUpdate: (event): Promise<void> =>\n this.onProgressUpdate(event),\n },\n );\n }\n\n /** @internal */\n override register(\n shell: IShell,\n context?: PluginRegistrationContext,\n ): Promise<PluginCapabilities> {\n return this.messageDelegate.register(shell, context);\n }\n\n protected abstract sendMessageToChannel(\n request: SendMessageToChannelRequest,\n ): void;\n\n protected override async onRegister(\n _context: InterfacePluginContext,\n ): Promise<void> {}\n protected override async onReady(\n _context: InterfacePluginContext,\n ): Promise<void> {}\n protected override async onShutdown(): Promise<void> {}\n protected override async getTools(): Promise<Tool[]> {\n return [];\n }\n protected override async getResources(): Promise<Resource[]> {\n return [];\n }\n protected override async getInstructions(): Promise<string | undefined> {\n return undefined;\n }\n protected sendMessageWithId(\n _request: SendMessageWithIdRequest,\n ): Promise<string | undefined> {\n return Promise.resolve(undefined);\n }\n protected editMessage(_request: EditMessageRequest): Promise<boolean> {\n return Promise.resolve(false);\n }\n protected supportsMessageEditing(): boolean {\n return false;\n }\n protected async onProgressUpdate(_event: JobProgressEvent): Promise<void> {}\n\n /** @internal */\n protected isUploadableTextFile(filename: string, mimetype?: string): boolean {\n const textFileExtensions = [\".md\", \".txt\", \".markdown\"];\n const textMimeTypes = [\"text/plain\", \"text/markdown\", \"text/x-markdown\"];\n if (mimetype && textMimeTypes.some((type) => mimetype.startsWith(type))) {\n return true;\n }\n return textFileExtensions.some((extension) =>\n filename.toLowerCase().endsWith(extension),\n );\n }\n\n /** @internal */\n protected isFileSizeAllowed(size: number): boolean {\n return size <= 100_000;\n }\n\n /** @internal */\n protected formatFileUploadMessage(filename: string, content: string): string {\n return `User uploaded a file \"${filename}\":\\n\\n${content}`;\n }\n\n /** @internal */\n protected extractCaptureableUrls(\n content: string,\n blockedDomains: string[],\n ): string[] {\n const matches =\n content.match(/https?:\\/\\/[^\\s<>\"{}|\\\\^`[\\]]+?(?=[,;:\\s]|$)/gi) ?? [];\n return [...new Set(matches)].filter((url) => {\n try {\n const { hostname } = new URL(url);\n return !blockedDomains.some(\n (domain) => hostname === domain || hostname.endsWith(`.${domain}`),\n );\n } catch {\n return false;\n }\n });\n }\n\n /** @internal */\n protected captureUrlViaAgent(\n url: string,\n channelId: string,\n authorId: string,\n interfaceType: string,\n permissionContext?: PermissionLookupContext,\n ): Promise<void> {\n return this.messageDelegate.captureUrlViaAgentPublic(\n url,\n channelId,\n authorId,\n interfaceType,\n permissionContext,\n );\n }\n\n protected trackAgentResponseForJob(\n jobId: string,\n messageId: string,\n channelId: string,\n ): void {\n this.messageDelegate.trackAgentResponseForJobPublic(\n jobId,\n messageId,\n channelId,\n );\n }\n\n public registerProgressCallback(\n callback: (events: JobProgressEvent[]) => void,\n ): void {\n this.messageDelegate.registerProgressCallback(\n callback as (events: JobProgressEvent[]) => void,\n );\n }\n\n public unregisterProgressCallback(): void {\n this.messageDelegate.unregisterProgressCallback();\n }\n\n public getProgressEvents(): JobProgressEvent[] {\n return this.messageDelegate.getProgressEvents() as JobProgressEvent[];\n }\n\n public getActiveProgressEvents(): JobProgressEvent[] {\n return this.messageDelegate.getActiveProgressEvents() as JobProgressEvent[];\n }\n\n public startProcessingInput(channelId: string | null = null): void {\n this.messageDelegate.startProcessingInput(channelId);\n }\n\n public endProcessingInput(): void {\n this.messageDelegate.endProcessingInput();\n }\n\n protected getCurrentChannelId(): string | null {\n return this.messageDelegate.getCurrentChannelIdPublic();\n }\n\n override ready(): Promise<void> {\n return this.messageDelegate.ready();\n }\n\n override shutdown(): Promise<void> {\n return this.messageDelegate.shutdown?.() ?? Promise.resolve();\n }\n}\n",
|
|
9
9
|
"import { ServicePlugin as RuntimeServicePlugin } from \"../service/service-plugin\";\nimport type { ServicePluginContext as RuntimeServicePluginContext } from \"../service/context\";\nimport type { PluginConfigSchema } from \"../config\";\nimport type {\n IShell,\n PluginCapabilities,\n PluginRegistrationContext,\n} from \"../interfaces\";\nimport type { Plugin, Resource, ServicePluginContext, Tool } from \"./types\";\n\ninterface ServicePluginHooks {\n onRegister(context: ServicePluginContext): Promise<void>;\n onReady(context: ServicePluginContext): Promise<void>;\n onShutdown(): Promise<void>;\n getTools(): Promise<Tool[]>;\n getResources(): Promise<Resource[]>;\n getInstructions(): Promise<string | undefined>;\n}\n\nclass ServicePluginDelegate<TConfig, TConfigInput> extends RuntimeServicePlugin<\n TConfig,\n TConfigInput\n> {\n private readonly hooks: ServicePluginHooks;\n constructor(\n id: string,\n packageJson: { name: string; version: string; description?: string },\n config: TConfigInput,\n configSchema: PluginConfigSchema<TConfig>,\n hooks: ServicePluginHooks,\n ) {\n super(id, packageJson, config, configSchema);\n this.hooks = hooks;\n }\n\n protected override onRegister(\n context: RuntimeServicePluginContext,\n ): Promise<void> {\n return this.hooks.onRegister(context);\n }\n\n protected override onReady(\n context: RuntimeServicePluginContext,\n ): Promise<void> {\n return this.hooks.onReady(context);\n }\n\n protected override onShutdown(): Promise<void> {\n return this.hooks.onShutdown();\n }\n\n protected override getTools(): Promise<never[]> {\n return this.hooks.getTools() as Promise<never[]>;\n }\n\n protected override getResources(): Promise<never[]> {\n return this.hooks.getResources() as Promise<never[]>;\n }\n\n protected override getInstructions(): Promise<string | undefined> {\n return this.hooks.getInstructions();\n }\n}\n\nexport abstract class ServicePlugin<TConfig, TConfigInput> implements Plugin {\n public readonly type = \"service\" as const;\n public readonly id: string;\n public readonly version: string;\n public readonly packageName: string;\n public readonly description?: string;\n private readonly delegate: ServicePluginDelegate<TConfig, TConfigInput>;\n\n protected constructor(\n id: string,\n packageJson: { name: string; version: string; description?: string },\n config: TConfigInput,\n configSchema: PluginConfigSchema<TConfig>,\n ) {\n this.id = id;\n this.version = packageJson.version;\n this.packageName = packageJson.name;\n if (packageJson.description !== undefined) {\n this.description = packageJson.description;\n }\n this.delegate = new ServicePluginDelegate(\n id,\n packageJson,\n config,\n configSchema,\n {\n onRegister: (context): Promise<void> => this.onRegister(context),\n onReady: (context): Promise<void> => this.onReady(context),\n onShutdown: (): Promise<void> => this.onShutdown(),\n getTools: (): Promise<Tool[]> => this.getTools(),\n getResources: (): Promise<Resource[]> => this.getResources(),\n getInstructions: (): Promise<string | undefined> =>\n this.getInstructions(),\n },\n );\n }\n\n /** @internal */\n register(\n shell: IShell,\n context?: PluginRegistrationContext,\n ): Promise<PluginCapabilities> {\n return this.delegate.register(shell, context);\n }\n\n protected async onRegister(_context: ServicePluginContext): Promise<void> {}\n protected async onReady(_context: ServicePluginContext): Promise<void> {}\n protected async onShutdown(): Promise<void> {}\n protected async getTools(): Promise<Tool[]> {\n return [];\n }\n protected async getResources(): Promise<Resource[]> {\n return [];\n }\n protected async getInstructions(): Promise<string | undefined> {\n return undefined;\n }\n\n ready(): Promise<void> {\n return this.delegate.ready();\n }\n\n shutdown(): Prom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Aa,EAC3D,gBAAiB,IACf,KAAK,gBAAgB,CACzB,CACF,EAIF,QAAQ,CACN,EACA,EAC6B,CAC7B,OAAO,KAAK,SAAS,SAAS,EAAO,CAAO,OAG9B,WAAU,CAAC,EAA+C,OAC1D,QAAO,CAAC,EAA+C,OACvD,WAAU,EAAkB,OAC5B,SAAQ,EAAoB,CAC1C,MAAO,CAAC,OAEM,aAAY,EAAwB,CAClD,MAAO,CAAC,OAEM,gBAAe,EAAgC,CAC7D,OAGF,KAAK,EAAkB,CACrB,OAAO,KAAK,SAAS,MAAM,EAG7B,QAAQ,EAAkB,CACxB,OAAO,KAAK,SAAS,WAAW,GAAK,QAAQ,QAAQ,EAEzD",
|
|
12
|
+
"debugId": "C6919AA775FA2EAF64756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Rover default style
|
|
3
|
+
voice:
|
|
4
|
+
summary: Thoughtful, direct, playful, and opinionated without sounding corporate
|
|
5
|
+
traits:
|
|
6
|
+
- clear
|
|
7
|
+
- witty
|
|
8
|
+
- systems-minded
|
|
9
|
+
principles:
|
|
10
|
+
- Blend philosophy, technology, and culture when relevant
|
|
11
|
+
- Prefer real specific examples from the brain over generic hypotheticals
|
|
12
|
+
- Use first person when the represented identity is speaking
|
|
13
|
+
- Let arguments end naturally instead of adding generic takeaway sections
|
|
14
|
+
avoid:
|
|
15
|
+
- consulting whitepaper language
|
|
16
|
+
- excessive hedging
|
|
17
|
+
- generic content-marketing prose
|
|
18
|
+
visual:
|
|
19
|
+
artDirection: >-
|
|
20
|
+
Dense contemporary editorial illustration rendered in clean digital linework,
|
|
21
|
+
bold filled shapes, halftone textures, and screenprint-style color separations.
|
|
22
|
+
Create depth through overlapping visual planes rather than realistic perspective.
|
|
23
|
+
palette:
|
|
24
|
+
- "#3921D7"
|
|
25
|
+
- "#E7640A"
|
|
26
|
+
- "#DC2626"
|
|
27
|
+
- "#FFFCF6"
|
|
28
|
+
- "#0E0027"
|
|
29
|
+
composition: >-
|
|
30
|
+
Pack the frame with interconnected symbolic elements at varied scales. Use one
|
|
31
|
+
central metaphor, diagonal flow, layered overlaps, and elements bleeding beyond
|
|
32
|
+
the edges. Avoid sparse grid compositions.
|
|
33
|
+
mood: Intellectual maximalism; playful, rigorous, and rewarding close inspection
|
|
34
|
+
preferred:
|
|
35
|
+
- conceptual visual metaphors using everyday physical objects
|
|
36
|
+
- crisp opaque color blocks
|
|
37
|
+
- surprising symbolic connections
|
|
38
|
+
avoid:
|
|
39
|
+
- photorealism
|
|
40
|
+
- photography
|
|
41
|
+
- gradients
|
|
42
|
+
- watercolor or visible brush textures
|
|
43
|
+
- sparse minimal vectors
|
|
44
|
+
- dark fantasy or gothic imagery
|
|
45
|
+
- sci-fi chrome, glass, or crystal materials
|
|
46
|
+
- lens flare or dreamy fog
|
|
47
|
+
- text, words, lettering, or typography inside the image
|
|
48
|
+
---
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Rover default style
|
|
3
|
+
voice:
|
|
4
|
+
summary: Thoughtful, direct, playful, and opinionated without sounding corporate
|
|
5
|
+
traits:
|
|
6
|
+
- clear
|
|
7
|
+
- witty
|
|
8
|
+
- systems-minded
|
|
9
|
+
principles:
|
|
10
|
+
- Blend philosophy, technology, and culture when relevant
|
|
11
|
+
- Prefer real specific examples from the brain over generic hypotheticals
|
|
12
|
+
- Use first person when the represented identity is speaking
|
|
13
|
+
- Let arguments end naturally instead of adding generic takeaway sections
|
|
14
|
+
avoid:
|
|
15
|
+
- consulting whitepaper language
|
|
16
|
+
- excessive hedging
|
|
17
|
+
- generic content-marketing prose
|
|
18
|
+
visual:
|
|
19
|
+
artDirection: >-
|
|
20
|
+
Dense contemporary editorial illustration rendered in clean digital linework,
|
|
21
|
+
bold filled shapes, halftone textures, and screenprint-style color separations.
|
|
22
|
+
Create depth through overlapping visual planes rather than realistic perspective.
|
|
23
|
+
palette:
|
|
24
|
+
- "#3921D7"
|
|
25
|
+
- "#E7640A"
|
|
26
|
+
- "#DC2626"
|
|
27
|
+
- "#FFFCF6"
|
|
28
|
+
- "#0E0027"
|
|
29
|
+
composition: >-
|
|
30
|
+
Pack the frame with interconnected symbolic elements at varied scales. Use one
|
|
31
|
+
central metaphor, diagonal flow, layered overlaps, and elements bleeding beyond
|
|
32
|
+
the edges. Avoid sparse grid compositions.
|
|
33
|
+
mood: Intellectual maximalism; playful, rigorous, and rewarding close inspection
|
|
34
|
+
preferred:
|
|
35
|
+
- conceptual visual metaphors using everyday physical objects
|
|
36
|
+
- crisp opaque color blocks
|
|
37
|
+
- surprising symbolic connections
|
|
38
|
+
avoid:
|
|
39
|
+
- photorealism
|
|
40
|
+
- photography
|
|
41
|
+
- gradients
|
|
42
|
+
- watercolor or visible brush textures
|
|
43
|
+
- sparse minimal vectors
|
|
44
|
+
- dark fantasy or gothic imagery
|
|
45
|
+
- sci-fi chrome, glass, or crystal materials
|
|
46
|
+
- lens flare or dreamy fog
|
|
47
|
+
- text, words, lettering, or typography inside the image
|
|
48
|
+
---
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Rover default style
|
|
3
|
+
voice:
|
|
4
|
+
summary: Thoughtful, direct, playful, and opinionated without sounding corporate
|
|
5
|
+
traits:
|
|
6
|
+
- clear
|
|
7
|
+
- witty
|
|
8
|
+
- systems-minded
|
|
9
|
+
principles:
|
|
10
|
+
- Blend philosophy, technology, and culture when relevant
|
|
11
|
+
- Prefer real specific examples from the brain over generic hypotheticals
|
|
12
|
+
- Use first person when the represented identity is speaking
|
|
13
|
+
- Let arguments end naturally instead of adding generic takeaway sections
|
|
14
|
+
avoid:
|
|
15
|
+
- consulting whitepaper language
|
|
16
|
+
- excessive hedging
|
|
17
|
+
- generic content-marketing prose
|
|
18
|
+
visual:
|
|
19
|
+
artDirection: >-
|
|
20
|
+
Dense contemporary editorial illustration rendered in clean digital linework,
|
|
21
|
+
bold filled shapes, halftone textures, and screenprint-style color separations.
|
|
22
|
+
Create depth through overlapping visual planes rather than realistic perspective.
|
|
23
|
+
palette:
|
|
24
|
+
- "#3921D7"
|
|
25
|
+
- "#E7640A"
|
|
26
|
+
- "#DC2626"
|
|
27
|
+
- "#FFFCF6"
|
|
28
|
+
- "#0E0027"
|
|
29
|
+
composition: >-
|
|
30
|
+
Pack the frame with interconnected symbolic elements at varied scales. Use one
|
|
31
|
+
central metaphor, diagonal flow, layered overlaps, and elements bleeding beyond
|
|
32
|
+
the edges. Avoid sparse grid compositions.
|
|
33
|
+
mood: Intellectual maximalism; playful, rigorous, and rewarding close inspection
|
|
34
|
+
preferred:
|
|
35
|
+
- conceptual visual metaphors using everyday physical objects
|
|
36
|
+
- crisp opaque color blocks
|
|
37
|
+
- surprising symbolic connections
|
|
38
|
+
avoid:
|
|
39
|
+
- photorealism
|
|
40
|
+
- photography
|
|
41
|
+
- gradients
|
|
42
|
+
- watercolor or visible brush textures
|
|
43
|
+
- sparse minimal vectors
|
|
44
|
+
- dark fantasy or gothic imagery
|
|
45
|
+
- sci-fi chrome, glass, or crystal materials
|
|
46
|
+
- lens flare or dreamy fog
|
|
47
|
+
- text, words, lettering, or typography inside the image
|
|
48
|
+
---
|
package/dist/services.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{A as j,y as f,z as h}from"./chunks/index-1qz89akh.js";import"./chunks/index-4xzx30t8.js";import"./chunks/index-18d0wj5t.js";import"./chunks/index-h1zmmtbw.js";import"./chunks/index-48mg443r.js";export{f as baseQuerySchema,h as baseInputSchema,j as BaseEntityDataSource};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=731D7B90AD294D0864756E2164756E21
|
|
5
5
|
//# sourceMappingURL=services.js.map
|