@pinet/pinet-core 0.2.2 → 0.2.6
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 +17 -11
- package/dist/output-options.d.ts +11 -1
- package/dist/pinet-read-formatting.d.ts +33 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
# @pinet/pinet-core
|
|
2
2
|
|
|
3
|
-
Runtime
|
|
3
|
+
Runtime helpers for Pinet that work independently of Slack.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## What it does
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- durable Pinet read result text/detail formatting
|
|
9
|
-
- scheduled wake-up time parsing and thread ID helpers
|
|
7
|
+
This package provides:
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
- output option normalisation (defaults to `cli`, accepts `json` or `full`)
|
|
10
|
+
- durable read result formatting
|
|
11
|
+
- scheduled wake-up time parsing
|
|
12
|
+
- thread ID helpers
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
## How it works
|
|
15
|
+
|
|
16
|
+
The package exports helpers that `@pinet/slack-bridge` uses internally. These functions handle Pinet operations without depending on Slack adapters.
|
|
17
|
+
|
|
18
|
+
The helpers live behind package exports. Future changes can move functionality one boundary at a time.
|
|
19
|
+
|
|
20
|
+
See the design proposal in `plans/slack-split-proposal.md`.
|
|
14
21
|
|
|
15
22
|
## Publishing
|
|
16
23
|
|
|
17
|
-
This package is
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
bump versions without explicit maintainer release approval.
|
|
24
|
+
This package is part of the npm publish set in [`../plans/npm-publish.md`](../plans/npm-publish.md).
|
|
25
|
+
|
|
26
|
+
Do not publish, tag, or bump versions without maintainer approval. Use the GitHub Actions workflow for validation.
|
package/dist/output-options.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
export type PinetOutputFormat = "cli" | "json";
|
|
2
|
+
type PinetOutputFormatInput = string | number | boolean | null | undefined;
|
|
3
|
+
type PinetOutputFullInput = boolean | string | number | null | undefined;
|
|
4
|
+
export interface PinetOutputOptionsArgs {
|
|
5
|
+
format?: PinetOutputFormatInput;
|
|
6
|
+
f?: PinetOutputFormatInput;
|
|
7
|
+
"-f"?: PinetOutputFormatInput;
|
|
8
|
+
full?: PinetOutputFullInput;
|
|
9
|
+
"--full"?: PinetOutputFullInput;
|
|
10
|
+
}
|
|
2
11
|
export interface PinetOutputOptions {
|
|
3
12
|
format: PinetOutputFormat;
|
|
4
13
|
full: boolean;
|
|
5
14
|
}
|
|
6
|
-
export declare function normalizePinetOutputOptions(args:
|
|
15
|
+
export declare function normalizePinetOutputOptions(args: PinetOutputOptionsArgs): PinetOutputOptions;
|
|
16
|
+
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type PinetMailClass } from "@pinet/broker-core/mail-classification";
|
|
2
|
+
export type PinetReadMetadataValue = unknown;
|
|
3
|
+
export interface PinetReadMessageMetadata {
|
|
4
|
+
[key: string]: PinetReadMetadataValue;
|
|
5
|
+
}
|
|
2
6
|
export interface PinetInboxItem {
|
|
3
7
|
inboxId: number;
|
|
4
8
|
delivered: boolean;
|
|
@@ -10,7 +14,7 @@ export interface PinetInboxItem {
|
|
|
10
14
|
direction: string;
|
|
11
15
|
sender: string;
|
|
12
16
|
body: string;
|
|
13
|
-
metadata:
|
|
17
|
+
metadata: PinetReadMessageMetadata | null;
|
|
14
18
|
createdAt: string;
|
|
15
19
|
};
|
|
16
20
|
}
|
|
@@ -43,7 +47,34 @@ export interface PinetReadOptions {
|
|
|
43
47
|
unreadOnly?: boolean;
|
|
44
48
|
markRead?: boolean;
|
|
45
49
|
}
|
|
50
|
+
export interface CompactPinetReadMessageDetails {
|
|
51
|
+
id: number;
|
|
52
|
+
threadId: string;
|
|
53
|
+
source: string;
|
|
54
|
+
sender: string;
|
|
55
|
+
class: PinetMailClass;
|
|
56
|
+
}
|
|
57
|
+
export interface CompactPinetReadUnreadThreadDetails {
|
|
58
|
+
threadId: string;
|
|
59
|
+
source: string;
|
|
60
|
+
unread: number;
|
|
61
|
+
latestMessageId: number;
|
|
62
|
+
class: PinetMailClass;
|
|
63
|
+
summary: string;
|
|
64
|
+
}
|
|
65
|
+
export interface CompactPinetReadDetails {
|
|
66
|
+
summary: string;
|
|
67
|
+
messageCount: number;
|
|
68
|
+
unreadBefore: number;
|
|
69
|
+
unreadAfter: number;
|
|
70
|
+
markedReadCount?: number;
|
|
71
|
+
messages?: CompactPinetReadMessageDetails[];
|
|
72
|
+
exactBodies?: string;
|
|
73
|
+
messagesTruncated?: number;
|
|
74
|
+
unreadThreads?: CompactPinetReadUnreadThreadDetails[];
|
|
75
|
+
unreadThreadsTruncated?: number;
|
|
76
|
+
}
|
|
46
77
|
export declare function formatPinetReadResultFull(result: PinetReadResult, options: PinetReadOptions): string;
|
|
47
78
|
export declare function summarizeUnreadThreadCounts(thread: PinetUnreadThreadSummary): string;
|
|
48
|
-
export declare function buildCompactPinetReadDetails(result: PinetReadResult):
|
|
79
|
+
export declare function buildCompactPinetReadDetails(result: PinetReadResult): CompactPinetReadDetails;
|
|
49
80
|
export declare function formatPinetReadResultCompact(result: PinetReadResult, options: PinetReadOptions): string;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinet/pinet-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pinet runtime core for pi — broker/follower orchestration and mesh tooling",
|
|
6
6
|
"author": "Will Porcellini <5994936+gugu91@users.noreply.github.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/gugu91/
|
|
10
|
+
"url": "git+https://github.com/gugu91/pinet.git",
|
|
11
11
|
"directory": "pinet-core"
|
|
12
12
|
},
|
|
13
13
|
"publishConfig": {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "node ../scripts/build-package.mjs",
|
|
32
32
|
"prepack": "pnpm run build",
|
|
33
|
-
"lint": "
|
|
33
|
+
"lint": "oxlint .",
|
|
34
34
|
"typecheck": "tsc --noEmit",
|
|
35
|
-
"test": "vitest run *.test.ts"
|
|
35
|
+
"test": "vitest run --config ../vitest.config.ts *.test.ts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@pinet/broker-core": "0.2.
|
|
39
|
-
"@pinet/transport-core": "0.2.
|
|
38
|
+
"@pinet/broker-core": "0.2.6",
|
|
39
|
+
"@pinet/transport-core": "0.2.6"
|
|
40
40
|
},
|
|
41
41
|
"types": "./dist/index.d.ts"
|
|
42
42
|
}
|