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
33 changes: 33 additions & 0 deletions .github/workflows/pkg-pr-new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish PR Preview

on:
pull_request:
types: [opened, synchronize]

jobs:
publish-preview:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9.14.4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build packages
run: pnpm run build

- name: Publish Preview
run: npx pkg-pr-new publish ./packages/sdk
1 change: 1 addition & 0 deletions packages/sdk/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default defineBuildConfig({
entries: ["./src/index", "./src/browser", "./src/prompts/index"],
declaration: true,
clean: true,
failOnWarn: false,
externals: [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling build warnings could hide potential issues. Consider handling warnings instead of suppressing them.

"adm-zip", // Keep as external to avoid bundling
],
Expand Down
17 changes: 17 additions & 0 deletions packages/sdk/dist-browser/browser.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,24 @@ interface FileNode {
lastModified?: Date;
children?: FileNode[];
}
interface PerformanceMetrics {
fetchDuration: number;
parseFiles: number;
tokenCountDuration: number;
totalDuration: number;
memoryUsed?: number;
}
interface FetchMetadata {
totalFiles: number;
totalSize: number;
totalTokens: number;
fetchedAt: Date;
source: string;
gitProvider?: string;
gitOwner?: string;
gitRepo?: string;
gitRef?: string;
metrics?: PerformanceMetrics;
}
interface FetchResult {
root: FileNode;
Expand Down Expand Up @@ -61,6 +73,11 @@ declare const SUPPORTED_MODELS: {
interface FileContent {
path: string;
content: string;
language?: string;
mimeType?: string;
size?: number;
tokens?: number;
encoding?: string;
}
interface MarkdownFromContentOptions {
maxTokens?: number;
Expand Down
17 changes: 17 additions & 0 deletions packages/sdk/dist-browser/browser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,24 @@ interface FileNode {
lastModified?: Date;
children?: FileNode[];
}
interface PerformanceMetrics {
fetchDuration: number;
parseFiles: number;
tokenCountDuration: number;
totalDuration: number;
memoryUsed?: number;
}
interface FetchMetadata {
totalFiles: number;
totalSize: number;
totalTokens: number;
fetchedAt: Date;
source: string;
gitProvider?: string;
gitOwner?: string;
gitRepo?: string;
gitRef?: string;
metrics?: PerformanceMetrics;
}
interface FetchResult {
root: FileNode;
Expand Down Expand Up @@ -61,6 +73,11 @@ declare const SUPPORTED_MODELS: {
interface FileContent {
path: string;
content: string;
language?: string;
mimeType?: string;
size?: number;
tokens?: number;
encoding?: string;
}
interface MarkdownFromContentOptions {
maxTokens?: number;
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/dist-browser/browser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ class WorkerWebCache {
}
}

const isCloudflareWorker = globalThis.WebSocketPair !== void 0 && !("__dirname" in globalThis);
const isCloudflareWorker = globalThis.WebSocketPair !== undefined && !("__dirname" in globalThis);

var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
Expand Down Expand Up @@ -764,7 +764,7 @@ class TarStreamParser {
if (!name) return null;
const sizeStr = this.readString(block, 124, 12);
const size = Number.parseInt(sizeStr, 8);
const typeFlag = String.fromCharCode(block[156]);
const typeFlag = String.fromCodePoint(block[156]);
return {
name: name.replace(/\0+$/, ""),
// Remove null padding
Expand Down
Loading
Loading