@synap-core/workspace-templates 0.71.0 → 0.72.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/README.md +10 -3
- package/automations/github-pr-events.automation.json +1 -1
- package/automations/ship-a-change-checks-green.automation.json +1 -1
- package/automations/ship-a-change-checks-red.automation.json +1 -1
- package/automations/ship-a-change-deployed.automation.json +1 -1
- package/automations/ship-a-change-pr-merged.automation.json +1 -1
- package/automations/ship-a-change-pr-opened.automation.json +1 -1
- package/capabilities/apify-linkedin-profiles.capability.json +45 -0
- package/capabilities/apify-social-post-capture.capability.json +57 -0
- package/capabilities/apify.capability.json +2 -50
- package/capabilities/github-issues.capability.json +176 -0
- package/capabilities/stripe-payments.capability.json +176 -0
- package/capabilities/test-api-3.capability.json +104 -0
- package/capabilities/unipile-linkedin.capability.json +5 -3
- package/dist/index.js +1073 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/app-factory-research/SKILL.md +1 -1
- package/src/apify-social-reader.test.ts +8 -3
- package/src/builder-work-views.template.test.ts +111 -0
- package/src/builder.yaml +494 -32
- package/src/content-os.piece-model.template.test.ts +8 -6
- package/src/content-os.yaml +7 -0
- package/src/crm.yaml +4 -3
- package/src/dev-flow-change.template.test.ts +192 -0
- package/src/retired-names.test.ts +68 -0
- package/src/templates.ts +874 -30
- package/automations/ship-a-change-deployed.catalog.json +0 -18
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ How installs, reconciles and tiers work is in the `synap-market` skill
|
|
|
24
24
|
| `capabilities/<key>.capability.json` | `capability` | Manifest (below). `meta` carries the listing and visibility; `spec` is the CapabilityDefinition | Yes, CI on every push to main (§4) |
|
|
25
25
|
| `skills/<slug>/` | `skill` | Either a manifest `<slug>.skill.json` (`creative-director`), or an Agent-Skills folder (`SKILL.md` plus references) with a header `skills/<slug>.catalog.json` beside it. A manifest folder may also hold a source file the skill builds on a computer (`facecam-edit/synap-matte.swift`): never a catalog entry, it reaches the computer through the npm package, pinned by version and sha256 in the skill's body (held equal by `src/facecam-edit.matte.test.ts`) | The manifest: yes. A folder: only with its header, and only when it holds no reference files (a skill package carries no documents). Headers decided by the founder on 2026-11-05: `bookmark-enrichment` and `routing-to-channels` public, `mapping-the-server` unlisted (private to the official owner); `reading-client-progress` and the parked `stellar-scf-grants-advisor` stay **staged** |
|
|
26
26
|
| `views/<slug>.view.json` | `view` | Manifest; `spec.views` in the canonical shape the CP stores (`{slug, displayName, type, config, scopeProfileSlugs}`) | Category `view`. Three today (`bookmark-views-pack`, `event-views-pack`, `task-views-pack`), moved from the old CP pack fragments on 2026-11-05. CI on every push to main |
|
|
27
|
-
| `automations/<slug>.automation.json` | `automation` | bridge-setup `flowDefinition` form, plus a header `automations/<slug>.catalog.json` beside it | Only with its header, and only without apply-time placeholders. Headers decided by the founder on 2026-11-05: `bookmark-enrichment` public; `url-bookmark-capture`, `github-pr-events` and the
|
|
27
|
+
| `automations/<slug>.automation.json` | `automation` | bridge-setup `flowDefinition` form, plus a header `automations/<slug>.catalog.json` beside it | Only with its header, and only without apply-time placeholders. Headers decided by the founder on 2026-11-05: `bookmark-enrichment` public; `url-bookmark-capture`, `github-pr-events` and the four `ship-a-change-*` that carry no pod id unlisted. `mail-feed` stays **staged**: it carries two placeholders bridge-setup fills; `ship-a-change-deployed` too: its `playbook_run` node needs one pod's agent and goal ids (`handToAgentId`, `trackId`), which a package install cannot supply |
|
|
28
28
|
| `agents/<slug>.agent.yaml` | `agent` | Manifest. `spec` (`schema/agent.ts`) is what the pod reads as `definition.agent`: `harness` (the `agent_type` join key), `aliases`, `worker`, `tried`, `detect`, `wake` (data: `program` + `args` + `params`, never a shell line; required for a worker only), `practices.skills`, `mcp` (where its program reads MCP servers: `config` under ~/, `format` yaml/json, `key` dot path, `entry`; the CLI writes the pod's server there on `synap agents add`, the pod ignores it), `toolProfile` (`entry` / `builder`) + `toolGroups` (only with `entry`): the MCP tools an agent's first key lists, read by the pod (backend#900). One per program of the backend harness registry, plus `hermes`. CP category `agent`, official vendor only, left out of browse lists (the catalog installs every official agent on every pod, founder decision D8) | Yes, on every push to main, like every other kind (the first publish was the founder's, by hand, on 2026-11-07; `FIRST_PUBLISH_BY_HAND` is empty since) |
|
|
29
29
|
| `renderer-bundles/<slug>.yaml` | `renderer-bundle` | Manifest (`schema/renderer-bundle.ts`): the cells (each an entry module under `packages/web/src/renderer-bundle/cells/`, importing only the bundle's kit `space-packages/kit-bundle.ts`), and the host's fallbacks (`defaults`). `pnpm --filter @synap-core/workspace-templates build:renderer-bundle` builds `renderer-bundles/built/<slug>.definition.json` (the `RendererBundleDefinition`: its own React, kit and tokens, the cells' code, every sha256) and `<slug>.build.json` (inputs, the commits it was built from, the tRPC trace). Neither is committed (`built/` is gitignored): the publish workflow builds them from the commit it publishes, and `scripts/build-renderer-bundle.test.ts` runs the same build and checks it. Never in the npm package (`files`). Licence PolyForm Noncommercial 1.0.0 | Category `renderer-bundle`, private, never synced: the CP delivers it to any live pod a Synap plan covers (decision c91d26dc; founder, 20 Nov 2026). CI on every push to main, once the CP accepts the category |
|
|
30
30
|
| `schema/` | | Zod manifest schema: `header.ts`, plus one body per kind (`workspace`, `capability`, `skill`, `automation`, `view`, `agent`, `playbook`) | |
|
|
@@ -96,10 +96,17 @@ visibility go in `meta`; the definition goes in `spec`.
|
|
|
96
96
|
a required `url` parameter, and `urls: [...]` declaring the links it handles (`host[/path]`, `*.host`,
|
|
97
97
|
or `"*"`; the grammar lives in `@synap-core/types/url-read`). The pod's one read door routes by those
|
|
98
98
|
patterns; nothing else names a vendor. It returns a `UrlRead` (`status`, `text`, `media`, ...), saves
|
|
99
|
-
nothing, and an account-billed one runs only on the person's tap. Reference:
|
|
100
|
-
`capture_social_post`. `synap catalog validate` enforces it (`skill-urls`). The agents' own door to
|
|
99
|
+
nothing, and an account-billed one runs only on the person's tap. Reference: the
|
|
100
|
+
`apify-social-post-capture` add-on's `capture_social_post`. `synap catalog validate` enforces it (`skill-urls`). The agents' own door to
|
|
101
101
|
reading a link is the pod's built-in `web.read` verb (Synap Core), not a catalog capability: the old
|
|
102
102
|
`web.read` pack is retired.
|
|
103
|
+
- **An add-on** (founder decision D6) is a capability that extends another one: `spec.extends: "<base key>"`
|
|
104
|
+
(e.g. `apify-linkedin-profiles` extends `apify`). It is its own package, listing and installed tool, with
|
|
105
|
+
its own actions; it declares no `tools` and no `vault`: its skills `requires` the base's tools by name and
|
|
106
|
+
run through the base's access. `spec.extends` is the one authored field: the `{kind: capability,
|
|
107
|
+
relation: require}` dependency on the base is added at publish, and `synap catalog validate` refuses an
|
|
108
|
+
add-on that names no catalog capability, declares a tool, requires a tool its base does not declare,
|
|
109
|
+
repeats one of its base's action ids, or carries a dependency on its base that disagrees (`addon-*`).
|
|
103
110
|
|
|
104
111
|
- **A verb that must always ask** (it deletes, destroys or publishes) declares `metadata.proposeOnly: true`:
|
|
105
112
|
no auto grant and no "runs on its own" rule ever runs it, whatever its name. Adding it later only
|
|
@@ -498,7 +498,7 @@
|
|
|
498
498
|
]
|
|
499
499
|
},
|
|
500
500
|
"metadata": {
|
|
501
|
-
"staged": "
|
|
501
|
+
"staged": "PUBLISHED, not staged (checked 2026-11-27, lane K, session 958b7329): its catalog header exists (isPublic false: unlisted), record_observation is in src/validate-flow.ts FLOW_OUTPUT_TYPES and on backend main, and the install binds triggerConfig.webhookSource.name to the space's source of that name (backend database utils/webhook-source-declaration.ts bindWebhookSourceDeclaration, called by the automation insert door and the template reconcile); the binding never creates the source: a person does.",
|
|
502
502
|
"mapping": "Ported from Synap-core/backend scripts/pod-observation.mjs (#281): opened/reopened \u2192 dev.pr_opened, closed+merged \u2192 dev.pr_merged (sha = merge commit), closed \u2192 dev.pr_closed; intoDefault = base.ref == repository.default_branch; a check suite's conclusion folds startup_failure \u2192 failure, action_required \u2192 neutral, stale \u2192 cancelled, and any other conclusion is not reported (the guard). Optional fields that resolve to null are left out by the step (contract: absent, never null). The session is resolved by the pod from the PR body's Pod session line (record-observation's resolver), so no field carries it.",
|
|
503
503
|
"sender": "A person creates the inbound webhook source named GitHub in the install space (pod-admin, space Connections, Webhook sources): the install binds to it by name, in either order. GitHub org webhook: Payload URL = that source's URL, Content type application/json, Secret = the source's secret (shown once; Replace secret shows a new one), events: Pull requests + Check suites."
|
|
504
504
|
}
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
"metadata": {
|
|
102
102
|
"playbook": "Ship a change (builder-workspace)",
|
|
103
|
-
"staged": "
|
|
103
|
+
"staged": "PUBLISHED, not staged (checked 2026-11-27, lane K, session 958b7329): its catalog header exists (isPublic false: unlisted, installed as a draft), and its output verbs post_evidence and session_update are in the catalog flow vocabulary (src/validate-flow.ts FLOW_OUTPUT_TYPES) and on backend main (packages/jobs/src/workers/steps/output.ts). Its trigger fact is recorded by record_observation (backend services/observations/record-observation.ts), which stamps the session from the PR body. Builder bundles none of the ship-a-change automations: a person installs each from the catalog.",
|
|
104
104
|
"notes": "Reads `sessionId` on ci.finished: not in the contract (types events/dev-loop.ts, extra fields allowed), but both producers send it when they know it (GitHub Actions from the run's PR body, the devbox from GATE_POD_SESSION). A run with none (a push to main, a body naming no session) stops at the guard. ONE workflow green is not every check green: a repository with several required workflows posts one ci.finished each, so this grades on the first; the worker re-reads all runs with github_pr_checks before the merge."
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
"metadata": {
|
|
102
102
|
"playbook": "Ship a change (builder-workspace)",
|
|
103
|
-
"staged": "
|
|
103
|
+
"staged": "PUBLISHED, not staged (checked 2026-11-27, lane K, session 958b7329): its catalog header exists (isPublic false: unlisted, installed as a draft), and its output verbs post_evidence and session_update are in the catalog flow vocabulary (src/validate-flow.ts FLOW_OUTPUT_TYPES) and on backend main (packages/jobs/src/workers/steps/output.ts). Its trigger fact is recorded by record_observation (backend services/observations/record-observation.ts), which stamps the session from the PR body. Builder bundles none of the ship-a-change automations: a person installs each from the catalog.",
|
|
104
104
|
"notes": "A precondition is one comparison: timed_out is not caught here (cancelled, skipped and neutral are not red). Same sessionId source as ship-a-change-checks-green."
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"metadata": {
|
|
52
52
|
"playbook": "Ship a change (builder-workspace)",
|
|
53
|
-
"staged": "STAGED (no catalog header, so
|
|
53
|
+
"staged": "STAGED, not published (lane P, 2026-11-28): it has no catalog header. handToAgentId and trackId are <...> holes (ONE pod's ids) that playbook_run reads literally, and a package install takes no parameters, so it cannot install as published. applyTimePlaceholders now looks at playbook_run nodes, so adding a header back while the holes remain fails validation (apply-time-placeholder). Its output verbs post_evidence and session_update are in the catalog flow vocabulary (src/validate-flow.ts FLOW_OUTPUT_TYPES) and on backend main (packages/jobs/src/workers/steps/output.ts); dev.deployed is recorded by record_observation (backend services/observations/record-observation.ts).",
|
|
54
54
|
"notes": "POD-SPECIFIC VALUES: handToAgentId and trackId are ids on ONE pod, and the catalog has no install-time params for an automation, while playbook_run reads both literally (backend jobs steps/playbook-run.ts: not template-resolved). So this copy keeps them as <…> holes; the pod write (lanes/catalog.md, pilot setup) fills them. dev.deployed is recorded by the pod that was updated, as its owner: this automation hears ITS pod's deploys only. A lab that is another pod reaches the goal's pod only if a producer forwards its deploy."
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
},
|
|
105
105
|
"metadata": {
|
|
106
106
|
"playbook": "Ship a change (builder-workspace)",
|
|
107
|
-
"staged": "
|
|
107
|
+
"staged": "PUBLISHED, not staged (checked 2026-11-27, lane K, session 958b7329): its catalog header exists (isPublic false: unlisted, installed as a draft), and its output verbs post_evidence and session_update are in the catalog flow vocabulary (src/validate-flow.ts FLOW_OUTPUT_TYPES) and on backend main (packages/jobs/src/workers/steps/output.ts). Its trigger fact is recorded by record_observation (backend services/observations/record-observation.ts), which stamps the session from the PR body. Builder bundles none of the ship-a-change automations: a person installs each from the catalog.",
|
|
108
108
|
"notes": "Derived from be-loop's config (lanes/be-loop-automation-config.json, pinned by backend#286). Two changes: the step moves to `deploy`, not `verifying` (the Ship a change order is merged → deployed to lab → dogfooded → criteria verified, and no stage is keyed verifying); the dogfood run starts on dev.deployed (ship-a-change-deployed), not at the merge."
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -99,6 +99,6 @@
|
|
|
99
99
|
},
|
|
100
100
|
"metadata": {
|
|
101
101
|
"playbook": "Ship a change (builder-workspace)",
|
|
102
|
-
"staged": "
|
|
102
|
+
"staged": "PUBLISHED, not staged (checked 2026-11-27, lane K, session 958b7329): its catalog header exists (isPublic false: unlisted, installed as a draft), and its output verbs post_evidence and session_update are in the catalog flow vocabulary (src/validate-flow.ts FLOW_OUTPUT_TYPES) and on backend main (packages/jobs/src/workers/steps/output.ts). Its trigger fact is recorded by record_observation (backend services/observations/record-observation.ts), which stamps the session from the PR body. Builder bundles none of the ship-a-change automations: a person installs each from the catalog."
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiVersion": "synap/v1",
|
|
3
|
+
"kind": "capability",
|
|
4
|
+
"meta": {
|
|
5
|
+
"slug": "apify-linkedin-profiles",
|
|
6
|
+
"name": "LinkedIn profiles (Apify add-on)",
|
|
7
|
+
"description": "Enriches one person from a public LinkedIn profile link, through your Apify account: job title, company, city, country, bio and the contact fields the profile shows. An add-on of Apify: install Apify first; it runs through Apify's access and stops when that is off. Apify bills each run.",
|
|
8
|
+
"tags": [
|
|
9
|
+
"capability",
|
|
10
|
+
"add-on"
|
|
11
|
+
],
|
|
12
|
+
"isPublic": true,
|
|
13
|
+
"syncByDefault": true
|
|
14
|
+
},
|
|
15
|
+
"spec": {
|
|
16
|
+
"key": "apify-linkedin-profiles",
|
|
17
|
+
"name": "LinkedIn profiles",
|
|
18
|
+
"description": "Enriches one person from a public LinkedIn profile link, through your Apify account: job title, company, city, country, bio and the contact fields the profile shows. An add-on of Apify: install Apify first; it runs through Apify's access and stops when that is off. Apify bills each run.",
|
|
19
|
+
"extends": "apify",
|
|
20
|
+
"tools": [],
|
|
21
|
+
"skills": [
|
|
22
|
+
{
|
|
23
|
+
"name": "apify_linkedin_profile",
|
|
24
|
+
"intent": "enrich_entity",
|
|
25
|
+
"kind": "code",
|
|
26
|
+
"scope": "pod",
|
|
27
|
+
"category": "enrichment",
|
|
28
|
+
"description": "Enriches ONE person from a PUBLIC LinkedIn profile URL via the Apify actor curious_coder/linkedin-profile-scraper, and returns normalized fields { jobTitle, city, country, bio, company, email, phone, website } where the actor provides them (billed external run). Also returns scrapedName (the profile's full name) SEPARATELY at the top level — NOT mapped into properties, since the name is the entity title, not a person property. Read-only for the pod — returns data; the caller decides whether to write it (mirrors the CRM's useEnrich enrichLinkedIn). Args: { url: string (a linkedin.com/in/ profile URL) }.",
|
|
29
|
+
"requires": [
|
|
30
|
+
"apify_api"
|
|
31
|
+
],
|
|
32
|
+
"executionMode": "async",
|
|
33
|
+
"timeoutSeconds": 120,
|
|
34
|
+
"parameters": {
|
|
35
|
+
"url": "string"
|
|
36
|
+
},
|
|
37
|
+
"code": "// Enrich a person from a public LinkedIn profile URL via an Apify actor's\n// synchronous run. Executor wraps this body as (async (args, context) => { <code> });\n// use args directly and `return`. callProvider(tool, method, path, body?) resolves\n// the apify_api tool by NAME, injects the vaulted token as Authorization: Bearer\n// <token>, and uses config.baseUrl = https://api.apify.com/v2. Apify actor ids\n// with a '/' use '~' in the URL path (owner~actor-name). Field map is DEFENSIVE:\n// the actor (curious_coder/linkedin-profile-scraper) output shape drifts across\n// runs/plans, so each field tries its most likely key(s) and is skipped (never\n// thrown) when absent. Confirmed actor keys: headline/jobTitle, occupation,\n// summary, geoLocationName/geoCountryName, companyName, positions[0].companyName,\n// firstName/lastName, publicIdentifier, pictureUrl. email/phone only appear when\n// the actor's findContacts option is enabled (not set here) — mapped defensively\n// in case a future run includes them.\nconst url = String(args?.url ?? '').trim();\nif (!url) throw new Error('apify_linkedin_profile: url is required (a public linkedin.com/in/ profile URL)');\nif (!/linkedin\\.com\\/in\\//i.test(url)) throw new Error('apify_linkedin_profile: url must be a linkedin.com/in/ profile URL');\n\nconst actorId = 'curious_coder~linkedin-profile-scraper';\nconst input = { profileUrls: [{ url }], maxResults: 1 };\n\nconst res = await callProvider('apify_api', 'POST', `/actors/${actorId}/run-sync-get-dataset-items`, input);\nif (res?.proposed === true) {\n return { success: false, proposed: true, proposalId: res?.proposalId ?? null, url };\n}\nconst payload = res?.body ?? res;\nconst items = Array.isArray(payload) ? payload : [];\nconst data = items[0];\nif (!data) throw new Error('apify_linkedin_profile: no data returned — the profile may be private, region-locked, or the URL malformed');\n\nconst mapped = {};\nif (data.jobTitle) mapped.jobTitle = data.jobTitle;\nelse if (data.headline) mapped.jobTitle = data.headline;\nelse if (data.occupation) mapped.jobTitle = data.occupation;\n\nif (typeof data.location === 'string' && data.location) mapped.city = data.location;\nelse if (data.location?.city) mapped.city = data.location.city;\nelse if (data.geoLocationName) mapped.city = data.geoLocationName;\n\nif (typeof data.location === 'object' && data.location?.country) mapped.country = data.location.country;\nelse if (data.geoCountryName) mapped.country = data.geoCountryName;\nelse if (data.countryCode) mapped.country = data.countryCode;\n\nif (data.summary) mapped.bio = data.summary;\nelse if (data.about) mapped.bio = data.about;\n\nconst company = data.companyName\n ?? (Array.isArray(data.experiences) ? data.experiences[0]?.company : undefined)\n ?? (Array.isArray(data.positions) ? data.positions[0]?.companyName : undefined);\nif (company) mapped.company = company;\n\nif (data.email) mapped.email = data.email;\nelse if (data.emailAddress) mapped.email = data.emailAddress;\nelse if (data.contactInfo?.email) mapped.email = data.contactInfo.email;\n\nif (data.phone) mapped.phone = data.phone;\nelse if (Array.isArray(data.phoneNumbers) && data.phoneNumbers[0]) mapped.phone = data.phoneNumbers[0];\nelse if (data.contactInfo?.phone) mapped.phone = data.contactInfo.phone;\n\nconst website = data.website\n ?? data.personalWebsite\n ?? (Array.isArray(data.contactInfo?.websites) ? data.contactInfo.websites[0] : undefined);\nif (website) mapped.website = website;\n\nconst joinedName = [data.firstName, data.lastName].filter(Boolean).join(' ').trim();\nconst scrapedName = data.fullName || joinedName || undefined;\n\nreturn { matched: Object.keys(mapped).length > 0, fields: Object.keys(mapped).length, url, scrapedName, ...mapped };"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"provides": [
|
|
41
|
+
"enrich_entity"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"dependencies": []
|
|
45
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiVersion": "synap/v1",
|
|
3
|
+
"kind": "capability",
|
|
4
|
+
"meta": {
|
|
5
|
+
"slug": "apify-social-post-capture",
|
|
6
|
+
"name": "Social post capture (Apify add-on)",
|
|
7
|
+
"description": "Reads one public Instagram post, reel or carousel, or one TikTok video, from its link, through your Apify account: the caption, the author, the date, every picture and the video, and the like, comment and view counts. An add-on of Apify: install Apify first; it runs through Apify's access and stops when that is off. Apify bills each run.",
|
|
8
|
+
"tags": [
|
|
9
|
+
"capability",
|
|
10
|
+
"add-on"
|
|
11
|
+
],
|
|
12
|
+
"isPublic": true,
|
|
13
|
+
"syncByDefault": true
|
|
14
|
+
},
|
|
15
|
+
"spec": {
|
|
16
|
+
"key": "apify-social-post-capture",
|
|
17
|
+
"name": "Social post capture",
|
|
18
|
+
"description": "Reads one public Instagram post, reel or carousel, or one TikTok video, from its link, through your Apify account: the caption, the author, the date, every picture and the video, and the like, comment and view counts. An add-on of Apify: install Apify first; it runs through Apify's access and stops when that is off. Apify bills each run.",
|
|
19
|
+
"extends": "apify",
|
|
20
|
+
"tools": [],
|
|
21
|
+
"skills": [
|
|
22
|
+
{
|
|
23
|
+
"name": "capture_social_post",
|
|
24
|
+
"intent": "read_webpage",
|
|
25
|
+
"kind": "code",
|
|
26
|
+
"scope": "pod",
|
|
27
|
+
"description": "Reads one public Instagram post, reel or carousel, or one TikTok video, from its link: the caption, the author, the date, every picture and the video, and the like, comment and view counts. It saves nothing by itself. Public posts only: a private or deleted post comes back as blocked. It runs on YOUR Apify account, and Apify bills each run, retries included. Instagram's and TikTok's terms forbid automated collection; you are responsible for using it. Args: { url: string, withVideo?: boolean (TikTok only: also download the video file — off unless the person picks it; Apify may bill more per item) }.",
|
|
28
|
+
"requires": [
|
|
29
|
+
"apify_api"
|
|
30
|
+
],
|
|
31
|
+
"executionMode": "async",
|
|
32
|
+
"timeoutSeconds": 120,
|
|
33
|
+
"parameters": {
|
|
34
|
+
"url": "string",
|
|
35
|
+
"withVideo": "boolean?"
|
|
36
|
+
},
|
|
37
|
+
"urls": [
|
|
38
|
+
"instagram.com/p/*",
|
|
39
|
+
"instagram.com/reel/*",
|
|
40
|
+
"instagram.com/reels/*",
|
|
41
|
+
"instagram.com/tv/*",
|
|
42
|
+
"tiktok.com/@*/video/*",
|
|
43
|
+
"vm.tiktok.com/*",
|
|
44
|
+
"vt.tiktok.com/*"
|
|
45
|
+
],
|
|
46
|
+
"code": "// A READER: one public Instagram post/reel/carousel or TikTok video by URL,\n// read through an Apify actor's synchronous run, returned in the UrlRead shape\n// (@synap-core/types/url-read). It writes nothing: the pod's read door stamps\n// `via`, normalizes the result and keeps it (the Library item is the one home\n// of a kept post).\n// Executor wraps this body as (async (args, context) => { <code> }); use args\n// directly and `return`. callProvider(tool, method, path, body?) resolves the\n// apify_api tool by NAME, injects the vaulted token as Authorization: Bearer\n// <token>, and uses the tool's config.baseUrl = https://api.apify.com/v2.\n// Apify actor ids with a '/' use '~' in the URL path (owner~actor-name).\n// The URLs accepted here are exactly the verb's declared `urls` (a catalog\n// test runs this body against them).\nconst url = String(args?.url ?? '').trim();\nif (!url) return { status: 'failed', sourceUrl: url, error: 'capture_social_post: url is required' };\n\nlet parsed = null;\ntry { parsed = new URL(url); } catch (_) { parsed = null; }\nconst scheme = parsed ? parsed.protocol.toLowerCase() : '';\nconst host = parsed ? parsed.hostname.toLowerCase().replace(/^www\\./, '') : '';\nconst path = parsed ? parsed.pathname : '';\n\n// The vendor is sent the URL as PARSED (what the checks above saw), never the\n// raw string: WHATWG drops tabs/newlines, so the two can differ.\nlet platform, actorId, body;\nif ((scheme === 'https:' || scheme === 'http:') && host === 'instagram.com' && /^\\/(p|reel|reels|tv)\\/[^/]+(\\/|$)/.test(path)) {\n platform = 'instagram';\n actorId = 'apify~instagram-scraper';\n body = { directUrls: [parsed.href], resultsType: 'posts' };\n} else if ((scheme === 'https:' || scheme === 'http:') && ((host === 'tiktok.com' && /^\\/@[^/]+\\/video\\/[^/]+(\\/|$)/.test(path)) || ((host === 'vm.tiktok.com' || host === 'vt.tiktok.com') && /^\\/[^/]+(\\/|$)/.test(path)))) {\n platform = 'tiktok';\n actorId = 'clockworks~tiktok-scraper';\n // The video file is downloaded only when the person picked \"with video\"\n // (`withVideo`): the actor bills more per item for it.\n body = { postURLs: [parsed.href], shouldDownloadVideos: args?.withVideo === true };\n} else {\n return {\n status: 'blocked',\n sourceUrl: url,\n blocked: { reason: 'unsupported', detail: 'Reads only public instagram.com/p, /reel, /reels and /tv links, and tiktok.com/@user/video, vm.tiktok.com and vt.tiktok.com links.' },\n };\n}\n\n// An Apify HTTP / auth / quota / run failure is NOT caught: it propagates like\n// every other Apify verb's, so the executor keeps its failure class (re-auth,\n// retry later) and the read door maps it to a retryable failure.\nconst res = await callProvider('apify_api', 'POST', `/actors/${actorId}/run-sync-get-dataset-items`, body);\nif (res?.proposed === true) {\n return { status: 'failed', sourceUrl: url, error: 'The Apify run is waiting for approval; nothing was read yet.', proposed: true, proposalId: res?.proposalId ?? null };\n}\nif (typeof res?.status === 'number' && res.status >= 400) {\n throw new Error(`capture_social_post: the Apify run answered HTTP ${res.status}`);\n}\nconst payload = res?.body ?? res;\nconst items = Array.isArray(payload) ? payload : [];\nconst item = items[0];\n\n// Not there, or not public. The actors return an empty dataset, or one item\n// carrying `error` / `errorDescription`, for a private, deleted or missing post.\n// \"Missing\" is checked first: the Instagram actor's \"Empty or private data\"\n// cannot tell the two apart, and a deleted post is the likelier reading.\nconst MISSING = /not.?found|no.?items|empty|deleted|unavailable|does not exist|404|removed/i;\nconst PRIVATE = /private|restricted|login/i;\nif (!item || typeof item !== 'object') {\n return { status: 'blocked', sourceUrl: url, blocked: { reason: 'not_found', detail: 'Apify returned nothing for this link: the post may be deleted, private or region-locked.' } };\n}\nconst itemError = [item.error, item.errorDescription, item.errorMessage].filter((x) => typeof x === 'string' && x).join(': ');\nif (itemError) {\n if (MISSING.test(itemError)) return { status: 'blocked', sourceUrl: url, blocked: { reason: 'not_found', detail: itemError } };\n if (PRIVATE.test(itemError)) return { status: 'blocked', sourceUrl: url, blocked: { reason: 'private', detail: itemError } };\n // Any other actor error is a run failure, not a fact about the post.\n throw new Error(`capture_social_post: Apify could not read this post: ${itemError}`);\n}\n\nconst isUrl = (u) => typeof u === 'string' && /^https?:\\/\\//i.test(u);\nconst num = (n) => (typeof n === 'number' && Number.isFinite(n) ? n : undefined);\nconst firstLine = (s) => (typeof s === 'string' ? s.split('\\n').map((l) => l.trim()).find(Boolean) : undefined);\nconst media = [];\nconst seen = new Set();\nconst add = (m) => {\n if (!isUrl(m.url) || seen.has(m.kind + ' ' + m.url)) return;\n seen.add(m.kind + ' ' + m.url);\n const entry = { url: m.url, kind: m.kind, order: media.length };\n if (m.role) entry.role = m.role;\n if (num(m.width)) entry.width = m.width;\n if (num(m.height)) entry.height = m.height;\n if (num(m.durationSec)) entry.durationSec = m.durationSec;\n media.push(entry);\n};\n\nlet read;\nif (platform === 'instagram') {\n // apify~instagram-scraper's dataset: caption, ownerUsername, ownerFullName,\n // timestamp, url, type (Image | Video | Sidecar), displayUrl (always an\n // image, even for a reel), videoUrl, videoDuration, dimensionsWidth/Height,\n // images (every image of a carousel) and childPosts (each carousel slide,\n // with its own displayUrl / videoUrl), likesCount, commentsCount,\n // videoViewCount / videoPlayCount.\n const children = Array.isArray(item.childPosts) ? item.childPosts.filter((c) => c && typeof c === 'object') : [];\n const slideImages = children.length ? children.map((c) => c.displayUrl) : Array.isArray(item.images) ? item.images : [];\n // The cover: the post's own still. In a carousel it is the first slide, so it\n // is listed once, as that slide.\n if (!slideImages.includes(item.displayUrl)) {\n add({ url: item.displayUrl, kind: 'image', role: 'cover', width: item.dimensionsWidth, height: item.dimensionsHeight });\n }\n add({ url: item.videoUrl, kind: 'video', width: item.dimensionsWidth, height: item.dimensionsHeight, durationSec: item.videoDuration });\n if (children.length) {\n for (const c of children) {\n add({ url: c.displayUrl, kind: 'image', role: 'slide', width: c.dimensionsWidth, height: c.dimensionsHeight });\n add({ url: c.videoUrl, kind: 'video', role: 'slide', width: c.dimensionsWidth, height: c.dimensionsHeight, durationSec: c.videoDuration });\n }\n } else {\n for (const u of slideImages) add({ url: u, kind: 'image', role: 'slide' });\n }\n const author = item.ownerUsername || item.ownerFullName || undefined;\n read = {\n canonicalUrl: isUrl(item.url) ? item.url : undefined,\n title: firstLine(item.caption)?.slice(0, 120),\n author,\n authorUrl: item.ownerUsername ? `https://www.instagram.com/${item.ownerUsername}/` : undefined,\n text: typeof item.caption === 'string' && item.caption.trim() ? item.caption : undefined,\n publishedAt: typeof item.timestamp === 'string' ? item.timestamp : undefined,\n fields: { platform, likes: num(item.likesCount), comments: num(item.commentsCount), views: num(item.videoViewCount) ?? num(item.videoPlayCount) },\n };\n} else {\n // clockworks~tiktok-scraper's dataset: text, createTimeISO, webVideoUrl (the\n // post page), authorMeta { name, profileUrl }, videoMeta { coverUrl,\n // downloadAddr, width, height, duration }, mediaUrls (stored video files,\n // when the actor downloads them), diggCount, commentCount, playCount.\n const meta = item.videoMeta && typeof item.videoMeta === 'object' ? item.videoMeta : {};\n add({ url: meta.coverUrl ?? meta.originalCoverUrl, kind: 'image', role: 'cover', width: meta.width, height: meta.height });\n const videoFile = (Array.isArray(item.mediaUrls) ? item.mediaUrls.find(isUrl) : undefined) ?? meta.downloadAddr;\n add({ url: videoFile, kind: 'video', width: meta.width, height: meta.height, durationSec: meta.duration });\n const am = item.authorMeta && typeof item.authorMeta === 'object' ? item.authorMeta : {};\n read = {\n canonicalUrl: isUrl(item.webVideoUrl) ? item.webVideoUrl : undefined,\n title: firstLine(item.text)?.slice(0, 120),\n author: am.name || am.nickName || undefined,\n authorUrl: isUrl(am.profileUrl) ? am.profileUrl : am.name ? `https://www.tiktok.com/@${am.name}` : undefined,\n text: typeof item.text === 'string' && item.text.trim() ? item.text : undefined,\n publishedAt: typeof item.createTimeISO === 'string' ? item.createTimeISO : undefined,\n fields: { platform, likes: num(item.diggCount), comments: num(item.commentCount), views: num(item.playCount) },\n };\n}\nfor (const k of Object.keys(read.fields)) if (read.fields[k] === undefined) delete read.fields[k];\nfor (const k of Object.keys(read)) if (read[k] === undefined) delete read[k];\nreturn { status: 'ok', sourceUrl: url, ...read, media: media.slice(0, 12) };",
|
|
47
|
+
"metadata": {
|
|
48
|
+
"readOnly": true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"provides": [
|
|
53
|
+
"read_webpage"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"dependencies": []
|
|
57
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"spec": {
|
|
15
15
|
"key": "apify",
|
|
16
16
|
"name": "Apify — Actor Platform",
|
|
17
|
-
"description": "Full Apify actor-platform access: discover marketplace actors, inspect any actor's real input schema, run any actor generically
|
|
17
|
+
"description": "Full Apify actor-platform access: discover marketplace actors, inspect any actor's real input schema, run any actor generically. Reading one public social post and enriching a person from a LinkedIn profile are its add-ons (Social post capture, LinkedIn profiles): each its own tool, running through this one. Everything verified against Apify's public API docs (store search, actor/build metadata, sync run, dataset items), not guessed. GOTCHA: this is NOT a Unipile substitute and NOT a private-saved-posts fetcher — Apify scrapes PUBLIC pages only; there is no reliable, ToS-compliant way to read a user's own saved/bookmarked posts on Instagram or TikTok (neither platform exposes that via official API, and cookie-based scraping of private data is fragile and ToS-risky — deliberately NOT implemented). Scheduling recurring actor runs is deliberately NOT implemented here either — use Synap's own automation/playbook scheduling instead of duplicating Apify's scheduler; this capability stays focused on discovery + on-demand execution. Apify actor ids with a `/` are addressed with `~` in the URL path (owner~actor-name) per Apify's REST convention; all metadata endpoints (store, actor, build) wrap results in a top-level `data` object, but run-sync-get-dataset-items returns a bare array — handled per-skill. PRECONDITION: an Apify account with an API token (Console -> Settings -> Integrations -> Personal API tokens).",
|
|
18
18
|
"params": [
|
|
19
19
|
{
|
|
20
20
|
"name": "apifyToken",
|
|
@@ -211,61 +211,13 @@
|
|
|
211
211
|
"metadata": {
|
|
212
212
|
"readOnly": true
|
|
213
213
|
}
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"name": "capture_social_post",
|
|
217
|
-
"intent": "read_webpage",
|
|
218
|
-
"kind": "code",
|
|
219
|
-
"scope": "pod",
|
|
220
|
-
"description": "Reads one public Instagram post, reel or carousel, or one TikTok video, from its link: the caption, the author, the date, every picture and the video, and the like, comment and view counts. It saves nothing by itself. Public posts only: a private or deleted post comes back as blocked. It runs on YOUR Apify account, and Apify bills each run, retries included. Instagram's and TikTok's terms forbid automated collection; you are responsible for using it. Args: { url: string, withVideo?: boolean (TikTok only: also download the video file — off unless the person picks it; Apify may bill more per item) }.",
|
|
221
|
-
"requires": [
|
|
222
|
-
"apify_api"
|
|
223
|
-
],
|
|
224
|
-
"executionMode": "async",
|
|
225
|
-
"timeoutSeconds": 120,
|
|
226
|
-
"parameters": {
|
|
227
|
-
"url": "string",
|
|
228
|
-
"withVideo": "boolean?"
|
|
229
|
-
},
|
|
230
|
-
"urls": [
|
|
231
|
-
"instagram.com/p/*",
|
|
232
|
-
"instagram.com/reel/*",
|
|
233
|
-
"instagram.com/reels/*",
|
|
234
|
-
"instagram.com/tv/*",
|
|
235
|
-
"tiktok.com/@*/video/*",
|
|
236
|
-
"vm.tiktok.com/*",
|
|
237
|
-
"vt.tiktok.com/*"
|
|
238
|
-
],
|
|
239
|
-
"code": "// A READER: one public Instagram post/reel/carousel or TikTok video by URL,\n// read through an Apify actor's synchronous run, returned in the UrlRead shape\n// (@synap-core/types/url-read). It writes nothing: the pod's read door stamps\n// `via`, normalizes the result and keeps it (the Library item is the one home\n// of a kept post).\n// Executor wraps this body as (async (args, context) => { <code> }); use args\n// directly and `return`. callProvider(tool, method, path, body?) resolves the\n// apify_api tool by NAME, injects the vaulted token as Authorization: Bearer\n// <token>, and uses the tool's config.baseUrl = https://api.apify.com/v2.\n// Apify actor ids with a '/' use '~' in the URL path (owner~actor-name).\n// The URLs accepted here are exactly the verb's declared `urls` (a catalog\n// test runs this body against them).\nconst url = String(args?.url ?? '').trim();\nif (!url) return { status: 'failed', sourceUrl: url, error: 'capture_social_post: url is required' };\n\nlet parsed = null;\ntry { parsed = new URL(url); } catch (_) { parsed = null; }\nconst scheme = parsed ? parsed.protocol.toLowerCase() : '';\nconst host = parsed ? parsed.hostname.toLowerCase().replace(/^www\\./, '') : '';\nconst path = parsed ? parsed.pathname : '';\n\n// The vendor is sent the URL as PARSED (what the checks above saw), never the\n// raw string: WHATWG drops tabs/newlines, so the two can differ.\nlet platform, actorId, body;\nif ((scheme === 'https:' || scheme === 'http:') && host === 'instagram.com' && /^\\/(p|reel|reels|tv)\\/[^/]+(\\/|$)/.test(path)) {\n platform = 'instagram';\n actorId = 'apify~instagram-scraper';\n body = { directUrls: [parsed.href], resultsType: 'posts' };\n} else if ((scheme === 'https:' || scheme === 'http:') && ((host === 'tiktok.com' && /^\\/@[^/]+\\/video\\/[^/]+(\\/|$)/.test(path)) || ((host === 'vm.tiktok.com' || host === 'vt.tiktok.com') && /^\\/[^/]+(\\/|$)/.test(path)))) {\n platform = 'tiktok';\n actorId = 'clockworks~tiktok-scraper';\n // The video file is downloaded only when the person picked \"with video\"\n // (`withVideo`): the actor bills more per item for it.\n body = { postURLs: [parsed.href], shouldDownloadVideos: args?.withVideo === true };\n} else {\n return {\n status: 'blocked',\n sourceUrl: url,\n blocked: { reason: 'unsupported', detail: 'Reads only public instagram.com/p, /reel, /reels and /tv links, and tiktok.com/@user/video, vm.tiktok.com and vt.tiktok.com links.' },\n };\n}\n\n// An Apify HTTP / auth / quota / run failure is NOT caught: it propagates like\n// every other Apify verb's, so the executor keeps its failure class (re-auth,\n// retry later) and the read door maps it to a retryable failure.\nconst res = await callProvider('apify_api', 'POST', `/actors/${actorId}/run-sync-get-dataset-items`, body);\nif (res?.proposed === true) {\n return { status: 'failed', sourceUrl: url, error: 'The Apify run is waiting for approval; nothing was read yet.', proposed: true, proposalId: res?.proposalId ?? null };\n}\nif (typeof res?.status === 'number' && res.status >= 400) {\n throw new Error(`capture_social_post: the Apify run answered HTTP ${res.status}`);\n}\nconst payload = res?.body ?? res;\nconst items = Array.isArray(payload) ? payload : [];\nconst item = items[0];\n\n// Not there, or not public. The actors return an empty dataset, or one item\n// carrying `error` / `errorDescription`, for a private, deleted or missing post.\n// \"Missing\" is checked first: the Instagram actor's \"Empty or private data\"\n// cannot tell the two apart, and a deleted post is the likelier reading.\nconst MISSING = /not.?found|no.?items|empty|deleted|unavailable|does not exist|404|removed/i;\nconst PRIVATE = /private|restricted|login/i;\nif (!item || typeof item !== 'object') {\n return { status: 'blocked', sourceUrl: url, blocked: { reason: 'not_found', detail: 'Apify returned nothing for this link: the post may be deleted, private or region-locked.' } };\n}\nconst itemError = [item.error, item.errorDescription, item.errorMessage].filter((x) => typeof x === 'string' && x).join(': ');\nif (itemError) {\n if (MISSING.test(itemError)) return { status: 'blocked', sourceUrl: url, blocked: { reason: 'not_found', detail: itemError } };\n if (PRIVATE.test(itemError)) return { status: 'blocked', sourceUrl: url, blocked: { reason: 'private', detail: itemError } };\n // Any other actor error is a run failure, not a fact about the post.\n throw new Error(`capture_social_post: Apify could not read this post: ${itemError}`);\n}\n\nconst isUrl = (u) => typeof u === 'string' && /^https?:\\/\\//i.test(u);\nconst num = (n) => (typeof n === 'number' && Number.isFinite(n) ? n : undefined);\nconst firstLine = (s) => (typeof s === 'string' ? s.split('\\n').map((l) => l.trim()).find(Boolean) : undefined);\nconst media = [];\nconst seen = new Set();\nconst add = (m) => {\n if (!isUrl(m.url) || seen.has(m.kind + ' ' + m.url)) return;\n seen.add(m.kind + ' ' + m.url);\n const entry = { url: m.url, kind: m.kind, order: media.length };\n if (m.role) entry.role = m.role;\n if (num(m.width)) entry.width = m.width;\n if (num(m.height)) entry.height = m.height;\n if (num(m.durationSec)) entry.durationSec = m.durationSec;\n media.push(entry);\n};\n\nlet read;\nif (platform === 'instagram') {\n // apify~instagram-scraper's dataset: caption, ownerUsername, ownerFullName,\n // timestamp, url, type (Image | Video | Sidecar), displayUrl (always an\n // image, even for a reel), videoUrl, videoDuration, dimensionsWidth/Height,\n // images (every image of a carousel) and childPosts (each carousel slide,\n // with its own displayUrl / videoUrl), likesCount, commentsCount,\n // videoViewCount / videoPlayCount.\n const children = Array.isArray(item.childPosts) ? item.childPosts.filter((c) => c && typeof c === 'object') : [];\n const slideImages = children.length ? children.map((c) => c.displayUrl) : Array.isArray(item.images) ? item.images : [];\n // The cover: the post's own still. In a carousel it is the first slide, so it\n // is listed once, as that slide.\n if (!slideImages.includes(item.displayUrl)) {\n add({ url: item.displayUrl, kind: 'image', role: 'cover', width: item.dimensionsWidth, height: item.dimensionsHeight });\n }\n add({ url: item.videoUrl, kind: 'video', width: item.dimensionsWidth, height: item.dimensionsHeight, durationSec: item.videoDuration });\n if (children.length) {\n for (const c of children) {\n add({ url: c.displayUrl, kind: 'image', role: 'slide', width: c.dimensionsWidth, height: c.dimensionsHeight });\n add({ url: c.videoUrl, kind: 'video', role: 'slide', width: c.dimensionsWidth, height: c.dimensionsHeight, durationSec: c.videoDuration });\n }\n } else {\n for (const u of slideImages) add({ url: u, kind: 'image', role: 'slide' });\n }\n const author = item.ownerUsername || item.ownerFullName || undefined;\n read = {\n canonicalUrl: isUrl(item.url) ? item.url : undefined,\n title: firstLine(item.caption)?.slice(0, 120),\n author,\n authorUrl: item.ownerUsername ? `https://www.instagram.com/${item.ownerUsername}/` : undefined,\n text: typeof item.caption === 'string' && item.caption.trim() ? item.caption : undefined,\n publishedAt: typeof item.timestamp === 'string' ? item.timestamp : undefined,\n fields: { platform, likes: num(item.likesCount), comments: num(item.commentsCount), views: num(item.videoViewCount) ?? num(item.videoPlayCount) },\n };\n} else {\n // clockworks~tiktok-scraper's dataset: text, createTimeISO, webVideoUrl (the\n // post page), authorMeta { name, profileUrl }, videoMeta { coverUrl,\n // downloadAddr, width, height, duration }, mediaUrls (stored video files,\n // when the actor downloads them), diggCount, commentCount, playCount.\n const meta = item.videoMeta && typeof item.videoMeta === 'object' ? item.videoMeta : {};\n add({ url: meta.coverUrl ?? meta.originalCoverUrl, kind: 'image', role: 'cover', width: meta.width, height: meta.height });\n const videoFile = (Array.isArray(item.mediaUrls) ? item.mediaUrls.find(isUrl) : undefined) ?? meta.downloadAddr;\n add({ url: videoFile, kind: 'video', width: meta.width, height: meta.height, durationSec: meta.duration });\n const am = item.authorMeta && typeof item.authorMeta === 'object' ? item.authorMeta : {};\n read = {\n canonicalUrl: isUrl(item.webVideoUrl) ? item.webVideoUrl : undefined,\n title: firstLine(item.text)?.slice(0, 120),\n author: am.name || am.nickName || undefined,\n authorUrl: isUrl(am.profileUrl) ? am.profileUrl : am.name ? `https://www.tiktok.com/@${am.name}` : undefined,\n text: typeof item.text === 'string' && item.text.trim() ? item.text : undefined,\n publishedAt: typeof item.createTimeISO === 'string' ? item.createTimeISO : undefined,\n fields: { platform, likes: num(item.diggCount), comments: num(item.commentCount), views: num(item.playCount) },\n };\n}\nfor (const k of Object.keys(read.fields)) if (read.fields[k] === undefined) delete read.fields[k];\nfor (const k of Object.keys(read)) if (read[k] === undefined) delete read[k];\nreturn { status: 'ok', sourceUrl: url, ...read, media: media.slice(0, 12) };",
|
|
240
|
-
"metadata": {
|
|
241
|
-
"readOnly": true
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
"name": "apify_linkedin_profile",
|
|
246
|
-
"intent": "enrich_entity",
|
|
247
|
-
"kind": "code",
|
|
248
|
-
"scope": "pod",
|
|
249
|
-
"category": "enrichment",
|
|
250
|
-
"description": "Enriches ONE person from a PUBLIC LinkedIn profile URL via the Apify actor curious_coder/linkedin-profile-scraper, and returns normalized fields { jobTitle, city, country, bio, company, email, phone, website } where the actor provides them (billed external run). Also returns scrapedName (the profile's full name) SEPARATELY at the top level — NOT mapped into properties, since the name is the entity title, not a person property. Read-only for the pod — returns data; the caller decides whether to write it (mirrors the CRM's useEnrich enrichLinkedIn). Args: { url: string (a linkedin.com/in/ profile URL) }.",
|
|
251
|
-
"requires": [
|
|
252
|
-
"apify_api"
|
|
253
|
-
],
|
|
254
|
-
"executionMode": "async",
|
|
255
|
-
"timeoutSeconds": 120,
|
|
256
|
-
"parameters": {
|
|
257
|
-
"url": "string"
|
|
258
|
-
},
|
|
259
|
-
"code": "// Enrich a person from a public LinkedIn profile URL via an Apify actor's\n// synchronous run. Executor wraps this body as (async (args, context) => { <code> });\n// use args directly and `return`. callProvider(tool, method, path, body?) resolves\n// the apify_api tool by NAME, injects the vaulted token as Authorization: Bearer\n// <token>, and uses config.baseUrl = https://api.apify.com/v2. Apify actor ids\n// with a '/' use '~' in the URL path (owner~actor-name). Field map is DEFENSIVE:\n// the actor (curious_coder/linkedin-profile-scraper) output shape drifts across\n// runs/plans, so each field tries its most likely key(s) and is skipped (never\n// thrown) when absent. Confirmed actor keys: headline/jobTitle, occupation,\n// summary, geoLocationName/geoCountryName, companyName, positions[0].companyName,\n// firstName/lastName, publicIdentifier, pictureUrl. email/phone only appear when\n// the actor's findContacts option is enabled (not set here) — mapped defensively\n// in case a future run includes them.\nconst url = String(args?.url ?? '').trim();\nif (!url) throw new Error('apify_linkedin_profile: url is required (a public linkedin.com/in/ profile URL)');\nif (!/linkedin\\.com\\/in\\//i.test(url)) throw new Error('apify_linkedin_profile: url must be a linkedin.com/in/ profile URL');\n\nconst actorId = 'curious_coder~linkedin-profile-scraper';\nconst input = { profileUrls: [{ url }], maxResults: 1 };\n\nconst res = await callProvider('apify_api', 'POST', `/actors/${actorId}/run-sync-get-dataset-items`, input);\nif (res?.proposed === true) {\n return { success: false, proposed: true, proposalId: res?.proposalId ?? null, url };\n}\nconst payload = res?.body ?? res;\nconst items = Array.isArray(payload) ? payload : [];\nconst data = items[0];\nif (!data) throw new Error('apify_linkedin_profile: no data returned — the profile may be private, region-locked, or the URL malformed');\n\nconst mapped = {};\nif (data.jobTitle) mapped.jobTitle = data.jobTitle;\nelse if (data.headline) mapped.jobTitle = data.headline;\nelse if (data.occupation) mapped.jobTitle = data.occupation;\n\nif (typeof data.location === 'string' && data.location) mapped.city = data.location;\nelse if (data.location?.city) mapped.city = data.location.city;\nelse if (data.geoLocationName) mapped.city = data.geoLocationName;\n\nif (typeof data.location === 'object' && data.location?.country) mapped.country = data.location.country;\nelse if (data.geoCountryName) mapped.country = data.geoCountryName;\nelse if (data.countryCode) mapped.country = data.countryCode;\n\nif (data.summary) mapped.bio = data.summary;\nelse if (data.about) mapped.bio = data.about;\n\nconst company = data.companyName\n ?? (Array.isArray(data.experiences) ? data.experiences[0]?.company : undefined)\n ?? (Array.isArray(data.positions) ? data.positions[0]?.companyName : undefined);\nif (company) mapped.company = company;\n\nif (data.email) mapped.email = data.email;\nelse if (data.emailAddress) mapped.email = data.emailAddress;\nelse if (data.contactInfo?.email) mapped.email = data.contactInfo.email;\n\nif (data.phone) mapped.phone = data.phone;\nelse if (Array.isArray(data.phoneNumbers) && data.phoneNumbers[0]) mapped.phone = data.phoneNumbers[0];\nelse if (data.contactInfo?.phone) mapped.phone = data.contactInfo.phone;\n\nconst website = data.website\n ?? data.personalWebsite\n ?? (Array.isArray(data.contactInfo?.websites) ? data.contactInfo.websites[0] : undefined);\nif (website) mapped.website = website;\n\nconst joinedName = [data.firstName, data.lastName].filter(Boolean).join(' ').trim();\nconst scrapedName = data.fullName || joinedName || undefined;\n\nreturn { matched: Object.keys(mapped).length > 0, fields: Object.keys(mapped).length, url, scrapedName, ...mapped };"
|
|
260
214
|
}
|
|
261
215
|
],
|
|
262
216
|
"provides": [
|
|
263
217
|
"search_external",
|
|
264
218
|
"fetch_record",
|
|
265
219
|
"run_external_job",
|
|
266
|
-
"list_records"
|
|
267
|
-
"read_webpage",
|
|
268
|
-
"enrich_entity"
|
|
220
|
+
"list_records"
|
|
269
221
|
]
|
|
270
222
|
},
|
|
271
223
|
"dependencies": []
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiVersion": "synap/v1",
|
|
3
|
+
"kind": "capability",
|
|
4
|
+
"meta": {
|
|
5
|
+
"slug": "github-issues",
|
|
6
|
+
"name": "GitHub Issues",
|
|
7
|
+
"description": "GitHub Issues capability",
|
|
8
|
+
"tags": [
|
|
9
|
+
"capability"
|
|
10
|
+
],
|
|
11
|
+
"isPublic": true,
|
|
12
|
+
"syncByDefault": true
|
|
13
|
+
},
|
|
14
|
+
"spec": {
|
|
15
|
+
"key": "github-issues",
|
|
16
|
+
"name": "GitHub Issues",
|
|
17
|
+
"description": "GitHub Issues capability",
|
|
18
|
+
"params": [
|
|
19
|
+
{
|
|
20
|
+
"name": "github-issuesApiKey",
|
|
21
|
+
"label": "GitHub Issues API Key",
|
|
22
|
+
"type": "text",
|
|
23
|
+
"required": true,
|
|
24
|
+
"description": "The GitHub Issues API key. Stored server-encrypted in the vault; never persisted in the template.",
|
|
25
|
+
"obtain": {
|
|
26
|
+
"url": "https://example.com/dashboard/keys",
|
|
27
|
+
"steps": [
|
|
28
|
+
"Obtain your API key from the provider dashboard",
|
|
29
|
+
"Copy and paste it here"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"vault": [
|
|
35
|
+
{
|
|
36
|
+
"ref": "apiKeySecret",
|
|
37
|
+
"name": "{{name}} API key",
|
|
38
|
+
"value": "{{github-issuesApiKey}}",
|
|
39
|
+
"type": "api_key",
|
|
40
|
+
"description": "API key for the GitHub Issues connector."
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"tools": [
|
|
44
|
+
{
|
|
45
|
+
"name": "github-issues_api",
|
|
46
|
+
"kind": "api",
|
|
47
|
+
"description": "Authenticated HTTP access to the GitHub Issues API.",
|
|
48
|
+
"credentialRef": "apiKeySecret",
|
|
49
|
+
"executor": "is-agent",
|
|
50
|
+
"config": {
|
|
51
|
+
"baseUrl": "https://api.github.com",
|
|
52
|
+
"auth": {
|
|
53
|
+
"in": "header",
|
|
54
|
+
"name": "Authorization",
|
|
55
|
+
"prefix": "Bearer "
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"skills": [
|
|
61
|
+
{
|
|
62
|
+
"name": "github-issues_search",
|
|
63
|
+
"kind": "code",
|
|
64
|
+
"scope": "pod",
|
|
65
|
+
"requires": [
|
|
66
|
+
"github-issues_api"
|
|
67
|
+
],
|
|
68
|
+
"executionMode": "async",
|
|
69
|
+
"timeoutSeconds": 60,
|
|
70
|
+
"intent": "search_external",
|
|
71
|
+
"description": "Search searchs via the GithubIssues API and propose results as github-issues entities.",
|
|
72
|
+
"parameters": {
|
|
73
|
+
"query": "string",
|
|
74
|
+
"limit": "number?",
|
|
75
|
+
"page": "number?"
|
|
76
|
+
},
|
|
77
|
+
"code": "// Search skill — calls the API and proposes results as github-issues entities\nconst query = String(args?.query ?? '').trim();\nif (!query) throw new Error('query is required');\n\nconst limit = args?.limit ? Math.min(Number(args.limit), 100) : 20;\nconst page = args?.page ? Math.max(Number(args.page), 1) : 1;\nconst path = args?.path || '/search';\n\nconst payload = { q: query, per_page: limit, page };\n\nconst res = await callProvider('github-issues_api', 'GET', path, payload);\nconst ok = typeof res?.status === 'number' && res.status >= 200 && res.status < 300;\nconst body = res?.body ?? res;\nconst items = Array.isArray(body) ? body : (body?.items ?? body?.data ?? body?.results ?? []);\n\nif (!ok || items.length === 0) {\n return { success: false, message: 'No results found' };\n}\n\nconst proposed = [];\nfor (const item of items) {\n const r = await propose.entity({\n profileSlug: 'github-issues',\n title: String(item?.title ?? item?.name ?? item?.id ?? 'result'),\n properties: { ...item, externalId: String(item?.id ?? item?.externalId ?? '') },\n });\n proposed.push(r);\n}\n\nreturn { success: true, count: items.length, proposed };"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "github-issues_create",
|
|
81
|
+
"kind": "code",
|
|
82
|
+
"scope": "pod",
|
|
83
|
+
"requires": [
|
|
84
|
+
"github-issues_api"
|
|
85
|
+
],
|
|
86
|
+
"executionMode": "async",
|
|
87
|
+
"timeoutSeconds": 60,
|
|
88
|
+
"intent": "capture_into_pod",
|
|
89
|
+
"description": "Create a new create via the GithubIssues API and propose it as a github-issues entity.",
|
|
90
|
+
"parameters": {
|
|
91
|
+
"title": "string",
|
|
92
|
+
"properties": "object?",
|
|
93
|
+
"externalId": "string?"
|
|
94
|
+
},
|
|
95
|
+
"code": "// Create skill — POST to API and propose the created entity\nconst title = String(args?.title ?? '').trim();\nif (!title) throw new Error('title is required');\n\nconst path = args?.path || '/create';\nconst payload = { ...args };\ndelete payload.path;\ndelete payload.title;\n\nconst res = await callProvider('github-issues_api', 'POST', path, payload);\nconst ok = typeof res?.status === 'number' && res.status >= 200 && res.status < 300;\nconst body = res?.body ?? res;\n\nif (!ok) {\n throw new Error(`create failed (${res?.status ?? 'unknown'})`);\n}\n\nconst r = await propose.entity({\n profileSlug: 'github-issues',\n title,\n properties: { ...body, externalId: String(body?.id ?? body?.externalId ?? '') },\n});\n\nreturn { success: true, proposed: r };"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "github-issues_update",
|
|
99
|
+
"kind": "code",
|
|
100
|
+
"scope": "pod",
|
|
101
|
+
"requires": [
|
|
102
|
+
"github-issues_api"
|
|
103
|
+
],
|
|
104
|
+
"executionMode": "async",
|
|
105
|
+
"timeoutSeconds": 60,
|
|
106
|
+
"intent": "manage_file",
|
|
107
|
+
"description": "Update an existing update via the GithubIssues API.",
|
|
108
|
+
"parameters": {
|
|
109
|
+
"externalId": "string",
|
|
110
|
+
"title": "string?",
|
|
111
|
+
"properties": "object?",
|
|
112
|
+
"status": "string?"
|
|
113
|
+
},
|
|
114
|
+
"code": "// Update skill — PATCH/PUT to API\nconst externalId = String(args?.externalId ?? '').trim();\nif (!externalId) throw new Error('externalId is required');\n\nconst path = args?.path || `/${externalId}`;\nconst payload = { ...args };\ndelete payload.path;\ndelete payload.externalId;\n\nconst res = await callProvider('github-issues_api', 'PATCH', path, payload);\nconst ok = typeof res?.status === 'number' && res.status >= 200 && res.status < 300;\nconst body = res?.body ?? res;\n\nif (!ok) {\n throw new Error(`update failed (${res?.status ?? 'unknown'})`);\n}\n\nconst r = await propose.entity({\n profileSlug: 'github-issues',\n title: String(body?.title ?? body?.name ?? externalId),\n properties: { ...body, externalId },\n});\n\nreturn { success: true, proposed: r };"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "github-issues_delete",
|
|
118
|
+
"kind": "code",
|
|
119
|
+
"scope": "pod",
|
|
120
|
+
"requires": [
|
|
121
|
+
"github-issues_api"
|
|
122
|
+
],
|
|
123
|
+
"executionMode": "async",
|
|
124
|
+
"timeoutSeconds": 60,
|
|
125
|
+
"intent": "manage_file",
|
|
126
|
+
"description": "Delete a delete via the GithubIssues API.",
|
|
127
|
+
"parameters": {
|
|
128
|
+
"externalId": "string"
|
|
129
|
+
},
|
|
130
|
+
"code": "// Delete skill — DELETE from API\nconst externalId = String(args?.externalId ?? '').trim();\nif (!externalId) throw new Error('externalId is required');\n\nconst path = args?.path || `/${externalId}`;\n\nconst res = await callProvider('github-issues_api', 'DELETE', path);\nconst ok = typeof res?.status === 'number' && res.status >= 200 && res.status < 300;\n\nif (!ok) {\n throw new Error(`delete failed (${res?.status ?? 'unknown'})`);\n}\n\nreturn { success: true, deleted: externalId };"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "github-issues_list",
|
|
134
|
+
"kind": "code",
|
|
135
|
+
"scope": "pod",
|
|
136
|
+
"requires": [
|
|
137
|
+
"github-issues_api"
|
|
138
|
+
],
|
|
139
|
+
"executionMode": "async",
|
|
140
|
+
"timeoutSeconds": 60,
|
|
141
|
+
"intent": "list_records",
|
|
142
|
+
"description": "List lists via the GithubIssues API.",
|
|
143
|
+
"parameters": {
|
|
144
|
+
"limit": "number?",
|
|
145
|
+
"page": "number?",
|
|
146
|
+
"status": "string?"
|
|
147
|
+
},
|
|
148
|
+
"code": "// List skill — GET list from API\nconst limit = args?.limit ? Math.min(Number(args.limit), 100) : 20;\nconst page = args?.page ? Math.max(Number(args.page), 1) : 1;\nconst status = args?.status ? String(args.status).trim() : '';\nconst path = args?.path || '/list';\n\nconst payload = { per_page: limit, page };\nif (status) payload.status = status;\n\nconst res = await callProvider('github-issues_api', 'GET', path, payload);\nconst ok = typeof res?.status === 'number' && res.status >= 200 && res.status < 300;\nconst body = res?.body ?? res;\nconst items = Array.isArray(body) ? body : (body?.items ?? body?.data ?? body?.results ?? []);\n\nif (!ok) {\n return { success: false, message: 'List request failed' };\n}\n\nreturn { success: true, count: items.length, items };"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "github-issues_get",
|
|
152
|
+
"kind": "code",
|
|
153
|
+
"scope": "pod",
|
|
154
|
+
"requires": [
|
|
155
|
+
"github-issues_api"
|
|
156
|
+
],
|
|
157
|
+
"executionMode": "async",
|
|
158
|
+
"timeoutSeconds": 60,
|
|
159
|
+
"intent": "fetch_record",
|
|
160
|
+
"description": "Get a single get by external ID via the GithubIssues API.",
|
|
161
|
+
"parameters": {
|
|
162
|
+
"externalId": "string"
|
|
163
|
+
},
|
|
164
|
+
"code": "// Get skill — GET single entity by external ID\nconst externalId = String(args?.externalId ?? '').trim();\nif (!externalId) throw new Error('externalId is required');\n\nconst path = args?.path || `/${externalId}`;\n\nconst res = await callProvider('github-issues_api', 'GET', path);\nconst ok = typeof res?.status === 'number' && res.status >= 200 && res.status < 300;\nconst body = res?.body ?? res;\n\nif (!ok || !body) {\n return { success: false, message: 'Not found' };\n}\n\nconst r = await propose.entity({\n profileSlug: 'github-issues',\n title: String(body?.title ?? body?.name ?? externalId),\n properties: { ...body, externalId },\n});\n\nreturn { success: true, proposed: r };"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"provides": [
|
|
168
|
+
"search_external",
|
|
169
|
+
"capture_into_pod",
|
|
170
|
+
"manage_file",
|
|
171
|
+
"list_records",
|
|
172
|
+
"fetch_record"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"dependencies": []
|
|
176
|
+
}
|