@ziggs-ai/contracts 0.20.0 → 0.21.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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/points.d.ts +14 -0
- package/dist/points.js +26 -0
- package/dist/vocabulary.d.ts +18 -0
- package/dist/vocabulary.js +18 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
* so any runtime can import it.
|
|
24
24
|
*/
|
|
25
25
|
__exportStar(require("./vocabulary"), exports);
|
|
26
|
+
__exportStar(require("./points"), exports);
|
|
26
27
|
__exportStar(require("./chat"), exports);
|
|
27
28
|
__exportStar(require("./inbox"), exports);
|
|
28
29
|
__exportStar(require("./error"), exports);
|
package/dist/points.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Points, as people and agents read them.
|
|
3
|
+
*
|
|
4
|
+
* Amounts travel as integers of hundredths (500 is ϟ5.00). This is the one way
|
|
5
|
+
* to show one. The web had it (ZIG-1259); the phone, the backend's own notices
|
|
6
|
+
* and the agent tools each wrote their own and printed `$5.00` or `500 pez`.
|
|
7
|
+
* `pez` is the wallet's internal unit code and is never shown.
|
|
8
|
+
*/
|
|
9
|
+
/** The unit. Use it rather than typing the glyph. */
|
|
10
|
+
export declare const POINTS_GLYPH = "\u03DF";
|
|
11
|
+
/** An amount. Always renders: zero is `ϟ0.00`. The sign sits outside the glyph: `-ϟ5.00`. */
|
|
12
|
+
export declare function formatPoints(hundredths: number): string;
|
|
13
|
+
/** A price, where no price and zero are the same fact: the work costs nothing. */
|
|
14
|
+
export declare function formatPointsPrice(hundredths: number | null | undefined): string;
|
package/dist/points.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Points, as people and agents read them.
|
|
4
|
+
*
|
|
5
|
+
* Amounts travel as integers of hundredths (500 is ϟ5.00). This is the one way
|
|
6
|
+
* to show one. The web had it (ZIG-1259); the phone, the backend's own notices
|
|
7
|
+
* and the agent tools each wrote their own and printed `$5.00` or `500 pez`.
|
|
8
|
+
* `pez` is the wallet's internal unit code and is never shown.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.POINTS_GLYPH = void 0;
|
|
12
|
+
exports.formatPoints = formatPoints;
|
|
13
|
+
exports.formatPointsPrice = formatPointsPrice;
|
|
14
|
+
/** The unit. Use it rather than typing the glyph. */
|
|
15
|
+
exports.POINTS_GLYPH = 'ϟ';
|
|
16
|
+
/** An amount. Always renders: zero is `ϟ0.00`. The sign sits outside the glyph: `-ϟ5.00`. */
|
|
17
|
+
function formatPoints(hundredths) {
|
|
18
|
+
const sign = hundredths < 0 ? '-' : '';
|
|
19
|
+
return `${sign}${exports.POINTS_GLYPH}${(Math.abs(hundredths) / 100).toFixed(2)}`;
|
|
20
|
+
}
|
|
21
|
+
/** A price, where no price and zero are the same fact: the work costs nothing. */
|
|
22
|
+
function formatPointsPrice(hundredths) {
|
|
23
|
+
if (hundredths == null || hundredths === 0)
|
|
24
|
+
return 'Free';
|
|
25
|
+
return formatPoints(hundredths);
|
|
26
|
+
}
|
package/dist/vocabulary.d.ts
CHANGED
|
@@ -45,3 +45,21 @@ export type InboxPartyKind = 'human' | 'org';
|
|
|
45
45
|
export type PartyRole = 'payer' | 'provider' | 'creator' | 'proposedTo' | 'providerPrincipal';
|
|
46
46
|
/** What kind of principal sent a message. */
|
|
47
47
|
export type MessageSenderType = 'user' | 'agent' | 'service' | 'system';
|
|
48
|
+
/**
|
|
49
|
+
* The file formats a file artifact can carry (not its semantic content type).
|
|
50
|
+
* The server stores and validates against this list; clients offer it as a
|
|
51
|
+
* tool parameter. `mp3` is stored and downloaded, never text-extracted.
|
|
52
|
+
*/
|
|
53
|
+
export declare const ARTIFACT_FILE_FORMAT: {
|
|
54
|
+
readonly PDF: "pdf";
|
|
55
|
+
readonly DOCX: "docx";
|
|
56
|
+
readonly HWPX: "hwpx";
|
|
57
|
+
readonly PPTX: "pptx";
|
|
58
|
+
readonly MD: "md";
|
|
59
|
+
readonly TXT: "txt";
|
|
60
|
+
readonly HTML: "html";
|
|
61
|
+
readonly MP3: "mp3";
|
|
62
|
+
};
|
|
63
|
+
export type ArtifactFileFormat = (typeof ARTIFACT_FILE_FORMAT)[keyof typeof ARTIFACT_FILE_FORMAT];
|
|
64
|
+
/** Every accepted format, in one list. */
|
|
65
|
+
export declare const ARTIFACT_FILE_FORMATS: readonly ArtifactFileFormat[];
|
package/dist/vocabulary.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* enum, a switch a consumer needs to make exhaustive.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.RESOURCE_KINDS = exports.CHAT_ADDRESS_KINDS = exports.GRANT_ACCESS_KINDS = void 0;
|
|
10
|
+
exports.ARTIFACT_FILE_FORMATS = exports.ARTIFACT_FILE_FORMAT = exports.RESOURCE_KINDS = exports.CHAT_ADDRESS_KINDS = exports.GRANT_ACCESS_KINDS = void 0;
|
|
11
11
|
/**
|
|
12
12
|
* What a grant lets its holder do with the scope.
|
|
13
13
|
*
|
|
@@ -39,3 +39,20 @@ exports.RESOURCE_KINDS = [
|
|
|
39
39
|
/** Marketplace request doorbell: a typed inbox channel, not a chat. */
|
|
40
40
|
'request',
|
|
41
41
|
];
|
|
42
|
+
/**
|
|
43
|
+
* The file formats a file artifact can carry (not its semantic content type).
|
|
44
|
+
* The server stores and validates against this list; clients offer it as a
|
|
45
|
+
* tool parameter. `mp3` is stored and downloaded, never text-extracted.
|
|
46
|
+
*/
|
|
47
|
+
exports.ARTIFACT_FILE_FORMAT = {
|
|
48
|
+
PDF: 'pdf',
|
|
49
|
+
DOCX: 'docx',
|
|
50
|
+
HWPX: 'hwpx',
|
|
51
|
+
PPTX: 'pptx',
|
|
52
|
+
MD: 'md',
|
|
53
|
+
TXT: 'txt',
|
|
54
|
+
HTML: 'html',
|
|
55
|
+
MP3: 'mp3',
|
|
56
|
+
};
|
|
57
|
+
/** Every accepted format, in one list. */
|
|
58
|
+
exports.ARTIFACT_FILE_FORMATS = Object.values(exports.ARTIFACT_FILE_FORMAT);
|
package/package.json
CHANGED