@jdscript/opencode-notify 0.0.0-stage → 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.
@@ -0,0 +1,75 @@
1
+ import type { Plugin } from "@opencode/plugin";
2
+ import type { Subscribe } from "./rpc.js";
3
+ export type SessionInfo = Awaited<ReturnType<Plugin.Context["session"]["get"]>>;
4
+ export type Event = ReturnType<Plugin.Context["event"]["subscribe"]> extends AsyncIterable<infer T> ? T : never;
5
+ export type Storage = Plugin.Context["storage"];
6
+ export interface Content {
7
+ title: string;
8
+ project: string;
9
+ phase: "working" | "attention" | "complete" | "failed" | "stopped" | "idle" | "offline";
10
+ detail: string;
11
+ agents: number;
12
+ shells: number;
13
+ waiting: number;
14
+ cost?: number;
15
+ startedAt?: number;
16
+ updatedAt: number;
17
+ sessionCount?: number;
18
+ items?: Array<{
19
+ id: string;
20
+ title: string;
21
+ phase: Content["phase"];
22
+ updatedAt?: number;
23
+ }>;
24
+ }
25
+ export interface Plaintext {
26
+ version: 1;
27
+ subscriptionID: string;
28
+ eventID: string;
29
+ installationID: string;
30
+ serverID: string;
31
+ kind: "alert" | "live_activity";
32
+ producer: "server";
33
+ issuedAt: number;
34
+ expiresAt: number;
35
+ sessionID: string;
36
+ directory: string;
37
+ activityID?: string;
38
+ event?: "update" | "end";
39
+ timestamp?: number;
40
+ content: Content;
41
+ }
42
+ export interface Subscription {
43
+ input: Subscribe;
44
+ revoked: boolean;
45
+ unavailable: boolean;
46
+ billingUntil?: number;
47
+ }
48
+ export interface Activity {
49
+ subscriptionID: string;
50
+ activityID: string;
51
+ sessionID: string;
52
+ expiresAt: number;
53
+ ended: boolean;
54
+ unavailable?: boolean;
55
+ lastTimestamp: number;
56
+ lastSent: number;
57
+ scope?: "session" | "server" | "workspace";
58
+ serverName?: string;
59
+ }
60
+ export interface Push {
61
+ event_id: string;
62
+ kind: "alert" | "live_activity";
63
+ ciphertext: string;
64
+ activity_id?: string;
65
+ event?: "update" | "end";
66
+ timestamp?: number;
67
+ settled?: boolean;
68
+ }
69
+ export interface Job {
70
+ subscriptionID: string;
71
+ body: Push;
72
+ expiresAt: number;
73
+ attempt: number;
74
+ next: number;
75
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/index.js ADDED
@@ -0,0 +1,2 @@
1
+ // OpenCode's local-directory discovery resolves <directory>/index before package exports.
2
+ export { default } from "./dist/index.js"
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@jdscript/opencode-notify",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "End-to-end encrypted mobile notifications and Live Activity updates for OpenCode v2",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "license": "MIT",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./rpc": {
14
+ "types": "./dist/rpc.d.ts",
15
+ "import": "./dist/rpc.js"
16
+ },
17
+ "./crypto": {
18
+ "types": "./dist/crypto.d.ts",
19
+ "import": "./dist/crypto.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "index.js",
25
+ "README.md",
26
+ "VERIFICATION.md"
27
+ ],
28
+ "scripts": {
29
+ "build": "tsc -p tsconfig.build.json",
30
+ "typecheck": "tsc --noEmit",
31
+ "test": "bun test",
32
+ "test:upstream": "python3 scripts/check-upstream.py"
33
+ },
34
+ "engines": {
35
+ "node": ">=22"
36
+ },
37
+ "peerDependencies": {
38
+ "@opencode/plugin": ">=2.0.26 <3"
39
+ },
40
+ "dependencies": {
41
+ "zod": "^4.1.8"
42
+ },
43
+ "devDependencies": {
44
+ "@opencode/plugin": "2.0.26",
45
+ "@opencode/sdk": "2.0.26",
46
+ "@types/bun": "^1.3.0",
47
+ "@types/node": "^22.0.0",
48
+ "typescript": "^5.8.2"
49
+ }
50
+ }