@owlmeans/basic-envelope 0.1.18-rc.44 → 0.1.18-rc.45
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 +2 -2
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/basic-envelope/SKILL.md +1 -1
- package/build/model.js +4 -4
- package/build/model.js.map +1 -1
- package/build/utils/model.d.ts +17 -4
- package/build/utils/model.d.ts.map +1 -1
- package/build/utils/model.js +6 -4
- package/build/utils/model.js.map +1 -1
- package/build/utils/types.d.ts +3 -0
- package/build/utils/types.d.ts.map +1 -0
- package/build/utils/types.js +2 -0
- package/build/utils/types.js.map +1 -0
- package/package.json +7 -7
- package/src/model.ts +4 -4
- package/src/utils/model.ts +8 -4
- package/src/utils/types.ts +3 -0
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Type-safe message envelope with TTL, signing, and Base64 encoding for cross-serv
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
bun add @owlmeans/basic-envelope@^0.1.18-rc.
|
|
14
|
+
bun add @owlmeans/basic-envelope@^0.1.18-rc.45
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
@@ -80,7 +80,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
80
80
|
your project's skill store (`.agents/skills/`):
|
|
81
81
|
|
|
82
82
|
```sh
|
|
83
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
83
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.48
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/basic-envelope",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.45",
|
|
5
|
+
"generatedAt": "2026-10-05T08:32:19.138Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/basic-envelope
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/basic-envelope": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/basic-envelope": "^0.1.18-rc.45"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
An envelope is a signed, self-expiring container: a type tag, an encoded message, a timestamp and a
|
|
14
14
|
TTL, plus the signature over all of it. It is what carries auth challenges and tokens between
|
package/build/model.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { base64, utf8 } from '@scure/base';
|
|
2
2
|
import { DEFAULT_TTL, EnvelopeKind } from './consts.js';
|
|
3
|
-
import {
|
|
3
|
+
import { utilsModelHelper } from './utils/model.js';
|
|
4
4
|
export const makeEnvelopeModel = (type, kind) => {
|
|
5
5
|
const model = {
|
|
6
6
|
envelope: kind == null ? {
|
|
@@ -9,7 +9,7 @@ export const makeEnvelopeModel = (type, kind) => {
|
|
|
9
9
|
dt: new Date().getTime(),
|
|
10
10
|
ttl: DEFAULT_TTL
|
|
11
11
|
} : kind === EnvelopeKind.Wrap
|
|
12
|
-
? unwrap(type) : untokenize(type),
|
|
12
|
+
? utilsModelHelper.unwrap(type) : utilsModelHelper.untokenize(type),
|
|
13
13
|
send: (msg, ttl) => {
|
|
14
14
|
model.envelope.msg = typeof msg == 'string' ? msg : base64.encode(utf8.decode(JSON.stringify(msg)));
|
|
15
15
|
if (typeof ttl !== 'undefined') {
|
|
@@ -29,8 +29,8 @@ export const makeEnvelopeModel = (type, kind) => {
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
type: () => model.envelope.t,
|
|
32
|
-
wrap: () => wrap(model.envelope),
|
|
33
|
-
tokenize: () => tokenize(model.envelope),
|
|
32
|
+
wrap: () => utilsModelHelper.wrap(model.envelope),
|
|
33
|
+
tokenize: () => utilsModelHelper.tokenize(model.envelope),
|
|
34
34
|
sign: async (key, kind) => {
|
|
35
35
|
model.envelope.sig = await key.sign(model.envelope);
|
|
36
36
|
switch (kind) {
|
package/build/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAAY,EAAE,IAAmB,EACf,EAAE;IACpB,MAAM,KAAK,GAAkB;QAC3B,QAAQ,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC;YACvB,CAAC,EAAE,IAAI;YACP,GAAG,EAAE,EAAE;YACP,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;YACxB,GAAG,EAAE,WAAW;SACjB,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI;YAC5B,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC;QAErE,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACjB,KAA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,YAAY,CAAC,IAAI;oBACpB,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;gBACrB,KAAK,YAAY,CAAC,KAAK;oBACrB,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;gBACzB;oBACE,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAA;YAC7B,CAAC;QACH,CAAC;QAED,MAAM,EAAE,KAAK,EAAC,GAAG,EAAC,EAAE;YAClB,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAA;YACpC,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;gBACtB,OAAO,KAAK,CAAA;YACd,CAAC;YACD,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,IAAI;mBACzB,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;gBACnE,OAAO,KAAK,CAAA;YACd,CAAC;YAED,MAAM,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;YAClC,OAAO,IAAI,CAAC,GAAG,CAAA;YAEf,OAAO,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;KACF,CAAA;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
package/build/utils/model.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { Envelope } from '../types.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
declare const wrap: (object: Envelope) => string;
|
|
3
|
+
declare const tokenize: (object: Envelope) => string;
|
|
4
|
+
declare const untokenize: (token: string) => Envelope;
|
|
5
|
+
declare const unwrap: (envelope: string) => Envelope;
|
|
6
|
+
export declare const createUtilsModelHelper: () => {
|
|
7
|
+
wrap: typeof wrap;
|
|
8
|
+
tokenize: typeof tokenize;
|
|
9
|
+
untokenize: typeof untokenize;
|
|
10
|
+
unwrap: typeof unwrap;
|
|
11
|
+
};
|
|
12
|
+
export declare const utilsModelHelper: {
|
|
13
|
+
wrap: typeof wrap;
|
|
14
|
+
tokenize: typeof tokenize;
|
|
15
|
+
untokenize: typeof untokenize;
|
|
16
|
+
unwrap: typeof unwrap;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
6
19
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/utils/model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/utils/model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,QAAA,MAAM,IAAI,WAAY,QAAQ,KAAG,MACmB,CAAA;AAEpD,QAAA,MAAM,QAAQ,WAAY,QAAQ,KAAG,MACuB,CAAA;AAE5D,QAAA,MAAM,UAAU,UAAW,MAAM,KAAG,QACmB,CAAA;AAEvD,QAAA,MAAM,MAAM,aAAc,MAAM,KAAG,QACe,CAAA;AAElD,eAAO,MAAM,sBAAsB;;;;;CAAiD,CAAA;AAEpF,eAAO,MAAM,gBAAgB;;;;;CAA2B,CAAA"}
|
package/build/utils/model.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { base64, base64urlnopad, utf8 } from '@scure/base';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const wrap = (object) => base64.encode(utf8.decode(JSON.stringify(object)));
|
|
3
|
+
const tokenize = (object) => base64urlnopad.encode(utf8.decode(JSON.stringify(object)));
|
|
4
|
+
const untokenize = (token) => JSON.parse(utf8.encode(base64urlnopad.decode(token)));
|
|
5
|
+
const unwrap = (envelope) => JSON.parse(utf8.encode(base64.decode(envelope)));
|
|
6
|
+
export const createUtilsModelHelper = () => ({ wrap, tokenize, untokenize, unwrap });
|
|
7
|
+
export const utilsModelHelper = createUtilsModelHelper();
|
|
6
8
|
//# sourceMappingURL=model.js.map
|
package/build/utils/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/utils/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAG1D,MAAM,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/utils/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAG1D,MAAM,IAAI,GAAG,CAAC,MAAgB,EAAU,EAAE,CACxC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAEpD,MAAM,QAAQ,GAAG,CAAC,MAAgB,EAAU,EAAE,CAC5C,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAE5D,MAAM,UAAU,GAAG,CAAC,KAAa,EAAY,EAAE,CAC7C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAEvD,MAAM,MAAM,GAAG,CAAC,QAAgB,EAAY,EAAE,CAC5C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AAElD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAA;AAEpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAExD,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/basic-envelope",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.45",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@owlmeans/dep-config": "workspace:*",
|
|
26
|
-
"@owlmeans/test-auth": "^0.1.18-rc.
|
|
27
|
-
"@types/bun": "^1.4.
|
|
26
|
+
"@owlmeans/test-auth": "^0.1.18-rc.45",
|
|
27
|
+
"@types/bun": "^1.4.2",
|
|
28
28
|
"nodemon": "^3.1.14",
|
|
29
29
|
"typescript": "^7.0.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@noble/curves": "^
|
|
33
|
-
"@noble/hashes": "^
|
|
34
|
-
"@owlmeans/basic-keys": "^0.1.18-rc.
|
|
35
|
-
"@scure/base": "^2.
|
|
32
|
+
"@noble/curves": "^2.4.0",
|
|
33
|
+
"@noble/hashes": "^2.4.0",
|
|
34
|
+
"@owlmeans/basic-keys": "^0.1.18-rc.47",
|
|
35
|
+
"@scure/base": "^2.4.0"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
package/src/model.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { base64, utf8 } from '@scure/base'
|
|
2
2
|
import { DEFAULT_TTL, EnvelopeKind } from './consts.js'
|
|
3
3
|
import type { EnvelopeModel } from './types.js'
|
|
4
|
-
import {
|
|
4
|
+
import { utilsModelHelper } from './utils/model.js'
|
|
5
5
|
|
|
6
6
|
export const makeEnvelopeModel = <T extends {} | string = string>(
|
|
7
7
|
type: string, kind?: EnvelopeKind
|
|
@@ -13,7 +13,7 @@ export const makeEnvelopeModel = <T extends {} | string = string>(
|
|
|
13
13
|
dt: new Date().getTime(),
|
|
14
14
|
ttl: DEFAULT_TTL
|
|
15
15
|
} : kind === EnvelopeKind.Wrap
|
|
16
|
-
? unwrap(type) : untokenize(type),
|
|
16
|
+
? utilsModelHelper.unwrap(type) : utilsModelHelper.untokenize(type),
|
|
17
17
|
|
|
18
18
|
send: (msg, ttl) => {
|
|
19
19
|
model.envelope.msg = typeof msg == 'string' ? msg : base64.encode(utf8.decode(JSON.stringify(msg)))
|
|
@@ -37,9 +37,9 @@ export const makeEnvelopeModel = <T extends {} | string = string>(
|
|
|
37
37
|
|
|
38
38
|
type: () => model.envelope.t,
|
|
39
39
|
|
|
40
|
-
wrap: () => wrap(model.envelope),
|
|
40
|
+
wrap: () => utilsModelHelper.wrap(model.envelope),
|
|
41
41
|
|
|
42
|
-
tokenize: () => tokenize(model.envelope),
|
|
42
|
+
tokenize: () => utilsModelHelper.tokenize(model.envelope),
|
|
43
43
|
|
|
44
44
|
sign: async (key, kind) => {
|
|
45
45
|
model.envelope.sig = await key.sign(model.envelope)
|
package/src/utils/model.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { base64, base64urlnopad, utf8 } from '@scure/base'
|
|
2
2
|
import type { Envelope } from '../types.js'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const wrap = (object: Envelope): string =>
|
|
5
5
|
base64.encode(utf8.decode(JSON.stringify(object)))
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tokenize = (object: Envelope): string =>
|
|
8
8
|
base64urlnopad.encode(utf8.decode(JSON.stringify(object)))
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const untokenize = (token: string): Envelope =>
|
|
11
11
|
JSON.parse(utf8.encode(base64urlnopad.decode(token)))
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const unwrap = (envelope: string): Envelope =>
|
|
14
14
|
JSON.parse(utf8.encode(base64.decode(envelope)))
|
|
15
|
+
|
|
16
|
+
export const createUtilsModelHelper = () => ({ wrap, tokenize, untokenize, unwrap })
|
|
17
|
+
|
|
18
|
+
export const utilsModelHelper = createUtilsModelHelper()
|