🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@deepnote/blocks

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deepnote/blocks - npm Package Compare versions

Comparing version
4.3.0
to
4.4.0
+23
-0
dist/index.cjs

@@ -105,2 +105,3 @@ //#region rolldown:runtime

const executableBlockTypes = new Set([
"agent",
"code",

@@ -329,2 +330,11 @@ "sql",

});
const agentBlockSchema = zod.z.object({
...executableBlockFields,
type: zod.z.literal("agent"),
content: zod.z.string().optional(),
metadata: executableBlockMetadataSchema.extend({
deepnote_variable_name: zod.z.string().optional(),
deepnote_agent_model: zod.z.string().optional()
}).default({})
});
const bigNumberBlockSchema = zod.z.object({

@@ -440,2 +450,3 @@ ...executableBlockFields,

textCellCalloutBlockSchema,
agentBlockSchema,
codeBlockSchema,

@@ -776,2 +787,13 @@ sqlBlockSchema,

//#endregion
//#region src/blocks/agent-blocks.ts
function createPythonCodeForAgentBlock(block) {
const prompt = block.content ?? "";
if (!prompt.trim()) return "# [agent block] (empty system prompt)";
return `# [agent block] System prompt:\n${prompt.split("\n").map((line) => `# ${line}`).join("\n")}`;
}
function isAgentBlock(block) {
return block.type === "agent";
}
//#endregion
//#region src/blocks/python-utils.ts

@@ -1195,2 +1217,3 @@ function escapePythonString(value) {

function createPythonCode(block, executionContext) {
if (isAgentBlock(block)) return createPythonCodeForAgentBlock(block);
if (isCodeBlock(block)) return createPythonCodeForCodeBlock(block);

@@ -1197,0 +1220,0 @@ if (isSqlBlock(block)) return createPythonCodeForSqlBlock(block);

@@ -79,2 +79,3 @@ import { z } from "zod";

const executableBlockTypes = new Set([
"agent",
"code",

@@ -303,2 +304,11 @@ "sql",

});
const agentBlockSchema = z.object({
...executableBlockFields,
type: z.literal("agent"),
content: z.string().optional(),
metadata: executableBlockMetadataSchema.extend({
deepnote_variable_name: z.string().optional(),
deepnote_agent_model: z.string().optional()
}).default({})
});
const bigNumberBlockSchema = z.object({

@@ -414,2 +424,3 @@ ...executableBlockFields,

textCellCalloutBlockSchema,
agentBlockSchema,
codeBlockSchema,

@@ -750,2 +761,13 @@ sqlBlockSchema,

//#endregion
//#region src/blocks/agent-blocks.ts
function createPythonCodeForAgentBlock(block) {
const prompt = block.content ?? "";
if (!prompt.trim()) return "# [agent block] (empty system prompt)";
return `# [agent block] System prompt:\n${prompt.split("\n").map((line) => `# ${line}`).join("\n")}`;
}
function isAgentBlock(block) {
return block.type === "agent";
}
//#endregion
//#region src/blocks/python-utils.ts

@@ -1169,2 +1191,3 @@ function escapePythonString(value) {

function createPythonCode(block, executionContext) {
if (isAgentBlock(block)) return createPythonCodeForAgentBlock(block);
if (isCodeBlock(block)) return createPythonCodeForCodeBlock(block);

@@ -1171,0 +1194,0 @@ if (isSqlBlock(block)) return createPythonCodeForSqlBlock(block);

+1
-1
{
"name": "@deepnote/blocks",
"version": "4.3.0",
"version": "4.4.0",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [],

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display