Skip to content

An open-source, faster Devin alternative

TypeScript

memory: read declared resources from the deployment record

Igor Zalutskiea9bb74be9af
diff --git a/cli/package-lock.json b/cli/package-lock.json
index 9eaa02f7..4067f3f6 100644
--- a/cli/package-lock.json
+++ b/cli/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@opencomputer/cli",
- "version": "0.7.0",
+ "version": "0.7.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@opencomputer/cli",
- "version": "0.7.0",
+ "version": "0.7.1",
"dependencies": {
"@opencode-ai/sdk": "1.18.4",
"ai": "^7.0.45",
diff --git a/cli/package.json b/cli/package.json
index 342a6724..16f51ee8 100644
--- a/cli/package.json
+++ b/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@opencomputer/cli",
- "version": "0.7.0",
+ "version": "0.7.1",
"description": "Build, test, deploy, and share OpenComputer agents as code.",
"type": "module",
"bin": {
diff --git a/cli/src/api.ts b/cli/src/api.ts
index 07273e1c..8658a68f 100644
--- a/cli/src/api.ts
+++ b/cli/src/api.ts
@@ -266,13 +266,6 @@ export interface MemoryDocumentRead {
etag: string;
}
-/** A memory resource declared by a deployment (`projectDeployment.resources.memory`). */
-export interface MemoryDeclaration {
- id: string;
- description?: string;
- provider?: { kind: string; maxBytes?: number };
-}
-
interface CreateSessionResult {
session: ManagedSessionSnapshot;
deployment?: ManagedAgentDeployment;
@@ -745,11 +738,12 @@ export class OpenComputerClient {
deployment(deploymentId: string) {
return this.request<
ManagedAgentDeployment & {
- projectDeployment?: {
- resources?: Partial<ProjectResourceManifest> & {
- memory?: MemoryDeclaration[];
- };
- };
+ /** Memory resources the deployment declares; absent on older deployments. */
+ memory?: Array<{
+ id: string;
+ description?: string;
+ provider?: { kind?: string; maxBytes?: number };
+ }>;
}
>(`/api/managed-agents/deployments/${encodeURIComponent(deploymentId)}`);
}
diff --git a/cli/src/commands.ts b/cli/src/commands.ts
index 225f6efa..f38996d6 100644
--- a/cli/src/commands.ts
+++ b/cli/src/commands.ts
@@ -371,8 +371,7 @@ async function memoryResourcesForEnvironment(
const resources = new Set<string>();
for (const deploymentId of deploymentIds) {
const deployment = await client.deployment(deploymentId);
- for (const declaration of deployment.projectDeployment?.resources?.memory ??
- []) {
+ for (const declaration of deployment.memory ?? []) {
if (typeof declaration.id === "string") resources.add(declaration.id);
}
}
diff --git a/cloudflare-workers/api-edge/src/managed_agents.test.ts b/cloudflare-workers/api-edge/src/managed_agents.test.ts
index 7bd5dd2b..3772fe95 100644
--- a/cloudflare-workers/api-edge/src/managed_agents.test.ts
+++ b/cloudflare-workers/api-edge/src/managed_agents.test.ts
@@ -842,6 +842,19 @@ describe("managed agents proxy", () => {
channels: ["slack"],
connections: ["gmail"],
createdAt: "2026-07-31T00:00:00.000Z",
+ memory: [
+ {
+ id: "requirements",
+ description: "Verified requirements.",
+ provider: {
+ kind: "http",
+ maxBytes: 8192,
+ connection: "notes-api",
+ path: "/memory",
+ tools: [{ name: "search" }],
+ },
+ },
+ ],
artifact: { bucket: "private", key: "source.tar.gz" },
imageArn: "arn:aws:private",
imageVersion: "7",
@@ -868,6 +881,13 @@ describe("managed agents proxy", () => {
channels: ["slack"],
connections: ["gmail"],
createdAt: "2026-07-31T00:00:00.000Z",
+ memory: [
+ {
+ id: "requirements",
+ description: "Verified requirements.",
+ provider: { kind: "http", maxBytes: 8192 },
+ },
+ ],
});
});
diff --git a/cloudflare-workers/api-edge/src/managed_agents.ts b/cloudflare-workers/api-edge/src/managed_agents.ts
index 71f8c44f..bf7ae06a 100644
--- a/cloudflare-workers/api-edge/src/managed_agents.ts
+++ b/cloudflare-workers/api-edge/src/managed_agents.ts
@@ -312,6 +312,18 @@ async function memoryResponse(
});
}
+// A memory resource the deployment declares (docs/agents/document-memory.mdx,
+// "Configuration"): what the Memory page and `memory export` enumerate.
+function publicMemoryDeclaration(value: unknown): Record<string, unknown> {
+ const declaration = record(value) ?? {};
+ const provider = record(declaration.provider) ?? {};
+ return {
+ id: declaration.id,
+ description: declaration.description,
+ provider: { kind: provider.kind, maxBytes: provider.maxBytes },
+ };
+}
+
function publicDeployment(value: unknown): Record<string, unknown> {
const deployment = record(value) ?? {};
return {
@@ -321,6 +333,9 @@ function publicDeployment(value: unknown): Record<string, unknown> {
channels: strings(deployment.channels),
connections: strings(deployment.connections),
createdAt: deployment.createdAt,
+ ...(Array.isArray(deployment.memory)
+ ? { memory: deployment.memory.map(publicMemoryDeclaration) }
+ : {}),
...(deployment.projectDeployment
? { projectDeployment: stripPrivateValues(deployment.projectDeployment) }
: {}),