@profullstack/agenticjobs 0.11.0 → 0.14.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 +136 -1
- package/dist/cli/args.js +4 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/index.js +227 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/jobfile.js +38 -2
- package/dist/cli/jobfile.js.map +1 -1
- package/dist/client/client.d.ts +157 -0
- package/dist/client/client.js +44 -0
- package/dist/client/client.js.map +1 -1
- package/dist/config.d.ts +35 -1
- package/dist/config.js +33 -1
- package/dist/config.js.map +1 -1
- package/dist/core/agentwriter.js +22 -5
- package/dist/core/agentwriter.js.map +1 -1
- package/dist/core/applications.js +1 -1
- package/dist/core/applications.js.map +1 -1
- package/dist/core/candidates.js +3 -5
- package/dist/core/candidates.js.map +1 -1
- package/dist/core/capacity.d.ts +1 -1
- package/dist/core/capacity.js +11 -19
- package/dist/core/capacity.js.map +1 -1
- package/dist/core/coinpay.d.ts +143 -0
- package/dist/core/coinpay.js +417 -0
- package/dist/core/coinpay.js.map +1 -0
- package/dist/core/import.js +19 -9
- package/dist/core/import.js.map +1 -1
- package/dist/core/inbox.d.ts +155 -0
- package/dist/core/inbox.js +353 -0
- package/dist/core/inbox.js.map +1 -0
- package/dist/core/invoices.d.ts +111 -0
- package/dist/core/invoices.js +292 -0
- package/dist/core/invoices.js.map +1 -0
- package/dist/core/jobs.d.ts +24 -6
- package/dist/core/jobs.js +116 -31
- package/dist/core/jobs.js.map +1 -1
- package/dist/core/mail.d.ts +16 -0
- package/dist/core/mail.js +22 -0
- package/dist/core/mail.js.map +1 -1
- package/dist/core/recommendations.d.ts +134 -0
- package/dist/core/recommendations.js +356 -0
- package/dist/core/recommendations.js.map +1 -0
- package/dist/core/updates.d.ts +15 -3
- package/dist/core/updates.js +58 -24
- package/dist/core/updates.js.map +1 -1
- package/dist/core/zip.js +29 -4
- package/dist/core/zip.js.map +1 -1
- package/dist/directory/federate.js +3 -1
- package/dist/directory/federate.js.map +1 -1
- package/dist/directory/fetch.d.ts +1 -1
- package/dist/markup/markdown.js +6 -2
- package/dist/markup/markdown.js.map +1 -1
- package/dist/markup/resume.js +18 -5
- package/dist/markup/resume.js.map +1 -1
- package/dist/mcp/tools.js +249 -7
- package/dist/mcp/tools.js.map +1 -1
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/instance.js +29 -0
- package/dist/schema/instance.js.map +1 -1
- package/dist/schema/job.d.ts +12 -0
- package/dist/schema/job.js +17 -3
- package/dist/schema/job.js.map +1 -1
- package/dist/schema/jsonld.js +7 -6
- package/dist/schema/jsonld.js.map +1 -1
- package/dist/schema/pay.d.ts +173 -0
- package/dist/schema/pay.js +668 -0
- package/dist/schema/pay.js.map +1 -0
- package/dist/server/app.d.ts +4 -3
- package/dist/server/app.js +10 -5
- package/dist/server/app.js.map +1 -1
- package/dist/server/deps.d.ts +5 -0
- package/dist/server/middleware.d.ts +11 -1
- package/dist/server/middleware.js +26 -3
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/routes/api.js +437 -7
- package/dist/server/routes/api.js.map +1 -1
- package/dist/server/routes/discovery.js +29 -8
- package/dist/server/routes/discovery.js.map +1 -1
- package/dist/server/routes/inbox.d.ts +9 -0
- package/dist/server/routes/inbox.js +223 -0
- package/dist/server/routes/inbox.js.map +1 -0
- package/dist/server/routes/openapi.js +260 -2
- package/dist/server/routes/openapi.js.map +1 -1
- package/dist/server/routes/pages.d.ts +22 -0
- package/dist/server/routes/pages.js +244 -19
- package/dist/server/routes/pages.js.map +1 -1
- package/dist/tui/views.js +9 -3
- package/dist/tui/views.js.map +1 -1
- package/dist/views/candidates.d.ts +7 -0
- package/dist/views/candidates.js +3 -2
- package/dist/views/candidates.js.map +1 -1
- package/dist/views/docs.js +10 -1
- package/dist/views/docs.js.map +1 -1
- package/dist/views/inbox.d.ts +90 -0
- package/dist/views/inbox.js +73 -0
- package/dist/views/inbox.js.map +1 -0
- package/dist/views/jobs.d.ts +25 -0
- package/dist/views/jobs.js +35 -12
- package/dist/views/jobs.js.map +1 -1
- package/dist/views/layout.d.ts +24 -0
- package/dist/views/layout.js +20 -2
- package/dist/views/layout.js.map +1 -1
- package/dist/views/me.d.ts +10 -3
- package/dist/views/me.js +3 -2
- package/dist/views/me.js.map +1 -1
- package/dist/views/post.d.ts +18 -0
- package/dist/views/post.js +39 -7
- package/dist/views/post.js.map +1 -1
- package/dist/views/recommendations.d.ts +43 -0
- package/dist/views/recommendations.js +26 -0
- package/dist/views/recommendations.js.map +1 -0
- package/dist/views/updates.d.ts +13 -0
- package/dist/views/updates.js +6 -5
- package/dist/views/updates.js.map +1 -1
- package/docs/openjob.md +63 -0
- package/migrations/0014_inbox_and_billing.sql +138 -0
- package/migrations/0015_pay_lines.sql +38 -0
- package/migrations/0016_recommendations.sql +65 -0
- package/package.json +1 -1
- package/web/public/app.css +192 -2
- package/web/public/sw.js +1 -1
package/dist/schema/jsonld.js
CHANGED
|
@@ -60,15 +60,16 @@ export function jobPostingJsonLd(job, origin) {
|
|
|
60
60
|
}
|
|
61
61
|
const salary = job.salary;
|
|
62
62
|
if (salary.min !== null || salary.max !== null) {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
// An absent endpoint is an open bound, not an exact salary. Keep it
|
|
64
|
+
// absent in both representations instead of copying the other endpoint.
|
|
65
|
+
const { min, max } = salary;
|
|
65
66
|
doc['baseSalary'] = {
|
|
66
67
|
'@type': 'MonetaryAmount',
|
|
67
68
|
currency: salary.currency.toUpperCase(),
|
|
68
69
|
value: {
|
|
69
70
|
'@type': 'QuantitativeValue',
|
|
70
|
-
minValue: min,
|
|
71
|
-
maxValue: max,
|
|
71
|
+
...(min !== null ? { minValue: min } : {}),
|
|
72
|
+
...(max !== null ? { maxValue: max } : {}),
|
|
72
73
|
unitText: salary.period.toUpperCase(),
|
|
73
74
|
},
|
|
74
75
|
};
|
|
@@ -77,8 +78,8 @@ export function jobPostingJsonLd(job, origin) {
|
|
|
77
78
|
currency: salary.currency.toUpperCase(),
|
|
78
79
|
value: {
|
|
79
80
|
'@type': 'QuantitativeValue',
|
|
80
|
-
minValue: Math.round(
|
|
81
|
-
maxValue: Math.round(
|
|
81
|
+
...(min !== null ? { minValue: Math.round(min * (PER_YEAR[salary.period] ?? 1)) } : {}),
|
|
82
|
+
...(max !== null ? { maxValue: Math.round(max * (PER_YEAR[salary.period] ?? 1)) } : {}),
|
|
82
83
|
unitText: 'YEAR',
|
|
83
84
|
},
|
|
84
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonld.js","sourceRoot":"","sources":["../../src/schema/jsonld.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAOvC,MAAM,UAAU,gBAAgB,CAAC,GAAQ,EAAE,MAAc;IACvD,MAAM,GAAG,GAAG,GAAG,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,GAAG,GAAqB;QAC5B,UAAU,EAAE,oBAAoB;QAChC,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,GAAG;QACV,GAAG;QACH,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,UAAU,EAAE,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,SAAS;QAC5C,cAAc,EAAE,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,OAAO;QACzD,kBAAkB,EAAE;YAClB,OAAO,EAAE,cAAc;YACvB,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI;YAClB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,C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b,CAAC;AAED,MAAM,UAAU,GAA2B;IACzC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,WAAW;IACxB,QAAQ,EAAE,YAAY;IACtB,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,WAAW;CACvB,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a listing pays, in the words people use to say it.
|
|
3
|
+
*
|
|
4
|
+
* A salary range per year was the whole vocabulary, and it described one
|
|
5
|
+
* kind of work. The listings this board is for pay per task, per pull
|
|
6
|
+
* request, per social post, a flat fee for a project, a share of revenue, or
|
|
7
|
+
* a bounty, in dollars or in a coin, settled over whatever rail the two sides
|
|
8
|
+
* agree on. ugig.net has carried that vocabulary for a year (`budget_type`,
|
|
9
|
+
* `budget_unit`, `payment_coin`) and this is the same model, so a gig there
|
|
10
|
+
* and a job here describe pay the same way and a shared package can lift it
|
|
11
|
+
* later without either side changing shape.
|
|
12
|
+
*
|
|
13
|
+
* Three ideas, kept apart on purpose:
|
|
14
|
+
*
|
|
15
|
+
* - A LINE is one price: an amount or range, what it is per, and what it
|
|
16
|
+
* is denominated in. A listing may carry several: "$0.25 per task" and
|
|
17
|
+
* "$0.25 per PR that fixes a bug" are two lines, not one with a note.
|
|
18
|
+
* - The DENOMINATION is what the number is written in: USD, EUR, or a
|
|
19
|
+
* ticker such as SOL. "$0.25 per task" is denominated in dollars even
|
|
20
|
+
* when it is paid in SOL.
|
|
21
|
+
* - The METHOD is the rail it is settled over: SOL, USDC, a bank transfer,
|
|
22
|
+
* PayPal, payroll. One per listing, separate from the price, because
|
|
23
|
+
* "$100 an hour paid in USDC" is one rate with a preference, not two
|
|
24
|
+
* rates - the number does not change because the rail did.
|
|
25
|
+
*
|
|
26
|
+
* Everything here is text in, text out. A person types "$0.25 per task", an
|
|
27
|
+
* agent sends the same string, the front matter of a job file carries it as a
|
|
28
|
+
* list, and the page prints it back. The structured form is what the API
|
|
29
|
+
* serves, but the string is what everybody writes, so the parser is the
|
|
30
|
+
* feature and the JSON is its shadow.
|
|
31
|
+
*
|
|
32
|
+
* No imports from the rest of the board: this file is meant to be lifted into
|
|
33
|
+
* a shared package with ugig.net and CoinPay behind it.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* The kinds of price. The same list ugig.net's `budget_type` carries, in the
|
|
37
|
+
* same spelling, so a value round-trips between the two boards untouched.
|
|
38
|
+
*
|
|
39
|
+
* hourly … yearly a rate per unit of time
|
|
40
|
+
* fixed a flat fee for the whole engagement
|
|
41
|
+
* per_task a price per task, the unit being "task"
|
|
42
|
+
* per_unit a price per anything else, named in `unit`
|
|
43
|
+
* revenue_share a percentage; min and max are percentages
|
|
44
|
+
* bounty a fixed payout for an accepted submission
|
|
45
|
+
*/
|
|
46
|
+
export declare const PAY_TYPES: readonly ["hourly", "daily", "weekly", "monthly", "yearly", "fixed", "per_task", "per_unit", "revenue_share", "bounty"];
|
|
47
|
+
export type PayType = (typeof PAY_TYPES)[number];
|
|
48
|
+
/**
|
|
49
|
+
* Coins a listing is commonly settled in. ugig.net's list, which is the set
|
|
50
|
+
* CoinPay can take payment in; Lightning and on-chain BTC are deliberately
|
|
51
|
+
* not on it because CoinPay cannot settle them. The method field is free
|
|
52
|
+
* text and accepts anything, so this list only drives the suggestions in a
|
|
53
|
+
* form and the upper-casing of a ticker somebody typed in lowercase.
|
|
54
|
+
*/
|
|
55
|
+
export declare const PAYMENT_COINS: readonly ["SOL", "ETH", "USDC", "USDT", "POL"];
|
|
56
|
+
/** Rails that are not coins, offered beside them in a form. */
|
|
57
|
+
export declare const PAYMENT_RAILS: readonly ["bank transfer", "PayPal", "payroll", "card", "invoice"];
|
|
58
|
+
export interface PayLine {
|
|
59
|
+
type: PayType;
|
|
60
|
+
/** Bottom of the range, or the only figure. Percent for revenue_share. */
|
|
61
|
+
min: number | null;
|
|
62
|
+
/** Top of the range. Null for a single figure or an open-ended floor. */
|
|
63
|
+
max: number | null;
|
|
64
|
+
/** What the figure is written in: an ISO code or a ticker. `%` for a share. */
|
|
65
|
+
currency: string;
|
|
66
|
+
/** For per_task and per_unit: what one of them is. Null otherwise. */
|
|
67
|
+
unit: string | null;
|
|
68
|
+
}
|
|
69
|
+
export interface Pay {
|
|
70
|
+
lines: PayLine[];
|
|
71
|
+
/** How it is settled: a coin such as SOL, or a rail such as "bank transfer". */
|
|
72
|
+
method: string | null;
|
|
73
|
+
/** Free text, "0.1% - 0.4%". Never parsed. */
|
|
74
|
+
equity: string | null;
|
|
75
|
+
/**
|
|
76
|
+
* The role pays nothing, and the employer is saying so. Distinct from an
|
|
77
|
+
* empty `lines`, which means nobody filled the field in.
|
|
78
|
+
*/
|
|
79
|
+
unpaid: boolean;
|
|
80
|
+
}
|
|
81
|
+
export declare const EMPTY_PAY: Pay;
|
|
82
|
+
/** The most lines a listing can carry. Past this it is a rate card, not a job. */
|
|
83
|
+
export declare const PAY_LINES_MAX = 8;
|
|
84
|
+
/** The longest a per-unit description can be: "PR that fixes a bug you find". */
|
|
85
|
+
export declare const UNIT_MAX = 60;
|
|
86
|
+
export declare const METHOD_MAX = 40;
|
|
87
|
+
export declare const EQUITY_MAX = 60;
|
|
88
|
+
export declare const isFiat: (code: string) => boolean;
|
|
89
|
+
export declare const isKnownCurrency: (code: string) => boolean;
|
|
90
|
+
/** The period word for a time-based line, or null for every other kind. */
|
|
91
|
+
export declare function periodOf(type: PayType): 'hour' | 'day' | 'week' | 'month' | 'year' | null;
|
|
92
|
+
export declare function isPayType(value: unknown): value is PayType;
|
|
93
|
+
/** How a pay line is written, for every error message that has to explain it. */
|
|
94
|
+
export declare const PAY_LINE_EXAMPLES = "\"$0.25 per task\", \"$120k - $150k a year\", \"$100 an hour\", \"$5000 fixed\", \"0.01 SOL per PR that fixes a bug\", \"10% revenue share\"";
|
|
95
|
+
/**
|
|
96
|
+
* One pay line from the way a person wrote it.
|
|
97
|
+
*
|
|
98
|
+
* Returns the line, or a sentence saying what could not be read. A sentence
|
|
99
|
+
* rather than a throw, because the caller is a form or an API handler and
|
|
100
|
+
* the person has to be told which line and what it should look like.
|
|
101
|
+
*/
|
|
102
|
+
export declare function parsePayLine(input: unknown): PayLine | string;
|
|
103
|
+
/** The line and, when the text named one, the rail it is settled over. */
|
|
104
|
+
export declare function readPayLine(input: unknown): {
|
|
105
|
+
line: PayLine;
|
|
106
|
+
method: string | null;
|
|
107
|
+
} | string;
|
|
108
|
+
/** "$0.25", "$120k", "0.01 SOL", "CAD 1,000", "10%". */
|
|
109
|
+
export declare function formatAmount(amount: number, currency: string): string;
|
|
110
|
+
/**
|
|
111
|
+
* One line, the way it is printed everywhere: the badge on a card, the CLI,
|
|
112
|
+
* the TUI, a federated result. A single endpoint is a bound rather than a
|
|
113
|
+
* fixed figure, and is labelled as one.
|
|
114
|
+
*/
|
|
115
|
+
export declare function formatPayLine(line: PayLine): string;
|
|
116
|
+
/** Every line, or "Unpaid", or null when the listing says nothing about pay. */
|
|
117
|
+
export declare function formatPay(pay: Pay): string | null;
|
|
118
|
+
/** The first line only, for a badge with one line of room. */
|
|
119
|
+
export declare function formatPayShort(pay: Pay): string | null;
|
|
120
|
+
/** "Paid in SOL", "Paid by bank transfer". */
|
|
121
|
+
export declare function formatMethod(method: string | null): string | null;
|
|
122
|
+
/** Has the employer said what it pays? Unpaid counts: it is a statement. */
|
|
123
|
+
export declare function payStated(pay: Pay): boolean;
|
|
124
|
+
export interface SalaryLike {
|
|
125
|
+
min: number | null;
|
|
126
|
+
max: number | null;
|
|
127
|
+
currency: string;
|
|
128
|
+
period: string;
|
|
129
|
+
equity?: string | null;
|
|
130
|
+
unpaid?: boolean;
|
|
131
|
+
}
|
|
132
|
+
/** A listing from a board that predates pay lines, read into the new shape. */
|
|
133
|
+
export declare function payFromSalary(salary: SalaryLike): Pay;
|
|
134
|
+
/**
|
|
135
|
+
* The time-based line a listing's `salary` columns carry, for search, sort
|
|
136
|
+
* and structured data - all of which compare on an annual basis and have no
|
|
137
|
+
* meaning for a price per task. The first time-based line wins; a listing
|
|
138
|
+
* with none has a null range, so it stays out of every salary filter.
|
|
139
|
+
*/
|
|
140
|
+
export declare function salaryFromPay(pay: Pay): {
|
|
141
|
+
min: number | null;
|
|
142
|
+
max: number | null;
|
|
143
|
+
currency: string;
|
|
144
|
+
period: 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
145
|
+
};
|
|
146
|
+
/** A ticker typed in any case comes out in capitals; a rail stays as typed. */
|
|
147
|
+
export declare function normaliseMethod(value: unknown): string | null;
|
|
148
|
+
/**
|
|
149
|
+
* Pay, from whatever a form, an API client or a model sent.
|
|
150
|
+
*
|
|
151
|
+
* `pay` may be a string (one line, or several separated by newlines), an
|
|
152
|
+
* array of strings or of line objects, or an object with `lines` and
|
|
153
|
+
* `method`. The old flat fields - salaryMin, salaryMax, salaryCurrency,
|
|
154
|
+
* salaryPeriod, salaryUnpaid, salaryEquity - still work and become one line,
|
|
155
|
+
* so a client written against 0.11 keeps posting listings.
|
|
156
|
+
*
|
|
157
|
+
* Returns the pay, or a sentence saying which line could not be read.
|
|
158
|
+
*/
|
|
159
|
+
export declare function normalisePay(input: Record<string, unknown>): Pay | string;
|
|
160
|
+
/**
|
|
161
|
+
* The pay of any listing, including one from a board that predates `pay`.
|
|
162
|
+
*
|
|
163
|
+
* Federated search puts listings from other instances on this board's pages,
|
|
164
|
+
* and an instance still on 0.11 serves a `salary` and no `pay`. Reading
|
|
165
|
+
* `job.pay` straight would throw on those, so every display path goes
|
|
166
|
+
* through here.
|
|
167
|
+
*/
|
|
168
|
+
export declare function payOfJob(job: {
|
|
169
|
+
pay?: Pay | null;
|
|
170
|
+
salary?: SalaryLike | null;
|
|
171
|
+
}): Pay;
|
|
172
|
+
/** The lines as the text a person would type, one per line. Round-trips through parsePayLine. */
|
|
173
|
+
export declare function payToText(pay: Pay): string;
|