Add agents package
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
|||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
dist_*/
|
||||||
|
dist_ts/
|
||||||
|
coverage/
|
||||||
|
.nyc_output/
|
||||||
|
.nogit/
|
||||||
|
.playwright-mcp/
|
||||||
|
*.log
|
||||||
|
.DS_Store
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"name": "@smarthome.exchange/agents",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": false,
|
||||||
|
"description": "Reference agent definitions for smarthome.exchange.",
|
||||||
|
"exports": {
|
||||||
|
".": "./dist_ts/index.js"
|
||||||
|
},
|
||||||
|
"type": "module",
|
||||||
|
"author": "Task Venture Capital GmbH",
|
||||||
|
"license": "MIT",
|
||||||
|
"scripts": {
|
||||||
|
"test": "tstest test/ --verbose --logfile --timeout 60",
|
||||||
|
"build": "tsbuild tsfolders --allowimplicitany",
|
||||||
|
"buildDocs": "tsdoc"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@smarthome.exchange/interfaces": "workspace:*"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@git.zone/tsbuild": "^4.4.0",
|
||||||
|
"@git.zone/tsdoc": "^2.0.3",
|
||||||
|
"@git.zone/tsrun": "^2.0.3",
|
||||||
|
"@git.zone/tstest": "^3.6.3",
|
||||||
|
"@types/node": "^25.6.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"ts/**/*",
|
||||||
|
"dist/**/*",
|
||||||
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
|
"readme.md",
|
||||||
|
"changelog.md",
|
||||||
|
"license"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
|
],
|
||||||
|
"packageManager": "pnpm@10.28.2"
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# @smarthome.exchange/agents
|
||||||
|
|
||||||
|
Editable reference agent definitions for smarthome.exchange installs.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||||
|
import { referenceAgents } from '../ts/index.js';
|
||||||
|
|
||||||
|
tap.test('ships six reference agents', async () => {
|
||||||
|
expect(referenceAgents.length).toEqual(6);
|
||||||
|
expect(referenceAgents.map((agentArg) => agentArg.id)).toContain('comfort');
|
||||||
|
});
|
||||||
|
|
||||||
|
export default tap.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './referenceagents.js';
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// Project scope
|
||||||
|
import * as shxInterfaces from '@smarthome.exchange/interfaces';
|
||||||
|
|
||||||
|
export { shxInterfaces };
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
import * as plugins from './plugins.js';
|
||||||
|
|
||||||
|
export const referenceAgents: plugins.shxInterfaces.data.IAgentDefinition[] = [
|
||||||
|
{
|
||||||
|
id: 'comfort',
|
||||||
|
name: 'Comfort',
|
||||||
|
role: 'Climate, light, ambience',
|
||||||
|
glyph: 'comfort',
|
||||||
|
color: '#f59e0b',
|
||||||
|
mode: 'auto',
|
||||||
|
model: 'local:small',
|
||||||
|
scopes: ['climate.read', 'climate.write', 'light.read', 'light.write', 'device.read'],
|
||||||
|
systemPrompt: 'Keep rooms comfortable while minimizing waste. Explain any tradeoff involving energy or privacy.',
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'sentinel',
|
||||||
|
name: 'Sentinel',
|
||||||
|
role: 'Locks, cameras, presence',
|
||||||
|
glyph: 'sentinel',
|
||||||
|
color: '#ef4444',
|
||||||
|
mode: 'ask',
|
||||||
|
model: 'local:small',
|
||||||
|
scopes: ['lock.read', 'lock.write', 'camera.read', 'alarm.write', 'device.read'],
|
||||||
|
systemPrompt: 'Protect the home with conservative defaults. Ask before irreversible or alarming actions.',
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'watt',
|
||||||
|
name: 'Watt',
|
||||||
|
role: 'Energy, solar, EV, appliances',
|
||||||
|
glyph: 'watt',
|
||||||
|
color: '#22c55e',
|
||||||
|
mode: 'ask',
|
||||||
|
model: 'local:small',
|
||||||
|
scopes: ['energy.read', 'energy.write', 'climate.read', 'device.read', 'device.write'],
|
||||||
|
systemPrompt: 'Shift energy loads toward cheap, local, and renewable windows without reducing household comfort.',
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'dawn',
|
||||||
|
name: 'Dawn',
|
||||||
|
role: 'Wake, wind-down, daily ritual',
|
||||||
|
glyph: 'dawn',
|
||||||
|
color: '#a78bfa',
|
||||||
|
mode: 'auto',
|
||||||
|
model: 'local:small',
|
||||||
|
scopes: ['light.read', 'light.write', 'device.read', 'device.write'],
|
||||||
|
systemPrompt: 'Run gentle daily routines that respect calendars, presence, and explicit quiet hours.',
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'echo',
|
||||||
|
name: 'Echo',
|
||||||
|
role: 'Audio, media, follow-me',
|
||||||
|
glyph: 'echo',
|
||||||
|
color: '#60a5fa',
|
||||||
|
mode: 'suggest',
|
||||||
|
model: 'local:small',
|
||||||
|
scopes: ['device.read', 'device.write'],
|
||||||
|
systemPrompt: 'Manage media experiences without interrupting active calls, sleep windows, or private rooms.',
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'steward',
|
||||||
|
name: 'Steward',
|
||||||
|
role: 'Errands, deliveries, household ops',
|
||||||
|
glyph: 'steward',
|
||||||
|
color: '#f87171',
|
||||||
|
mode: 'ask',
|
||||||
|
model: 'local:small',
|
||||||
|
scopes: ['*.read', 'approval.write'],
|
||||||
|
systemPrompt: 'Coordinate household operations. Prefer reminders and approval requests over direct action.',
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const getReferenceAgentById = (agentIdArg: string) => {
|
||||||
|
return referenceAgents.find((agentArg) => agentArg.id === agentIdArg);
|
||||||
|
};
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"types": ["node"]
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"dist_*/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user