openpond-code 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/CHANGELOG.md +5 -0
- package/README.md +121 -0
- package/RELEASE.md +24 -0
- package/dist/api.d.ts +247 -0
- package/dist/cache.d.ts +22 -0
- package/dist/cli.js +1767 -0
- package/dist/config.d.ts +16 -0
- package/dist/index.d.ts +154 -0
- package/dist/index.js +1346 -0
- package/dist/indicators.d.ts +38 -0
- package/dist/stream.d.ts +20 -0
- package/dist/types.d.ts +58 -0
- package/package.json +59 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type Bar = {
|
|
2
|
+
time: number;
|
|
3
|
+
open: number;
|
|
4
|
+
high: number;
|
|
5
|
+
low: number;
|
|
6
|
+
close: number;
|
|
7
|
+
volume?: number;
|
|
8
|
+
};
|
|
9
|
+
export type MacdResult = {
|
|
10
|
+
macd: number;
|
|
11
|
+
signalLine: number;
|
|
12
|
+
histogram: number;
|
|
13
|
+
};
|
|
14
|
+
export type MaCrossSignal = "neutral" | "bullish" | "bearish" | "bullish-cross" | "bearish-cross";
|
|
15
|
+
export type MaCrossResult = {
|
|
16
|
+
fast: number;
|
|
17
|
+
slow: number;
|
|
18
|
+
signal: MaCrossSignal;
|
|
19
|
+
};
|
|
20
|
+
export type BollingerResult = {
|
|
21
|
+
middle: number;
|
|
22
|
+
upper: number;
|
|
23
|
+
lower: number;
|
|
24
|
+
};
|
|
25
|
+
export type PriceChangeResult = {
|
|
26
|
+
previous: number;
|
|
27
|
+
percent: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function computeRsi(values: number[], period?: number): number | null;
|
|
30
|
+
export declare function computeSmaSeries(values: number[], period: number): number[];
|
|
31
|
+
export declare function computeSma(values: number[], period: number): number | null;
|
|
32
|
+
export declare function computeEmaSeries(values: number[], period: number): number[];
|
|
33
|
+
export declare function computeEma(values: number[], period: number): number | null;
|
|
34
|
+
export declare function computeMacd(values: number[]): MacdResult | null;
|
|
35
|
+
export declare function computeMaCross(values: number[], type: "sma" | "ema", fastPeriod: number, slowPeriod: number): MaCrossResult | null;
|
|
36
|
+
export declare function computeBollinger(values: number[], period?: number, multiplier?: number): BollingerResult | null;
|
|
37
|
+
export declare function computePriceChange(values: number[], lookback?: number): PriceChangeResult | null;
|
|
38
|
+
export declare function computeAtr(bars: Bar[], period?: number): number | null;
|
package/dist/stream.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ResponseItem } from "./types";
|
|
2
|
+
export type StreamCallbacks = {
|
|
3
|
+
onTextDelta?: (delta: string) => void;
|
|
4
|
+
onReasoningDelta?: (delta: string) => void;
|
|
5
|
+
onConversationId?: (id: string) => void;
|
|
6
|
+
onItems?: (items: ResponseItem[]) => void;
|
|
7
|
+
onUsage?: (usage: {
|
|
8
|
+
promptTokens?: number;
|
|
9
|
+
completionTokens?: number;
|
|
10
|
+
totalTokens?: number;
|
|
11
|
+
}) => void;
|
|
12
|
+
shouldStop?: () => boolean;
|
|
13
|
+
onStop?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function normalizeDataFrames(raw: unknown): {
|
|
16
|
+
conversationId?: string;
|
|
17
|
+
items: ResponseItem[];
|
|
18
|
+
};
|
|
19
|
+
export declare function consumeStream(response: Response, callbacks: StreamCallbacks): Promise<void>;
|
|
20
|
+
export declare function formatStreamItem(item: ResponseItem): string | null;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type ResponseItem = {
|
|
2
|
+
type: string;
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
export type ResponseMessageItem = ResponseItem & {
|
|
6
|
+
type: "message";
|
|
7
|
+
role: "user" | "assistant" | "system";
|
|
8
|
+
content: Array<{
|
|
9
|
+
type: "markdown" | "text" | "json";
|
|
10
|
+
text: string;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
export type ToolCallItem = ResponseItem & {
|
|
14
|
+
type: "tool_call";
|
|
15
|
+
callId?: string;
|
|
16
|
+
name: string;
|
|
17
|
+
args?: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
export type ToolOutputItem = ResponseItem & {
|
|
20
|
+
type: "tool_output";
|
|
21
|
+
callId?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
ok: boolean;
|
|
24
|
+
output?: unknown;
|
|
25
|
+
error?: string;
|
|
26
|
+
};
|
|
27
|
+
export type UsageInfo = {
|
|
28
|
+
promptTokens?: number;
|
|
29
|
+
completionTokens?: number;
|
|
30
|
+
totalTokens?: number;
|
|
31
|
+
};
|
|
32
|
+
export type TemplateBootstrap = {
|
|
33
|
+
name?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
templateId?: string;
|
|
36
|
+
templateRepoUrl?: string;
|
|
37
|
+
templateBranch?: string;
|
|
38
|
+
envVars?: Record<string, string>;
|
|
39
|
+
};
|
|
40
|
+
export type ChatRequestBody = {
|
|
41
|
+
input: ResponseItem[];
|
|
42
|
+
mode: "general" | "builder";
|
|
43
|
+
executionMode?: "local" | "hosted";
|
|
44
|
+
conversationId?: string | null;
|
|
45
|
+
appId?: string | null;
|
|
46
|
+
template?: TemplateBootstrap;
|
|
47
|
+
streamDeployLogs?: boolean;
|
|
48
|
+
userId?: string;
|
|
49
|
+
teamId?: string;
|
|
50
|
+
action?: "tool_result";
|
|
51
|
+
toolResult?: {
|
|
52
|
+
toolName: string;
|
|
53
|
+
callId?: string;
|
|
54
|
+
output?: unknown;
|
|
55
|
+
ok?: boolean;
|
|
56
|
+
error?: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openpond-code",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OpenPond CLI (API key only)",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"openpond-code": "dist/cli.js",
|
|
10
|
+
"openpond": "dist/cli.js",
|
|
11
|
+
"op": "dist/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "bun run src/index.tsx",
|
|
15
|
+
"cli": "bun run src/cli-package.ts",
|
|
16
|
+
"cli:package": "bun run src/cli-package.ts",
|
|
17
|
+
"build:cli": "bun build ./src/cli-package.ts --outfile=dist/cli.js --target=node --banner:js='#!/usr/bin/env node'",
|
|
18
|
+
"build:package": "bun build src/index.ts --outfile dist/index.js --target node",
|
|
19
|
+
"build:types": "tsc --project tsconfig.package.json",
|
|
20
|
+
"lint": "npm run typecheck",
|
|
21
|
+
"typecheck": "npm run build:types",
|
|
22
|
+
"test": "node -e \"console.log('No automated tests configured')\"",
|
|
23
|
+
"build": "npm run build:cli && npm run build:package && npm run build:types",
|
|
24
|
+
"prepublishOnly": "npm run build",
|
|
25
|
+
"changeset": "changeset",
|
|
26
|
+
"changeset:version": "changeset version",
|
|
27
|
+
"changeset:publish": "changeset publish",
|
|
28
|
+
"release": "npm run build && npm run changeset:publish"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/**/*",
|
|
32
|
+
"README.md",
|
|
33
|
+
"CHANGELOG.md",
|
|
34
|
+
"RELEASE.md"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20.0.0"
|
|
41
|
+
},
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"import": "./dist/index.js",
|
|
45
|
+
"types": "./dist/index.d.ts"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@opentui/core": "^0.1.62",
|
|
50
|
+
"@opentui/react": "^0.1.62",
|
|
51
|
+
"react": "^19.2.3",
|
|
52
|
+
"typescript": "^5.6.3",
|
|
53
|
+
"typescript-language-server": "^4.3.3"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@changesets/cli": "^2.29.5",
|
|
57
|
+
"@types/node": "^20.19.24"
|
|
58
|
+
}
|
|
59
|
+
}
|