@cjhyy/code-shell-pet 0.8.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 +99 -0
- package/dist/capability.d.ts +15 -0
- package/dist/capability.js +251 -0
- package/dist/current-time.d.ts +5 -0
- package/dist/current-time.js +43 -0
- package/dist/delegate-work.d.ts +7 -0
- package/dist/delegate-work.js +142 -0
- package/dist/delegation.d.ts +33 -0
- package/dist/delegation.js +6 -0
- package/dist/disclosure/catalog.d.ts +22 -0
- package/dist/disclosure/catalog.js +104 -0
- package/dist/disclosure/constants.d.ts +7 -0
- package/dist/disclosure/constants.js +7 -0
- package/dist/disclosure/jsonl.d.ts +9 -0
- package/dist/disclosure/jsonl.js +61 -0
- package/dist/disclosure/latest-result.d.ts +8 -0
- package/dist/disclosure/latest-result.js +35 -0
- package/dist/disclosure/search.d.ts +21 -0
- package/dist/disclosure/search.js +124 -0
- package/dist/disclosure/selector.d.ts +2 -0
- package/dist/disclosure/selector.js +5 -0
- package/dist/disclosure/todo-snapshot.d.ts +8 -0
- package/dist/disclosure/todo-snapshot.js +54 -0
- package/dist/follow-ups.d.ts +21 -0
- package/dist/follow-ups.js +102 -0
- package/dist/gateway.d.ts +41 -0
- package/dist/gateway.js +263 -0
- package/dist/host-actions.d.ts +51 -0
- package/dist/host-actions.js +405 -0
- package/dist/index.capability.d.ts +7 -0
- package/dist/index.capability.js +7 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.disclosure.d.ts +13 -0
- package/dist/index.disclosure.js +13 -0
- package/dist/index.js +32 -0
- package/dist/index.protocol.d.ts +8 -0
- package/dist/index.protocol.js +8 -0
- package/dist/index.team.d.ts +2 -0
- package/dist/index.team.js +2 -0
- package/dist/long-task.d.ts +251 -0
- package/dist/long-task.js +795 -0
- package/dist/mobile-remote.d.ts +14 -0
- package/dist/mobile-remote.js +39 -0
- package/dist/outbound-message.d.ts +15 -0
- package/dist/outbound-message.js +127 -0
- package/dist/pending-decision-index.d.ts +24 -0
- package/dist/pending-decision-index.js +110 -0
- package/dist/profile.d.ts +27 -0
- package/dist/profile.js +120 -0
- package/dist/projection-extension.d.ts +8 -0
- package/dist/projection-extension.js +238 -0
- package/dist/protocol.d.ts +58 -0
- package/dist/protocol.js +15 -0
- package/dist/report-to-mimi.d.ts +7 -0
- package/dist/report-to-mimi.js +87 -0
- package/dist/run-params.d.ts +34 -0
- package/dist/run-params.js +387 -0
- package/dist/segment-closure.d.ts +52 -0
- package/dist/segment-closure.js +130 -0
- package/dist/session-control.d.ts +5 -0
- package/dist/session-control.js +46 -0
- package/dist/session-index.d.ts +22 -0
- package/dist/session-index.js +324 -0
- package/dist/sessions-tool.d.ts +21 -0
- package/dist/sessions-tool.js +145 -0
- package/dist/team.d.ts +13 -0
- package/dist/team.js +38 -0
- package/dist/tool-arguments.d.ts +1 -0
- package/dist/tool-arguments.js +10 -0
- package/dist/topic-segment.d.ts +55 -0
- package/dist/topic-segment.js +37 -0
- package/dist/types.d.ts +95 -0
- package/dist/types.js +1 -0
- package/package.json +56 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { SessionOrigin, SessionStatus, StreamEvent, TurnCompletionKind } from "@cjhyy/code-shell-core/extension";
|
|
2
|
+
export declare const LOCAL_PET_OWNER: "local-user";
|
|
3
|
+
export type PetOwnerId = typeof LOCAL_PET_OWNER;
|
|
4
|
+
export type PetWorkerState = "active" | "reclaimed" | "disconnected" | "unknown";
|
|
5
|
+
export type PetSessionRunState = "dormant" | "idle" | "queued" | "running" | "terminal" | "unknown";
|
|
6
|
+
export type PetSessionPhase = "model" | "tool" | "waiting-decision" | "compacting" | "finalizing";
|
|
7
|
+
export type PetTerminalStatus = "completed" | "failed" | "cancelled";
|
|
8
|
+
export interface PetProjectionCursor {
|
|
9
|
+
generation: number;
|
|
10
|
+
version: number;
|
|
11
|
+
observedAt: number;
|
|
12
|
+
}
|
|
13
|
+
export interface PetProjectionFreshness {
|
|
14
|
+
source: "disk" | "live-snapshot" | "live-event";
|
|
15
|
+
observedAt: number;
|
|
16
|
+
workerState: PetWorkerState;
|
|
17
|
+
}
|
|
18
|
+
export interface PetSessionProjection {
|
|
19
|
+
owner: PetOwnerId;
|
|
20
|
+
agentSessionId: string;
|
|
21
|
+
coreSessionId: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
workspaceDisplayName?: string;
|
|
24
|
+
runState: PetSessionRunState;
|
|
25
|
+
phase?: PetSessionPhase;
|
|
26
|
+
summary?: string;
|
|
27
|
+
queueDepth: number;
|
|
28
|
+
lastActivityAt: number;
|
|
29
|
+
pendingDecisionCount: number;
|
|
30
|
+
/** Exceptional completed-run boundary that is waiting for recovery/continuation. */
|
|
31
|
+
completionKind?: TurnCompletionKind;
|
|
32
|
+
terminal?: {
|
|
33
|
+
status: PetTerminalStatus;
|
|
34
|
+
at: number;
|
|
35
|
+
};
|
|
36
|
+
freshness: PetProjectionFreshness;
|
|
37
|
+
}
|
|
38
|
+
export interface PetCatalogSession {
|
|
39
|
+
sessionId: string;
|
|
40
|
+
title?: string;
|
|
41
|
+
workspaceDisplayName?: string;
|
|
42
|
+
updatedAt: number;
|
|
43
|
+
origin?: SessionOrigin;
|
|
44
|
+
kind?: "work" | "pet";
|
|
45
|
+
ephemeral?: boolean;
|
|
46
|
+
parentSessionId?: string | null;
|
|
47
|
+
status?: SessionStatus;
|
|
48
|
+
completionKind?: TurnCompletionKind;
|
|
49
|
+
}
|
|
50
|
+
export interface PetOwnerScopedCatalog {
|
|
51
|
+
owner: PetOwnerId;
|
|
52
|
+
sessions: readonly PetCatalogSession[];
|
|
53
|
+
observedAt: number;
|
|
54
|
+
}
|
|
55
|
+
export interface PetLiveSessionState {
|
|
56
|
+
sessionId: string;
|
|
57
|
+
busy: boolean;
|
|
58
|
+
queueDepth: number;
|
|
59
|
+
lastActivityAt: number;
|
|
60
|
+
}
|
|
61
|
+
export interface PetLiveSessionsSnapshot extends PetProjectionCursor {
|
|
62
|
+
sessions: readonly PetLiveSessionState[];
|
|
63
|
+
}
|
|
64
|
+
export interface PetSessionStreamEvent extends PetProjectionCursor {
|
|
65
|
+
sessionId: string;
|
|
66
|
+
event: StreamEvent;
|
|
67
|
+
}
|
|
68
|
+
export interface PetWorkerLifecycleEvent extends PetProjectionCursor {
|
|
69
|
+
state: Exclude<PetWorkerState, "unknown">;
|
|
70
|
+
}
|
|
71
|
+
export type PendingDecisionKind = "tool_approval" | "ask_user";
|
|
72
|
+
export type PendingDecisionStatus = "pending" | "resolved" | "expired" | "cancelled" | "owner-lost";
|
|
73
|
+
export interface PendingDecisionProjection {
|
|
74
|
+
owner: PetOwnerId;
|
|
75
|
+
agentSessionId: string;
|
|
76
|
+
coreSessionId: string;
|
|
77
|
+
requestId: string;
|
|
78
|
+
routeGeneration?: number;
|
|
79
|
+
workerGeneration: number;
|
|
80
|
+
kind: PendingDecisionKind;
|
|
81
|
+
title: string;
|
|
82
|
+
toolName?: string;
|
|
83
|
+
riskLevel?: "low" | "medium" | "high";
|
|
84
|
+
createdAt: number;
|
|
85
|
+
expiresAt?: number;
|
|
86
|
+
status: PendingDecisionStatus;
|
|
87
|
+
terminalAt?: number;
|
|
88
|
+
}
|
|
89
|
+
export interface PetProjectionSnapshot {
|
|
90
|
+
snapshotVersion: number;
|
|
91
|
+
workerGeneration: number;
|
|
92
|
+
observedAt: number;
|
|
93
|
+
sessions: PetSessionProjection[];
|
|
94
|
+
pending: PendingDecisionProjection[];
|
|
95
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const LOCAL_PET_OWNER = "local-user";
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cjhyy/code-shell-pet",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Pet (top-level personal assistant) capability for CodeShell — projection state machine, DelegateWork contract, Mimi behavior profile.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./capability": {
|
|
14
|
+
"types": "./dist/index.capability.d.ts",
|
|
15
|
+
"import": "./dist/index.capability.js"
|
|
16
|
+
},
|
|
17
|
+
"./protocol": {
|
|
18
|
+
"types": "./dist/index.protocol.d.ts",
|
|
19
|
+
"import": "./dist/index.protocol.js"
|
|
20
|
+
},
|
|
21
|
+
"./team": {
|
|
22
|
+
"types": "./dist/index.team.d.ts",
|
|
23
|
+
"import": "./dist/index.team.js"
|
|
24
|
+
},
|
|
25
|
+
"./disclosure": {
|
|
26
|
+
"types": "./dist/index.disclosure.d.ts",
|
|
27
|
+
"import": "./dist/index.disclosure.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "bun run clean && tsc -p tsconfig.json",
|
|
35
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@cjhyy/code-shell-core": "0.8.0"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=20.10"
|
|
42
|
+
},
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/cjhyy/codeshell.git",
|
|
46
|
+
"directory": "packages/pet"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/cjhyy/codeshell/tree/main/packages/pet#readme",
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/cjhyy/codeshell/issues"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"license": "MIT"
|
|
56
|
+
}
|