@owlmeans/client-socket 0.1.18-rc.21 → 0.1.18-rc.22

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 CHANGED
@@ -73,7 +73,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
73
73
  your project's skill store (`.agents/skills/`):
74
74
 
75
75
  ```sh
76
- npx @owlmeans/agent-skills@^0.1.18-rc.19
76
+ npx @owlmeans/agent-skills@^0.1.18-rc.20
77
77
  ```
78
78
 
79
79
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/client-socket",
4
- "version": "0.1.18-rc.21",
5
- "generatedAt": "2026-09-12T13:51:53.529Z",
4
+ "version": "0.1.18-rc.22",
5
+ "generatedAt": "2026-09-12T14:18:54.786Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/client-socket
9
9
 
10
10
  **Layer:** Client
11
- **Install:** `"@owlmeans/client-socket": "^0.1.18-rc.21"` in `dependencies`
11
+ **Install:** `"@owlmeans/client-socket": "^0.1.18-rc.22"` in `dependencies`
12
12
 
13
13
  The browser carrier for `@owlmeans/socket`. It supplies the four members the connection model
14
14
  leaves abstract — `send`, `close`, `prepare`, `authenticate` — and hands back a plain `Connection`,
@@ -20,7 +20,7 @@ so everything a screen does with the socket is the vocabulary of that package
20
20
  | Export | Description |
21
21
  |--------|-------------|
22
22
  | `ws(entrypoint, request?)` | Open a `Connection` to a socket entrypoint. Resolves once the socket is open, and only then |
23
- | `useWs(entrypoint \| alias, request?)` | React hook — `Connection \| null` until it opens; re-opens on change and closes on unmount |
23
+ | `useWs(protocol \| alias, request?)` | React hook — `Connection \| null` until it opens; re-opens on change and closes on unmount |
24
24
  | `Config` / `Context` | The client config and context types this package expects |
25
25
 
26
26
  ## How the address is built
@@ -67,10 +67,11 @@ useEffect(() => {
67
67
  }, [connection])
