forked from retoor/devplacepy
Continuous Delivery could never be turned off once a crop was planted. Add a one-shot per-plot "stop after harvest" flag (POST /game/plot/stop, Devii tool game_plot_stop, game_plots.stop_after_harvest), cleared by the next plant, autoreplant claim or Refactor. Autoreplant now also respects crop locks through the shared _crop_lock predicate. Plan and measurements in happyplanting.md. Also includes the pending community sync, node network and related work in the tree; the full suite passed (4999) with all of it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
114 lines
3.1 KiB
JavaScript
114 lines
3.1 KiB
JavaScript
export const PROTOCOL_VERSION = 1;
|
|
export const MIN_SUPPORTED_PROTOCOL = 1;
|
|
export const CLIENT_KIND = "extension";
|
|
export const MODE_FETCH = "fetch";
|
|
|
|
export const ALLOWED_PORTS = Object.freeze([80, 443]);
|
|
export const HTTPS_PORT = 443;
|
|
|
|
export const CLOSE_NORMAL = 1000;
|
|
export const CLOSE_PROTOCOL = 4400;
|
|
export const CLOSE_RETRY_OWNER = 4013;
|
|
export const CLOSE_CAPACITY = 4029;
|
|
export const CLOSE_KICKED = 4403;
|
|
export const CLOSE_POLICY = 1008;
|
|
|
|
export const MAX_REDIRECTS = 5;
|
|
export const MAX_RESPONSE_HEADERS = 64;
|
|
export const MAX_HEADER_VALUE_CHARS = 512;
|
|
export const MAX_BODY_CHUNKS = 65536;
|
|
export const MAX_BACKOFF_EXPONENT = 16;
|
|
|
|
export const LIMITS = Object.freeze({
|
|
max_frame_bytes: 256 * 1024,
|
|
max_body_bytes: 2 * 1024 * 1024,
|
|
max_concurrent_per_node: 2,
|
|
job_timeout_seconds: 25,
|
|
default_donor_mb_per_day: 500,
|
|
max_donor_mb_per_day: 20 * 1024,
|
|
ping_seconds: 20,
|
|
reconnect_min_seconds: 1,
|
|
reconnect_max_seconds: 60,
|
|
url_max_chars: 2048,
|
|
});
|
|
|
|
export const FRAME_CEILING_BYTES = Object.freeze({
|
|
job_result: 3 * 1024 * 1024,
|
|
default: 256 * 1024,
|
|
});
|
|
|
|
export const DESTINATIONS = Object.freeze([
|
|
Object.freeze({
|
|
suffix: "reddit.com",
|
|
adapter: "reddit",
|
|
methods: Object.freeze(["GET"]),
|
|
ports: Object.freeze([80, 443]),
|
|
modes: Object.freeze(["tunnel", "fetch"]),
|
|
max_rps: 0.5,
|
|
}),
|
|
Object.freeze({
|
|
suffix: "redd.it",
|
|
adapter: "reddit",
|
|
methods: Object.freeze(["GET"]),
|
|
ports: Object.freeze([80, 443]),
|
|
modes: Object.freeze(["tunnel", "fetch"]),
|
|
max_rps: 0.5,
|
|
}),
|
|
]);
|
|
|
|
export const REFUSALS = Object.freeze({
|
|
HOST_NOT_ALLOWED: "host_not_allowed",
|
|
PORT_NOT_ALLOWED: "port_not_allowed",
|
|
ADDRESS_NOT_PUBLIC: "address_not_public",
|
|
REDIRECT_NOT_ALLOWED: "redirect_not_allowed",
|
|
METHOD_NOT_ALLOWED: "method_not_allowed",
|
|
BANDWIDTH_EXHAUSTED: "bandwidth_exhausted",
|
|
CONCURRENCY_EXCEEDED: "concurrency_exceeded",
|
|
OUTSIDE_HOURS: "outside_hours",
|
|
ON_BATTERY: "on_battery",
|
|
BODY_TOO_LARGE: "body_too_large",
|
|
TIMEOUT: "timeout",
|
|
});
|
|
|
|
export const SUSPENSION = Object.freeze({
|
|
reason: "suspended",
|
|
min_seconds: 60,
|
|
max_seconds: 24 * 60 * 60,
|
|
default_seconds: 300,
|
|
jitter_seconds: 30,
|
|
});
|
|
|
|
export const FETCH_FAILED = "fetch_failed";
|
|
|
|
export const SERVER_FRAMES = Object.freeze({
|
|
welcome: Object.freeze({
|
|
device_uid: "string",
|
|
limits: "object",
|
|
destinations: "array",
|
|
settings: "object",
|
|
}),
|
|
ping: Object.freeze({}),
|
|
job: Object.freeze({
|
|
job_id: "string",
|
|
method: "string",
|
|
url: "string",
|
|
timeout: "number",
|
|
}),
|
|
tunnel_open: Object.freeze({ conn_id: "string", host: "string", port: "number" }),
|
|
tunnel_data: Object.freeze({ conn_id: "string", b64: "string" }),
|
|
tunnel_close: Object.freeze({ conn_id: "string" }),
|
|
settings_update: Object.freeze({ settings: "object" }),
|
|
kick: Object.freeze({ reason: "string" }),
|
|
});
|
|
|
|
export const DROPPED_RESPONSE_HEADERS = Object.freeze([
|
|
"set-cookie",
|
|
"set-cookie2",
|
|
"authorization",
|
|
"proxy-authenticate",
|
|
]);
|
|
|
|
export const FORWARDED_REQUEST_HEADERS = Object.freeze(["accept", "accept-language"]);
|
|
|
|
export const HALTING_CLOSE_REASONS_EXEMPT = Object.freeze(["ticket", "heartbeat", "error", "capacity"]);
|