@sudobility/sider_types 0.0.3 → 0.0.5
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/api.d.ts +68 -2
- package/package.json +1 -1
- package/src/api.ts +78 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IsoTimestamp, JSONSchema } from "./common";
|
|
2
|
+
import type { EndpointGraphEdge, InvocationRecipe, SafetyClass, SecretSlot, Site, ToolSpec, ToolStatus, UXRecipe } from "./registry";
|
|
3
|
+
import type { CaptureBatch, Contributor, Observation, StepKind } from "./runtime";
|
|
3
4
|
/** A planner decision (mirror of the ShapeShyft plan-next-step output). */
|
|
4
5
|
export interface PlannerStep {
|
|
5
6
|
kind: StepKind;
|
|
@@ -52,3 +53,68 @@ export interface StatsResponse {
|
|
|
52
53
|
trustedToolCount: number;
|
|
53
54
|
contributorCount: number;
|
|
54
55
|
}
|
|
56
|
+
/** GET /api/v1/me — the signed-in contributor + aggregate counts. */
|
|
57
|
+
export interface MeResponse {
|
|
58
|
+
contributor: Contributor;
|
|
59
|
+
batchCount: number;
|
|
60
|
+
observationCount: number;
|
|
61
|
+
/** Tools this user has corroborated (cast a recipe vote on). */
|
|
62
|
+
toolsContributed: number;
|
|
63
|
+
/** Of those, how many are currently `trusted`. */
|
|
64
|
+
trustedToolsContributed: number;
|
|
65
|
+
}
|
|
66
|
+
/** One row of GET /api/v1/me/capture-batches. */
|
|
67
|
+
export interface MyCaptureBatchSummary extends CaptureBatch {
|
|
68
|
+
siteOrigin: string;
|
|
69
|
+
siteName: string;
|
|
70
|
+
}
|
|
71
|
+
/** GET /api/v1/me/capture-batches/:id — a batch plus its observations. */
|
|
72
|
+
export interface MyCaptureBatchDetail {
|
|
73
|
+
batch: MyCaptureBatchSummary;
|
|
74
|
+
observations: Observation[];
|
|
75
|
+
}
|
|
76
|
+
/** One row of GET /api/v1/me/tools — a tool this user corroborated. */
|
|
77
|
+
export interface MyToolEntry {
|
|
78
|
+
toolId: string;
|
|
79
|
+
siteId: string;
|
|
80
|
+
name: string;
|
|
81
|
+
status: ToolStatus;
|
|
82
|
+
safetyClass: SafetyClass;
|
|
83
|
+
version: number;
|
|
84
|
+
corroboratingUserCount: number;
|
|
85
|
+
/** Hash of MY independently-derived recipe. */
|
|
86
|
+
myRecipeHash: string;
|
|
87
|
+
/** Hash of the recipe currently stored on the tool. */
|
|
88
|
+
currentRecipeHash: string;
|
|
89
|
+
/** Whether my vote agrees with the stored recipe. */
|
|
90
|
+
agreesWithCurrent: boolean;
|
|
91
|
+
votedAt: IsoTimestamp;
|
|
92
|
+
}
|
|
93
|
+
/** GET /api/v1/tools/:id — full tool detail for the registry inspector. */
|
|
94
|
+
export interface ToolDetailResponse {
|
|
95
|
+
/** The tools table row (recipe, schema, safety, status, counts). */
|
|
96
|
+
tool: {
|
|
97
|
+
id: string;
|
|
98
|
+
siteId: string;
|
|
99
|
+
name: string;
|
|
100
|
+
description: string;
|
|
101
|
+
capabilityLabel: string;
|
|
102
|
+
inputSchema: JSONSchema;
|
|
103
|
+
safetyClass: SafetyClass;
|
|
104
|
+
directCallAvailable: boolean;
|
|
105
|
+
recipe: InvocationRecipe;
|
|
106
|
+
status: ToolStatus;
|
|
107
|
+
version: number;
|
|
108
|
+
observationCount: number;
|
|
109
|
+
corroboratingUserCount: number;
|
|
110
|
+
confidence: number;
|
|
111
|
+
createdAt: IsoTimestamp;
|
|
112
|
+
updatedAt: IsoTimestamp;
|
|
113
|
+
};
|
|
114
|
+
/** Anonymized corroboration breakdown: recipe hash → distinct-user count. */
|
|
115
|
+
corroboration: {
|
|
116
|
+
distinctUsers: number;
|
|
117
|
+
hashCounts: Record<string, number>;
|
|
118
|
+
trustThreshold: number;
|
|
119
|
+
};
|
|
120
|
+
}
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
// (to type its handlers) and sider_client (to type its calls). Keeping these
|
|
3
3
|
// here is the single source of truth that stops the two sides from drifting.
|
|
4
4
|
|
|
5
|
+
import type { IsoTimestamp, JSONSchema } from "./common";
|
|
5
6
|
import type {
|
|
6
7
|
EndpointGraphEdge,
|
|
8
|
+
InvocationRecipe,
|
|
7
9
|
SafetyClass,
|
|
8
10
|
SecretSlot,
|
|
9
11
|
Site,
|
|
10
12
|
ToolSpec,
|
|
13
|
+
ToolStatus,
|
|
11
14
|
UXRecipe,
|
|
12
15
|
} from "./registry";
|
|
13
|
-
import type { Observation, StepKind } from "./runtime";
|
|
16
|
+
import type { CaptureBatch, Contributor, Observation, StepKind } from "./runtime";
|
|
14
17
|
|
|
15
18
|
/** A planner decision (mirror of the ShapeShyft plan-next-step output). */
|
|
16
19
|
export interface PlannerStep {
|
|
@@ -66,3 +69,77 @@ export interface StatsResponse {
|
|
|
66
69
|
trustedToolCount: number;
|
|
67
70
|
contributorCount: number;
|
|
68
71
|
}
|
|
72
|
+
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// Dashboard DTOs (per-user + registry inspection). Spec 2026-07-20 §3.
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
|
|
77
|
+
/** GET /api/v1/me — the signed-in contributor + aggregate counts. */
|
|
78
|
+
export interface MeResponse {
|
|
79
|
+
contributor: Contributor;
|
|
80
|
+
batchCount: number;
|
|
81
|
+
observationCount: number;
|
|
82
|
+
/** Tools this user has corroborated (cast a recipe vote on). */
|
|
83
|
+
toolsContributed: number;
|
|
84
|
+
/** Of those, how many are currently `trusted`. */
|
|
85
|
+
trustedToolsContributed: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** One row of GET /api/v1/me/capture-batches. */
|
|
89
|
+
export interface MyCaptureBatchSummary extends CaptureBatch {
|
|
90
|
+
siteOrigin: string;
|
|
91
|
+
siteName: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** GET /api/v1/me/capture-batches/:id — a batch plus its observations. */
|
|
95
|
+
export interface MyCaptureBatchDetail {
|
|
96
|
+
batch: MyCaptureBatchSummary;
|
|
97
|
+
observations: Observation[];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** One row of GET /api/v1/me/tools — a tool this user corroborated. */
|
|
101
|
+
export interface MyToolEntry {
|
|
102
|
+
toolId: string;
|
|
103
|
+
siteId: string;
|
|
104
|
+
name: string;
|
|
105
|
+
status: ToolStatus;
|
|
106
|
+
safetyClass: SafetyClass;
|
|
107
|
+
version: number;
|
|
108
|
+
corroboratingUserCount: number;
|
|
109
|
+
/** Hash of MY independently-derived recipe. */
|
|
110
|
+
myRecipeHash: string;
|
|
111
|
+
/** Hash of the recipe currently stored on the tool. */
|
|
112
|
+
currentRecipeHash: string;
|
|
113
|
+
/** Whether my vote agrees with the stored recipe. */
|
|
114
|
+
agreesWithCurrent: boolean;
|
|
115
|
+
votedAt: IsoTimestamp;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** GET /api/v1/tools/:id — full tool detail for the registry inspector. */
|
|
119
|
+
export interface ToolDetailResponse {
|
|
120
|
+
/** The tools table row (recipe, schema, safety, status, counts). */
|
|
121
|
+
tool: {
|
|
122
|
+
id: string;
|
|
123
|
+
siteId: string;
|
|
124
|
+
name: string;
|
|
125
|
+
description: string;
|
|
126
|
+
capabilityLabel: string;
|
|
127
|
+
inputSchema: JSONSchema;
|
|
128
|
+
safetyClass: SafetyClass;
|
|
129
|
+
directCallAvailable: boolean;
|
|
130
|
+
recipe: InvocationRecipe;
|
|
131
|
+
status: ToolStatus;
|
|
132
|
+
version: number;
|
|
133
|
+
observationCount: number;
|
|
134
|
+
corroboratingUserCount: number;
|
|
135
|
+
confidence: number;
|
|
136
|
+
createdAt: IsoTimestamp;
|
|
137
|
+
updatedAt: IsoTimestamp;
|
|
138
|
+
};
|
|
139
|
+
/** Anonymized corroboration breakdown: recipe hash → distinct-user count. */
|
|
140
|
+
corroboration: {
|
|
141
|
+
distinctUsers: number;
|
|
142
|
+
hashCounts: Record<string, number>;
|
|
143
|
+
trustThreshold: number;
|
|
144
|
+
};
|
|
145
|
+
}
|