gipity 1.0.403 → 1.0.405
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/commands/notify.js +67 -0
- package/dist/index.js +2 -1
- package/dist/knowledge.js +6 -3
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { get, post } from '../api.js';
|
|
3
|
+
import { requireConfig } from '../config.js';
|
|
4
|
+
import { bold, muted, success, warning } from '../colors.js';
|
|
5
|
+
import { run } from '../helpers/index.js';
|
|
6
|
+
export const notifyCommand = new Command('notify')
|
|
7
|
+
.description('Gipity Notify (web push): send a test notification or inspect subscriptions');
|
|
8
|
+
notifyCommand
|
|
9
|
+
.command('test')
|
|
10
|
+
.description('Send a test push notification to yourself, a user, or everyone')
|
|
11
|
+
.option('--to <who>', "Recipient: a user guid, comma-separated guids, or 'all'", 'all')
|
|
12
|
+
.option('--title <text>', 'Notification title', 'Test notification')
|
|
13
|
+
.option('--body <text>', 'Notification body', 'Hello from Gipity Notify 👋')
|
|
14
|
+
.option('--url <url>', 'URL to open when the notification is clicked')
|
|
15
|
+
.option('--json', 'Output raw JSON')
|
|
16
|
+
.action((opts) => run('Notify', async () => {
|
|
17
|
+
const config = requireConfig();
|
|
18
|
+
const to = opts.to === 'all' ? 'all' : (opts.to.includes(',') ? opts.to.split(',').map((s) => s.trim()) : opts.to);
|
|
19
|
+
const notification = { title: opts.title, body: opts.body };
|
|
20
|
+
if (opts.url)
|
|
21
|
+
notification.url = opts.url;
|
|
22
|
+
const res = await post(`/api/${config.projectGuid}/services/notify/send`, { to, notification });
|
|
23
|
+
if (opts.json) {
|
|
24
|
+
console.log(JSON.stringify(res.data));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const { sent, failed, pruned } = res.data;
|
|
28
|
+
if (sent > 0)
|
|
29
|
+
console.log(success(`✓ Sent to ${sent} device${sent === 1 ? '' : 's'}.`));
|
|
30
|
+
else
|
|
31
|
+
console.log(warning('No devices received it — has anyone enabled notifications in the app yet? (gipity notify subs)'));
|
|
32
|
+
if (pruned)
|
|
33
|
+
console.log(muted(` pruned ${pruned} expired subscription${pruned === 1 ? '' : 's'}`));
|
|
34
|
+
if (failed)
|
|
35
|
+
console.log(muted(` ${failed} delivery failure${failed === 1 ? '' : 's'}`));
|
|
36
|
+
}));
|
|
37
|
+
notifyCommand
|
|
38
|
+
.command('subs')
|
|
39
|
+
.description('Show how many push subscriptions this app has, per user')
|
|
40
|
+
.option('--json', 'Output raw JSON')
|
|
41
|
+
.action((opts) => run('Notify', async () => {
|
|
42
|
+
const config = requireConfig();
|
|
43
|
+
const res = await get(`/api/${config.projectGuid}/services/notify/subs`);
|
|
44
|
+
if (opts.json) {
|
|
45
|
+
console.log(JSON.stringify(res.data));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const { total, byUser } = res.data;
|
|
49
|
+
console.log(bold(`${total} subscription${total === 1 ? '' : 's'} across ${byUser.length} user${byUser.length === 1 ? '' : 's'}`));
|
|
50
|
+
for (const r of byUser)
|
|
51
|
+
console.log(` ${r.user_guid} ${muted(`${r.count} device${r.count === 1 ? '' : 's'}`)}`);
|
|
52
|
+
}));
|
|
53
|
+
notifyCommand
|
|
54
|
+
.command('rm')
|
|
55
|
+
.description("Remove a user's push subscriptions (e.g. on account deletion)")
|
|
56
|
+
.requiredOption('--user <guid>', 'User guid whose subscriptions to remove')
|
|
57
|
+
.option('--json', 'Output raw JSON')
|
|
58
|
+
.action((opts) => run('Notify', async () => {
|
|
59
|
+
const config = requireConfig();
|
|
60
|
+
const res = await post(`/api/${config.projectGuid}/services/notify/remove`, { user_guid: opts.user });
|
|
61
|
+
if (opts.json) {
|
|
62
|
+
console.log(JSON.stringify(res.data));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
console.log(success(`Removed ${res.data.removed} subscription${res.data.removed === 1 ? '' : 's'} for ${opts.user}.`));
|
|
66
|
+
}));
|
|
67
|
+
//# sourceMappingURL=notify.js.map
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ import { pageCommand } from './commands/page.js';
|
|
|
35
35
|
import { recordsCommand } from './commands/records.js';
|
|
36
36
|
import { fnCommand } from './commands/fn.js';
|
|
37
37
|
import { serviceCommand } from './commands/service.js';
|
|
38
|
+
import { notifyCommand } from './commands/notify.js';
|
|
38
39
|
import { paymentsCommand } from './commands/payments.js';
|
|
39
40
|
import { jobCommand } from './commands/job.js';
|
|
40
41
|
import { rbacCommand } from './commands/rbac.js';
|
|
@@ -125,7 +126,7 @@ const commonGroup = [skillCommand, projectCommand, addCommand, removeCommand, de
|
|
|
125
126
|
const connectGroup = [claudeCommand, relayCommand];
|
|
126
127
|
const projectGroup = [domainCommand, statusCommand, initCommand];
|
|
127
128
|
const filesGroup = [fileCommand, syncCommand, pushCommand, uploadCommand];
|
|
128
|
-
const appBuildingGroup = [testCommand, fnCommand, serviceCommand, paymentsCommand, jobCommand, dbCommand, logsCommand, workflowCommand, realtimeCommand, rbacCommand, auditCommand, recordsCommand];
|
|
129
|
+
const appBuildingGroup = [testCommand, fnCommand, serviceCommand, notifyCommand, paymentsCommand, jobCommand, dbCommand, logsCommand, workflowCommand, realtimeCommand, rbacCommand, auditCommand, recordsCommand];
|
|
129
130
|
const utilitiesGroup = [pageCommand, sandboxCommand, generateCommand, emailCommand, gmailCommand, locationCommand, textCommand];
|
|
130
131
|
const agentGroup = [chatCommand, memoryCommand, agentCommand, approvalCommand];
|
|
131
132
|
const setupGroup = [loginCommand, logoutCommand, tokenCommand, creditsCommand, planCommand, doctorCommand, updateCommand, uninstallCommand];
|
package/dist/knowledge.js
CHANGED
|
@@ -22,6 +22,7 @@ Templates:
|
|
|
22
22
|
- \`karaoke-captions\` - Forced-alignment app - karaoke captions, subtitle timing, language learning, dubbing alignment
|
|
23
23
|
- \`outreach-agent\` - AI outreach / drip-email funnel - reach a list of people with personalized, human-approved emails that auto-send on a schedule and a self-improving agent that learns from your edits
|
|
24
24
|
- \`paid-app\` - App that charges users money - SaaS subscription, paid membership, digital product store, "Pro" upgrade, paywalled content (Stripe one-time + subscriptions)
|
|
25
|
+
- \`notify-demo\` - App that sends push notifications / alerts / reminders to users' phones or desktops - web push, PWA notifications, "notify me when..." features
|
|
25
26
|
When unsure, default to \`web-simple\`. After adding the template, edit the generated files, then \`gipity deploy dev\`.
|
|
26
27
|
Only skip this on a build request if the user explicitly says not to.
|
|
27
28
|
|
|
@@ -40,7 +41,8 @@ Kits are reusable building blocks added to an existing app, not whole templates
|
|
|
40
41
|
- \`gipity add views\` - Generic UI over records-kit objects: sortable/filterable table with full-text search, create/edit/delete forms with type-appropriate widgets, kanban board with drag-to-update. Renders entirely from the field registry - zero per-object UI code. Requires the records kit.
|
|
41
42
|
- \`gipity add agent-api\` - Make your app agent-operable: named API keys (kit_api_keys) let agents and scripts write through the records kit's single write path with AGENT/API actor attribution - machine writes land on the same audit spine as human edits. Requires the records kit.
|
|
42
43
|
- \`gipity add contacts\` - Source-agnostic contact data layer for lead-gen/CRM apps: import people from LinkedIn CSV + Gmail + pasted lists, resolve duplicates into one person while keeping EVERY value from every source with provenance (multi-valued attributes, never overwrites). Exact email/URL auto-merge; fuzzy name+company goes to a human merge-review queue (reversible). Re-imports detect job changes and emit signals. User-definable tags, full-text search, and a transactional event spine. Ships backend functions + migrations. Needs a database (web-fullstack/api template).
|
|
43
|
-
- \`gipity add stripe\` - Charge your app's end-users for one-time purchases and subscriptions via Stripe. Owner connects their own Stripe account through Gipity-hosted onboarding (no API keys to paste); money lands in their account, Gipity takes a small platform fee. Ships a buy-button / pricing component, a subscription-status helper for gating UI, a webhook-verified fulfillment function, and the payments/subscriptions tables. The platform brokers checkout + signature-verified webhooks. Needs a database (web-fullstack/api template)
|
|
44
|
+
- \`gipity add stripe\` - Charge your app's end-users for one-time purchases and subscriptions via Stripe. Owner connects their own Stripe account through Gipity-hosted onboarding (no API keys to paste); money lands in their account, Gipity takes a small platform fee. Ships a buy-button / pricing component, a subscription-status helper for gating UI, a webhook-verified fulfillment function, and the payments/subscriptions tables. The platform brokers checkout + signature-verified webhooks. Needs a database (web-fullstack/api template).
|
|
45
|
+
- \`gipity add notify\` - Web push notifications for any web app, including iOS home-screen web apps (iOS 16.4+). The platform owns the VAPID keys, encryption, and delivery — no keys to paste, no crypto, no server. Ships a <gipity-notify-button>, a service worker, and a PWA manifest; the device subscribes itself and self-heals stale subscriptions. Send from a function with the injected notify() service (one flat credit per send, owner-billed) or test with \`gipity notify test\`. Works in any template — no database required.`;
|
|
44
46
|
export const SKILLS_CONTENT = `# Gipity Integration
|
|
45
47
|
|
|
46
48
|
Gipity is the cloud platform your project runs on - hosting, databases, deployment, file storage, code execution, workflows, and monitoring. Gip is the cloud agent that runs on Gipity.
|
|
@@ -49,14 +51,14 @@ Prefer the cheapest option that works - CLI and sandbox are instant and free, ap
|
|
|
49
51
|
|
|
50
52
|
1. CLI commands (fast, no agent overhead). The \`gipity\` CLI covers add, deploy, db, fn, logs, browser, sync, memory, skill, email, and more. All commands support \`--json\`. You can send email yourself - \`gipity email send\` goes out as the agent from \`gipity@gipity.ai\` with no setup or API keys (\`gipity skill read email\`); don't build a \`mailto:\` workaround or reach for an SMTP library.
|
|
51
53
|
2. Cloud sandbox via \`gipity sandbox run\` - Docker container with pre-installed tools for media (ffmpeg, ImageMagick, sox), documents (pandoc, LibreOffice), and data (pandas, matplotlib, sqlite3). Run \`gipity skill read sandbox-tools\` for the full toolkit. No network from inside the sandbox - fetch what you need before sending it in.
|
|
52
|
-
3. App services - runtime HTTP endpoints your deployed app calls directly at \`https://a.gipity.ai/api/<PROJECT_GUID>/services/*\`. Available: LLM, TTS, image, sound, music, transcribe, video, file upload, realtime, location. Load the matching skill (\`app-llm\`, \`app-tts\`, etc.) before writing service code - they have the schemas, auth pattern, and common-mistake guards. For one-off generation during development, prefer \`gipity generate <image|video|speech|music>\` or \`gipity chat\`. \`gipity generate\` saves to a generic file in the current directory by default (e.g. \`./generated.png\`) - pass \`-o <path>\` to write it straight into your source tree so it deploys (e.g. \`gipity generate image "hero banner" -o src/assets/images/hero.png\`) instead of generating at cwd and moving it.
|
|
54
|
+
3. App services - runtime HTTP endpoints your deployed app calls directly at \`https://a.gipity.ai/api/<PROJECT_GUID>/services/*\`. Available: LLM, TTS, image, sound, music, transcribe, video, file upload, realtime, location, push notifications (Gipity Notify - \`gipity add notify\`, send from a function with the injected \`notify()\`; see \`app-notify\`). Load the matching skill (\`app-llm\`, \`app-tts\`, etc.) before writing service code - they have the schemas, auth pattern, and common-mistake guards. For one-off generation during development, prefer \`gipity generate <image|video|speech|music>\` or \`gipity chat\`. \`gipity generate\` saves to a generic file in the current directory by default (e.g. \`./generated.png\`) - pass \`-o <path>\` to write it straight into your source tree so it deploys (e.g. \`gipity generate image "hero banner" -o src/assets/images/hero.png\`) instead of generating at cwd and moving it.
|
|
53
55
|
4. Delegate to Gip (\`gipity chat "<task>"\`) - only when the work genuinely needs agent reasoning or a tool not in the CLI, sandbox, or app services. Required for: Twitter/X search, Gmail, calendar, push notifications, video understanding, audio source isolation, cross-model second opinions, multi-step orchestration. Don't use \`gipity chat\` for anything the sandbox can do - it's slower and burns tokens.
|
|
54
56
|
|
|
55
57
|
You are the developer. Write files in this directory - the Gipity Claude Code plugin's hooks auto-sync them to Gipity. Don't run \`npm install\`, \`npm start\`, \`node\`, or \`python\` locally; there is no local runtime. Code runs in the Gipity sandbox.
|
|
56
58
|
|
|
57
59
|
## Use first-party services before reaching outside
|
|
58
60
|
|
|
59
|
-
Gipity ships first-party services for what apps usually pull from third parties - auth, location/geocoding, LLM, image/audio/video generation, transcription, file uploads, realtime, and email (send as the agent via \`gipity email send\`, or from a deployed app via a workflow \`notify\` step - no SMTP/SendGrid/Nodemailer). Before calling an external API or adding an npm package for one of these, check \`gipity skill list\` for a match. First-party services need no API keys, cost less, and keep data in-house. Reach outside only when the catalog has no equivalent - and say so when you do.
|
|
61
|
+
Gipity ships first-party services for what apps usually pull from third parties - auth, location/geocoding, LLM, image/audio/video generation, transcription, file uploads, realtime, web push notifications (Gipity Notify - no VAPID keys, no Firebase/OneSignal; works on iOS home-screen web apps), and email (send as the agent via \`gipity email send\`, or from a deployed app via a workflow \`notify\` step - no SMTP/SendGrid/Nodemailer). Before calling an external API or adding an npm package for one of these, check \`gipity skill list\` for a match. First-party services need no API keys, cost less, and keep data in-house. Reach outside only when the catalog has no equivalent - and say so when you do.
|
|
60
62
|
|
|
61
63
|
## Don't guess Gipity facts - look them up
|
|
62
64
|
|
|
@@ -145,6 +147,7 @@ App services skills (load before calling \`/services/*\` endpoints):
|
|
|
145
147
|
- \`app-image\` - text-to-image only (no input image / editing); providers, sizes, aspect ratios
|
|
146
148
|
- \`app-llm\` - chat completions, streaming, image input
|
|
147
149
|
- \`app-location\` - user location & reverse geocoding for deployed apps (first-party - no third-party geocoder)
|
|
150
|
+
- \`app-notify\` - web push notifications for deployed apps (incl. iOS home-screen web apps) - notify kit + injected notify() service, platform owns the keys
|
|
148
151
|
- \`app-payments\` - charge end-users real money - Stripe one-time purchases & subscriptions, via the stripe kit (gipity add stripe)
|
|
149
152
|
- \`app-realtime\` - Gipity Realtime rooms, relay vs state
|
|
150
153
|
- \`app-tts\` - voices, multi-speaker, languages
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gipity",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.405",
|
|
4
4
|
"description": "The full-stack platform tuned for AI agents. Database, storage, auth, functions, deploy, and drop-in kits - all agent-tuned. Pair with Claude Code or use standalone.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"gipity": "dist/updater/shim.js",
|