@jini-ai/agent-plugins 0.6.23 → 0.7.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/CHANGELOG.md +47 -0
- package/README.md +13 -0
- package/calendly/exports/booking-calendar.css +7 -0
- package/calendly/exports/booking-calendar.html +5 -0
- package/calendly/mcp.json +10 -0
- package/calendly/plugin.json +47 -0
- package/calendly/skills/calendly/SKILL.md +27 -0
- package/charts-echarts/plugin.json +2 -2
- package/charts-recharts/plugin.json +2 -2
- package/cloudflare/lib/cms-forms.mjs +57 -0
- package/cloudflare/lib/forms.mjs +78 -18
- package/cloudflare/lib/target.mjs +17 -4
- package/cloudflare/plugin.json +2 -2
- package/cloudflare/skills/cloudflare/SKILL.md +4 -4
- package/cloudflare/skills/cloudflare/references/workers.md +4 -4
- package/cloudflare/worker/forms-receiver.mjs +81 -41
- package/cloudflare/worker/portable-validation.mjs +220 -0
- package/commerce/plugin.json +17 -0
- package/commerce/skills/commerce/SKILL.md +23 -0
- package/composio/mcp.json +1 -1
- package/composio/plugin.json +2 -2
- package/composio/skills/composio/SKILL.md +4 -4
- package/core/commerce-server.d.ts +2 -0
- package/core/commerce-server.mjs +2 -0
- package/dist/admin-surfaces/connections/connections.d.ts +35 -0
- package/dist/admin-surfaces/connections/connections.js +135 -0
- package/dist/admin-surfaces/connections/index.d.ts +3 -0
- package/dist/admin-surfaces/connections/index.js +2 -0
- package/dist/admin-surfaces/connections/ports.d.ts +110 -0
- package/dist/admin-surfaces/connections/ports.js +2 -0
- package/dist/admin-surfaces/index.d.ts +2 -0
- package/dist/admin-surfaces/index.js +1 -0
- package/dist/admin-surfaces/plugin-state-persistence.d.ts +27 -0
- package/dist/admin-surfaces/plugin-state-persistence.js +2 -0
- package/dist/admin-surfaces/plugin-state.d.ts +51 -0
- package/dist/admin-surfaces/plugin-state.js +106 -0
- package/dist/connect/access-token-tool.d.ts +240 -0
- package/dist/connect/access-token-tool.js +213 -0
- package/dist/connect/apply-connect-defaults.d.ts +91 -0
- package/dist/connect/apply-connect-defaults.js +113 -0
- package/dist/connect/apply-tool-renames.d.ts +72 -0
- package/dist/connect/apply-tool-renames.js +105 -0
- package/dist/connect/connect-card-ui.d.ts +143 -0
- package/dist/connect/connect-card-ui.js +106 -0
- package/dist/connect/connect-destination.d.ts +35 -0
- package/dist/connect/connect-destination.js +45 -0
- package/dist/connect/connect-sign-in-wait.d.ts +31 -0
- package/dist/connect/connect-sign-in-wait.js +21 -0
- package/dist/connect/connect-tool.d.ts +314 -0
- package/dist/connect/connect-tool.js +431 -0
- package/dist/connect/connection-status.d.ts +33 -0
- package/dist/connect/connection-status.js +63 -0
- package/dist/connect/credential-cards.d.ts +15 -0
- package/dist/connect/credential-cards.js +49 -0
- package/dist/connect/credential-save-tool.d.ts +45 -0
- package/dist/connect/credential-save-tool.js +156 -0
- package/dist/connect/enable-access.d.ts +67 -0
- package/dist/connect/enable-access.js +74 -0
- package/dist/connect/executable/approval.d.ts +58 -0
- package/dist/connect/executable/approval.js +40 -0
- package/dist/connect/executable/host-capabilities.d.ts +76 -0
- package/dist/connect/executable/host-capabilities.js +100 -0
- package/dist/connect/executable/index.d.ts +10 -0
- package/dist/connect/executable/index.js +9 -0
- package/dist/connect/executable/ports.d.ts +189 -0
- package/dist/connect/executable/ports.js +2 -0
- package/dist/connect/executable/register.d.ts +21 -0
- package/dist/connect/executable/register.js +125 -0
- package/dist/connect/federate-mcp.d.ts +190 -0
- package/dist/connect/federate-mcp.js +440 -0
- package/dist/connect/grant-signed-in-defaults.d.ts +96 -0
- package/dist/connect/grant-signed-in-defaults.js +100 -0
- package/dist/connect/import-access-token.d.ts +114 -0
- package/dist/connect/import-access-token.js +103 -0
- package/dist/connect/index.d.ts +19 -0
- package/dist/connect/index.js +19 -0
- package/dist/connect/plugin-credential-card.d.ts +46 -0
- package/dist/connect/plugin-credential-card.js +63 -0
- package/dist/connect/plugin-host/index.d.ts +203 -0
- package/dist/connect/plugin-host/index.js +153 -0
- package/dist/connect/ports.d.ts +74 -0
- package/dist/connect/ports.js +2 -0
- package/dist/connect/switch-on-saved-token.d.ts +48 -0
- package/dist/connect/switch-on-saved-token.js +20 -0
- package/dist/connect/token-sign-in.d.ts +51 -0
- package/dist/connect/token-sign-in.js +43 -0
- package/dist/core/identity-namespace.d.ts +39 -0
- package/dist/core/identity-namespace.js +61 -3
- package/dist/folder-zip-node.js +3 -1
- package/dist/lifecycle/automatic-use.d.ts +12 -7
- package/dist/lifecycle/automatic-use.js +37 -28
- package/dist/lifecycle/capability-projection.js +5 -1
- package/dist/lifecycle/contribution-loader.d.ts +2 -7
- package/dist/lifecycle/contribution-types.d.ts +8 -0
- package/dist/lifecycle/contribution-types.js +2 -0
- package/dist/lifecycle/credential-card-metadata.d.ts +23 -0
- package/dist/lifecycle/credential-card-metadata.js +184 -0
- package/dist/lifecycle/exports.d.ts +11 -0
- package/dist/lifecycle/exports.js +64 -3
- package/dist/lifecycle/host-tools/identity.d.ts +38 -0
- package/dist/lifecycle/host-tools/identity.js +58 -0
- package/dist/lifecycle/host-tools/index.d.ts +20 -0
- package/dist/lifecycle/host-tools/index.js +20 -0
- package/dist/lifecycle/host-tools/memory-tools.d.ts +22 -0
- package/dist/lifecycle/host-tools/memory-tools.js +63 -0
- package/dist/lifecycle/host-tools/ports.d.ts +121 -0
- package/dist/lifecycle/host-tools/ports.js +2 -0
- package/dist/lifecycle/host-tools/provider-status-tool.d.ts +88 -0
- package/dist/lifecycle/host-tools/provider-status-tool.js +45 -0
- package/dist/lifecycle/host-tools/search-tool.d.ts +74 -0
- package/dist/lifecycle/host-tools/search-tool.js +282 -0
- package/dist/lifecycle/host-tools/skill-tool.d.ts +219 -0
- package/dist/lifecycle/host-tools/skill-tool.js +482 -0
- package/dist/lifecycle/host-tools/write-note-tool.d.ts +22 -0
- package/dist/lifecycle/host-tools/write-note-tool.js +47 -0
- package/dist/lifecycle/index.d.ts +2 -1
- package/dist/lifecycle/install.js +2 -1
- package/dist/lifecycle/installed-package-index.js +5 -8
- package/dist/lifecycle/mail/adapter-descriptors.d.ts +78 -0
- package/dist/lifecycle/mail/adapter-descriptors.js +155 -0
- package/dist/lifecycle/mail/catalog.d.ts +116 -0
- package/dist/lifecycle/mail/catalog.js +72 -0
- package/dist/lifecycle/mail/configuration.d.ts +25 -0
- package/dist/lifecycle/mail/configuration.js +62 -0
- package/dist/lifecycle/mail/contribution.d.ts +89 -0
- package/dist/lifecycle/mail/contribution.js +115 -0
- package/dist/lifecycle/mail/host-mailer.d.ts +24 -0
- package/dist/lifecycle/mail/host-mailer.js +10 -0
- package/dist/lifecycle/mail/index.d.ts +16 -0
- package/dist/lifecycle/mail/index.js +16 -0
- package/dist/lifecycle/mail/selection.d.ts +40 -0
- package/dist/lifecycle/mail/selection.js +86 -0
- package/dist/lifecycle/manifest.d.ts +7 -2
- package/dist/lifecycle/manifest.js +32 -9
- package/dist/lifecycle/metadata.d.ts +31 -0
- package/dist/lifecycle/metadata.js +80 -0
- package/dist/lifecycle/persistent-state.js +2 -1
- package/dist/lifecycle/ports.d.ts +2 -0
- package/dist/lifecycle/resolve-agent-plugin-refs.d.ts +2 -1
- package/dist/lifecycle/resolve-agent-plugin-refs.js +14 -8
- package/dist/lifecycle/search-projection.d.ts +3 -4
- package/dist/lifecycle/search-projection.js +5 -7
- package/dist/lifecycle/search.js +3 -2
- package/fly/plugin.json +5 -5
- package/fly/skills/fly/SKILL.md +1 -1
- package/formspree/plugin.json +7 -0
- package/formspree/skills/formspree/SKILL.md +11 -0
- package/github/plugin.json +2 -2
- package/github/skills/github/SKILL.md +28 -28
- package/github/skills/github/references/actions.md +8 -8
- package/github/skills/github/references/auth-and-tokens.md +7 -7
- package/github/skills/github/references/repo-files.md +5 -5
- package/github/skills/github/references/site-backup.md +16 -16
- package/github/skills/github/references/source-control.md +17 -17
- package/github-pages/plugin.json +2 -2
- package/github-pages/skills/github-pages/SKILL.md +3 -3
- package/google-forms/plugin.json +7 -0
- package/google-forms/skills/google-forms/SKILL.md +15 -0
- package/google-login/plugin.json +3 -3
- package/google-login/skills/google-login/SKILL.md +17 -60
- package/google-workspace/plugin.json +6 -6
- package/google-workspace/skills/google-workspace/references/connection.md +1 -1
- package/google-workspace/skills/google-workspace/references/form-delivery.md +4 -4
- package/google-workspace/tovu-admin-surfaces.json +5 -5
- package/higgsfield-media/plugin.json +5 -5
- package/higgsfield-media/skills/higgsfield-media/SKILL.md +31 -33
- package/higgsfield-media/skills/higgsfield-media/references/failure-modes.md +7 -7
- package/higgsfield-media/skills/higgsfield-media/references/models-and-plan-gates.md +3 -3
- package/jev/plugin.json +2 -2
- package/langfuse/plugin.json +2 -2
- package/meilisearch/plugin.json +2 -2
- package/meilisearch/skills/meilisearch/SKILL.md +1 -1
- package/netlify/plugin.json +2 -2
- package/netlify/skills/netlify/SKILL.md +3 -3
- package/opentelemetry/plugin.json +2 -2
- package/opentelemetry/skills/opentelemetry/SKILL.md +7 -7
- package/package.json +92 -14
- package/posthog/plugin.json +2 -2
- package/posthog/skills/posthog/SKILL.md +7 -7
- package/railway/plugin.json +3 -3
- package/railway/skills/railway/SKILL.md +10 -11
- package/render/plugin.json +3 -3
- package/render/skills/render/SKILL.md +7 -8
- package/resend/NOTES.md +2 -2
- package/resend/mcp.json +1 -1
- package/resend/plugin.json +5 -5
- package/resend/skills/resend/SKILL.md +13 -13
- package/s3-compatible/plugin.json +2 -2
- package/s3-compatible/skills/s3-compatible/SKILL.md +4 -4
- package/sentry/plugin.json +2 -2
- package/sentry/skills/sentry/SKILL.md +7 -7
- package/shopify/plugin.json +2 -2
- package/site-compliance/plugin.json +2 -2
- package/site-compliance/skills/site-compliance/SKILL.md +3 -3
- package/site-compliance/skills/site-compliance/references/gdpr-eu-uk.md +1 -1
- package/site-import/plugin.json +2 -2
- package/slide-design/plugin.json +2 -2
- package/software-engineering/LICENSE +201 -0
- package/software-engineering/NOTICE +9 -0
- package/software-engineering/README.md +89 -0
- package/software-engineering/plugin.json +24 -0
- package/software-engineering/skills/software-engineering/SKILL.md +33 -0
- package/software-engineering/skills/software-engineering/references/debugging.md +54 -0
- package/software-engineering/skills/software-engineering/references/implementation.md +27 -0
- package/software-engineering/skills/software-engineering/references/planning.md +27 -0
- package/software-engineering/skills/software-engineering/references/prototyping.md +14 -0
- package/software-engineering/skills/software-engineering/references/security.md +47 -0
- package/software-engineering/skills/software-engineering/references/verification.md +53 -0
- package/stripe/plugin.json +2 -2
- package/supabase/mcp.json +4 -4
- package/supabase/plugin.json +3 -3
- package/supabase/skills/supabase/SKILL.md +8 -8
- package/supabase/skills/supabase/references/failure-modes.md +5 -5
- package/ui-ux-design/plugin.json +2 -2
- package/vercel/plugin.json +2 -2
- package/vercel/skills/vercel/SKILL.md +3 -3
- package/wordpress/plugin.json +2 -2
- package/wordpress/skills/wordpress/SKILL.md +3 -3
- package/wordpress/skills/wordpress/references/free-site-redirect.md +2 -2
- package/wordpress/skills/wordpress/references/subdomain.md +5 -5
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { FORM_SCHEMA_HASH_FIELD, matchesFormSchemaHash, resolvePortableFormField } from "./portable-validation.mjs";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Form submissions receiver, uploaded as `receiver.mjs` beside the site's static assets.
|
|
3
|
-
* Runs inside
|
|
5
|
+
* Runs inside Cloudflare Workers with the bundled portable validator and Web platform APIs only.
|
|
4
6
|
* Forms and full validation belong to the host; this receiver enforces its published supported
|
|
5
7
|
* subset and rejects unsupported fields at publish time.
|
|
6
8
|
* Never log answers, IPs or the management secret: only fixed reason codes.
|
|
@@ -8,7 +10,7 @@
|
|
|
8
10
|
export const LIMITS = Object.freeze({ maxBodyBytes: 64 * 1024, maxFields: 100, maxValueLength: 5000, ratePerWindow: 5, windowSeconds: 60, maxPage: 100 });
|
|
9
11
|
/** The host's reserved names: the honeypot and the double-submit attempt token. Never stored. */
|
|
10
12
|
const HONEYPOT = '_hp';
|
|
11
|
-
const RESERVED = new Set([HONEYPOT, '_attempt']);
|
|
13
|
+
const RESERVED = new Set([HONEYPOT, '_attempt', FORM_SCHEMA_HASH_FIELD]);
|
|
12
14
|
/** The host's existing result query names (`form`, `form_status`), so a returning page reads one vocabulary. */
|
|
13
15
|
const RESULT_KEYS = ['form', 'form_status', 'form_errors', 'form_retry_after'];
|
|
14
16
|
const SUBMIT_PATH = /^\/forms\/([a-z0-9][a-z0-9-]{0,99})\/submit\/?$/;
|
|
@@ -70,19 +72,35 @@ export async function handleSubmit({ request, env, manifest, slug }, { now = ()
|
|
|
70
72
|
if (!form) return errorPage({ status: 404, message: 'This form is not available.', back });
|
|
71
73
|
const parsed = await readFields({ request });
|
|
72
74
|
if (parsed.error) return errorPage({ ...parsed.error, back });
|
|
73
|
-
|
|
75
|
+
const stale = schemaRetryResponse({ form, fields: parsed.fields, back });
|
|
76
|
+
if (stale) return stale;
|
|
77
|
+
if (hasHoneypotValue({ fields: parsed.fields })) return successRedirect({ request, form });
|
|
74
78
|
const checked = checkFields({ form, fields: parsed.fields });
|
|
75
79
|
if (checked.error) return errorPage({ status: 400, message: checked.error, back });
|
|
76
|
-
const refused = await storeSubmission({ db: env.TOVU_FORMS, slug, answers: checked.answers, ip: request.headers.get('CF-Connecting-IP'), secret: env.TOVU_FORMS_SECRET, back }, { now, randomId });
|
|
80
|
+
const refused = await storeSubmission({ db: env.TOVU_FORMS, slug, answers: checked.answers, evidence: form.evidence, ip: request.headers.get('CF-Connecting-IP'), secret: env.TOVU_FORMS_SECRET, back }, { now, randomId });
|
|
77
81
|
return refused ?? successRedirect({ request, form });
|
|
78
82
|
}
|
|
79
83
|
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
function hasHoneypotValue({ fields }, _options = {}) {
|
|
85
|
+
return (fields.get(HONEYPOT) ?? []).some(value => value.trim() !== '');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Refuse stale metadata before any field validation or storage; legacy pages stay compatible.
|
|
89
|
+
* @complexity O(digest length), no I/O or answer retention. */
|
|
90
|
+
function schemaRetryResponse({ form, fields, back }, _options = {}) {
|
|
91
|
+
const hashes = fields.get(FORM_SCHEMA_HASH_FIELD);
|
|
92
|
+
const current = matchesFormSchemaHash({ present: fields.has(FORM_SCHEMA_HASH_FIELD), submittedHash: hashes?.length === 1 ? hashes[0] : hashes, schemaHash: form.evidence?.schemaHash });
|
|
93
|
+
return current ? null : errorPage({ status: 409, message: 'This form changed while you were filling it in. Your form has not been sent. Please return to the updated form and review your answers.', back });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Rate window, then insert. Returns the error page to send, or null once the row is stored.
|
|
97
|
+
* @complexity O(answer + evidence bytes) time/space; one rate batch and one insert.
|
|
98
|
+
* @overallScore 98 — Minor: a failed insert still consumes its existing rate-window attempt. */
|
|
99
|
+
async function storeSubmission({ db, slug, answers, evidence, ip, secret, back }, { now, randomId }) {
|
|
82
100
|
try {
|
|
83
101
|
if (!await withinRate({ db, key: await rateKey({ slug, ip, secret }), nowMs: now() })) return errorPage({ status: 429, message: 'Too many submissions. Wait a minute, then try again.', back });
|
|
84
102
|
await db.prepare('INSERT INTO submissions (id, form_slug, answers_json, submitted_at, ip) VALUES (?, ?, ?, ?, ?)')
|
|
85
|
-
.bind(randomId(), slug, JSON.stringify(answers), new Date(now()).toISOString(), null).run();
|
|
103
|
+
.bind(randomId(), slug, JSON.stringify(evidence ? ['@jini/form-submission/v1', answers, null, { ...evidence, capturedAt: new Date(now()).toISOString(), source: 'cloudflare' }] : answers), new Date(now()).toISOString(), null).run();
|
|
86
104
|
return null;
|
|
87
105
|
} catch {
|
|
88
106
|
console.error('FORMS_STORE_FAILED');
|
|
@@ -109,7 +127,7 @@ export async function readFields({ request }, _options = {}) {
|
|
|
109
127
|
function entriesError({ entries }, _options = {}) {
|
|
110
128
|
if (!entries) return { status: 400, message: 'The submission could not be read.' };
|
|
111
129
|
if (entries.length > LIMITS.maxFields) return { status: 413, message: 'The submission has too many fields.' };
|
|
112
|
-
if (entries.some(([, value]) => typeof value !== 'string')) return { status: 400, message: 'File uploads are not accepted by this form.' };
|
|
130
|
+
if (entries.some(([name, value]) => name !== FORM_SCHEMA_HASH_FIELD && typeof value !== 'string')) return { status: 400, message: 'File uploads are not accepted by this form.' };
|
|
113
131
|
return null;
|
|
114
132
|
}
|
|
115
133
|
|
|
@@ -134,55 +152,68 @@ async function multipartEntries({ bytes, type }, _options = {}) {
|
|
|
134
152
|
catch { return null; }
|
|
135
153
|
}
|
|
136
154
|
|
|
137
|
-
/**
|
|
138
|
-
* @
|
|
155
|
+
/** Use the portable live validation owner; published rules and accepted normalization stay identical.
|
|
156
|
+
* @complexity O(fields * (value bytes + options)) time/space, bounded by request/manifest limits.
|
|
157
|
+
* @overallScore 100 */
|
|
139
158
|
export function checkFields({ form, fields }, _options = {}) {
|
|
140
159
|
const known = new Map(form.fields.map(field => [field.name, field]));
|
|
141
160
|
const unknown = [...fields.keys()].find(name => !RESERVED.has(name) && !known.has(name));
|
|
142
161
|
if (unknown !== undefined) return { error: `The field "${unknown}" is not part of this form.` };
|
|
143
162
|
const answers = {};
|
|
144
163
|
for (const field of form.fields) {
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
if (values) answers[field.name] = field.multiple ? values : values[0];
|
|
164
|
+
const result = receiveField({ field, values: fields.get(field.name) });
|
|
165
|
+
if (result.error) return { error: result.error };
|
|
166
|
+
if (result.kind === 'accepted') Object.defineProperty(answers, field.name, { value: result.value, enumerable: true });
|
|
149
167
|
}
|
|
150
168
|
return { answers };
|
|
151
169
|
}
|
|
152
170
|
|
|
153
|
-
/**
|
|
154
|
-
*
|
|
155
|
-
function
|
|
171
|
+
/** Published v1 manifests with no explicit type retain their text/multiple behavior.
|
|
172
|
+
* @complexity O(value bytes + options) time/space; no I/O. @overallScore 100 */
|
|
173
|
+
function receiveField({ field, values }, _options = {}) {
|
|
174
|
+
const error = receiveFieldProblem({ field, values });
|
|
175
|
+
if (error) return { error };
|
|
176
|
+
if (!field.type && field.multiple) return receiveLegacyMultiple({ field, values });
|
|
177
|
+
const value = field.multiple ? values : values?.[0];
|
|
178
|
+
const resolved = resolvePortableFormField({ field: receiverDescriptor({ field, value }), value });
|
|
179
|
+
return resolved.kind === 'rejected' ? { error: fieldError({ field, reason: resolved.reason }) } : resolved;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** Reject unsupported rules and repeated scalars before resolving a value.
|
|
183
|
+
* @complexity O(1) time/space; no I/O. @overallScore 100 */
|
|
184
|
+
function receiveFieldProblem({ field, values }, _options = {}) {
|
|
156
185
|
if (field.validationUnsupported || field.type === 'file') return `"${field.name}" cannot be received here. Contact the site owner.`;
|
|
157
|
-
if (!field.multiple && values
|
|
158
|
-
|
|
159
|
-
if (field.type === 'checkbox' || field.type === 'toggle') return checkboxProblem({ field, values });
|
|
160
|
-
return textFieldProblem({ field, values });
|
|
186
|
+
if (!field.multiple && values?.length > 1) return `"${field.name}" was sent more than once.`;
|
|
187
|
+
return null;
|
|
161
188
|
}
|
|
162
189
|
|
|
163
|
-
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return
|
|
190
|
+
/** Adapt published code-point caps to the native validator's UTF-16 units.
|
|
191
|
+
* @complexity O(value bytes + options) time/space; no I/O. @overallScore 100 */
|
|
192
|
+
function receiverDescriptor({ field, value }, _options = {}) {
|
|
193
|
+
// Published text caps count Unicode code points. The shared validator counts UTF-16 units,
|
|
194
|
+
// so express the same cap in its units without changing or truncating the submitted answer.
|
|
195
|
+
const maxLength = (field.maxLength ?? LIMITS.maxValueLength) + (typeof value === 'string' ? value.length - [...value].length : 0);
|
|
196
|
+
return { ...field, maxLength, type: field.type ?? 'text', id: field.name, label: field.label ?? field.name,
|
|
197
|
+
...(field.options ? { options: field.options.map(value => ({ value, label: value })) } : {}) };
|
|
170
198
|
}
|
|
171
199
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
200
|
+
/** Preserve old untyped manifests without inventing a choice allowlist.
|
|
201
|
+
* @complexity O(total value bytes) time/space; no I/O. @overallScore 100 */
|
|
202
|
+
function receiveLegacyMultiple({ field, values }, _options = {}) {
|
|
203
|
+
if (!values?.length) return field.required ? { error: fieldError({ field, reason: 'required' }) } : { kind: 'absent' };
|
|
204
|
+
for (const value of values) {
|
|
205
|
+
const result = resolvePortableFormField({ field: receiverDescriptor({ field: { ...field, type: 'text' }, value }), value });
|
|
206
|
+
if (result.kind === 'rejected') return { error: fieldError({ field, reason: result.reason }) };
|
|
207
|
+
}
|
|
208
|
+
return { kind: 'accepted', value: values };
|
|
175
209
|
}
|
|
176
210
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
function
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
const allowed = new Set(field.options);
|
|
184
|
-
if (new Set(values).size !== values.length || values.some(value => !allowed.has(value))) return `"${field.name}" contains an unavailable choice.`;
|
|
185
|
-
return null;
|
|
211
|
+
/** Map bounded validator reasons to the receiver's visitor-facing error vocabulary.
|
|
212
|
+
* @complexity O(reason length) time/space; no I/O. @overallScore 100 */
|
|
213
|
+
function fieldError({ field, reason }, _options = {}) {
|
|
214
|
+
const descriptions = { required: 'is required', too_long: `is longer than ${field.maxLength ?? LIMITS.maxValueLength} characters`,
|
|
215
|
+
too_short: 'is too short', invalid_option: 'contains an unavailable choice', invalid_email: 'must be an email address' };
|
|
216
|
+
return `"${field.name}" ${descriptions[reason] ?? `has an invalid value (${reason.replaceAll('_', ' ')})`}.`;
|
|
186
217
|
}
|
|
187
218
|
|
|
188
219
|
/** Secret-salted short-lived pseudonyms prevent offline IPv4 enumeration; no raw IP persists. */
|
|
@@ -265,10 +296,19 @@ export async function listPending({ env, url }, _options = {}) {
|
|
|
265
296
|
const after = Math.max(0, Number.parseInt(url.searchParams.get('after') ?? '0', 10) || 0);
|
|
266
297
|
const limit = Math.min(LIMITS.maxPage, Math.max(1, Number.parseInt(url.searchParams.get('limit') ?? '50', 10) || 50));
|
|
267
298
|
const { results = [] } = await env.TOVU_FORMS.prepare('SELECT seq, id, form_slug, answers_json, submitted_at FROM submissions WHERE pulled_at IS NULL AND seq > ? ORDER BY seq LIMIT ?').bind(after, limit).all();
|
|
268
|
-
const items = results.map(row => ({
|
|
299
|
+
const items = results.map(row => pendingRow({ row }));
|
|
269
300
|
return json({ body: { items, nextAfter: items.length ? items[items.length - 1].seq : after, hasMore: items.length === limit } });
|
|
270
301
|
}
|
|
271
302
|
|
|
303
|
+
/** Backward-compatible answer JSON; new rows carry captured evidence outside visitor answers.
|
|
304
|
+
* @complexity O(stored JSON bytes) time/space; no I/O. @overallScore 100 */
|
|
305
|
+
function pendingRow({ row }, _options = {}) {
|
|
306
|
+
const stored = JSON.parse(row.answers_json);
|
|
307
|
+
const envelope = Array.isArray(stored) && stored[0] === '@jini/form-submission/v1';
|
|
308
|
+
return { seq: row.seq, id: row.id, formSlug: row.form_slug, answers: envelope ? stored[1] : stored,
|
|
309
|
+
...(envelope && stored[3] ? { evidence: stored[3] } : {}), submittedAt: row.submitted_at, ip: null };
|
|
310
|
+
}
|
|
311
|
+
|
|
272
312
|
function validIds({ ids }, _options = {}) {
|
|
273
313
|
return Array.isArray(ids) && ids.length > 0 && ids.length <= LIMITS.maxPage && ids.every(id => typeof id === 'string' && id.length > 0 && id.length <= 64);
|
|
274
314
|
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// ../cms/dist/forms/portable-validation.js
|
|
2
|
+
var EMAIL_PATTERN = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
3
|
+
function isValidFormEmail({ value }, _optional = {}) {
|
|
4
|
+
return EMAIL_PATTERN.exec(value)?.[0] === value;
|
|
5
|
+
}
|
|
6
|
+
var accepted = (value) => ({ kind: "accepted", value });
|
|
7
|
+
var rejected = (reason) => ({ kind: "rejected", reason });
|
|
8
|
+
var NUMBER = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
9
|
+
var fullMatch = (pattern, value) => pattern.exec(value)?.[0] === value;
|
|
10
|
+
var absent = { kind: "absent" };
|
|
11
|
+
var blank = (field) => field.required ? rejected("required") : absent;
|
|
12
|
+
var outcome = (reason, value) => reason === void 0 ? accepted(value) : rejected(reason);
|
|
13
|
+
function textLengthViolation(field, value) {
|
|
14
|
+
if (value.length > (field.maxLength ?? 5e3))
|
|
15
|
+
return "too_long";
|
|
16
|
+
return value !== "" && value.length < (field.minLength ?? Number(field.attributes?.minlength ?? 0)) ? "too_short" : void 0;
|
|
17
|
+
}
|
|
18
|
+
function textPatternViolation(field, value) {
|
|
19
|
+
const pattern = field.pattern ?? field.attributes?.pattern;
|
|
20
|
+
if (value === "" || pattern === void 0)
|
|
21
|
+
return void 0;
|
|
22
|
+
return isSafeFieldPattern({ pattern }) && fullMatch(new RegExp(`^(?:${pattern})$`, "u"), value) ? void 0 : "pattern_mismatch";
|
|
23
|
+
}
|
|
24
|
+
function textValue({ field, value }, _optional = {}) {
|
|
25
|
+
if (typeof value !== "string")
|
|
26
|
+
return rejected("must be a string");
|
|
27
|
+
if (field.required && value.trim() === "")
|
|
28
|
+
return rejected("required");
|
|
29
|
+
return outcome(textLengthViolation(field, value) ?? textPatternViolation(field, value), value);
|
|
30
|
+
}
|
|
31
|
+
var formattedText = (isFormatted, reason) => ({ field, value }) => {
|
|
32
|
+
const result = textValue({ field, value });
|
|
33
|
+
if (result.kind !== "accepted" || value === "")
|
|
34
|
+
return result;
|
|
35
|
+
return isFormatted(value) ? result : rejected(reason);
|
|
36
|
+
};
|
|
37
|
+
var emailValue = formattedText((value) => isValidFormEmail({ value }), "invalid_email");
|
|
38
|
+
var phoneValue = formattedText((value) => fullMatch(/^\+?[0-9() .-]{3,50}$/, value) && /\d/.test(value), "invalid_phone");
|
|
39
|
+
function hasDottedHost(address, absolute) {
|
|
40
|
+
const authority = (absolute ? address.slice(address.indexOf("://") + 3) : address).split(/[/?#]/, 1)[0];
|
|
41
|
+
return authority.slice(authority.lastIndexOf("@") + 1).split(":", 1)[0].includes(".");
|
|
42
|
+
}
|
|
43
|
+
function parsesAsDomainUrl(href) {
|
|
44
|
+
try {
|
|
45
|
+
const labels = new URL(href).hostname.split(".");
|
|
46
|
+
return labels.length > 1 && labels.every((label) => /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(label));
|
|
47
|
+
} catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function isFormUrl(address) {
|
|
52
|
+
if (/[\s\\\x00-\x08\x0e-\x1f\x7f]/u.test(address))
|
|
53
|
+
return false;
|
|
54
|
+
if (fullMatch(/@[A-Za-z0-9._]{1,30}/, address))
|
|
55
|
+
return true;
|
|
56
|
+
const absolute = /^https?:\/\/[^/]/i.test(address);
|
|
57
|
+
if (!absolute && !fullMatch(/[^:/?#@]+(?::\d+)?(?:[/?#].*)?/, address))
|
|
58
|
+
return false;
|
|
59
|
+
return hasDottedHost(address, absolute) && parsesAsDomainUrl(absolute ? address : `https://${address}`);
|
|
60
|
+
}
|
|
61
|
+
var urlValue = formattedText(isFormUrl, "invalid_url");
|
|
62
|
+
function parseNativeNumber(value) {
|
|
63
|
+
const numericText = typeof value === "string" && value.length <= 100 && fullMatch(NUMBER, value);
|
|
64
|
+
if (typeof value !== "number" && !numericText)
|
|
65
|
+
return void 0;
|
|
66
|
+
const number = Number(value);
|
|
67
|
+
return Number.isFinite(number) ? number : void 0;
|
|
68
|
+
}
|
|
69
|
+
var nativeRangeBound = (field, bound) => field.type === "range" ? bound : void 0;
|
|
70
|
+
function isOnStep(field, { number, min }) {
|
|
71
|
+
const step = field.step ?? Number(field.attributes?.step ?? 1);
|
|
72
|
+
const units = (number - Number(min ?? 0)) / step;
|
|
73
|
+
return Number.isFinite(units) && Math.abs(units - Math.round(units)) <= 1e-8;
|
|
74
|
+
}
|
|
75
|
+
var numberBounds = (field) => ({
|
|
76
|
+
min: field.min ?? field.attributes?.min ?? nativeRangeBound(field, 0),
|
|
77
|
+
max: field.max ?? field.attributes?.max ?? nativeRangeBound(field, 100)
|
|
78
|
+
});
|
|
79
|
+
function numberBoundViolation(field, number) {
|
|
80
|
+
const { min, max } = numberBounds(field);
|
|
81
|
+
if (min !== void 0 && number < Number(min))
|
|
82
|
+
return "below_min";
|
|
83
|
+
if (max !== void 0 && number > Number(max))
|
|
84
|
+
return "above_max";
|
|
85
|
+
return isOnStep(field, { number, min }) ? void 0 : "step_mismatch";
|
|
86
|
+
}
|
|
87
|
+
function numberValue({ field, value }, _optional = {}) {
|
|
88
|
+
if (value === "")
|
|
89
|
+
return blank(field);
|
|
90
|
+
const number = parseNativeNumber(value);
|
|
91
|
+
if (number === void 0)
|
|
92
|
+
return rejected("invalid_number");
|
|
93
|
+
return outcome(numberBoundViolation(field, number), number);
|
|
94
|
+
}
|
|
95
|
+
function validDate(value) {
|
|
96
|
+
if (!fullMatch(/^\d{4}-\d{2}-\d{2}$/, value))
|
|
97
|
+
return false;
|
|
98
|
+
const [year, month, day] = value.split("-").map(Number);
|
|
99
|
+
if (!year || !month || !day)
|
|
100
|
+
return false;
|
|
101
|
+
const date = /* @__PURE__ */ new Date(`${value}T00:00:00Z`);
|
|
102
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() + 1 === month && date.getUTCDate() === day;
|
|
103
|
+
}
|
|
104
|
+
var validTime = (value) => fullMatch(/(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d{1,3})?)?/, value);
|
|
105
|
+
function temporalTimestamp(type, value) {
|
|
106
|
+
if (type === "date")
|
|
107
|
+
return Date.parse(`${value}T00:00:00Z`);
|
|
108
|
+
return Date.parse(type === "time" ? `1970-01-01T${value}Z` : `${value}Z`);
|
|
109
|
+
}
|
|
110
|
+
function isNativeTemporal(type, value) {
|
|
111
|
+
if (type === "date")
|
|
112
|
+
return validDate(value);
|
|
113
|
+
if (type === "time")
|
|
114
|
+
return validTime(value);
|
|
115
|
+
const [date, time, extra] = value.split("T");
|
|
116
|
+
return extra === void 0 && validDate(date) && time !== void 0 && validTime(time);
|
|
117
|
+
}
|
|
118
|
+
function temporalBoundViolation(field, value) {
|
|
119
|
+
const min = field.min ?? field.attributes?.min;
|
|
120
|
+
const max = field.max ?? field.attributes?.max;
|
|
121
|
+
const timestamp = temporalTimestamp(field.type, value);
|
|
122
|
+
if (min !== void 0 && timestamp < temporalTimestamp(field.type, String(min)))
|
|
123
|
+
return "below_min";
|
|
124
|
+
if (max !== void 0 && timestamp > temporalTimestamp(field.type, String(max)))
|
|
125
|
+
return "above_max";
|
|
126
|
+
return void 0;
|
|
127
|
+
}
|
|
128
|
+
function temporalValue({ field, value }, _optional = {}) {
|
|
129
|
+
if (typeof value !== "string" || value.length > 30)
|
|
130
|
+
return rejected("invalid_datetime");
|
|
131
|
+
if (value === "")
|
|
132
|
+
return blank(field);
|
|
133
|
+
if (!isNativeTemporal(field.type, value))
|
|
134
|
+
return rejected(`invalid_${field.type}`);
|
|
135
|
+
return outcome(temporalBoundViolation(field, value), value);
|
|
136
|
+
}
|
|
137
|
+
function singleChoice({ field, value }, _optional = {}) {
|
|
138
|
+
if (value === "")
|
|
139
|
+
return blank(field);
|
|
140
|
+
if (typeof value !== "string")
|
|
141
|
+
return rejected("must be a string");
|
|
142
|
+
return field.options?.some((option) => option.value === value) ? accepted(value) : rejected("invalid_option");
|
|
143
|
+
}
|
|
144
|
+
var isBoundedStringList = (values) => Array.isArray(values) && values.length <= 100 && values.every((item) => typeof item === "string");
|
|
145
|
+
function isUniqueOptionSubset(values, options) {
|
|
146
|
+
const allowed = new Set(options?.map((option) => option.value));
|
|
147
|
+
return new Set(values).size === values.length && values.every((item) => allowed.has(item));
|
|
148
|
+
}
|
|
149
|
+
function multipleChoice({ field, value }, _optional = {}) {
|
|
150
|
+
const values = typeof value === "string" ? [value] : value;
|
|
151
|
+
if (!isBoundedStringList(values))
|
|
152
|
+
return rejected("must be a string array");
|
|
153
|
+
if (field.required && values.length === 0)
|
|
154
|
+
return rejected("required");
|
|
155
|
+
return isUniqueOptionSubset(values, field.options) ? accepted([...values]) : rejected("invalid_option");
|
|
156
|
+
}
|
|
157
|
+
function booleanValue({ field, value }, _optional = {}) {
|
|
158
|
+
if (field.checkboxValue !== void 0) {
|
|
159
|
+
if (typeof value !== "string")
|
|
160
|
+
return rejected("must be a boolean");
|
|
161
|
+
return value === field.checkboxValue ? accepted(value) : rejected("invalid_option");
|
|
162
|
+
}
|
|
163
|
+
if (typeof value === "boolean")
|
|
164
|
+
return field.required && !value ? rejected("required") : accepted(value);
|
|
165
|
+
return value === "on" ? accepted(true) : rejected("must be a boolean");
|
|
166
|
+
}
|
|
167
|
+
function isSafeFieldPattern({ pattern }, _optional = {}) {
|
|
168
|
+
if (pattern.length > 300 || /[()|]|\\[1-9]|\\[pPkK]/.test(pattern))
|
|
169
|
+
return false;
|
|
170
|
+
const outsideClasses = pattern.replace(/\\./g, "x").replace(/\[[^\]]*\]/g, "x");
|
|
171
|
+
if ((outsideClasses.match(/[+*?]|\{/g) ?? []).length > 1 || /\.\*/.test(outsideClasses))
|
|
172
|
+
return false;
|
|
173
|
+
try {
|
|
174
|
+
new RegExp(`^(?:${pattern})$`, "u");
|
|
175
|
+
return true;
|
|
176
|
+
} catch {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
var portableFieldValidators = {
|
|
181
|
+
text: textValue,
|
|
182
|
+
textarea: textValue,
|
|
183
|
+
hidden: textValue,
|
|
184
|
+
password: textValue,
|
|
185
|
+
color: textValue,
|
|
186
|
+
email: emailValue,
|
|
187
|
+
phone: phoneValue,
|
|
188
|
+
tel: phoneValue,
|
|
189
|
+
url: urlValue,
|
|
190
|
+
number: numberValue,
|
|
191
|
+
range: numberValue,
|
|
192
|
+
date: temporalValue,
|
|
193
|
+
time: temporalValue,
|
|
194
|
+
datetime: temporalValue,
|
|
195
|
+
"datetime-local": temporalValue,
|
|
196
|
+
select: singleChoice,
|
|
197
|
+
radio: singleChoice,
|
|
198
|
+
"multi-select": multipleChoice,
|
|
199
|
+
"checkbox-group": multipleChoice,
|
|
200
|
+
checkbox: booleanValue,
|
|
201
|
+
toggle: booleanValue
|
|
202
|
+
};
|
|
203
|
+
function resolvePortableFormField({ field, value }, _optional = {}) {
|
|
204
|
+
if (value === void 0 || value === null)
|
|
205
|
+
return blank(field);
|
|
206
|
+
const validator = Object.hasOwn(portableFieldValidators, field.type) ? portableFieldValidators[field.type] : void 0;
|
|
207
|
+
return validator ? validator({ field, value }) : rejected("invalid_type");
|
|
208
|
+
}
|
|
209
|
+
var FORM_SCHEMA_HASH_FIELD = "_schemaHash";
|
|
210
|
+
function matchesFormSchemaHash({ present, submittedHash, schemaHash }, _optional = {}) {
|
|
211
|
+
return !present || typeof submittedHash === "string" && /^[a-f0-9]{64}$/.test(submittedHash) && submittedHash === schemaHash;
|
|
212
|
+
}
|
|
213
|
+
export {
|
|
214
|
+
FORM_SCHEMA_HASH_FIELD,
|
|
215
|
+
isSafeFieldPattern,
|
|
216
|
+
isValidFormEmail,
|
|
217
|
+
matchesFormSchemaHash,
|
|
218
|
+
portableFieldValidators,
|
|
219
|
+
resolvePortableFormField
|
|
220
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "commerce",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"description": "One-time catalog and member checkout using the host's configured payment provider. Disabled until the host activates and configures it.",
|
|
6
|
+
"author": "Jini",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"extensions": {
|
|
9
|
+
"jini": {
|
|
10
|
+
"id": "jini/commerce",
|
|
11
|
+
"displayName": "Commerce",
|
|
12
|
+
"summary": "Manage a catalog and accept one-time payments on a deployed HTTPS site.",
|
|
13
|
+
"provides": ["commerce"]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"keywords": ["commerce", "catalog", "checkout"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commerce
|
|
3
|
+
description: Set up the site's one-time catalog, check commerce readiness, and explain member checkout and settlement.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the host's commerce setup and status tools. Installing this plugin does not enable it or its payment provider. Ask for payment credentials only through the host's secure settings flow, never in chat.
|
|
7
|
+
|
|
8
|
+
For a host application, set up checkout in this order:
|
|
9
|
+
|
|
10
|
+
1. Enable Commerce and the selected payment provider through the existing plugin activation controls. Use provider status to discover the provider plugin id. Open its secure settings card through the host. For Stripe, save the merchant `accountId` and the selected mode's `test_secretKey`/`test_webhookSecret` or `live_secretKey`/`live_webhookSecret` in that human form. Never put these keys in tool arguments, general settings or chat.
|
|
11
|
+
2. Inspect settings definitions to inspect namespace `core.commerce`. Save its workspace `configuration` as a workspace setting: `{"namespace":"core.commerce","key":"configuration","scope":"workspace","value":{"providerId":"stripe","accountId":"<matching merchant account id>","mode":"test","publicOrigin":"https://<deployed shop host>"}}`. `providerId` selects the payments provider; `accountId` must match its secure settings; `mode` is `test` or `live`; `publicOrigin` is an HTTPS origin without a path, query, credentials or fragment. Use the deployed shop origin, never the desktop address. Do not change this selection while original payments are draining.
|
|
12
|
+
3. Call checkout status. Its `checkout.webhookUrl`, when present, is the exact public URL the owner must register manually in the selected provider's webhook dashboard, using that mode's signing secret in the secure settings card. The host supplies the webhook URL; use the returned URL rather than guessing the site id. Webhook provisioning is manual. A ready status does not prove external reachability: verify delivery on the deployed site in provider test mode before live acceptance.
|
|
13
|
+
4. Create a checkout product with `{name:"Notebook",slug:"notebook"}`, then create a checkout price with `{productId:"<returned product id>",amount:{minorUnits:123,currency:"JPY"}}`. Prices are immutable positive integer minor units; JPY has no decimal units. Setup activates the prepared catalog only when the plugin and provider configuration are usable. Check checkout status again and explain any unavailable reason before offering checkout.
|
|
14
|
+
|
|
15
|
+
For Stripe's one-time checkout, set the webhook endpoint API version to `2024-06-20`, matching the provider's pinned request version, and register `checkout.session.completed`, `checkout.session.expired`, `checkout.session.async_payment_succeeded` and `checkout.session.async_payment_failed`. Keep test and live endpoint signing secrets in their corresponding secure fields. A completed session with an unpaid payment status must remain unpaid.
|
|
16
|
+
|
|
17
|
+
Checkout accepts one active one-time price for a signed-in member. Create a pending order first, then pay or resume that same order id. Never create another order merely to retry payment. The host supplies member, workspace, site, merchant account and test/live mode; do not accept those identities from a visitor.
|
|
18
|
+
|
|
19
|
+
On the deployed shop, authenticated members create orders with `POST /api/commerce/v1/workspaces/<workspaceId>/orders` and `{priceId,quantity?}`, then pay/resume with `POST .../orders/<orderId>/pay` and `{}`. The host's member session and same-origin checks apply. Use the returned payment intent's redirect/action; browser callbacks are `/commerce/return?orderId=<saved id>` and `/commerce/cancel?orderId=<saved id>`. Read an owned order with `GET .../orders/<orderId>`; callbacks and reads remain ledger-only when new purchases are disabled.
|
|
20
|
+
|
|
21
|
+
Payment acceptance requires the deployed site's HTTPS address. Desktop manages settings and catalog; it does not receive public payment callbacks. Return and cancel URLs only display stored payment state. A completed browser redirect does not prove payment: only verified ledger evidence marks the order paid.
|
|
22
|
+
|
|
23
|
+
Disabling Commerce stops new purchases. Already-started payments retain their data and continue the host's disclosed settlement drain. Subscriptions, refunds, inventory, taxes, location collection and custom fraud decisions are not provided by this plugin.
|
package/composio/mcp.json
CHANGED
package/composio/plugin.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "composio",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "Lets the assistant use the user's other apps (Gmail, Google Calendar, Slack, Notion, GitHub, HubSpot, Linear and 1000+ more) through Composio Connect, Composio's hosted MCP server. One browser sign-in to Composio connects it; each app is then connected on first use by a Composio sign-in link, with no API keys anywhere.",
|
|
6
6
|
"author": "Tovu",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"extensions": {
|
|
9
|
-
"
|
|
9
|
+
"jini": {
|
|
10
10
|
"maturity": "soon",
|
|
11
11
|
"summary": "Lets the assistant use your other apps, like Gmail, Google Calendar, Slack and Notion. You connect each app with one sign-in link.",
|
|
12
12
|
"id": "tovu/composio",
|
|
@@ -10,7 +10,7 @@ description: Use the user's other apps (Gmail, Calendar, Slack, Notion, GitHub,
|
|
|
10
10
|
Choose the card yourself from its `usedFor` list. Reuse a saved key or working sign-in for that
|
|
11
11
|
task. Never offer a replacement unless the person asks.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Connecting the account opens the plugin-declared **Connect Composio** card. Review each app’s sign-in permissions and grant only the requested tools. This hosted connection declares no token fallback; do not request or save a Composio API key.
|
|
14
14
|
|
|
15
15
|
Composio Connect is an **external MCP server** at `https://connect.composio.dev/mcp`. It does not
|
|
16
16
|
expose one tool per app. It exposes a handful of meta-tools, and you reach every app through them.
|
|
@@ -30,10 +30,10 @@ Its tools arrive in chat as `mcp__composio__<TOOL>`.
|
|
|
30
30
|
Connect signs the user in by standard MCP OAuth in their browser. The host discovers Composio's
|
|
31
31
|
endpoints and registers its own client, so nobody types a URL, client id or secret.
|
|
32
32
|
|
|
33
|
-
1. **Turn the plugin on.** It ships disabled. Offer to enable it; on yes
|
|
33
|
+
1. **Turn the plugin on.** It ships disabled. Offer to enable it; on yes enable the plugin with confirmation
|
|
34
34
|
with `family: "agent-plugin"`, `pluginId: "composio"`, `enabled: true` (the user approves a
|
|
35
35
|
dialog), or they use the **Agent Plugins** screen. Enabling creates the `composio` connection row.
|
|
36
|
-
2. **Sign in.**
|
|
36
|
+
2. **Sign in.** Connect the account. It provisions the declared
|
|
37
37
|
connection, shows the secure browser sign-in card and waits. On `status: "connected"`, continue;
|
|
38
38
|
on `status: "waiting-for-sign-in"`, wait for the person to return, then call it again once.
|
|
39
39
|
Say: "Sign in to Composio (free account; sign up there if you have none)." If it refuses because
|
|
@@ -78,7 +78,7 @@ Report what the tool actually returned. If it failed, say so with its error in o
|
|
|
78
78
|
|
|
79
79
|
## When it stops working
|
|
80
80
|
|
|
81
|
-
- **"is disconnected: its authorization expired or was revoked"**:
|
|
81
|
+
- **"is disconnected: its authorization expired or was revoked"**: request renewed browser sign-in
|
|
82
82
|
for `composio`. After the user signs in again, retry the original call once.
|
|
83
83
|
- **An app's own sign-in expired** (the app tool fails with an auth error): run
|
|
84
84
|
`COMPOSIO_MANAGE_CONNECTIONS` for that app again and give the user the new link.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createCommerceServer, readOwnedCommerceOrder, normalizedCommerceOrigin, CommerceUnavailableError } from "@jini-ai/commerce";
|
|
2
|
+
export type { CommerceServer, CommerceServerRequired, CommerceServerStatus, CommerceOrderView, CommerceOrderReadDeps } from "@jini-ai/commerce";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type AdminSurfaceAuthorizationStart, type AdminSurfaceConnections } from '../surface-capabilities.js';
|
|
2
|
+
import type { AdminSurfaceConnectionsHost, AdminSurfaceDeclaredConnection } from './ports.js';
|
|
3
|
+
/**
|
|
4
|
+
* @file The host's `connections` port for plugin admin-surface handlers (Jini's `AdminSurfaceConnections`):
|
|
5
|
+
* account actions a signed-in admin takes on a plugin's own settings screen, over the same
|
|
6
|
+
* api-connections host the chat sign-in and the tools use.
|
|
7
|
+
*
|
|
8
|
+
* Why the host resolves ids itself: Jini's session already refuses ids the SURFACE did not declare,
|
|
9
|
+
* but only the host knows which connections the calling PLUGIN declares in THIS workspace, so a
|
|
10
|
+
* connection id is turned into its opaque ref here, from the scope's plugin and workspace, and any
|
|
11
|
+
* other id gets one refusal. Refs never leave. A sign-in's authorization URL is reported to
|
|
12
|
+
* `onSignInIssued` so the admin route can let the host page (not the sandboxed frame) open exactly
|
|
13
|
+
* the URLs this host issued. Revocation outcomes are reported verbatim: `confirmed` only when the
|
|
14
|
+
* provider confirmed. A sign-in's `attemptId` is the service's own random id; the OAuth `state`
|
|
15
|
+
* never reaches the plugin.
|
|
16
|
+
*/
|
|
17
|
+
export interface IssuedSignIn extends AdminSurfaceAuthorizationStart {
|
|
18
|
+
readonly pluginId: string;
|
|
19
|
+
readonly connectionId: string;
|
|
20
|
+
}
|
|
21
|
+
export interface AdminSurfaceConnectionsDeps<Connection extends AdminSurfaceDeclaredConnection> {
|
|
22
|
+
readonly host: AdminSurfaceConnectionsHost<Connection>;
|
|
23
|
+
readonly onSignInIssued?: (issued: IssuedSignIn) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Builds the per-call connections port for one plugin, workspace and (for account actions) admin.
|
|
27
|
+
* @complexity Each call: one contribution load plus one record read or one service call.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createAdminSurfaceConnections<Connection extends AdminSurfaceDeclaredConnection>(required: AdminSurfaceConnectionsDeps<Connection> & {
|
|
30
|
+
readonly pluginId: string;
|
|
31
|
+
readonly workspaceId: string;
|
|
32
|
+
readonly principalId?: string | undefined;
|
|
33
|
+
readonly signal?: AbortSignal | undefined;
|
|
34
|
+
}, _optional?: Record<string, never>): AdminSurfaceConnections;
|
|
35
|
+
//# sourceMappingURL=connections.d.ts.map
|