@hydraharness/harness-notifications 0.0.0-stage → 0.1.1-rc.11

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,15 @@
1
- # Temporary Holding Version
1
+ # Live notifications
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The `notifications` settings namespace controls live turn completion, pending questions, display-permission prompts, and sound. Completion defaults to Background. API proxy emits `notifications/requested` only when a new turn ends or a new question is requested; transcript reload does not emit it. Connected Web windows use browser permission. Desktop windows share native delivery and deduplicate stable notification ids. Clicking a question opens its chat.
4
+
5
+ ## Model Experience
6
+
7
+ None, as live notification delivery adds no model input or transcript content.
8
+
9
+ #### KV Cache effect
10
+
11
+ None; notification policies do not alter model requests.
12
+
13
+ ## Known Limitations and Deferred Work
14
+
15
+ - Web delivery requires a connected page and browser display permission. Desktop delivery remains subject to OS notification settings.
package/lib/index.js ADDED
@@ -0,0 +1,22 @@
1
+ import z from "@hydraharness/schemastery";
2
+ import { settingsNamespace } from "@hydraharness/harness-settings";
3
+ //#region lib/types/index.js
4
+ /** Registers global live-notification policy.
5
+ * @param ctx - Host settings owner.
6
+ */
7
+ function apply(ctx) {
8
+ ctx.inject(["settings"], (sctx) => {
9
+ sctx.settings.register(settingsNamespace("notifications"), z.object({
10
+ completion: z.union([
11
+ "never",
12
+ "background",
13
+ "always"
14
+ ]).default("background"),
15
+ permissionPrompts: z.boolean().default(true),
16
+ questions: z.boolean().default(true),
17
+ sound: z.union(["default", "off"]).default("default")
18
+ }));
19
+ });
20
+ }
21
+ //#endregion
22
+ export { apply };
@@ -0,0 +1,17 @@
1
+ //#region lib/types/invariant.js
2
+ /** Cordis companion plugin name. */
3
+ const name = "notifications-invariant";
4
+ /** Service required before reserving package ownership. */
5
+ const inject = ["invariants"];
6
+ /**
7
+ * No runtime invariant: this plugin registers settings while browser and OS providers own notification delivery; it owns
8
+ * no mutable delivery projection.
9
+ */
10
+ const install = () => {};
11
+ /** Registers this package's invariant ownership.
12
+ * @param ctx - Cordis context carrying the invariant service.
13
+ * @returns registration disposer.
14
+ */
15
+ const apply = (ctx) => Promise.resolve(ctx.invariants.register("@hydraharness/harness-notifications", install));
16
+ //#endregion
17
+ export { apply, inject, name };
@@ -0,0 +1,8 @@
1
+ /** User policy for live notifications, delivered by connected Web or Desktop providers. */
2
+ import type { Context } from '@hydraharness/cordis';
3
+ export type { NotificationId, NotificationRequest, NotificationSettings } from './types.ts';
4
+ /** Registers global live-notification policy.
5
+ * @param ctx - Host settings owner.
6
+ */
7
+ export declare function apply(ctx: Context): void;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,15 @@
1
+ import z from '@hydraharness/schemastery';
2
+ import { settingsNamespace } from '@hydraharness/harness-settings';
3
+ /** Registers global live-notification policy.
4
+ * @param ctx - Host settings owner.
5
+ */
6
+ export function apply(ctx) {
7
+ ctx.inject(['settings'], (sctx) => {
8
+ sctx.settings.register(settingsNamespace('notifications'), z.object({
9
+ completion: z.union(['never', 'background', 'always']).default('background'),
10
+ permissionPrompts: z.boolean().default(true), questions: z.boolean().default(true),
11
+ sound: z.union(['default', 'off']).default('default'),
12
+ }));
13
+ });
14
+ }
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,12 @@
1
+ /** Package-owned invariant companion for `@hydraharness/harness-notifications`. */
2
+ import type { Context } from '@hydraharness/cordis';
3
+ /** Cordis companion plugin name. */
4
+ export declare const name = "notifications-invariant";
5
+ /** Service required before reserving package ownership. */
6
+ export declare const inject: string[];
7
+ /** Registers this package's invariant ownership.
8
+ * @param ctx - Cordis context carrying the invariant service.
9
+ * @returns registration disposer.
10
+ */
11
+ export declare const apply: (ctx: Context) => Promise<() => void>;
12
+ //# sourceMappingURL=invariant.d.ts.map
@@ -0,0 +1,16 @@
1
+ /** Cordis companion plugin name. */
2
+ export const name = 'notifications-invariant';
3
+ /** Service required before reserving package ownership. */
4
+ export const inject = ['invariants'];
5
+ /**
6
+ * No runtime invariant: this plugin registers settings while browser and OS providers own notification delivery; it owns
7
+ * no mutable delivery projection.
8
+ */
9
+ const install = () => { };
10
+ /** Registers this package's invariant ownership.
11
+ * @param ctx - Cordis context carrying the invariant service.
12
+ * @returns registration disposer.
13
+ */
14
+ export const apply = (ctx) => Promise.resolve(ctx.invariants.register('@hydraharness/harness-notifications', install));
15
+ /* jscpd:ignore-end */
16
+ //# sourceMappingURL=invariant.js.map
@@ -0,0 +1,31 @@
1
+ /** Client-safe live notification facts and accepted user choices. */
2
+ import type { SessionId } from '@hydraharness/harness-session/types';
3
+ import type { Branded } from '@hydraharness/harness-brand';
4
+ /** Stable identity for one live delivery fact across connected windows. */
5
+ export type NotificationId = Branded<'NotificationId'>;
6
+ /** Stable identity and chat destination; emitted for live events rather than transcript replay. */
7
+ export interface NotificationRequest {
8
+ id: NotificationId;
9
+ sessionId: SessionId;
10
+ kind: 'completion' | 'question';
11
+ title: string;
12
+ body: string;
13
+ }
14
+ /** Notification choices are independent of browser and OS display permission. */
15
+ export interface NotificationSettings {
16
+ completion: 'never' | 'background' | 'always';
17
+ permissionPrompts: boolean;
18
+ questions: boolean;
19
+ sound: 'default' | 'off';
20
+ }
21
+ declare module '@hydraharness/cordis' {
22
+ interface Events {
23
+ /**
24
+ * A live turn ended or a new question awaits an answer; connected providers may deliver it.
25
+ * @mode parallel
26
+ * @param request - stable delivery identity and destination chat.
27
+ */
28
+ 'notifications/requested'(request: NotificationRequest): void;
29
+ }
30
+ }
31
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "@hydraharness/harness-notifications",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1-rc.11",
4
+ "description": "Live turn and question notification facts and user policy",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/MaiHongPhong2010/Hydra-Harness.git",
13
+ "directory": "packages/interaction/notifications"
14
+ },
15
+ "main": "lib/index.js",
16
+ "types": "lib/types/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./lib/types/index.d.ts",
20
+ "default": "./lib/index.js"
21
+ },
22
+ "./types": {
23
+ "types": "./lib/types/types.d.ts",
24
+ "default": "./lib/types/types.js"
25
+ },
26
+ "./invariant": {
27
+ "types": "./lib/types/invariant.d.ts",
28
+ "default": "./lib/invariant.js"
29
+ },
30
+ "./src/*": "./src/*",
31
+ "./package.json": "./package.json"
32
+ },
33
+ "files": [
34
+ "lib/index.js",
35
+ "lib/invariant.js",
36
+ "lib/types/**/*.js",
37
+ "lib/types/**/*.d.ts"
38
+ ],
39
+ "hydra": {
40
+ "plugin": {
41
+ "application": "Choose live turn and question notification policy."
42
+ }
43
+ },
44
+ "peerDependencies": {
45
+ "@hydraharness/cordis": "^4.0.2",
46
+ "@hydraharness/harness-session": "^0.1.1-rc.11",
47
+ "@hydraharness/harness-settings": "^0.1.1-rc.11",
48
+ "@hydraharness/harness-brand": "^0.1.1-rc.11",
49
+ "@hydraharness/harness-invariants": "^0.1.1-rc.11"
50
+ },
51
+ "dependencies": {
52
+ "@hydraharness/schemastery": "^3.18.2"
53
+ },
54
+ "devDependencies": {
55
+ "@hydraharness/cordis": "^4.0.2",
56
+ "@hydraharness/harness-session": "^0.1.1-rc.11",
57
+ "@hydraharness/harness-brand": "^0.1.1-rc.11",
58
+ "@hydraharness/harness-settings": "^0.1.1-rc.11",
59
+ "@hydraharness/harness-invariants": "^0.1.1-rc.11"
60
+ }
6
61
  }