@try-works/dsh-righthand 0.1.7 → 0.1.9
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 +10 -4
- package/lib/events-tools.d.ts +44 -0
- package/lib/events-tools.d.ts.map +1 -0
- package/lib/events-tools.js +219 -0
- package/lib/events-tools.js.map +1 -0
- package/lib/index.d.ts +15 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +16 -3
- package/lib/index.js.map +1 -1
- package/lib/notify-tools.d.ts +18 -0
- package/lib/notify-tools.d.ts.map +1 -0
- package/lib/notify-tools.js +52 -0
- package/lib/notify-tools.js.map +1 -0
- package/lib/places-tools.d.ts +48 -0
- package/lib/places-tools.d.ts.map +1 -0
- package/lib/places-tools.js +191 -0
- package/lib/places-tools.js.map +1 -0
- package/lib/secrets-tools.d.ts +2 -0
- package/lib/secrets-tools.d.ts.map +1 -1
- package/lib/secrets-tools.js +2 -1
- package/lib/secrets-tools.js.map +1 -1
- package/lib/weather-tools.d.ts +6 -0
- package/lib/weather-tools.d.ts.map +1 -1
- package/lib/weather-tools.js +1 -5
- package/lib/weather-tools.js.map +1 -1
- package/package.json +1 -1
- package/skills/dsh-righthand/SKILL.md +26 -3
- package/src/events-tools.ts +241 -0
- package/src/index.ts +18 -3
- package/src/notify-tools.ts +62 -0
- package/src/places-tools.ts +227 -0
- package/src/secrets-tools.ts +2 -1
- package/src/weather-tools.ts +8 -2
package/README.md
CHANGED
|
@@ -28,7 +28,10 @@ dsh --profile <profile> --patch ./cordis.patch.yml
|
|
|
28
28
|
| `rh_task_create` / `rh_task_list` / `rh_task_next` / `rh_task_update` / `rh_task_delete` | tasks | `ctx.storageDomain` (typed `righthand_tasks` domain; state machine open → done/failed) |
|
|
29
29
|
| `rh_text_summarise` / `rh_text_extract` / `rh_text_classify` / `rh_text_translate` | text | `ctx.llm` (one model call per verb) |
|
|
30
30
|
| `rh_weather_forecast` / `rh_weather_air` | weather | Open-Meteo (keyless), every request through the SSRF-guarded fetcher |
|
|
31
|
+
| `rh_places_geocode` / `rh_places_address` / `rh_places_elevation` / `rh_places_nearby` | places | Nominatim/OSM + Open-Meteo (keyless; User-Agent per Nominatim's 1 req/s usage policy) |
|
|
31
32
|
| `rh_files_put` / `rh_files_get` / `rh_files_list` / `rh_files_share` / `rh_files_delete` | files | Cloudflare R2 (S3-compatible, SigV4-signed; credentials from `R2_ACCESS_KEY_ID` / `R2_SECRET_ACCESS_KEY`, bucket from settings) |
|
|
33
|
+
| `rh_events_create` / `rh_events_due` / `rh_events_list` / `rh_events_free` / `rh_events_cancel` | events | `ctx.storageDomain` (typed `righthand_events` domain; the agent is the scheduler — `rh_events_due` runs each turn) |
|
|
34
|
+
| `rh_notify_send` | notify | ntfy.sh (keyless — the topic name is the only secret) |
|
|
32
35
|
| `rh_credential_describe` / `rh_credential_set` / `rh_credential_unset` | secrets | `ctx.credentials` (values never echoed) |
|
|
33
36
|
| `rh_settings_get` / `rh_settings_set` | secrets | `ctx.settings` (namespace `righthand`) |
|
|
34
37
|
| `rh_run` | exec | `ctx.subprocess` (collect mode, bounded output) |
|
|
@@ -69,6 +72,7 @@ Namespace "righthand" (registered by the secrets family):
|
|
|
69
72
|
| `defaultScriptPrefix` | "rh-" | default name prefix for generated workers/scripts |
|
|
70
73
|
| `defaultZone` | "" | default Cloudflare zone |
|
|
71
74
|
| `defaultR2Bucket` | "" | default R2 bucket for `rh_files_*` |
|
|
75
|
+
| `defaultNotifyTopic` | "" | default ntfy topic for `rh_notify_send` |
|
|
72
76
|
|
|
73
77
|
`rh_settings_get` returns the resolved values; `rh_settings_set` merges a
|
|
74
78
|
partial patch (persisted by the harness settings provider).
|
|
@@ -144,10 +148,12 @@ so the agent cannot deploy or destroy without the gate.
|
|
|
144
148
|
|
|
145
149
|
## Service availability
|
|
146
150
|
|
|
147
|
-
The store and
|
|
148
|
-
provides (`storage` + `storage-json` + `storage-domain` rows). In a
|
|
149
|
-
without it — e.g. the headless bundle — those
|
|
150
|
-
|
|
151
|
+
The store, task and events families need `ctx.storageDomain`, which the web
|
|
152
|
+
profile provides (`storage` + `storage-json` + `storage-domain` rows). In a
|
|
153
|
+
profile without it — e.g. the headless bundle — those fourteen tools stay
|
|
154
|
+
dormant and the other twenty-three tools (secrets, settings, exec, text,
|
|
155
|
+
weather, places, files, notify) still register; the plugin never fails the
|
|
156
|
+
boot.
|
|
151
157
|
|
|
152
158
|
## Development
|
|
153
159
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* events-tools — rh_events_* over ctx.storageDomain.
|
|
3
|
+
* Reminders and the free-slot query. The agent IS the scheduler:
|
|
4
|
+
* rh_events_due is the check the agent runs each turn — an event whose
|
|
5
|
+
* time has come is returned once (pending → notified), so a missed run
|
|
6
|
+
* cannot go quiet without a record. Repeating events are one-off here;
|
|
7
|
+
* a real scheduler is the documented Cloudflare cron escalation.
|
|
8
|
+
* @module dsh-righthand/events-tools
|
|
9
|
+
*/
|
|
10
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
11
|
+
import type { Domain } from '@deepseek-ai/dsh-storage-domain';
|
|
12
|
+
export declare const name = "righthand-events";
|
|
13
|
+
export declare const inject: string[];
|
|
14
|
+
export interface Event {
|
|
15
|
+
id: string;
|
|
16
|
+
title: string;
|
|
17
|
+
detail: string;
|
|
18
|
+
at: string;
|
|
19
|
+
state: 'pending' | 'notified' | 'cancelled';
|
|
20
|
+
createdAt: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const eventsDomain: {
|
|
23
|
+
name: string;
|
|
24
|
+
version: number;
|
|
25
|
+
tables: {
|
|
26
|
+
events: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<string, {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
detail: string;
|
|
30
|
+
at: string;
|
|
31
|
+
state: "pending" | "notified" | "cancelled";
|
|
32
|
+
createdAt: string;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type EventsDomain = Domain<typeof eventsDomain>;
|
|
37
|
+
/**
|
|
38
|
+
* Free slots: gaps of at least durationMinutes between pending events at or
|
|
39
|
+
* after now, within working hours 09:00–17:00, over the next horizonHours.
|
|
40
|
+
* Pure and exported for tests.
|
|
41
|
+
*/
|
|
42
|
+
export declare function freeSlots(events: readonly Event[], now: Date, durationMinutes: number, horizonHours?: number): string[];
|
|
43
|
+
export declare function apply(ctx: Context): void;
|
|
44
|
+
//# sourceMappingURL=events-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-tools.d.ts","sourceRoot":"","sources":["../src/events-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAG7D,eAAO,MAAM,IAAI,qBAAqB,CAAA;AACtC,eAAO,MAAM,MAAM,UAA6B,CAAA;AAEhD,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAavB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAA;AAMtD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,YAAY,SAAK,GAAG,MAAM,EAAE,CA6BnH;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAwJxC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* events-tools — rh_events_* over ctx.storageDomain.
|
|
3
|
+
* Reminders and the free-slot query. The agent IS the scheduler:
|
|
4
|
+
* rh_events_due is the check the agent runs each turn — an event whose
|
|
5
|
+
* time has come is returned once (pending → notified), so a missed run
|
|
6
|
+
* cannot go quiet without a record. Repeating events are one-off here;
|
|
7
|
+
* a real scheduler is the documented Cloudflare cron escalation.
|
|
8
|
+
* @module dsh-righthand/events-tools
|
|
9
|
+
*/
|
|
10
|
+
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
11
|
+
import { defineDomain, domainTable } from '@deepseek-ai/dsh-storage-domain';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
export const name = 'righthand-events';
|
|
14
|
+
export const inject = ['tools', 'storageDomain'];
|
|
15
|
+
export const eventsDomain = defineDomain({
|
|
16
|
+
name: 'righthand_events',
|
|
17
|
+
version: 1,
|
|
18
|
+
tables: {
|
|
19
|
+
events: domainTable(z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
title: z.string(),
|
|
22
|
+
detail: z.string(),
|
|
23
|
+
at: z.string(),
|
|
24
|
+
state: z.enum(['pending', 'notified', 'cancelled']),
|
|
25
|
+
createdAt: z.string(),
|
|
26
|
+
})),
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
function newId() {
|
|
30
|
+
return 'e-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2, 6);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Free slots: gaps of at least durationMinutes between pending events at or
|
|
34
|
+
* after now, within working hours 09:00–17:00, over the next horizonHours.
|
|
35
|
+
* Pure and exported for tests.
|
|
36
|
+
*/
|
|
37
|
+
export function freeSlots(events, now, durationMinutes, horizonHours = 24) {
|
|
38
|
+
const horizonEnd = now.getTime() + horizonHours * 3600000;
|
|
39
|
+
const busy = events
|
|
40
|
+
.filter(e => e.state === 'pending')
|
|
41
|
+
.map(e => new Date(e.at).getTime())
|
|
42
|
+
.filter(t => Number.isFinite(t) && t >= now.getTime() && t <= horizonEnd)
|
|
43
|
+
.sort((a, b) => a - b);
|
|
44
|
+
const slots = [];
|
|
45
|
+
let cursor = now.getTime();
|
|
46
|
+
const dayStart = (t) => {
|
|
47
|
+
const d = new Date(t);
|
|
48
|
+
d.setHours(9, 0, 0, 0);
|
|
49
|
+
return d.getTime();
|
|
50
|
+
};
|
|
51
|
+
const dayEnd = (t) => {
|
|
52
|
+
const d = new Date(t);
|
|
53
|
+
d.setHours(17, 0, 0, 0);
|
|
54
|
+
return d.getTime();
|
|
55
|
+
};
|
|
56
|
+
const need = durationMinutes * 60000;
|
|
57
|
+
for (const b of busy) {
|
|
58
|
+
let from = Math.max(cursor, dayStart(cursor));
|
|
59
|
+
if (from < b && b - from >= need && from + need <= dayEnd(from) && from + need <= horizonEnd) {
|
|
60
|
+
slots.push(new Date(from).toISOString());
|
|
61
|
+
}
|
|
62
|
+
cursor = Math.max(b, dayEnd(cursor) + 1);
|
|
63
|
+
if (cursor > horizonEnd)
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
return slots;
|
|
67
|
+
}
|
|
68
|
+
export function apply(ctx) {
|
|
69
|
+
let domain;
|
|
70
|
+
let ready;
|
|
71
|
+
ctx.effect(() => {
|
|
72
|
+
ready = (async () => {
|
|
73
|
+
domain = await ctx.storageDomain.open(eventsDomain);
|
|
74
|
+
})();
|
|
75
|
+
return () => { };
|
|
76
|
+
});
|
|
77
|
+
const ensure = async () => {
|
|
78
|
+
if (domain === undefined) {
|
|
79
|
+
await ready;
|
|
80
|
+
}
|
|
81
|
+
if (domain === undefined)
|
|
82
|
+
throw new Error('righthand events are not open (storageDomain not mounted)');
|
|
83
|
+
return domain;
|
|
84
|
+
};
|
|
85
|
+
const all = async () => {
|
|
86
|
+
const d = await ensure();
|
|
87
|
+
return [...d.table('events').entries()].map(([, e]) => e);
|
|
88
|
+
};
|
|
89
|
+
ctx.tools.register(defineTool({
|
|
90
|
+
name: 'rh_events_create',
|
|
91
|
+
description: 'Schedule a reminder at an ISO datetime. One-off: the agent checks rh_events_due each turn and the event is delivered exactly once (pending to notified), so a missed run is never silently dropped.',
|
|
92
|
+
parameters: {
|
|
93
|
+
title: { type: 'string', required: true, description: 'What to be reminded of.' },
|
|
94
|
+
at: { type: 'string', required: true, description: 'ISO datetime when it is due, e.g. 2026-08-31T09:00:00Z.' },
|
|
95
|
+
detail: { type: 'string', description: 'Optional longer note.' },
|
|
96
|
+
},
|
|
97
|
+
output: {
|
|
98
|
+
schema: {
|
|
99
|
+
type: 'object',
|
|
100
|
+
additionalProperties: false,
|
|
101
|
+
properties: {
|
|
102
|
+
id: { type: 'string', required: true },
|
|
103
|
+
title: { type: 'string', required: true },
|
|
104
|
+
at: { type: 'string', required: true },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
render: (_args, value) => [{ type: 'text', text: 'event ' + value.id + ': ' + value.title + ' at ' + value.at }],
|
|
108
|
+
},
|
|
109
|
+
async execute(args) {
|
|
110
|
+
const d = await ensure();
|
|
111
|
+
const at = new Date(args.at);
|
|
112
|
+
if (Number.isNaN(at.getTime()))
|
|
113
|
+
throw new Error('at must be a valid ISO datetime');
|
|
114
|
+
const event = {
|
|
115
|
+
id: newId(),
|
|
116
|
+
title: args.title.trim(),
|
|
117
|
+
detail: args.detail ?? '',
|
|
118
|
+
at: at.toISOString(),
|
|
119
|
+
state: 'pending',
|
|
120
|
+
createdAt: new Date().toISOString(),
|
|
121
|
+
};
|
|
122
|
+
if (event.title === '')
|
|
123
|
+
throw new Error('an event needs a title');
|
|
124
|
+
await d.table('events').put(event.id, event);
|
|
125
|
+
return { id: event.id, title: event.title, at: event.at };
|
|
126
|
+
},
|
|
127
|
+
}));
|
|
128
|
+
ctx.tools.register(defineTool({
|
|
129
|
+
name: 'rh_events_due',
|
|
130
|
+
description: 'The pending events whose time has come (at <= now). Each is delivered exactly once: returned events are marked notified. This is the check to run every turn — the agent is the scheduler.',
|
|
131
|
+
parameters: {},
|
|
132
|
+
output: {
|
|
133
|
+
schema: {
|
|
134
|
+
type: 'object',
|
|
135
|
+
additionalProperties: false,
|
|
136
|
+
properties: {
|
|
137
|
+
due: { type: 'array', required: true, items: { type: 'json' } },
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
render: (_args, value) => [{ type: 'text', text: value.due.length === 0 ? '(nothing due)' : value.due.map((e) => e.title + ' at ' + e.at).join(' / ') }],
|
|
141
|
+
},
|
|
142
|
+
async execute() {
|
|
143
|
+
const d = await ensure();
|
|
144
|
+
const now = Date.now();
|
|
145
|
+
const due = [];
|
|
146
|
+
for (const e of [...d.table('events').entries()].map(([, v]) => v)) {
|
|
147
|
+
if (e.state === 'pending' && new Date(e.at).getTime() <= now) {
|
|
148
|
+
const notified = { ...e, state: 'notified' };
|
|
149
|
+
await d.table('events').put(e.id, notified);
|
|
150
|
+
due.push(notified);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
due.sort((a, b) => a.at.localeCompare(b.at));
|
|
154
|
+
return { due: due.map(e => ({ id: e.id, title: e.title, detail: e.detail, at: e.at })) };
|
|
155
|
+
},
|
|
156
|
+
}));
|
|
157
|
+
ctx.tools.register(defineTool({
|
|
158
|
+
name: 'rh_events_list',
|
|
159
|
+
description: 'List events: upcoming pending ones first, then notified and cancelled.',
|
|
160
|
+
parameters: {
|
|
161
|
+
state: { type: 'string', description: 'Filter: pending | notified | cancelled. Omit for all.' },
|
|
162
|
+
},
|
|
163
|
+
output: {
|
|
164
|
+
schema: { type: 'array', items: { type: 'json' } },
|
|
165
|
+
render: (_args, value) => [{ type: 'text', text: value.length === 0 ? '(no events)' : value.map((e) => e.at + ' ' + e.title + ' [' + e.state + ']').join(' / ') }],
|
|
166
|
+
},
|
|
167
|
+
async execute(args) {
|
|
168
|
+
const events = await all();
|
|
169
|
+
const wanted = args.state ?? null;
|
|
170
|
+
const filtered = wanted ? events.filter(e => e.state === wanted) : events;
|
|
171
|
+
const rank = { pending: 0, notified: 1, cancelled: 2 };
|
|
172
|
+
filtered.sort((a, b) => (rank[a.state] - rank[b.state]) || a.at.localeCompare(b.at));
|
|
173
|
+
return filtered.map(e => ({ id: e.id, title: e.title, detail: e.detail, at: e.at, state: e.state }));
|
|
174
|
+
},
|
|
175
|
+
}));
|
|
176
|
+
ctx.tools.register(defineTool({
|
|
177
|
+
name: 'rh_events_free',
|
|
178
|
+
description: 'When is there nothing booked: the next free slots of at least durationMinutes within working hours (09:00-17:00) over the next horizonHours.',
|
|
179
|
+
parameters: {
|
|
180
|
+
durationMinutes: { type: 'integer', required: true, description: 'How long the free block must be.' },
|
|
181
|
+
horizonHours: { type: 'integer', description: 'How far ahead to look (default 24).' },
|
|
182
|
+
},
|
|
183
|
+
output: {
|
|
184
|
+
schema: { type: 'array', items: { type: 'string' } },
|
|
185
|
+
render: (_args, value) => [{ type: 'text', text: value.length === 0 ? '(no free slot)' : value.join(' / ') }],
|
|
186
|
+
},
|
|
187
|
+
async execute(args) {
|
|
188
|
+
const events = await all();
|
|
189
|
+
return freeSlots(events, new Date(), args.durationMinutes, args.horizonHours ?? 24);
|
|
190
|
+
},
|
|
191
|
+
}));
|
|
192
|
+
ctx.tools.register(defineTool({
|
|
193
|
+
name: 'rh_events_cancel',
|
|
194
|
+
description: 'Cancel an event by id. Returns whether it existed. Cancelled events stay in the record — a cancellation is news too.',
|
|
195
|
+
parameters: {
|
|
196
|
+
id: { type: 'string', required: true, description: 'The event id.' },
|
|
197
|
+
},
|
|
198
|
+
output: {
|
|
199
|
+
schema: {
|
|
200
|
+
type: 'object',
|
|
201
|
+
additionalProperties: false,
|
|
202
|
+
properties: {
|
|
203
|
+
id: { type: 'string', required: true },
|
|
204
|
+
existed: { type: 'boolean', required: true },
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
render: (_args, value) => [{ type: 'text', text: 'cancelled ' + value.id + ': ' + value.existed }],
|
|
208
|
+
},
|
|
209
|
+
async execute(args) {
|
|
210
|
+
const d = await ensure();
|
|
211
|
+
const e = d.table('events').get(args.id);
|
|
212
|
+
if (e === undefined)
|
|
213
|
+
return { id: args.id, existed: false };
|
|
214
|
+
await d.table('events').put(args.id, { ...e, state: 'cancelled' });
|
|
215
|
+
return { id: args.id, existed: true };
|
|
216
|
+
},
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=events-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-tools.js","sourceRoot":"","sources":["../src/events-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAE3E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAA;AACtC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;AAWhD,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC;IACvC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,CAAC;IACV,MAAM,EAAE;QACN,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;YAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;YACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;YAClB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;YACnD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;SACtB,CAAC,CAAC;KACJ;CACF,CAAC,CAAA;AAIF,SAAS,KAAK;IACZ,OAAO,IAAI,GAAG,IAAI,C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AE,IAAI,EAAE;iBAC7C;aACF;YACD,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,KAAK,CAAC,EAAE,GAAG,IAAI,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;SACnG;QACD,KAAK,CAAC,OAAO,CAAC,IAAI;YAChB,MAAM,CAAC,GAAG,MAAM,MAAM,EAAE,CAAA;YACxB,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACxC,IAAI,CAAC,KAAK,SAAS;gBAAE,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;YAC3D,MAAM,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;YAClE,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;QACvC,CAAC;KACF,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
* The package's plugin entry (name/inject/apply) mounts the tool families
|
|
9
9
|
* and the packaged skill as child fibers; each child waits on its own
|
|
10
10
|
* services, so a
|
|
11
|
-
* profile without `storageDomain` (e.g. headless) simply gets the
|
|
12
|
-
*
|
|
11
|
+
* profile without `storageDomain` (e.g. headless) simply gets the
|
|
12
|
+
* store/task/events families dormant and the other twenty-three tools
|
|
13
|
+
* (secrets, settings, exec, text, weather, places, files, notify) instead
|
|
14
|
+
* of failing the boot.
|
|
13
15
|
*
|
|
14
16
|
* Modules (each individually mountable via `export * as ...`):
|
|
15
17
|
* - store-tools: rh_store_put/get/delete/list over ctx.storageDomain
|
|
@@ -17,7 +19,10 @@
|
|
|
17
19
|
* - task-tools: rh_task_create/list/next/update/delete over ctx.storageDomain
|
|
18
20
|
* - text-tools: rh_text_summarise/extract/classify/translate over ctx.llm
|
|
19
21
|
* - weather-tools: rh_weather_forecast/air over Open-Meteo (keyless, SSRF-guarded)
|
|
22
|
+
* - places-tools: rh_places_geocode/address/elevation/nearby (Nominatim + Open-Meteo, keyless)
|
|
20
23
|
* - files-tools: rh_files_put/get/list/share/delete over Cloudflare R2
|
|
24
|
+
* - events-tools: rh_events_create/due/list/free/cancel over ctx.storageDomain
|
|
25
|
+
* - notify-tools: rh_notify_send over ntfy.sh (keyless)
|
|
21
26
|
* - exec-tools: rh_run / rh_run_bg over ctx.subprocess + ctx.jobs
|
|
22
27
|
* - guard-tools: tools/pre-execute policy (config.rules)
|
|
23
28
|
* - skills: the packaged dsh-righthand skill (ctx.skills)
|
|
@@ -32,7 +37,10 @@ import * as guardTools from './guard-tools.ts';
|
|
|
32
37
|
import * as taskTools from './task-tools.ts';
|
|
33
38
|
import * as textTools from './text-tools.ts';
|
|
34
39
|
import * as weatherTools from './weather-tools.ts';
|
|
40
|
+
import * as placesTools from './places-tools.ts';
|
|
35
41
|
import * as filesTools from './files-tools.ts';
|
|
42
|
+
import * as eventsTools from './events-tools.ts';
|
|
43
|
+
import * as notifyTools from './notify-tools.ts';
|
|
36
44
|
import * as righthandSkills from './skills.ts';
|
|
37
45
|
import type { GuardRule } from './guard-tools.ts';
|
|
38
46
|
export declare const name = "dsh-righthand";
|
|
@@ -50,14 +58,18 @@ export interface RighthandConfig {
|
|
|
50
58
|
* instead of failing the whole plugin.
|
|
51
59
|
*/
|
|
52
60
|
export declare function apply(ctx: Context, config?: RighthandConfig): void;
|
|
53
|
-
export { storeTools, secretsTools, execTools, taskTools, textTools, weatherTools, filesTools, guardTools, righthandSkills };
|
|
61
|
+
export { storeTools, secretsTools, execTools, taskTools, textTools, weatherTools, placesTools, filesTools, eventsTools, notifyTools, guardTools, righthandSkills };
|
|
54
62
|
export { SKILL_NAME, SKILL_DESCRIPTION, skillDirectory, skillBody } from './skills.ts';
|
|
55
63
|
export type { GuardRule } from './guard-tools.ts';
|
|
56
64
|
export { guardFactsFor } from './guard-tools.ts';
|
|
57
65
|
export type { GuardFacts } from './guard-tools.ts';
|
|
58
66
|
export { isBlockedIP, guardedFetch, normalizeForecast, normalizeAir } from './weather-tools.ts';
|
|
67
|
+
export { normalizePlace, normalizePlaces, normalizeElevation, distanceKm, nearbyViewbox } from './places-tools.ts';
|
|
59
68
|
export { createR2Client, R2_ACCESS_KEY_REF, R2_SECRET_KEY_REF } from './files-tools.ts';
|
|
60
69
|
export { signRequest, presignGet } from './sigv4.ts';
|
|
70
|
+
export { freeSlots } from './events-tools.ts';
|
|
71
|
+
export type { Event } from './events-tools.ts';
|
|
61
72
|
export type { R2Options, ListEntry } from './files-tools.ts';
|
|
62
73
|
export type { WeatherConfig, ForecastOut, AirOut } from './weather-tools.ts';
|
|
74
|
+
export type { PlacesConfig, PlaceOut, ElevationOut } from './places-tools.ts';
|
|
63
75
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,S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AAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAClH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACvF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5D,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC5E,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
* The package's plugin entry (name/inject/apply) mounts the tool families
|
|
9
9
|
* and the packaged skill as child fibers; each child waits on its own
|
|
10
10
|
* services, so a
|
|
11
|
-
* profile without `storageDomain` (e.g. headless) simply gets the
|
|
12
|
-
*
|
|
11
|
+
* profile without `storageDomain` (e.g. headless) simply gets the
|
|
12
|
+
* store/task/events families dormant and the other twenty-three tools
|
|
13
|
+
* (secrets, settings, exec, text, weather, places, files, notify) instead
|
|
14
|
+
* of failing the boot.
|
|
13
15
|
*
|
|
14
16
|
* Modules (each individually mountable via `export * as ...`):
|
|
15
17
|
* - store-tools: rh_store_put/get/delete/list over ctx.storageDomain
|
|
@@ -17,7 +19,10 @@
|
|
|
17
19
|
* - task-tools: rh_task_create/list/next/update/delete over ctx.storageDomain
|
|
18
20
|
* - text-tools: rh_text_summarise/extract/classify/translate over ctx.llm
|
|
19
21
|
* - weather-tools: rh_weather_forecast/air over Open-Meteo (keyless, SSRF-guarded)
|
|
22
|
+
* - places-tools: rh_places_geocode/address/elevation/nearby (Nominatim + Open-Meteo, keyless)
|
|
20
23
|
* - files-tools: rh_files_put/get/list/share/delete over Cloudflare R2
|
|
24
|
+
* - events-tools: rh_events_create/due/list/free/cancel over ctx.storageDomain
|
|
25
|
+
* - notify-tools: rh_notify_send over ntfy.sh (keyless)
|
|
21
26
|
* - exec-tools: rh_run / rh_run_bg over ctx.subprocess + ctx.jobs
|
|
22
27
|
* - guard-tools: tools/pre-execute policy (config.rules)
|
|
23
28
|
* - skills: the packaged dsh-righthand skill (ctx.skills)
|
|
@@ -31,7 +36,10 @@ import * as guardTools from "./guard-tools.js";
|
|
|
31
36
|
import * as taskTools from "./task-tools.js";
|
|
32
37
|
import * as textTools from "./text-tools.js";
|
|
33
38
|
import * as weatherTools from "./weather-tools.js";
|
|
39
|
+
import * as placesTools from "./places-tools.js";
|
|
34
40
|
import * as filesTools from "./files-tools.js";
|
|
41
|
+
import * as eventsTools from "./events-tools.js";
|
|
42
|
+
import * as notifyTools from "./notify-tools.js";
|
|
35
43
|
import * as righthandSkills from "./skills.js";
|
|
36
44
|
export const name = 'dsh-righthand';
|
|
37
45
|
/** The combined plugin needs no services itself; each child waits on its own. */
|
|
@@ -49,15 +57,20 @@ export function apply(ctx, config = {}) {
|
|
|
49
57
|
ctx.plugin(taskTools);
|
|
50
58
|
ctx.plugin(textTools);
|
|
51
59
|
ctx.plugin(weatherTools);
|
|
60
|
+
ctx.plugin(placesTools);
|
|
52
61
|
ctx.plugin(filesTools);
|
|
62
|
+
ctx.plugin(eventsTools);
|
|
63
|
+
ctx.plugin(notifyTools);
|
|
53
64
|
ctx.plugin(guardTools, { rules: config.rules ?? [] });
|
|
54
65
|
ctx.plugin(righthandSkills);
|
|
55
66
|
}
|
|
56
67
|
// Individual modules stay importable for selective mounting.
|
|
57
|
-
export { storeTools, secretsTools, execTools, taskTools, textTools, weatherTools, filesTools, guardTools, righthandSkills };
|
|
68
|
+
export { storeTools, secretsTools, execTools, taskTools, textTools, weatherTools, placesTools, filesTools, eventsTools, notifyTools, guardTools, righthandSkills };
|
|
58
69
|
export { SKILL_NAME, SKILL_DESCRIPTION, skillDirectory, skillBody } from "./skills.js";
|
|
59
70
|
export { guardFactsFor } from "./guard-tools.js";
|
|
60
71
|
export { isBlockedIP, guardedFetch, normalizeForecast, normalizeAir } from "./weather-tools.js";
|
|
72
|
+
export { normalizePlace, normalizePlaces, normalizeElevation, distanceKm, nearbyViewbox } from "./places-tools.js";
|
|
61
73
|
export { createR2Client, R2_ACCESS_KEY_REF, R2_SECRET_KEY_REF } from "./files-tools.js";
|
|
62
74
|
export { signRequest, presignGet } from "./sigv4.js";
|
|
75
|
+
export { freeSlots } from "./events-tools.js";
|
|
63
76
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,eAAe,MAAM,aAAa,CAAA;AAG9C,MAAM,CAAC,MAAM,IAAI,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AAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAClH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACvF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* notify-tools — rh_notify_send over ntfy.sh (keyless).
|
|
3
|
+
* Interrupt yourself on your own devices: publish to a topic; any phone
|
|
4
|
+
* subscribed to that topic gets it. The topic name is the only secret —
|
|
5
|
+
* choose one nobody can guess, like the digest of a random string.
|
|
6
|
+
* @module dsh-righthand/notify-tools
|
|
7
|
+
*/
|
|
8
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
9
|
+
export declare const name = "righthand-notify";
|
|
10
|
+
export declare const inject: string[];
|
|
11
|
+
export interface NotifyConfig {
|
|
12
|
+
/** ntfy server base URL; default https://ntfy.sh (keyless publish). */
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
/** Topic to publish to; defaults to the righthand settings defaultNotifyTopic. */
|
|
15
|
+
topic?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function apply(ctx: Context, config?: NotifyConfig): void;
|
|
18
|
+
//# sourceMappingURL=notify-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-tools.d.ts","sourceRoot":"","sources":["../src/notify-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,eAAO,MAAM,IAAI,qBAAqB,CAAA;AACtC,eAAO,MAAM,MAAM,UAAwB,CAAA;AAE3C,MAAM,WAAW,YAAY;IAC3B,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,YAAiB,GAAG,IAAI,CAqCnE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* notify-tools — rh_notify_send over ntfy.sh (keyless).
|
|
3
|
+
* Interrupt yourself on your own devices: publish to a topic; any phone
|
|
4
|
+
* subscribed to that topic gets it. The topic name is the only secret —
|
|
5
|
+
* choose one nobody can guess, like the digest of a random string.
|
|
6
|
+
* @module dsh-righthand/notify-tools
|
|
7
|
+
*/
|
|
8
|
+
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
9
|
+
import { settingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
10
|
+
import { guardedFetch } from "./weather-tools.js";
|
|
11
|
+
export const name = 'righthand-notify';
|
|
12
|
+
export const inject = ['tools', 'settings'];
|
|
13
|
+
export function apply(ctx, config = {}) {
|
|
14
|
+
const ns = settingsNamespace('righthand');
|
|
15
|
+
const baseUrl = config.baseUrl ?? 'https://ntfy.sh';
|
|
16
|
+
ctx.tools.register(defineTool({
|
|
17
|
+
name: 'rh_notify_send',
|
|
18
|
+
description: 'Interrupt yourself on your own devices: publish a notification to a ntfy.sh topic (keyless). Any device subscribed to that topic receives it. The topic name is the only secret — use an unguessable one. Defaults: priority 1 and auto-delete after 24h.',
|
|
19
|
+
parameters: {
|
|
20
|
+
message: { type: 'string', required: true, description: 'The notification body.' },
|
|
21
|
+
title: { type: 'string', description: 'Notification title.' },
|
|
22
|
+
topic: { type: 'string', description: 'Topic to publish to; defaults to the settings defaultNotifyTopic.' },
|
|
23
|
+
priority: { type: 'integer', description: '1 (low/default) to 5 (urgent). Default 1.' },
|
|
24
|
+
},
|
|
25
|
+
output: {
|
|
26
|
+
schema: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
properties: {
|
|
30
|
+
topic: { type: 'string', required: true },
|
|
31
|
+
sent: { type: 'boolean', required: true },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
render: (_args, value) => [{ type: 'text', text: 'notified ' + value.topic }],
|
|
35
|
+
},
|
|
36
|
+
async execute(args) {
|
|
37
|
+
const settings = ctx.settings.get(ns);
|
|
38
|
+
const topic = args.topic ?? config.topic ?? settings?.defaultNotifyTopic ?? '';
|
|
39
|
+
if (topic === '')
|
|
40
|
+
throw new Error('notify topic is not set (arg, plugin config, or settings defaultNotifyTopic)');
|
|
41
|
+
const priority = Math.min(Math.max(args.priority ?? 1, 1), 5);
|
|
42
|
+
const headers = { 'Priority': String(priority), 'X-TTL': '24h' };
|
|
43
|
+
if (args.title !== undefined)
|
|
44
|
+
headers['Title'] = args.title;
|
|
45
|
+
await guardedFetch(baseUrl + '/' + encodeURIComponent(topic), {
|
|
46
|
+
init: { method: 'POST', body: args.message, headers },
|
|
47
|
+
});
|
|
48
|
+
return { topic, sent: true };
|
|
49
|
+
},
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=notify-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-tools.js","sourceRoot":"","sources":["../src/notify-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAA;AACtC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;AAS3C,MAAM,UAAU,KAAK,CAAC,GAAY,EAAE,SAAuB,EAAE;IAC3D,MAAM,EAAE,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAA;IACzC,MAAM,O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EAA8E,CAAC,CAAA;YACjH,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAC7D,MAAM,OAAO,GAA2B,EAAE,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;YACxF,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;gBAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAA;YAC3D,MAAM,YAAY,CAAC,OAAO,GAAG,GAAG,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAAE;gBAC5D,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE;aACtD,CAAC,CAAA;YACF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;QAC9B,CAAC;KACF,CAAC,CAAC,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* places-tools - the second keyless data-adapter family (after weather).
|
|
3
|
+
* Geocoding, reverse geocoding and nearby search over Nominatim
|
|
4
|
+
* (OpenStreetMap, keyless), elevation over Open-Meteo (keyless).
|
|
5
|
+
*
|
|
6
|
+
* Every request goes through guardedFetch (the SSRF checklist from
|
|
7
|
+
* blueprint/data-adapter); Nominatim requests carry a User-Agent per its
|
|
8
|
+
* usage policy (max 1 req/s - agent-paced calls only).
|
|
9
|
+
* @module dsh-righthand/places-tools
|
|
10
|
+
*/
|
|
11
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
12
|
+
export declare const name = "righthand-places";
|
|
13
|
+
export declare const inject: string[];
|
|
14
|
+
export interface PlacesConfig {
|
|
15
|
+
/** Nominatim endpoint; default https://nominatim.openstreetmap.org (keyless). */
|
|
16
|
+
nominatimUrl?: string;
|
|
17
|
+
/** Open-Meteo elevation endpoint; default https://api.open-meteo.com/v1/elevation (keyless). */
|
|
18
|
+
elevationUrl?: string;
|
|
19
|
+
/** User-Agent sent with Nominatim requests (its usage policy requires one). */
|
|
20
|
+
userAgent?: string;
|
|
21
|
+
}
|
|
22
|
+
/** The stable place shape callers see - the wire JSON is Nominatim's. */
|
|
23
|
+
export interface PlaceOut {
|
|
24
|
+
name: string;
|
|
25
|
+
lat: number;
|
|
26
|
+
lon: number;
|
|
27
|
+
displayName: string;
|
|
28
|
+
category: string;
|
|
29
|
+
type: string;
|
|
30
|
+
address: Record<string, string>;
|
|
31
|
+
}
|
|
32
|
+
/** Normalize one Nominatim result (search or reverse) to PlaceOut. */
|
|
33
|
+
export declare function normalizePlace(raw: any): PlaceOut;
|
|
34
|
+
export declare function normalizePlaces(raw: any): PlaceOut[];
|
|
35
|
+
/** Normalize the Open-Meteo elevation response { elevation: [8.0] }. */
|
|
36
|
+
export interface ElevationOut {
|
|
37
|
+
elevation: number;
|
|
38
|
+
}
|
|
39
|
+
export declare function normalizeElevation(raw: any): ElevationOut;
|
|
40
|
+
/** Haversine distance in km between two lat/lon pairs. */
|
|
41
|
+
export declare function distanceKm(lat1: number, lon1: number, lat2: number, lon2: number): number;
|
|
42
|
+
/**
|
|
43
|
+
* The Nominatim viewbox for a radius around a point, as
|
|
44
|
+
* left,top,right,bottom (lon,lat pairs) - the order the API expects.
|
|
45
|
+
*/
|
|
46
|
+
export declare function nearbyViewbox(latitude: number, longitude: number, radiusKm: number): string;
|
|
47
|
+
export declare function apply(ctx: Context, config?: PlacesConfig): void;
|
|
48
|
+
//# sourceMappingURL=places-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"places-tools.d.ts","sourceRoot":"","sources":["../src/places-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;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