Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
24 changes: 22 additions & 2 deletions claude-code/bundle/capture.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ function sqlStr(value) {
return value.replace(/\\/g, "\\\\").replace(/'/g, "''").replace(/\0/g, "").replace(/[\x01-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
}

// dist/src/utils/client-header.js
function pluginVersion() {
try {
if ("0.6.45") {
return "0.6.45";
}
} catch {
}
return "dev";
}
var DEEPLAKE_CLIENT_HEADER = "X-Deeplake-Client";
function deeplakeClientValue() {
return `hivemind/${pluginVersion()}`;
}
function deeplakeClientHeader() {
return { [DEEPLAKE_CLIENT_HEADER]: deeplakeClientValue() };
}

// dist/src/deeplake-api.js
var log2 = (msg) => log("sdk", msg);
function summarizeSql(sql, maxLen = 220) {
Expand Down Expand Up @@ -187,7 +205,8 @@ var DeeplakeApi = class {
headers: {
Authorization: `Bearer ${this.token}`,
"Content-Type": "application/json",
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
},
signal,
body: JSON.stringify({ query: sql })
Expand Down Expand Up @@ -339,7 +358,8 @@ var DeeplakeApi = class {
const resp = await fetch(`${this.apiUrl}/workspaces/${this.workspaceId}/tables`, {
headers: {
Authorization: `Bearer ${this.token}`,
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
}
});
if (resp.ok) {
Expand Down
39 changes: 32 additions & 7 deletions claude-code/bundle/commands/auth-login.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ import { readFileSync, writeFileSync, existsSync, mkdirSync, unlinkSync } from "
import { join } from "node:path";
import { homedir } from "node:os";
import { execSync } from "node:child_process";

// dist/src/utils/client-header.js
function pluginVersion() {
try {
if ("0.6.45") {
return "0.6.45";
}
} catch {
}
return "dev";
}
var DEEPLAKE_CLIENT_HEADER = "X-Deeplake-Client";
function deeplakeClientValue() {
return `hivemind/${pluginVersion()}`;
}
function deeplakeClientHeader() {
return { [DEEPLAKE_CLIENT_HEADER]: deeplakeClientValue() };
}

// dist/src/commands/auth.js
var CONFIG_DIR = join(homedir(), ".deeplake");
var CREDS_PATH = join(CONFIG_DIR, "credentials.json");
var DEFAULT_API_URL = "https://api.deeplake.ai";
Expand Down Expand Up @@ -32,7 +52,8 @@ function deleteCredentials() {
async function apiGet(path, token, apiUrl, orgId) {
const headers = {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
"Content-Type": "application/json",
...deeplakeClientHeader()
};
if (orgId)
headers["X-Activeloop-Org-Id"] = orgId;
Expand All @@ -44,7 +65,8 @@ async function apiGet(path, token, apiUrl, orgId) {
async function apiPost(path, body, token, apiUrl, orgId) {
const headers = {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
"Content-Type": "application/json",
...deeplakeClientHeader()
};
if (orgId)
headers["X-Activeloop-Org-Id"] = orgId;
Expand All @@ -56,7 +78,8 @@ async function apiPost(path, body, token, apiUrl, orgId) {
async function apiDelete(path, token, apiUrl, orgId) {
const headers = {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
"Content-Type": "application/json",
...deeplakeClientHeader()
};
if (orgId)
headers["X-Activeloop-Org-Id"] = orgId;
Expand All @@ -67,7 +90,7 @@ async function apiDelete(path, token, apiUrl, orgId) {
async function requestDeviceCode(apiUrl = DEFAULT_API_URL) {
const resp = await fetch(`${apiUrl}/auth/device/code`, {
method: "POST",
headers: { "Content-Type": "application/json" }
headers: { "Content-Type": "application/json", ...deeplakeClientHeader() }
});
if (!resp.ok)
throw new Error(`Device flow unavailable: HTTP ${resp.status}`);
Expand All @@ -76,7 +99,7 @@ async function requestDeviceCode(apiUrl = DEFAULT_API_URL) {
async function pollForToken(deviceCode, apiUrl = DEFAULT_API_URL) {
const resp = await fetch(`${apiUrl}/auth/device/token`, {
method: "POST",
headers: { "Content-Type": "application/json" },
headers: { "Content-Type": "application/json", ...deeplakeClientHeader() },
body: JSON.stringify({ device_code: deviceCode })
});
if (resp.ok)
Expand Down Expand Up @@ -368,7 +391,8 @@ var DeeplakeApi = class {
headers: {
Authorization: `Bearer ${this.token}`,
"Content-Type": "application/json",
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
},
signal,
body: JSON.stringify({ query: sql })
Expand Down Expand Up @@ -520,7 +544,8 @@ var DeeplakeApi = class {
const resp = await fetch(`${this.apiUrl}/workspaces/${this.workspaceId}/tables`, {
headers: {
Authorization: `Bearer ${this.token}`,
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
}
});
if (resp.ok) {
Expand Down
24 changes: 22 additions & 2 deletions claude-code/bundle/pre-tool-use.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ function sqlLike(value) {
return sqlStr(value).replace(/%/g, "\\%").replace(/_/g, "\\_");
}

// dist/src/utils/client-header.js
function pluginVersion() {
try {
if ("0.6.45") {
return "0.6.45";
}
} catch {
}
return "dev";
}
var DEEPLAKE_CLIENT_HEADER = "X-Deeplake-Client";
function deeplakeClientValue() {
return `hivemind/${pluginVersion()}`;
}
function deeplakeClientHeader() {
return { [DEEPLAKE_CLIENT_HEADER]: deeplakeClientValue() };
}

// dist/src/deeplake-api.js
var log2 = (msg) => log("sdk", msg);
function summarizeSql(sql, maxLen = 220) {
Expand Down Expand Up @@ -193,7 +211,8 @@ var DeeplakeApi = class {
headers: {
Authorization: `Bearer ${this.token}`,
"Content-Type": "application/json",
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
},
signal,
body: JSON.stringify({ query: sql })
Expand Down Expand Up @@ -345,7 +364,8 @@ var DeeplakeApi = class {
const resp = await fetch(`${this.apiUrl}/workspaces/${this.workspaceId}/tables`, {
headers: {
Authorization: `Bearer ${this.token}`,
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
}
});
if (resp.ok) {
Expand Down
26 changes: 24 additions & 2 deletions claude-code/bundle/session-start-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ import { readFileSync, writeFileSync, existsSync, mkdirSync, unlinkSync } from "
import { join } from "node:path";
import { homedir } from "node:os";
import { execSync } from "node:child_process";

// dist/src/utils/client-header.js
function pluginVersion() {
try {
if ("0.6.45") {
return "0.6.45";
}
} catch {
}
return "dev";
}
var DEEPLAKE_CLIENT_HEADER = "X-Deeplake-Client";
function deeplakeClientValue() {
return `hivemind/${pluginVersion()}`;
}
function deeplakeClientHeader() {
return { [DEEPLAKE_CLIENT_HEADER]: deeplakeClientValue() };
}

// dist/src/commands/auth.js
var CONFIG_DIR = join(homedir(), ".deeplake");
var CREDS_PATH = join(CONFIG_DIR, "credentials.json");
function loadCredentials() {
Expand Down Expand Up @@ -198,7 +218,8 @@ var DeeplakeApi = class {
headers: {
Authorization: `Bearer ${this.token}`,
"Content-Type": "application/json",
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
},
signal,
body: JSON.stringify({ query: sql })
Expand Down Expand Up @@ -350,7 +371,8 @@ var DeeplakeApi = class {
const resp = await fetch(`${this.apiUrl}/workspaces/${this.workspaceId}/tables`, {
headers: {
Authorization: `Bearer ${this.token}`,
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
}
});
if (resp.ok) {
Expand Down
26 changes: 24 additions & 2 deletions claude-code/bundle/session-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ import { readFileSync, writeFileSync, existsSync, mkdirSync, unlinkSync } from "
import { join } from "node:path";
import { homedir } from "node:os";
import { execSync } from "node:child_process";

// dist/src/utils/client-header.js
function pluginVersion() {
try {
if ("0.6.45") {
return "0.6.45";
}
} catch {
}
return "dev";
}
var DEEPLAKE_CLIENT_HEADER = "X-Deeplake-Client";
function deeplakeClientValue() {
return `hivemind/${pluginVersion()}`;
}
function deeplakeClientHeader() {
return { [DEEPLAKE_CLIENT_HEADER]: deeplakeClientValue() };
}

// dist/src/commands/auth.js
var CONFIG_DIR = join(homedir(), ".deeplake");
var CREDS_PATH = join(CONFIG_DIR, "credentials.json");
function loadCredentials() {
Expand Down Expand Up @@ -199,7 +219,8 @@ var DeeplakeApi = class {
headers: {
Authorization: `Bearer ${this.token}`,
"Content-Type": "application/json",
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
},
signal,
body: JSON.stringify({ query: sql })
Expand Down Expand Up @@ -351,7 +372,8 @@ var DeeplakeApi = class {
const resp = await fetch(`${this.apiUrl}/workspaces/${this.workspaceId}/tables`, {
headers: {
Authorization: `Bearer ${this.token}`,
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
}
});
if (resp.ok) {
Expand Down
24 changes: 22 additions & 2 deletions claude-code/bundle/shell/deeplake-shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -66779,6 +66779,24 @@ function sqlLike(value) {
return sqlStr(value).replace(/%/g, "\\%").replace(/_/g, "\\_");
}

// dist/src/utils/client-header.js
function pluginVersion() {
try {
if ("0.6.45") {
return "0.6.45";
}
} catch {
}
return "dev";
}
var DEEPLAKE_CLIENT_HEADER = "X-Deeplake-Client";
function deeplakeClientValue() {
return `hivemind/${pluginVersion()}`;
}
function deeplakeClientHeader() {
return { [DEEPLAKE_CLIENT_HEADER]: deeplakeClientValue() };
}

// dist/src/deeplake-api.js
var log2 = (msg) => log("sdk", msg);
function summarizeSql(sql, maxLen = 220) {
Expand Down Expand Up @@ -66890,7 +66908,8 @@ var DeeplakeApi = class {
headers: {
Authorization: `Bearer ${this.token}`,
"Content-Type": "application/json",
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
},
signal,
body: JSON.stringify({ query: sql })
Expand Down Expand Up @@ -67042,7 +67061,8 @@ var DeeplakeApi = class {
const resp = await fetch(`${this.apiUrl}/workspaces/${this.workspaceId}/tables`, {
headers: {
Authorization: `Bearer ${this.token}`,
"X-Activeloop-Org-Id": this.orgId
"X-Activeloop-Org-Id": this.orgId,
...deeplakeClientHeader()
}
});
if (resp.ok) {
Expand Down
21 changes: 20 additions & 1 deletion claude-code/bundle/wiki-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ function log(tag, msg) {
`);
}

// dist/src/utils/client-header.js
function pluginVersion() {
try {
if ("0.6.45") {
return "0.6.45";
}
} catch {
}
return "dev";
}
var DEEPLAKE_CLIENT_HEADER = "X-Deeplake-Client";
function deeplakeClientValue() {
return `hivemind/${pluginVersion()}`;
}
function deeplakeClientHeader() {
return { [DEEPLAKE_CLIENT_HEADER]: deeplakeClientValue() };
}

// dist/src/hooks/summary-state.js
import { readFileSync, writeFileSync, writeSync, mkdirSync, renameSync, existsSync, unlinkSync, openSync, closeSync } from "node:fs";
import { homedir as homedir2 } from "node:os";
Expand Down Expand Up @@ -154,7 +172,8 @@ async function query(sql, retries = 4) {
headers: {
Authorization: `Bearer ${cfg.token}`,
"Content-Type": "application/json",
"X-Activeloop-Org-Id": cfg.orgId
"X-Activeloop-Org-Id": cfg.orgId,
...deeplakeClientHeader()
},
body: JSON.stringify({ query: sql })
});
Expand Down
Loading
Loading