Skip to content

Commit d745cb0

Browse files
authored
Merge pull request #1442 from Oneirocom/property-inspector
Property inspector
2 parents f9d9817 + 93471f3 commit d745cb0

File tree

282 files changed

+11374
-1472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+11374
-1472
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ AWS_BUCKET_ENDPOINT=endpoint
6161

6262
CLOUD_AGENT_KEY=key
6363
APT_ROOT_URL=http://0.0.0.0
64+
65+
PLUGINS_DIRECTORY=./plugins

.eslintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"@typescript-eslint/no-explicit-any": "off"
77
},
88
"overrides": [
9+
{
10+
"files": "*.json",
11+
"parser": "jsonc-eslint-parser",
12+
"rules": {}
13+
},
914
{
1015
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
1116
"rules": {

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
33
"editor.codeActionsOnSave": {
4-
"source.fixAll.eslint": "explicit"
4+
"source.fixAll.eslint": true
55
},
66
"editor.formatOnType": false,
77
"editor.defaultFormatter": "esbenp.prettier-vscode",

apps/agent/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { AgentManager } from 'server/agents'
99
import { app, initApp } from 'server/core'
10-
import { initLogger, getLogger } from 'shared/core'
10+
import { initLogger, getLogger } from 'server/logger'
1111
import 'regenerator-runtime/runtime'
1212
import pluginExports from './plugins'
1313
import { PRODUCTION, DONT_CRASH_ON_ERROR } from 'shared/config'

apps/client/src/main.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,19 @@ import {
1111
STANDALONE,
1212
} from 'shared/config'
1313
import { PostHogProvider } from 'posthog-js/react'
14-
import { initLogger, getLogger } from 'shared/core'
1514

1615
import plugins from './plugins'
1716
import { AppConfig } from '@magickml/providers'
1817

1918
// We want to add this back in eventually, but it's causing some visual bugs
2019
//import './globals.css'
21-
22-
initLogger({ name: 'AIDE' })
23-
24-
const logger = getLogger()
25-
26-
logger.info('loaded with plugins %o', plugins)
20+
console.info('loaded with plugins %o', plugins)
2721
/**
2822
* Initialize and render the MagickIDE component when running as a standalone editor (not inside an iframe)
2923
*/
3024
if (window === window.parent) {
31-
logger.info('not in iframe')
3225
if (STANDALONE) {
33-
logger.info('standalone')
26+
console.info('standalone')
3427
const container = document.getElementById('root') as Element
3528
const root = createRoot(container) // createRoot(container!) if you use TypeScript
3629
; (window as any).root = root
@@ -57,7 +50,6 @@ if (window === window.parent) {
5750
root.render(<Root />)
5851
}
5952
} else {
60-
logger.info('iframe: In iframe')
6153
/**
6254
* If the editor is loaded in an iframe, listen for messages from the parent to initialize and render the MagickIDE component
6355
*/
@@ -77,10 +69,10 @@ if (window === window.parent) {
7769
event.origin !== window.location.origin &&
7870
!TRUSTED_PARENT_URLS.includes(event.origin)
7971
) {
80-
logger.error('Untrusted origin %s', event.origin);
72+
console.error('Untrusted origin %s', event.origin);
8173
// Log the trusted origins for debugging purposes
8274
TRUSTED_PARENT_URLS.forEach(trustedUrl => {
83-
logger.error('Trusted origin is %s', trustedUrl);
75+
console.error('Trusted origin is %s', trustedUrl);
8476
});
8577

8678
return;
@@ -110,15 +102,13 @@ if (window === window.parent) {
110102
</PostHogProvider>
111103
)
112104
} else {
113-
logger.info('iframe: rendering without posthog')
114105
return <MagickIDE config={config} />
115106
}
116107
}
117108
const container = document.getElementById('root') as Element
118109
const root = createRoot(container) // createRoot(container!) if you use TypeScript
119110
; (window as any).root = root
120111

121-
logger.info('iframe: rendering root')
122112
root.render(<Root />)
123113
}
124114
},

apps/cloud-agent-manager/src/main.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import {
22
CloudAgentManager,
33
FeathersSyncReporter,
44
} from 'server/cloud-agent-manager'
5-
import { initLogger, getLogger } from 'shared/core'
6-
import { app, BullQueue, initApp } from 'server/core'
5+
import { initLogger, getLogger } from 'server/logger'
6+
import { app, initApp } from 'server/core'
77
import { DONT_CRASH_ON_ERROR, PRODUCTION } from 'shared/config'
88
import { initAgentCommander } from 'server/agents'
99
import { getPinoTransport } from '@hyperdx/node-opentelemetry'
10+
import { BullQueue } from 'server/communication'
1011

1112
if (PRODUCTION) {
1213
initLogger({
@@ -24,7 +25,7 @@ const logger = getLogger()
2425
function start() {
2526
logger.info('Starting cloud agent manager...')
2627
const manager = new CloudAgentManager({
27-
newQueue: new BullQueue(),
28+
newQueue: new BullQueue(app.get('redis')),
2829
agentStateReporter: new FeathersSyncReporter(),
2930
pubSub: app.get('pubsub'),
3031
})

apps/cloud-agent-worker/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CloudAgentWorker } from 'server/cloud-agent-worker'
2-
import { initLogger, getLogger } from 'shared/core'
2+
import { initLogger, getLogger } from 'server/logger'
33
import { initApp } from 'server/core'
44
import pluginExports from './plugins'
55
import { initAgentCommander } from 'server/agents'

apps/server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import cors from '@koa/cors'
77
import Router from '@koa/router'
88
import { pluginManager } from 'shared/core'
99
import { apis, initApp, app, Handler, initFileServer, Method, Middleware, Route, spells } from 'server/core'
10-
import { initLogger, getLogger } from 'shared/core'
10+
import { initLogger, getLogger } from 'server/logger'
1111
import { Context } from 'koa'
1212
import koaBody from 'koa-body'
1313
import compose from 'koa-compose'

docs/eventTaxonomy.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Agent events
2+
Events are a pubsub mechanism to communicate with agents and have them stream data back
3+
4+
agent:{agentId}:event:run
5+
agent:{agentId}:event:spell
6+
agent:{agentId}:event:log
7+
agent:{agentId}:event:warn
8+
agent:{agentId}:event:error
9+
agent:{agentId}:event:command
10+
11+
Agent jobs
12+
Jobs are a 1 to 1 relationship with agents and are used to do a thing once or on a schedule
13+
14+
agent:{agentId}:job:run
15+
agent:{agentId}:job:update
16+
agent:{agentId}:job:delete
17+
18+
Plugin events
19+
20+
agent:{agentId}:{pluginName}:event
21+
22+
agent:{agentId}:spellBook:play
23+
agent:{agentId}:spellBook:pause

0 commit comments

Comments
 (0)