68
68
  ```
69
69
 
70
- Both hooks take an alias or the entrypoint itself, and re-open when the alias, the `AUTH_QUERY`
71
- value or the params change — the params are compared by content, so a fresh object literal each
72
- render does not re-open. Both close the connection when the component unmounts, and both answer
73
- `null` until the socket is open, so every effect that touches one guards on that.
70
+ Pass the immutable socket protocol declaration in application code. A string alias is reserved
71
+ for an adapter whose remote declaration is unavailable to import. Both hooks re-open when the
72
+ protocol, `AUTH_QUERY` value, or params change — the params are compared by content, so a fresh
73
+ object literal each render does not re-open. Both close the connection when the component unmounts,
74
+ and both answer `null` until the socket is open, so every effect that touches one guards on that.
74
75
 
75
76
  ## Disconnects
76
77
 
package/build/helper.d.ts CHANGED
@@ -1,8 +1,16 @@
1
1
  import type { ClientEntrypoint } from '@owlmeans/client-entrypoint';
2
2
  import type { AbstractRequest } from '@owlmeans/entrypoint';
3
3
  import type { Connection } from '@owlmeans/socket';
4
+ import type { EntrypointReference } from '@owlmeans/context';
4
5
  export declare const ws: (module: ClientEntrypoint<string>, request?: AbstractRequest<{
5
6
  token?: string;
6
7
  }>) => Promise<Connection>;
7
- export declare const useWs: (module: string | ClientEntrypoint<any>, request?: Partial<AbstractRequest<any>>) => Connection | null;
8
+ /**
9
+ * Open a socket through a declared entrypoint protocol.
10
+ *
11
+ * String aliases remain an adapter input for dynamically addressed integrations, while
12
+ * application callers pass their immutable protocol declaration and receive its bound client
13
+ * entrypoint here at the transport boundary.
14
+ */
15
+ export declare const useWs: (module: EntrypointReference | string, request?: Partial<AbstractRequest<any>>) => Connection | null;
8
16
  //# sourceMappingURL=helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AASlD,eAAO,MAAM,EAAE,WAAkB,gBAAgB,CAAC,MAAM,CAAC,YAAY,eAAe,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,KAAG,OAAO,CAAC,UAAU,CAuB5H,CAAA;AAED,eAAO,MAAM,KAAK,WAAY,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,KAAG,UAAU,GAAG,IAyBpH,CAAA"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAO5D,eAAO,MAAM,EAAE,WAAkB,gBAAgB,CAAC,MAAM,CAAC,YAAY,eAAe,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,KAAG,OAAO,CAAC,UAAU,CAuB5H,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,WAAY,mBAAmB,GAAG,MAAM,YAAY,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,KAAG,UAAU,GAAG,IAyBlH,CAAA"}
package/build/helper.js CHANGED
@@ -25,9 +25,16 @@ export const ws = async (module, request) => {
25
25
  };
26
26
  });
27
27
  };
28
+ /**
29
+ * Open a socket through a declared entrypoint protocol.
30
+ *
31
+ * String aliases remain an adapter input for dynamically addressed integrations, while
32
+ * application callers pass their immutable protocol declaration and receive its bound client
33
+ * entrypoint here at the transport boundary.
34
+ */
28
35
  export const useWs = (module, request) => {
29
36
  const ctx = useContext();
30
- const mod = useMemo(() => typeof module === 'string' ? ctx.entrypoint(module) : module, [module]);
37
+ const mod = useMemo(() => ctx.entrypoint(module), [module]);
31
38
  const connection = useValue(async () => {
32
39
  const _request = provideRequest(mod.alias, mod.path());
33
40
  Object.assign(_request, request);
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE1C,MAAM,CAAC,MAAM,EAAE,GAAG,KAAK,EAAE,MAAgC,EAAE,OAA6C,EAAuB,EAAE;IAC/H,MAAM,GAAG,GAAG,aAAa,CAAkB,MAAM,CAAC,GAAc,EAAE,WAAW,CAAC,CAAA;IAC9E,OAAO,GAAG,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;IAChE,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAA;IAEzD,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC,CAAA;IAEjC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE;YACnB,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;gBACjC,IAAI,MAAM,CAAC,UAAU,KAAK,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AC5B,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;KAC7D,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YACvB,OAAO,GAAG,EAAE;gBACV,KAAK,UAAU,CAAC,KAAK,EAAE,CAAA;YACzB,CAAC,CAAA;QACH,CAAC;IACH,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAEhB,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/client-socket",
3
- "version": "0.1.18-rc.21",
3
+ "version": "0.1.18-rc.22",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -30,14 +30,14 @@
30
30
  "typescript": "^7.0.2"
31
31
  },
32
32
  "dependencies": {
33
- "@owlmeans/auth": "^0.1.18-rc.16",
34
- "@owlmeans/basic-envelope": "^0.1.18-rc.19",
35
- "@owlmeans/client": "^0.1.18-rc.23",
36
- "@owlmeans/client-context": "^0.1.18-rc.20",
37
- "@owlmeans/client-entrypoint": "^0.1.18-rc.20",
38
- "@owlmeans/context": "^0.1.18-rc.15",
39
- "@owlmeans/entrypoint": "^0.1.18-rc.18",
40
- "@owlmeans/socket": "^0.1.18-rc.16"
33
+ "@owlmeans/auth": "^0.1.18-rc.17",
34
+ "@owlmeans/basic-envelope": "^0.1.18-rc.20",
35
+ "@owlmeans/client": "^0.1.18-rc.24",
36
+ "@owlmeans/client-context": "^0.1.18-rc.21",
37
+ "@owlmeans/client-entrypoint": "^0.1.18-rc.21",
38
+ "@owlmeans/context": "^0.1.18-rc.16",
39
+ "@owlmeans/entrypoint": "^0.1.18-rc.19",
40
+ "@owlmeans/socket": "^0.1.18-rc.17"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
package/src/helper.ts CHANGED
@@ -4,6 +4,7 @@ import { provideRequest } from '@owlmeans/client-entrypoint'
4
4
  import type { Connection } from '@owlmeans/socket'
5
5
  import { makeConnection } from './utils/connection.js'
6
6
  import { assertContext } from '@owlmeans/context'
7
+ import type { EntrypointReference } from '@owlmeans/context'
7
8
  import type { Config, Context } from './types.js'
8
9
  import { useContext, useValue } from '@owlmeans/client'
9
10
  import { AUTH_QUERY } from '@owlmeans/auth'
@@ -35,10 +36,17 @@ export const ws = async (module: ClientEntrypoint<string>, request?: AbstractReq
35
36
  })
36
37
  }
37
38
 
38
- export const useWs = (module: string | ClientEntrypoint<any>, request?: Partial<AbstractRequest<any>>): Connection | null => {
39
+ /**
40
+ * Open a socket through a declared entrypoint protocol.
41
+ *
42
+ * String aliases remain an adapter input for dynamically addressed integrations, while
43
+ * application callers pass their immutable protocol declaration and receive its bound client
44
+ * entrypoint here at the transport boundary.
45
+ */
46
+ export const useWs = (module: EntrypointReference | string, request?: Partial<AbstractRequest<any>>): Connection | null => {
39
47
  const ctx = useContext()
40
48
  const mod = useMemo(
41
- () => typeof module === 'string' ? ctx.entrypoint<ClientEntrypoint>(module) : module,
49
+ () => ctx.entrypoint<ClientEntrypoint>(module),
42
50
  [module]
43
51
  )
44
52
  const connection = useValue<Connection>(async () => {