@harperfast/agent 0.16.6 → 0.16.7
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/dist/{agent.js → chunk-LSVGOLBU.js} +526 -3374
- package/dist/cli.js +2919 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.js +6 -0
- package/package.json +9 -6
- /package/dist/{agent.d.ts → cli.d.ts} +0 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Session, Agent, Tool } from '@openai/agents';
|
|
2
|
+
|
|
3
|
+
interface Message {
|
|
4
|
+
id: number;
|
|
5
|
+
version: number;
|
|
6
|
+
type: 'prompt' | 'user' | 'agent' | 'tool' | 'interrupted';
|
|
7
|
+
handled?: boolean;
|
|
8
|
+
text: string;
|
|
9
|
+
args?: string;
|
|
10
|
+
callId?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type PlanItemStatus = 'todo' | 'in-progress' | 'done' | 'not-needed';
|
|
14
|
+
interface PlanItemPersisted {
|
|
15
|
+
id: number;
|
|
16
|
+
text: string;
|
|
17
|
+
status: PlanItemStatus;
|
|
18
|
+
}
|
|
19
|
+
interface PlanState {
|
|
20
|
+
planDescription: string;
|
|
21
|
+
planItems: PlanItemPersisted[];
|
|
22
|
+
progress?: number;
|
|
23
|
+
}
|
|
24
|
+
interface WithPlanState {
|
|
25
|
+
/**
|
|
26
|
+
* Returns the persisted plan state for the current session, or null if none exists.
|
|
27
|
+
*/
|
|
28
|
+
getPlanState(): Promise<PlanState>;
|
|
29
|
+
/**
|
|
30
|
+
* Merges and persists a partial plan state for the current session.
|
|
31
|
+
*/
|
|
32
|
+
setPlanState(state: Partial<PlanState>): Promise<void> | void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type WithRunCompaction = {
|
|
36
|
+
runCompaction: (args?: any) => Promise<any>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
interface WithSkillsRead {
|
|
40
|
+
addSkillRead(skill: string): Promise<void> | void;
|
|
41
|
+
getSkillsRead(): Promise<string[]>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface WithLatestAddedTimestamp {
|
|
45
|
+
getLatestAddedTimestamp(): Promise<number | null>;
|
|
46
|
+
}
|
|
47
|
+
type CombinedSession = Session & WithRunCompaction & WithSkillsRead & WithPlanState & WithLatestAddedTimestamp;
|
|
48
|
+
|
|
49
|
+
declare class AgentManager {
|
|
50
|
+
private isInitialized;
|
|
51
|
+
private controller;
|
|
52
|
+
private queuedUserInputs;
|
|
53
|
+
private resumeState;
|
|
54
|
+
agent: Agent | null;
|
|
55
|
+
session: CombinedSession | null;
|
|
56
|
+
initialMessages: Message[];
|
|
57
|
+
static instantiateAgent(tools: Tool[], instructions?: string): Agent<unknown, "text">;
|
|
58
|
+
initialize(agent?: Agent, session?: CombinedSession): Promise<void>;
|
|
59
|
+
enqueueUserInput(text: string): void;
|
|
60
|
+
runTask(task: string, isPrompt?: boolean): Promise<void>;
|
|
61
|
+
private runCompactionIfWeWereIdle;
|
|
62
|
+
interrupt(): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { AgentManager };
|
package/dist/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harperfast/agent",
|
|
3
3
|
"description": "AI to help you with Harper app management",
|
|
4
|
-
"version": "0.16.
|
|
5
|
-
"main": "dist/
|
|
4
|
+
"version": "0.16.7",
|
|
5
|
+
"main": "dist/cli.js",
|
|
6
6
|
"repository": "github:HarperFast/harper-agent",
|
|
7
7
|
"bugs": {
|
|
8
8
|
"url": "https://github.com/harperfast/harper-agent/issues"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://github.com/harperfast",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"dev": "tsup
|
|
12
|
+
"dev": "tsup index.ts cli.ts --format esm --clean --dts --watch --external puppeteer",
|
|
13
13
|
"link": "npm run build && npm link",
|
|
14
|
-
"build": "tsup
|
|
14
|
+
"build": "tsup index.ts cli.ts --format esm --clean --dts --external puppeteer && cp node_modules/harperdb/schema.graphql dist/",
|
|
15
15
|
"commitlint": "commitlint --edit",
|
|
16
|
-
"start": "node ./dist/
|
|
16
|
+
"start": "node ./dist/cli.js",
|
|
17
17
|
"lint": "oxlint --format stylish .",
|
|
18
18
|
"lint:fix": "oxlint --format stylish . --fix",
|
|
19
19
|
"prepare": "husky",
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
"prepublishOnly": "npm run build"
|
|
29
29
|
},
|
|
30
30
|
"bin": {
|
|
31
|
-
"harper-agent": "./dist/
|
|
31
|
+
"harper-agent": "./dist/cli.js"
|
|
32
|
+
},
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./dist/index.js"
|
|
32
35
|
},
|
|
33
36
|
"keywords": [],
|
|
34
37
|
"author": {
|
|
File without changes
|