Skip to content
← Public packages

@kody/doordash

Order food on DoorDash as a customer through the consumer MCP used by dd-cli.

src/adapt.ts

60 lines · 1.6 KB · TypeScript
import { accessTokenSetupUrl, CONSUMER_MCP_HOST, CLI_RELEASES_URL, WAITLIST_URL } from './mcp.ts'
import { readSettings } from './settings.ts'

export default async function adapt() {
	const settings = await readSettings()
	return {
		purpose:
			'Point this forked DoorDash consumer package at the forking user’s dd-cli access token, then publish.',
		ownerSettings: {
			accessToken: {
				secretName: 'doorDashCliAccessToken',
				setupUrl: accessTokenSetupUrl(),
				approveHost: CONSUMER_MCP_HOST,
			},
			defaultTipRule: {
				storageName: 'defaultTipRule',
				resolved: settings.defaultTipRule,
			},
		},
		steps: [
			{
				id: 'intent',
				title: 'Rewrite README ## Intent',
				detail: 'Describe the forking user’s DoorDash ordering use case.',
			},
			{
				id: 'waitlist',
				title: 'Get on the DoorDash CLI waitlist (if needed)',
				detail: WAITLIST_URL,
			},
			{
				id: 'token',
				title: 'Export and save an access token',
				detail:
					'On a machine with a browser: install dd-cli from ' +
					CLI_RELEASES_URL +
					', run `dd-cli login` then `dd-cli export-token`. Save the value at ' +
					accessTokenSetupUrl() +
					' and approve host ' +
					CONSUMER_MCP_HOST +
					'. Never paste the token in chat.',
			},
			{
				id: 'smoke',
				title: 'Run smoke-test',
				detail: 'import smokeTest from "kody:@you/doordash/smoke-test"; await smokeTest()',
			},
			{
				id: 'publish',
				title: 'Publish your fork',
				detail: 'Publish after README Intent matches this copy.',
			},
		],
		related: {
			drive: 'https://kody.codes/@kody/doordash-driver',
			cli: CLI_RELEASES_URL,
		},
		share: 'https://kody.codes/@kody/doordash',
	}
}