@geoffai/geoff 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/clients/index.cjs +4 -0
- package/dist/clients/index.d.cts +114 -0
- package/dist/clients/index.d.ts +114 -0
- package/dist/clients/index.js +4 -0
- package/dist/coder-BwKJFaCZ.d.cts +229 -0
- package/dist/coder-BwKJFaCZ.d.ts +229 -0
- package/dist/index-fVOkaOIE.d.cts +170 -0
- package/dist/index-fVOkaOIE.d.ts +170 -0
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +318 -0
- package/dist/index.d.ts +318 -0
- package/dist/index.js +17 -0
- package/dist/points-BXIt899Y.d.ts +579 -0
- package/dist/points-Blo2T9MP.d.cts +579 -0
- package/dist/points-CGAg3YZi.d.cts +777 -0
- package/dist/points-CGAg3YZi.d.ts +777 -0
- package/dist/proxy/index.cjs +2 -0
- package/dist/proxy/index.d.cts +1 -0
- package/dist/proxy/index.d.ts +1 -0
- package/dist/proxy/index.js +2 -0
- package/dist/scouts-CvzLWYpj.d.cts +166 -0
- package/dist/scouts-CvzLWYpj.d.ts +166 -0
- package/dist/streaming/index.cjs +13 -0
- package/dist/streaming/index.d.cts +145 -0
- package/dist/streaming/index.d.ts +145 -0
- package/dist/streaming/index.js +13 -0
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +0 -0
- package/package.json +76 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var m={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};async function*h(i){if(!i.body)throw new Error("Response body is null");let t=i.body.getReader(),r=new TextDecoder,n="",e={};try{for(;;){let{done:a,value:o}=await t.read();if(a)break;n+=r.decode(o,{stream:!0});let s=n.split(`
|
|
2
|
+
`);n=s.pop()||"";for(let c of s){if(c===""){e.data!==void 0&&(yield e),e={};continue}if(c.startsWith(":"))continue;let u=c.indexOf(":");if(u===-1)continue;let f=c.slice(0,u),l=c.slice(u+1).trimStart();switch(f){case "event":e.event=l;break;case "data":try{e.data=JSON.parse(l);}catch{e.data=l;}break;case "id":e.id=l;break;case "retry":e.retry=parseInt(l,10);break}}}e.data!==void 0&&(yield e);}finally{t.releaseLock();}}function S(i,t){let r=new TextEncoder,n=new ReadableStream({async start(e){try{for await(let a of i){let o="";a.event&&(o+=`event: ${a.event}
|
|
3
|
+
`),a.id&&(o+=`id: ${a.id}
|
|
4
|
+
`),a.retry&&(o+=`retry: ${a.retry}
|
|
5
|
+
`);let s=typeof a.data=="string"?a.data:JSON.stringify(a.data);o+=`data: ${s}
|
|
6
|
+
|
|
7
|
+
`,e.enqueue(r.encode(o));}}catch(a){console.error("SSE stream error:",a);}finally{e.close();}}});return new Response(n,{headers:{...m,...t}})}var d=class{encoder=new TextEncoder;controller=null;stream;constructor(){this.stream=new ReadableStream({start:t=>{this.controller=t;}});}getStream(){return this.stream}getResponse(t){return new Response(this.stream,{headers:{...m,...t}})}write(t){if(!this.controller)return;let r="";t.event&&(r+=`event: ${t.event}
|
|
8
|
+
`),t.id&&(r+=`id: ${t.id}
|
|
9
|
+
`);let n=typeof t.data=="string"?t.data:JSON.stringify(t.data);r+=`data: ${n}
|
|
10
|
+
|
|
11
|
+
`,this.controller.enqueue(this.encoder.encode(r));}writeData(t){this.write({data:t});}writeComment(t){this.controller&&this.controller.enqueue(this.encoder.encode(`: ${t}
|
|
12
|
+
|
|
13
|
+
`));}close(){this.controller&&(this.controller.close(),this.controller=null);}error(t){this.controller&&(this.controller.error(t),this.controller=null);}};function g(){return new d}var p=class{constructor(t){this.dataStream=t;}processToolCalls(t){if(!(!t||t.length===0))for(let r of t)try{let n=JSON.parse(r.function.arguments),e=r.function.name;switch(e){case "create_document":this.handleCreateDocument(n,r.id);break;case "update_document":this.handleUpdateDocument(n,r.id);break;default:console.log(`[ComponentStream] Unknown tool: ${e}`);}}catch(n){console.error("[ComponentStream] Error processing tool call:",n);}}processToolResult(t){try{t.type==="artifact"?this.handleArtifactResult(t):t.type==="artifact_update"&&this.handleArtifactUpdate(t);}catch(r){console.error("[ComponentStream] Error processing tool result:",r);}}streamArtifact(t){this.dataStream.write({type:"data-kind",data:t.kind,transient:true}),this.dataStream.write({type:"data-id",data:t.id,transient:true}),this.dataStream.write({type:"data-title",data:t.title,transient:true}),this.dataStream.write({type:"data-clear",data:null,transient:true}),this.streamContent(t.content),this.dataStream.write({type:"data-finish",data:null,transient:true});}streamTextDelta(t){this.dataStream.write({type:"data-textDelta",data:t,transient:true});}streamContent(t,r=50){let n=this.splitIntoChunks(t,r);for(let e of n)this.dataStream.write({type:"data-textDelta",data:e,transient:true});}finish(){this.dataStream.write({type:"data-finish",data:null,transient:true});}handleCreateDocument(t,r){let{title:n,kind:e,content:a}=t,o=`doc_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;console.log(`[ComponentStream] Creating document: ${n} (${e})`),this.streamArtifact({id:o,kind:e,title:n,content:a}),this.dataStream.write({type:"tool-result",data:{toolCallId:r,toolName:"create_document",result:{id:o,title:n,kind:e,message:"Document created successfully"}}});}handleUpdateDocument(t,r){let{id:n,description:e,content:a}=t;console.log(`[ComponentStream] Updating document: ${n}`),this.dataStream.write({type:"data-clear",data:null,transient:true}),this.streamContent(a),this.dataStream.write({type:"data-finish",data:null,transient:true}),this.dataStream.write({type:"tool-result",data:{toolCallId:r,toolName:"update_document",result:{id:n,message:`Document updated: ${e}`}}});}handleArtifactResult(t){let{id:r,title:n,kind:e,content:a}=t;if(!r||!n||!e||!a){console.error("[ComponentStream] Invalid artifact result:",t);return}this.streamArtifact({id:r,kind:e,title:n,content:a});}handleArtifactUpdate(t){let{content:r}=t;if(!r){console.error("[ComponentStream] Invalid artifact update:",t);return}this.dataStream.write({type:"data-clear",data:null,transient:true}),this.streamContent(r),this.dataStream.write({type:"data-finish",data:null,transient:true});}splitIntoChunks(t,r){let n=[],e=t.split(" "),a="";for(let o=0;o<e.length;o++){let s=o===0?e[o]:" "+e[o];a.length+s.length>r&&a.length>0?(n.push(a),a=s.trim()):a+=s;}return a.length>0&&n.push(a),n}};function y(i){return !!(i?.tool_calls&&Array.isArray(i.tool_calls)&&i.tool_calls.length>0)}function E(i){try{let t=JSON.parse(i);if(t.type&&(t.type==="artifact"||t.type==="artifact_update"))return [t]}catch{}return []}function v(i){return new p(i)}export{p as ComponentStreamAdapter,d as SSEWriter,v as createComponentStreamAdapter,S as createSSEResponse,g as createSSEWriter,E as extractToolResults,y as hasToolCalls,h as parseSSEStream};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { am as ActionProof, au as AddPointsInput, A as Agent, r as AgentCreateInput, n as AgentExecuteRequest, o as AgentExecuteResponse, t as AgentFromPromptInput, q as AgentResponse, j as AgentTrigger, s as AgentUpdateInput, k as AgentWorkflow, m as AgentWorkflowEdge, l as AgentWorkflowNode, u as AgentsClientConfig, p as AgentsListResponse, e as ChatCompletionChunk, C as ChatCompletionRequest, f as ChatCompletionResponse, K as CommentResponse, H as CommentsResponse, ah as ContextDomain, aB as ContextResponse, aA as ContextsListResponse, as as CreateContextInput, at as CreateDelegationInput, ar as CreateDomainInput, N as CreatePostInput, O as CreatePostResponse, aj as Delegation, an as DelegationChainLink, ax as DelegationFilters, aD as DelegationResponse, ak as DelegationScope, aC as DelegationsListResponse, az as DomainResponse, ay as DomainsListResponse, G as FeedResponse, a5 as FileUploadResponse, a6 as FilesClientConfig, aw as HistoryFilters, aG as HistoryResponse, h as ImaginationCharacter, i as ImaginationMetadata, I as ImaginationSource, aH as InitNetworkResponse, L as LikeCheckResponse, J as LikeResponse, y as MCPContent, x as MCPMessage, w as MCPSession, v as MCPSessionConfig, z as MCPToolResult, g as MagmaFile, B as MediaType, M as Message, aI as PaymentRequiredResponse, aq as PointBalance, ai as PointContext, al as PointRecord, aE as PointRecordResponse, ao as PointSpend, aF as PointSpendResponse, aJ as PointsClientConfig, P as PostResponse, Q as ProfileResponse, R as RemixesResponse, a7 as Skill, ab as SkillCreateInput, af as SkillMapPromptResponse, ae as SkillMapResponse, aa as SkillResponse, ag as SkillSummaryResponse, ac as SkillUpdateInput, a8 as SkillVerifyResponse, ad as SkillsClientConfig, a9 as SkillsListResponse, S as SocialAuthor, U as SocialClientConfig, E as SocialComment, D as SocialPost, F as SocialRemix, ap as SpendDestination, av as SpendPointsInput, c as TaskPayload, d as TaskResponse, b as TaskState, a as TaskStatus, T as TaskType, a4 as UserClientConfig, a1 as UserProfile, a3 as UserProfileResponse, a2 as UserProfileUpdateInput, V as Widget, Z as WidgetCreateInput, Y as WidgetResponse, $ as WidgetSystemPromptResponse, _ as WidgetUpdateInput, a0 as WidgetsClientConfig, X as WidgetsListResponse, W as WorkflowData } from '../points-CGAg3YZi.cjs';
|
|
2
|
+
export { F as CoderClientConfig, u as CoderCommandInput, t as CoderCommandResult, s as CoderDiffInput, c as CoderExecuteRequest, e as CoderExecuteResponse, p as CoderFileContent, o as CoderFileInfo, q as CoderFileWriteInput, D as CoderFilesResponse, b as CoderMetrics, k as CoderProgressEvent, v as CoderSandbox, d as CoderSandboxConfig, w as CoderSandboxCreateInput, x as CoderSandboxExecInput, y as CoderSandboxExecResult, E as CoderSandboxResponse, r as CoderSearchResult, a as CoderSession, z as CoderSessionResponse, C as CoderSessionStatus, A as CoderSessionsListResponse, g as CoderStreamEvent, f as CoderStreamEventType, h as CoderThinkingEvent, l as CoderTool, i as CoderToolCallEvent, m as CoderToolParameter, n as CoderToolResult, j as CoderToolResultEvent, B as CoderToolsResponse } from '../coder-BwKJFaCZ.cjs';
|
|
3
|
+
export { C as CreateNotificationInput, i as CreateScoutInput, p as DeleteScoutResponse, D as DiffAnalysis, M as MarkAllReadResponse, b as Notification, g as NotificationConfig, a as NotificationPriority, e as NotificationResponse, N as NotificationType, f as NotificationsClientConfig, c as NotificationsListFilters, d as NotificationsListResponse, S as Scout, n as ScoutHistoryResponse, m as ScoutResponse, h as ScoutSnapshot, q as ScoutsClientConfig, k as ScoutsListFilters, l as ScoutsListResponse, o as TriggerScoutResponse, T as TriggerScoutResult, U as UnreadCountResponse, j as UpdateScoutInput } from '../scouts-CvzLWYpj.cjs';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { am as ActionProof, au as AddPointsInput, A as Agent, r as AgentCreateInput, n as AgentExecuteRequest, o as AgentExecuteResponse, t as AgentFromPromptInput, q as AgentResponse, j as AgentTrigger, s as AgentUpdateInput, k as AgentWorkflow, m as AgentWorkflowEdge, l as AgentWorkflowNode, u as AgentsClientConfig, p as AgentsListResponse, e as ChatCompletionChunk, C as ChatCompletionRequest, f as ChatCompletionResponse, K as CommentResponse, H as CommentsResponse, ah as ContextDomain, aB as ContextResponse, aA as ContextsListResponse, as as CreateContextInput, at as CreateDelegationInput, ar as CreateDomainInput, N as CreatePostInput, O as CreatePostResponse, aj as Delegation, an as DelegationChainLink, ax as DelegationFilters, aD as DelegationResponse, ak as DelegationScope, aC as DelegationsListResponse, az as DomainResponse, ay as DomainsListResponse, G as FeedResponse, a5 as FileUploadResponse, a6 as FilesClientConfig, aw as HistoryFilters, aG as HistoryResponse, h as ImaginationCharacter, i as ImaginationMetadata, I as ImaginationSource, aH as InitNetworkResponse, L as LikeCheckResponse, J as LikeResponse, y as MCPContent, x as MCPMessage, w as MCPSession, v as MCPSessionConfig, z as MCPToolResult, g as MagmaFile, B as MediaType, M as Message, aI as PaymentRequiredResponse, aq as PointBalance, ai as PointContext, al as PointRecord, aE as PointRecordResponse, ao as PointSpend, aF as PointSpendResponse, aJ as PointsClientConfig, P as PostResponse, Q as ProfileResponse, R as RemixesResponse, a7 as Skill, ab as SkillCreateInput, af as SkillMapPromptResponse, ae as SkillMapResponse, aa as SkillResponse, ag as SkillSummaryResponse, ac as SkillUpdateInput, a8 as SkillVerifyResponse, ad as SkillsClientConfig, a9 as SkillsListResponse, S as SocialAuthor, U as SocialClientConfig, E as SocialComment, D as SocialPost, F as SocialRemix, ap as SpendDestination, av as SpendPointsInput, c as TaskPayload, d as TaskResponse, b as TaskState, a as TaskStatus, T as TaskType, a4 as UserClientConfig, a1 as UserProfile, a3 as UserProfileResponse, a2 as UserProfileUpdateInput, V as Widget, Z as WidgetCreateInput, Y as WidgetResponse, $ as WidgetSystemPromptResponse, _ as WidgetUpdateInput, a0 as WidgetsClientConfig, X as WidgetsListResponse, W as WorkflowData } from '../points-CGAg3YZi.js';
|
|
2
|
+
export { F as CoderClientConfig, u as CoderCommandInput, t as CoderCommandResult, s as CoderDiffInput, c as CoderExecuteRequest, e as CoderExecuteResponse, p as CoderFileContent, o as CoderFileInfo, q as CoderFileWriteInput, D as CoderFilesResponse, b as CoderMetrics, k as CoderProgressEvent, v as CoderSandbox, d as CoderSandboxConfig, w as CoderSandboxCreateInput, x as CoderSandboxExecInput, y as CoderSandboxExecResult, E as CoderSandboxResponse, r as CoderSearchResult, a as CoderSession, z as CoderSessionResponse, C as CoderSessionStatus, A as CoderSessionsListResponse, g as CoderStreamEvent, f as CoderStreamEventType, h as CoderThinkingEvent, l as CoderTool, i as CoderToolCallEvent, m as CoderToolParameter, n as CoderToolResult, j as CoderToolResultEvent, B as CoderToolsResponse } from '../coder-BwKJFaCZ.js';
|
|
3
|
+
export { C as CreateNotificationInput, i as CreateScoutInput, p as DeleteScoutResponse, D as DiffAnalysis, M as MarkAllReadResponse, b as Notification, g as NotificationConfig, a as NotificationPriority, e as NotificationResponse, N as NotificationType, f as NotificationsClientConfig, c as NotificationsListFilters, d as NotificationsListResponse, S as Scout, n as ScoutHistoryResponse, m as ScoutResponse, h as ScoutSnapshot, q as ScoutsClientConfig, k as ScoutsListFilters, l as ScoutsListResponse, o as TriggerScoutResponse, T as TriggerScoutResult, U as UnreadCountResponse, j as UpdateScoutInput } from '../scouts-CvzLWYpj.js';
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@geoffai/geoff",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SDK for connecting to GeoffNet",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./clients": {
|
|
16
|
+
"types": "./dist/clients/index.d.ts",
|
|
17
|
+
"import": "./dist/clients/index.js",
|
|
18
|
+
"require": "./dist/clients/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./streaming": {
|
|
21
|
+
"types": "./dist/streaming/index.d.ts",
|
|
22
|
+
"import": "./dist/streaming/index.js",
|
|
23
|
+
"require": "./dist/streaming/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./proxy": {
|
|
26
|
+
"types": "./dist/proxy/index.d.ts",
|
|
27
|
+
"import": "./dist/proxy/index.js",
|
|
28
|
+
"require": "./dist/proxy/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./types": {
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
32
|
+
"import": "./dist/types/index.js",
|
|
33
|
+
"require": "./dist/types/index.cjs"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"README.md"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsup",
|
|
42
|
+
"dev": "tsup --watch",
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"clean": "rm -rf dist",
|
|
45
|
+
"build:prod": "NODE_ENV=production tsup",
|
|
46
|
+
"prepublishOnly": "npm run build:prod"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"redis": "^4.7.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^20.0.0",
|
|
53
|
+
"tsup": "^8.0.0",
|
|
54
|
+
"typescript": "^5.0.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"next": ">=14.0.0"
|
|
58
|
+
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"next": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"keywords": [
|
|
65
|
+
"geoff",
|
|
66
|
+
"p2p",
|
|
67
|
+
"task-network",
|
|
68
|
+
"ai",
|
|
69
|
+
"sdk"
|
|
70
|
+
],
|
|
71
|
+
"license": "MIT",
|
|
72
|
+
"repository": {
|
|
73
|
+
"type": "git",
|
|
74
|
+
"url": "https://github.com/geoffai/metachain-v2"
|
|
75
|
+
}
|
|
76
|
+
}
|