Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Enable autocomplete preview

Tomas Valenta57f264950911
diff --git a/editor/referenceType.ts b/editor/referenceType.ts
index d68ef5824..d206e5076 100644
--- a/editor/referenceType.ts
+++ b/editor/referenceType.ts
@@ -2,7 +2,6 @@ import Fuse from 'fuse.js'
export enum ReferenceType {
NPMPackage = 'NPM_PACKAGE',
- DEPLOYMENT = 'DEPLOYMENT_SERVICE',
}
export interface Reference {
diff --git a/editor/schema.ts b/editor/schema.ts
index 538a8a91c..dd3c79c6c 100644
--- a/editor/schema.ts
+++ b/editor/schema.ts
@@ -6,19 +6,13 @@ import ListItem from '@tiptap/extension-list-item'
import OrderedList from '@tiptap/extension-ordered-list'
import CodeBlock from '@tiptap/extension-code-block'
+import { Reference } from './referenceType'
+
import ReferenceExtension, {
REFERENCE_TYPE_ATTRIBUTE_NAME,
REFERENCE_VALUE_ATTRIBUTE_NAME,
} from 'editor/extensions/reference'
-export enum ReferenceType {
- NPMPackage = 'NPM_PACKAGE',
-}
-
-export interface Reference {
- type: ReferenceType
- value: string
-}
export const extensions = [
StarterKit.configure({
diff --git a/hooks/useReferences.ts b/hooks/useReferences.ts
index 42ff96a5a..8985bb383 100644
--- a/hooks/useReferences.ts
+++ b/hooks/useReferences.ts
@@ -6,18 +6,24 @@ import Fuse from 'fuse.js'
import { ReferenceType, Reference } from 'editor/referenceType'
// Top 10k NPM packages
// https://gist.github.com/anvaka/8e8fa57c7ee1350e3491
-import topNPMPackages from 'editor/referencePackages.json'
-const packageReferences: Reference[] = topNPMPackages.map(p => ({
- type: ReferenceType.NPMPackage,
- value: p,
-}))
+// const packageReferences: Reference[] = topNPMPackages.map(p => ({
+// type: ReferenceType.NPMPackage,
+// value: p,
+// }))
+const packageReferences: Reference[] = [
+ {
+ type: ReferenceType.NPMPackage,
+ value: '@slack/web-api',
+ }
+]
+
function useReferences(): [Fuse<Reference>, Reference[]] {
const references = useMemo<Reference[]>(() => [
// TODO: Package search is synchronous and even with just 10k packages it freezes the whole app.
- // ...packageReferences,
+ ...packageReferences,
], [])
const engine = useMemo(() => new Fuse(references, {