Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions agents/cosmo-mail/protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ triggers:
# propose-draft hands a ready-to-send email to the CosmoMail UI as a draft card
# (Insert button). Implemented as a server passthrough so Cosmo can keep talking
# after proposing; the host app renders the tool args.
# propose-draft must stay `display: stream`: the UI reads its arguments off the
# message parts, and a `title`-mode tool arrives there with empty arguments.
tools:
propose-draft:
display: stream
Expand Down
41 changes: 21 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"pack": "node scripts/pack-dist.mjs"
},
"dependencies": {
"@octavus/client-sdk": "^6.10.0",
"@octavus/server-sdk": "^6.10.0",
"@octavus/client-sdk": "^7.2.0",
"@octavus/server-sdk": "^7.2.0",
"@rive-app/canvas": "^2.44.0",
"@tiptap/core": "^3.0.0",
"@tiptap/markdown": "^3.0.0",
Expand All @@ -38,7 +38,7 @@
"marked-highlight": "^2.2.4"
},
"devDependencies": {
"@octavus/cli": "^6.10.0",
"@octavus/cli": "^7.2.0",
"concurrently": "^10.0.1",
"cross-env": "^7.0.3",
"dom-accessibility-api": "^0.7.1",
Expand Down
17 changes: 9 additions & 8 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function doneCharacterIds(record) {

// Attach to an Octavus session, execute the payload, and pipe the SSE stream.
async function streamAgent(res, octavusSessionId, payload, { tools } = {}) {
const session = octavus.agentSessions.attach(
const session = octavus.sessions.attach(
octavusSessionId,
tools ? { tools } : undefined,
);
Expand Down Expand Up @@ -420,7 +420,7 @@ app.post('/api/assistant/session', async (req, res) => {
// Create outside the write lock, then persist on the latest record.
const { config } = await getScenario();
const input = buildAgentSessionInput(config);
const octavusSessionId = await octavus.agentSessions.create(AGENT_ID, input);
const { id: octavusSessionId } = await octavus.sessions.create(AGENT_ID, input);

const record = await updateSessionById(sessionId, (fresh) => {
if (!fresh.octavus_session_id) fresh.octavus_session_id = octavusSessionId;
Expand All @@ -447,7 +447,8 @@ app.post('/api/assistant/clear', async (req, res) => {
if (AGENT_ID) {
const { config } = await getScenario();
const input = buildAgentSessionInput(config);
octavusSessionId = await octavus.agentSessions.create(AGENT_ID, input);
const session = await octavus.sessions.create(AGENT_ID, input);
octavusSessionId = session.id;
}

const record = await updateSessionById(sessionId, (fresh) => {
Expand Down Expand Up @@ -506,9 +507,9 @@ async function runQuickAction({
if (config.generation?.model === undefined) input.MODEL = QUICK_ACTION_MODEL;
if (config.generation?.temperature === undefined) input.TEMPERATURE = 0.3;

const ephemeralId = await octavus.agentSessions.create(AGENT_ID, input);
const { id: ephemeralId } = await octavus.sessions.create(AGENT_ID, input);
try {
const session = octavus.agentSessions.attach(ephemeralId, {
const session = octavus.sessions.attach(ephemeralId, {
tools: buildAssistantTools(capture),
});
// Server SDK uses execute() with the same trigger payload the client sends.
Expand All @@ -527,7 +528,7 @@ async function runQuickAction({
}
} finally {
try {
await octavus.agentSessions.clear(ephemeralId);
await octavus.sessions.clear(ephemeralId);
} catch (err) {
console.warn('[assistant/quick-action] clear failed:', err?.message || err);
}
Expand Down Expand Up @@ -641,7 +642,7 @@ app.post('/api/upload-urls', async (req, res) => {
if (!files.every((f) => uploadAllowed(config, f?.filename))) {
return res.status(400).json({ error: 'File type not allowed' });
}
const result = await octavus.files.getUploadUrls(sessionId, files);
const result = await octavus.files.create(files, { sessionId });
res.json(result);
} catch (err) {
console.error('[upload-urls] Error:', err);
Expand Down Expand Up @@ -751,7 +752,7 @@ app.post('/api/character/session', async (req, res) => {
return res.json({ characterOctavusSessionId: prior });
}

const id = await octavus.agentSessions.create(
const { id } = await octavus.sessions.create(
CHARACTER_AGENT_ID,
buildCharacterSessionInput(config, character),
);
Expand Down
8 changes: 4 additions & 4 deletions similar-project-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ Octavus platform (agent orchestration, model exec, tools) → LLM
- Helpful `EADDRINUSE` message tells you to free the port or use `PORT=3001`.

### 2. Uses the Octavus SDK for all agentic work
- Dependencies: `@octavus/server-sdk` and `@octavus/client-sdk` (both `^3.2.0`),
- Dependencies: `@octavus/server-sdk` and `@octavus/client-sdk` (both `^7.2.0`),
plus `@octavus/cli` as a dev dependency.
- Server side: `new OctavusClient({ baseUrl: OCTAVUS_API_URL, apiKey: OCTAVUS_API_KEY })`.
- `octavus.agentSessions.create(AGENT_ID, input)` — create a session.
- `octavus.agentSessions.attach(sessionId).execute(payload)` — run a turn.
- `octavus.files.getUploadUrls(sessionId, files)` — presigned S3 upload URLs.
- `octavus.sessions.create(AGENT_ID, input)` — create a session (returns the session; its id is `.id`).
- `octavus.sessions.attach(sessionId).execute(payload)` — run a turn.
- `octavus.files.create(files, { sessionId })` — presigned S3 upload URLs.
- `toSSEStream(events)` converts the event stream to SSE for the browser.
- Client side: `OctavusChat` + `createHttpTransport` posts turns to `/api/trigger`
and consumes the SSE stream for real-time token streaming.
Expand Down
Loading