@agent-facets/core 0.1.3 → 0.2.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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @agent-facets/core
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#35](https://github.com/agent-facets/facets/pull/35) [`6350718`](https://github.com/agent-facets/facets/commit/63507188f1bb3a7276cd4812f69f7d16d1778fd6) Thanks [@eXamadeus](https://github.com/eXamadeus)! - Ensure proper release isolation
8
+
9
+ ### Patch Changes
10
+
11
+ - [#33](https://github.com/agent-facets/facets/pull/33) [`540e126`](https://github.com/agent-facets/facets/commit/540e126e677de98a9b3d4e39542df37de8756b73) Thanks [@eXamadeus](https://github.com/eXamadeus)! - Ensure CI runs tests before release and notify Slack when failures occur.
12
+
3
13
  ## 0.1.3
4
14
 
5
15
  ### Patch Changes
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://github.com/agent-facets/facets",
6
6
  "directory": "packages/core"
7
7
  },
8
- "version": "0.1.3",
8
+ "version": "0.2.0",
9
9
  "type": "module",
10
10
  "exports": {
11
11
  ".": "./src/index.ts"
@@ -2,6 +2,7 @@ import { afterAll, beforeAll, describe, expect, test } from 'bun:test'
2
2
  import { mkdtemp, rm } from 'node:fs/promises'
3
3
  import { tmpdir } from 'node:os'
4
4
  import { join } from 'node:path'
5
+ import dedent from 'dedent'
5
6
  import { detectNamingCollisions } from '../build/detect-collisions.ts'
6
7
  import { runBuildPipeline } from '../build/pipeline.ts'
7
8
  import { validateCompactFacets } from '../build/validate-facets.ts'
@@ -358,7 +359,14 @@ describe('content validation', () => {
358
359
  const dir = await createFixtureDir('front-matter')
359
360
  await Bun.write(
360
361
  join(dir, 'skills/review/SKILL.md'),
361
- '---\nname: Review\ndescription: A review skill\n---\n# Review\nReview all code.',
362
+ dedent`
363
+ ---
364
+ name: Review
365
+ description: A review skill
366
+ ---
367
+ # Review
368
+ Review all code.
369
+ `,
362
370
  )
363
371
  await Bun.write(
364
372
  join(dir, 'facet.json'),
@@ -2,6 +2,7 @@ import { afterAll, beforeAll, describe, expect, test } from 'bun:test'
2
2
  import { mkdtemp, rm } from 'node:fs/promises'
3
3
  import { tmpdir } from 'node:os'
4
4
  import { join } from 'node:path'
5
+ import dedent from 'dedent'
5
6
  import { loadManifest, resolvePrompts } from '../loaders/facet.ts'
6
7
 
7
8
  let testDir: string
@@ -174,9 +175,30 @@ describe('loadManifest', () => {
174
175
  describe('resolvePrompts', () => {
175
176
  test('prompt content is resolved from conventional file paths', async () => {
176
177
  const dir = await createFixtureDir('resolve-convention')
177
- await writeFixture(dir, 'skills/review/SKILL.md', '# Code Review\nReview all code.')
178
- await writeFixture(dir, 'agents/reviewer.md', '# Reviewer\nReview this code.')
179
- await writeFixture(dir, 'commands/deploy.md', '# Deploy\nDeploy the code.')
178
+ await writeFixture(
179
+ dir,
180
+ 'skills/review/SKILL.md',
181
+ dedent`
182
+ # Code Review
183
+ Review all code.
184
+ `,
185
+ )
186
+ await writeFixture(
187
+ dir,
188
+ 'agents/reviewer.md',
189
+ dedent`
190
+ # Reviewer
191
+ Review this code.
192
+ `,
193
+ )
194
+ await writeFixture(
195
+ dir,
196
+ 'commands/deploy.md',
197
+ dedent`
198
+ # Deploy
199
+ Deploy the code.
200
+ `,
201
+ )
180
202
 
181
203
  const manifest = {
182
204
  name: 'test',
@@ -195,15 +217,31 @@ describe('resolvePrompts', () => {
195
217
  const result = await resolvePrompts(manifest, dir)
196
218
  expect(result.ok).toBe(true)
197
219
  if (result.ok) {
198
- expect(result.data.skills?.review?.prompt).toBe('# Code Review\nReview all code.')
199
- expect(result.data.agents?.reviewer?.prompt).toBe('# Reviewer\nReview this code.')
200
- expect(result.data.commands?.deploy?.prompt).toBe('# Deploy\nDeploy the code.')
220
+ expect(result.data.skills?.review?.prompt).toBe(dedent`
221
+ # Code Review
222
+ Review all code.
223
+ `)
224
+ expect(result.data.agents?.reviewer?.prompt).toBe(dedent`
225
+ # Reviewer
226
+ Review this code.
227
+ `)
228
+ expect(result.data.commands?.deploy?.prompt).toBe(dedent`
229
+ # Deploy
230
+ Deploy the code.
231
+ `)
201
232
  }
202
233
  })
203
234
 
204
235
  test('file-based prompt is resolved from agents/<name>.md', async () => {
205
236
  const dir = await createFixtureDir('resolve-file')
206
- await writeFixture(dir, 'agents/reviewer.md', '# Review\nCheck all code.')
237
+ await writeFixture(
238
+ dir,
239
+ 'agents/reviewer.md',
240
+ dedent`
241
+ # Review
242
+ Check all code.
243
+ `,
244
+ )
207
245
 
208
246
  const manifest = {
209
247
  name: 'test',
@@ -216,7 +254,10 @@ describe('resolvePrompts', () => {
216
254
  const result = await resolvePrompts(manifest, dir)
217
255
  expect(result.ok).toBe(true)
218
256
  if (result.ok) {
219
- expect(result.data.agents?.reviewer?.prompt).toBe('# Review\nCheck all code.')
257
+ expect(result.data.agents?.reviewer?.prompt).toBe(dedent`
258
+ # Review
259
+ Check all code.
260
+ `)
220
261
  }
221
262
  })
222
263
 
@@ -242,7 +283,14 @@ describe('resolvePrompts', () => {
242
283
 
243
284
  test('manifest without agents or commands resolves successfully', async () => {
244
285
  const dir = await createFixtureDir('resolve-skills-only')
245
- await writeFixture(dir, 'skills/x/SKILL.md', '# Skill X\nDo x.')
286
+ await writeFixture(
287
+ dir,
288
+ 'skills/x/SKILL.md',
289
+ dedent`
290
+ # Skill X
291
+ Do x.
292
+ `,
293
+ )
246
294
 
247
295
  const manifest = {
248
296
  name: 'test',
@@ -258,7 +306,10 @@ describe('resolvePrompts', () => {
258
306
  expect(result.ok).toBe(true)
259
307
  if (result.ok) {
260
308
  expect(result.data.name).toBe('test')
261
- expect(result.data.skills?.x?.prompt).toBe('# Skill X\nDo x.')
309
+ expect(result.data.skills?.x?.prompt).toBe(dedent`
310
+ # Skill X
311
+ Do x.
312
+ `)
262
313
  }
263
314
  })
264
315
  })